@ai-development-environment/server 0.0.104 → 0.0.105

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (205) hide show
  1. package/package.json +1 -1
  2. package/standalone/.next/BUILD_ID +1 -1
  3. package/standalone/.next/build-manifest.json +3 -3
  4. package/standalone/.next/prerender-manifest.json +3 -3
  5. package/standalone/.next/server/app/[locale]/(auth)/register/page.js.nft.json +1 -1
  6. package/standalone/.next/server/app/[locale]/(auth)/register/page_client-reference-manifest.js +1 -1
  7. package/standalone/.next/server/app/[locale]/(auth)/sign-in/page.js.nft.json +1 -1
  8. package/standalone/.next/server/app/[locale]/(auth)/sign-in/page_client-reference-manifest.js +1 -1
  9. package/standalone/.next/server/app/[locale]/(dashboard)/actions/page.js.nft.json +1 -1
  10. package/standalone/.next/server/app/[locale]/(dashboard)/actions/page_client-reference-manifest.js +1 -1
  11. package/standalone/.next/server/app/[locale]/(dashboard)/actions-cache/page.js.nft.json +1 -1
  12. package/standalone/.next/server/app/[locale]/(dashboard)/actions-cache/page_client-reference-manifest.js +1 -1
  13. package/standalone/.next/server/app/[locale]/(dashboard)/agents/[id]/page.js.nft.json +1 -1
  14. package/standalone/.next/server/app/[locale]/(dashboard)/agents/[id]/page_client-reference-manifest.js +1 -1
  15. package/standalone/.next/server/app/[locale]/(dashboard)/agents/page.js.nft.json +1 -1
  16. package/standalone/.next/server/app/[locale]/(dashboard)/agents/page_client-reference-manifest.js +1 -1
  17. package/standalone/.next/server/app/[locale]/(dashboard)/analytics-events/page.js.nft.json +1 -1
  18. package/standalone/.next/server/app/[locale]/(dashboard)/analytics-events/page_client-reference-manifest.js +1 -1
  19. package/standalone/.next/server/app/[locale]/(dashboard)/api-keys/page.js.nft.json +1 -1
  20. package/standalone/.next/server/app/[locale]/(dashboard)/api-keys/page_client-reference-manifest.js +1 -1
  21. package/standalone/.next/server/app/[locale]/(dashboard)/apps/[appId]/page.js.nft.json +1 -1
  22. package/standalone/.next/server/app/[locale]/(dashboard)/apps/[appId]/page_client-reference-manifest.js +1 -1
  23. package/standalone/.next/server/app/[locale]/(dashboard)/apps/page.js.nft.json +1 -1
  24. package/standalone/.next/server/app/[locale]/(dashboard)/apps/page_client-reference-manifest.js +1 -1
  25. package/standalone/.next/server/app/[locale]/(dashboard)/build-data/page.js.nft.json +1 -1
  26. package/standalone/.next/server/app/[locale]/(dashboard)/build-data/page_client-reference-manifest.js +1 -1
  27. package/standalone/.next/server/app/[locale]/(dashboard)/builds/[buildId]/coverage/page.js.nft.json +1 -1
  28. package/standalone/.next/server/app/[locale]/(dashboard)/builds/[buildId]/coverage/page_client-reference-manifest.js +1 -1
  29. package/standalone/.next/server/app/[locale]/(dashboard)/builds/[buildId]/page.js.nft.json +1 -1
  30. package/standalone/.next/server/app/[locale]/(dashboard)/builds/[buildId]/page_client-reference-manifest.js +1 -1
  31. package/standalone/.next/server/app/[locale]/(dashboard)/builds/page.js.nft.json +1 -1
  32. package/standalone/.next/server/app/[locale]/(dashboard)/builds/page_client-reference-manifest.js +1 -1
  33. package/standalone/.next/server/app/[locale]/(dashboard)/changes/page.js.nft.json +1 -1
  34. package/standalone/.next/server/app/[locale]/(dashboard)/changes/page_client-reference-manifest.js +1 -1
  35. package/standalone/.next/server/app/[locale]/(dashboard)/codebases/[codebaseId]/page.js.nft.json +1 -1
  36. package/standalone/.next/server/app/[locale]/(dashboard)/codebases/[codebaseId]/page_client-reference-manifest.js +1 -1
  37. package/standalone/.next/server/app/[locale]/(dashboard)/codebases/page.js.nft.json +1 -1
  38. package/standalone/.next/server/app/[locale]/(dashboard)/codebases/page_client-reference-manifest.js +1 -1
  39. package/standalone/.next/server/app/[locale]/(dashboard)/codebases/repositories/[repositoryId]/page.js.nft.json +1 -1
  40. package/standalone/.next/server/app/[locale]/(dashboard)/codebases/repositories/[repositoryId]/page_client-reference-manifest.js +1 -1
  41. package/standalone/.next/server/app/[locale]/(dashboard)/commands/[commandId]/edit/page.js.nft.json +1 -1
  42. package/standalone/.next/server/app/[locale]/(dashboard)/commands/[commandId]/edit/page_client-reference-manifest.js +1 -1
  43. package/standalone/.next/server/app/[locale]/(dashboard)/commands/new/page.js.nft.json +1 -1
  44. package/standalone/.next/server/app/[locale]/(dashboard)/commands/new/page_client-reference-manifest.js +1 -1
  45. package/standalone/.next/server/app/[locale]/(dashboard)/commands/page.js.nft.json +1 -1
  46. package/standalone/.next/server/app/[locale]/(dashboard)/commands/page_client-reference-manifest.js +1 -1
  47. package/standalone/.next/server/app/[locale]/(dashboard)/commands/runs/[runId]/page.js.nft.json +1 -1
  48. package/standalone/.next/server/app/[locale]/(dashboard)/commands/runs/[runId]/page_client-reference-manifest.js +1 -1
  49. package/standalone/.next/server/app/[locale]/(dashboard)/comments/page.js.nft.json +1 -1
  50. package/standalone/.next/server/app/[locale]/(dashboard)/comments/page_client-reference-manifest.js +1 -1
  51. package/standalone/.next/server/app/[locale]/(dashboard)/console-logs/page.js.nft.json +1 -1
  52. package/standalone/.next/server/app/[locale]/(dashboard)/console-logs/page_client-reference-manifest.js +1 -1
  53. package/standalone/.next/server/app/[locale]/(dashboard)/costs/page.js.nft.json +1 -1
  54. package/standalone/.next/server/app/[locale]/(dashboard)/costs/page_client-reference-manifest.js +1 -1
  55. package/standalone/.next/server/app/[locale]/(dashboard)/credentials/page.js.nft.json +1 -1
  56. package/standalone/.next/server/app/[locale]/(dashboard)/credentials/page_client-reference-manifest.js +1 -1
  57. package/standalone/.next/server/app/[locale]/(dashboard)/devices/[id]/page.js.nft.json +1 -1
  58. package/standalone/.next/server/app/[locale]/(dashboard)/devices/[id]/page_client-reference-manifest.js +1 -1
  59. package/standalone/.next/server/app/[locale]/(dashboard)/devices/enroll/page.js.nft.json +1 -1
  60. package/standalone/.next/server/app/[locale]/(dashboard)/devices/enroll/page_client-reference-manifest.js +1 -1
  61. package/standalone/.next/server/app/[locale]/(dashboard)/devices/page.js.nft.json +1 -1
  62. package/standalone/.next/server/app/[locale]/(dashboard)/devices/page_client-reference-manifest.js +1 -1
  63. package/standalone/.next/server/app/[locale]/(dashboard)/drafts/page.js.nft.json +1 -1
  64. package/standalone/.next/server/app/[locale]/(dashboard)/drafts/page_client-reference-manifest.js +1 -1
  65. package/standalone/.next/server/app/[locale]/(dashboard)/github-cache/entries/[id]/page.js.nft.json +1 -1
  66. package/standalone/.next/server/app/[locale]/(dashboard)/github-cache/entries/[id]/page_client-reference-manifest.js +1 -1
  67. package/standalone/.next/server/app/[locale]/(dashboard)/github-cache/page.js.nft.json +1 -1
  68. package/standalone/.next/server/app/[locale]/(dashboard)/github-cache/page_client-reference-manifest.js +1 -1
  69. package/standalone/.next/server/app/[locale]/(dashboard)/gitlab/cache/page.js.nft.json +1 -1
  70. package/standalone/.next/server/app/[locale]/(dashboard)/gitlab/cache/page_client-reference-manifest.js +1 -1
  71. package/standalone/.next/server/app/[locale]/(dashboard)/gitlab/comments/page.js.nft.json +1 -1
  72. package/standalone/.next/server/app/[locale]/(dashboard)/gitlab/comments/page_client-reference-manifest.js +1 -1
  73. package/standalone/.next/server/app/[locale]/(dashboard)/gitlab/merge-requests/[projectId]/[iid]/page.js.nft.json +1 -1
  74. package/standalone/.next/server/app/[locale]/(dashboard)/gitlab/merge-requests/[projectId]/[iid]/page_client-reference-manifest.js +1 -1
  75. package/standalone/.next/server/app/[locale]/(dashboard)/gitlab/merge-requests/page.js.nft.json +1 -1
  76. package/standalone/.next/server/app/[locale]/(dashboard)/gitlab/merge-requests/page_client-reference-manifest.js +1 -1
  77. package/standalone/.next/server/app/[locale]/(dashboard)/gitlab/pipelines/page.js.nft.json +1 -1
  78. package/standalone/.next/server/app/[locale]/(dashboard)/gitlab/pipelines/page_client-reference-manifest.js +1 -1
  79. package/standalone/.next/server/app/[locale]/(dashboard)/gitlab/webhooks/page.js.nft.json +1 -1
  80. package/standalone/.next/server/app/[locale]/(dashboard)/gitlab/webhooks/page_client-reference-manifest.js +1 -1
  81. package/standalone/.next/server/app/[locale]/(dashboard)/jira/tickets/[issueKey]/page.js.nft.json +1 -1
  82. package/standalone/.next/server/app/[locale]/(dashboard)/jira/tickets/[issueKey]/page_client-reference-manifest.js +1 -1
  83. package/standalone/.next/server/app/[locale]/(dashboard)/jira/tickets/page.js.nft.json +1 -1
  84. package/standalone/.next/server/app/[locale]/(dashboard)/jira/tickets/page_client-reference-manifest.js +1 -1
  85. package/standalone/.next/server/app/[locale]/(dashboard)/jira-cache/page.js.nft.json +1 -1
  86. package/standalone/.next/server/app/[locale]/(dashboard)/jira-cache/page_client-reference-manifest.js +1 -1
  87. package/standalone/.next/server/app/[locale]/(dashboard)/jira-cache/tickets/[issueKey]/page.js.nft.json +1 -1
  88. package/standalone/.next/server/app/[locale]/(dashboard)/jira-cache/tickets/[issueKey]/page_client-reference-manifest.js +1 -1
  89. package/standalone/.next/server/app/[locale]/(dashboard)/jira-webhooks/page.js.nft.json +1 -1
  90. package/standalone/.next/server/app/[locale]/(dashboard)/jira-webhooks/page_client-reference-manifest.js +1 -1
  91. package/standalone/.next/server/app/[locale]/(dashboard)/jobs/[jobId]/page.js.nft.json +1 -1
  92. package/standalone/.next/server/app/[locale]/(dashboard)/jobs/[jobId]/page_client-reference-manifest.js +1 -1
  93. package/standalone/.next/server/app/[locale]/(dashboard)/notifications/page.js.nft.json +1 -1
  94. package/standalone/.next/server/app/[locale]/(dashboard)/notifications/page_client-reference-manifest.js +1 -1
  95. package/standalone/.next/server/app/[locale]/(dashboard)/page.js.nft.json +1 -1
  96. package/standalone/.next/server/app/[locale]/(dashboard)/page_client-reference-manifest.js +1 -1
  97. package/standalone/.next/server/app/[locale]/(dashboard)/plans/[runId]/page.js.nft.json +1 -1
  98. package/standalone/.next/server/app/[locale]/(dashboard)/plans/[runId]/page_client-reference-manifest.js +1 -1
  99. package/standalone/.next/server/app/[locale]/(dashboard)/plans/page.js.nft.json +1 -1
  100. package/standalone/.next/server/app/[locale]/(dashboard)/plans/page_client-reference-manifest.js +1 -1
  101. package/standalone/.next/server/app/[locale]/(dashboard)/polling/page.js.nft.json +1 -1
  102. package/standalone/.next/server/app/[locale]/(dashboard)/polling/page_client-reference-manifest.js +1 -1
  103. package/standalone/.next/server/app/[locale]/(dashboard)/prepare/page.js.nft.json +1 -1
  104. package/standalone/.next/server/app/[locale]/(dashboard)/prepare/page_client-reference-manifest.js +1 -1
  105. package/standalone/.next/server/app/[locale]/(dashboard)/provisioning-profiles/[profileId]/page.js.nft.json +1 -1
  106. package/standalone/.next/server/app/[locale]/(dashboard)/provisioning-profiles/[profileId]/page_client-reference-manifest.js +1 -1
  107. package/standalone/.next/server/app/[locale]/(dashboard)/provisioning-profiles/page.js.nft.json +1 -1
  108. package/standalone/.next/server/app/[locale]/(dashboard)/provisioning-profiles/page_client-reference-manifest.js +1 -1
  109. package/standalone/.next/server/app/[locale]/(dashboard)/pull-requests/[owner]/[repository]/[number]/page.js.nft.json +1 -1
  110. package/standalone/.next/server/app/[locale]/(dashboard)/pull-requests/[owner]/[repository]/[number]/page_client-reference-manifest.js +1 -1
  111. package/standalone/.next/server/app/[locale]/(dashboard)/pull-requests/page.js.nft.json +1 -1
  112. package/standalone/.next/server/app/[locale]/(dashboard)/pull-requests/page_client-reference-manifest.js +1 -1
  113. package/standalone/.next/server/app/[locale]/(dashboard)/push-notifications/page.js.nft.json +1 -1
  114. package/standalone/.next/server/app/[locale]/(dashboard)/push-notifications/page_client-reference-manifest.js +1 -1
  115. package/standalone/.next/server/app/[locale]/(dashboard)/runs/new/page.js.nft.json +1 -1
  116. package/standalone/.next/server/app/[locale]/(dashboard)/runs/new/page_client-reference-manifest.js +1 -1
  117. package/standalone/.next/server/app/[locale]/(dashboard)/sessions/[runId]/page.js.nft.json +1 -1
  118. package/standalone/.next/server/app/[locale]/(dashboard)/sessions/[runId]/page_client-reference-manifest.js +1 -1
  119. package/standalone/.next/server/app/[locale]/(dashboard)/sessions/page.js.nft.json +1 -1
  120. package/standalone/.next/server/app/[locale]/(dashboard)/sessions/page_client-reference-manifest.js +1 -1
  121. package/standalone/.next/server/app/[locale]/(dashboard)/settings/page.js.nft.json +1 -1
  122. package/standalone/.next/server/app/[locale]/(dashboard)/settings/page_client-reference-manifest.js +1 -1
  123. package/standalone/.next/server/app/[locale]/(dashboard)/skills/[skillId]/page.js.nft.json +1 -1
  124. package/standalone/.next/server/app/[locale]/(dashboard)/skills/[skillId]/page_client-reference-manifest.js +1 -1
  125. package/standalone/.next/server/app/[locale]/(dashboard)/skills/groups/[groupId]/page.js.nft.json +1 -1
  126. package/standalone/.next/server/app/[locale]/(dashboard)/skills/groups/[groupId]/page_client-reference-manifest.js +1 -1
  127. package/standalone/.next/server/app/[locale]/(dashboard)/skills/groups/page.js.nft.json +1 -1
  128. package/standalone/.next/server/app/[locale]/(dashboard)/skills/groups/page_client-reference-manifest.js +1 -1
  129. package/standalone/.next/server/app/[locale]/(dashboard)/skills/page.js.nft.json +1 -1
  130. package/standalone/.next/server/app/[locale]/(dashboard)/skills/page_client-reference-manifest.js +1 -1
  131. package/standalone/.next/server/app/[locale]/(dashboard)/skills/sync/[runId]/page.js.nft.json +1 -1
  132. package/standalone/.next/server/app/[locale]/(dashboard)/skills/sync/[runId]/page_client-reference-manifest.js +1 -1
  133. package/standalone/.next/server/app/[locale]/(dashboard)/sse/[endpointId]/mocks/page.js.nft.json +1 -1
  134. package/standalone/.next/server/app/[locale]/(dashboard)/sse/[endpointId]/mocks/page_client-reference-manifest.js +1 -1
  135. package/standalone/.next/server/app/[locale]/(dashboard)/sse/[endpointId]/page.js.nft.json +1 -1
  136. package/standalone/.next/server/app/[locale]/(dashboard)/sse/[endpointId]/page_client-reference-manifest.js +1 -1
  137. package/standalone/.next/server/app/[locale]/(dashboard)/sse/breakpoints/page.js.nft.json +1 -1
  138. package/standalone/.next/server/app/[locale]/(dashboard)/sse/breakpoints/page_client-reference-manifest.js +1 -1
  139. package/standalone/.next/server/app/[locale]/(dashboard)/sse/history/[requestId]/page.js.nft.json +1 -1
  140. package/standalone/.next/server/app/[locale]/(dashboard)/sse/history/[requestId]/page_client-reference-manifest.js +1 -1
  141. package/standalone/.next/server/app/[locale]/(dashboard)/sse/history/page.js.nft.json +1 -1
  142. package/standalone/.next/server/app/[locale]/(dashboard)/sse/history/page_client-reference-manifest.js +1 -1
  143. package/standalone/.next/server/app/[locale]/(dashboard)/sse/new/page.js.nft.json +1 -1
  144. package/standalone/.next/server/app/[locale]/(dashboard)/sse/new/page_client-reference-manifest.js +1 -1
  145. package/standalone/.next/server/app/[locale]/(dashboard)/sse/page.js.nft.json +1 -1
  146. package/standalone/.next/server/app/[locale]/(dashboard)/sse/page_client-reference-manifest.js +1 -1
  147. package/standalone/.next/server/app/[locale]/(dashboard)/sse/storage/page.js.nft.json +1 -1
  148. package/standalone/.next/server/app/[locale]/(dashboard)/sse/storage/page_client-reference-manifest.js +1 -1
  149. package/standalone/.next/server/app/[locale]/(dashboard)/status/page.js.nft.json +1 -1
  150. package/standalone/.next/server/app/[locale]/(dashboard)/status/page_client-reference-manifest.js +1 -1
  151. package/standalone/.next/server/app/[locale]/(dashboard)/tailscale/page.js.nft.json +1 -1
  152. package/standalone/.next/server/app/[locale]/(dashboard)/tailscale/page_client-reference-manifest.js +1 -1
  153. package/standalone/.next/server/app/[locale]/(dashboard)/tools/page.js.nft.json +1 -1
  154. package/standalone/.next/server/app/[locale]/(dashboard)/tools/page_client-reference-manifest.js +1 -1
  155. package/standalone/.next/server/app/[locale]/(dashboard)/unified-events/page.js.nft.json +1 -1
  156. package/standalone/.next/server/app/[locale]/(dashboard)/unified-events/page_client-reference-manifest.js +1 -1
  157. package/standalone/.next/server/app/[locale]/(dashboard)/usage/page.js.nft.json +1 -1
  158. package/standalone/.next/server/app/[locale]/(dashboard)/usage/page_client-reference-manifest.js +1 -1
  159. package/standalone/.next/server/app/[locale]/(dashboard)/users/page.js.nft.json +1 -1
  160. package/standalone/.next/server/app/[locale]/(dashboard)/users/page_client-reference-manifest.js +1 -1
  161. package/standalone/.next/server/app/[locale]/(dashboard)/webhooks/page.js.nft.json +1 -1
  162. package/standalone/.next/server/app/[locale]/(dashboard)/webhooks/page_client-reference-manifest.js +1 -1
  163. package/standalone/.next/server/app/[locale]/(dashboard)/workflows/[workflowId]/edit/page.js.nft.json +1 -1
  164. package/standalone/.next/server/app/[locale]/(dashboard)/workflows/[workflowId]/edit/page_client-reference-manifest.js +1 -1
  165. package/standalone/.next/server/app/[locale]/(dashboard)/workflows/[workflowId]/page.js.nft.json +1 -1
  166. package/standalone/.next/server/app/[locale]/(dashboard)/workflows/[workflowId]/page_client-reference-manifest.js +1 -1
  167. package/standalone/.next/server/app/[locale]/(dashboard)/workflows/new/page.js.nft.json +1 -1
  168. package/standalone/.next/server/app/[locale]/(dashboard)/workflows/new/page_client-reference-manifest.js +1 -1
  169. package/standalone/.next/server/app/[locale]/(dashboard)/workflows/page.js.nft.json +1 -1
  170. package/standalone/.next/server/app/[locale]/(dashboard)/workflows/page_client-reference-manifest.js +1 -1
  171. package/standalone/.next/server/app/[locale]/(dashboard)/workflows/runs/[runId]/page.js.nft.json +1 -1
  172. package/standalone/.next/server/app/[locale]/(dashboard)/workflows/runs/[runId]/page_client-reference-manifest.js +1 -1
  173. package/standalone/.next/server/app/[locale]/(dashboard)/worktrees/[worktreeId]/page.js.nft.json +1 -1
  174. package/standalone/.next/server/app/[locale]/(dashboard)/worktrees/[worktreeId]/page_client-reference-manifest.js +1 -1
  175. package/standalone/.next/server/app/[locale]/(dashboard)/worktrees/page.js.nft.json +1 -1
  176. package/standalone/.next/server/app/[locale]/(dashboard)/worktrees/page_client-reference-manifest.js +1 -1
  177. package/standalone/.next/server/app/_global-error.html +1 -1
  178. package/standalone/.next/server/app/_global-error.rsc +1 -1
  179. package/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  180. package/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  181. package/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  182. package/standalone/.next/server/app/_not-found.html +1 -1
  183. package/standalone/.next/server/app/_not-found.rsc +1 -1
  184. package/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
  185. package/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  186. package/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  187. package/standalone/.next/server/chunks/ssr/{_0922cgb._.js → _01uthe5._.js} +29 -22
  188. package/standalone/.next/server/chunks/ssr/{_0wzxel4._.js → _04pqmk5._.js} +29 -22
  189. package/standalone/.next/server/chunks/ssr/{_16qls8q._.js → _0qn0zlz._.js} +29 -22
  190. package/standalone/.next/server/chunks/ssr/messages_de_json_[json]_cjs_1uig1ud._.js +1 -1
  191. package/standalone/.next/server/chunks/ssr/messages_en_json_[json]_cjs_206072-._.js +1 -1
  192. package/standalone/.next/server/chunks/ssr/messages_es_json_[json]_cjs_082yukd._.js +1 -1
  193. package/standalone/.next/server/chunks/ssr/messages_fr_json_[json]_cjs_0j6-w0i._.js +1 -1
  194. package/standalone/.next/server/middleware-build-manifest.js +3 -3
  195. package/standalone/.next/server/pages/404.html +1 -1
  196. package/standalone/.next/server/pages/500.html +1 -1
  197. package/standalone/.next/server/server-reference-manifest.js +1 -1
  198. package/standalone/.next/server/server-reference-manifest.json +1 -1
  199. package/standalone/.next/static/chunks/178wtl_ig0bxa.js +153 -0
  200. package/standalone/.next/static/chunks/21wyivb86q7ph.css +1 -0
  201. package/standalone/.next/static/chunks/08tqkboq7jldl.css +0 -1
  202. package/standalone/.next/static/chunks/2llenynsmogfu.js +0 -146
  203. /package/standalone/.next/static/{-6fMkwaNJnZS-eCqnu7XQ → xkUaHnpvpggDLECvJ6z6y}/_buildManifest.js +0 -0
  204. /package/standalone/.next/static/{-6fMkwaNJnZS-eCqnu7XQ → xkUaHnpvpggDLECvJ6z6y}/_clientMiddlewareManifest.js +0 -0
  205. /package/standalone/.next/static/{-6fMkwaNJnZS-eCqnu7XQ → xkUaHnpvpggDLECvJ6z6y}/_ssgManifest.js +0 -0
@@ -0,0 +1,153 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,939050,868401,e=>{"use strict";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 a=(0,t.default)(r);e.s(["MoveRight",0,a],939050);let s={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"}]]};s.node;let n=(0,t.default)(s);e.s(["Tags",0,n],868401)},448295,e=>{"use strict";var t=e.i(843476),r=e.i(688194),a=e.i(93384),s=e.i(741120),n=e.i(456420);let i={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"]};i.node;let l=(0,n.default)(i);var o=e.i(861745),d=e.i(948148),c=e.i(271645),u=e.i(929592),h=e.i(487486),m=e.i(519455),p=e.i(515288),g=e.i(257428),x=e.i(776639),b=e.i(793479),f=e.i(110204),j=e.i(337822),v=e.i(967489),k=e.i(987968),w=e.i(624687),y=e.i(520133),S=e.i(462777),C=e.i(637611),I=e.i(360583),N=e.i(975157),E=e.i(687862),T=e.i(52253);let A=`
2
+ id type
3
+ configurations {
4
+ id name iconKey scheme buildConfiguration defaultAction advancedSettings autoExport exportSettings createdAt updatedAt
5
+ source { id kind relativePath }
6
+ observation { id scopeKey status schemes configurations testPlans error stale headSha xcodeVersion lastParseAttemptAt lastParsedAt }
7
+ }
8
+ allowedScripts {
9
+ position
10
+ script { id name preBuildScript postBuildScript enabledByDefault timeoutSeconds failureBehavior }
11
+ }
12
+ `,D=`
13
+ id scopeKey status schemes configurations testPlans error stale headSha xcodeVersion lastParseAttemptAt lastParsedAt
14
+ `,R=["BUILD","TEST","ANALYZE","ARCHIVE","BUILD_FOR_TESTING","TEST_WITHOUT_BUILDING"];function B({codebaseId:e,worktreeId:a,open:n,onOpenChange:i,onStarted:l,destinationCache:j,coverageMode:y=!1}){let W=(0,d.useTranslations)("builds"),P=(0,o.useLocale)(),[L,M]=(0,c.useState)(null),[O,$]=(0,c.useState)(null),[_,U]=(0,c.useState)([]),[q,F]=(0,c.useState)(!1),[H,V]=(0,c.useState)(""),[G,K]=(0,c.useState)("BUILD"),[z,J]=(0,c.useState)({}),[Q,Y]=(0,c.useState)([]),[X,Z]=(0,c.useState)("SIMULATOR"),[ee,et]=(0,c.useState)(""),[er,ea]=(0,c.useState)(new Set),[es,en]=(0,c.useState)({}),[ei,el]=(0,c.useState)(!1),[eo,ed]=(0,c.useState)(T.DEFAULT_EXPORT_SETTINGS),[ec,eu]=(0,c.useState)("{}"),[eh,em]=(0,c.useState)(!0),[ep,eg]=(0,c.useState)(!1),[ex,eb]=(0,c.useState)(!1),[ef,ej]=(0,c.useState)(null),[ev,ek]=(0,c.useState)(null),ew=(0,c.useRef)(0),ey=(0,c.useRef)("SIMULATOR"),eS=(0,c.useRef)(""),eC=(0,c.useRef)(!1),eI=L?.configurations.find(e=>e.id===H),eN=eI?z[eI.id]??eI.observation:null;(0,c.useEffect)(()=>{let t=!1;return(0,C.controlPlaneRequest)(`query StartBuildProject($codebaseId: ID!) {
15
+ iosAppProject(codebaseId: $codebaseId) { ${A} }
16
+ codebase(id: $codebaseId) { agent { id name hostname } }
17
+ }`,{codebaseId:e}).then(e=>{if(t)return;M(e.iosAppProject),$(e.codebase?.agent??null);let r=e.iosAppProject?.configurations[0];r&&(V(r.id),K(y?"TEST":r.defaultAction),en(r.advancedSettings??{}),el(!!(!y&&"ARCHIVE"===r.defaultAction&&r.autoExport)),ed({...T.DEFAULT_EXPORT_SETTINGS,...r.exportSettings??{}}),ea(new Set(e.iosAppProject.allowedScripts.filter(e=>e.script.enabledByDefault).map(e=>e.script.id))))}).catch(e=>ej(e instanceof Error?e.message:String(e))).finally(()=>{t||em(!1)}),()=>{t=!0}},[e,y,a]),(0,c.useEffect)(()=>{"TEST_WITHOUT_BUILDING"!==G||eC.current||(eC.current=!0,F(!0),(0,C.controlPlaneRequest)(`query StartBuildPriorBuilds($worktreeId: ID!) {
18
+ builds(first: 50, status: SUCCEEDED, worktreeId: $worktreeId) {
19
+ items { id action destinationType snapshot createdAt }
20
+ }
21
+ }`,{worktreeId:a}).then(e=>U(e.builds.items)).catch(e=>{eC.current=!1,ej(e instanceof Error?e.message:String(e))}).finally(()=>F(!1)))},[G,a]);let eE=(0,c.useMemo)(()=>_.filter(e=>{if("BUILD_FOR_TESTING"!==e.action||e.destinationType!==X)return!1;let t=e.snapshot.configuration,r="string"==typeof es.testPlan?es.testPlan:null,a=t?.advancedSettings?.testPlan;return t?.id===H&&(!r||!a||r===a)}),[es.testPlan,H,X,_]),eT=eE.find(e=>e.id===es.priorBuildForTestingId)?.id??eE[0]?.id??null,eA=(e,t,r)=>{let a="ARCHIVE"===t?"PHYSICAL_DEVICE":e.some(e=>"SIMULATOR"===e.type)?"SIMULATOR":"PHYSICAL_DEVICE",s=r&&e.some(e=>e.type===ey.current)?ey.current:a,n=r&&e.some(e=>e.id===eS.current&&e.type===s)?eS.current:e.find(e=>e.type===s)?.id??"";ey.current=s,eS.current=n,Y(e),Z(s),et(n)},eD=async(e,t)=>{let s=++ew.current,n=`${a}:${e.id}:${t}`,i=j.get(n);i&&i.expiresAt<=Date.now()&&j.delete(n);let l=i&&i.expiresAt>Date.now()?i.destinations:(0,r.genericBuildDestinations)(t);ej(null),ek(null),eA(l,t,!1);try{let r=await (0,C.controlPlaneRequest)(`mutation InspectStartBuildDestinations($input: InspectBuildDestinationsInput!) {
22
+ inspectBuildDestinations(input: $input)
23
+ }`,{input:{worktreeId:a,configurationId:e.id,action:t,requestId:(0,S.createClientId)()}});if(s!==ew.current)return;j.set(n,{destinations:r.inspectBuildDestinations,expiresAt:Date.now()+15e3}),eA(r.inspectBuildDestinations,t,!0)}catch(t){if(s!==ew.current)return;let e=t instanceof Error?t.message:String(t);l.length?ek(W("destinationRefreshWarning",{error:e})):ej(e)}},eR=async e=>{eg(!0),ej(null);try{let t=(await (0,C.controlPlaneRequest)(`mutation ReparseStartBuild($configurationId: ID!, $worktreeId: ID!, $requestId: ID!) {
24
+ reparseBuildConfiguration(configurationId: $configurationId, worktreeId: $worktreeId, requestId: $requestId) {
25
+ ${D}
26
+ }
27
+ }`,{configurationId:e.id,worktreeId:a,requestId:(0,S.createClientId)()})).reparseBuildConfiguration;if(J(r=>({...r,[e.id]:t})),"VALID"!==t.status)throw Error(t.error||W("configurationInvalid"));eD(e,G)}catch(e){ej(e instanceof Error?e.message:String(e))}finally{eg(!1)}},eB=async()=>{if(!eI)throw Error(W("selectSigningSourceFirst"));return(await (0,C.controlPlaneRequest)(`mutation InspectStartBuildSigningRequirements($input: InspectBuildSourceInput!) {
28
+ inspectBuildSource(input: $input) {
29
+ signingRequirements {
30
+ bundleId name target platform teamId provisioningProfileSpecifier
31
+ }
32
+ }
33
+ }`,{input:{worktreeId:a,sourceKind:eI.source.kind,sourcePath:eI.source.relativePath,scheme:eI.scheme,configuration:eI.buildConfiguration,requestId:(0,S.createClientId)()}})).inspectBuildSource.signingRequirements};(0,c.useEffect)(()=>{if(!eI||eh)return;let e=window.setTimeout(()=>void eD(eI,G),0);return()=>{window.clearTimeout(e),ew.current+=1}},[H,G,eh]);let eW=(0,c.useMemo)(()=>Q.filter(e=>e.type===X),[Q,X]),eP=Q.find(e=>e.id===ee),eL=eI?`xcrun xcodebuild ${"PROJECT"===eI.source.kind?`-project ${eI.source.relativePath}`:"WORKSPACE"===eI.source.kind?`-workspace ${eI.source.relativePath}`:""} -scheme ${JSON.stringify(eI.scheme)} -configuration ${JSON.stringify(eI.buildConfiguration)} -destination ${JSON.stringify(eP?.name??"<destination>")} -hideShellScriptEnvironment ${G.toLowerCase().replaceAll("_","-")}${"TEST_WITHOUT_BUILDING"===G&&eT?` \xb7 ${W("priorBuildSummary",{id:eT})}`:""}`:"",eM=async()=>{if(eI&&eP){eb(!0),ej(null);try{let e={};try{let t=JSON.parse(ec);if(!t||"object"!=typeof t||Array.isArray(t))throw Error();e=t}catch{throw Error(W("overridesInvalid"))}let t=await (0,C.controlPlaneRequest)(`mutation StartIosBuild($input: StartBuildInput!) {
34
+ ${y?"startWorktreeCoverage":"startBuild"}(input: $input) { id }
35
+ }`,{input:{worktreeId:a,configurationId:eI.id,destination:eP,scriptIds:[...er],action:G,advancedSettings:{...es,buildSettingOverrides:e,...y?{codeCoverage:!0,parseTestResults:!0}:{},..."TEST_WITHOUT_BUILDING"===G?{priorBuildForTestingId:eT,priorTestProductsPath:null,priorXctestrunPath:null}:{}},exportWhenComplete:!y&&"ARCHIVE"===G&&ei,exportSettings:"ARCHIVE"===G?eo:null,requestId:(0,S.createClientId)()}});i(!1);let r=t.startBuild??t.startWorktreeCoverage;if(!r)throw Error(W("startBuildFailed"));l(r.id)}catch(e){ej(e instanceof Error?e.message:String(e))}finally{eb(!1)}}};return(0,t.jsx)(x.Dialog,{onOpenChange:i,open:n,children:(0,t.jsxs)(x.DialogContent,{className:"max-h-[90vh] grid-cols-[minmax(0,1fr)] overflow-y-auto sm:max-w-5xl",children:[(0,t.jsxs)(x.DialogHeader,{children:[(0,t.jsx)(x.DialogTitle,{children:W(y?"startWorktreeCoverage":"startBuild")}),(0,t.jsx)(x.DialogDescription,{children:W(y?"startWorktreeCoverageDescription":"startBuildDescription")})]}),ef&&(0,t.jsx)(u.Alert,{variant:"destructive",children:(0,t.jsx)(u.AlertDescription,{children:ef})}),ev&&(0,t.jsx)(u.Alert,{children:(0,t.jsx)(u.AlertDescription,{children:ev})}),eh?(0,t.jsxs)("p",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,t.jsx)(k.Spinner,{})," ",W("loading")]}):L?.configurations.length?(0,t.jsxs)("div",{className:"space-y-5",children:[(0,t.jsxs)("section",{className:"space-y-2",children:[(0,t.jsx)(f.Label,{children:W("configuration")}),(0,t.jsx)("div",{className:"grid gap-2 sm:grid-cols-2",children:L.configurations.map(e=>(0,t.jsxs)("button",{className:`rounded-xl border p-3 text-left transition-colors ${e.id===H?"border-primary bg-primary/5":"hover:bg-muted/50"}`,onClick:()=>{e.id!==H&&(ew.current+=1),V(e.id),K(y?"TEST":e.defaultAction),en(e.advancedSettings??{}),el(!!(!y&&"ARCHIVE"===e.defaultAction&&e.autoExport)),ed({...T.DEFAULT_EXPORT_SETTINGS,...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)(E.ConfigurationIcon,{iconKey:e.iconKey}),e.name]}),(0,t.jsx)(h.Badge,{variant:"outline",children:W(`parseStatuses.${(z[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))})]}),eI&&(0,t.jsx)(p.Card,{children:(0,t.jsxs)(p.CardContent,{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:eI.source.relativePath,children:eI.source.relativePath}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:[eI.scheme," ·"," ",eI.buildConfiguration]}),O&&(0,t.jsxs)("p",{className:"truncate text-xs text-muted-foreground",title:`${O.name} (${O.hostname})`,children:[W("agent"),": ",O.name]})]}),(0,t.jsxs)(m.Button,{disabled:ep,onClick:()=>void eR(eI),size:"sm",type:"button",variant:"outline",children:[ep?(0,t.jsx)(k.Spinner,{}):(0,t.jsx)(s.RefreshCw,{})," ",W("reparse")]})]}),eN?.error&&(0,t.jsx)("p",{className:"text-xs text-destructive",children:eN.error})]})}),(0,t.jsxs)("div",{className:"grid gap-4 sm:grid-cols-3",children:[(0,t.jsxs)("div",{className:(0,N.cn)("space-y-2",y&&"hidden"),children:[(0,t.jsx)(f.Label,{children:W("action")}),(0,t.jsxs)(v.Select,{onValueChange:e=>{e!==G&&(ew.current+=1),K(e),"ARCHIVE"!==e&&el(!1)},value:G,children:[(0,t.jsx)(v.SelectTrigger,{children:(0,t.jsx)(v.SelectValue,{})}),(0,t.jsx)(v.SelectContent,{children:R.map(e=>(0,t.jsx)(v.SelectItem,{value:e,children:W(`actions.${e}`)},e))})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(f.Label,{children:W("destinationType")}),(0,t.jsxs)(v.Select,{disabled:"ARCHIVE"===G,onValueChange:e=>{ey.current=e,Z(e);let t=Q.find(t=>t.type===e)?.id??"";eS.current=t,et(t)},value:X,children:[(0,t.jsx)(v.SelectTrigger,{children:(0,t.jsx)(v.SelectValue,{})}),(0,t.jsxs)(v.SelectContent,{children:[(0,t.jsx)(v.SelectItem,{value:"SIMULATOR",children:W("simulator")}),(0,t.jsx)(v.SelectItem,{value:"PHYSICAL_DEVICE",children:W("physicalDevice")})]})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(f.Label,{children:W("device")}),(0,t.jsxs)(v.Select,{disabled:!eW.length,onValueChange:e=>{eS.current=e,et(e)},value:ee,children:[(0,t.jsx)(v.SelectTrigger,{children:(0,t.jsx)(v.SelectValue,{placeholder:W("selectDevice")})}),(0,t.jsx)(v.SelectContent,{children:eW.map(e=>(0,t.jsxs)(v.SelectItem,{value:e.id,children:[e.generic?"SIMULATOR"===e.type?W("anySimulator"):W("anyPhysicalDevice"):e.name,e.osVersion?` \xb7 ${e.osVersion}`:""]},e.id))})]})]})]}),!y&&"ARCHIVE"===G&&(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)(g.Checkbox,{checked:ei,onCheckedChange:e=>el(!!e)}),W("exportWhenComplete")]}),ei&&(0,t.jsx)(T.ExportSettingsForm,{onChange:ed,onParseSigningRequirements:eB,value:eo},H)]}),"TEST_WITHOUT_BUILDING"===G&&(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(f.Label,{children:W("priorBuildForTesting")}),(0,t.jsxs)(v.Select,{disabled:q||!eE.length,onValueChange:e=>en(t=>({...t,priorBuildForTestingId:e,priorTestProductsPath:null,priorXctestrunPath:null})),value:eT??"",children:[(0,t.jsx)(v.SelectTrigger,{children:(0,t.jsx)(v.SelectValue,{placeholder:W("selectPriorBuildForTesting")})}),(0,t.jsx)(v.SelectContent,{children:eE.map(e=>(0,t.jsxs)(v.SelectItem,{value:e.id,children:[(0,I.formatDateValue)(e.createdAt,"short",{locale:P})," ","· ",e.id]},e.id))})]}),q&&(0,t.jsxs)("p",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[(0,t.jsx)(k.Spinner,{})," ",W("loading")]}),!q&&!eE.length&&(0,t.jsx)("p",{className:"text-xs text-destructive",children:W("noPriorBuildForTesting")})]}),["TEST","BUILD_FOR_TESTING","TEST_WITHOUT_BUILDING"].includes(G)&&(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(f.Label,{children:W("testPlan")}),(0,t.jsxs)(v.Select,{onValueChange:e=>en(t=>({...t,testPlan:"__SCHEME_DEFAULT__"===e?null:e})),value:String(es.testPlan??"__SCHEME_DEFAULT__"),children:[(0,t.jsx)(v.SelectTrigger,{children:(0,t.jsx)(v.SelectValue,{})}),(0,t.jsxs)(v.SelectContent,{children:[(0,t.jsx)(v.SelectItem,{value:"__SCHEME_DEFAULT__",children:W("schemeDefaultTestPlan")}),"string"==typeof es.testPlan&&es.testPlan&&!eN?.testPlans.includes(es.testPlan)&&(0,t.jsxs)(v.SelectItem,{value:es.testPlan,children:[es.testPlan," · ",W("savedValueUnavailable")]}),eN?.testPlans.map(e=>(0,t.jsx)(v.SelectItem,{value:e,children:e},e))]})]})]}),L.allowedScripts.length>0&&(0,t.jsxs)("section",{className:"space-y-2",children:[(0,t.jsx)(f.Label,{children:W("scripts")}),(0,t.jsx)("div",{className:"grid gap-2 sm:grid-cols-2",children:L.allowedScripts.map(({script:e})=>(0,t.jsxs)("label",{className:"flex items-start gap-2 rounded-lg border p-2",children:[(0,t.jsx)(g.Checkbox,{checked:er.has(e.id),onCheckedChange:t=>{ea(r=>{let a=new Set(r);return t?a.add(e.id):a.delete(e.id),a})}}),(0,t.jsxs)("span",{children:[(0,t.jsx)("span",{className:"block text-sm font-medium",children:e.name}),(0,t.jsxs)("span",{className:"text-xs text-muted-foreground",children:[e.preBuildScript?W("preBuild"):"",e.preBuildScript&&e.postBuildScript?" · ":"",e.postBuildScript?W("postBuild"):""]})]})]},e.id))})]}),(0,t.jsxs)("details",{className:"rounded-xl border p-3",children:[(0,t.jsx)("summary",{className:"cursor-pointer font-medium",children:W("advancedSettings")}),(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)(f.Label,{htmlFor:"development-team",children:W("developmentTeam")}),(0,t.jsx)(b.Input,{id:"development-team",onChange:e=>en(t=>({...t,developmentTeam:e.target.value||null})),value:String(es.developmentTeam??"")})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(f.Label,{children:W("packageResolution")}),(0,t.jsxs)(v.Select,{onValueChange:e=>en(t=>({...t,packageResolution:e})),value:String(es.packageResolution??"DEFAULT"),children:[(0,t.jsx)(v.SelectTrigger,{children:(0,t.jsx)(v.SelectValue,{})}),(0,t.jsx)(v.SelectContent,{children:["DEFAULT","RESOLVED_ONLY","SKIP_UPDATES","DISABLE_AUTOMATIC"].map(e=>(0,t.jsx)(v.SelectItem,{value:e,children:e},e))})]})]}),(0,t.jsxs)("label",{className:"flex items-center gap-2",children:[(0,t.jsx)(g.Checkbox,{checked:y||!!es.codeCoverage,disabled:y,onCheckedChange:e=>en(t=>({...t,codeCoverage:!!e}))}),W("codeCoverage")]}),["TEST","TEST_WITHOUT_BUILDING"].includes(G)&&(0,t.jsxs)("label",{className:"flex items-center gap-2",children:[(0,t.jsx)(g.Checkbox,{checked:y||!1!==es.parseTestResults,disabled:y,onCheckedChange:e=>en(t=>({...t,parseTestResults:!!e}))}),W("parseTestResults")]}),(0,t.jsxs)("label",{className:"flex items-center gap-2",children:[(0,t.jsx)(g.Checkbox,{checked:!!es.allowProvisioningUpdates,onCheckedChange:e=>en(t=>({...t,allowProvisioningUpdates:!!e}))}),W("allowProvisioningUpdates")]}),(0,t.jsxs)("div",{className:"space-y-2 sm:col-span-2",children:[(0,t.jsx)(f.Label,{htmlFor:"build-setting-overrides",children:W("buildSettingOverrides")}),(0,t.jsx)(w.Textarea,{className:"font-mono text-xs",id:"build-setting-overrides",onChange:e=>eu(e.target.value),rows:4,value:ec})]})]})]}),(0,t.jsxs)("section",{className:"space-y-2",children:[(0,t.jsx)(f.Label,{children:W("commandPreview")}),(0,t.jsx)("pre",{className:"overflow-x-auto rounded-lg bg-muted p-3 text-xs whitespace-pre-wrap",children:eL})]})]}):(0,t.jsx)(u.Alert,{children:(0,t.jsx)(u.AlertDescription,{children:W("noConfigurations")})}),(0,t.jsxs)(x.DialogFooter,{children:[(0,t.jsx)(m.Button,{onClick:()=>i(!1),type:"button",variant:"outline",children:W("cancel")}),(0,t.jsxs)(m.Button,{disabled:eh||ex||!eI||!eP||"TEST_WITHOUT_BUILDING"===G&&!eT,onClick:()=>void eM(),type:"button",children:[ex&&(0,t.jsx)(k.Spinner,{})," ",W("startBuild")]})]})]})})}e.s(["StartBuildButton",0,function({codebaseId:e,worktreeId:r,disabled:s,disabledReason:n,buildSettingsHref:i,onStarted:l,size:o="sm"}){let u=(0,d.useTranslations)("builds"),[h,p]=(0,c.useState)(!1),[g,x]=(0,c.useState)(!1),b=(0,c.useRef)(null),[f]=(0,c.useState)(()=>new Map),v=()=>{null!==b.current&&(window.clearTimeout(b.current),b.current=null)},k=()=>{v(),x(!0)},w=()=>{v(),b.current=window.setTimeout(()=>x(!1),150)};return(0,c.useEffect)(()=>()=>{null!==b.current&&window.clearTimeout(b.current)},[]),(0,t.jsxs)(t.Fragment,{children:[s&&i?(0,t.jsxs)(j.Popover,{onOpenChange:x,open:g,children:[(0,t.jsx)(j.PopoverAnchor,{asChild:!0,children:(0,t.jsxs)(m.Button,{"aria-disabled":"true","aria-expanded":g,"aria-haspopup":"dialog",className:"cursor-not-allowed opacity-50",onClick:k,onFocus:k,onMouseEnter:k,onMouseLeave:w,size:o,title:n??void 0,type:"button",children:[(0,t.jsx)(a.Hammer,{})," ",u("build")]})}),(0,t.jsx)(j.PopoverContent,{align:"start",className:"w-auto max-w-64 p-2 text-xs",onBlurCapture:w,onFocusCapture:v,onMouseEnter:v,onMouseLeave:w,onOpenAutoFocus:e=>e.preventDefault(),side:"top",children:(0,t.jsx)(y.Link,{className:"font-medium underline-offset-4 hover:underline",href:i,children:u("configureBuilds")})})]}):(0,t.jsxs)(m.Button,{disabled:s,onClick:()=>p(!0),size:o,title:n??void 0,type:"button",children:[(0,t.jsx)(a.Hammer,{})," ",u("build")]}),h&&(0,t.jsx)(B,{codebaseId:e,destinationCache:f,onOpenChange:p,onStarted:e=>l?.(e),open:h,worktreeId:r})]})},"WorktreeCoverageButton",0,function({codebaseId:e,worktreeId:r,disabled:a,onStarted:s}){let n=(0,d.useTranslations)("builds"),[i,o]=(0,c.useState)(!1),[u]=(0,c.useState)(()=>new Map);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(m.Button,{disabled:a,onClick:()=>o(!0),type:"button",children:[(0,t.jsx)(l,{})," ",n("generateWorktreeCoverage")]}),i&&(0,t.jsx)(B,{codebaseId:e,coverageMode:!0,destinationCache:u,onOpenChange:o,onStarted:e=>s?.(e),open:i,worktreeId:r})]})}],448295)},227286,539531,e=>{"use strict";var t=e.i(843476),r=e.i(716327),a=e.i(482022),s=e.i(948148),n=e.i(519455),i=e.i(755146),l=e.i(762525);e.s(["GitLabWorktreePipelinesMenu",0,function({pipelines:e}){let o=(0,s.useTranslations)("gitlabPages");if(!e.length)return null;let d=(0,l.aggregateGitLabPipelineStatus)(e.map(e=>e.status)),c=e=>e.stopPropagation();return(0,t.jsxs)(i.DropdownMenu,{children:[(0,t.jsx)(i.DropdownMenuTrigger,{asChild:!0,children:(0,t.jsxs)(n.Button,{"aria-label":`${o("pipelines")}: ${d}`,className:`h-5 rounded-full px-2 py-0.5 text-xs ${(0,l.gitLabPipelineStatusClass)(d)}`,onClick:c,variant:"outline",children:[d,(0,t.jsx)(r.ChevronDown,{className:"size-3"})]})}),(0,t.jsxs)(i.DropdownMenuContent,{align:"start",className:"w-80",onClick:c,children:[(0,t.jsx)(i.DropdownMenuLabel,{children:o("pipelines")}),(0,t.jsx)(i.DropdownMenuSeparator,{}),e.map(e=>(0,t.jsx)(i.DropdownMenuItem,{asChild:!0,children:(0,t.jsxs)("a",{href:e.webUrl,rel:"noreferrer",target:"_blank",children:[(0,t.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("span",{className:"block truncate font-medium",children:["#",e.iid??e.id," · ",e.ref]}),(0,t.jsxs)("span",{className:"block text-xs text-muted-foreground",children:[e.source," · ",e.status]})]}),(0,t.jsx)(a.ExternalLink,{className:"size-3.5 shrink-0"})]})},e.id))]})]})}],227286);var o=e.i(271645),d=e.i(772436),c=e.i(975157);e.s(["QuickActionsRow",0,function({first:e,second:r}){let a=(0,o.useRef)(null),[s,n]=(0,o.useState)({paired:!1,inline:!1});return(0,o.useEffect)(()=>{let e=a.current;if(!e)return;let t=()=>{let t=[...e.children].filter(e=>e instanceof HTMLElement&&void 0===e.dataset.quickActionsSeparator),r=2===t.length,[a,s]=t,i=r&&a.getBoundingClientRect().bottom>s.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 s=new MutationObserver(t);return s.observe(e,{childList:!0,subtree:!0}),()=>{r.disconnect(),s.disconnect()}}),(0,t.jsxs)("div",{className:"flex w-full flex-wrap items-center gap-2",ref:a,children:[e,s.paired&&(0,t.jsx)(d.Separator,{className:(0,c.cn)(!s.inline&&"invisible"),"data-quick-actions-separator":"",orientation:"vertical"}),r]})}],539531)},501416,e=>{"use strict";var t=e.i(843476),r=e.i(948148),a=e.i(271645),s=e.i(929592),n=e.i(519455),i=e.i(987968),l=e.i(687862),o=e.i(520133),d=e.i(637611),c=e.i(975157),u=e.i(997778);e.s(["WorkflowQuickActions",0,function({worktreeId:e,sessionData:h,workflows:m,className:p}){let g=(0,r.useTranslations)("workflows"),[x,b]=(0,a.useState)(null),[f,j]=(0,a.useState)({}),[v,k]=(0,a.useState)(null),w=(0,a.useRef)(new Map);(0,a.useEffect)(()=>{let e=w.current;return()=>{for(let t of e.values())clearTimeout(t);e.clear()}},[]);let y=async(t,r)=>{b(t.id),k(null);try{let a=await (0,d.controlPlaneRequest)(`mutation RunWorktreeQuickAction($input: TriggerWorkflowInput!) {
36
+ triggerWorkflow(input: $input) { id }
37
+ }`,{input:{workflowId:t.id,sessionData:h,resourceKind:"WORKTREE",resourceId:e,subjectKey:`WORKTREE:${e}`,choice:r}});j(e=>({...e,[t.id]:a.triggerWorkflow.id})),clearTimeout(w.current.get(t.id)),w.current.set(t.id,setTimeout(()=>{w.current.delete(t.id),j(e=>{let r={...e};return delete r[t.id],r})},5e3))}catch(e){k(e instanceof Error?e.message:String(e))}finally{b(null)}};return m.length||v?(0,t.jsxs)("div",{className:(0,c.cn)("w-full space-y-2",p),children:[(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:m.map(e=>{let r=f[e.id];return(0,t.jsxs)("div",{className:"flex items-center",children:[r&&(0,t.jsx)(n.Button,{asChild:!0,className:"rounded-r-none border-emerald-500/30 bg-emerald-500/10 text-emerald-700 hover:bg-emerald-500/20 hover:text-emerald-700 dark:border-emerald-500/30 dark:bg-emerald-500/10 dark:text-emerald-300 dark:hover:bg-emerald-500/20 dark:hover:text-emerald-300",size:"sm",variant:"outline",children:(0,t.jsxs)(o.Link,{href:`/workflows/runs/${r}`,title:g("quickActionStarted",{name:e.name}),children:[(0,t.jsx)(i.Spinner,{}),g("quickActionView")]})}),(0,t.jsx)(u.WorkflowChoiceMenu,{button:(0,t.jsxs)(n.Button,{className:r?"-ml-px rounded-l-none":void 0,disabled:null!==x,size:"sm",title:e.description||e.name,variant:e.quickActionButtonVariant,children:[x===e.id?(0,t.jsx)(i.Spinner,{}):(0,t.jsx)(l.ConfigurationIcon,{iconKey:e.quickActionIconKey}),e.name]}),choices:e.triggerChoices??[],hasPlainTrigger:e.hasPlainTrigger??!1,onRun:t=>void y(e,t)})]},e.id)})}),v&&(0,t.jsx)(s.Alert,{variant:"destructive",children:(0,t.jsx)(s.AlertDescription,{children:v})})]}):null}])},966264,e=>{"use strict";var t=e.i(843476),r=e.i(113030),a=e.i(741120),s=e.i(948148),n=e.i(271645),i=e.i(346194),l=e.i(929592),o=e.i(519455),d=e.i(257428),c=e.i(776639),u=e.i(793479),h=e.i(110204),m=e.i(967489),p=e.i(987968),g=e.i(624687),x=e.i(637611),b=e.i(440289);let f="__none__",j="__github_account_default__";function v(e){return e instanceof Error?e.message:String(e)}e.s(["AutoMergeButton",0,function({worktree:e,disabled:a,onCompleted:b,onError:f}){let k,w=(0,s.useTranslations)("worktrees"),y=(0,s.useTranslations)("pullRequests"),S=e.pullRequest,C=e.autoMerge,I=C&&(!S||C.pullRequestNumber===S.number&&C.repositoryNameWithOwner.toLowerCase()===S.repositoryNameWithOwner.toLowerCase())?C:null,[N,E]=(0,n.useState)(!1),[T,A]=(0,n.useState)(!1),[D,R]=(0,n.useState)(!1),[B,W]=(0,n.useState)(null),[P,L]=(0,n.useState)(null),[M,O]=(0,n.useState)(""),[$,_]=(0,n.useState)(""),[U,q]=(0,n.useState)(""),[F,H]=(0,n.useState)(j),[V,G]=(0,n.useState)(!1),[K,z]=(0,n.useState)(!1);if((0,n.useEffect)(()=>{if(!N||!S)return;let e=!0,[t="",r=""]=S.repositoryNameWithOwner.split("/",2);return(0,x.controlPlaneRequest)(`query GitHubPullRequestMergeOptions(
38
+ $owner: String!
39
+ $name: String!
40
+ $number: Int!
41
+ ) {
42
+ githubPullRequestMergeOptions(
43
+ source: WORKTREE_AUTOMATION
44
+ owner: $owner
45
+ name: $name
46
+ number: $number
47
+ ) {
48
+ availableMethods commitEmails defaultCommitEmail
49
+ defaultCommitHeadline defaultCommitBody canMerge
50
+ canEnableAutoMerge autoMergeEnabled viewerCanDisableAutoMerge
51
+ mergeStateStatus headRefOid blockedReason
52
+ }
53
+ }`,{owner:t,name:r,number:S.number}).then(t=>{if(!e)return;let r=t.githubPullRequestMergeOptions;L(r),O(I?.mergeMethod??r.availableMethods[0]??""),_(I?.commitHeadline??r.defaultCommitHeadline),q(I?.commitBody??r.defaultCommitBody),H(I?.authorEmail??r.defaultCommitEmail??j),G(I?.deleteWorktree??!1),z(I?.moveTicketToDone??!1)}).catch(t=>e&&W(v(t))).finally(()=>e&&A(!1)),()=>{e=!1}},[I,N,S]),S&&I?.state!=="COMPLETED"&&(k=e.pullRequest)&&"OPEN"===k.state&&!k.isDraft&&"MERGEABLE"===k.mergeable&&["CLEAN","HAS_HOOKS","UNSTABLE"].includes(k.mergeStateStatus))return(0,t.jsx)(i.MergePullRequestButton,{onMerged:async()=>{I&&await (0,x.controlPlaneRequest)(`mutation RetryWorktreeAutoMerge($worktreeId: ID!) {
54
+ retryWorktreeAutoMerge(worktreeId: $worktreeId) {
55
+ worktreeId state
56
+ }
57
+ }`,{worktreeId:e.id}),await b()},pullRequest:S,requestSource:"WORKTREE_AUTOMATION"});let J=async()=>{if(S&&M&&$.trim()){R(!0),W(null);try{await (0,x.controlPlaneRequest)(`mutation ConfigureWorktreeAutoMerge(
58
+ $input: ConfigureWorktreeAutoMergeInput!
59
+ ) {
60
+ configureWorktreeAutoMerge(input: $input) {
61
+ worktreeId state repositoryNameWithOwner pullRequestNumber
62
+ mergeMethod commitHeadline commitBody authorEmail deleteWorktree
63
+ moveTicketToDone ticketKey lastError updatedAt
64
+ }
65
+ }`,{input:{worktreeId:e.id,repositoryNameWithOwner:S.repositoryNameWithOwner,pullRequestNumber:S.number,method:M,commitHeadline:$,commitBody:U,authorEmail:F===j?null:F,deleteWorktree:V,moveTicketToDone:K}}),f(null),E(!1),await b()}catch(e){W(v(e))}finally{R(!1)}}},Q=async()=>{R(!0),W(null);try{await (0,x.controlPlaneRequest)(`mutation CancelWorktreeAutoMerge($worktreeId: ID!) {
66
+ cancelWorktreeAutoMerge(worktreeId: $worktreeId)
67
+ }`,{worktreeId:e.id}),f(null),E(!1),await b()}catch(e){W(v(e))}finally{R(!1)}},Y=I?.state==="ACTION_REQUIRED",X=I?.state==="COMPLETED";return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(o.Button,{className:I&&!Y?"bg-emerald-600 text-white hover:bg-emerald-700":void 0,disabled:!S||a&&!I||X,onClick:e=>{e.stopPropagation(),A(!0),L(null),W(null),E(!0)},size:"sm",type:"button",variant:Y?"destructive":I?"default":"outline",children:[(0,t.jsx)(r.GitMerge,{}),w(X?"autoMergeComplete":Y?"autoMergePaused":I?"autoMerging":"autoMerge")]}),(0,t.jsx)(c.Dialog,{onOpenChange:e=>!D&&E(e),open:N,children:(0,t.jsxs)(c.DialogContent,{className:"sm:max-w-xl",children:[(0,t.jsxs)(c.DialogHeader,{children:[(0,t.jsx)(c.DialogTitle,{children:w("autoMergeTitle")}),(0,t.jsx)(c.DialogDescription,{children:w("autoMergeDescription")})]}),!T&&(P||B)?(0,t.jsxs)("div",{className:"space-y-4",children:[(B||I?.lastError)&&(0,t.jsx)(l.Alert,{variant:"destructive",children:(0,t.jsx)(l.AlertDescription,{children:B||I?.lastError})}),P&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(h.Label,{className:"mb-1.5 block",children:y("mergeType")}),(0,t.jsxs)(m.Select,{disabled:D,onValueChange:e=>O(e),value:M,children:[(0,t.jsx)(m.SelectTrigger,{children:(0,t.jsx)(m.SelectValue,{})}),(0,t.jsx)(m.SelectContent,{children:P.availableMethods.map(e=>(0,t.jsx)(m.SelectItem,{value:e,children:y(`mergeTypes.${e}`)},e))})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.Label,{className:"mb-1.5 block",children:y("commitMessage")}),(0,t.jsx)(u.Input,{disabled:D,onChange:e=>_(e.target.value),value:$})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.Label,{className:"mb-1.5 block",children:y("commitDescription")}),(0,t.jsx)(g.Textarea,{className:"min-h-24",disabled:D,onChange:e=>q(e.target.value),value:U})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.Label,{className:"mb-1.5 block",children:y("commitEmail")}),(0,t.jsxs)(m.Select,{disabled:D,onValueChange:H,value:F,children:[(0,t.jsx)(m.SelectTrigger,{children:(0,t.jsx)(m.SelectValue,{})}),(0,t.jsxs)(m.SelectContent,{children:[(0,t.jsx)(m.SelectItem,{value:j,children:y("githubDefaultEmail")}),P.commitEmails.map(e=>(0,t.jsx)(m.SelectItem,{value:e,children:e},e))]})]})]}),!e.primary&&(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(d.Checkbox,{checked:V,disabled:D,id:`delete-after-merge-${e.id}`,onCheckedChange:e=>G(!!e)}),(0,t.jsx)(h.Label,{htmlFor:`delete-after-merge-${e.id}`,children:w("deleteAfterMerge")})]}),e.ticketKey&&(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(d.Checkbox,{checked:K,disabled:D,id:`done-after-merge-${e.id}`,onCheckedChange:e=>z(!!e)}),(0,t.jsx)(h.Label,{htmlFor:`done-after-merge-${e.id}`,children:w("moveTicketToDone")})]})]})]}):(0,t.jsxs)("div",{className:"flex items-center gap-2 py-6 text-sm text-muted-foreground",children:[(0,t.jsx)(p.Spinner,{})," ",y("loadingMergeOptions")]}),(0,t.jsxs)(c.DialogFooter,{children:[I&&(0,t.jsx)(o.Button,{disabled:D,onClick:()=>void Q(),type:"button",variant:"destructive",children:w("cancelAutoMerge")}),(0,t.jsx)(o.Button,{disabled:D,onClick:()=>E(!1),type:"button",variant:"outline",children:w("cancel")}),(0,t.jsxs)(o.Button,{disabled:T||D||!M||!$.trim()||!I&&!P?.canEnableAutoMerge,onClick:()=>void J(),type:"button",children:[D&&(0,t.jsx)(p.Spinner,{}),w(Y?"resumeAutoMerge":"saveAutoMerge")]})]})]})})]})},"AutoSyncButton",0,function({worktree:e,conflictWorkflows:r,disabled:i,onCompleted:u,onError:g}){let j=(0,s.useTranslations)("worktrees"),k=e.autoSync,[w,y]=(0,n.useState)(!1),[S,C]=(0,n.useState)(!1),[I,N]=(0,n.useState)(!1),[E,T]=(0,n.useState)(null),[A,D]=(0,n.useState)(!1),[R,B]=(0,n.useState)(f),[W,P]=(0,n.useState)(f),L=(0,n.useMemo)(()=>r.find(e=>e.id===R),[r,R]),M=async()=>{C(!0),T(null);try{await (0,x.controlPlaneRequest)(`mutation ConfigureWorktreeAutoSync(
68
+ $input: ConfigureWorktreeAutoSyncInput!
69
+ ) {
70
+ configureWorktreeAutoSync(input: $input) {
71
+ worktreeId state conflictWorkflowId conflictWorkflowChoice
72
+ lastError pauseReason lastSyncedAt updatedAt
73
+ }
74
+ }`,{input:{worktreeId:e.id,conflictWorkflowId:A&&R!==f?R:null,conflictWorkflowChoice:A&&W!==f?W:null}}),g(null),y(!1),await u()}catch(e){T(v(e))}finally{C(!1)}},O=async()=>{C(!0),T(null);try{await (0,x.controlPlaneRequest)(`mutation CancelWorktreeAutoSync($worktreeId: ID!) {
75
+ cancelWorktreeAutoSync(worktreeId: $worktreeId)
76
+ }`,{worktreeId:e.id}),g(null),y(!1),await u()}catch(e){T(v(e))}finally{C(!1)}},$=async()=>{C(!0),T(null);try{let t=await (0,x.controlPlaneRequest)(`mutation ForceWorktreeAutoSync($worktreeId: ID!, $requestId: ID!) {
77
+ forceWorktreeAutoSync(worktreeId: $worktreeId, requestId: $requestId) { id }
78
+ }`,{worktreeId:e.id,requestId:crypto.randomUUID()});await (0,b.waitForWorktreeJob)(t.forceWorktreeAutoSync.id),g(null),y(!1),await u()}catch(e){T(v(e)),await u().catch(()=>void 0)}finally{N(!1),C(!1)}},_=k?.state==="PAUSED";return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(o.Button,{className:k&&!_?"bg-emerald-600 text-white hover:bg-emerald-700":void 0,disabled:i&&!k,onClick:e=>{e.stopPropagation(),T(null),N(!1),D(!!k?.conflictWorkflowId),B(k?.conflictWorkflowId??f),P(k?.conflictWorkflowChoice??f),y(!0)},size:"sm",type:"button",variant:_?"destructive":k?"default":"outline",children:[(0,t.jsx)(a.RefreshCw,{}),j(_?"autoSyncPaused":k?"autoSyncing":"autoSync")]}),(0,t.jsx)(c.Dialog,{onOpenChange:e=>{S||y(e),e||N(!1)},open:w,children:(0,t.jsxs)(c.DialogContent,{className:"sm:max-w-xl",children:[(0,t.jsxs)(c.DialogHeader,{children:[(0,t.jsx)(c.DialogTitle,{children:j("autoSyncTitle")}),(0,t.jsx)(c.DialogDescription,{children:j("autoSyncDescription")})]}),(0,t.jsxs)("div",{className:"space-y-4",children:[(E||k?.lastError)&&(0,t.jsx)(l.Alert,{variant:"destructive",children:(0,t.jsx)(l.AlertDescription,{children:E||k?.lastError})}),(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(d.Checkbox,{checked:A,disabled:S||0===r.length,id:`auto-sync-workflow-${e.id}`,onCheckedChange:e=>D(!!e)}),(0,t.jsx)(h.Label,{htmlFor:`auto-sync-workflow-${e.id}`,children:j("useConflictWorkflow")})]}),A&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(h.Label,{className:"mb-1.5 block",children:j("selectConflictWorkflow")}),(0,t.jsxs)(m.Select,{disabled:S,onValueChange:e=>{B(e),P(f)},value:R,children:[(0,t.jsx)(m.SelectTrigger,{children:(0,t.jsx)(m.SelectValue,{})}),(0,t.jsxs)(m.SelectContent,{children:[(0,t.jsx)(m.SelectItem,{value:f,children:j("noWorkflow")}),r.map(e=>(0,t.jsx)(m.SelectItem,{value:e.id,children:e.name},e.id))]})]})]}),L?.triggerChoices&&L.triggerChoices.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)(h.Label,{className:"mb-1.5 block",children:j("conflictWorkflowChoice")}),(0,t.jsxs)(m.Select,{disabled:S,onValueChange:P,value:W,children:[(0,t.jsx)(m.SelectTrigger,{children:(0,t.jsx)(m.SelectValue,{})}),(0,t.jsxs)(m.SelectContent,{children:[L.hasPlainTrigger&&(0,t.jsx)(m.SelectItem,{value:f,children:j("defaultWorkflowTrigger")}),L.triggerChoices.map(e=>(0,t.jsx)(m.SelectItem,{value:e.key,children:e.label},e.key))]})]})]})]})]}),(0,t.jsxs)(c.DialogFooter,{children:[k?.state==="PAUSED"&&"PREPARATION_CONFLICT"===k.pauseReason&&(0,t.jsxs)(o.Button,{disabled:S,onClick:()=>{I?$():N(!0)},type:"button",variant:"destructive",children:[S&&(0,t.jsx)(p.Spinner,{})," ",j(I?"confirmForceSyncPreparations":"forceSyncPreparations")]}),k&&(0,t.jsx)(o.Button,{disabled:S,onClick:()=>void O(),type:"button",variant:"destructive",children:j("cancelAutoSync")}),(0,t.jsx)(o.Button,{disabled:S,onClick:()=>y(!1),type:"button",variant:"outline",children:j("cancel")}),(0,t.jsxs)(o.Button,{disabled:S||A&&R===f||!!(A&&L?.triggerChoices?.length&&!L.hasPlainTrigger&&W===f),onClick:()=>void M(),type:"button",children:[S&&(0,t.jsx)(p.Spinner,{}),j(_?"resumeAutoSync":"saveAutoSync")]})]})]})})]})}])},942230,e=>{"use strict";var t=e.i(843476),r=e.i(716327),a=e.i(434322),s=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),b=e.i(455329);function f({detail:e,worktreeId:r}){let a=(0,n.useTranslations)("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)(j,{change:e,worktreeId:r},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.Table,{"aria-label":a("commits",{count:e.commits.length}),className:"min-w-[36rem] table-fixed text-xs",children:(0,t.jsx)(m.TableBody,{children:e.commits.map(e=>(0,t.jsxs)(m.TableRow,{children:[(0,t.jsx)(m.TableCell,{className:"w-24 px-2 py-1.5 font-mono text-muted-foreground",children:e.sha.slice(0,8)}),(0,t.jsx)(m.TableCell,{className:"max-w-0 px-2 py-1.5",children:(0,t.jsxs)("div",{className:"flex min-w-0 items-baseline gap-2",children:[(0,t.jsx)("span",{className:"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.DateTime,{value:e.authoredAt})]})]})}),(0,t.jsx)(m.TableCell,{className:"w-24 px-2 py-1.5 text-right",children:(0,t.jsx)(E,{additions:e.additions,deletions:e.deletions})})]},e.sha))})}):(0,t.jsx)("p",{className:"p-3 text-sm text-muted-foreground",children:a("noCommits")})})]})]})}function j({change:e,worktreeId:r}){let a=(0,n.useTranslations)("worktrees");return(0,t.jsx)(v,{label:e.path,summary:(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[e.conflicted&&(0,t.jsx)(l.Badge,{variant:"destructive",children:a("conflicted")}),e.staged&&(0,t.jsx)(N,{additions:e.stagedAdditions,deletions:e.stagedDeletions,label:a("staged")}),e.unstaged&&(0,t.jsx)(N,{additions:e.unstagedAdditions,deletions:e.unstagedDeletions,label:a("unstaged")}),e.untracked&&(0,t.jsx)(N,{additions:e.unstagedAdditions,deletions:e.unstagedDeletions,label:a("untracked")})]}),children:(0,t.jsxs)("div",{className:"space-y-3",children:[e.staged&&(0,t.jsx)(y,{label:a("staged"),path:e.path,previousPath:e.previousPath,scope:"STAGED",worktreeId:r}),e.unstaged&&(0,t.jsx)(y,{label:a("unstaged"),path:e.path,scope:"UNSTAGED",worktreeId:r}),e.untracked&&(0,t.jsx)(y,{label:a("untracked"),path:e.path,scope:"UNTRACKED",worktreeId:r})]})})}function v({label:e,prefix:a,summary:s,children:n}){let[l,o]=(0,i.useState)(!1);return(0,t.jsxs)("div",{children:[(0,t.jsxs)("button",{"aria-expanded":l,className:"flex min-h-8 w-full items-center gap-2 px-2 py-1.5 text-left hover:bg-muted/40",onClick:()=>o(e=>!e),type:"button",children:[(0,t.jsx)(r.ChevronDown,{className:(0,p.cn)("size-3.5 shrink-0 transition-transform",l&&"rotate-180")}),a&&(0,t.jsx)("span",{className:"shrink-0 font-mono text-xs text-muted-foreground",children:a}),(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:s})]}),l&&n&&(0,t.jsx)("div",{className:"border-t bg-muted/10 p-3",children:n})]})}function k({worktreeId:e,commitSha:r}){let{value:a,loading:s,error:n}=S(e,"COMMIT",null,null,r);return s?(0,t.jsx)(C,{}):n?(0,t.jsx)(I,{value:n}):(0,t.jsx)("div",{className:"divide-y rounded-md border bg-background",children:a?.files.map(a=>(0,t.jsx)(w,{commitSha:r,file:a,scope:"COMMIT",worktreeId:e},`${a.previousPath??""}:${a.path}`))})}function w({file:e,worktreeId:r,scope:n,commitSha:i}){return(0,t.jsx)(v,{label:e.path,summary:(0,t.jsxs)("span",{className:"inline-flex items-center gap-2",children:[e.image?(0,t.jsx)(s.Images,{className:"size-4"}):(0,t.jsx)(a.FileCode2,{className:"size-4"}),(0,t.jsx)(l.Badge,{variant:"outline",children:e.changeType}),(0,t.jsx)(E,{additions:e.additions,deletions:e.deletions})]}),children:(0,t.jsx)(y,{commitSha:i,path:e.path,previousPath:e.previousPath,scope:n,worktreeId:r})})}function y({label:e,worktreeId:r,path:a,previousPath:s,scope:i,commitSha:l}){let o=(0,n.useTranslations)("worktreeDetail"),h=(0,u.useDiffViewLabels)(),m=(0,u.useImageDiffLabels)(),{value:p,loading:g,error:x}=S(r,i,a,s??null,l??null),b=e=>{let t=new URLSearchParams({scope:i,path:a,side:e});return s&&t.set("previousPath",s),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)(C,{}):x?(0,t.jsx)(I,{value:x}):p?.image?(0,t.jsx)(d.ImageDiff,{after:p.afterAvailable?b("AFTER"):null,before:p.beforeAvailable?b("BEFORE"):null,labels:m}):p?.patch?(0,t.jsx)(c.PatchDiffView,{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 S(e,t,r,a,s){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.controlPlaneRequest)(b.INSPECT_WORKTREE_DIFF_MUTATION,{input:{worktreeId:e,scope:t,path:r,previousPath:a,commitSha:s,requestId:(0,g.createClientId)()}}).then(e=>{n||l(e.inspectWorktreeDiff)}).catch(e=>{n||u(e instanceof Error?e.message:String(e))}).finally(()=>{n||d(!1)}),()=>{n=!0}},[s,r,a,t,e]),{value:n,loading:o,error:c}}function C(){let e=(0,n.useTranslations)("worktreeDetail");return(0,t.jsxs)("p",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(h.Spinner,{})," ",e("loadingDiff")]})}function I({value:e}){return(0,t.jsx)("p",{className:"text-sm text-destructive",children:e})}function N({label:e,additions:r,deletions:a}){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)(E,{additions:r,deletions:a})]})}function E({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(["BranchChangesPanel",0,function({files:e,truncated:r,worktreeId:a}){let s=(0,n.useTranslations)("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)(w,{file:e,scope:"BRANCH",worktreeId:a},`${e.previousPath??""}:${e.path}`))}):(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:s("noBranchChanges")}),r&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:s("diffTruncated")})]})},"WorktreeDetailPanel",0,function({detail:e,worktreeId:r,inline:a=!1}){let s=(0,n.useTranslations)("worktrees");return a?(0,t.jsx)(f,{detail:e,worktreeId:r}):(0,t.jsxs)("div",{className:(0,p.cn)("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:s("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)(j,{change:e,worktreeId:r},e.path)):(0,t.jsx)("p",{className:"p-3 text-sm text-muted-foreground",children:s("noChanges")})})]}),(0,t.jsxs)("section",{children:[(0,t.jsx)("h2",{className:"mb-2 font-medium",children:s("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)(v,{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.DateTime,{value:e.authoredAt})," ","·"," ",(0,t.jsx)(E,{additions:e.additions,deletions:e.deletions})]}),children:r?(0,t.jsx)(k,{commitSha:e.sha,worktreeId:r}):null},e.sha)):(0,t.jsx)("p",{className:"p-3 text-sm text-muted-foreground",children:s("noCommits")})})]}),(e.commitsTruncated||e.changesTruncated)&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:s("truncated")})]})}])},453154,5406,e=>{"use strict";var t=e.i(843476),r=e.i(689664),a=e.i(867927),s=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(["WorktreeFetchProgress",0,function({batch:e,onDismiss:x,onRetry:b}){let f=(0,i.useTranslations)("worktrees.fetchProgress"),j=(0,l.useId)(),v=["starting","fetching","refreshing"].includes(e.phase),k=e.rows.filter(e=>!p(e)).length,w=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),I=e.rows.some(e=>"SUCCEEDED"===e.status&&!e.worktreesRefreshedAt&&!e.worktreeRefreshError),N=f("progress",{completed:k,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.Spinner,{"aria-hidden":"true"}):"finished"!==e.phase||y||C||I?null:(0,t.jsx)(r.Check,{className:"size-4 text-emerald-600"}),f(e.phase)]}),(0,t.jsx)("p",{children:N}),(0,t.jsx)("p",{className:"text-muted-foreground",children:f("summary",{succeeded:w,failed:y,skipped:S})})]}),!v&&(0,t.jsx)(d.Button,{"aria-label":f("dismiss"),onClick:x,size:"icon-sm",variant:"ghost",children:(0,t.jsx)(n.X,{})})]}),(0,t.jsx)("progress",{"aria-label":N,className:"mt-3 h-1.5 w-full accent-primary",max:Math.max(1,e.rows.length),value:k}),e.monitoringError&&(0,t.jsxs)("p",{className:"mt-3 text-amber-700 dark:text-amber-300",children:[f("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:f("statusUnavailable")}),C&&(0,t.jsx)("p",{className:"mt-3 text-amber-700 dark:text-amber-300",children:f("refreshWarning")}),e.legacyRefreshRequested&&I&&(0,t.jsx)("p",{className:"mt-3 text-amber-700 dark:text-amber-300",children:f("legacyWarning")}),e.legacyRefreshError&&(0,t.jsxs)("p",{className:"mt-3 break-words text-amber-700 dark:text-amber-300",children:[f("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:[f("pageUpdateError")," ",e.pageUpdateError]}),(0,t.jsx)(d.Button,{onClick:b,size:"sm",variant:"outline",children:f("retry")})]}),"finished"===e.phase&&!C&&!I&&(0,t.jsx)("p",{className:"mt-2 text-muted-foreground",children:f("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)(a.ChevronRight,{className:"size-4 transition-transform group-open:rotate-90"}),f("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.Badge,{variant:g(e)?"destructive":"SUCCEEDED"===e.status&&!e.worktreeRefreshError&&e.worktreesRefreshedAt?"success":"secondary",children:[p(e)&&(0,t.jsx)(c.Spinner,{"aria-hidden":"true"}),f(h[e.status])]})]}),e.skipReason&&(0,t.jsx)("p",{className:"text-muted-foreground",children:m[e.skipReason]?f(m[e.skipReason]):f("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:f("notScheduled")}),"SUBMISSION_FAILED"===e.status&&(0,t.jsx)("p",{className:"text-destructive",children:f("submissionFailed")}),e.worktreeRefreshError&&(0,t.jsxs)("p",{className:"break-words text-amber-700 dark:text-amber-300",children:[f("refreshWarning")," ",e.worktreeRefreshError]}),e.jobId&&(0,t.jsx)(d.Button,{asChild:!0,size:"sm",variant:"link",className:"h-auto px-0",children:(0,t.jsxs)(u.Link,{href:`/jobs/${e.jobId}`,target:"_blank",rel:"noreferrer",children:[f("logs")," ",(0,t.jsx)(s.ExternalLink,{})]})})]},e.codebaseId))})]})]})}],453154);var x=e.i(462777),b=e.i(637611),f=e.i(944887);let j="id agentId payload status error result updatedAt",v=new Set(["SUCCEEDED","FAILED","CANCELLED","TIMED_OUT"]),k=new Set(["starting","fetching","refreshing"]),w={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 I(e){return"string"==typeof e&&e.trim()?e:null}function N(e){return e instanceof Error?e.message:Array.isArray(e)?e.map(N).join("; "):I(C(e).message)??String(e)}function E(e,t){let r=C(t.result);return{...e,status:t.status,jobId:t.id,error:I(C(r.snapshot).error)??t.error,skipReason:null,worktreesRefreshedAt:I(r.worktreesRefreshedAt),worktreeRefreshError:I(r.worktreeRefreshError)}}e.s(["useWorktreeFetch",0,function({scopeKey:e,refreshPage:t}){let[r,a]=(0,l.useState)(null),s=(0,l.useRef)(null),n=(0,l.useRef)(null);r&&r.scopeKey!==e&&a(null),(0,l.useEffect)(()=>{let t={scopeKey:e};return n.current=t,()=>{n.current===t&&(n.current=null,s.current&&S(s.current),s.current=null)}},[e]);let i=(0,l.useCallback)(e=>s.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},a({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,b.controlPlaneRequest)("mutation RefreshWorktreesAfterFetch { refreshWorktrees }",void 0,{signal:e.controller.signal})}catch(t){if(!i(e))return;o(e,{legacyRefreshError:N(t)})}}if(i(e))try{await e.refreshPage(),o(e,{phase:"finished"})}catch(t){o(e,{phase:"refreshFailed",pageUpdateError:N(t)})}}},[i,o]),c=(0,l.useCallback)(async r=>{if(!n.current||n.current.scopeKey!==e||s.current&&k.has(s.current.batch.phase))return;let a=[...new Map(r.map(e=>[e.codebaseId,e])).values()];if(!a.length)return;s.current&&S(s.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.createClientId)(),phase:"starting",rows:a.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}};s.current=l,o(l,{});for(let e=0;e<a.length;e+=500){let t=a.slice(e,e+500).map(e=>e.codebaseId),r=new Set(t);try{let e=await (0,b.controlPlaneRequest)(`mutation FetchWorktreeCodebases($input: RunCodebaseOperationInput!) {
79
+ fetchCodebases(input: $input) {
80
+ jobs { ${j} }
81
+ skipped { codebaseId reason }
82
+ }
83
+ }`,{input:{codebaseIds:t,requestId:l.batch.id}},{signal:l.controller.signal});if(!i(l))return;let a=new Map;for(let t of e.fetchCodebases.jobs){let e=I(C(t.payload).codebaseId);e&&r.has(e)&&(a.set(e,t),l.jobs.set(t.id,t))}let s=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=a.get(e.codebaseId);if(t)return E(e,t);let n=s.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:N(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||w[t.status]<w[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,f.createRefreshCoalescer)(async e=>{let t=0;try{let r=c();for(let a=0;a<r.length;a+=200){let s=r.slice(a,a+200),n=await (0,b.controlPlaneRequest)(`query WorktreeFetchJobs($ids: [ID!]!) {
84
+ agentJobsByIds(ids: $ids) { ${j} }
85
+ }`,{ids:s},{signal:e});if(e.aborted||!i(l))return;let o=new Set(n.agentJobsByIds.map(e=>e.id));t+=s.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:N(t)})}u()});l.monitor=m;let p=(0,b.controlPlaneSubscriptions)();for(let e of c()){let t=p.subscribe({query:`subscription WorktreeFetchJobChanged($jobId: ID!) {
86
+ agentJobChanged(jobId: $jobId) { ${j} }
87
+ }`,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:N(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,b.onControlPlaneRecovery)(()=>void m.refresh()),m.refresh())},[i,o,t,e,d]),u=(0,l.useCallback)(async()=>{let e=s.current;e&&i(e)&&"refreshFailed"===e.batch.phase&&await d(e)},[i,d]),h=(0,l.useCallback)(()=>{let e=s.current;!e||k.has(e.batch.phase)||(S(e),s.current=null,a(null))},[]),m=r&&r.scopeKey===e?r.batch:null;return{batch:m,active:null!==m&&k.has(m.phase),start:c,retryPageUpdate:u,dismiss:h}}],5406)},756283,941179,e=>{"use strict";var t=e.i(271645),r=e.i(462777),a=e.i(637611),s=e.i(455329);async function n(e){return(await (0,a.controlPlaneRequest)(s.INSPECT_WORKTREE_MUTATION,{id:e,requestId:(0,r.createClientId)()})).inspectWorktree}e.s(["inspectWorktree",0,n,"useLiveWorktree",0,function(e){let[r,a]=(0,t.useState)(null),s=(0,t.useCallback)(t=>{a(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&&s(t)},[s]);return{worktree:r?.sourceUpdatedAt===e.updatedAt?{...e,...r.value}:e,applyActivity:n,setUnstagedChanges:(0,t.useCallback)(e=>s({hasUnstagedChanges:e}),[s])}},"useQueuedWorktreeInspection",0,function(e){let r=(0,t.useRef)(!1),a=(0,t.useRef)(!1);return(0,t.useCallback)(async()=>{if(r.current){a.current=!0;return}r.current=!0;try{do a.current=!1,await e();while(a.current)}finally{r.current=!1}},[e])},"useWorktreeActivitySubscription",0,function(e,r,s){let n=(0,t.useRef)(s);(0,t.useEffect)(()=>{n.current=s},[s]),(0,t.useEffect)(()=>{if(!r)return;let t=!1,s=0,i=null,l=()=>void 0,o=e=>{t||e!==s||null!==i||(i=window.setTimeout(()=>{i=null,d()},1e3))},d=()=>{let t=++s;l=(0,a.controlPlaneSubscriptions)().subscribe({query:`subscription WorktreeInspectionChanged($worktreeId: ID!) {
88
+ worktreeInspectionChanged(worktreeId: $worktreeId) {
89
+ worktreeId branch headSha upstream ahead behind syncState baseAhead baseBehind
90
+ hasStagedChanges hasUnstagedChanges rebaseInProgress hasConflicts pushStatus observedAt
91
+ }
92
+ }`,variables:{worktreeId:e}},{next:e=>{let t=e.data?.worktreeInspectionChanged;t&&n.current(t)},error:()=>o(t),complete:()=>o(t)})};return d(),()=>{t=!0,s+=1,null!==i&&window.clearTimeout(i),l()}},[r,e])}],756283);var i=e.i(843476),l=e.i(113030),o=e.i(263676),d=e.i(948148),c=e.i(501416),u=e.i(519455),h=e.i(906197),m=e.i(987968),p=e.i(440289);e.s(["WorktreeRebaseConflictItem",0,function({worktree:e,group:s,onCompleted:n,onError:g}){let x=(0,d.useTranslations)("worktrees"),[b,f]=(0,t.useState)(!1);if(!e.rebaseInProgress)return null;let j=s.mergeConflictQuickActions??[],v=async()=>{f(!0);try{let t=await (0,a.controlPlaneRequest)(`mutation CancelWorktreeRebase($input: RunWorktreeOperationInput!) {
93
+ runWorktreeOperation(input: $input) { id }
94
+ }`,{input:{worktreeId:e.id,operation:"CANCEL_REBASE",requestId:(0,r.createClientId)()}});await (0,p.waitForWorktreeJob)(t.runWorktreeOperation.id),await n(),g(null)}catch(e){g(e instanceof Error?e.message:String(e))}finally{f(!1)}};return(0,i.jsxs)(h.Item,{className:"border-destructive/40 bg-[color-mix(in_oklab,var(--destructive)_8%,var(--card))]",size:"sm",variant:"outline",children:[(0,i.jsx)(h.ItemMedia,{variant:"icon",children:(0,i.jsx)(l.GitMerge,{className:"text-destructive"})}),(0,i.jsxs)(h.ItemContent,{children:[(0,i.jsx)(h.ItemTitle,{children:x("rebasePaused")}),(0,i.jsx)(h.ItemDescription,{children:x(e.hasConflicts?"rebaseConflicts":"rebaseIncomplete")})]}),(0,i.jsx)(h.ItemActions,{children:(0,i.jsxs)(u.Button,{disabled:b,onClick:()=>void v(),size:"sm",variant:"outline",children:[b?(0,i.jsx)(m.Spinner,{}):(0,i.jsx)(o.X,{}),x("cancelRebase")]})}),e.hasConflicts&&j.length?(0,i.jsx)(h.ItemFooter,{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,i.jsx)(c.WorkflowQuickActions,{sessionData:{worktree:{id:e.id,path:e.folder,branch:e.branch,baseBranch:e.baseBranch,headSha:e.headSha,rebaseInProgress:!0,hasConflicts:!0},codebase:{id:s.codebase.id,folder:s.codebase.folder},repo:{id:s.repository.id,name:s.repository.name,url:s.repository.displayOrigin,displayOrigin:s.repository.displayOrigin}},worktreeId:e.id,workflows:j})}):null]})}],941179)},267572,e=>{"use strict";var t=e.i(843476),r=e.i(271645),a=e.i(763267),s=e.i(944887),n=e.i(876561),i=e.i(635416),l=e.i(768877),o=e.i(96892),d=e.i(689664),c=e.i(716327),u=e.i(867927),h=e.i(55677),m=e.i(452330),p=e.i(762368),g=e.i(482022),x=e.i(835079),b=e.i(269846),f=e.i(187516),j=e.i(113030),v=e.i(634398),k=e.i(851817),w=e.i(882505),y=e.i(84570),S=e.i(648119),C=e.i(939050),I=e.i(506184),N=e.i(515281),E=e.i(77071),T=e.i(741120),A=e.i(395925),D=e.i(856522),R=e.i(566595),B=e.i(868401),W=e.i(604139),P=e.i(759659),L=e.i(725981),M=e.i(861745),O=e.i(948148),$=e.i(90969),_=e.i(771777),U=e.i(866026),q=e.i(448295),F=e.i(966264),H=e.i(501416),V=e.i(653269),G=e.i(647776),K=e.i(227286),z=e.i(948812),J=e.i(356505),Q=e.i(486122),Y=e.i(929592),X=e.i(487486),Z=e.i(519455),ee=e.i(515288),et=e.i(257428),er=e.i(776639),ea=e.i(755146),es=e.i(82612),en=e.i(793479),ei=e.i(906197),el=e.i(110204),eo=e.i(337822),ed=e.i(983913),ec=e.i(987968),eu=e.i(967489),eh=e.i(784774),em=e.i(808562),ep=e.i(624687),eg=e.i(462777),ex=e.i(360583),eb=e.i(171502),ef=e.i(637611),ej=e.i(975157),ev=e.i(520133),ek=e.i(284494),ew=e.i(539531),ey=e.i(942230),eS=e.i(453154),eC=e.i(5406),eI=e.i(455329),eN=e.i(756283),eE=e.i(440289),eT=e.i(941179),eA=e.i(940276);let eD=["gray","stone","red","rose","orange","amber","yellow","lime","green","emerald","teal","cyan","sky","blue","indigo","violet","purple","fuchsia","pink","lavender","maroon","brown","olive","navy"],eR="worktrees-layout",eB="worktrees-group-by",eW="worktrees-filters",eP="__all__",eL="dirty",eM="clean",eO="non-default";function e$(e){return e?`${eW}:${e}`:eW}function e_(e){return e.hasStagedChanges||e.hasUnstagedChanges}function eU(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 eq(e,t){return e.some(e=>("string"==typeof e||"number"==typeof e)&&String(e).toLocaleLowerCase().includes(t))}function eF(e,t){let r=t.query.trim().toLocaleLowerCase();return r||t.agentId||t.repositoryId||null!==t.dirty||t.nonDefaultBranch?e.flatMap(e=>{if(t.agentId&&e.agent.id!==t.agentId)return[];let a=r.length>0&&eq([e.agent.id,e.agent.name,e.agent.hostname],r),s=e.codebases.flatMap(e=>{if(t.repositoryId&&e.repository.id!==t.repositoryId)return[];let s=r.length>0&&eq([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||a||s?e.worktrees:e.worktrees.filter(e=>eq([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=>e_(e)===t.dirty),l=t.nonDefaultBranch?e.codebase.defaultBranch?i.filter(t=>t.branch!==e.codebase.defaultBranch):[]:i;return l.length?[{...e,worktrees:l}]:[]});return s.length?[{...e,codebases:s}]:[]}):e}function eH(e){let t=new Map;return e.forEach(e=>e.codebases.forEach(r=>{let a=t.get(r.repository.id);a?a.entries.push({agentGroup:e,group:r}):t.set(r.repository.id,{repository:r.repository,entries:[{agentGroup:e,group:r}]})})),[...t.values()].sort((e,t)=>e.repository.name.localeCompare(t.repository.name))}function eV(e,t){if(!t)return e;let r=/^[A-Za-z]:[\\/]/.test(t)||t.startsWith("\\\\"),a=r?"\\":"/",s=e=>r?e.replaceAll("/","\\"):e,n=e=>(r?/^[A-Za-z]:\\$/.test(e):"/"===e)?e:e.replace(/[\\/]+$/,""),i=n(s(t)),l=n(s(e)),o=r?i.toLocaleLowerCase():i,d=r?l.toLocaleLowerCase():l;if(d===o)return".";let c=i.endsWith(a)?i:`${i}${a}`,u=r?c.toLocaleLowerCase():c;return d.startsWith(u)?l.slice(c.length):e}function eG(e){return{hasChanges:e_(e),stageOperation:e.hasStagedChanges&&!e.hasUnstagedChanges?"UNSTAGE_ALL":"STAGE_ALL"}}function eK(e,t,r,a){return e.agents.some(e=>e.codebases.some(e=>e.codebase.id===t&&e.worktrees.some(e=>e.id!==a&&e.branch===r)))}let ez={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"},eJ={gray:"border-slate-600 bg-slate-500",stone:"border-stone-600 bg-stone-500",red:"border-red-600 bg-red-500",rose:"border-rose-600 bg-rose-500",orange:"border-orange-600 bg-orange-500",amber:"border-amber-600 bg-amber-500",yellow:"border-yellow-600 bg-yellow-500",lime:"border-lime-600 bg-lime-500",green:"border-green-600 bg-green-500",emerald:"border-emerald-600 bg-emerald-500",teal:"border-teal-600 bg-teal-500",cyan:"border-cyan-600 bg-cyan-500",sky:"border-sky-600 bg-sky-500",blue:"border-blue-600 bg-blue-500",indigo:"border-indigo-600 bg-indigo-500",violet:"border-violet-600 bg-violet-500",purple:"border-purple-600 bg-purple-500",fuchsia:"border-fuchsia-600 bg-fuchsia-500",pink:"border-pink-600 bg-pink-500",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"},eQ={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 eY({moves:e,onReload:a,onError:s,onNotice:n}){let i=(0,O.useTranslations)("worktrees"),[l,o]=(0,r.useState)(null),d=async e=>{o(e.id);try{await (0,ef.controlPlaneRequest)(`mutation RetryWorktreeMove($id: ID!) {
95
+ retryWorktreeMoveWithStash(id: $id) { id status }
96
+ }`,{id:e.id});let t=await (0,eE.waitForWorktreeMove)(e.id);if("FAILED"===t.status)throw Error(t.error||i("moveFailed"));n("SUCCEEDED_WITH_WARNING"===t.status?t.warning||i("moveCompletedWithWarning"):i("moveCompleted")),s(null),await a()}catch(e){s(e instanceof Error?e.message:String(e))}finally{o(null)}},c=async e=>{o(e.id);try{await (0,ef.controlPlaneRequest)(`mutation CancelWorktreeMove($id: ID!) {
97
+ cancelWorktreeMove(id: $id) { id status }
98
+ }`,{id:e.id}),n(i("moveCancelled")),s(null),await a()}catch(e){s(e instanceof Error?e.message:String(e))}finally{o(null)}};return(0,t.jsx)("div",{className:"space-y-2",children:e.map(e=>(0,t.jsx)(Y.Alert,{children:(0,t.jsxs)(Y.AlertDescription,{className:"flex flex-wrap items-center justify-between gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"font-medium",children:i("moveProgress",{branch:e.branch})}),(0,t.jsx)("p",{className:"text-muted-foreground",children:"AWAITING_STASH"===e.status?e.error||i("moveNeedsStash"):i(`moveStatus.${e.status}`)})]}),"AWAITING_STASH"===e.status?(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(Z.Button,{disabled:l===e.id,onClick:()=>void c(e),size:"sm",variant:"outline",children:i("cancelMove")}),(0,t.jsxs)(Z.Button,{disabled:l===e.id,onClick:()=>void d(e),size:"sm",children:[l===e.id&&(0,t.jsx)(ec.Spinner,{}),i("stashAndContinue")]})]}):(0,t.jsx)(ec.Spinner,{})]})},e.id))})}function eX(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 eZ({overview:e,onCreated:a}){let s=(0,O.useTranslations)("worktrees"),n=e.agents.flatMap(e=>e.codebases.flatMap(t=>"ONLINE"===e.agent.connectionStatus&&e.agent.capabilities.includes("worktree.branch")&&"AVAILABLE"===t.codebase.availability&&!t.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(s("selectCodebase"));d(!0);try{let t=await (0,ef.controlPlaneRequest)(`mutation CreateWorktree($input: CreateWorktreeInput!) {
99
+ createWorktree(input: $input) { id }
100
+ }`,{input:{codebaseId:u.group.codebase.id,selection:e,requestId:(0,eg.createClientId)()}});await (0,eE.waitForWorktreeJob)(t.createWorktree.id),await a()}finally{d(!1)}};return(0,t.jsxs)(ee.Card,{children:[(0,t.jsx)(ee.CardHeader,{children:(0,t.jsx)(ee.CardTitle,{children:s("createWorktree")})}),(0,t.jsxs)(ee.CardContent,{className:"space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(el.Label,{className:"mb-1.5 block",children:s("repositoryCheckout")}),(0,t.jsx)(ed.SearchableSelect,{ariaLabel:s("repositoryCheckout"),disabled:o||0===h.length,emptyMessage:s("noEligibleCodebases"),onValueChange:l,options:h,placeholder:s("selectCodebase"),searchPlaceholder:s("searchCodebases"),value:c})]}),u?(0,t.jsx)(ek.WorktreeBranchForm,{busy:o,onSubmit:m,submitLabel:s("createWorktree"),target:eX(u.group)},u.group.codebase.id):(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:h.length?s("selectCodebaseHelp"):s("noEligibleCodebases")})]})]})}function e0({agent:e}){let r=(0,O.useTranslations)("worktrees"),a="ONLINE"===e.connectionStatus;return(0,t.jsx)(X.Badge,{variant:a?"success":"secondary",children:r(a?"online":"offline")})}function e1({agentGroup:e,group:a,layout:s,...n}){let i={...n,agentName:e.agent.name,baseRepoDirectory:e.agent.baseRepoDirectory,branchManagementEnabled:"ONLINE"===e.agent.connectionStatus&&e.agent.capabilities.includes("worktree.branch"),group:a,liveUpdatesEnabled:"ONLINE"===e.agent.connectionStatus&&e.agent.capabilities.includes("worktree.watch")};return"cards"!==s?(0,t.jsx)(tb,{...i}):(0,t.jsx)("div",{className:"space-y-3",children:a.worktrees.map(e=>(0,r.createElement)(e3,{...i,key:e.id,worktree:e}))})}function e5({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)(e0,{agent:e.agent})]}),e.codebases.map(a=>(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:a.repository.name}),(0,t.jsx)("p",{className:"font-mono text-xs text-muted-foreground",children:a.repository.displayOrigin})]}),(0,t.jsx)(e4,{codebase:a.codebase})]}),(0,t.jsx)(e1,{...r,agentGroup:e,group:a})]},a.codebase.id))]})}function e2({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:a})=>(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)(e0,{agent:e.agent})]}),(0,t.jsx)(e4,{codebase:a.codebase})]}),(0,t.jsx)(e1,{...r,agentGroup:e,group:a})]},a.codebase.id))]})}function e4({codebase:e}){let a=(0,O.useTranslations)("worktrees"),s=(0,M.useLocale)(),[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?a("neverFetched"):l<6e4?a("secondsAgo",{count:Math.floor(l/1e3)}):(0,ex.formatDateValue)(e.lastFetchedAt,"relative",{locale:s,now:n??void 0});return(0,t.jsx)("span",{className:(0,ej.cn)("text-xs text-muted-foreground",e.lastFetchError&&"text-destructive"),title:e.lastFetchError??void 0,children:a("lastFetched",{value:o})})}function e3(e){let{inspectionRefreshToken:a,onError:s}=e,{worktree:n,applyActivity:i,setUnstagedChanges:l}=(0,eN.useLiveWorktree)(e.worktree),o={...e,worktree:n},[d,h]=(0,r.useState)(!1),[m,p]=(0,r.useState)(null),[g,x]=(0,r.useState)(!1),b=(0,r.useRef)(0),f=(0,r.useRef)(a),j=(0,O.useTranslations)("worktrees"),v=(0,ev.useRouter)(),k=(0,r.useCallback)(async()=>{let e=++b.current;x(!0);try{let t=await (0,eN.inspectWorktree)(n.id);if(e!==b.current)return;p(t),l(t.changes.some(e=>e.unstaged||e.untracked||e.conflicted)),s(null)}catch(t){e===b.current&&s(t instanceof Error?t.message:String(t))}finally{e===b.current&&x(!1)}},[s,l,n.id]),w=(0,eN.useQueuedWorktreeInspection)(k),y=(0,r.useCallback)(e=>{i(e),d&&w()},[i,d,w]);(0,eN.useWorktreeActivitySubscription)(n.id,e.liveUpdatesEnabled&&"AVAILABLE"===n.availability,y),(0,r.useEffect)(()=>{if(f.current===a||(f.current=a,!d))return;let e=window.setTimeout(()=>void w(),0);return()=>window.clearTimeout(e)},[d,a,w]);let S=()=>{let e=!d;h(e),e&&!m&&w()};return(0,t.jsxs)(ee.Card,{className:(0,ej.cn)("cursor-pointer transition-colors hover:bg-muted/30",n.highlightColor&&eb.worktreeHighlightSurfaceClasses[n.highlightColor]),onClick:e=>{(0,eA.shouldNavigateWorktreeSurface)(e)&&v.push((0,eA.worktreeDetailHref)(n.id))},children:[(0,t.jsxs)(ee.CardHeader,{className:"grid-cols-1! @md/card-header:grid-cols-[minmax(0,1fr)_auto]!",children:[(0,t.jsxs)(ee.CardTitle,{className:"min-w-0",children:[(0,t.jsxs)(Z.Button,{"aria-expanded":d,className:"h-auto w-full max-w-full justify-start gap-1 p-1 text-left",onClick:()=>void S(),variant:"ghost",children:[d?(0,t.jsx)(c.ChevronDown,{}):(0,t.jsx)(u.ChevronRight,{}),(0,t.jsx)("span",{className:"truncate font-mono",children:n.branch??n.headSha?.slice(0,10)??j("detached")})]}),(n.ticketKey||n.ticketTitle)&&(0,t.jsx)(e6,{...o})]}),(0,t.jsxs)(ee.CardAction,{className:"col-start-1 row-span-1 row-start-auto flex max-w-full flex-wrap items-center justify-start gap-1 justify-self-start @md/card-header:col-start-2 @md/card-header:row-span-2 @md/card-header:row-start-1 @md/card-header:justify-end @md/card-header:justify-self-end",children:[(0,t.jsx)(tn,{worktree:n}),e_(n)&&(0,t.jsx)(X.Badge,{variant:"destructive",children:j("dirty")}),(0,t.jsx)(to,{...o})]})]}),(0,t.jsxs)(ee.CardContent,{className:"space-y-4",children:[(0,t.jsx)(e8,{...o,detailsExpanded:d,onToggleDetails:S}),(0,t.jsx)(eT.WorktreeRebaseConflictItem,{group:e.group,onCompleted:e.onReload,onError:e.onError,worktree:n}),g&&(0,t.jsxs)("p",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(ec.Spinner,{})," ",j("loadingDetails")]}),d&&m&&(0,t.jsx)(ey.WorktreeDetailPanel,{detail:m,inline:!0,worktreeId:n.id})]}),(0,t.jsxs)(ee.CardFooter,{className:"flex-col items-stretch gap-2","data-worktree-navigation-ignore":!0,children:[(0,t.jsx)(tm,{...o,onCompleted:async()=>{await e.onReload(),d&&await w()}}),(0,t.jsx)(ew.QuickActionsRow,{first:(0,t.jsx)(H.WorkflowQuickActions,{className:"w-auto",sessionData:{worktree:{id:n.id,path:n.folder,branch:n.branch,baseBranch:n.baseBranch,headSha:n.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:n.id,workflows:e.group.quickActions??[]}),second:(0,t.jsx)(V.CommandQuickActions,{agentCapabilities:e.overview.agents.find(t=>t.codebases.some(t=>t.codebase.id===e.group.codebase.id))?.agent.capabilities??[],className:"w-auto",worktreeId:n.id})})]})]})}function e7({worktree:e}){let r=(0,O.useTranslations)("worktrees"),a=e.branch??e.headSha?.slice(0,10)??r("detached"),s=r("openWorktreeDetails",{branch:a});return(0,t.jsx)(Z.Button,{asChild:!0,size:"icon-sm",variant:"ghost",children:(0,t.jsx)(ev.Link,{"aria-label":s,href:(0,eA.worktreeDetailHref)(e.id),title:s,children:(0,t.jsx)(l.ArrowRight,{})})})}function e6({worktree:e,onOpenTicket:r,compact:a=!1}){let s=`${e.ticketKey??""}${e.ticketTitle?`${e.ticketKey?" — ":""}${e.ticketTitle}`:""}`;return(0,t.jsxs)("div",{className:(0,ej.cn)("flex max-w-full flex-wrap items-center gap-1.5 font-normal",a?"mt-0.5 text-xs":"mt-1 text-sm"),children:[e.ticketKey?(0,t.jsx)(Z.Button,{className:"h-auto min-w-0 justify-start truncate p-0 text-left font-normal",onClick:()=>r(e.ticketKey),title:s,type:"button",variant:"link",children:s}):(0,t.jsx)("p",{className:"min-w-0 truncate text-muted-foreground",title:s,children:s}),e.ticketStatus&&(e.ticketKey?(0,t.jsx)(X.Badge,{asChild:!0,variant:"secondary",children:(0,t.jsx)("button",{onClick:()=>r(e.ticketKey),type:"button",children:e.ticketStatus})}):(0,t.jsx)(X.Badge,{variant:"secondary",children:e.ticketStatus}))]})}function e8(e){let{worktree:r,group:a,agentName:s,baseRepoDirectory:n,detailsExpanded:i,onToggleDetails:l}=e,o=(0,O.useTranslations)("worktrees");return(0,t.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,t.jsxs)("div",{className:"grid gap-3 md:grid-cols-2",children:[(0,t.jsx)(tv,{label:o("path"),mono:!0,value:eV(r.folder,n)}),(0,t.jsx)(ti,{...e})]}),(0,t.jsxs)(te,{label:o("upToDate"),children:[(0,t.jsx)(tr,{worktree:r}),(0,t.jsx)("span",{className:"pl-6 text-xs text-muted-foreground",children:o("agent")}),(0,t.jsx)(X.Badge,{variant:"outline",children:s})]}),(0,t.jsx)(tt,{...e}),(0,t.jsx)(te,{label:o("pullRequest"),children:(0,t.jsx)(ta,{detailsExpanded:i,onToggleDetails:l,worktree:r})}),r.latestBuild&&(0,t.jsx)(e9,{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}),!a.codebase.defaultBranch&&!r.baseBranchOverride&&(0,t.jsx)("span",{className:"text-xs text-destructive",children:o("baseUnavailable")})]})]})}function e9({build:e,onCompleted:r,onError:a}){let s=(0,O.useTranslations)("worktrees"),n=(0,O.useTranslations)("builds"),i="SUCCEEDED"===e.status&&e.artifacts.some(e=>"RUNNABLE_APP"===e.kind),{rebuild:l,rebuilding:o}=(0,_.useRebuildBuild)({buildId:e.id,onCompleted:()=>r(),onError:a});return(0,t.jsxs)(te,{label:s("latestBuild"),children:[(0,t.jsxs)(ea.DropdownMenu,{children:[(0,t.jsx)(ea.DropdownMenuTrigger,{asChild:!0,children:(0,t.jsx)(X.Badge,{asChild:!0,variant:"outline",children:(0,t.jsxs)("button",{type:"button",children:[n(`actions.${e.action}`),(0,t.jsx)(c.ChevronDown,{})]})})}),(0,t.jsxs)(ea.DropdownMenuContent,{align:"start",className:"w-36",children:[(0,t.jsx)(ea.DropdownMenuItem,{asChild:!0,children:(0,t.jsxs)(ev.Link,{href:`/builds/${e.id}`,children:[(0,t.jsx)(g.ExternalLink,{}),n("viewBuild")]})}),(0,t.jsxs)(ea.DropdownMenuItem,{disabled:o,onSelect:()=>void l(),children:[o?(0,t.jsx)(ec.Spinner,{}):(0,t.jsx)(A.RotateCcw,{}),n("rebuild")]})]})]}),"SUCCEEDED"===e.status?(0,t.jsx)(X.Badge,{asChild:!0,variant:(0,$.buildStatusVariant)(e.status),children:(0,t.jsx)(ev.Link,{href:`/builds/${e.id}`,children:n(`statuses.${e.status}`)})}):(0,t.jsx)(X.Badge,{variant:(0,$.buildStatusVariant)(e.status),children:n(`statuses.${e.status}`)}),e.outOfDate&&(0,t.jsx)(X.Badge,{className:"border-amber-500/40 text-amber-700 dark:text-amber-300",variant:"outline",children:n("outOfDate")}),i&&(0,t.jsx)(U.RunBuildControls,{buildId:e.id,destinationType:e.destinationType,onCompleted:r,onError:a,preferredDestination:e.destination,size:"sm"})]})}function te({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 tt({compact:e=!1,...r}){let{worktree:a}=r,s=(0,O.useTranslations)("worktrees");return(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[!e&&(0,t.jsx)("span",{className:"w-24 shrink-0 text-xs text-muted-foreground",children:s("tags")}),(0,t.jsx)(to,{...r,contentAlign:e?"end":"start",contentAlignOffset:e?0:-100,trigger:(0,t.jsx)(Z.Button,{"aria-label":`${s("tags")}: ${a.branch??s("detached")}`,className:(0,ej.cn)("h-auto min-h-7 max-w-full justify-start px-1 py-1 text-left font-normal",!e&&"-mx-1"),type:"button",variant:"ghost",children:(0,t.jsxs)("span",{className:"flex min-w-0 flex-wrap items-center gap-1.5",children:[a.tags.map(e=>(0,t.jsx)(tj,{tag:e},e.id)),!a.tags.length&&(0,t.jsx)("span",{className:"text-muted-foreground",children:"—"})]})})})]})}function tr({worktree:e}){let r=(0,O.useTranslations)("worktrees"),a=0===e.baseBehind;return(0,t.jsx)(X.Badge,{className:a?"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"):a?r("yes"):r("notUpToDate",{count:e.baseBehind})})}function ta({worktree:e,detailsExpanded:r,onToggleDetails:a}){var s;let n=(0,O.useTranslations)("worktrees"),i=(0,O.useTranslations)("gitlabPages"),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)(ts,{pullRequest:e.pullRequest}),(0,t.jsx)(G.PipelineMenu,{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)(X.Badge,{className:"APPROVED"===(s=e.pullRequest.reviewDecision)?"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300":"CHANGES_REQUESTED"===s?"border-red-500/30 bg-red-500/10 text-red-700 dark:text-red-300":"border-amber-500/30 bg-amber-500/10 text-amber-700 dark:text-amber-300",children:n(`review.${e.pullRequest.reviewDecision}`)}),(0,t.jsx)(X.Badge,{asChild:!0,className:0===e.pullRequest.unresolvedReviewThreadCount?"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300":"border-amber-500/30 bg-amber-500/10 text-amber-700 dark:text-amber-300",children:(0,t.jsx)(ev.Link,{href:(0,z.pullRequestCommentsHref)(e.pullRequest),children:n("comments",{count:e.pullRequest.unresolvedReviewThreadCount})})})]}):o?(0,t.jsxs)(ea.DropdownMenu,{children:[(0,t.jsx)(ea.DropdownMenuTrigger,{asChild:!0,children:(0,t.jsx)(X.Badge,{asChild:!0,children:(0,t.jsxs)("button",{type:"button",children:["MR !",o.number]})})}),(0,t.jsxs)(ea.DropdownMenuContent,{align:"start",className:"w-44",children:[(0,t.jsx)(ea.DropdownMenuItem,{asChild:!0,children:(0,t.jsxs)("a",{href:o.url,rel:"noreferrer",target:"_blank",children:[(0,t.jsx)(g.ExternalLink,{}),i("openInGitLab")]})}),o.projectId?(0,t.jsx)(ea.DropdownMenuItem,{asChild:!0,children:(0,t.jsxs)(ev.Link,{href:`/gitlab/merge-requests/${encodeURIComponent(o.projectId)}/${o.number}`,children:[(0,t.jsx)(j.GitMerge,{}),n("openDetails")]})}):null]})]}):null,(0,t.jsx)(K.GitLabWorktreePipelinesMenu,{pipelines:e.gitLabPipelines??[]}),e.pullRequest||o||(e.gitLabPipelines??[]).length||0!==l?null:(0,t.jsx)("span",{className:"text-muted-foreground",children:"—"}),l>0&&(a?(0,t.jsx)(X.Badge,{asChild:!0,variant:"secondary",children:(0,t.jsx)("button",{"aria-expanded":r,onClick:a,type:"button",children:n("branchCommits",{count:l})})}):(0,t.jsx)(X.Badge,{variant:"secondary",children:n("branchCommits",{count:l})}))]})}function ts({pullRequest:e}){let r=(0,O.useTranslations)("worktrees");return(0,t.jsxs)(ea.DropdownMenu,{children:[(0,t.jsx)(ea.DropdownMenuTrigger,{asChild:!0,children:(0,t.jsx)(X.Badge,{asChild:!0,children:(0,t.jsxs)("button",{type:"button",children:["PR #",e.number]})})}),(0,t.jsxs)(ea.DropdownMenuContent,{align:"start",className:"w-44",children:[(0,t.jsx)(ea.DropdownMenuItem,{asChild:!0,children:(0,t.jsxs)("a",{href:e.url,rel:"noreferrer",target:"_blank",children:[(0,t.jsx)(g.ExternalLink,{}),r("openInGitHub")]})}),(0,t.jsx)(ea.DropdownMenuItem,{asChild:!0,children:(0,t.jsxs)(ev.Link,{href:(0,z.pullRequestDetailHref)(e),children:[(0,t.jsx)(v.GitPullRequest,{}),r("openDetails")]})})]})]})}function tn({worktree:e}){var r,a;let s=(0,O.useTranslations)("worktrees");if("IN_SYNC"===e.syncState||0===e.ahead&&0===e.behind)return(0,t.jsx)(X.Badge,{className:"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300",variant:"outline",children:s("inSync")});let n=e.ahead??0,l=e.behind??0;return n>0||l>0?(0,t.jsxs)(t.Fragment,{children:[n>0&&(0,t.jsxs)(X.Badge,{className:"border-blue-500/30 bg-blue-500/10 text-blue-700 dark:text-blue-300",variant:"outline",children:[(0,t.jsx)(o.ArrowUp,{"data-icon":"inline-start"}),s("ahead",{count:n})]}),l>0&&(0,t.jsxs)(X.Badge,{className:"border-blue-500/30 bg-blue-500/10 text-blue-700 dark:text-blue-300",variant:"outline",children:[(0,t.jsx)(i.ArrowDown,{"data-icon":"inline-start"}),s("behind",{count:l})]})]}):(0,t.jsx)(X.Badge,{variant:"outline",children:(r=e,a=s,"AHEAD"===r.syncState?a("ahead",{count:r.ahead??0}):"BEHIND"===r.syncState?a("behind",{count:r.behind??0}):a("DIVERGED"===r.syncState?"diverged":"IN_SYNC"===r.syncState?"upToDate":"NO_UPSTREAM"===r.syncState?"unpublished":"DETACHED"===r.syncState?"detached":"unknown"))})}function ti(e){let{worktree:a,group:s,onUpdate:n,onError:i,compact:l=!1}=e,o=(0,O.useTranslations)("worktrees"),[d,c]=(0,r.useState)(!1),[u,h]=(0,r.useState)(!1),m="__inherit_remote_default__",p=Array.from(new Set([a.baseBranchOverride,s.codebase.defaultBranch,...s.codebase.remoteBranches].filter(e=>!!e))),g=async e=>{h(!0);try{let t=await (0,ef.controlPlaneRequest)(`mutation UpdateWorktreeBase($id: ID!, $baseBranch: String) {
101
+ updateWorktreeBaseBranch(id: $id, baseBranch: $baseBranch) { ${eI.WORKTREE_FIELDS} }
102
+ }`,{id:a.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,ej.cn)("flex min-h-6 min-w-0 items-center gap-1",!l&&"mt-0.5"),children:d?(0,t.jsxs)(eu.Select,{disabled:u,onOpenChange:c,onValueChange:e=>void g(e===m?"":e),open:d,value:a.baseBranchOverride??(s.codebase.defaultBranch?m:void 0),children:[(0,t.jsx)(eu.SelectTrigger,{"aria-label":o("baseBranch"),className:"h-7 min-w-40 max-w-full font-mono text-xs",size:"sm",children:(0,t.jsx)(eu.SelectValue,{placeholder:o("baseUnavailable")})}),(0,t.jsxs)(eu.SelectContent,{align:"start",children:[s.codebase.defaultBranch&&(0,t.jsxs)(eu.SelectItem,{value:m,children:[s.codebase.defaultBranch," · ",o("inheritBase")]}),p.map(e=>(0,t.jsx)(eu.SelectItem,{value:e,children:e},e))]})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"truncate font-mono text-xs",title:a.baseBranch??void 0,children:a.baseBranch??"—"}),(0,t.jsx)(Z.Button,{"aria-label":o("editBase"),onClick:()=>c(!0),size:"icon-xs",variant:"ghost",children:(0,t.jsx)(N.Pencil,{})})]})})]})}function tl(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 to(e){let a,s,{worktree:n,allTags:i,editorVariant:l,onUpdate:o,onError:d,onManageTags:c,contentAlign:u="end",contentAlignOffset:h=0,trigger:p}=e,g=(0,O.useTranslations)("worktrees"),[j,v]=(0,r.useState)(!1),[k,w]=(0,r.useState)(!1),[y,N]=(0,r.useState)(!1),[A,D]=(0,r.useState)(!1),[R,W]=(0,r.useState)(!1),[L,M]=(0,r.useState)(!1),[$,_]=(0,r.useState)(null),[U,q]=(0,r.useState)(null),F=(0,r.useRef)(!1),H=(a=e.overview.agents.find(t=>t.codebases.some(t=>t.codebase.id===e.group.codebase.id)))?e.overview.agents.flatMap(t=>t.agent.id===a.agent.id?[]:t.codebases.flatMap(r=>r.repository.id===e.group.repository.id?[{agentGroup:t,group:r}]:[])):[],V=(s=e.overview.agents.find(t=>t.codebases.some(t=>t.codebase.id===e.group.codebase.id)))&&"ONLINE"===s.agent.connectionStatus&&s.agent.capabilities.includes("worktree.move.push")?"AVAILABLE"!==e.worktree.availability||e.group.blockingJob||e.worktree.rebaseInProgress||e.overview.activeMoves.some(t=>t.sourceCodebaseId===e.group.codebase.id||t.targetCodebaseId===e.group.codebase.id)?g("moveBlocked.busy"):e.worktree.branch&&e.worktree.headSha?e.worktree.hasStagedChanges||e.worktree.hasUnstagedChanges||"DIRTY"===e.worktree.pushStatus?g("moveBlocked.dirty"):"BEHIND"===e.worktree.pushStatus?g("moveBlocked.behind"):"DIVERGED"===e.worktree.pushStatus?g("moveBlocked.diverged"):"READY"!==e.worktree.pushStatus?g("moveBlocked.unknown"):H.some(t=>tl(t,e.overview))?null:g("moveBlocked.destination"):g("moveBlocked.detached"):g("moveBlocked.agent"),G=e.overview.agents.find(t=>t.codebases.some(t=>t.codebase.id===e.group.codebase.id)),K=!G||"ONLINE"!==G.agent.connectionStatus||!G.agent.capabilities.includes("worktree.delete")||"AVAILABLE"!==n.availability||!!e.group.blockingJob||n.rebaseInProgress||e.overview.activeMoves.some(t=>t.sourceCodebaseId===e.group.codebase.id||t.targetCodebaseId===e.group.codebase.id),z=new Set(n.tags.map(e=>e.id)),J=async(e,t)=>{let r=t?[...z,e]:[...z].filter(t=>t!==e);try{let e=await (0,ef.controlPlaneRequest)(`mutation SetWorktreeTags($id: ID!, $tagIds: [ID!]!) { setWorktreeTags(id: $id, tagIds: $tagIds) { ${eI.WORKTREE_FIELDS} } }`,{id:n.id,tagIds:r});o(e.setWorktreeTags),d(null)}catch(e){d(e instanceof Error?e.message:String(e))}},Q=async e=>{try{let t=await (0,ef.controlPlaneRequest)(`mutation HighlightWorktree($id: ID!, $color: String) { updateWorktreeHighlight(id: $id, color: $color) { ${eI.WORKTREE_FIELDS} } }`,{id:n.id,color:e});o(t.updateWorktreeHighlight),d(null)}catch(e){d(e instanceof Error?e.message:String(e))}},X=async()=>{M(!0);try{let e=await (0,ef.controlPlaneRequest)(`mutation RefreshWorktreePullRequest($id: ID!) {
103
+ refreshWorktreePullRequest(id: $id) { ${eI.WORKTREE_FIELDS} }
104
+ }`,{id:n.id});o(e.refreshWorktreePullRequest),d(null)}catch(e){d(e instanceof Error?e.message:String(e))}finally{M(!1)}},ee=async(t,r=!1)=>{W(!0);try{let a=await (0,ef.controlPlaneRequest)(`mutation ChangeWorktreeBranch($input: ChangeWorktreeBranchInput!) {
105
+ changeWorktreeBranch(input: $input) { id }
106
+ }`,{input:{worktreeId:n.id,selection:t,requestId:(0,eg.createClientId)(),stashOnFailure:r}});await (0,eE.waitForWorktreeJob)(a.changeWorktreeBranch.id),await e.onReload(),_(null),q(null),v(!1),d(null)}finally{W(!1)}},et=async()=>{if($)try{q(null),await ee($,!0)}catch(e){q(e instanceof Error?e.message:String(e))}},er=e.group.codebase.defaultBranch,es=!!(er&&eK(e.overview,e.group.codebase.id,er,n.id)),en=!e.branchManagementEnabled||"AVAILABLE"!==n.availability||!!e.group.blockingJob||n.rebaseInProgress,ei=async()=>{if(er)try{await ee({mode:"EXISTING",branchName:er,baseBranch:er})}catch(e){d(e instanceof Error?e.message:String(e))}};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(eo.Popover,{onOpenChange:e=>{v(e),e||(_(null),q(null))},open:j,children:[(0,t.jsxs)(ea.DropdownMenu,{children:[(0,t.jsx)(ea.DropdownMenuTrigger,{asChild:!0,children:(0,t.jsx)(eo.PopoverAnchor,{asChild:!0,children:p??(0,t.jsx)(Z.Button,{"aria-label":g("customize"),size:"icon-sm",variant:"ghost",children:(0,t.jsx)(S.MoreHorizontal,{})})})}),(0,t.jsxs)(ea.DropdownMenuContent,{align:u,alignOffset:h,className:"w-72",onCloseAutoFocus:e=>{F.current&&(F.current=!1,e.preventDefault(),v(!0))},children:[H.length>0&&(0,t.jsxs)(ea.DropdownMenuItem,{disabled:!!V,onSelect:()=>N(!0),title:V??void 0,children:[(0,t.jsx)(C.MoveRight,{})," ",g("moveToAgent")]}),(0,t.jsxs)(ea.DropdownMenuItem,{disabled:en,onSelect:()=>{F.current=!0},children:[(0,t.jsx)(b.GitBranch,{})," ",g("changeBranch")]}),er&&!es&&(0,t.jsxs)(ea.DropdownMenuItem,{disabled:en||R||n.branch===er,onSelect:()=>void ei(),children:[R?(0,t.jsx)(ec.Spinner,{}):(0,t.jsx)(b.GitBranch,{})," ",g("changeBranchToDefault",{branch:er})]}),(0,t.jsxs)(ea.DropdownMenuItem,{disabled:"AVAILABLE"!==n.availability||!!e.group.blockingJob||n.rebaseInProgress||!G?.agent.capabilities.includes("worktree.commit")||!n.hasStagedChanges&&!n.hasUnstagedChanges,onSelect:()=>w(!0),children:[(0,t.jsx)(f.GitCommitHorizontal,{})," ",g("commit")]}),"NONE"!==l&&(0,t.jsx)(tx,{icon:(0,t.jsx)(m.Code2,{}),label:g("CODE_INSIDERS"===l?"openInsiders":"openCode"),operation:"OPEN_EDITOR",disabled:!!e.group.blockingJob,props:{...e,onCompleted:e.onReload}}),(0,t.jsx)(ea.DropdownMenuItem,{asChild:!0,children:(0,t.jsxs)(ev.Link,{href:`/codebases/${e.group.codebase.id}`,children:[(0,t.jsx)(m.Code2,{})," ",g("viewCodebase")]})}),(0,t.jsx)(ea.DropdownMenuItem,{asChild:!0,children:(0,t.jsxs)(ev.Link,{href:`/codebases/repositories/${e.group.repository.id}`,children:[(0,t.jsx)(x.FolderGit2,{})," ",g("viewRepository")]})}),n.branch&&/^github\.com\/[^/]+\/[^/]+$/i.test(e.group.repository.canonicalOrigin)&&(0,t.jsxs)(ea.DropdownMenuItem,{disabled:L,onSelect:()=>void X(),children:[L?(0,t.jsx)(ec.Spinner,{}):(0,t.jsx)(T.RefreshCw,{})," ",g("refreshPullRequest")]}),(0,t.jsx)(ea.DropdownMenuSeparator,{}),(0,t.jsxs)(ea.DropdownMenuLabel,{className:"flex items-center gap-1.5 leading-none",children:[(0,t.jsx)(B.Tags,{className:"size-3"}),(0,t.jsx)("span",{children:g("tags")})]}),i.map(e=>(0,t.jsxs)(ea.DropdownMenuCheckboxItem,{checked:z.has(e.id),onCheckedChange:t=>void J(e.id,!!t),children:[(0,t.jsx)("span",{className:(0,ej.cn)("size-3 rounded-full border",eJ[e.color])})," ",e.name]},e.id)),(0,t.jsxs)(ea.DropdownMenuItem,{onSelect:c,children:[(0,t.jsx)(E.Plus,{})," ",g("manageTags")]}),(0,t.jsx)(ea.DropdownMenuSeparator,{}),(0,t.jsxs)(ea.DropdownMenuLabel,{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.Paintbrush,{className:"size-3"}),(0,t.jsx)("span",{children:g("highlight")})]}),(0,t.jsx)(Z.Button,{"aria-label":g("clearHighlight"),className:"size-6",disabled:!n.highlightColor,onClick:e=>{e.stopPropagation(),Q(null)},size:"icon-sm",variant:"ghost",children:(0,t.jsx)(P.Trash2,{className:"size-3"})})]}),(0,t.jsx)(em.ToggleGroup,{"aria-label":g("highlight"),className:"grid w-full grid-cols-8 gap-1 px-1.5 pb-1",onClick:e=>e.stopPropagation(),onValueChange:e=>{e&&Q(e)},size:"sm",spacing:1,type:"single",value:n.highlightColor??"",variant:"outline",children:eD.map(e=>(0,t.jsx)(em.ToggleGroupItem,{"aria-label":e,className:(0,ej.cn)("aspect-square h-auto w-full min-w-0 p-0",eJ[e],eQ[e],"data-[state=on]:ring-2 data-[state=on]:ring-foreground"),value:e},e))}),!n.primary&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ea.DropdownMenuSeparator,{}),(0,t.jsxs)(ea.DropdownMenuItem,{disabled:K,onSelect:()=>D(!0),variant:"destructive",children:[(0,t.jsx)(P.Trash2,{})," ",g("deleteWorktree")]})]})]})]}),(0,t.jsxs)(eo.PopoverContent,{align:u,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:g("changeBranch")}),(0,t.jsx)("p",{className:"mt-1 truncate font-mono text-xs text-muted-foreground",children:eV(n.folder,e.baseRepoDirectory)})]}),(0,t.jsx)(ek.WorktreeBranchForm,{busy:R,onSubmit:e=>ee(e),onSubmitError:e=>{_(n.hasStagedChanges||n.hasUnstagedChanges?e:null)},recovery:$?(0,t.jsx)(Y.Alert,{children:(0,t.jsxs)(Y.AlertDescription,{className:"space-y-2",children:[(0,t.jsx)("p",{children:g("stashRetryHelp")}),U&&(0,t.jsx)("p",{className:"text-destructive",children:U}),(0,t.jsxs)(Z.Button,{disabled:R,onClick:()=>void et(),size:"sm",type:"button",variant:"outline",children:[R&&(0,t.jsx)(ec.Spinner,{}),g("stashAndRetry")]})]})}):null,submitLabel:g("changeBranch"),target:eX(e.group,n)})]})]}),y&&(0,t.jsx)(tc,{onOpenChange:N,open:y,props:e,targets:H.filter(t=>tl(t,e.overview))}),k&&(0,t.jsx)(td,{onOpenChange:w,onReload:e.onReload,open:k,worktree:n}),!n.primary&&A&&(0,t.jsx)(tu,{onOpenChange:D,open:A,props:e})]})}function td({worktree:e,open:a,onOpenChange:s,onReload:n}){let i=(0,O.useTranslations)("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),[b,f]=(0,r.useState)(!1),[j,v]=(0,r.useState)(null);(0,r.useEffect)(()=>{let t=!1;return(0,eN.inspectWorktree)(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 k=async()=>{f(!0),v(null);try{let t=await (0,ef.controlPlaneRequest)(`mutation CommitWorktree($input: CommitWorktreeInput!) {
107
+ commitWorktree(input: $input) { id }
108
+ }`,{input:{worktreeId:e.id,message:d,signed:u,stageAll:m,paths:m?[]:[...g],requestId:(0,eg.createClientId)()}});await (0,eE.waitForWorktreeJob)(t.commitWorktree.id),await n(),s(!1)}catch(e){v(e instanceof Error?e.message:String(e))}finally{f(!1)}};return(0,t.jsx)(er.Dialog,{onOpenChange:s,open:a,children:(0,t.jsxs)(er.DialogContent,{className:"max-h-[min(42rem,calc(100vh-2rem))] overflow-y-auto sm:max-w-lg",children:[(0,t.jsxs)(er.DialogHeader,{children:[(0,t.jsx)(er.DialogTitle,{children:i("commitTitle")}),(0,t.jsx)(er.DialogDescription,{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)(el.Label,{htmlFor:"worktree-commit-message",children:i("commitMessage")}),(0,t.jsx)(ep.Textarea,{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)(et.Checkbox,{checked:u,onCheckedChange:e=>h(!!e)}),i("signedCommit")]}),(0,t.jsxs)("label",{className:"flex items-center gap-2 text-sm",children:[(0,t.jsx)(et.Checkbox,{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)(et.Checkbox,{checked:g.has(e.path),onCheckedChange:t=>{x(r=>{let a=new Set(r);return t?a.add(e.path):a.delete(e.path),a})}}),(0,t.jsx)("span",{className:"break-all font-mono text-xs",children:e.path})]},e.path))}),!l&&!j&&(0,t.jsx)(ec.Spinner,{}),j&&(0,t.jsx)(Y.Alert,{variant:"destructive",children:(0,t.jsx)(Y.AlertDescription,{children:j})})]}),(0,t.jsxs)(er.DialogFooter,{children:[(0,t.jsx)(Z.Button,{disabled:b,onClick:()=>s(!1),variant:"outline",children:i("cancel")}),(0,t.jsxs)(Z.Button,{disabled:b||!l||!d.trim()||!m&&0===g.size,onClick:()=>void k(),children:[b&&(0,t.jsx)(ec.Spinner,{})," ",i("commit")]})]})]})})}function tc({props:e,targets:a,open:s,onOpenChange:n}){let i=(0,O.useTranslations)("worktrees"),l=1===a.length?a[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,b]=(0,r.useState)(null),[f,j]=(0,r.useState)(null),v=a.some(e=>e.group.codebase.id===o)?o:1===a.length?a[0].group.codebase.id:"",k=a.find(e=>e.group.codebase.id===v),w=a.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=k?.group.worktrees.find(e=>e.id===c),S=k?.group.worktrees.find(t=>t.branch===e.worktree.branch),C=!e.worktree.primary&&e.overview.agents.some(t=>t.codebases.some(t=>t.codebase.id===e.group.codebase.id)&&t.agent.capabilities.includes("worktree.delete")),I=async t=>{if("AWAITING_STASH"===t.status){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)},N=async()=>{if(k){g(!0),b(null);try{let t=await (0,ef.controlPlaneRequest)(`mutation MoveWorktree($input: MoveWorktreeInput!) {
109
+ moveWorktree(input: $input) {
110
+ id sourceWorktreeId sourceCodebaseId targetCodebaseId targetWorktreeId destinationMode
111
+ branch headSha deleteSource status sourceJobId targetJobId cleanupJobId error warning
112
+ createdAt updatedAt finishedAt
113
+ }
114
+ }`,{input:{sourceWorktreeId:e.worktree.id,targetCodebaseId:k.group.codebase.id,targetWorktreeId:"__new__"===c?null:c,deleteSource:h,requestId:(0,eg.createClientId)()}});await I(await (0,eE.waitForWorktreeMove)(t.moveWorktree.id))}catch(e){b(e instanceof Error?e.message:String(e))}finally{g(!1)}}},E=async()=>{if(f){g(!0),b(null);try{await (0,ef.controlPlaneRequest)(`mutation RetryMove($id: ID!) {
115
+ retryWorktreeMoveWithStash(id: $id) { id status }
116
+ }`,{id:f.id}),await I(await (0,eE.waitForWorktreeMove)(f.id))}catch(e){b(e instanceof Error?e.message:String(e))}finally{g(!1)}}},T=async()=>{if(f){g(!0);try{await (0,ef.controlPlaneRequest)(`mutation CancelMove($id: ID!) {
117
+ cancelWorktreeMove(id: $id) { id status }
118
+ }`,{id:f.id}),await e.onReload(),n(!1)}catch(e){b(e instanceof Error?e.message:String(e))}finally{g(!1)}}};return(0,t.jsx)(er.Dialog,{onOpenChange:e=>!p&&n(e),open:s,children:(0,t.jsxs)(er.DialogContent,{className:"sm:max-w-xl",children:[(0,t.jsxs)(er.DialogHeader,{children:[(0,t.jsx)(er.DialogTitle,{children:i("moveToAgent")}),(0,t.jsx)(er.DialogDescription,{children:i("moveDescription",{branch:e.worktree.branch??""})})]}),f?(0,t.jsx)(Y.Alert,{children:(0,t.jsxs)(Y.AlertDescription,{className:"space-y-3",children:[(0,t.jsx)("p",{children:f.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)(el.Label,{className:"mb-1.5 block",children:i("destinationAgent")}),(0,t.jsx)(ed.SearchableSelect,{ariaLabel:i("destinationAgent"),disabled:p,emptyMessage:i("noMoveDestinations"),onValueChange:e=>{d(e),u("__new__")},options:w,placeholder:i("selectDestinationAgent"),searchPlaceholder:i("searchDestinationAgents"),value:v})]}),k&&(0,t.jsxs)("div",{children:[(0,t.jsx)(el.Label,{className:"mb-1.5 block",children:i("destinationWorktree")}),(0,t.jsxs)(eu.Select,{disabled:p,onValueChange:u,value:c,children:[(0,t.jsx)(eu.SelectTrigger,{"aria-label":i("destinationWorktree"),children:(0,t.jsx)(eu.SelectValue,{})}),(0,t.jsxs)(eu.SelectContent,{children:[(0,t.jsx)(eu.SelectItem,{disabled:!!S,value:"__new__",children:i("createDestinationWorktree")}),k.group.worktrees.filter(e=>"AVAILABLE"===e.availability).map(e=>(0,t.jsxs)(eu.SelectItem,{disabled:!!S&&S.id!==e.id,value:e.id,children:[e.branch??i("detached")," ·"," ",e.relativePath]},e.id))]})]})]}),y&&(y.hasStagedChanges||y.hasUnstagedChanges)&&(0,t.jsx)(Y.Alert,{children:(0,t.jsx)(Y.AlertDescription,{children:i("dirtyDestinationWarning")})}),(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(et.Checkbox,{checked:h,disabled:!C||p,id:`delete-source-${e.worktree.id}`,onCheckedChange:e=>m(!!e)}),(0,t.jsxs)("div",{children:[(0,t.jsx)(el.Label,{htmlFor:`delete-source-${e.worktree.id}`,children:i("deleteOldWorktree")}),!C&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:i("deleteOldWorktreeDisabled")})]})]})]}),x&&(0,t.jsx)(Y.Alert,{variant:"destructive",children:(0,t.jsx)(Y.AlertDescription,{children:x})}),(0,t.jsxs)(er.DialogFooter,{children:[(0,t.jsx)(Z.Button,{disabled:p,onClick:()=>f?void T():n(!1),variant:"outline",children:f?i("cancelMove"):i("cancel")}),(0,t.jsxs)(Z.Button,{disabled:p||!f&&!k,onClick:()=>f?void E():void N(),children:[p&&(0,t.jsx)(ec.Spinner,{}),f?i("stashAndContinue"):i("moveWorktree")]})]})]})})}function tu({props:e,open:a,onOpenChange:s}){let n=(0,O.useTranslations)("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,ef.controlPlaneRequest)(`mutation DeleteWorktree($input: DeleteWorktreeInput!) {
119
+ deleteWorktree(input: $input) { id }
120
+ }`,{input:{worktreeId:e.worktree.id,deleteRemoteBranch:i,requestId:(0,eg.createClientId)()}});await (0,eE.waitForWorktreeJob)(t.deleteWorktree.id),await e.onReload(),e.onError(null),e.onDeleted?.(),s(!1)}catch(e){u(e instanceof Error?e.message:String(e))}finally{d(!1)}};return(0,t.jsx)(er.Dialog,{onOpenChange:e=>!o&&s(e),open:a,children:(0,t.jsxs)(er.DialogContent,{children:[(0,t.jsxs)(er.DialogHeader,{children:[(0,t.jsx)(er.DialogTitle,{children:n("deleteWorktree")}),(0,t.jsx)(er.DialogDescription,{children:n("deleteWorktreeDescription",{path:eV(e.worktree.folder,e.baseRepoDirectory)})})]}),(0,t.jsx)(Y.Alert,{variant:"destructive",children:(0,t.jsx)(Y.AlertDescription,{children:n("deleteWorktreeWarning")})}),h&&(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(et.Checkbox,{checked:i,disabled:o||m,id:`delete-remote-${e.worktree.id}`,onCheckedChange:e=>l(!!e)}),(0,t.jsxs)("div",{children:[(0,t.jsx)(el.Label,{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)(Y.Alert,{variant:"destructive",children:(0,t.jsx)(Y.AlertDescription,{children:c})}),(0,t.jsxs)(er.DialogFooter,{children:[(0,t.jsx)(Z.Button,{disabled:o,onClick:()=>s(!1),variant:"outline",children:n("cancel")}),(0,t.jsxs)(Z.Button,{disabled:o,onClick:()=>void p(),variant:"destructive",children:[o&&(0,t.jsx)(ec.Spinner,{}),n("deleteWorktree")]})]})]})})}function th(e){let{worktree:r}=e,{appId:a}=e,s=(0,O.useTranslations)("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)(q.StartBuildButton,{buildSettingsHref:i?`/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?s("iosBuildNotConfigured"):"AVAILABLE"!==r.availability?s("worktreeUnavailable"):null:s("agentUnsupported"):s("agentOffline"),onStarted:()=>void e.onCompleted(),worktreeId:r.id}),o?(0,t.jsxs)(Z.Button,{disabled:!0,size:"sm",variant:"outline",children:[(0,t.jsx)(W.Terminal,{})," ",s("newSession")]}):(0,t.jsx)(Z.Button,{asChild:!0,size:"sm",variant:"outline",children:(0,t.jsxs)(ev.Link,{href:`/runs/new?kind=session&worktree=${r.id}${a?`&app=${encodeURIComponent(a)}`:""}`,children:[(0,t.jsx)(W.Terminal,{})," ",s("newSession")]})}),o?(0,t.jsxs)(Z.Button,{disabled:!0,size:"sm",variant:"outline",children:[(0,t.jsx)(h.ClipboardList,{})," ",s("newPlan")]}):(0,t.jsx)(Z.Button,{asChild:!0,size:"sm",variant:"outline",children:(0,t.jsxs)(ev.Link,{href:`/runs/new?kind=plan&worktree=${r.id}${a?`&app=${encodeURIComponent(a)}`:""}`,children:[(0,t.jsx)(h.ClipboardList,{})," ",s("newPlan")]})})]})}function tm(e){let{worktree:r}=e,a=(0,O.useTranslations)("worktrees"),s="AVAILABLE"!==r.availability||!!e.group.blockingJob||r.rebaseInProgress,i=eG(r);return(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsx)(th,{...e}),(0,t.jsx)(tg,{icon:(0,t.jsx)(p.Download,{}),label:a("pull"),operation:"PULL",props:e,disabled:s||!r.upstream||0===r.behind}),(0,t.jsx)(tg,{confirm:!0,icon:(0,t.jsx)(T.RefreshCw,{}),label:a("sync"),operation:"SYNC",props:e,disabled:s||!r.upstream||!r.baseBranch||0===r.baseBehind}),(0,t.jsx)(tg,{confirm:!0,icon:(0,t.jsx)(j.GitMerge,{}),label:a("rebase"),operation:"REBASE",props:e,disabled:s||!r.baseBranch||0===r.baseBehind}),(0,t.jsx)(tg,{icon:(0,t.jsx)(L.Upload,{}),label:a(r.upstream?"push":"publish"),operation:"PUSH",props:e,disabled:s||!r.branch}),(0,t.jsx)(F.AutoSyncButton,{conflictWorkflows:e.group.mergeConflictQuickActions??[],disabled:s||!r.upstream||!r.baseBranch,onCompleted:e.onCompleted,onError:e.onError,worktree:r}),(0,t.jsx)(F.AutoMergeButton,{conflictWorkflows:e.group.mergeConflictQuickActions??[],disabled:s,onCompleted:e.onCompleted,onError:e.onError,worktree:r}),(0,t.jsxs)(ea.DropdownMenu,{children:[(0,t.jsx)(ea.DropdownMenuTrigger,{asChild:!0,children:(0,t.jsxs)(Z.Button,{size:"sm",variant:"outline",children:[(0,t.jsx)(S.MoreHorizontal,{})," ",a("moreActions")]})}),(0,t.jsxs)(ea.DropdownMenuContent,{align:"end",children:[(0,t.jsx)(tx,{confirm:!0,icon:(0,t.jsx)(L.Upload,{}),label:a("forcePush"),operation:"FORCE_PUSH",props:e,disabled:s||!r.upstream}),(0,t.jsx)(tx,{confirm:!0,icon:(0,t.jsx)(A.RotateCcw,{}),label:a("reset"),operation:"RESET",props:e,disabled:s||!r.upstream}),(0,t.jsx)(tx,{confirm:!0,icon:(0,t.jsx)(y.LockOpen,{}),label:a("clearLock"),operation:"CLEAR_LOCK",props:e,disabled:s}),(0,t.jsx)(tx,{icon:(0,t.jsx)(n.Archive,{}),label:a("stashAll"),operation:"STASH_ALL",props:e,disabled:s||!i.hasChanges}),(0,t.jsx)(tx,{icon:(0,t.jsx)(d.Check,{}),label:a("UNSTAGE_ALL"===i.stageOperation?"unstageAll":"stageAll"),operation:i.stageOperation,props:e,disabled:s||!i.hasChanges})]})]}),r.activeJob&&(0,t.jsxs)("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,t.jsx)(ec.Spinner,{})," ",a("operationRunning")]})]})}function tp({props:e,operation:t,confirm:a=!1}){let s=(0,O.useTranslations)("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(a&&!n){i(!0),u.current=window.setTimeout(()=>i(!1),5e3);return}o(!0),i(!1);try{let r=await (0,ef.controlPlaneRequest)("mutation RunWorktreeOperation($input: RunWorktreeOperationInput!) { runWorktreeOperation(input: $input) { id } }",{input:{worktreeId:e.worktree.id,operation:t,requestId:(0,eg.createClientId)(),...d?{forcePreparations:!0}:{}}});e.onError(null),await e.onCompleted();let a=await (0,eE.waitForWorktreeOperationJob)(r.runWorktreeOperation.id);if(await e.onCompleted(),a?.outcome==="PREPARATION_CONFLICT"){c(!0),i(!0),e.onError(s("preparationConflict",{paths:a.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 tg({props:e,operation:r,label:a,icon:s,confirm:n=!1,disabled:i=!1}){let l=(0,O.useTranslations)("worktrees"),{armed:o,busy:c,forcePreparations:u,run:h}=tp({props:e,operation:r,confirm:n});return(0,t.jsxs)(Z.Button,{disabled:i||c,onClick:()=>void h(),size:"sm",variant:o?"destructive":"outline",children:[c?(0,t.jsx)(ec.Spinner,{}):o?(0,t.jsx)(d.Check,{}):s," ",o?l(u?"forcePreparationOperation":"confirmAction"):a]})}function tx({props:e,operation:r,label:a,icon:s,confirm:n=!1,disabled:i=!1}){let l=(0,O.useTranslations)("worktrees"),{armed:o,busy:c,run:u}=tp({props:e,operation:r,confirm:n});return(0,t.jsxs)(ea.DropdownMenuItem,{disabled:i||c,onSelect:e=>{n&&!o&&e.preventDefault(),u()},variant:o?"destructive":"default",children:[c?(0,t.jsx)(ec.Spinner,{}):o?(0,t.jsx)(d.Check,{}):s,o?l("confirmAction"):a]})}function tb(e){let a=(0,O.useTranslations)("worktrees");return(0,t.jsx)("div",{className:"rounded-xl border",children:(0,t.jsxs)(eh.Table,{children:[(0,t.jsx)(eh.TableHeader,{children:(0,t.jsxs)(eh.TableRow,{children:[(0,t.jsx)(eh.TableHead,{children:a("branch")}),(0,t.jsx)(eh.TableHead,{children:a("path")}),(0,t.jsx)(eh.TableHead,{children:a("baseBranch")}),(0,t.jsx)(eh.TableHead,{children:a("upToDate")}),(0,t.jsx)(eh.TableHead,{children:a("tags")}),(0,t.jsx)(eh.TableHead,{children:a("pullRequest")}),(0,t.jsx)(eh.TableHead,{children:a("origin")}),(0,t.jsx)(eh.TableHead,{})]})}),(0,t.jsx)(eh.TableBody,{children:e.group.worktrees.map(t=>(0,r.createElement)(tf,{...e,key:t.id,worktree:t}))})]})})}function tf(e){let{baseRepoDirectory:a,inspectionRefreshToken:s,onError:n}=e,{worktree:i,applyActivity:l,setUnstagedChanges:o}=(0,eN.useLiveWorktree)(e.worktree),d={...e,worktree:i},h=(0,O.useTranslations)("worktrees"),m=(0,ev.useRouter)(),[p,g]=(0,r.useState)(!1),[x,b]=(0,r.useState)(null),[f,j]=(0,r.useState)(!1),v=(0,r.useRef)(0),k=(0,r.useRef)(s),w=(0,r.useCallback)(async()=>{let e=++v.current;j(!0);try{let t=await (0,eN.inspectWorktree)(i.id);if(e!==v.current)return;b(t),o(t.changes.some(e=>e.unstaged||e.untracked||e.conflicted)),n(null)}catch(t){e===v.current&&n(t instanceof Error?t.message:String(t))}finally{e===v.current&&j(!1)}},[n,o,i.id]),y=(0,eN.useQueuedWorktreeInspection)(w),S=(0,r.useCallback)(e=>{l(e),p&&y()},[l,p,y]);(0,eN.useWorktreeActivitySubscription)(i.id,e.liveUpdatesEnabled&&"AVAILABLE"===i.availability,S),(0,r.useEffect)(()=>{if(k.current===s||(k.current=s,!p))return;let e=window.setTimeout(()=>void y(),0);return()=>window.clearTimeout(e)},[p,s,y]);let C=()=>{let e=!p;g(e),e&&!x&&y()},I=i.highlightColor&&eb.worktreeHighlightSurfaceClasses[i.highlightColor];return(0,t.jsxs)(r.Fragment,{children:[(0,t.jsxs)(eh.TableRow,{className:(0,ej.cn)("cursor-pointer transition-colors hover:bg-muted/50",I),onClick:e=>{(0,eA.shouldNavigateWorktreeSurface)(e)&&m.push((0,eA.worktreeDetailHref)(i.id))},children:[(0,t.jsxs)(eh.TableCell,{children:[(0,t.jsxs)(Z.Button,{"aria-expanded":p,className:"max-w-full px-0 font-mono",onClick:()=>void C(),variant:"ghost",children:[p?(0,t.jsx)(c.ChevronDown,{}):(0,t.jsx)(u.ChevronRight,{}),(0,t.jsx)("span",{className:"truncate",children:i.branch??h("detached")})]}),(i.ticketKey||i.ticketTitle)&&(0,t.jsx)(e6,{...d,compact:!0})]}),(0,t.jsx)(eh.TableCell,{className:"font-mono text-xs",children:eV(i.folder,a)}),(0,t.jsx)(eh.TableCell,{children:(0,t.jsx)(ti,{...d,compact:!0})}),(0,t.jsx)(eh.TableCell,{children:(0,t.jsx)(tr,{worktree:i})}),(0,t.jsx)(eh.TableCell,{children:(0,t.jsx)(tt,{...d,compact:!0})}),(0,t.jsx)(eh.TableCell,{children:(0,t.jsx)("div",{className:"flex flex-wrap items-center gap-1.5",children:(0,t.jsx)(ta,{detailsExpanded:p,onToggleDetails:C,worktree:i})})}),(0,t.jsx)(eh.TableCell,{children:(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-1",children:[(0,t.jsx)(tn,{worktree:i}),e_(i)&&(0,t.jsx)(X.Badge,{variant:"destructive",children:h("dirty")})]})}),(0,t.jsx)(eh.TableCell,{children:(0,t.jsxs)("div",{className:"flex items-center justify-end gap-1",children:[(0,t.jsx)(e7,{worktree:i}),(0,t.jsx)(to,{...d})]})})]}),i.rebaseInProgress&&(0,t.jsx)(eh.TableRow,{className:(0,ej.cn)(I),children:(0,t.jsx)(eh.TableCell,{colSpan:8,children:(0,t.jsx)(eT.WorktreeRebaseConflictItem,{group:e.group,onCompleted:e.onReload,onError:e.onError,worktree:i})})}),(0,t.jsx)(eh.TableRow,{className:(0,ej.cn)(I),children:(0,t.jsx)(eh.TableCell,{colSpan:8,children:(0,t.jsx)(tm,{...d,onCompleted:async()=>{await e.onReload(),p&&await y()}})})}),p&&(0,t.jsx)(eh.TableRow,{className:(0,ej.cn)(I),children:(0,t.jsx)(eh.TableCell,{colSpan:8,children:f&&!x?(0,t.jsx)(ec.Spinner,{}):x?(0,t.jsx)(ey.WorktreeDetailPanel,{detail:x,inline:!0,worktreeId:i.id}):null})})]})}function tj({tag:e}){return(0,t.jsx)(X.Badge,{className:ez[e.color],children:e.name})}function tv({label:e,value:r,mono:a=!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,ej.cn)("flex min-h-6 items-center truncate",a&&"font-mono text-xs"),title:r,children:r})]})}function tk({open:e,onOpenChange:a,tags:s,onChanged:n}){let i=(0,O.useTranslations)("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,ef.controlPlaneRequest)("mutation SaveTag($input: SaveWorktreeTagInput!) { saveWorktreeTag(input: $input) { id } }",{input:{id:l?.id??null,name:d,color:u}}),o(null),c(""),h("blue"),p(null),await n()}catch(e){p(e instanceof Error?e.message:String(e))}},x=async e=>{try{await (0,ef.controlPlaneRequest)("mutation DeleteTag($id: ID!) { deleteWorktreeTag(id: $id) }",{id:e}),await n()}catch(e){p(e instanceof Error?e.message:String(e))}};return(0,t.jsx)(er.Dialog,{onOpenChange:a,open:e,children:(0,t.jsxs)(er.DialogContent,{children:[(0,t.jsxs)(er.DialogHeader,{children:[(0,t.jsx)(er.DialogTitle,{children:i("manageTags")}),(0,t.jsx)(er.DialogDescription,{children:i("manageTagsDescription")})]}),m&&(0,t.jsx)(Y.Alert,{variant:"destructive",children:(0,t.jsx)(Y.AlertDescription,{children:m})}),(0,t.jsx)(ei.ItemGroup,{className:"gap-2",children:s.map(e=>(0,t.jsxs)(ei.Item,{size:"sm",variant:"outline",children:[(0,t.jsx)(ei.ItemContent,{children:(0,t.jsx)(ei.ItemTitle,{children:(0,t.jsx)(tj,{tag:e})})}),(0,t.jsxs)(ei.ItemActions,{children:[(0,t.jsx)(Z.Button,{onClick:()=>{o(e),c(e.name),h(e.color)},size:"sm",variant:"outline",children:i("edit")}),(0,t.jsx)(Z.Button,{onClick:()=>void x(e.id),size:"icon-sm",variant:"destructive",children:(0,t.jsx)(P.Trash2,{})})]})]},e.id))}),(0,t.jsxs)("form",{className:"space-y-3 border-t pt-3",onSubmit:g,children:[(0,t.jsx)(el.Label,{htmlFor:"tag-name",children:l?i("editTag"):i("createTag")}),(0,t.jsx)(en.Input,{id:"tag-name",maxLength:40,onChange:e=>c(e.target.value),required:!0,value:d}),(0,t.jsx)(em.ToggleGroup,{"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:eD.map(e=>(0,t.jsx)(em.ToggleGroupItem,{"aria-label":e,className:(0,ej.cn)("aspect-square h-auto w-full min-w-0 p-0",eJ[e],eQ[e],"data-[state=on]:ring-2 data-[state=on]:ring-foreground"),value:e},e))}),(0,t.jsx)(er.DialogFooter,{children:(0,t.jsxs)(Z.Button,{type:"submit",children:[(0,t.jsx)(D.Save,{})," ",i("saveTag")]})})]})]})})}function tw({appId:e,open:a,onOpenChange:s,onChanged:i}){let l=(0,O.useTranslations)("worktrees"),[o,d]=(0,r.useState)([]),[c,u]=(0,r.useState)(null),h=(0,r.useCallback)(async()=>{try{let t=await (0,ef.controlPlaneRequest)(`query HiddenWorktrees($appId: ID) { hiddenWorktrees(appId: $appId) { ${eI.WORKTREE_FIELDS} } }`,{appId:e??null});d(t.hiddenWorktrees),u(null)}catch(e){u(e instanceof Error?e.message:String(e))}},[e]);(0,r.useEffect)(()=>{if(!a)return;let e=window.setTimeout(()=>void h(),0);return()=>window.clearTimeout(e)},[a,h]);let m=async e=>{try{await (0,ef.controlPlaneRequest)(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)(er.Dialog,{onOpenChange:s,open:a,children:(0,t.jsxs)(er.DialogContent,{className:"sm:max-w-3xl",children:[(0,t.jsxs)(er.DialogHeader,{children:[(0,t.jsx)(er.DialogTitle,{children:l("hiddenTitle")}),(0,t.jsx)(er.DialogDescription,{children:l("hiddenDescription")})]}),c&&(0,t.jsx)(Y.Alert,{variant:"destructive",children:(0,t.jsx)(Y.AlertDescription,{children:c})}),(0,t.jsx)("div",{className:"max-h-96 overflow-y-auto",children:o.length?(0,t.jsx)(ei.ItemGroup,{className:"gap-2",children:o.map(e=>(0,t.jsxs)(ei.Item,{variant:"outline",children:[(0,t.jsx)(ei.ItemMedia,{variant:"icon",children:(0,t.jsx)(b.GitBranch,{})}),(0,t.jsxs)(ei.ItemContent,{className:"min-w-0",children:[(0,t.jsx)(ei.ItemTitle,{className:"font-mono",children:e.branch??l("detached")}),(0,t.jsx)(ei.ItemDescription,{className:"truncate",title:e.folder,children:e.folder})]}),(0,t.jsx)(ei.ItemActions,{children:(0,t.jsxs)(Z.Button,{onClick:()=>void m(e.id),size:"sm",variant:"destructive",children:[(0,t.jsx)(P.Trash2,{})," ",l("purge")]})})]},e.id))}):(0,t.jsx)(es.Empty,{className:"border-0 py-8",children:(0,t.jsxs)(es.EmptyHeader,{children:[(0,t.jsx)(es.EmptyMedia,{variant:"icon",children:(0,t.jsx)(n.Archive,{})}),(0,t.jsx)(es.EmptyTitle,{children:l("noHidden")})]})})}),(0,t.jsx)(er.DialogFooter,{children:o.length>0&&!e&&(0,t.jsxs)(Z.Button,{onClick:()=>void m(),variant:"destructive",children:[(0,t.jsx)(P.Trash2,{})," ",l("purgeAll")]})})]})})}e.s(["ActionRow",0,tm,"BaseBranchControl",0,ti,"BaseFreshnessBadge",0,tr,"OriginStatusBadges",0,tn,"PrimaryWorktreeActions",0,th,"PullRequestBadges",0,ta,"TagManagerDialog",0,tk,"WorktreeMenus",0,to,"WorktreeMetadata",0,e8,"WorktreeTagsMenu",0,tt,"WorktreeTicketLink",0,e6,"WorktreesPage",0,function({appId:e}){let i=(0,O.useTranslations)("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(eR)?"table":"cards"),[m,g]=(0,r.useState)(()=>"repository"===window.localStorage.getItem(eB)?"repository":"agent"),[x,f]=(0,r.useState)(!0),[j,v]=(0,r.useState)(!1),[y,S]=(0,r.useState)(null),[C,I]=(0,r.useState)(null),[N,E]=(0,r.useState)(0),[A,D]=(0,r.useState)(!1),[B,W]=(0,r.useState)(!1),P=(0,a.useActiveAgent)(),L=(0,O.useTranslations)("activeAgent"),[M]=(0,r.useState)(()=>(function(e){let t={query:"",agentId:eP,repositoryId:eP,changes:eP,branches:eP};try{let r=window.localStorage.getItem(e$(e));if(!r)return t;let a=JSON.parse(r);if(!a||"object"!=typeof a)return t;return{query:"string"==typeof a.query?a.query:t.query,agentId:"string"==typeof a.agentId?a.agentId:t.agentId,repositoryId:"string"==typeof a.repositoryId?a.repositoryId:t.repositoryId,changes:a.changes===eL||a.changes===eM?a.changes:t.changes,branches:a.branches===eO?a.branches:t.branches}}catch{return t}})(e)),[$,_]=(0,r.useState)(M.query),[U,q]=(0,r.useState)(M.agentId),[F,H]=(0,r.useState)(M.repositoryId),[V,G]=(0,r.useState)(M.changes),[K,z]=(0,r.useState)(M.branches),X=(0,r.useRef)(0),ee=(0,r.useRef)(null),et=(0,r.useCallback)(()=>ee.current?.refresh().catch(()=>void 0)??Promise.resolve(),[]),er=(0,r.useCallback)(async()=>{let e=ee.current;e&&(await e.refresh(),ee.current===e&&E(e=>e+1))},[]),ea=(0,eC.useWorktreeFetch)({scopeKey:e??"all-worktrees",refreshPage:er}),ei=(0,r.useCallback)(async t=>{let r=++X.current;try{let a=await (0,ef.controlPlaneRequest)(`query WorktreeOverview($appId: ID) {
121
+ worktreeOverview(appId: $appId) {
122
+ hiddenCount
123
+ settings { editorVariant updatedAt }
124
+ tags { id name color createdAt updatedAt }
125
+ activeMoves {
126
+ id sourceWorktreeId sourceCodebaseId targetCodebaseId targetWorktreeId destinationMode
127
+ branch headSha deleteSource status sourceJobId targetJobId cleanupJobId error warning
128
+ createdAt updatedAt finishedAt
129
+ }
130
+ agents {
131
+ agent { id name hostname capabilities baseRepoDirectory connectionStatus }
132
+ codebases {
133
+ iosBuildConfigured
134
+ blockingJob { id agentId kind status error createdAt startedAt finishedAt updatedAt }
135
+ quickActions {
136
+ id name description quickActionIconKey quickActionButtonVariant
137
+ hasPlainTrigger(resourceKind: "WORKTREE")
138
+ triggerChoices(resourceKind: "WORKTREE") { key label description }
139
+ }
140
+ mergeConflictQuickActions {
141
+ id name description quickActionIconKey quickActionButtonVariant
142
+ hasPlainTrigger(resourceKind: "WORKTREE")
143
+ triggerChoices(resourceKind: "WORKTREE") { key label description }
144
+ }
145
+ repository { id canonicalOrigin displayOrigin name description jiraBranchRegex keepBaseBranchUpToDate createdAt updatedAt }
146
+ codebase { ${eI.CODEBASE_FIELDS} }
147
+ worktrees { ${eI.WORKTREE_FIELDS} }
148
+ }
149
+ }
150
+ }
151
+ }`,{appId:e??null},{signal:t});if(r!==X.current||t.aborted)return;c(a.worktreeOverview),S(null)}catch(e){if(t.aborted)return;throw r!==X.current||t.aborted||S(e instanceof Error?e.message:String(e)),e}finally{r!==X.current||t.aborted||f(!1)}},[e]);(0,Q.useJiraTicketChanges)(()=>void et()),(0,r.useEffect)(()=>{let e=(0,s.createRefreshCoalescer)(ei);ee.current=e;let t=(0,ef.onControlPlaneRecovery)(t=>{(t?.initialConnection?e.refreshIfIdle():e.refresh()).catch(()=>void 0)},{includeInitial:!0});return()=>{e.dispose(),t(),ee.current===e&&(ee.current=null)}},[ei]),(0,r.useEffect)(()=>{let e=window.setTimeout(()=>void et(),0),t=window.setInterval(()=>void et(),3e4),r=(0,ef.controlPlaneSubscriptions)(),a=r.subscribe({query:"subscription WorktreesChanged { worktreeOverviewChanged { worktreeId codebaseId } }"},{next:()=>void et(),error:()=>void 0,complete:()=>void 0}),s=r.subscribe({query:"subscription WorktreeBuildsChanged { buildsChanged { id } }"},{next:()=>void et(),error:()=>void 0,complete:()=>void 0}),n=r.subscribe({query:"subscription WorktreeQuickActionsChanged { workflowChanges { definitionsChanged } }"},{next:e=>{e.data?.workflowChanges?.definitionsChanged&&et()},error:()=>void 0,complete:()=>void 0});return()=>{window.clearTimeout(e),window.clearInterval(t),X.current+=1,a(),s(),n()}},[et,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(e$(e),JSON.stringify({query:$,agentId:U,repositoryId:F,changes:V,branches:K}))},[U,e,K,V,$,F]);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,ef.controlPlaneRequest)(`mutation RefreshWorktrees {
152
+ refreshWorktrees
153
+ }`),await er(),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]),ep=!d||U===eP||d.agents.some(e=>e.agent.id===U)?U:eP,eg=P.activeAgentId??ep,ex=!d||F===eP||eh.some(e=>e.id===F)?F:eP,eb=(0,r.useMemo)(()=>eF(d?.agents??[],{query:$,agentId:eg===eP?null:eg,repositoryId:ex===eP?null:ex,dirty:V===eP?null:V===eL,nonDefaultBranch:K===eO}),[eg,ex,K,V,d,$]),ej=(0,r.useMemo)(()=>eH(eb),[eb]),ev=!!$.trim()||eg!==eP||ex!==eP||V!==eP||K!==eP;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:i("title")}),(0,t.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:i("description")})]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsxs)(Z.Button,{disabled:j||ea.active,onClick:()=>void eo(),variant:"outline",children:[(0,t.jsx)(T.RefreshCw,{className:x?"animate-spin":void 0})," ",i("refresh")]}),(0,t.jsxs)(Z.Button,{disabled:j||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)(ec.Spinner,{"aria-hidden":"true"}):(0,t.jsx)(p.Download,{})," ",ea.active&&ea.batch?i(`fetchProgress.${ea.batch.phase}`):i("fetchNow")]}),(0,t.jsxs)(Z.Button,{onClick:()=>W(!0),variant:"outline",children:[(0,t.jsx)(n.Archive,{})," ",i("hidden",{count:d?.hiddenCount??0})]}),(0,t.jsxs)(eu.Select,{onValueChange:e=>{("agent"===e||"repository"===e)&&(g(e),window.localStorage.setItem(eB,e))},value:m,children:[(0,t.jsx)(eu.SelectTrigger,{"aria-label":i("groupBy"),children:(0,t.jsx)(eu.SelectValue,{})}),(0,t.jsxs)(eu.SelectContent,{children:[(0,t.jsx)(eu.SelectItem,{value:"agent",children:i("groupByAgent")}),(0,t.jsx)(eu.SelectItem,{value:"repository",children:i("groupByRepository")})]})]}),(0,t.jsxs)(em.ToggleGroup,{"aria-label":`${i("cards")} / ${i("table")}`,onValueChange:e=>{("cards"===e||"table"===e)&&(h(e),window.localStorage.setItem(eR,e))},spacing:0,type:"single",value:u,variant:"outline",children:[(0,t.jsx)(em.ToggleGroupItem,{"aria-label":i("cards"),className:"px-2",value:"cards",children:(0,t.jsx)(k.Grid2X2,{})}),(0,t.jsx)(em.ToggleGroupItem,{"aria-label":i("table"),className:"px-2",value:"table",children:(0,t.jsx)(w.List,{})})]})]})]}),ea.batch&&(0,t.jsx)(eS.WorktreeFetchProgress,{batch:ea.batch,onDismiss:ea.dismiss,onRetry:()=>void ea.retryPageUpdate()}),y&&(0,t.jsx)(Y.Alert,{variant:"destructive",children:(0,t.jsx)(Y.AlertDescription,{children:y})}),C&&(0,t.jsx)(Y.Alert,{children:(0,t.jsx)(Y.AlertDescription,{children:C})}),d&&d.agents.length>0&&(0,t.jsxs)("div",{"aria-label":i("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)(R.Search,{className:"pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2 text-muted-foreground"}),(0,t.jsx)(en.Input,{"aria-label":i("searchWorktrees"),className:"pl-9",onChange:e=>_(e.target.value),placeholder:i("searchWorktreesPlaceholder"),type:"search",value:$})]}),(0,t.jsxs)("div",{className:"min-w-0 flex-[1_1_12rem]",children:[(0,t.jsxs)(eu.Select,{disabled:!!P.activeAgentId,onValueChange:q,value:eg,children:[(0,t.jsx)(eu.SelectTrigger,{"aria-label":i("filterByAgent"),className:"w-full",children:(0,t.jsx)(eu.SelectValue,{})}),(0,t.jsxs)(eu.SelectContent,{children:[(0,t.jsx)(eu.SelectItem,{value:eP,children:i("allAgents")}),P.activeAgentId&&!d.agents.some(({agent:e})=>e.id===P.activeAgentId)&&(0,t.jsx)(eu.SelectItem,{value:P.activeAgentId,children:P.activeAgent?.name??L("unavailable")}),d.agents.map(e=>(0,t.jsx)(eu.SelectItem,{value:e.agent.id,children:e.agent.name},e.agent.id))]})]}),P.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)(eu.Select,{onValueChange:H,value:ex,children:[(0,t.jsx)(eu.SelectTrigger,{"aria-label":i("filterByRepository"),className:"w-full",children:(0,t.jsx)(eu.SelectValue,{})}),(0,t.jsxs)(eu.SelectContent,{children:[(0,t.jsx)(eu.SelectItem,{value:eP,children:i("allRepositories")}),eh.map(e=>(0,t.jsx)(eu.SelectItem,{value:e.id,children:e.name},e.id))]})]})}),(0,t.jsx)("div",{className:"min-w-0 flex-[1_1_12rem]",children:(0,t.jsxs)(eu.Select,{onValueChange:G,value:V,children:[(0,t.jsx)(eu.SelectTrigger,{"aria-label":i("filterByChanges"),className:"w-full",children:(0,t.jsx)(eu.SelectValue,{})}),(0,t.jsxs)(eu.SelectContent,{children:[(0,t.jsx)(eu.SelectItem,{value:eP,children:i("allWorktrees")}),(0,t.jsx)(eu.SelectItem,{value:eL,children:i("dirtyWorktrees")}),(0,t.jsx)(eu.SelectItem,{value:eM,children:i("cleanWorktrees")})]})]})}),(0,t.jsx)("div",{className:"min-w-0 flex-[1_1_12rem]",children:(0,t.jsxs)(eu.Select,{onValueChange:z,value:K,children:[(0,t.jsx)(eu.SelectTrigger,{"aria-label":i("filterByBranch"),className:"w-full",children:(0,t.jsx)(eu.SelectValue,{})}),(0,t.jsxs)(eu.SelectContent,{children:[(0,t.jsx)(eu.SelectItem,{value:eP,children:i("allBranches")}),(0,t.jsx)(eu.SelectItem,{value:eO,children:i("nonDefaultBranches")})]})]})})]}),d&&d.activeMoves.length>0&&(0,t.jsx)(eY,{moves:d.activeMoves,onError:S,onNotice:I,onReload:et}),d&&(0,t.jsx)(eZ,{onCreated:async()=>{await et(),I(i("worktreeCreated"))},overview:d}),P.ready&&(!x||d)?d?.agents.length?ev&&0===eb.length?(0,t.jsx)(es.Empty,{className:"border py-12",children:(0,t.jsxs)(es.EmptyHeader,{children:[(0,t.jsx)(es.EmptyMedia,{variant:"icon",children:(0,t.jsx)(R.Search,{})}),(0,t.jsx)(es.EmptyTitle,{children:i("noMatchingWorktrees")}),(0,t.jsx)(es.EmptyDescription,{children:i("noMatchingWorktreesDescription")})]})}):"repository"===m?ej.map(r=>(0,t.jsx)(e2,{appId:e,allTags:d.tags,editorVariant:d.settings.editorVariant,inspectionRefreshToken:N,layout:u,onError:S,onManageTags:()=>D(!0),onOpenTicket:e=>el(e),onReload:et,onUpdate:ed,overview:d,repositoryGroup:r},r.repository.id)):eb.map(r=>(0,t.jsx)(e5,{appId:e,agentGroup:r,allTags:d.tags,editorVariant:d.settings.editorVariant,inspectionRefreshToken:N,layout:u,onError:S,onManageTags:()=>D(!0),onOpenTicket:e=>el(e),onReload:et,onUpdate:ed,overview:d},r.agent.id)):(0,t.jsx)(es.Empty,{className:"border py-12",children:(0,t.jsxs)(es.EmptyHeader,{children:[(0,t.jsx)(es.EmptyMedia,{variant:"icon",children:(0,t.jsx)(b.GitBranch,{})}),(0,t.jsx)(es.EmptyTitle,{children:i("emptyTitle")}),(0,t.jsx)(es.EmptyDescription,{children:i("emptyDescription")})]})}):(0,t.jsxs)("p",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(ec.Spinner,{})," ",i("loading")]}),(0,t.jsx)(tk,{onChanged:et,onOpenChange:D,open:A,tags:d?.tags??[]}),(0,t.jsx)(tw,{appId:e,onChanged:et,onOpenChange:W,open:B}),(0,t.jsx)(J.JiraTicketDrawer,{issueKey:l,onClose:()=>el(null),onTicketChange:e=>{c(t=>t?eU(t,e):t)}})]})},"applyJiraTicketToWorktreeOverview",0,eU,"displayedWorktreePath",0,eV,"filterWorktreeAgentGroups",0,eF,"groupWorktreesByRepository",0,eH,"worktreeBranchIsTaken",0,eK,"worktreeChangeActionState",0,eG,"worktreeIsDirty",0,e_])}]);