commandmate 0.49.1 → 0.49.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (456) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-build-manifest.json +128 -132
  3. package/.next/app-path-routes-manifest.json +22 -22
  4. package/.next/build-manifest.json +2 -2
  5. package/.next/prerender-manifest.json +12 -12
  6. package/.next/required-server-files.json +1 -1
  7. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  8. package/.next/server/app/api/agents/update/route_client-reference-manifest.js +1 -1
  9. package/.next/server/app/api/agents/versions/route_client-reference-manifest.js +1 -1
  10. package/.next/server/app/api/app/release-notes/route_client-reference-manifest.js +1 -1
  11. package/.next/server/app/api/app/update/route_client-reference-manifest.js +1 -1
  12. package/.next/server/app/api/app/update-check/route_client-reference-manifest.js +1 -1
  13. package/.next/server/app/api/auth/login/route_client-reference-manifest.js +1 -1
  14. package/.next/server/app/api/auth/logout/route_client-reference-manifest.js +1 -1
  15. package/.next/server/app/api/auth/status/route_client-reference-manifest.js +1 -1
  16. package/.next/server/app/api/capabilities/route.js +1 -1
  17. package/.next/server/app/api/capabilities/route_client-reference-manifest.js +1 -1
  18. package/.next/server/app/api/daily-summary/route_client-reference-manifest.js +1 -1
  19. package/.next/server/app/api/daily-summary/status/route_client-reference-manifest.js +1 -1
  20. package/.next/server/app/api/external-apps/[id]/health/route_client-reference-manifest.js +1 -1
  21. package/.next/server/app/api/external-apps/[id]/route_client-reference-manifest.js +1 -1
  22. package/.next/server/app/api/external-apps/route_client-reference-manifest.js +1 -1
  23. package/.next/server/app/api/fs/browse/route_client-reference-manifest.js +1 -1
  24. package/.next/server/app/api/fs/recent-paths/route_client-reference-manifest.js +1 -1
  25. package/.next/server/app/api/hooks/agent-event/route.js +2 -2
  26. package/.next/server/app/api/hooks/agent-event/route.js.nft.json +1 -1
  27. package/.next/server/app/api/hooks/agent-event/route_client-reference-manifest.js +1 -1
  28. package/.next/server/app/api/hooks/claude-done/route.js +2 -2
  29. package/.next/server/app/api/hooks/claude-done/route.js.nft.json +1 -1
  30. package/.next/server/app/api/hooks/claude-done/route_client-reference-manifest.js +1 -1
  31. package/.next/server/app/api/hooks/permission-request/route.js +1 -1
  32. package/.next/server/app/api/hooks/permission-request/route.js.nft.json +1 -1
  33. package/.next/server/app/api/hooks/permission-request/route_client-reference-manifest.js +1 -1
  34. package/.next/server/app/api/metrics/vibe/route_client-reference-manifest.js +1 -1
  35. package/.next/server/app/api/ollama/models/route_client-reference-manifest.js +1 -1
  36. package/.next/server/app/api/push/escalation/route_client-reference-manifest.js +1 -1
  37. package/.next/server/app/api/push/subscriptions/route.js +1 -1
  38. package/.next/server/app/api/push/subscriptions/route_client-reference-manifest.js +1 -1
  39. package/.next/server/app/api/push/vapid/route_client-reference-manifest.js +1 -1
  40. package/.next/server/app/api/relays/[relayId]/cancel/route.js +1 -1
  41. package/.next/server/app/api/relays/[relayId]/cancel/route.js.nft.json +1 -1
  42. package/.next/server/app/api/relays/[relayId]/cancel/route_client-reference-manifest.js +1 -1
  43. package/.next/server/app/api/relays/[relayId]/route_client-reference-manifest.js +1 -1
  44. package/.next/server/app/api/relays/route.js +1 -1
  45. package/.next/server/app/api/relays/route.js.nft.json +1 -1
  46. package/.next/server/app/api/relays/route_client-reference-manifest.js +1 -1
  47. package/.next/server/app/api/remote/pair/route_client-reference-manifest.js +1 -1
  48. package/.next/server/app/api/repositories/[id]/route_client-reference-manifest.js +1 -1
  49. package/.next/server/app/api/repositories/clone/[jobId]/route.js +1 -1
  50. package/.next/server/app/api/repositories/clone/[jobId]/route.js.nft.json +1 -1
  51. package/.next/server/app/api/repositories/clone/[jobId]/route_client-reference-manifest.js +1 -1
  52. package/.next/server/app/api/repositories/clone/route.js +1 -1
  53. package/.next/server/app/api/repositories/clone/route.js.nft.json +1 -1
  54. package/.next/server/app/api/repositories/clone/route_client-reference-manifest.js +1 -1
  55. package/.next/server/app/api/repositories/excluded/route_client-reference-manifest.js +1 -1
  56. package/.next/server/app/api/repositories/restore/route.js +1 -1
  57. package/.next/server/app/api/repositories/restore/route.js.nft.json +1 -1
  58. package/.next/server/app/api/repositories/restore/route_client-reference-manifest.js +1 -1
  59. package/.next/server/app/api/repositories/route.js +1 -1
  60. package/.next/server/app/api/repositories/route.js.nft.json +1 -1
  61. package/.next/server/app/api/repositories/route_client-reference-manifest.js +1 -1
  62. package/.next/server/app/api/repositories/scan/route.js +1 -1
  63. package/.next/server/app/api/repositories/scan/route.js.nft.json +1 -1
  64. package/.next/server/app/api/repositories/scan/route_client-reference-manifest.js +1 -1
  65. package/.next/server/app/api/repositories/sync/route.js +1 -1
  66. package/.next/server/app/api/repositories/sync/route.js.nft.json +1 -1
  67. package/.next/server/app/api/repositories/sync/route_client-reference-manifest.js +1 -1
  68. package/.next/server/app/api/repositories/validate-path/route_client-reference-manifest.js +1 -1
  69. package/.next/server/app/api/settings/default-agents/route.js +1 -1
  70. package/.next/server/app/api/settings/default-agents/route.js.nft.json +1 -1
  71. package/.next/server/app/api/settings/default-agents/route_client-reference-manifest.js +1 -1
  72. package/.next/server/app/api/settings/default-surface-mode/route_client-reference-manifest.js +1 -1
  73. package/.next/server/app/api/sidebar/group-order/route_client-reference-manifest.js +1 -1
  74. package/.next/server/app/api/skills/[id]/route_client-reference-manifest.js +1 -1
  75. package/.next/server/app/api/skills/installations/route_client-reference-manifest.js +1 -1
  76. package/.next/server/app/api/skills/operations/route_client-reference-manifest.js +1 -1
  77. package/.next/server/app/api/skills/reindex/route_client-reference-manifest.js +1 -1
  78. package/.next/server/app/api/skills/route_client-reference-manifest.js +1 -1
  79. package/.next/server/app/api/slash-commands/route_client-reference-manifest.js +1 -1
  80. package/.next/server/app/api/tasks/[taskId]/cancel/route_client-reference-manifest.js +1 -1
  81. package/.next/server/app/api/tasks/[taskId]/route.js +1 -1
  82. package/.next/server/app/api/tasks/[taskId]/route_client-reference-manifest.js +1 -1
  83. package/.next/server/app/api/templates/[id]/route_client-reference-manifest.js +1 -1
  84. package/.next/server/app/api/templates/route_client-reference-manifest.js +1 -1
  85. package/.next/server/app/api/verification/runs/[runId]/route.js +1 -1
  86. package/.next/server/app/api/verification/runs/[runId]/route_client-reference-manifest.js +1 -1
  87. package/.next/server/app/api/verification/runs/route.js +1 -1
  88. package/.next/server/app/api/verification/runs/route_client-reference-manifest.js +1 -1
  89. package/.next/server/app/api/worktrees/[id]/auto-yes/route.js +1 -1
  90. package/.next/server/app/api/worktrees/[id]/auto-yes/route.js.nft.json +1 -1
  91. package/.next/server/app/api/worktrees/[id]/auto-yes/route_client-reference-manifest.js +1 -1
  92. package/.next/server/app/api/worktrees/[id]/capture/route.js +1 -1
  93. package/.next/server/app/api/worktrees/[id]/capture/route.js.nft.json +1 -1
  94. package/.next/server/app/api/worktrees/[id]/capture/route_client-reference-manifest.js +1 -1
  95. package/.next/server/app/api/worktrees/[id]/clear-composer/route.js +1 -1
  96. package/.next/server/app/api/worktrees/[id]/clear-composer/route.js.nft.json +1 -1
  97. package/.next/server/app/api/worktrees/[id]/clear-composer/route_client-reference-manifest.js +1 -1
  98. package/.next/server/app/api/worktrees/[id]/cli-reference/route.js +1 -1
  99. package/.next/server/app/api/worktrees/[id]/cli-reference/route_client-reference-manifest.js +1 -1
  100. package/.next/server/app/api/worktrees/[id]/cli-tool/route.js +1 -1
  101. package/.next/server/app/api/worktrees/[id]/cli-tool/route_client-reference-manifest.js +1 -1
  102. package/.next/server/app/api/worktrees/[id]/cmate/schedules/route.js +1 -1
  103. package/.next/server/app/api/worktrees/[id]/cmate/schedules/route_client-reference-manifest.js +1 -1
  104. package/.next/server/app/api/worktrees/[id]/current-output/route.js +1 -1
  105. package/.next/server/app/api/worktrees/[id]/current-output/route.js.nft.json +1 -1
  106. package/.next/server/app/api/worktrees/[id]/current-output/route_client-reference-manifest.js +1 -1
  107. package/.next/server/app/api/worktrees/[id]/direct-input/route.js +1 -1
  108. package/.next/server/app/api/worktrees/[id]/direct-input/route.js.nft.json +1 -1
  109. package/.next/server/app/api/worktrees/[id]/direct-input/route_client-reference-manifest.js +1 -1
  110. package/.next/server/app/api/worktrees/[id]/env/route.js +1 -1
  111. package/.next/server/app/api/worktrees/[id]/env/route_client-reference-manifest.js +1 -1
  112. package/.next/server/app/api/worktrees/[id]/execution-logs/[logId]/route.js +1 -1
  113. package/.next/server/app/api/worktrees/[id]/execution-logs/[logId]/route_client-reference-manifest.js +1 -1
  114. package/.next/server/app/api/worktrees/[id]/execution-logs/route.js +1 -1
  115. package/.next/server/app/api/worktrees/[id]/execution-logs/route_client-reference-manifest.js +1 -1
  116. package/.next/server/app/api/worktrees/[id]/files/[...path]/route_client-reference-manifest.js +1 -1
  117. package/.next/server/app/api/worktrees/[id]/git/branch/create/route.js +1 -1
  118. package/.next/server/app/api/worktrees/[id]/git/branch/create/route_client-reference-manifest.js +1 -1
  119. package/.next/server/app/api/worktrees/[id]/git/branch/delete/route.js +1 -1
  120. package/.next/server/app/api/worktrees/[id]/git/branch/delete/route_client-reference-manifest.js +1 -1
  121. package/.next/server/app/api/worktrees/[id]/git/branches/route.js +1 -1
  122. package/.next/server/app/api/worktrees/[id]/git/branches/route_client-reference-manifest.js +1 -1
  123. package/.next/server/app/api/worktrees/[id]/git/checkout/route.js +1 -1
  124. package/.next/server/app/api/worktrees/[id]/git/checkout/route_client-reference-manifest.js +1 -1
  125. package/.next/server/app/api/worktrees/[id]/git/commit/route.js +1 -1
  126. package/.next/server/app/api/worktrees/[id]/git/commit/route_client-reference-manifest.js +1 -1
  127. package/.next/server/app/api/worktrees/[id]/git/diff/route.js +1 -1
  128. package/.next/server/app/api/worktrees/[id]/git/diff/route_client-reference-manifest.js +1 -1
  129. package/.next/server/app/api/worktrees/[id]/git/fetch/route.js +1 -1
  130. package/.next/server/app/api/worktrees/[id]/git/fetch/route_client-reference-manifest.js +1 -1
  131. package/.next/server/app/api/worktrees/[id]/git/log/route.js +1 -1
  132. package/.next/server/app/api/worktrees/[id]/git/log/route_client-reference-manifest.js +1 -1
  133. package/.next/server/app/api/worktrees/[id]/git/pull/route.js +1 -1
  134. package/.next/server/app/api/worktrees/[id]/git/pull/route_client-reference-manifest.js +1 -1
  135. package/.next/server/app/api/worktrees/[id]/git/push/route.js +1 -1
  136. package/.next/server/app/api/worktrees/[id]/git/push/route_client-reference-manifest.js +1 -1
  137. package/.next/server/app/api/worktrees/[id]/git/reset/route.js +1 -1
  138. package/.next/server/app/api/worktrees/[id]/git/reset/route_client-reference-manifest.js +1 -1
  139. package/.next/server/app/api/worktrees/[id]/git/revert/route.js +1 -1
  140. package/.next/server/app/api/worktrees/[id]/git/revert/route_client-reference-manifest.js +1 -1
  141. package/.next/server/app/api/worktrees/[id]/git/show/[commitHash]/route.js +1 -1
  142. package/.next/server/app/api/worktrees/[id]/git/show/[commitHash]/route_client-reference-manifest.js +1 -1
  143. package/.next/server/app/api/worktrees/[id]/git/stage/route.js +1 -1
  144. package/.next/server/app/api/worktrees/[id]/git/stage/route_client-reference-manifest.js +1 -1
  145. package/.next/server/app/api/worktrees/[id]/git/staged/route.js +1 -1
  146. package/.next/server/app/api/worktrees/[id]/git/staged/route_client-reference-manifest.js +1 -1
  147. package/.next/server/app/api/worktrees/[id]/git/stash/[index]/route.js +1 -1
  148. package/.next/server/app/api/worktrees/[id]/git/stash/[index]/route_client-reference-manifest.js +1 -1
  149. package/.next/server/app/api/worktrees/[id]/git/stash/apply/route.js +1 -1
  150. package/.next/server/app/api/worktrees/[id]/git/stash/apply/route_client-reference-manifest.js +1 -1
  151. package/.next/server/app/api/worktrees/[id]/git/stash/pop/route.js +1 -1
  152. package/.next/server/app/api/worktrees/[id]/git/stash/pop/route_client-reference-manifest.js +1 -1
  153. package/.next/server/app/api/worktrees/[id]/git/stash/push/route.js +1 -1
  154. package/.next/server/app/api/worktrees/[id]/git/stash/push/route_client-reference-manifest.js +1 -1
  155. package/.next/server/app/api/worktrees/[id]/git/stash/route.js +1 -1
  156. package/.next/server/app/api/worktrees/[id]/git/stash/route_client-reference-manifest.js +1 -1
  157. package/.next/server/app/api/worktrees/[id]/git/status/route.js +1 -1
  158. package/.next/server/app/api/worktrees/[id]/git/status/route_client-reference-manifest.js +1 -1
  159. package/.next/server/app/api/worktrees/[id]/git/unstage/route.js +1 -1
  160. package/.next/server/app/api/worktrees/[id]/git/unstage/route_client-reference-manifest.js +1 -1
  161. package/.next/server/app/api/worktrees/[id]/git/working-diff/route.js +1 -1
  162. package/.next/server/app/api/worktrees/[id]/git/working-diff/route_client-reference-manifest.js +1 -1
  163. package/.next/server/app/api/worktrees/[id]/instances/notes/route.js +1 -1
  164. package/.next/server/app/api/worktrees/[id]/instances/notes/route_client-reference-manifest.js +1 -1
  165. package/.next/server/app/api/worktrees/[id]/instances/opencode/route.js +1 -1
  166. package/.next/server/app/api/worktrees/[id]/instances/opencode/route.js.nft.json +1 -1
  167. package/.next/server/app/api/worktrees/[id]/instances/opencode/route_client-reference-manifest.js +1 -1
  168. package/.next/server/app/api/worktrees/[id]/interrupt/route.js +1 -1
  169. package/.next/server/app/api/worktrees/[id]/interrupt/route.js.nft.json +1 -1
  170. package/.next/server/app/api/worktrees/[id]/interrupt/route_client-reference-manifest.js +1 -1
  171. package/.next/server/app/api/worktrees/[id]/kill-session/route.js +2 -1
  172. package/.next/server/app/api/worktrees/[id]/kill-session/route.js.nft.json +1 -1
  173. package/.next/server/app/api/worktrees/[id]/kill-session/route_client-reference-manifest.js +1 -1
  174. package/.next/server/app/api/worktrees/[id]/logs/[filename]/route.js +1 -1
  175. package/.next/server/app/api/worktrees/[id]/logs/[filename]/route.js.nft.json +1 -1
  176. package/.next/server/app/api/worktrees/[id]/logs/[filename]/route_client-reference-manifest.js +1 -1
  177. package/.next/server/app/api/worktrees/[id]/logs/route.js +2 -2
  178. package/.next/server/app/api/worktrees/[id]/logs/route.js.nft.json +1 -1
  179. package/.next/server/app/api/worktrees/[id]/logs/route_client-reference-manifest.js +1 -1
  180. package/.next/server/app/api/worktrees/[id]/marp-render/route.js +1 -1
  181. package/.next/server/app/api/worktrees/[id]/marp-render/route_client-reference-manifest.js +1 -1
  182. package/.next/server/app/api/worktrees/[id]/memos/[memoId]/route.js +1 -1
  183. package/.next/server/app/api/worktrees/[id]/memos/[memoId]/route_client-reference-manifest.js +1 -1
  184. package/.next/server/app/api/worktrees/[id]/memos/route.js +1 -1
  185. package/.next/server/app/api/worktrees/[id]/memos/route_client-reference-manifest.js +1 -1
  186. package/.next/server/app/api/worktrees/[id]/messages/route.js +1 -1
  187. package/.next/server/app/api/worktrees/[id]/messages/route_client-reference-manifest.js +1 -1
  188. package/.next/server/app/api/worktrees/[id]/opencode/diff/route.js +1 -1
  189. package/.next/server/app/api/worktrees/[id]/opencode/diff/route.js.nft.json +1 -1
  190. package/.next/server/app/api/worktrees/[id]/opencode/diff/route_client-reference-manifest.js +1 -1
  191. package/.next/server/app/api/worktrees/[id]/opencode/session/route.js +1 -1
  192. package/.next/server/app/api/worktrees/[id]/opencode/session/route.js.nft.json +1 -1
  193. package/.next/server/app/api/worktrees/[id]/opencode/session/route_client-reference-manifest.js +1 -1
  194. package/.next/server/app/api/worktrees/[id]/opencode/share/route.js +1 -1
  195. package/.next/server/app/api/worktrees/[id]/opencode/share/route.js.nft.json +1 -1
  196. package/.next/server/app/api/worktrees/[id]/opencode/share/route_client-reference-manifest.js +1 -1
  197. package/.next/server/app/api/worktrees/[id]/prompt-response/route.js +1 -1
  198. package/.next/server/app/api/worktrees/[id]/prompt-response/route.js.nft.json +1 -1
  199. package/.next/server/app/api/worktrees/[id]/prompt-response/route_client-reference-manifest.js +1 -1
  200. package/.next/server/app/api/worktrees/[id]/prompt-response/strict/route.js +1 -1
  201. package/.next/server/app/api/worktrees/[id]/prompt-response/strict/route.js.nft.json +1 -1
  202. package/.next/server/app/api/worktrees/[id]/prompt-response/strict/route_client-reference-manifest.js +1 -1
  203. package/.next/server/app/api/worktrees/[id]/resolve-target/route.js +1 -1
  204. package/.next/server/app/api/worktrees/[id]/resolve-target/route_client-reference-manifest.js +1 -1
  205. package/.next/server/app/api/worktrees/[id]/respond/route.js +1 -1
  206. package/.next/server/app/api/worktrees/[id]/respond/route.js.nft.json +1 -1
  207. package/.next/server/app/api/worktrees/[id]/respond/route_client-reference-manifest.js +1 -1
  208. package/.next/server/app/api/worktrees/[id]/route.js +1 -1
  209. package/.next/server/app/api/worktrees/[id]/route.js.nft.json +1 -1
  210. package/.next/server/app/api/worktrees/[id]/route_client-reference-manifest.js +1 -1
  211. package/.next/server/app/api/worktrees/[id]/schedules/[scheduleId]/route.js +1 -1
  212. package/.next/server/app/api/worktrees/[id]/schedules/[scheduleId]/route_client-reference-manifest.js +1 -1
  213. package/.next/server/app/api/worktrees/[id]/schedules/active/route.js +1 -1
  214. package/.next/server/app/api/worktrees/[id]/schedules/active/route_client-reference-manifest.js +1 -1
  215. package/.next/server/app/api/worktrees/[id]/schedules/route.js +1 -1
  216. package/.next/server/app/api/worktrees/[id]/schedules/route_client-reference-manifest.js +1 -1
  217. package/.next/server/app/api/worktrees/[id]/search/route_client-reference-manifest.js +1 -1
  218. package/.next/server/app/api/worktrees/[id]/send/route.js +2 -2
  219. package/.next/server/app/api/worktrees/[id]/send/route.js.nft.json +1 -1
  220. package/.next/server/app/api/worktrees/[id]/send/route_client-reference-manifest.js +1 -1
  221. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route.js +3 -3
  222. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route.js.nft.json +1 -1
  223. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route_client-reference-manifest.js +1 -1
  224. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/install/route_client-reference-manifest.js +1 -1
  225. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/plan/route_client-reference-manifest.js +1 -1
  226. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall/route_client-reference-manifest.js +1 -1
  227. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall-plan/route_client-reference-manifest.js +1 -1
  228. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/update/route_client-reference-manifest.js +1 -1
  229. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/update-plan/route_client-reference-manifest.js +1 -1
  230. package/.next/server/app/api/worktrees/[id]/skills/route.js +1 -1
  231. package/.next/server/app/api/worktrees/[id]/skills/route_client-reference-manifest.js +1 -1
  232. package/.next/server/app/api/worktrees/[id]/slash-commands/route.js +1 -1
  233. package/.next/server/app/api/worktrees/[id]/slash-commands/route_client-reference-manifest.js +1 -1
  234. package/.next/server/app/api/worktrees/[id]/special-keys/route.js +1 -1
  235. package/.next/server/app/api/worktrees/[id]/special-keys/route.js.nft.json +1 -1
  236. package/.next/server/app/api/worktrees/[id]/special-keys/route_client-reference-manifest.js +1 -1
  237. package/.next/server/app/api/worktrees/[id]/tasks/route.js +1 -1
  238. package/.next/server/app/api/worktrees/[id]/tasks/route_client-reference-manifest.js +1 -1
  239. package/.next/server/app/api/worktrees/[id]/terminal/route.js +2 -2
  240. package/.next/server/app/api/worktrees/[id]/terminal/route.js.nft.json +1 -1
  241. package/.next/server/app/api/worktrees/[id]/terminal/route_client-reference-manifest.js +1 -1
  242. package/.next/server/app/api/worktrees/[id]/timers/history/route.js +1 -1
  243. package/.next/server/app/api/worktrees/[id]/timers/history/route_client-reference-manifest.js +1 -1
  244. package/.next/server/app/api/worktrees/[id]/timers/route.js +1 -1
  245. package/.next/server/app/api/worktrees/[id]/timers/route.js.nft.json +1 -1
  246. package/.next/server/app/api/worktrees/[id]/timers/route_client-reference-manifest.js +1 -1
  247. package/.next/server/app/api/worktrees/[id]/todos/[todoId]/route.js +1 -1
  248. package/.next/server/app/api/worktrees/[id]/todos/[todoId]/route.js.nft.json +1 -1
  249. package/.next/server/app/api/worktrees/[id]/todos/[todoId]/route_client-reference-manifest.js +1 -1
  250. package/.next/server/app/api/worktrees/[id]/todos/route.js +1 -1
  251. package/.next/server/app/api/worktrees/[id]/todos/route.js.nft.json +1 -1
  252. package/.next/server/app/api/worktrees/[id]/todos/route_client-reference-manifest.js +1 -1
  253. package/.next/server/app/api/worktrees/[id]/tree/[...path]/route_client-reference-manifest.js +1 -1
  254. package/.next/server/app/api/worktrees/[id]/tree/route_client-reference-manifest.js +1 -1
  255. package/.next/server/app/api/worktrees/[id]/upload/[...path]/route_client-reference-manifest.js +1 -1
  256. package/.next/server/app/api/worktrees/[id]/verify/config/route.js +1 -1
  257. package/.next/server/app/api/worktrees/[id]/verify/config/route_client-reference-manifest.js +1 -1
  258. package/.next/server/app/api/worktrees/[id]/verify/route.js +1 -1
  259. package/.next/server/app/api/worktrees/[id]/verify/route.js.nft.json +1 -1
  260. package/.next/server/app/api/worktrees/[id]/verify/route_client-reference-manifest.js +1 -1
  261. package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/cancel/route.js +1 -1
  262. package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/cancel/route.js.nft.json +1 -1
  263. package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/cancel/route_client-reference-manifest.js +1 -1
  264. package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/route.js +1 -1
  265. package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/route_client-reference-manifest.js +1 -1
  266. package/.next/server/app/api/worktrees/[id]/verify/runs/route.js +1 -1
  267. package/.next/server/app/api/worktrees/[id]/verify/runs/route_client-reference-manifest.js +1 -1
  268. package/.next/server/app/api/worktrees/[id]/viewed/route.js +1 -1
  269. package/.next/server/app/api/worktrees/[id]/viewed/route_client-reference-manifest.js +1 -1
  270. package/.next/server/app/api/worktrees/apply-default-agents/route_client-reference-manifest.js +1 -1
  271. package/.next/server/app/api/worktrees/route.js +1 -1
  272. package/.next/server/app/api/worktrees/route.js.nft.json +1 -1
  273. package/.next/server/app/api/worktrees/route_client-reference-manifest.js +1 -1
  274. package/.next/server/app/login/page_client-reference-manifest.js +1 -1
  275. package/.next/server/app/manifest.webmanifest/route_client-reference-manifest.js +1 -1
  276. package/.next/server/app/more/page_client-reference-manifest.js +1 -1
  277. package/.next/server/app/offline/page_client-reference-manifest.js +1 -1
  278. package/.next/server/app/page_client-reference-manifest.js +1 -1
  279. package/.next/server/app/proxy/[...path]/route_client-reference-manifest.js +1 -1
  280. package/.next/server/app/repositories/page_client-reference-manifest.js +1 -1
  281. package/.next/server/app/review/page.js +1 -1
  282. package/.next/server/app/review/page_client-reference-manifest.js +1 -1
  283. package/.next/server/app/sessions/page_client-reference-manifest.js +1 -1
  284. package/.next/server/app/skills/[skillId]/page_client-reference-manifest.js +1 -1
  285. package/.next/server/app/skills/installed/page_client-reference-manifest.js +1 -1
  286. package/.next/server/app/skills/page_client-reference-manifest.js +1 -1
  287. package/.next/server/app/worktrees/[id]/files/[...path]/page_client-reference-manifest.js +1 -1
  288. package/.next/server/app/worktrees/[id]/page.js +2 -2
  289. package/.next/server/app/worktrees/[id]/page_client-reference-manifest.js +1 -1
  290. package/.next/server/app/worktrees/[id]/terminal/page_client-reference-manifest.js +1 -1
  291. package/.next/server/app-paths-manifest.json +22 -22
  292. package/.next/server/chunks/1062.js +1 -0
  293. package/.next/server/chunks/110.js +1 -0
  294. package/.next/server/chunks/1501.js +5 -4
  295. package/.next/server/chunks/1656.js +2 -2
  296. package/.next/server/chunks/1957.js +2 -0
  297. package/.next/server/chunks/2119.js +1 -1
  298. package/.next/server/chunks/2445.js +1 -1
  299. package/.next/server/chunks/2897.js +1 -0
  300. package/.next/server/chunks/3417.js +1 -0
  301. package/.next/server/chunks/3505.js +1 -1
  302. package/.next/server/chunks/3756.js +1 -0
  303. package/.next/server/chunks/3801.js +3 -3
  304. package/.next/server/chunks/4911.js +1 -0
  305. package/.next/server/chunks/4936.js +1 -0
  306. package/.next/server/chunks/5209.js +2 -1
  307. package/.next/server/chunks/5354.js +1 -1
  308. package/.next/server/chunks/6130.js +1 -1
  309. package/.next/server/chunks/6401.js +1 -1
  310. package/.next/server/chunks/7023.js +2 -2
  311. package/.next/server/chunks/7905.js +1 -1
  312. package/.next/server/chunks/8581.js +15 -15
  313. package/.next/server/chunks/8728.js +2 -2
  314. package/.next/server/chunks/8782.js +1 -1
  315. package/.next/server/chunks/9390.js +1 -1
  316. package/.next/server/chunks/9584.js +1 -1
  317. package/.next/server/chunks/9731.js +2 -2
  318. package/.next/server/middleware-manifest.json +5 -5
  319. package/.next/server/pages/500.html +1 -1
  320. package/.next/server/server-reference-manifest.json +1 -1
  321. package/.next/static/chunks/{2407-675ba6b21844dc3b.js → 2407-07a237575e1ceb9e.js} +1 -1
  322. package/.next/static/chunks/3931-61ad1a4fc0208d0e.js +1 -0
  323. package/.next/static/chunks/5794-7975b8e51e731b19.js +1 -0
  324. package/.next/static/chunks/6966-d8dc6032410ffaba.js +1 -0
  325. package/.next/static/chunks/7197-ed3b3d99ac3bd450.js +1 -0
  326. package/.next/static/chunks/7636-a48cf0f7110250c5.js +1 -0
  327. package/.next/static/chunks/app/layout-4f64316957b0a8e5.js +1 -0
  328. package/.next/static/chunks/app/more/page-ff5af5ca48774c89.js +1 -0
  329. package/.next/static/chunks/app/page-b4863bfe0452e09d.js +1 -0
  330. package/.next/static/chunks/app/review/page-ff3efb96fdf9bb4b.js +1 -0
  331. package/.next/static/chunks/app/sessions/{page-890fd50ec9739973.js → page-c6eb7c02db2f4c80.js} +1 -1
  332. package/.next/static/chunks/app/worktrees/[id]/{page-f6d3ab8185d93aae.js → page-33afc6aa96289fb0.js} +1 -1
  333. package/.next/trace +13 -13
  334. package/dist/cli/commands/ask.d.ts.map +1 -1
  335. package/dist/cli/commands/ask.js +56 -5
  336. package/dist/cli/commands/attach.d.ts +4 -1
  337. package/dist/cli/commands/attach.d.ts.map +1 -1
  338. package/dist/cli/commands/attach.js +19 -7
  339. package/dist/cli/commands/command-target.d.ts +7 -0
  340. package/dist/cli/commands/command-target.d.ts.map +1 -1
  341. package/dist/cli/commands/command-target.js +10 -0
  342. package/dist/cli/commands/instances.d.ts.map +1 -1
  343. package/dist/cli/commands/instances.js +38 -2
  344. package/dist/cli/commands/message-dispatch.d.ts +17 -3
  345. package/dist/cli/commands/message-dispatch.d.ts.map +1 -1
  346. package/dist/cli/commands/message-dispatch.js +14 -8
  347. package/dist/cli/commands/relays.d.ts +2 -1
  348. package/dist/cli/commands/relays.d.ts.map +1 -1
  349. package/dist/cli/commands/relays.js +4 -3
  350. package/dist/cli/commands/respond-strict.d.ts.map +1 -1
  351. package/dist/cli/commands/respond-strict.js +22 -5
  352. package/dist/cli/commands/respond.d.ts +2 -2
  353. package/dist/cli/commands/respond.d.ts.map +1 -1
  354. package/dist/cli/commands/respond.js +40 -37
  355. package/dist/cli/commands/send.d.ts.map +1 -1
  356. package/dist/cli/commands/send.js +8 -4
  357. package/dist/cli/commands/wait-instance.d.ts +9 -1
  358. package/dist/cli/commands/wait-instance.d.ts.map +1 -1
  359. package/dist/cli/commands/wait-instance.js +15 -0
  360. package/dist/cli/commands/wait-poll-state.d.ts +18 -0
  361. package/dist/cli/commands/wait-poll-state.d.ts.map +1 -1
  362. package/dist/cli/commands/wait-verify.d.ts +2 -1
  363. package/dist/cli/commands/wait-verify.d.ts.map +1 -1
  364. package/dist/cli/commands/wait-verify.js +5 -1
  365. package/dist/cli/commands/wait.d.ts.map +1 -1
  366. package/dist/cli/commands/wait.js +37 -13
  367. package/dist/cli/commands/whoami.d.ts.map +1 -1
  368. package/dist/cli/commands/whoami.js +3 -1
  369. package/dist/cli/docs/agent-operations.d.ts +1 -1
  370. package/dist/cli/docs/agent-operations.d.ts.map +1 -1
  371. package/dist/cli/docs/agent-operations.js +1 -0
  372. package/dist/cli/types/api-responses.d.ts +3 -1
  373. package/dist/cli/types/api-responses.d.ts.map +1 -1
  374. package/dist/cli/utils/api-client.d.ts +55 -1
  375. package/dist/cli/utils/api-client.d.ts.map +1 -1
  376. package/dist/cli/utils/api-client.js +220 -18
  377. package/dist/cli/utils/follow-up-command.d.ts +38 -0
  378. package/dist/cli/utils/follow-up-command.d.ts.map +1 -0
  379. package/dist/cli/utils/follow-up-command.js +57 -0
  380. package/dist/cli/utils/reply-ledger.d.ts +1 -1
  381. package/dist/cli/utils/reply-ledger.d.ts.map +1 -1
  382. package/dist/cli/utils/reply-ledger.js +7 -2
  383. package/dist/cli/utils/server-capabilities.d.ts +18 -0
  384. package/dist/cli/utils/server-capabilities.d.ts.map +1 -1
  385. package/dist/cli/utils/server-capabilities.js +36 -3
  386. package/dist/cli/utils/session-target.d.ts +1 -1
  387. package/dist/cli/utils/session-target.d.ts.map +1 -1
  388. package/dist/cli/utils/session-target.js +3 -0
  389. package/dist/cli/utils/verify-runner.d.ts +7 -0
  390. package/dist/cli/utils/verify-runner.d.ts.map +1 -1
  391. package/dist/cli/utils/verify-runner.js +51 -15
  392. package/dist/lib/cli-tools/session-name.d.ts.map +1 -1
  393. package/dist/lib/cli-tools/session-name.js +11 -3
  394. package/dist/lib/session/send-attempt-types.d.ts +25 -0
  395. package/dist/lib/session/send-attempt-types.d.ts.map +1 -1
  396. package/dist/lib/session/send-attempt-types.js +10 -1
  397. package/dist/lib/verification/session-kill-ledger.d.ts +110 -0
  398. package/dist/lib/verification/session-kill-ledger.d.ts.map +1 -0
  399. package/dist/lib/verification/session-kill-ledger.js +174 -0
  400. package/dist/server/locales/en/worktree.json +2 -0
  401. package/dist/server/locales/ja/worktree.json +2 -0
  402. package/dist/server/src/config/cli-tool-timing-config.js +1 -7
  403. package/dist/server/src/lib/auto-yes-poller.js +5 -1
  404. package/dist/server/src/lib/cli-tools/antigravity.js +5 -2
  405. package/dist/server/src/lib/cli-tools/base.js +39 -0
  406. package/dist/server/src/lib/cli-tools/codex.js +7 -4
  407. package/dist/server/src/lib/cli-tools/command-code.js +7 -3
  408. package/dist/server/src/lib/cli-tools/copilot.js +5 -3
  409. package/dist/server/src/lib/cli-tools/gemini.js +10 -2
  410. package/dist/server/src/lib/cli-tools/launch-keys.js +39 -0
  411. package/dist/server/src/lib/cli-tools/opencode-v2.js +6 -2
  412. package/dist/server/src/lib/cli-tools/opencode.js +5 -2
  413. package/dist/server/src/lib/cli-tools/session-name.js +11 -3
  414. package/dist/server/src/lib/cli-tools/submit-composer-read.js +16 -6
  415. package/dist/server/src/lib/cli-tools/submit-verified-sender.js +164 -7
  416. package/dist/server/src/lib/cli-tools/vibe-local.js +4 -2
  417. package/dist/server/src/lib/db/db-migration-path.js +63 -2
  418. package/dist/server/src/lib/detection/prompt-detect-multiple-choice.js +5 -4
  419. package/dist/server/src/lib/hooks/sources/copilot/hook-settings.js +2 -3
  420. package/dist/server/src/lib/prompt-answer-errors.js +76 -2
  421. package/dist/server/src/lib/session/agent-event-state.js +4 -0
  422. package/dist/server/src/lib/session/agent-session-lifecycle.js +6 -1
  423. package/dist/server/src/lib/session/claude-session.js +22 -6
  424. package/dist/server/src/lib/session/current-output-builder.js +5 -3
  425. package/dist/server/src/lib/session/current-output-history-writers.js +1 -1
  426. package/dist/server/src/lib/session/prompt-submit-receipt.js +155 -0
  427. package/dist/server/src/lib/session/prompt-waiting-guard.js +10 -3
  428. package/dist/server/src/lib/session/send-attempt-state.js +48 -0
  429. package/dist/server/src/lib/session/send-attempt-types.js +10 -1
  430. package/dist/server/src/lib/session/send-user-message.js +5 -4
  431. package/dist/server/src/lib/session/session-launch-flight.js +243 -0
  432. package/dist/server/src/lib/session/session-starting-state.js +40 -4
  433. package/dist/server/src/lib/session/structured-prompt.js +12 -9
  434. package/dist/server/src/lib/session/waiting-episode-binding.js +4 -2
  435. package/dist/server/src/lib/session-cleanup.js +32 -0
  436. package/dist/server/src/lib/session-key-sender.js +0 -27
  437. package/dist/server/src/lib/verification/env-clean-gate.js +129 -0
  438. package/dist/server/src/lib/verification/env-snapshot.js +11 -2
  439. package/dist/server/src/lib/verification/session-kill-ledger.js +174 -0
  440. package/package.json +5 -1
  441. package/release-notes/0.49.2.json +49 -0
  442. package/.next/server/chunks/3773.js +0 -1
  443. package/.next/server/chunks/5775.js +0 -1
  444. package/.next/server/chunks/7604.js +0 -2
  445. package/.next/static/chunks/3931-1a1abab16248f14d.js +0 -1
  446. package/.next/static/chunks/4768-ad6f82f034f21eae.js +0 -1
  447. package/.next/static/chunks/5794-80ac3f06f098ea29.js +0 -1
  448. package/.next/static/chunks/6654-f3534f35f16644bc.js +0 -1
  449. package/.next/static/chunks/7665-e9ef6e0a85b9fa49.js +0 -1
  450. package/.next/static/chunks/8606-ce17ffa77f39608e.js +0 -1
  451. package/.next/static/chunks/app/layout-8bfac4724277b47f.js +0 -1
  452. package/.next/static/chunks/app/more/page-87c84987b2765213.js +0 -1
  453. package/.next/static/chunks/app/page-1b820c421db48c2c.js +0 -1
  454. package/.next/static/chunks/app/review/page-e2fd4a590646a2d8.js +0 -1
  455. /package/.next/static/{fqfSDqQMweROeHUzOt_m1 → yGatWDsS532awSs51kXyd}/_buildManifest.js +0 -0
  456. /package/.next/static/{fqfSDqQMweROeHUzOt_m1 → yGatWDsS532awSs51kXyd}/_ssgManifest.js +0 -0
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4768],{2317:(e,t,r)=>{r.d(t,{V:()=>s});var n=r(12115);function a(){try{let e="__localStorage_test__";return window.localStorage.setItem(e,"test"),window.localStorage.removeItem(e),!0}catch(e){return!1}}function s(e){let{key:t,defaultValue:r,validate:s,serialize:i=JSON.stringify,deserialize:o=JSON.parse}=e,l=(0,n.useRef)(r),c=(0,n.useRef)(s),u=(0,n.useRef)(i),f=(0,n.useRef)(o);l.current=r,c.current=s,u.current=i,f.current=o;let[d,m]=(0,n.useState)(!1),[y,p]=(0,n.useState)(r),g=(0,n.useCallback)(()=>{if(!a())return l.current;try{let e=window.localStorage.getItem(t);if(null===e)return l.current;let r=f.current(e);if(c.current)return c.current(r)?r:l.current;return r}catch(e){return l.current}},[t]),w=(0,n.useCallback)(e=>{if(a())try{let r=u.current(e);window.localStorage.setItem(t,r)}catch(e){}},[t]),h=(0,n.useCallback)(e=>{p(t=>{let r="function"==typeof e?e(t):e;return w(r),r})},[w]),N=(0,n.useCallback)(()=>{if(a())try{window.localStorage.removeItem(t)}catch(e){}p(l.current)},[t]);return(0,n.useEffect)(()=>{m(a()),p(g())},[g]),{value:y,setValue:h,removeValue:N,isAvailable:d}}},7636:(e,t,r)=>{r.d(t,{$m:()=>o,BN:()=>j,EN:()=>l,EY:()=>E,El:()=>b,Ew:()=>K,FS:()=>M,Ii:()=>I,KI:()=>P,Kp:()=>k,LV:()=>p,PB:()=>u,Si:()=>s,UB:()=>A,UZ:()=>m,Xn:()=>C,ZC:()=>_,ZD:()=>D,_s:()=>v,al:()=>Z,df:()=>J,fs:()=>O,go:()=>z,j:()=>S,jn:()=>V,m3:()=>c,nO:()=>g,rL:()=>U,s6:()=>y,zD:()=>N,zg:()=>x});var n=r(38606);let a=["updatedAt","repositoryName","branchName","status","lastSent"],s=e=>a.includes(e),i=["grouped","flat","sessions"],o=e=>i.includes(e),l=["always","collapsed","hidden"],c=e=>l.includes(e),u="collapsed",f={waiting:0,ready:1,running:2,generating:3,idle:4},d=["waiting","running","generating","ready","idle"];function m(e){let t=new Set;for(let r of e)!1===r.visible&&t.add(r.path);return t}function y(e,t){return 0===t.size?e.slice():e.filter(e=>{let r=e.repositoryPath;return!r||!t.has(r)})}function p(e){let t=function(e){let t=5381;for(let r=0;r<e.length;r++)t=(t<<5)+t+e.charCodeAt(r)|0;return Math.abs(t)}(e)%360;return"hsl(".concat(t,", ").concat(65,"%, ").concat(60,"%)")}function g(e,t){if(!e&&!t)return 0;if(!e)return 1;if(!t)return -1;let r=e instanceof Date?e.getTime():new Date(e).getTime();return(t instanceof Date?t.getTime():new Date(t).getTime())-r}function w(e){return e.cliStatus&&Object.keys(e.cliStatus).length>0?(0,n.A7)(e.cliStatus):e.status}function h(e){return"waiting"===w(e)}function N(e){let t=new Set(e.map(w));for(let e of d)if(t.has(e))return e;return"idle"}function b(e){return"ready"===N(e)&&e.some(e=>"ready"===w(e)&&(0,n.Pn)(e.cliStatus,e.unclassifiedInstanceIds))}function S(e){let t=0;for(let r of e)h(r)&&t++;return t}function C(e,t,r){let n=[...e],a="status"!==t;return n.sort((e,n)=>{if(a){let t=Number(h(n))-Number(h(e));if(0!==t)return t}let s=0;switch(t){case"updatedAt":{let t=e=>e?e instanceof Date?e.getTime():new Date(e).getTime():0,r=t(e.lastActivity);s=t(n.lastActivity)-r;break}case"repositoryName":{let t=e.repositoryName.toLowerCase(),r=n.repositoryName.toLowerCase();s=t.localeCompare(r);break}case"branchName":{let t=e.name.toLowerCase(),r=n.name.toLowerCase();s=t.localeCompare(r);break}case"status":s=f[e.status]-f[n.status];break;case"lastSent":{let t=g(e.lastActivity,n.lastActivity);if(!e.lastActivity&&!n.lastActivity){s=0;break}if(!e.lastActivity)return 1;if(!n.lastActivity)return -1;s=t;break}default:s=0}return("updatedAt"===t||"lastSent"===t?"desc"===r:"asc"===r)?s:-s}),n}function v(e,t,r){let n=new Map;for(let t of e){let e=t.repositoryName;n.has(e)||n.set(e,[]),n.get(e).push(t)}return[...n.keys()].sort((e,t)=>e.toLowerCase().localeCompare(t.toLowerCase())).map(e=>({repositoryName:e,branches:C(n.get(e),t,r)}))}function A(e){let t=[];for(let c of e){var r,n,a,s,i,o,l;let e=new Set(null!=(r=c.exitedInstanceIds)?r:[]),u=new Set(null!=(n=c.unclassifiedInstanceIds)?n:[]);for(let[r,n]of Object.entries(null!=(a=c.cliStatus)?a:{}))t.push({key:"".concat(c.id,":").concat(r),worktreeId:c.id,instanceId:r,label:null!=(o=null==(s=c.cliStatusLabels)?void 0:s[r])?o:r,status:null!=n?n:"idle",branchName:c.name,repositoryName:c.repositoryName,lastActivity:null!=(l=null==(i=c.lastActivityByInstance)?void 0:i[r])?l:c.lastActivity,exited:e.has(r),..."ready"===n&&u.has(r)?{unclassified:!0}:{}})}return t}let k="instance";function I(e){return"/worktrees/".concat(e.worktreeId,"?").concat(k,"=").concat(encodeURIComponent(e.instanceId))}function L(e){return e.lastActivity?e.lastActivity instanceof Date?e.lastActivity.getTime():new Date(e.lastActivity).getTime():0}function E(e,t,r){let n="asc"===r?1:-1;return e.slice().sort((e,r)=>{if("status"===t){let t=f[e.status]-f[r.status];return 0!==t?t*n:L(r)-L(e)}let a=Number("waiting"===r.status)-Number("waiting"===e.status);if(0!==a)return a;switch(t){case"updatedAt":case"lastSent":return(L(e)-L(r))*n;case"repositoryName":return e.repositoryName.toLowerCase().localeCompare(r.repositoryName.toLowerCase())*n;case"branchName":return e.branchName.toLowerCase().localeCompare(r.branchName.toLowerCase())*n;default:return 0}})}let T="mcbd-sidebar-group-order-cache";function D(){try{let e=localStorage.getItem(T);if(!e)return[];let t=function(e){try{let t=JSON.parse(e);if(!Array.isArray(t))return[];return t.filter(e=>"string"==typeof e).slice(0,500)}catch(e){return[]}}(e);return t.length,t}catch(e){return[]}}function _(e){try{localStorage.setItem(T,JSON.stringify(e))}catch(e){}}function K(e,t){if(0===t.length)return e.slice();let r=new Map(t.map((e,t)=>[e,t]));return e.slice().sort((e,t)=>{let n=r.has(e.repositoryName)?r.get(e.repositoryName):1/0,a=r.has(t.repositoryName)?r.get(t.repositoryName):1/0;return n===a?e.repositoryName.localeCompare(t.repositoryName):n-a})}function O(e,t){return"hidden"!==e&&("always"===e||!t)}let R=/^detached-[a-z0-9]+$/,B=new Set(["waiting","running","generating"]);function M(e,t,r,n){let a=[],s=[];for(let i of e)((null==n?void 0:n.has(i.id))===!0||U(i,t,r)?a:s).push(i);return{shown:a,other:s}}function U(e,t,r){var n,a;let s=null!=(n=null==r?void 0:r.get(e.id))?n:e;return a=s.name,!R.test(a)||s.id===t||B.has(w(s))||B.has(s.status)}let j=56,z=["sessions","repositories","review"],J=8,P=40;function x(e){return!0!==e.isComposing&&229!==e.keyCode&&!e.shiftKey&&!e.altKey&&(!!e.metaKey||!!e.ctrlKey)&&("b"===e.key.toLowerCase()||"KeyB"===e.code)}function Z(e){if("undefined"==typeof HTMLElement||!(e instanceof HTMLElement))return!1;let t=e.tagName;return"INPUT"===t||"TEXTAREA"===t||"SELECT"===t||!!e.isContentEditable||null!==e.closest('[role="log"]')}let H=/^\/worktrees\/([^/]+)/;function V(e,t){let r=H.exec(e);if(!r)return t;try{return decodeURIComponent(r[1])}catch(e){return r[1]}}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5794],{12906:(e,t,n)=>{n.d(t,{Iz:()=>P,W2:()=>I,gM:()=>N,oW:()=>_,vP:()=>D,zX:()=>R});var r=n(95155),a=n(12115),i=n(47650),s=n(20063),o=n(18955),l=n(37772),c=n(32916),u=n(39649),d=n(22592),m=n(89275),p=n(69858),f=n(86815),h=n(17848),x=n(48481),b=n(98873),g=n(38606),w=n(7636),v=n(76471),y=n(46892),k=n(59854),j=n(77873);function N(e){var t,n,r;return!!(null!=(r=null==(t=e.closest)?void 0:t.call(e,"[data-repository-tab-panel]"))?r:null==(n=e.closest)?void 0:n.call(e,"[".concat(f.K,"]")))}function S(e,t,n){let r=n-8-t;return r<=8?8:Math.min(Math.max(e.left+t>n-8?e.right-t:e.left,8),r)}function E(e,t,n){return Math.max(0,Math.min(t,Math.floor(n-8-(e+4)-2)))}function C(){let[e,t]=(0,a.useState)(()=>window.innerHeight);return(0,a.useEffect)(()=>{let e=()=>t(window.innerHeight);return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e}let M="commandmate:repository-branch-list-open";function T(e){"undefined"!=typeof document&&document.dispatchEvent(new CustomEvent(M,{detail:e}))}function I(e,t){let n=(0,a.useId)();(0,a.useEffect)(()=>{e&&T(n)},[e,n]),(0,a.useEffect)(()=>{if(!e||"undefined"==typeof document)return;let r=e=>{e.detail!==n&&t()};return document.addEventListener(M,r),()=>document.removeEventListener(M,r)},[e,n,t])}function R(){let{selectWorktree:e}=(0,u.$f)(),t=(0,m.Hq)();return(0,a.useCallback)(n=>{T(null),e(n),t.push("/worktrees/".concat(n))},[e,t])}function O(e){var t;null==e||null==(t=e.scrollIntoView)||t.call(e,{block:"nearest",inline:"nearest"})}function P(e){let{worktrees:t,repositories:n,sortKey:r,sortDirection:i,repositoryOrder:s}=e,o=(0,a.useMemo)(()=>(0,w.UZ)(null!=n?n:[]),[n]),l=(0,a.useMemo)(()=>(0,w.s6)(null!=t?t:[],o),[t,o]),c=(0,a.useMemo)(()=>l.map(g.XK),[l]),{groupedItems:u}=(0,b.D)({items:c,sortKey:r,sortDirection:i,viewMode:"grouped"});return(0,a.useMemo)(()=>(0,w.Ew)(u,s),[u,s])}let D=(0,a.memo)(function(){var e;let t=(0,o.c)("common"),n=(0,s.usePathname)(),i=R(),{sortKey:m,sortDirection:p,repositoryOrder:f}=(0,c.VF)(),{worktrees:h,repositories:x,selectedWorktreeId:b}=(0,u.$f)(),{factor:g}=(0,d.Ps)(),v=P({worktrees:h,repositories:x,sortKey:m,sortDirection:p,repositoryOrder:f}),y=(0,w.jn)(n,b),k=(0,a.useMemo)(()=>{var e,t;return null!=(t=null==(e=v.find(e=>e.branches.some(e=>e.id===y)))?void 0:e.repositoryName)?t:null},[v,y]),[S,E]=(0,a.useState)(null),[C,M]=(0,a.useState)(null),[T,D]=(0,a.useState)(!1),B=(0,a.useRef)(null),z=(0,a.useRef)(null),K=(0,a.useRef)(new Map),W=(0,a.useCallback)((e,t)=>{t?K.current.set(e,t):K.current.delete(e)},[]),V=(0,a.useCallback)(()=>{E(null),M(null),D(!1)},[]),F=(0,a.useCallback)(e=>{let t=K.current.get(e);if(!t)return;let n=t.getBoundingClientRect();M({left:n.left,right:n.right,bottom:n.bottom}),E(e),D(!1)},[]),H=(0,a.useCallback)(e=>{if(S===e)return void V();F(e)},[S,V,F]),[G,q]=(0,a.useState)(!1),[U,Y]=(0,a.useState)(0),J=(0,a.useCallback)(()=>{let e=B.current;e&&(q(e.scrollWidth>e.clientWidth+1),Y(e.clientWidth))},[]);(0,a.useLayoutEffect)(()=>{J()},[J,v.length,g]),(0,a.useEffect)(()=>(window.addEventListener("resize",J),()=>window.removeEventListener("resize",J)),[J]);let X=(0,a.useRef)(null),Z=(0,a.useCallback)(e=>{var t;if(B.current=e,null==(t=X.current)||t.disconnect(),X.current=null,!e||"undefined"==typeof ResizeObserver)return;let n=new ResizeObserver(()=>J());n.observe(e),X.current=n},[J]),$=null!==S||T;I($,V),(0,a.useEffect)(()=>{if(!$)return;let e=e=>{var t,n;let r=e.target;!(!r||(null==(t=B.current)?void 0:t.contains(r))||(null==(n=z.current)?void 0:n.contains(r)))&&(N(r)||V())},t=e=>{if(!(0,j.V$)(e))return;let t=S?K.current.get(S):z.current;V(),null==t||t.focus()};return document.addEventListener("mousedown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)}},[$,S,V]),(0,a.useEffect)(()=>{V()},[n,V]),(0,a.useLayoutEffect)(()=>{k&&O(K.current.get(k))},[k,n,G,U]);let Q=(0,a.useCallback)(e=>{V(),i(e)},[V,i]),ee=(0,a.useCallback)(e=>{let t=K.current.get(e);O(t),F(e),null==t||t.focus()},[F]),et=(0,a.useCallback)(e=>{var t;let n=e.currentTarget,r=(t=n.clientWidth,e.ctrlKey||e.shiftKey||Math.abs(e.deltaY)<=Math.abs(e.deltaX)?0:1===e.deltaMode?40*e.deltaY:2===e.deltaMode?e.deltaY*t:e.deltaY);0!==r&&(n.scrollLeft+=r)},[]);if(0===v.length)return null;let en=Math.round(32*g),er=null!=(e=v.find(e=>e.repositoryName===S))?e:null;return(0,r.jsxs)("div",{"data-testid":"repository-tab-bar",className:"relative flex-shrink-0 flex items-stretch border-b border-border bg-sidebar text-sidebar-foreground",style:{height:"".concat(en,"px")},children:[(0,r.jsx)("nav",{ref:Z,"data-testid":"repository-tab-strip","aria-label":t("nav.repositories"),onWheel:et,className:"flex min-w-0 flex-1 flex-nowrap items-stretch overflow-x-auto overflow-y-hidden scrollbar-hide",children:v.map(e=>(0,r.jsx)(L,{group:e,isActive:e.repositoryName===k,isOpen:e.repositoryName===S,registerTab:W,onToggle:H},e.repositoryName))}),G&&(0,r.jsx)("button",{ref:z,type:"button","data-testid":"repository-tab-overflow","aria-haspopup":"menu","aria-expanded":T,"aria-label":t("repoTabBar.overflow"),title:t("repoTabBar.overflow"),onClick:()=>{E(null),M(null),D(e=>!e)},className:"flex-shrink-0 flex items-center border-l border-sidebar-border px-2 text-sidebar-muted transition-colors hover:bg-sidebar-hover hover:text-sidebar-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring",children:(0,r.jsx)(l.A,{size:16,strokeWidth:2,"aria-hidden":"true"})}),er&&C&&(0,r.jsx)(_,{group:er,anchor:C,factor:g,activeWorktreeId:y,onBranchClick:Q}),T&&(0,r.jsx)(A,{groups:v,anchorRef:z,activeRepositoryName:k,onSelect:ee})]})}),L=(0,a.memo)(function(e){let{group:t,isActive:n,isOpen:a,registerTab:i,onToggle:s}=e,l=(0,o.c)("common"),c=(0,w.zD)(t.branches),u=(0,v.Mq)(c,(0,w.El)(t.branches)),d=(0,w.j)(t.branches),m=l(u?v.rH:y.PL[c].labelKey);return(0,r.jsx)("button",{ref:e=>i(t.repositoryName,e),type:"button","data-testid":"repository-tab","data-repository":t.repositoryName,"aria-haspopup":"menu","aria-expanded":a,"aria-current":n?"true":void 0,title:"".concat(t.repositoryName," — ").concat(m),onClick:()=>s(t.repositoryName),onKeyDown:e=>{"ArrowDown"===e.key&&(e.preventDefault(),a||s(t.repositoryName))},className:"group/tab flex-shrink-0 flex max-w-[14rem] items-stretch px-0.5 py-1 text-xs font-medium focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring",children:(0,r.jsxs)("span",{"data-testid":"repository-tab-chip",className:"flex min-w-0 items-center gap-1.5 rounded-md px-2 transition-colors ".concat(n?"bg-background text-foreground shadow-sm":"text-sidebar-muted group-hover/tab:bg-sidebar-hover group-hover/tab:text-sidebar-foreground"),children:[(0,r.jsx)(h.n,{className:"h-3.5 w-3.5",color:(0,w.LV)(t.repositoryName)}),(0,r.jsx)("span",{className:"min-w-0 truncate",children:t.repositoryName}),(0,r.jsx)(x.m,{status:c,size:"sm",label:m,className:u?v.Jd:void 0,"data-testid":"repository-tab-status"}),d>0&&(0,r.jsx)("span",{"data-testid":"repository-tab-attention-count","aria-label":l("attention.badgeLabel",{count:d}),className:"flex-shrink-0 rounded-full bg-warning-subtle px-1.5 text-[10px] font-semibold leading-4 tabular-nums text-warning-foreground",children:d})]})})});function _(e){let{group:t,anchor:n,factor:s,activeWorktreeId:l,onBranchClick:c}=e,u=(0,o.c)("common"),d=(0,a.useRef)(null),m=C();if((0,a.useEffect)(()=>{var e;let t=null==(e=d.current)?void 0:e.querySelector("button");null==t||t.focus()},[t.repositoryName]),"undefined"==typeof document)return null;let f=Math.round(300*s),h=window.innerWidth;return i.createPortal((0,r.jsx)("div",{ref:d,"data-repository-tab-panel":"","data-testid":"repository-tab-popover","data-repository":t.repositoryName,role:"menu","aria-label":u("sidebar.branchNavigation"),className:"fixed rounded-md border border-sidebar-border bg-sidebar text-sidebar-foreground shadow-lg",style:{top:n.bottom+4,left:S(n,f,h),width:f,zIndex:k.M.POPOVER},children:(0,r.jsx)("div",{"data-testid":"repository-tab-popover-list",className:"overflow-y-auto overflow-x-hidden py-1",style:{maxHeight:"".concat(E(n.bottom,Math.round(520*s),m),"px")},children:0===t.branches.length?(0,r.jsx)("p",{className:"px-4 py-6 text-center text-sm text-sidebar-muted",children:u("sidebar.noBranchesAvailable")}):t.branches.map(e=>(0,r.jsx)(p.yP,{branch:e,isSelected:e.id===l,onClick:()=>c(e.id),showRepositoryName:!1},e.id))})}),document.body)}function A(e){var t;let{groups:n,anchorRef:a,activeRepositoryName:s,onSelect:l}=e,c=(0,o.c)("common"),u=C(),d=null==(t=a.current)?void 0:t.getBoundingClientRect();if("undefined"==typeof document||!d)return null;let m=window.innerWidth;return i.createPortal((0,r.jsx)("div",{"data-repository-tab-panel":"","data-testid":"repository-tab-overflow-menu",role:"menu","aria-label":c("nav.repositories"),className:"fixed rounded-md border border-sidebar-border bg-sidebar text-sidebar-foreground shadow-lg",style:{top:d.bottom+4,left:S({left:d.left,right:d.right,bottom:d.bottom},300,m),width:300,zIndex:k.M.POPOVER},children:(0,r.jsx)("div",{"data-testid":"repository-tab-overflow-list",className:"overflow-y-auto py-1",style:{maxHeight:"".concat(E(d.bottom,520,u),"px")},children:n.map(e=>{let t=(0,w.zD)(e.branches),n=(0,v.Mq)(t,(0,w.El)(e.branches));return(0,r.jsxs)("button",{type:"button",role:"menuitem","data-testid":"repository-tab-overflow-item","data-repository":e.repositoryName,"aria-current":e.repositoryName===s?"true":void 0,onClick:()=>l(e.repositoryName),className:"flex w-full items-center gap-2 px-3 py-2 text-left text-sm transition-colors hover:bg-sidebar-hover focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring",children:[(0,r.jsx)(h.n,{className:"h-3.5 w-3.5",color:(0,w.LV)(e.repositoryName)}),(0,r.jsx)("span",{className:"min-w-0 flex-1 truncate",children:e.repositoryName}),(0,r.jsx)(x.m,{status:t,size:"sm",label:c(n?v.rH:y.PL[t].labelKey),className:n?v.Jd:void 0}),(0,r.jsx)("span",{className:"tabular-nums text-xs text-sidebar-muted",children:e.branches.length})]},e.repositoryName)})})}),document.body)}},18848:(e,t,n)=>{n.d(t,{Bz:()=>i,kj:()=>a,wx:()=>r}),n(95704);let r=["send","wait","capture","respond"];function a(e){let{binary:t,worktreeId:n,instanceId:r,messagePlaceholder:a}=e,i=null!=e.portPrefix&&3e3!==e.portPrefix?"CM_PORT=".concat(e.portPrefix," "):"",s="--instance ".concat(r),o="".concat(i).concat(t);return{send:"".concat(o," send ").concat(n,' "').concat(a,'" ').concat(s),wait:"".concat(o," wait ").concat(n," ").concat(s," --on-prompt human"),capture:"".concat(o," capture ").concat(n," ").concat(s),respond:"".concat(o," respond ").concat(n,' "').concat("1",'" ').concat(s)}}function i(e){let{binary:t,worktreeId:n,instanceId:r,instanceLabel:a,toolLabel:i}=e,s=null!=e.portPrefix&&3e3!==e.portPrefix?"CM_PORT=".concat(e.portPrefix," "):"",o="".concat(s).concat(t),l="--instance ".concat(r),c="ja"===e.locale?"ja":"en",u="".concat(o," capture ").concat(n," ").concat(l," --pane --tail ").concat(60),d="".concat(o," ask ").concat(n," ").concat(l,' "<request>" --async');if("ja"===c){let e="".concat(o," ask ").concat(n," ").concat(l,' "<依頼文>" --timeout ').concat(1800);return["## 別セッション「".concat(a,"」への委任"),"- 宛先: worktree `".concat(n,"` / instance `").concat(r,"`(").concat(i,")"),"- 依頼: ".concat(e)," - exit 0: 標準出力が返答本文\n - exit 10: 相手が確認待ち。標準出力のprompt JSONを私に報告して止まる(自分で答えない)\n - exit 124: タイムアウト。captureで状況を見て報告","- 待たない依頼: ".concat(d)," - 即座に relay id を返して exit 0。完了時に `[from ...]` 付きで返答が私のコンポーザーに届く"," - 状況確認: ".concat(o," relays / 取り消し: ").concat(o," relays cancel <relay-id>"),"- 進捗確認: ".concat(u),"- 禁止: respondで相手のプロンプトに答える / auto-yesを有効化する"].join("\n")}let m="".concat(o," ask ").concat(n," ").concat(l,' "<request>" --timeout ').concat(1800);return['## Delegating to session "'.concat(a,'"'),"- Target: worktree `".concat(n,"` / instance `").concat(r,"` (").concat(i,")"),"- Ask: ".concat(m)," - exit 0: stdout is the reply body\n - exit 10: they are waiting on a confirmation. Report the prompt JSON on stdout back to me and stop (do not answer it yourself)\n - exit 124: timed out. Look with capture and report what you see","- Ask without waiting: ".concat(d)," - exits 0 with a relay id on stdout; the reply lands in my composer prefixed `[from ...]` when the turn ends"," - Outstanding: ".concat(o," relays / withdraw: ").concat(o," relays cancel <relay-id>"),"- Progress: ".concat(u),"- Do not: answer their prompt with respond / turn auto-yes on"].join("\n")}},22592:(e,t,n)=>{n.d(t,{Ps:()=>d,W5:()=>u});var r=n(95155),a=n(12115),i=n(38218),s=n(68704);let o="data-pc-size",l={size:s.r5,setSize:()=>{},isMobile:!1,factor:s.d8[s.r5].factor,isAvailable:!1},c=(0,a.createContext)(l);function u(e){let{children:t}=e,{size:n,setSize:l,isAvailable:u}=(0,s.of)(),d=(0,i.a)();(0,a.useEffect)(()=>{if("undefined"==typeof document)return;let e=document.documentElement;return d?void e.removeAttribute(o):(e.setAttribute(o,n),()=>{e.removeAttribute(o)})},[n,d]);let m=(0,a.useMemo)(()=>({size:n,setSize:l,isMobile:d,factor:s.d8[n].factor,isAvailable:u}),[n,l,d,u]);return(0,r.jsx)(c.Provider,{value:m,children:t})}function d(){return(0,a.useContext)(c)}},26020:(e,t,n)=>{n.d(t,{Xn:()=>a,d9:()=>o,dI:()=>r,gB:()=>i,vK:()=>s});let r=["en","ja"],a="en",i="locale",s={en:"English",ja:"日本語"};function o(e){return"string"==typeof e&&r.includes(e)}},30061:(e,t,n)=>{n.d(t,{nR:()=>s});var r=n(95155),a=n(12115),i=n(47650);function s(e){let{content:t,delay:n=200,className:s,children:o,metadata:l}=e,c=(0,a.useRef)(null),u=(0,a.useRef)(null),d=(0,a.useRef)(null),m=(0,a.useRef)(null),[p,f]=(0,a.useState)(!1),[h,x]=(0,a.useState)({top:-9999,left:-9999}),b=(0,a.useCallback)(()=>{null!==d.current&&(clearTimeout(d.current),d.current=null)},[]),g=(0,a.useCallback)(()=>{let e=c.current;e&&(e.scrollWidth>e.clientWidth||l)&&(b(),d.current=setTimeout(()=>{let t=e.getBoundingClientRect(),n=Math.max(4,window.innerWidth-384-4);m.current={top:t.top,bottom:t.bottom},x({top:t.bottom+4,left:Math.min(t.left,n)}),f(!0),d.current=null},n))},[b,n,l]);(0,a.useLayoutEffect)(()=>{if(!p)return;let e=u.current,t=m.current;if(!e||!t)return;let{height:n}=e.getBoundingClientRect();if(n<=0)return;let r=window.innerHeight;if(t.bottom+4+n+4<=r)return;let a=t.top-4-n,i=a>=4?a:Math.max(4,r-n-4);x(e=>e.top===i?e:{...e,top:i})},[p]);let w=(0,a.useCallback)(()=>{b(),f(!1)},[b]);return(0,a.useEffect)(()=>()=>b(),[b]),(0,r.jsxs)("span",{ref:c,className:s,onMouseEnter:g,onMouseLeave:w,children:[null!=o?o:t,p&&"undefined"!=typeof document&&(0,i.createPortal)((0,r.jsxs)("span",{ref:u,role:"tooltip","aria-hidden":"true",className:"fixed z-[9999] max-w-md px-2 py-1 text-xs font-medium rounded bg-foreground text-background shadow-lg pointer-events-none",style:{top:h.top,left:h.left},children:[(0,r.jsx)("span",{className:"block break-all",children:t}),l&&(0,r.jsx)("span",{className:"mt-0.5 block whitespace-pre-line font-normal text-background/70",children:l})]}),document.body)]})}},32916:(e,t,n)=>{n.d(t,{GB:()=>m,P0:()=>s,RA:()=>o,VF:()=>p,e8:()=>l,pT:()=>f});var r=n(95155),a=n(12115),i=n(7636);let s="updatedAt",o="desc",l="grouped",c=(0,a.createContext)(null);function u(e,t,n,r){let i=(0,a.useRef)(!0);(0,a.useEffect)(()=>{try{let t=localStorage.getItem(e);t&&r(t)}catch(e){}},[]),(0,a.useEffect)(()=>{if(i.current){i.current=!1;return}try{localStorage.setItem(e,n())}catch(e){}},[t])}function d(e,t){switch(t.type){case"TOGGLE":return{...e,isOpen:!e.isOpen};case"SET_WIDTH":return{...e,width:t.width};case"OPEN_MOBILE_DRAWER":return{...e,isMobileDrawerOpen:!0};case"CLOSE_MOBILE_DRAWER":return{...e,isMobileDrawerOpen:!1};case"SET_SORT_KEY":return{...e,sortKey:t.sortKey};case"SET_SORT_DIRECTION":return{...e,sortDirection:t.sortDirection};case"LOAD_SORT_SETTINGS":return{...e,sortKey:t.sortKey,sortDirection:t.sortDirection};case"SET_VIEW_MODE":return{...e,viewMode:t.viewMode};case"SET_OPEN":return e.isOpen===t.isOpen?e:{...e,isOpen:t.isOpen};case"SET_REPOSITORY_ORDER":return{...e,repositoryOrder:t.repositoryOrder};case"SET_REPO_TAB_BAR_MODE":return{...e,repoTabBarMode:t.repoTabBarMode};default:return e}}function m(e){let{children:t,initialOpen:n=!0,initialWidth:m=224}=e,[p,f]=(0,a.useReducer)(d,{isOpen:n,width:m,isMobileDrawerOpen:!1,sortKey:s,sortDirection:o,viewMode:l,repositoryOrder:(0,i.ZD)(),repoTabBarMode:i.PB});u("mcbd-sidebar-sort","".concat(p.sortKey,":").concat(p.sortDirection),()=>JSON.stringify({sortKey:p.sortKey,sortDirection:p.sortDirection}),e=>{try{let t=JSON.parse(e),n=t.sortDirection,r=(0,i.Si)(t.sortKey)?t.sortKey:s;r&&("asc"===n||"desc"===n)&&f({type:"LOAD_SORT_SETTINGS",sortKey:r,sortDirection:n})}catch(e){}}),u("mcbd-sidebar-view-mode",p.viewMode,()=>p.viewMode,e=>{(0,i.$m)(e)&&f({type:"SET_VIEW_MODE",viewMode:e})}),u("mcbd-sidebar-width",p.width,()=>String(p.width),e=>{let t=Number(e);!isNaN(t)&&t>0&&f({type:"SET_WIDTH",width:288===t?224:t})}),u("mcbd-sidebar-open",p.isOpen,()=>String(p.isOpen),e=>{("true"===e||"false"===e)&&f({type:"SET_OPEN",isOpen:"true"===e})}),u("mcbd-repo-tab-bar-mode",p.repoTabBarMode,()=>p.repoTabBarMode,e=>{(0,i.m3)(e)&&f({type:"SET_REPO_TAB_BAR_MODE",repoTabBarMode:e})});let h=(0,a.useCallback)(()=>{f({type:"TOGGLE"})},[]),x=(0,a.useCallback)(e=>{f({type:"SET_WIDTH",width:e})},[]),b=(0,a.useCallback)(()=>{f({type:"OPEN_MOBILE_DRAWER"})},[]),g=(0,a.useCallback)(()=>{f({type:"CLOSE_MOBILE_DRAWER"})},[]),w=(0,a.useCallback)(e=>{f({type:"SET_SORT_KEY",sortKey:e})},[]),v=(0,a.useCallback)(e=>{f({type:"SET_SORT_DIRECTION",sortDirection:e})},[]),y=(0,a.useCallback)(e=>{f({type:"SET_VIEW_MODE",viewMode:e})},[]),k=(0,a.useCallback)(e=>{f({type:"SET_REPOSITORY_ORDER",repositoryOrder:e}),(0,i.ZC)(e)},[]),j=(0,a.useCallback)(e=>{f({type:"SET_REPO_TAB_BAR_MODE",repoTabBarMode:e})},[]),N=(0,a.useMemo)(()=>({isOpen:p.isOpen,width:p.width,isMobileDrawerOpen:p.isMobileDrawerOpen,sortKey:p.sortKey,sortDirection:p.sortDirection,toggle:h,setWidth:x,openMobileDrawer:b,closeMobileDrawer:g,setSortKey:w,setSortDirection:v,viewMode:p.viewMode,setViewMode:y,repositoryOrder:p.repositoryOrder,setRepositoryOrder:k,repoTabBarMode:p.repoTabBarMode,setRepoTabBarMode:j}),[p.isOpen,p.width,p.isMobileDrawerOpen,p.sortKey,p.sortDirection,p.viewMode,p.repositoryOrder,p.repoTabBarMode,h,x,b,g,w,v,y,k,j]);return(0,r.jsx)(c.Provider,{value:N,children:t})}function p(){let e=(0,a.useContext)(c);if(!e)throw Error("useSidebarContext must be used within a SidebarProvider");return e}function f(){return(0,a.useContext)(c)}},41898:(e,t,n)=>{n.d(t,{m_:()=>f});var r=n(95155),a=n(12115),i=n(47650),s=n(77873);function o(e,t,n){return Math.min(Math.max(e,4),Math.max(4,n-t-4))}function l(e,t,n,r){switch(e){case"top":return t.top-n.height-8<4;case"bottom":return t.top+t.height+8+n.height>r.height-4;case"left":return t.left-n.width-8<4;default:return t.left+t.width+8+n.width>r.width-4}}function c(e,t,n){switch(e){case"top":return Math.max(0,t.top-8-4);case"bottom":return Math.max(0,n.height-4-(t.top+t.height+8));case"left":return Math.max(0,t.left-8-4);default:return Math.max(0,n.width-4-(t.left+t.width+8))}}function u(e){return{maxWidth:"".concat(e,"px"),whiteSpace:"normal",overflowWrap:"anywhere"}}let d={maxWidth:"max-width",whiteSpace:"white-space",overflowWrap:"overflow-wrap"};function m(e,t){let n=null===t?null:u(t);for(let[t,r]of Object.entries(d))null===n?e.style.removeProperty(r):e.style.setProperty(r,n[t])}let p={top:-9999,left:-9999};function f(e){let{content:t,placement:n="right",delay:d=100,children:f,className:h,zIndex:x,fallbackPlacement:b}=e,[g,w]=(0,a.useState)(!1),[v,y]=(0,a.useState)(!1),k=g||v,[j,N]=(0,a.useState)(null),[S,E]=(0,a.useState)(null),C=(0,a.useRef)(null),M=(0,a.useRef)(null),T=(0,a.useRef)(null),I=(0,a.useCallback)(()=>{null!==T.current&&(clearTimeout(T.current),T.current=null)},[]),R=(0,a.useCallback)(()=>{I(),T.current=setTimeout(()=>{w(!0),T.current=null},d)},[d,I]),O=(0,a.useCallback)(()=>{I(),w(!1)},[I]),P=(0,a.useCallback)(()=>{y(!0)},[]),D=(0,a.useCallback)(()=>{y(!1)},[]),L=(0,a.useCallback)(()=>{I(),w(!1),y(!1)},[I]),_=(0,a.useCallback)(()=>{let e=C.current,t=M.current;if(!e||!t)return;let r=e.getBoundingClientRect(),a={top:r.top,left:r.left,width:r.width,height:r.height},i={width:window.innerWidth,height:window.innerHeight};m(t,null);let s=t.getBoundingClientRect(),u=function(e,t,n,r,a){let i=e=>"left"===e||"right"===e;if(void 0===a||a===e||!i(e)||!i(a)||!l(e,t,n,r)||!l(a,t,n,r))return null;let s=c(e,t,r),o=c(a,t,r),u=o>s?a:e,d=Math.floor(Math.max(s,o));return d>=80?{placement:u,maxWidth:d}:null}(n,a,{width:s.width,height:s.height},i,b);u&&(m(t,u.maxWidth),s=t.getBoundingClientRect()),E(u?u.maxWidth:null),N(function e(t,n,r,a,i){let s,c;if(void 0!==i&&i!==t&&l(t,n,r,a)&&!l(i,n,r,a))return e(i,n,r,a);let u=n.left+n.width/2-r.width/2,d=n.top+n.height/2-r.height/2;switch(t){case"top":s=n.top-r.height-8,c=u;break;case"bottom":s=n.top+n.height+8,c=u;break;case"left":s=d,c=n.left-r.width-8;break;default:s=d,c=n.left+n.width+8}return{top:o(s,r.height,a.height),left:o(c,r.width,a.width)}}(u?u.placement:n,a,{width:s.width,height:s.height},i,u?void 0:b))},[n,b]);return(0,a.useLayoutEffect)(()=>{if(!k){N(null),E(null);return}return _(),window.addEventListener("resize",_),window.addEventListener("scroll",_,!0),()=>{window.removeEventListener("resize",_),window.removeEventListener("scroll",_,!0)}},[k,_]),(0,a.useEffect)(()=>{if(!k)return;let e=e=>{(0,s.V$)(e)&&L()};return window.addEventListener("keydown",e),()=>{window.removeEventListener("keydown",e)}},[k,L]),(0,a.useEffect)(()=>()=>{I()},[I]),(0,r.jsxs)("span",{ref:C,"data-testid":"tooltip-wrapper",className:h?"relative inline-flex ".concat(h):"relative inline-flex",tabIndex:-1,onMouseEnter:R,onMouseLeave:O,onFocus:P,onBlur:D,children:[f,k&&"undefined"!=typeof document&&(0,i.createPortal)((0,r.jsx)("span",{ref:M,role:"tooltip","aria-hidden":"true","data-placement":n,className:"fixed z-40 whitespace-nowrap px-2 py-1 text-xs font-medium rounded bg-foreground text-background shadow-lg pointer-events-none",style:{...null!=j?j:p,...void 0===x?{}:{zIndex:x},...null===S?{}:u(S)},children:t}),document.body)]})}},45195:(e,t,n)=>{n.d(t,{g:()=>i});var r=n(36809),a=n(26020);function i(){return{currentLocale:(0,r.Ym)(),switchLocale:e=>{if(a.dI.includes(e)){let t="https:"===window.location.protocol;document.cookie="".concat(a.gB,"=").concat(e,";path=/;max-age=").concat(31536e3,";SameSite=Lax").concat(t?";Secure":""),localStorage.setItem("locale",e),window.location.reload()}}}}},45573:(e,t,n)=>{n.d(t,{P0:()=>en,oQ:()=>et,tJ:()=>Z,xk:()=>ee,xq:()=>ea,yW:()=>er});var r=n(95155),a=n(12115),i=n(47650),s=n(20063),o=n(89275),l=n(18955),c=n(36809),u=n(5379),d=n(79698),m=n(66685),p=n(24533),f=n(61362),h=n(95740),x=n(37772),b=n(11010),g=n(59427),w=n(37494),v=n(79451),y=n(89559),k=n(97470),j=n(94684),N=n(76482),S=n(39332),E=n(86651),C=n(18085),M=n(87531),T=n(59854),I=n(92614),R=n(70628),O=n(51743),P=n(22592),D=n(66966),L=n(68704),_=n(45195),A=n(80344),B=n(48481),z=n(76471),K=n(38606),W=n(79651),V=n(46365),F=n(94442),H=n(18848),G=n(54014);let q=[{key:"sessions",href:"/sessions"},{key:"repositories",href:"/repositories"},{key:"review",href:"/review"},{key:"skills",href:"/skills"},{key:"more",href:"/more"}],U={sessions:m.A,repositories:p.A,review:f.A,skills:h.A,more:x.A},Y="cm.palette.recents";function J(e){if(!e||"object"!=typeof e)return!1;let{kind:t,id:n}=e;return("nav"===t||"worktree"===t||"action"===t)&&"string"==typeof n}function X(e){var t;let{worktree:n,className:a}=e,i=(0,l.c)("common"),s=n.isWaitingForResponse?"waiting":n.isProcessing?"running":n.isSessionRunning?"ready":"idle",o=(0,z.Mq)(s,Object.values(null!=(t=n.sessionStatusByCli)?t:{}).some(e=>(0,K.px)(e)));return(0,r.jsx)(B.m,{status:s,size:"sm",label:o?i(z.rH):void 0,className:(0,M.cn)(a,o&&z.Jd),"data-unclassified":o?"true":void 0})}function Z(e){if(!(e instanceof HTMLElement))return!1;let t=e.tagName;return!!("INPUT"===t||"TEXTAREA"===t||"SELECT"===t||e.isContentEditable||e.closest('[role="log"]'))}let $=(0,M.cn)("flex cursor-pointer items-center gap-2 rounded-md px-2 py-2 text-sm","text-foreground","data-[selected=true]:bg-accent-500/15 data-[selected=true]:text-accent-700","dark:data-[selected=true]:text-accent-300"),Q="shrink-0 text-muted-foreground";function ee(){var e;if("undefined"==typeof document)return null;let t=document.querySelector("[data-instance-id]");return(null==t||null==(e=t.getAttribute("data-instance-id"))?void 0:e.trim())||null}function et(e){var t,n;if("undefined"==typeof document)return!1;let r=Array.from(document.querySelectorAll('[data-testid="message-input-textarea"]'));if(0===r.length)return!1;let a=document.activeElement,i=null!=(n=r.find(e=>e===a))?n:r[0],s=i.value,o=""===s.trim()?e:"".concat(s,"\n\n").concat(e),l=null==(t=Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype,"value"))?void 0:t.set;return l?l.call(i,o):i.value=o,i.dispatchEvent(new Event("input",{bubbles:!0})),i.focus(),i.setSelectionRange(o.length,o.length),!0}async function en(e,t,n){try{let[r,a]=await Promise.all([fetch("/api/worktrees/".concat(e,"/cli-reference")),fetch("/api/worktrees/".concat(e,"/resolve-target?instance=").concat(encodeURIComponent(t.id)))]);if(!r.ok||!a.ok)return null;let[i,s]=await Promise.all([r.json(),a.json()]);return(0,H.Bz)({binary:i.binary,worktreeId:i.worktreeId,instanceId:s.instanceId,instanceLabel:t.alias,toolLabel:(0,G.oo)(s.cliToolId),portPrefix:i.portPrefix,locale:n})}catch(e){return null}}let er={ja:{heading:"委任 (/delegate)",menuItem:"委任方法をコンポーザーに挿入",inserted:"委任方法をコンポーザーに挿入しました",self:"自分自身には委任できません",noComposer:"コンポーザーが見つかりません。worktree 画面を開いてから実行してください",failed:"委任方法を作成できませんでした"},en:{heading:"Delegate (/delegate)",menuItem:"Insert delegation brief into the composer",inserted:"Delegation brief inserted into the composer",self:"That is this session — nothing to delegate to",noComposer:"No composer on screen. Open a worktree screen and try again",failed:"Could not build the delegation brief"}};function ea(){var e,t,n;let{open:m,setOpen:p}=(0,I.C)(),{setOpen:f}=(0,R.K)(),{openNewTask:h}=(0,O.hX)(),x=(0,o.Hq)(),B=(0,s.usePathname)(),z=(0,c.Ym)(),K=(0,l.c)("commandPalette"),H=(0,l.c)("common"),{theme:ea,setTheme:ei}=(0,u.D)(),{setSize:es,isMobile:eo}=(0,P.Ps)(),{currentLocale:el,switchLocale:ec}=(0,_.g)(),eu=(0,D.rC)(),{showToast:ed}=(0,F.dj)(),[em,ep]=(0,a.useState)(!1),[ef,eh]=(0,a.useState)(""),[ex,eb]=(0,a.useState)([]),eg=(0,a.useRef)(null),ew=(0,a.useRef)(null),ev=(0,a.useRef)(m);(0,a.useEffect)(()=>{ev.current=m},[m]),(0,a.useEffect)(()=>{ep(!0)},[]),(0,a.useEffect)(()=>{function e(e){if(("k"===e.key||"K"===e.key)&&(e.metaKey||e.ctrlKey)){if(ev.current){e.preventDefault(),e.stopPropagation(),p(!1);return}if(Z(e.target)||(0,V.Sj)())return;e.preventDefault(),p(!0);return}"Escape"===e.key&&ev.current&&(e.preventDefault(),e.stopPropagation(),p(!1))}return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[p]),(0,a.useEffect)(()=>{var e,t,n,r;m?(ew.current=null!=(t=document.activeElement)?t:null,null==(e=eg.current)||e.focus(),eh(""),eb(function(){try{let e=localStorage.getItem(Y);if(!e)return[];let t=JSON.parse(e);if(!Array.isArray(t))return[];return t.filter(J).slice(0,8)}catch(e){return[]}}())):ew.current&&(null==(n=(r=ew.current).focus)||n.call(r),ew.current=null)},[m]);let ey=(0,a.useCallback)((e,t)=>{t&&eb(e=>(function(e,t){let n=e.filter(e=>e.kind!==t.kind||e.id!==t.id),r=[t,...n].slice(0,8);try{localStorage.setItem(Y,JSON.stringify(r))}catch(e){}return r})(e,t)),p(!1),e()},[p]),ek=(0,a.useCallback)(async e=>{let t=er["ja"===z?"ja":"en"];if(function(e){let t=/^\/worktrees\/([^/?#]+)/.exec(null!=e?e:"");return t?decodeURIComponent(t[1]):null}(B)===e.worktree.id&&ee()===e.instance.id)return void ed(t.self,"info");let n=await en(e.worktree.id,e.instance,z);if(null===n)return void ed(t.failed,"error");let r=et(n);ed(r?t.inserted:t.noComposer,r?"success":"error")},[z,B,ed]),ej=(0,a.useCallback)(async()=>{try{var e;await A.Rx.sync(),await (null==eu||null==(e=eu.refresh)?void 0:e.call(eu)),ed(K("actions.syncSuccess"),"success")}catch(e){ed(K("actions.syncError"),"error")}},[eu,ed,K]),eN="dark"===ea,eS=""===ef.trim(),eE=null!=(e=null==eu?void 0:eu.error)?e:null,eC=null!=(t=null==eu?void 0:eu.isLoading)&&t,eM=eE?[]:null!=(n=null==eu?void 0:eu.worktrees)?n:[],eT=eM.length>0,eI=!eE&&eC&&0===eM.length,eR=!function(e){let t=e.trim().toLowerCase();return""!==t&&(t.startsWith("/")||t.includes("delegate"))}(ef)?[]:function(e){let t=[];for(let r of e){var n;for(let e of(null==(n=r.agentInstances)?void 0:n.length)?r.agentInstances:r.cliToolId?[{id:r.cliToolId,cliTool:r.cliToolId,alias:(0,G.oo)(r.cliToolId),order:0}]:[])t.push({worktree:r,instance:e})}return t}(eM),eO=er["ja"===z?"ja":"en"],eP=[...eM].sort((e,t)=>{let n=+!!e.isSessionRunning,r=+!!t.isSessionRunning;if(n!==r)return r-n;let a=e.updatedAt?new Date(e.updatedAt).getTime():0;return(t.updatedAt?new Date(t.updatedAt).getTime():0)-a}),eD=eS?eP.slice(0,8):eP,eL=[{id:"newTask",label:K("actions.newTask"),icon:b.A,run:()=>queueMicrotask(()=>h())},{id:"theme",label:eN?K("actions.toLight"):K("actions.toDark"),icon:eN?g.A:w.A,run:()=>ei(eN?"light":"dark")},...eo?[]:L.Uf.map(e=>({id:"displaysize:".concat(e),label:"".concat(K("actions.displaySizePrefix"),": ").concat(H("displaySize.".concat(e))),icon:v.A,run:()=>es(e)})),{id:"sync",label:K("actions.syncRepositories"),icon:y.A,run:()=>{ej()}},{id:"locale",label:K("actions.switchLanguage"),icon:k.A,run:()=>ec("ja"===el?"en":"ja")},{id:"github",label:K("actions.openGitHub"),icon:j.A,run:()=>window.open("https://github.com/kewton/MyCodeBranchDesk","_blank","noopener,noreferrer")},{id:"keyboardShortcuts",label:K("actions.keyboardShortcuts"),icon:N.A,run:()=>f(!0)}],e_=eS?ex.map(e=>{if("nav"===e.kind){let t=q.find(t=>t.key===e.id);if(!t)return null;let n=U[t.key],a=H("nav.".concat(t.key));return{id:"nav-".concat(t.key),value:"recent nav ".concat(t.key),node:(0,r.jsxs)(r.Fragment,{children:[n&&(0,r.jsx)(n,{size:16,className:Q,"aria-hidden":"true"}),(0,r.jsx)("span",{className:"truncate",children:a})]}),onSelect:()=>ey(()=>x.push(t.href),{kind:"nav",id:t.key})}}if("worktree"===e.kind){let t=eM.find(t=>t.id===e.id);if(!t)return null;let n=t.repositoryDisplayName||t.repositoryName||"",a=t.branch||t.name;return{id:"worktree-".concat(t.id),value:"recent worktree ".concat(t.id),node:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(S.A,{size:16,className:Q,"aria-hidden":"true"}),(0,r.jsx)("span",{className:"truncate",children:a}),n&&(0,r.jsx)("span",{className:"ml-auto truncate pl-2 text-xs text-muted-foreground",children:n}),(0,r.jsx)(X,{worktree:t,className:n?"ml-2":"ml-auto"})]}),onSelect:()=>ey(()=>x.push("/worktrees/".concat(t.id)),{kind:"worktree",id:t.id})}}let t=eL.find(t=>t.id===e.id);if(!t)return null;let n=t.icon;return{id:"action-".concat(t.id),value:"recent action ".concat(t.id),node:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n,{size:16,className:Q,"aria-hidden":"true"}),(0,r.jsx)("span",{className:"truncate",children:t.label})]}),onSelect:()=>ey(t.run,{kind:"action",id:t.id})}}).filter(e=>null!==e):[];return em?(0,i.createPortal)((0,r.jsx)(r.Fragment,{children:m&&(0,r.jsxs)("div",{className:"fixed inset-0 overflow-y-auto",style:{zIndex:T.M.MODAL},"data-testid":"command-palette",children:[(0,r.jsx)("div",{"data-state":"open","aria-hidden":"true",className:"fixed inset-0 bg-black/40 backdrop-blur-sm transition-opacity data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:duration-200",onClick:()=>p(!1)}),(0,r.jsx)("div",{className:"relative flex min-h-full items-start justify-center p-4 pt-[15vh]",children:(0,r.jsx)("div",{"data-state":"open","data-testid":"command-palette-panel",className:(0,M.cn)("relative w-full max-w-lg overflow-hidden rounded-xl bg-surface/95 shadow-2xl ring-1 ring-border backdrop-blur-xl","data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:duration-200"),children:(0,r.jsxs)(d.uB,{label:K("title"),className:(0,M.cn)("flex flex-col","[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:pb-1 [&_[cmdk-group-heading]]:pt-2","[&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground"),children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 border-b border-border px-3",children:[(0,r.jsx)(E.A,{size:16,strokeWidth:2,"aria-hidden":"true",className:"shrink-0 text-muted-foreground"}),(0,r.jsx)(d.uB.Input,{ref:eg,value:ef,onValueChange:eh,placeholder:K("placeholder"),"data-testid":"command-palette-input",className:"flex-1 bg-transparent py-3 text-sm text-foreground outline-none placeholder:text-muted-foreground"})]}),(0,r.jsxs)(d.uB.List,{className:"max-h-[min(60vh,360px)] overflow-y-auto p-2",children:[(0,r.jsx)(d.uB.Empty,{"data-testid":"command-palette-empty",className:"py-6 text-center text-sm text-muted-foreground",children:K("empty")}),eI&&(0,r.jsx)(d.uB.Loading,{"data-testid":"command-palette-loading",className:"py-6 text-center text-sm text-muted-foreground",children:K("loading")}),e_.length>0&&(0,r.jsx)(d.uB.Group,{heading:K("groups.recent"),children:e_.map(e=>(0,r.jsx)(d.uB.Item,{value:e.value,onSelect:e.onSelect,className:$,children:e.node},e.id))}),(0,r.jsx)(d.uB.Group,{heading:K("groups.navigation"),children:q.map(e=>{let t=H("nav.".concat(e.key)),n=U[e.key];return(0,r.jsxs)(d.uB.Item,{value:"nav ".concat(t," ").concat(e.href),onSelect:()=>ey(()=>x.push(e.href),{kind:"nav",id:e.key}),className:$,children:[n&&(0,r.jsx)(n,{size:16,className:Q,"aria-hidden":"true"}),(0,r.jsx)("span",{className:"truncate",children:t})]},e.key)})}),eT&&(function(e){let t=new Map;for(let n of e){let e=n.repositoryDisplayName||n.repositoryName||"",r=e||"\0unnamed",a=t.get(r);a?a.worktrees.push(n):t.set(r,{key:r,repository:e,worktrees:[n]})}return[...t.values()]})(eD).map(e=>(0,r.jsx)(d.uB.Group,{heading:e.repository||K("groups.worktrees"),children:e.worktrees.map(t=>{let n=t.branch||t.name;return(0,r.jsxs)(d.uB.Item,{value:"worktree ".concat(e.repository," ").concat(n," ").concat(t.name," ").concat(t.id),onSelect:()=>ey(()=>x.push("/worktrees/".concat(t.id)),{kind:"worktree",id:t.id}),className:$,children:[(0,r.jsx)(S.A,{size:16,className:Q,"aria-hidden":"true"}),(0,r.jsx)("span",{className:"truncate",children:n}),(0,r.jsx)(X,{worktree:t,className:"ml-auto"})]},t.id)})},e.key)),eR.length>0&&(0,r.jsx)(d.uB.Group,{heading:eO.heading,children:eR.map(e=>{let t=e.worktree.branch||e.worktree.name;return(0,r.jsxs)(d.uB.Item,{"data-testid":"palette-delegate-".concat(e.worktree.id,"-").concat(e.instance.id),value:"/delegate ".concat(e.worktree.id," ").concat(e.instance.id," ").concat(e.instance.alias," ").concat(t),onSelect:()=>ey(()=>{ek(e)}),className:$,children:[(0,r.jsx)(C.A,{size:16,className:Q,"aria-hidden":"true"}),(0,r.jsx)("span",{className:"truncate",children:e.instance.alias}),(0,r.jsxs)("span",{className:"ml-auto truncate pl-2 text-xs text-muted-foreground",children:[t," / ",e.instance.id]})]},"".concat(e.worktree.id,":").concat(e.instance.id))})}),(0,r.jsx)(d.uB.Group,{heading:K("groups.actions"),children:eL.map(e=>{let t=e.icon;return(0,r.jsxs)(d.uB.Item,{value:"action ".concat(e.id," ").concat(e.label),onSelect:()=>ey(e.run,{kind:"action",id:e.id}),className:$,children:[(0,r.jsx)(t,{size:16,className:Q,"aria-hidden":"true"}),(0,r.jsx)("span",{className:"truncate",children:e.label})]},e.id)})})]}),(0,r.jsxs)("div",{className:"flex items-center gap-3 border-t border-border bg-surface-2 px-3 py-2 text-[11px] text-muted-foreground",children:[(0,r.jsxs)("span",{className:"flex items-center gap-1",children:[(0,r.jsx)(W.u,{children:"↑"}),(0,r.jsx)(W.u,{children:"↓"}),K("footer.navigate")]}),(0,r.jsxs)("span",{className:"flex items-center gap-1",children:[(0,r.jsx)(W.u,{children:"↵"}),K("footer.select")]}),(0,r.jsxs)("span",{className:"flex items-center gap-1",children:[(0,r.jsx)(W.u,{children:"esc"}),K("footer.close")]})]})]})})})]})}),document.body):null}},46365:(e,t,n)=>{function r(e){let t=e.ownerDocument.defaultView;for(let n=e;n;n=n.parentElement)if(n instanceof HTMLElement&&n.hidden||t&&"none"===t.getComputedStyle(n).display)return!1;return!0}function a(){return"undefined"!=typeof document&&Array.from(document.querySelectorAll("".concat('[role="dialog"][aria-modal="true"]:not([data-state="closed"]):not([data-testid="prompt-panel"])',", ").concat('[role="menu"][data-state="open"]'))).some(r)}n.d(t,{Sj:()=>a})},46892:(e,t,n)=>{n.d(t,{PL:()=>a,sb:()=>i});let r={idle:"bg-muted-foreground",ready:"bg-success",spinner:"border-info",waiting:"bg-warning"},a={idle:{className:r.idle,labelKey:"status.idle",type:"dot"},ready:{className:r.ready,labelKey:"status.ready",type:"dot"},running:{className:r.spinner,labelKey:"status.running",type:"spinner"},waiting:{className:r.waiting,labelKey:"status.waiting",type:"dot"},generating:{className:r.spinner,labelKey:"status.generating",type:"spinner"}},i={idle:"detailStatus.idle",ready:"detailStatus.ready",running:"detailStatus.running",waiting:"detailStatus.waiting"}},51743:(e,t,n)=>{n.d(t,{Zg:()=>c,hX:()=>u,uH:()=>d});var r=n(95155),a=n(12115),i=n(46365);let s=()=>{},o=(0,a.createContext)({isOpen:!1,requestedTarget:null,screenTarget:null,openNewTask:s,closeNewTask:s,setCloseLocked:s}),l=(0,a.createContext)(s);function c(e){let{children:t}=e,[n,s]=(0,a.useState)(!1),[c,u]=(0,a.useState)(null),[d,m]=(0,a.useState)(null),p=(0,a.useRef)(!1),f=(0,a.useCallback)(e=>{(0,i.Sj)()||(u(null!=e?e:null),s(!0))},[]),h=(0,a.useCallback)(()=>{p.current||s(!1)},[]),x=(0,a.useCallback)(e=>{p.current=e},[]),b=(0,a.useCallback)(e=>{m(t=>null===t&&null===e||t&&e&&t.worktreeId===e.worktreeId&&t.instanceId===e.instanceId?t:e)},[]),g=(0,a.useMemo)(()=>({isOpen:n,requestedTarget:c,screenTarget:d,openNewTask:f,closeNewTask:h,setCloseLocked:x}),[n,c,d,f,h,x]);return(0,r.jsx)(l.Provider,{value:b,children:(0,r.jsx)(o.Provider,{value:g,children:t})})}function u(){return(0,a.useContext)(o)}function d(){return(0,a.useContext)(l)}},55756:(e,t,n)=>{n.d(t,{Bl:()=>i,cv:()=>a});let r="data-mobile-drawer-opener",a={[r]:""};function i(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,t=e.querySelector("[".concat(r,"]"));return!!t&&(t.focus(),!0)}},63470:(e,t,n)=>{n.d(t,{Y:()=>m,y2:()=>d});var r=n(95155),a=n(12115),i=n(18955),s=n(80344),o=n(36402),l=n(94442);let c=()=>{},u=(0,a.createContext)({updateInfo:null,checking:!1,hasUpdate:!1,pendingVersion:null,canSelfUpdate:!1,state:"idle",logPath:null,errorKey:null,openConfirm:c,cancel:c,confirm:async()=>{}});function d(e){var t,n;let{children:c,enabled:d=!0}=e,m=(0,i.c)("worktree"),{showToast:p}=(0,l.dj)(),[f,h]=(0,a.useState)(null),[x,b]=(0,a.useState)(!0),[g,w]=(0,a.useState)("idle"),[v,y]=(0,a.useState)(null),[k,j]=(0,a.useState)(null),N=(0,a.useRef)("idle");(0,a.useEffect)(()=>{N.current=g},[g]);let S=(0,a.useRef)(!1),E=(0,a.useRef)(async()=>{});(0,a.useEffect)(()=>{if(!d)return;let e=!1,t=async()=>{if("idle"===N.current)try{let t=await s.GQ.checkForUpdate();if(e)return;h(e=>"degraded"===t.status&&null!==e?e:t)}catch(e){}finally{e||b(!1)}};E.current=t,t();let n=setInterval(()=>{t()},36e5);return()=>{e=!0,E.current=async()=>{},clearInterval(n)}},[d]);let C=(null==f?void 0:f.hasUpdate)===!0,M=C?null:null!=(t=null==f?void 0:f.pendingVersion)?t:null;(0,a.useEffect)(()=>{if(!M)return;let e=setInterval(()=>{E.current()},3e5);return()=>clearInterval(e)},[M]);let T=(null==f?void 0:f.installType)==="global"||(null==f?void 0:f.installType)==="npx",I=(0,a.useCallback)(()=>{C&&T&&w(e=>"idle"===e?"confirming":e)},[C,T]),R=(0,a.useCallback)(()=>{w(e=>"confirming"===e?"idle":e)},[]),O=(0,a.useCallback)(async()=>{if("confirming"===N.current){N.current="starting",w("starting");try{let e=await s.GQ.startUpdate();y(e.logPath),w(e.willRestart?"updating":"no-restart")}catch(t){var e;if(t instanceof s.hD&&409===t.status&&(null==(e=t.data)?void 0:e.code)==="not_yet_published"){p(m("update.notYetPublished"),"info"),N.current="idle",w("idle"),E.current();return}t instanceof s.hD&&400===t.status?j("update.errorNotGlobal"):t instanceof s.hD&&409===t.status?j("update.errorInProgress"):j("update.errorGeneric"),w("error")}}},[p,m]);(0,a.useEffect)(()=>{if("updating"!==g)return;let e=!1,t=Date.now();S.current=!1;let n=setInterval(async()=>{if(e)return;if(Date.now()-t>3e5)return void w("timeout");let n=await s.GQ.ping();if(!e){if(!n){S.current=!0;return}S.current&&window.location.reload()}},2e3);return()=>{e=!0,clearInterval(n)}},[g]);let P=(0,a.useMemo)(()=>({updateInfo:f,checking:x,hasUpdate:C,pendingVersion:M,canSelfUpdate:T,state:g,logPath:v,errorKey:k,openConfirm:I,cancel:R,confirm:O}),[f,x,C,M,T,g,v,k,I,R,O]);return(0,r.jsxs)(u.Provider,{value:P,children:[c,(0,r.jsx)(o.TM,{isOpen:"confirming"===g,title:m("update.confirmTitle"),description:m("update.confirmDescription",{version:null!=(n=null==f?void 0:f.latestVersion)?n:""}),confirmLabel:m("update.confirmButton"),onConfirm:()=>{O()},onCancel:R})]})}function m(){return(0,a.useContext)(u)}},68704:(e,t,n)=>{n.d(t,{Uf:()=>i,d8:()=>s,fM:()=>o,of:()=>c,r5:()=>a,rq:()=>l});var r=n(2317);let a="medium",i=["large","medium","small","xsmall"],s={large:{value:"large",rootFontSizePx:18,factor:1.125,terminalFontSize:16},medium:{value:"medium",rootFontSizePx:16,factor:1,terminalFontSize:14},small:{value:"small",rootFontSizePx:14,factor:.875,terminalFontSize:12},xsmall:{value:"xsmall",rootFontSizePx:12.5,factor:.78,terminalFontSize:11}};function o(e){return"string"==typeof e&&Object.prototype.hasOwnProperty.call(s,e)}function l(e){return s[e].terminalFontSize}function c(){let{value:e,setValue:t,isAvailable:n}=(0,r.V)({key:"mcbd-pc-display-size",defaultValue:a,validate:o});return{size:e,setSize:t,isAvailable:n}}},69858:(e,t,n)=>{n.d(t,{yP:()=>y,Fy:()=>m,R8:()=>x,Xd:()=>b});var r=n(95155),a=n(12115),i=n(47650),s=n(18955),o=n(5917),l=n(38606),c=n(76471),u=n(86815),d=n(39970);let m=(0,a.createContext)(!0);function p(e){let{worktreeStatus:t}=e,n=(0,s.c)("worktree");return(0,a.useContext)(m)&&t?(0,r.jsxs)("span",{"data-testid":"branch-worktree-status","data-status":t,className:"flex-shrink-0 inline-flex items-center",title:n((0,d.Zh)(t)),children:[(0,r.jsx)("span",{"data-testid":"branch-worktree-status-dot","aria-hidden":"true",className:"h-1.5 w-1.5 rounded-full @min-[17rem]:hidden ".concat(d.mq[t])}),(0,r.jsx)("span",{"data-testid":"branch-worktree-status-label",className:"sr-only @min-[17rem]:not-sr-only @min-[17rem]:max-w-[5.5rem] @min-[17rem]:truncate\n @min-[17rem]:rounded-full @min-[17rem]:px-1.5 @min-[17rem]:text-[10px] @min-[17rem]:font-medium\n @min-[17rem]:leading-4 ".concat(d.SE[t]),children:n((0,d.Zh)(t))})]}):null}var f=n(94442),h=n(66966);let x="px-2";function b(e){return"rounded-[10px] transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring ".concat(e?"bg-sidebar-border":"hover:bg-sidebar-hover")}function g(e,t,n){let r=n-8-t;return r<=8?8:Math.min(Math.max(e,8),r)}function w(e){let{id:t,branch:n,isVisible:s,anchorRef:o,nextActionLabel:c,unclassified:u,awaitingInstructionLabel:d}=e,[m,p]=(0,a.useState)({top:-9999,left:-9999}),f=(0,a.useRef)(null);if((0,a.useEffect)(()=>{var e,t,n;if(!s||!o.current)return;let r=o.current.getBoundingClientRect(),a=null==(e=f.current)?void 0:e.getBoundingClientRect(),i=null!=(t=null==a?void 0:a.width)?t:0,l=null!=(n=null==a?void 0:a.height)?n:0,c=window.innerWidth,u=window.innerHeight,d=r.right+8;if(d+i>c-8){let e=r.left-8-i;e>=8&&(d=e)}p({top:g(r.top,l,u),left:g(d,i,c)})},[s,o]),"undefined"==typeof document||!s)return null;let h=Math.min(384,Math.max(0,window.innerWidth-16));return i.createPortal((0,r.jsxs)("div",{ref:f,id:t,role:"tooltip",className:" fixed z-[9999] px-3 py-2 rounded-md shadow-lg bg-sidebar text-xs text-sidebar-foreground border border-sidebar-border pointer-events-none max-w-sm transition-opacity duration-150 ",style:{top:m.top,left:m.left,maxWidth:h},children:[(0,r.jsx)("p",{className:"font-medium text-sidebar-foreground whitespace-nowrap",children:n.name}),(0,r.jsx)("p",{className:"text-sidebar-muted whitespace-nowrap",children:n.repositoryName}),(0,r.jsxs)("p",{className:"text-sidebar-muted whitespace-nowrap",children:["Status: ",u?l.pu:n.status]}),n.worktreePath&&(0,r.jsx)("p",{className:"text-sidebar-muted truncate",children:n.worktreePath}),c&&(0,r.jsxs)("p",{className:"text-sidebar-muted whitespace-nowrap",children:["Next: ",c]}),d&&(0,r.jsx)("p",{className:"text-success-foreground whitespace-nowrap",children:d}),n.description&&(0,r.jsx)("p",{className:"text-sidebar-muted mt-1 border-t border-sidebar-border pt-1 whitespace-pre-wrap break-words",children:n.description})]}),document.body)}let v=0,y=(0,a.memo)(function(e){let{branch:t,isSelected:n,onClick:i,showRepositoryName:m=!0}=e,g=(0,s.c)("common"),y=(0,s.c)("worktree"),k="tooltip-".concat(t.id),j=(0,a.useRef)(null),[N,S]=(0,a.useState)(!1),E=(0,a.useRef)(null),C=(0,a.useCallback)(()=>{null!==E.current&&(clearTimeout(E.current),E.current=null)},[]);(0,a.useEffect)(()=>()=>C(),[C]);let M=(0,l.A7)(t.cliStatus),T="waiting"===M,I=!0===t.awaitingInstruction,R=t.nextActionKey?y(t.nextActionKey):null,O=(0,a.useMemo)(()=>{var e;return new Set(null!=(e=t.exitedInstanceIds)?e:[])},[t.exitedInstanceIds]),P=(0,a.useMemo)(()=>{var e;return new Set(null!=(e=t.unclassifiedInstanceIds)?e:[])},[t.unclassifiedInstanceIds]),D=(0,l.Pn)(t.cliStatus,t.unclassifiedInstanceIds),L=(T||I)&&null!==R,_=null!==R&&(L||n),A=N&&!n,[B,z]=(0,a.useState)(!1),[K,W]=(0,a.useState)(!1),[V,F]=(0,a.useState)(!1),H=n||B||K||V,{worktreeStatus:G,handleWorktreeStatusChange:q}=function(e,t,n){var r;let{showToast:i}=(0,f.dj)(),s=null==(r=(0,h.rC)())?void 0:r.refresh,[o,l]=(0,a.useState)(void 0),c=(0,a.useRef)(0),u=(0,a.useRef)(0),m=(0,a.useRef)(null),p=(0,a.useRef)(null),x=(0,a.useRef)(null),b=null!=t?t:null,g=void 0!==o?o:b;return p.current=b,(0,a.useEffect)(()=>{if(c.current!==u.current)return;let e=x.current;(null===e||(0,d.FI)(e))&&(x.current=null,l(void 0))},[b]),{worktreeStatus:g,handleWorktreeStatusChange:(0,a.useCallback)(async t=>{let r=++c.current;m.current=p.current,x.current=null,l(t);try{await (0,d.V9)(e,t)}catch(e){if(r!==c.current)return;u.current=r,l(void 0),i(n("branchItem.statusChangeFailed"),"error");return}let a=(0,d.Xg)();try{await (null==s?void 0:s())}finally{r===c.current&&(u.current=r,s?(x.current=a,(0,d.FI)(a)&&p.current!==m.current&&(x.current=null,l(void 0))):p.current!==m.current&&l(void 0))}},[e,s,i,n])}}(t.id,t.worktreeStatus,g);return(0,a.useEffect)(()=>{n&&S(!1)},[n]),(0,a.useEffect)(()=>{if(!N)return;let e=()=>S(!1);return document.addEventListener("click",e),()=>document.removeEventListener("click",e)},[N]),(0,r.jsxs)("div",{"data-testid":"branch-list-row",className:"relative w-full min-w-0 ".concat(x),onPointerEnter:()=>z(!0),onPointerLeave:()=>z(!1),onFocus:e=>{e.target.matches(":focus-visible")&&W(!0)},onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||W(!1)},children:[(0,r.jsxs)("button",{ref:j,"data-testid":"branch-list-item",onClick:()=>{C(),v=Date.now()+400,S(!1),i()},onMouseEnter:()=>{C(),Date.now()>=v&&(E.current=setTimeout(()=>{S(!0)},150))},onMouseLeave:()=>{C(),S(!1)},onFocus:e=>{C(),e.target.matches(":focus-visible")&&(E.current=setTimeout(()=>{S(!0)},150))},onBlur:()=>{C(),S(!1)},"aria-current":n?"true":void 0,"aria-describedby":A?k:void 0,"aria-label":m?void 0:"".concat(t.name," - ").concat(t.repositoryName),className:"\n group relative w-full min-h-[34px] pl-3 py-1.5 flex flex-col justify-center gap-0.5\n ".concat(H?n?"pr-9":"pr-9 [@media(hover:none)]:pr-3":"pr-3","\n ").concat(b(n),"\n "),children:[(0,r.jsxs)("div",{className:"@container flex items-center gap-2 w-full min-w-0",children:[t.cliStatus&&Object.keys(t.cliStatus).length>0&&(0,r.jsx)("div",{className:"flex items-center justify-center flex-shrink-0 w-4","aria-label":g("branchItem.cliToolStatus"),children:(0,r.jsx)(c.Ej,{status:M,label:(0,l.dw)(t.cliStatus,t.cliStatusLabels,O.size>0?e=>O.has(e)?g("branchItem.agentExited"):null:void 0,P),waitingKind:t.waitingKind,unclassified:D})}),(0,r.jsx)("p",{className:"flex-1 min-w-0 text-left text-sm text-sidebar-foreground truncate",children:t.name}),m&&(0,r.jsx)("p",{className:"flex-shrink min-w-0 max-w-[40%] text-xs text-sidebar-muted truncate",children:t.repositoryName}),(0,r.jsx)(p,{worktreeStatus:G}),I&&(0,r.jsxs)("span",{"data-testid":"awaiting-instruction-badge",className:"flex-shrink-0 inline-flex h-4 w-4 items-center justify-center rounded-full bg-success-subtle text-success-foreground",title:y("awaitingInstruction.label"),children:[(0,r.jsx)(o.A,{className:"h-3 w-3",strokeWidth:3,"aria-hidden":"true"}),(0,r.jsx)("span",{className:"sr-only",children:y("awaitingInstruction.badge")})]}),t.hasUnread&&(0,r.jsx)("span",{"data-testid":"unread-indicator",className:"w-2 h-2 rounded-full bg-accent-500 flex-shrink-0","aria-label":g("branchItem.hasUnread")})]}),_&&(0,r.jsx)("p",{"data-testid":"branch-next-action",className:"pl-6 text-left text-xs font-medium truncate ".concat(n?"block":"hidden [@media(hover:none)]:block"," ").concat(T?"text-warning-foreground":I?"text-success-foreground":"text-sidebar-muted"),children:R}),n&&t.description&&(0,r.jsx)("p",{"data-testid":"branch-description",className:"pl-6 text-left text-xs text-sidebar-muted truncate",children:t.description}),(0,r.jsx)(w,{id:k,branch:t,isVisible:A,anchorRef:j,nextActionLabel:R,unclassified:D,awaitingInstructionLabel:I?y("awaitingInstruction.badge"):null})]}),H&&(0,r.jsx)(u.m,{branch:t,isSelected:n,onOpenChange:F,worktreeStatus:G,onWorktreeStatusChange:q})]})})},70628:(e,t,n)=>{n.d(t,{K:()=>o,S:()=>s});var r=n(95155),a=n(12115);let i=(0,a.createContext)({open:!1,setOpen:()=>{},toggle:()=>{}});function s(e){let{children:t}=e,[n,s]=(0,a.useState)(!1),o=(0,a.useCallback)(()=>s(e=>!e),[]),l=(0,a.useMemo)(()=>({open:n,setOpen:s,toggle:o}),[n,o]);return(0,r.jsx)(i.Provider,{value:l,children:t})}function o(){return(0,a.useContext)(i)}},72137:(e,t,n)=>{n.d(t,{H:()=>m});var r=n(95155),a=n(12115),i=n(18955),s=n(68695),o=n(31166),l=n(94465),c=n(79361),u=n(63470),d=n(38218);function m(){var e,t;let n=(0,i.c)("worktree"),m=(0,d.a)(),{updateInfo:p,hasUpdate:f,pendingVersion:h,canSelfUpdate:x,state:b,openConfirm:g}=(0,u.Y)(),[w,v]=(0,a.useState)(!1),y=null!=(e=null==p?void 0:p.latestVersion)?e:null;if(m||!y)return null;if("idle"===b&&!f&&h){let e=n("update.pendingDescription",{version:h});return(0,r.jsxs)(o.$,{type:"button",variant:"secondary",size:"sm",disabled:!0,className:"flex-shrink-0 gap-1.5 whitespace-nowrap",title:e,"aria-label":e,"data-testid":"app-update-button","data-state":"pending",children:[(0,r.jsx)(s.A,{size:16,"aria-hidden":"true"}),(0,r.jsx)("span",{children:n("update.pendingLabel",{version:h})})]})}if("idle"===b&&!f)return null;let k="starting"===b||"updating"===b,j="no-restart"===b||"timeout"===b||"error"===b,N=n("update.buttonLabel",{version:y});return x||k||j?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(o.$,{type:"button",variant:"primary",size:"sm",loading:k,onClick:j?()=>v(!0):g,className:"flex-shrink-0 gap-1.5 whitespace-nowrap","aria-label":k?n("update.buttonUpdating"):n("update.buttonAriaLabel",{version:y}),"aria-haspopup":"dialog","aria-busy":k,"data-testid":"app-update-button","data-state":b,children:[!k&&(0,r.jsx)(s.A,{size:16,"aria-hidden":"true"}),(0,r.jsx)("span",{children:k?n("update.buttonUpdating"):N})]}),j&&(0,r.jsx)(l.a,{isOpen:w,onClose:()=>v(!1),title:n("update.statusDialogTitle"),size:"sm",children:(0,r.jsx)(c.V,{})})]}):(0,r.jsxs)("a",{href:null!=(t=null==p?void 0:p.releaseUrl)?t:"https://github.com/Kewton/CommandMate/releases/latest",target:"_blank",rel:"noopener noreferrer",className:"inline-flex flex-shrink-0 items-center justify-center gap-1.5 whitespace-nowrap rounded-md px-3 py-1.5 text-sm font-medium bg-accent-600 dark:bg-accent-500 text-white hover:bg-accent-700 dark:hover:bg-accent-600 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","aria-label":n("update.buttonReleaseAriaLabel",{version:y}),"data-testid":"app-update-button",children:[(0,r.jsx)(s.A,{size:16,"aria-hidden":"true"}),(0,r.jsx)("span",{children:N})]})}},79361:(e,t,n)=>{n.d(t,{V:()=>l});var r=n(95155),a=n(18955),i=n(63470),s=n(31166),o=n(3005);function l(){let e=(0,a.c)("worktree"),{updateInfo:t,hasUpdate:n,canSelfUpdate:l,state:c,logPath:u,errorKey:d,openConfirm:m}=(0,i.Y)();if(!t||!n&&"idle"===c)return null;let{latestVersion:p,releaseUrl:f,updateCommand:h,installType:x}=t,b="npx"===x,g=b?"npx commandmate@latest":"commandmate update";return(0,r.jsxs)("div",{className:"bg-accent-50 border border-accent-200 rounded-lg p-3 mt-2",role:"status","aria-label":e("update.available"),"data-testid":"update-notification-banner",children:[(0,r.jsx)("p",{className:"text-sm font-medium text-accent-800 mb-1",children:e("update.available")}),p&&(0,r.jsx)("p",{className:"text-sm text-accent-700 mb-2",children:e("update.latestVersion",{version:p})}),l&&"idle"===c&&(0,r.jsx)(s.$,{variant:"primary",size:"sm",className:"mb-2",onClick:m,"data-testid":"update-now-button",children:e("update.updateNow")}),b&&"idle"===c&&(0,r.jsx)("p",{className:"text-xs text-accent-600 mb-2","data-testid":"update-npx-notice",children:e("update.npxRestartNotice")}),("starting"===c||"updating"===c)&&(0,r.jsxs)("div",{className:"mb-2","data-testid":"update-progress",children:[(0,r.jsxs)("p",{className:"flex items-center text-sm text-accent-800",children:[(0,r.jsx)(o.y,{size:"sm",className:"mr-2"}),e("starting"===c?"update.starting":"update.updating")]}),"updating"===c&&(0,r.jsx)("p",{className:"text-xs text-accent-600 mt-1",children:e("update.updatingHint")})]}),"no-restart"===c&&(0,r.jsxs)("div",{className:"mb-2","data-testid":"update-no-restart",children:[(0,r.jsx)("p",{className:"text-sm font-medium text-accent-800",children:e("update.noRestartTitle")}),(0,r.jsx)("p",{className:"text-xs text-accent-600 mt-1",children:e("update.noRestartDescription")})]}),"timeout"===c&&(0,r.jsxs)("div",{className:"mb-2","data-testid":"update-timeout",children:[(0,r.jsx)("p",{className:"text-sm font-medium text-accent-800",children:e("update.timeoutTitle")}),(0,r.jsx)("p",{className:"text-xs text-accent-600 mt-1",children:e("update.timeoutDescription")}),(0,r.jsx)("code",{className:"block bg-accent-100 rounded px-2 py-1 mt-1 text-xs text-accent-900 font-mono",children:g})]}),"error"===c&&(0,r.jsxs)("div",{className:"mb-2","data-testid":"update-error",children:[(0,r.jsx)("p",{className:"text-sm font-medium text-accent-800",children:e("update.errorTitle")}),(0,r.jsx)("p",{className:"text-xs text-accent-600 mt-1",children:d?e(d):null}),(0,r.jsx)("code",{className:"block bg-accent-100 rounded px-2 py-1 mt-1 text-xs text-accent-900 font-mono",children:g})]}),u&&("no-restart"===c||"timeout"===c)&&(0,r.jsx)("p",{className:"text-xs text-accent-500 mb-2","data-testid":"update-log-hint",children:e("update.logHint",{path:u})}),h&&"global"===x&&"idle"===c&&(0,r.jsxs)("div",{className:"mb-2",children:[(0,r.jsx)("p",{className:"text-xs text-accent-600 mb-1",children:e("update.updateCommand")}),(0,r.jsx)("code",{className:"block bg-accent-100 rounded px-2 py-1 text-xs text-accent-900 font-mono",children:h})]}),f&&(0,r.jsxs)("a",{href:f,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center text-sm text-accent-600 hover:text-accent-800 underline",children:[e("update.viewRelease"),(0,r.jsx)("span",{className:"ml-1","aria-hidden":"true",children:"→"})]}),(0,r.jsx)("p",{className:"text-xs text-accent-500 mt-2",children:e("update.dataPreserved")})]})}},86815:(e,t,n)=>{n.d(t,{K:()=>f,m:()=>h});var r=n(95155),a=n(12115),i=n(18955),s=n(37772),o=n(27937),l=n(47971),c=n(26232),u=n(94442),d=n(60322),m=n(59854),p=n(39970);let f="data-branch-row-actions",h=(0,a.memo)(function(e){let{branch:t,isSelected:n,onOpenChange:h,worktreeStatus:x=null,onWorktreeStatusChange:b}=e,g=(0,i.c)("common"),w=(0,i.c)("worktree"),{showToast:v}=(0,u.dj)(),y=(0,a.useCallback)(async e=>{try{await (0,d.l)(e),v(g("branchItem.copied"),"success")}catch(e){v(g("branchItem.copyFailed"),"error")}},[v,g]);return(0,r.jsxs)(c.rI,{onOpenChange:h,children:[(0,r.jsx)(c.ty,{asChild:!0,children:(0,r.jsx)("button",{type:"button","data-testid":"branch-row-actions","aria-label":g("branchItem.actions",{name:t.name}),title:g("branchItem.actions",{name:t.name}),className:"absolute right-3 top-[5px] flex h-6 w-6 items-center justify-center rounded-md\n text-sidebar-muted transition-colors hover:bg-sidebar-hover hover:text-sidebar-foreground\n focus:outline-none focus-visible:ring-2 focus-visible:ring-ring\n data-[state=open]:text-sidebar-foreground ".concat(n?"":"[@media(hover:none)]:hidden"),children:(0,r.jsx)(s.A,{className:"h-4 w-4","aria-hidden":"true"})})}),(0,r.jsxs)(c.SQ,{align:"end",[f]:"",onEscapeKeyDown:e=>e.stopPropagation(),children:[(0,r.jsx)(c._2,{asChild:!0,children:(0,r.jsx)("a",{href:"/worktrees/".concat(t.id),target:"_blank",rel:"noopener noreferrer",children:g("branchItem.openInNewTab")})}),(0,r.jsx)(c._2,{onSelect:()=>void y(t.name),children:g("branchItem.copyBranchName")}),t.worktreePath&&(0,r.jsx)(c._2,{onSelect:()=>{var e;y(null!=(e=t.worktreePath)?e:"")},children:g("branchItem.copyPath")}),b&&(0,r.jsxs)(l.Pb,{children:[(0,r.jsxs)(l.ZP,{"data-testid":"branch-row-status",className:"relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-muted data-[state=open]:bg-muted",children:[(0,r.jsx)("span",{className:"flex-1",children:g("branchItem.status")}),(0,r.jsx)("span",{"data-testid":"branch-row-status-current",className:"text-xs text-muted-foreground",children:w((0,p.Zh)(x))}),(0,r.jsx)(o.A,{className:"h-3.5 w-3.5 text-muted-foreground","aria-hidden":"true"})]}),(0,r.jsx)(l.ZL,{children:(0,r.jsx)(l.G5,{[f]:"",sideOffset:4,collisionPadding:8,style:{zIndex:m.M.POPOVER},className:"min-w-[9rem] overflow-hidden rounded-md border border-border bg-surface p-1 text-surface-foreground shadow-lg",onEscapeKeyDown:e=>e.stopPropagation(),children:(0,r.jsx)(c.Hr,{value:null!=x?x:"",onValueChange:e=>{let t=""===e?null:e;t!==x&&b(t)},children:p.m9.map(e=>{var t;return(0,r.jsx)(c.Ht,{value:null!=(t=e.value)?t:"",children:w(e.labelKey)},e.labelKey)})})})})]})]})]})})},89275:(e,t,n)=>{n.d(t,{Bo:()=>u,Hq:()=>l});var r=n(95155),a=n(12115),i=n(20063);let s={startTransition:e=>e()},o=(0,a.createContext)(null);function l(){var e;let t=(0,i.useRouter)(),{startTransition:n}=null!=(e=(0,a.useContext)(o))?e:s;return(0,a.useMemo)(()=>({push:e=>n(()=>t.push(e)),replace:e=>n(()=>t.replace(e))}),[t,n])}function c(e){let{onCommit:t}=e,n=(0,i.usePathname)(),r=(0,a.useRef)(!1);return(0,a.useEffect)(()=>{if(!r.current){r.current=!0;return}t()},[n,t]),null}function u(e){let{children:t}=e,n=(0,a.useRef)(null),i=(0,a.useCallback)(()=>{var e;null==(e=n.current)||e.call(n)},[]),s=(0,a.useCallback)(e=>{var t;t=()=>new Promise(t=>{let r=!1,a=()=>{r||(r=!0,t())};n.current=a,e(),window.setTimeout(a,500)}),"undefined"==typeof document||"function"!=typeof document.startViewTransition||"function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches?t():document.startViewTransition(t)},[]),l=(0,a.useMemo)(()=>({startTransition:s}),[s]);return(0,r.jsxs)(o.Provider,{value:l,children:[(0,r.jsx)(c,{onCommit:i}),t]})}},92614:(e,t,n)=>{n.d(t,{C:()=>o,E:()=>s});var r=n(95155),a=n(12115);let i=(0,a.createContext)({open:!1,setOpen:()=>{},toggle:()=>{}});function s(e){let{children:t}=e,[n,s]=(0,a.useState)(!1),o=(0,a.useCallback)(()=>s(e=>!e),[]),l=(0,a.useMemo)(()=>({open:n,setOpen:s,toggle:o}),[n,o]);return(0,r.jsx)(i.Provider,{value:l,children:t})}function o(){return(0,a.useContext)(i)}},98873:(e,t,n)=>{n.d(t,{D:()=>i});var r=n(12115),a=n(7636);function i(e){let{items:t,sortKey:n,sortDirection:i,viewMode:s,filterText:o}=e,l=(0,r.useMemo)(()=>{if(!o)return t;let e=o.toLowerCase();return t.filter(t=>t.name.toLowerCase().includes(e)||t.repositoryName.toLowerCase().includes(e))},[t,o]);return{sortedItems:(0,r.useMemo)(()=>(0,a.Xn)(l,n,i),[l,n,i]),groupedItems:(0,r.useMemo)(()=>"grouped"===s?(0,a._s)(l,n,i):[],[l,n,i,s])}}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6654],{39649:(e,t,r)=>{r.d(t,{$f:()=>f,H8:()=>d});var n=r(95155),s=r(12115),i=r(80344),l=r(39970);let o={PROCESSING:2e3,SESSION_RUNNING:5e3,IDLE:1e4},a=(0,s.createContext)(null),u={selectedWorktreeId:null,worktrees:[],repositories:[],selectedWorktreeDetail:null,isLoading:!0,isLoadingDetail:!1,error:null};function c(e,t){switch(t.type){case"SET_WORKTREES":return{...e,worktrees:t.worktrees,isLoading:!1};case"SET_REPOSITORIES":return{...e,repositories:t.repositories};case"SELECT_WORKTREE":{var r;let n=null!=(r=e.worktrees.find(e=>e.id===t.id))?r:null;return{...e,selectedWorktreeId:t.id,selectedWorktreeDetail:null!=n?n:e.selectedWorktreeDetail,isLoadingDetail:null===n}}case"SET_WORKTREE_DETAIL":return{...e,selectedWorktreeDetail:t.detail};case"SET_LOADING":return{...e,isLoading:t.isLoading};case"SET_LOADING_DETAIL":return{...e,isLoadingDetail:t.isLoadingDetail};case"SET_ERROR":return{...e,error:t.error,isLoading:!1};default:return e}}function d(e){let{children:t,externalWorktrees:r,externalRepositories:d,externalIsLoading:f,externalError:g,externalRefresh:E}=e,S=void 0!==r,[y,w]=(0,s.useReducer)(c,u);(0,s.useEffect)(()=>{S&&r&&w({type:"SET_WORKTREES",worktrees:r})},[S,r]),(0,s.useEffect)(()=>{S&&d&&w({type:"SET_REPOSITORIES",repositories:d})},[S,d]);let R=(0,s.useCallback)(async()=>{if(!S){w({type:"SET_LOADING",isLoading:!0}),w({type:"SET_ERROR",error:null});try{var e;let t=(0,l.Xg)(),r=await i.y.getAll();w({type:"SET_WORKTREES",worktrees:(0,l.Th)(r.worktrees,t)}),w({type:"SET_REPOSITORIES",repositories:null!=(e=r.repositories)?e:[]})}catch(e){w({type:"SET_ERROR",error:e instanceof Error?e.message:"Failed to fetch worktrees"})}}},[S]),k=(0,s.useCallback)(async e=>{w({type:"SELECT_WORKTREE",id:e}),w({type:"SET_ERROR",error:null});try{i.y.markAsViewed(e).catch(e=>{console.warn("[WorktreeSelectionContext] Failed to mark as viewed:",e)});let t=(0,l.Xg)(),r=await i.y.getById(e);w({type:"SET_WORKTREE_DETAIL",detail:(0,l.Dj)(r,t)})}catch(e){w({type:"SET_ERROR",error:e instanceof Error?e.message:"Failed to fetch worktree detail"})}finally{w({type:"SET_LOADING_DETAIL",isLoadingDetail:!1})}},[]),p=(0,s.useCallback)(async()=>{if(S&&E)return void await E();await R()},[S,E,R]);(0,s.useEffect)(()=>{S||R()},[R,S]),(0,s.useEffect)(()=>{if(S)return;let e=null,t=!0,r=async()=>{if(t)try{var n,s;let a=(0,l.Xg)(),u=await i.y.getAll();w({type:"SET_WORKTREES",worktrees:(0,l.Th)(u.worktrees,a)}),w({type:"SET_REPOSITORIES",repositories:null!=(n=u.repositories)?n:[]});let c=(s=u.worktrees).some(e=>e.isProcessing||e.isWaitingForResponse)?o.PROCESSING:s.some(e=>e.isSessionRunning)?o.SESSION_RUNNING:o.IDLE;t&&(e=setTimeout(r,c))}catch(n){if(n instanceof i.hD&&401===n.status)return;console.error("[WorktreeSelectionContext] Polling error:",n),t&&(e=setTimeout(r,o.SESSION_RUNNING))}};return r(),()=>{t=!1,e&&clearTimeout(e)}},[S]);let h=S&&void 0!==f?f:y.isLoading,v=S&&g?g.message:null,T={selectedWorktreeId:y.selectedWorktreeId,worktrees:y.worktrees,repositories:y.repositories,selectedWorktreeDetail:y.selectedWorktreeDetail,isLoading:h,isLoadingDetail:y.isLoadingDetail,error:null!=v?v:y.error,selectWorktree:k,refreshWorktrees:p};return(0,n.jsx)(a.Provider,{value:T,children:t})}function f(){let e=(0,s.useContext)(a);if(!e)throw Error("useWorktreeSelection must be used within a WorktreeSelectionProvider");return e}},39970:(e,t,r)=>{r.d(t,{Dj:()=>E,FI:()=>k,LP:()=>f,PX:()=>g,SE:()=>i,Th:()=>S,V9:()=>y,WZ:()=>R,Xg:()=>d,Zh:()=>s,m9:()=>n,mq:()=>l});let n=[{value:null,labelKey:"worktreeStatus.notSet"},{value:"ready",labelKey:"worktreeStatus.ready"},{value:"in_progress",labelKey:"worktreeStatus.inProgress"},{value:"in_review",labelKey:"worktreeStatus.inReview"},{value:"done",labelKey:"worktreeStatus.done"}];function s(e){var t,r;return null!=(r=null==(t=n.find(t=>t.value===(null!=e?e:null)))?void 0:t.labelKey)?r:"worktreeStatus.notSet"}let i={ready:"bg-muted text-muted-foreground",in_progress:"bg-accent-100 dark:bg-accent-900/30 text-accent-700 dark:text-accent-400",in_review:"bg-info-subtle text-info-foreground",done:"bg-success-subtle text-success-foreground"},l={ready:"bg-muted-foreground",in_progress:"bg-accent-500",in_review:"bg-info",done:"bg-success"};async function o(e,t){let r=await fetch("/api/worktrees/".concat(encodeURIComponent(e)),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({status:t})});if(!r.ok)throw Error("Failed to update worktree status: HTTP ".concat(r.status));return await r.json()}let a=0,u=new Map,c=new Map;function d(){return a}function f(){return a+=1}function g(e,t,r,n){let s=u.get(e),i=r,l=t;return s&&s.generation>i&&(i=s.generation,l=s.status),n&&void 0!==n.status&&n.at>i&&(l=n.status),l}function E(e,t){let r=function(e,t,r){let n=u.get(e);return n&&n.generation>r?n.status:t}(e.id,e.status,t);return r===e.status?e:{...e,status:r}}function S(e,t){let r=!1,n=e.map(e=>{let n=E(e,t);return n!==e&&(r=!0),n});return r?n:e}function y(e,t){var r;let n=(null!=(r=c.get(e))?r:Promise.resolve()).catch(()=>void 0).then(()=>o(e,t)).then(r=>(a+=1,u.set(e,{generation:a,status:t}),r)),s=n.catch(()=>void 0);return c.set(e,s),s.then(()=>{c.get(e)===s&&c.delete(e)}),n}let w=-1;function R(e){e>w&&(w=e)}function k(e){return w>=e}},55449:(e,t,r)=>{r.d(t,{IK:()=>a,qD:()=>d,sA:()=>o,zk:()=>s});var n=r(63001);let s="/api/settings/default-agents",i=n.fJ,l=new Set;function o(){return i}function a(e){if(!Array.isArray(e))return!1;let t=(0,n.Lt)(e);if(!t.valid)return!1;let r=t.value;if(r.length===i.length&&r.every((e,t)=>e===i[t]))return!1;for(let e of(i=r,l))e();return!0}let u=null,c=!1;async function d(){return c?i:u||("function"!=typeof fetch?i:u=(async()=>{try{let e=await fetch(s);if(e.ok){let t=await e.json();a(null==t?void 0:t.defaultSelectedAgents),c=!0}}catch(e){}finally{u=null}return i})())}},63001:(e,t,r)=>{r.d(t,{Lt:()=>o,Wj:()=>i,eu:()=>s,fJ:()=>l});var n=r(54014);let s=2,i=6,l=["claude","codex","antigravity"];function o(e){return e.length<s||e.length>i?{valid:!1,error:"Must be ".concat(s,"-").concat(i," elements")}:e.every(e=>"string"==typeof e&&n.XH.includes(e))?new Set(e).size!==e.length?{valid:!1,error:"Duplicate tool IDs not allowed"}:{valid:!0,value:e}:{valid:!1,error:"Invalid CLI tool ID"}}},66966:(e,t,r)=>{r.d(t,{g7:()=>d,rC:()=>g,Fn:()=>f});var n=r(95155),s=r(12115),i=r(80344),l=r(60199),o=r(39970);let a=[2e3,5e3,1e4];var u=r(39649);let c=(0,s.createContext)(null);function d(e){let{children:t,enabled:r=!0}=e,{worktrees:d,repositories:f,isLoading:g,error:E,refresh:S}=function(){let{enabled:e=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},[t,r]=(0,s.useState)([]),[n,u]=(0,s.useState)([]),[c,d]=(0,s.useState)(!0),[f,g]=(0,s.useState)(null),E=(0,s.useRef)(null),S=(0,s.useRef)([]),y=(0,s.useRef)(null),w=(0,s.useRef)(0),R=(0,s.useRef)(null),k=(0,s.useRef)(!1),p=(0,s.useRef)(async()=>{}),h=(0,s.useCallback)(()=>{null!==R.current&&(clearTimeout(R.current),R.current=null)},[]),{connected:v,subscribe:T,unsubscribe:I,addListener:_}=(0,l.xM)(),m=(0,s.useRef)(v);m.current=v;let b=(0,s.useCallback)(async()=>{try{var e,t;g(null),k.current&&0===S.current.length&&d(!0);let n=(0,o.Xg)(),l=await fetch("/api/worktrees"),a=(0,i.O0)(l);if(a)throw a;if(!l.ok)throw Error("Failed to fetch worktrees: ".concat(l.status));let c=(0,i.xd)(l);if(c)throw c;let f=await l.json(),E=(0,o.Th)(null!=(e=f.worktrees)?e:[],n),y=null!=(t=f.repositories)?t:[];(0,s.startTransition)(()=>{r(E),u(y),d(!1)}),S.current=E,(0,o.WZ)(n),k.current=!1,w.current=0,h()}catch(r){let e=r instanceof Error?r:Error(String(r));console.error("[useWorktreesCache] Failed to fetch worktrees:",e),k.current=!0,g(e),d(!1);let t=w.current;0===S.current.length&&t<a.length&&(w.current=t+1,h(),R.current=setTimeout(()=>{R.current=null,p.current()},a[t]))}},[h]);p.current=b,(0,s.useEffect)(()=>{e&&b()},[e,b]),(0,s.useEffect)(()=>h,[h]);let W=(0,s.useCallback)(()=>S.current.some(e=>!0===e.isSessionRunning),[]),L=(0,s.useCallback)(()=>{let e=W();return m.current?e?2e4:6e4:e?5e3:3e4},[W]),O=(0,s.useCallback)(()=>{null!==E.current&&(clearInterval(E.current),E.current=null),y.current=null},[]),C=(0,s.useCallback)(()=>{O();let e=L();y.current=e,E.current=setInterval(()=>{b()},e)},[L,b,O]);(0,s.useEffect)(()=>{if(!e)return;let t=()=>{document.hidden?O():(b(),C())},r=setTimeout(()=>{C()},0);return document.addEventListener("visibilitychange",t),()=>{clearTimeout(r),O(),document.removeEventListener("visibilitychange",t)}},[e,b,C,O]),(0,s.useEffect)(()=>{if(S.current=t,"undefined"!=typeof document&&document.hidden||null===y.current)return;let e=L();y.current!==e&&C()},[t,v,L,C]);let D=t.map(e=>e.id).sort().join(" ");return(0,s.useEffect)(()=>{let e=D.length>0?D.split(" "):[];return e.forEach(e=>T(e)),()=>{e.forEach(e=>I(e))}},[D,T,I]),(0,s.useEffect)(()=>_(e=>{if("session_status_changed"===e.type&&"string"==typeof e.worktreeId){let i=e.worktreeId,l=e.isWaitingForResponse;if("boolean"==typeof l){var t,n;let o=null!=(t=e.instance)?t:null,a=null!=(n=e.waitingKind)?n:null;(0,s.startTransition)(()=>{r(e=>{let t=!1,r=e.map(e=>{if(e.id!==i)return e;let r=function(e,t){var r,n,s;let i,l=null!=(n=t.instance)?n:null,o=l?null==(r=e.sessionStatusByInstance)?void 0:r[l]:void 0,a=e.sessionStatusByInstance;if(l&&o&&o.isWaitingForResponse!==t.waiting&&(a={...e.sessionStatusByInstance,[l]:{...o,isWaitingForResponse:t.waiting,waitingKind:null!=(s=t.waitingKind)?s:null}}),t.waiting)i=!0;else{let e=a?Object.values(a):[];i=e.length>0&&e.some(e=>(null==e?void 0:e.isWaitingForResponse)===!0)}return a===e.sessionStatusByInstance&&i===e.isWaitingForResponse?e:{...e,sessionStatusByInstance:a,isWaitingForResponse:i}}(e,{waiting:l,instance:o,waitingKind:a});return r!==e&&(t=!0),r});return t?r:e})});return}let o=e.isRunning;if("boolean"==typeof o){if((null!=e.cliTool||null!=e.instance)&&!1===o)return void b();(0,s.startTransition)(()=>{r(e=>{let t=!1,r=e.map(e=>e.id===i&&e.isSessionRunning!==o?(t=!0,{...e,isSessionRunning:o}):e);return t?r:e})})}}else("message"===e.type||"message_updated"===e.type)&&b()}),[_,b]),{worktrees:t,repositories:n,isLoading:c,error:f,refresh:b}}({enabled:r}),y=(0,s.useMemo)(()=>({worktrees:d,repositories:f,isLoading:g,error:E,refresh:S}),[d,f,g,E,S]);return(0,n.jsx)(c.Provider,{value:y,children:(0,n.jsx)(u.H8,{externalWorktrees:d,externalRepositories:f,externalIsLoading:g,externalError:E,externalRefresh:S,children:t})})}function f(){let e=(0,s.useContext)(c);if(null===e)throw Error("useWorktreesCacheContext must be used within a WorktreesCacheProvider");return e}function g(){return(0,s.useContext)(c)}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7665],{14524:(e,t,r)=>{r.d(t,{Rb:()=>n,wn:()=>o,yv:()=>a});let a=["recommended","careful"],n="recommended";function o(e){return"recommended"===e||"careful"===e}},34325:(e,t,r)=>{r.d(t,{$s:()=>l,_q:()=>o,t6:()=>s,CN:()=>c,nG:()=>i,$B:()=>f,dR:()=>d,S9:()=>u,P0:()=>m});var a=r(82912),n=r.n(a);r(95704);let o=[36e5,72e5,108e5,144e5,18e6,216e5,252e5,288e5,324e5,36e6,396e5,432e5,468e5,504e5,54e6,576e5,612e5,648e5,684e5,72e6,756e5,792e5,828e5,864e5],c=[36e5,108e5,288e5],s=36e5;function d(e){return"number"==typeof e&&o.includes(e)}function i(e){return e/36e5}let l=1e3;function u(e){return(null==e?void 0:e.enabled)!==!0&&(null==e?void 0:e.stopReason)==="server-restart"}function m(e){if(e.length>500)return{valid:!1,error:"Pattern must be ".concat(500," characters or less")};if(!n()(e))return{valid:!1,error:"Pattern may cause performance issues (catastrophic backtracking detected)"};try{return new RegExp(e),{valid:!0}}catch(e){return{valid:!1,error:"Invalid regular expression syntax"}}}function f(e){let t=Math.max(0,e-Date.now()),r=Math.floor(t/36e5),a=Math.floor(t%36e5/6e4),n=Math.floor(t%6e4/1e3);return r>0?"".concat(r,":").concat(a.toString().padStart(2,"0"),":").concat(n.toString().padStart(2,"0")):"".concat(a.toString().padStart(2,"0"),":").concat(n.toString().padStart(2,"0"))}},38218:(e,t,r)=>{r.d(t,{D:()=>o,a:()=>c});var a=r(12115);let n=a.useLayoutEffect,o=768;function c(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{breakpoint:t=o}=e,[r,c]=(0,a.useState)(!1);return n(()=>{let e=window.matchMedia("(max-width: ".concat(t-1,"px)"));c(e.matches);let r=e=>{c(e.matches)};return e.addEventListener("change",r),()=>{e.removeEventListener("change",r)}},[t]),r}},76471:(e,t,r)=>{r.d(t,{Ej:()=>l,Jd:()=>s,Mq:()=>i,rH:()=>d});var a=r(95155),n=r(12115),o=r(18955),c=r(48481);let s="bg-transparent border-2 border-muted-foreground",d="status.unknown";function i(e,t){return!0===t&&"ready"===e}let l=(0,n.memo)(function(e){let{status:t,label:r,waitingKind:n,unclassified:l}=e,u=(0,o.c)("common"),m=i(t,l);return(0,a.jsx)(c.m,{"data-testid":"status-indicator",status:t,label:m?null!=r?r:u(d):r,waitingKind:n,size:"sm",className:m?s:void 0,"data-unclassified":m?"true":void 0})})},86068:(e,t,r)=>{r.d(t,{o:()=>c});var a=r(95155);r(12115);var n=r(18955),o=r(14524);function c(e){let{value:t,onChange:r,idPrefix:c="auto-yes-answer-mode",labelClassName:s="font-medium mb-2"}=e,d=(0,n.c)("autoYes"),i="".concat(c,"-label");return(0,a.jsxs)("div",{className:"text-sm text-foreground",children:[(0,a.jsx)("p",{className:s,id:i,children:d("answerModeLabel")}),(0,a.jsx)("div",{className:"flex flex-col gap-2",role:"radiogroup","aria-labelledby":i,"data-testid":"".concat(c,"-options"),children:o.yv.map(e=>(0,a.jsxs)("button",{type:"button",role:"radio","aria-checked":t===e,onClick:()=>r(e),className:"w-full py-2 px-3 text-left rounded-md border-2 transition-colors ".concat(t===e?"border-accent-600 bg-accent-50 dark:bg-accent-900/30 text-accent-700 dark:text-accent-400":"border-border bg-surface dark:bg-surface-2 text-foreground hover:border-muted-foreground"),style:{minHeight:"44px"},"data-testid":"".concat(c,"-").concat(e),children:[(0,a.jsx)("span",{className:"block text-sm font-medium",children:d("answerModes.".concat(e))}),(0,a.jsx)("span",{className:"block text-xs text-muted-foreground",children:d("answerModeDescriptions.".concat(e))})]},e))}),(0,a.jsx)("p",{className:"mt-2 text-xs text-muted-foreground","data-testid":"".concat(c,"-permission-note"),children:d("answerModePermissionNote")})]})}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8606],{38606:(n,e,t)=>{t.d(e,{pu:()=>u,A7:()=>c,kA:()=>l,f_:()=>y,dw:()=>g,Pn:()=>p,px:()=>a,XK:()=>v});var i=t(54014),s=t(55449);function l(n){return n?n.isWaitingForResponse?"waiting":n.isProcessing?"running":n.isRunning?"ready":"idle":"idle"}function a(n){return(null==n?void 0:n.isUnclassified)===!0&&"ready"===l(n)}let r={start:"nextAction.start",sendMessage:"nextAction.sendMessage",approveReject:"nextAction.approveReject",replyToPrompt:"nextAction.replyToPrompt",checkStalled:"nextAction.checkStalled",running:"nextAction.running"},o="exited",u="unknown",d={idle:null,ready:"ready",running:"running",generating:"running",waiting:"waiting"};function c(n){if(!n)return"idle";let e=Object.values(n).filter(n=>void 0!==n);return 0===e.length?"idle":e.includes("waiting")?"waiting":e.includes("running")?"running":e.includes("generating")?"generating":e.includes("ready")?"ready":"idle"}function g(n,e,t,s){return n?Object.entries(n).map(n=>{var l;let[a,r]=n,o=null!=(l=null==e?void 0:e[a])?l:(0,i.f_)(a,a),d=null==t?void 0:t(a),c="ready"===r&&(null==s?void 0:s.has(a))?u:null!=r?r:"idle";return"".concat(o,": ").concat(c).concat(d?" (".concat(d,")"):"")}).join(", "):""}function p(n,e){return!!n&&!!e&&0!==e.length&&"ready"===c(n)&&e.some(e=>"ready"===n[e])}let f=["prompt","menu","unclassified"];function y(n){var e,t,i;let s=Object.values(null!=(t=null!=(e=n.sessionStatusByInstance)?e:n.sessionStatusByCli)?t:{}).filter(n=>void 0!==n),l=!1,a=new Set;for(let n of s)n.awaitingInstruction&&(l=!0),n.waitingKind&&a.add(n.waitingKind);return{waitingKind:null!=(i=f.find(n=>a.has(n)))?i:null,awaitingInstruction:l}}function v(n){var e,t,u,g,f,v,w;let A=l(void 0!==n.isSessionRunning?{isRunning:null!=(e=n.isSessionRunning)&&e,isWaitingForResponse:null!=(t=n.isWaitingForResponse)&&t,isProcessing:null!=(u=n.isProcessing)&&u}:void 0),h=!!n.lastAssistantMessageAt&&(!n.lastViewedAt||new Date(n.lastAssistantMessageAt)>new Date(n.lastViewedAt)),{cliStatus:S,cliStatusLabels:m,exitedInstanceIds:R,unclassifiedInstanceIds:k}=function(n){var e,t,r,u,d,c,g;let p={},f={},y=[],v=[],w=n.sessionStatusByInstance;if(!w){for(let c of null!=(e=n.selectedAgents)?e:(0,s.sA)())p[c]=l(null==(t=n.sessionStatusByCli)?void 0:t[c]),f[c]=(0,i.oo)(c),(null==(u=n.sessionStatusByCli)||null==(r=u[c])?void 0:r.sessionStatusReason)===o&&y.push(c),a(null==(d=n.sessionStatusByCli)?void 0:d[c])&&v.push(c);return{cliStatus:p,cliStatusLabels:f,exitedInstanceIds:y,unclassifiedInstanceIds:v}}let A=n.agentInstances&&n.agentInstances.length>0?n.agentInstances:(0,i.lu)(null!=(c=n.selectedAgents)?c:(0,s.sA)()),h=new Set;for(let n of A)h.add(n.id),p[n.id]=l(w[n.id]),f[n.id]=(0,i.sw)(n),(null==(g=w[n.id])?void 0:g.sessionStatusReason)===o&&y.push(n.id),a(w[n.id])&&v.push(n.id);for(let[n,e]of Object.entries(w)){if(h.has(n))continue;let t=l(e);"idle"!==t&&(p[n]=t,f[n]=function(n){let e=i.XH.find(e=>n.startsWith("".concat(e,"-")));if(e){let t=n.slice(e.length+1);return"".concat((0,i.oo)(e)," ").concat(t)}return(0,i.f_)(n,n)}(n),a(e)&&v.push(n))}return{cliStatus:p,cliStatusLabels:f,exitedInstanceIds:y,unclassifiedInstanceIds:v}}(n),x=c(S),{waitingKind:j,awaitingInstruction:B}=y(n),I=p(S,k);return{id:n.id,name:n.name,repositoryName:null!=(g=n.repositoryDisplayName)?g:n.repositoryName,status:A,hasUnread:h,lastActivity:n.updatedAt,lastActivityByInstance:n.lastActivityByInstance,description:n.description,cliStatus:S,cliStatusLabels:m,exitedInstanceIds:R,unclassifiedInstanceIds:k,worktreePath:n.path,worktreeStatus:null!=(f=n.status)?f:null,waitingKind:j,awaitingInstruction:B,nextActionKey:I?void 0:(v=d[x],w="waiting"===x?"approval":null,v&&"idle"!==v?"ready"===v?r.sendMessage:"waiting"===v&&"approval"===w?r.approveReject:"waiting"===v?r.replyToPrompt:(0,r.running):r.start)}}}}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7177],{13673:()=>{},23252:(e,t,n)=>{"use strict";n.d(t,{AppProviders:()=>M});var r=n(95155),s=n(20063);n(95704);let a=["/login","/api/auth/login","/api/auth/logout","/api/auth/status","/api/remote/pair","/manifest.webmanifest","/sw.js","/offline"];var i=n(3809),l=n(5379),o=n(32916),d=n(65380),c=n(22592),u=n(92614),m=n(70628),h=n(66966),x=n(89275),f=n(60199),p=n(36402),b=n(63470),g=n(40823),v=n(58165),w=n(94442),j=n(72604),y=n(95275),k=n(79832),N=n(12115),C=n(18955),S=n(89559),I=n(59854),T=n(77016);function A(){let e=(0,C.c)("pwa"),[t,n]=(0,N.useState)(null),s=(0,N.useRef)(!1),a=(0,T.W)();return((0,N.useEffect)(()=>{if("undefined"==typeof navigator||!("serviceWorker"in navigator))return;let e=!1,t=t=>{e||n(t)};navigator.serviceWorker.register("/sw.js").then(e=>{e.waiting&&navigator.serviceWorker.controller&&t(e.waiting),e.addEventListener("updatefound",()=>{let n=e.installing;n&&n.addEventListener("statechange",()=>{"installed"===n.state&&navigator.serviceWorker.controller&&t(n)})})}).catch(()=>{});let r=()=>{s.current||(s.current=!0,window.location.reload())};return navigator.serviceWorker.addEventListener("controllerchange",r),()=>{e=!0,navigator.serviceWorker.removeEventListener("controllerchange",r)}},[]),!t||a)?null:(0,r.jsx)("div",{"data-testid":"pwa-update-toast",role:"status","aria-live":"polite",className:"pointer-events-none fixed bottom-0 right-0 flex max-w-full justify-end px-4 pb-safe",style:{zIndex:I.M.TOAST},children:(0,r.jsxs)("div",{"data-testid":"pwa-update-toast-card",className:"pointer-events-auto mb-4 flex items-center gap-3 rounded-lg border border-border bg-surface px-4 py-3 shadow-lg",children:[(0,r.jsx)("span",{className:"text-sm font-medium text-foreground",children:e("update.available")}),(0,r.jsxs)("button",{type:"button",onClick:()=>{t.postMessage({type:"SKIP_WAITING"})},className:"inline-flex items-center gap-1.5 rounded-md bg-accent-600 px-3 py-1.5 text-sm font-medium text-white transition-colors hover:bg-accent-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ring-offset-background dark:bg-accent-500 dark:hover:bg-accent-600",children:[(0,r.jsx)(S.A,{className:"h-4 w-4"}),e("update.reload")]})]})})}function M(e){var t;let{children:n,locale:N,messages:C,timeZone:S,authEnabled:I=!1}=e,T=(t=(0,s.usePathname)(),!I||!a.includes(null!=t?t:""));return(0,r.jsx)(i.default,{locale:N,messages:C,timeZone:S,children:(0,r.jsx)(w.tE,{children:(0,r.jsx)(l.N,{attribute:"class",defaultTheme:"system",enableSystem:!0,children:(0,r.jsx)(d.O,{authEnabled:I,children:(0,r.jsx)(c.W5,{children:(0,r.jsx)(o.GB,{children:(0,r.jsx)(f.tS,{enabled:T,children:(0,r.jsxs)(h.g7,{enabled:T,children:[(0,r.jsx)(j.rM,{}),(0,r.jsx)(k.o,{}),(0,r.jsx)(y.H,{}),(0,r.jsx)(u.E,{children:(0,r.jsx)(m.S,{children:(0,r.jsx)(p.aF,{children:(0,r.jsx)(b.y2,{enabled:T,children:(0,r.jsxs)(g.NS,{children:[(0,r.jsx)(x.Bo,{children:n}),(0,r.jsx)(A,{}),(0,r.jsx)(v.gZ,{})]})})})})})]})})})})})})})})}},60322:(e,t,n)=>{"use strict";n.d(t,{l:()=>s});let r=/\x1b\[[0-9;]*[a-zA-Z]|\x1b\][^\x07]*\x07|\[[0-9;]*m/g;async function s(e){var t;if(!e||0===e.trim().length)return;let n=e.replace(r,"");if(null==(t=navigator.clipboard)?void 0:t.writeText)try{await navigator.clipboard.writeText(n);return}catch(e){}let s=document.createElement("textarea");s.value=n,s.style.position="fixed",s.style.left="-9999px",s.style.top="-9999px",s.style.opacity="0",document.body.appendChild(s),s.focus(),s.select();try{document.execCommand("copy")}finally{document.body.removeChild(s)}}},61781:(e,t,n)=>{"use strict";n.d(t,{AppShellGate:()=>tG});var r=n(95155),s=n(20063),a=n(12115),i=n(32916),l=n(38218);let o={showSidebar:!0,showGlobalNav:!0,showLocalNav:!1,autoCollapseSidebar:!1},d=[{prefix:"/worktrees/",config:{showGlobalNav:!1,showLocalNav:!0}},{prefix:"/sessions",config:{autoCollapseSidebar:!0}}];var c=n(22592),u=n(52619),m=n.n(u),h=n(89275);let x=(0,a.forwardRef)(function(e,t){let{href:n,onClick:a,target:i,...l}=e,o=(0,s.usePathname)(),d=(0,h.Hq)();return(0,r.jsx)(m(),{ref:t,href:n,target:i,onClick:e=>{var t;null==a||a(e),e.defaultPrevented||0!==(t=e).button||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||void 0!==i&&"_self"!==i||/^([a-z][a-z0-9+.-]*:)?\/\//i.test(n)||/^(mailto:|tel:)/i.test(n)||(e.preventDefault(),n!==o&&d.push(n))},...l})});var f=n(18955),p=n(66685),b=n(85710),g=n(61362),v=n(15870),w=n(17787),j=n(49027),y=n(27587),k=n(39649),N=n(69858),C=n(76471),S=n(70532),I=n(44308),T=n(38606);let A=(0,a.memo)(function(e){let{worktrees:t,visibleWorktreeIds:n,selectedWorktreeId:s,onSelect:a,onNavigate:i}=e,l=(0,f.c)("common"),o=t.length;if(0===o)return null;let d=t.slice(0,3),c=o-d.length;return(0,r.jsxs)("section",{"data-testid":"sidebar-needs-attention","aria-label":l("sidebar.needsAttention"),className:"flex-shrink-0 px-2 pt-3",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 px-2 pb-1 text-xs text-sidebar-muted",children:[(0,r.jsx)("span",{className:"min-w-0 flex-1 truncate",children:l("sidebar.needsAttention")}),(0,r.jsx)("span",{"data-testid":"sidebar-needs-attention-count","aria-label":l("attention.badgeLabel",{count:o}),className:"flex-shrink-0 rounded-full bg-warning-subtle px-1.5 font-semibold leading-5 tabular-nums text-warning-foreground",children:o>99?"99+":o})]}),(0,r.jsx)("ul",{className:"space-y-0.5",children:d.map(e=>{let t=(0,T.XK)(e),i=!n.has(e.id),o=e.id===s;return(0,r.jsx)("li",{children:(0,r.jsxs)("button",{type:"button","data-testid":"sidebar-attention-item","data-hidden-repository":i?"true":void 0,onClick:()=>a(e.id),"aria-current":o?"true":void 0,title:"".concat(t.name," \xb7 ").concat(t.repositoryName),className:"flex h-[34px] w-full min-w-0 items-center gap-2 rounded-md px-2 text-left transition-colors hover:bg-sidebar-hover focus:outline-none focus-visible:ring-2 focus-visible:ring-ring ".concat(o?"bg-sidebar-hover":""),children:[(0,r.jsx)("span",{className:"flex w-4 flex-shrink-0 items-center justify-center",children:(0,r.jsx)(C.Ej,{status:"waiting",waitingKind:t.waitingKind})}),(0,r.jsx)("span",{className:"min-w-0 flex-1 truncate text-sm text-sidebar-foreground",children:t.name}),(0,r.jsx)("span",{className:"min-w-0 max-w-[40%] flex-shrink truncate text-xs text-sidebar-muted",children:t.repositoryName}),i&&(0,r.jsx)(S.A,{"data-testid":"sidebar-attention-hidden-repository",className:"h-3.5 w-3.5 flex-shrink-0 text-sidebar-muted","aria-label":l("sidebar.hiddenRepository"),role:"img"})]})},e.id)})}),(0,r.jsx)(x,{href:I.ks,"data-testid":"sidebar-needs-attention-review-link",onClick:i,className:"mt-0.5 flex min-w-0 items-center rounded-md px-2 py-1 text-xs text-sidebar-muted transition-colors hover:bg-sidebar-hover hover:text-sidebar-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:(0,r.jsx)("span",{className:"min-w-0 truncate",children:c>0?l("sidebar.attentionMoreInReview",{count:c}):l("sidebar.openInReview")})})]})}),M=(0,a.memo)(function(e){let{branches:t,selectedWorktreeId:n,onBranchClick:s,forceExpanded:i}=e,l=(0,f.c)("common"),[o,d]=(0,a.useState)(!1),c=i||o;return(0,r.jsxs)("div",{"data-testid":"branch-group-other",children:[(0,r.jsx)("div",{className:N.R8,children:(0,r.jsxs)("button",{type:"button","data-testid":"branch-group-other-toggle","aria-expanded":c,disabled:i,onClick:()=>d(e=>!e),className:"flex h-[30px] w-full min-w-0 items-center gap-2 rounded-[10px] px-3 text-left text-xs text-sidebar-muted transition-colors hover:bg-sidebar-hover hover:text-sidebar-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring disabled:cursor-default disabled:hover:bg-transparent",children:[(0,r.jsx)("svg",{className:"h-3 w-3 flex-shrink-0 transition-transform ".concat(c?"rotate-90":""),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})}),(0,r.jsx)("span",{className:"min-w-0 truncate",children:l("sidebar.otherBranches",{count:t.length})})]})}),c&&t.map(e=>(0,r.jsx)(N.yP,{branch:e,isSelected:e.id===n,onClick:()=>s(e.id),showRepositoryName:!1},e.id))]})});var E=n(48407),L=n(73464),R=n(26232),P=n(7636),B=n(87531);let K=[{mode:"grouped",labelKey:"sidebar.viewMode.grouped"},{mode:"flat",labelKey:"sidebar.viewMode.flat"},{mode:"sessions",labelKey:"sidebar.viewMode.sessions"}],O=[{key:"updatedAt",labelKey:"sort.updatedAt"},{key:"repositoryName",labelKey:"sort.repositoryName"},{key:"branchName",labelKey:"sort.branchName"},{key:"status",labelKey:"sort.status"}],F={updatedAt:"desc"},D={updatedAt:{asc:"sort.direction.oldestFirst",desc:"sort.direction.newestFirst"},repositoryName:{asc:"sort.direction.aToZ",desc:"sort.direction.zToA"},branchName:{asc:"sort.direction.aToZ",desc:"sort.direction.zToA"},status:{asc:"sort.direction.attentionFirst",desc:"sort.direction.attentionLast"}},W={asc:"sort.ascending",desc:"sort.descending"};function z(e){var t;return null!=(t=F[e])?t:"asc"}function _(e){e.preventDefault()}let H=(0,a.memo)(function(e){var t,n,s,l;let{viewMode:o,onViewModeChange:d}=e,c=(0,f.c)("common"),{sortKey:u,sortDirection:m,setSortKey:h,setSortDirection:x}=(0,i.VF)(),p=(0,a.useId)(),b=(0,a.useId)(),g=(0,a.useMemo)(()=>{var e;let t=null!=(e=D[u])?e:W;return e=>c(t[e])},[u,c]),v=c(null!=(s=null==(t=K.find(e=>e.mode===o))?void 0:t.labelKey)?s:"sidebar.viewMode.grouped"),w=c(null!=(l=null==(n=O.find(e=>e.key===u))?void 0:n.labelKey)?l:"sort.".concat(u)),j=c("sidebar.listOptionsSummary",{view:v,sort:w,direction:g(m)}),y=o===i.e8&&u===i.P0&&m===i.RA,k=z(u);return(0,r.jsxs)(R.rI,{children:[(0,r.jsx)(R.ty,{asChild:!0,children:(0,r.jsxs)("button",{type:"button","data-testid":"sidebar-list-options","data-view-mode":o,"data-sort-key":u,"data-sort-direction":m,"aria-label":c("sidebar.listOptionsLabel",{summary:j}),title:j,className:"relative flex h-8 w-8 flex-shrink-0 items-center justify-center rounded-md text-sidebar-muted transition-colors hover:bg-sidebar-hover hover:text-sidebar-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-ring data-[state=open]:bg-sidebar-hover data-[state=open]:text-sidebar-foreground",children:[(0,r.jsx)(L.A,{className:"h-4 w-4","aria-hidden":"true"}),!y&&(0,r.jsx)("span",{"data-testid":"sidebar-list-options-indicator","aria-hidden":"true",className:"absolute right-1 top-1 h-1.5 w-1.5 rounded-full bg-accent-500"})]})}),(0,r.jsxs)(R.SQ,{"data-testid":"sidebar-list-options-menu",align:"end",collisionPadding:8,className:(0,B.cn)("w-52 max-w-[calc(100vw-16px)]","max-h-[var(--radix-dropdown-menu-content-available-height)] overflow-y-auto"),children:[(0,r.jsx)(R.lp,{id:p,children:c("sidebar.viewLabel")}),(0,r.jsx)(R.Hr,{"data-testid":"view-mode-options","aria-labelledby":p,value:o,onValueChange:e=>{(0,P.$m)(e)&&e!==o&&d(e)},children:K.map(e=>{let{mode:t,labelKey:n}=e;return(0,r.jsx)(R.Ht,{value:t,onSelect:_,children:c(n)},t)})}),(0,r.jsx)(R.mB,{}),(0,r.jsx)(R.lp,{id:b,children:c("sort.label")}),(0,r.jsx)(R.Hr,{"data-testid":"sort-key-options","aria-labelledby":b,value:u,onValueChange:e=>{let t=O.find(t=>t.key===e);t&&t.key!==u&&(h(t.key),x(z(t.key)))},children:O.map(e=>{let{key:t,labelKey:n}=e;return(0,r.jsx)(R.Ht,{value:t,onSelect:_,children:c(n)},t)})}),(0,r.jsx)(R.mB,{}),(0,r.jsx)(R.Hr,{"data-testid":"sort-direction-options","aria-label":c("sort.directionLabel"),value:m,onValueChange:e=>{("asc"===e||"desc"===e)&&x(e)},children:("asc"===k?["asc","desc"]:["desc","asc"]).map(e=>(0,r.jsx)(R.Ht,{value:e,onSelect:_,children:g(e)},e))})]})]})}),V=(0,a.memo)(function(e){let{searchQuery:t,onSearchChange:n,viewMode:s,onViewModeChange:a}=e,i=(0,f.c)("common");return(0,r.jsxs)("div",{"data-testid":"sidebar-list-toolbar",className:"flex flex-shrink-0 items-center gap-1 px-3 pt-2 pb-1.5",children:[(0,r.jsx)(E.pd,{type:"text",inputSize:"sm",placeholder:i("sidebar.searchBranches"),"aria-label":i("sidebar.searchBranches"),value:t,onChange:e=>n(e.target.value),className:"min-w-0 flex-1 border-sidebar-border bg-background shadow-none"}),(0,r.jsx)(H,{viewMode:s,onViewModeChange:a})]})});var Y=n(41898),U=n(30061),q=n(5379),G=n(65380),X=n(45195),J=n(40823),Z=n(68704),$=n(26020);async function Q(){try{await fetch("/api/auth/logout",{method:"POST"}),window.location.href="/login"}catch(e){window.location.href="/login"}}let ee=R.ty;function et(){let e=(0,f.c)("common"),{size:t,setSize:n}=(0,c.Ps)(),s=(0,i.pT)();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(R.mB,{}),(0,r.jsx)(R.lp,{children:e("displaySize.ariaLabel")}),(0,r.jsx)(R.Hr,{value:t,onValueChange:e=>{(0,Z.fM)(e)&&n(e)},children:Z.Uf.map(t=>(0,r.jsx)(R.Ht,{value:t,children:e("displaySize.".concat(t))},t))}),s&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(R.lp,{children:e("repoTabBar.settingLabel")}),(0,r.jsx)(R.Hr,{value:s.repoTabBarMode,onValueChange:e=>{(0,P.m3)(e)&&s.setRepoTabBarMode(e)},children:P.EN.map(t=>(0,r.jsx)(R.Ht,{value:t,children:e("repoTabBar.mode.".concat(t))},t))})]})]})}function en(e){let{children:t,testIdPrefix:n,side:s="top",align:i="end",showDisplayPreferences:o=!1,onNavigate:d}=e,c=(0,f.c)("worktree"),u=(0,h.Hq)(),{theme:m,setTheme:x}=(0,q.D)(),{currentLocale:p,switchLocale:b}=(0,X.g)(),g=(0,G.H)(),v=(0,l.a)(),{open:w}=(0,J.V0)(),j=(0,a.useRef)(!1),y=(0,a.useRef)(null),k="0.49.1",N=e=>{null==d||d(),u.push(e)};return(0,r.jsxs)(R.rI,{children:[t,(0,r.jsxs)(R.SQ,{side:s,align:i,collisionPadding:8,className:"w-56 max-w-[calc(100vw-16px)] max-h-[var(--radix-dropdown-menu-content-available-height)] overflow-y-auto",onCloseAutoFocus:()=>{j.current&&(j.current=!1,queueMicrotask(w))},children:[(0,r.jsx)(R.lp,{"data-testid":"".concat(n,"-version"),children:c("activityBar.settingsMenu.version",{version:k?"v".concat(k):"-"})}),(0,r.jsx)(R._2,{asChild:!0,onSelect:()=>{let e=y.current;if(y.current=null,!(e&&(0!==e.button||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey))){if(null==e||e.preventDefault(),v)return void N("/more");j.current=!0}},children:(0,r.jsx)("a",{href:"/more","data-testid":"".concat(n,"-settings"),onClick:e=>{y.current=e},children:c("activityBar.settingsMenu.settings")})}),(0,r.jsx)(R._2,{onSelect:()=>N("/skills"),children:c("activityBar.settingsMenu.skills")}),(0,r.jsx)(R.mB,{}),(0,r.jsx)(R.lp,{children:c("activityBar.settingsMenu.theme")}),(0,r.jsxs)(R.Hr,{value:null!=m?m:"system",onValueChange:e=>x(e),children:[(0,r.jsx)(R.Ht,{value:"light",children:c("activityBar.settingsMenu.themeLight")}),(0,r.jsx)(R.Ht,{value:"dark",children:c("activityBar.settingsMenu.themeDark")}),(0,r.jsx)(R.Ht,{value:"system",children:c("activityBar.settingsMenu.themeSystem")})]}),(0,r.jsx)(R.lp,{children:c("activityBar.settingsMenu.language")}),(0,r.jsx)(R.Hr,{value:p,onValueChange:e=>b(e),children:$.dI.map(e=>(0,r.jsx)(R.Ht,{value:e,children:$.vK[e]},e))}),o&&!v&&(0,r.jsx)(et,{}),(0,r.jsx)(R.mB,{}),(0,r.jsx)(R._2,{asChild:!0,children:(0,r.jsx)("a",{href:"https://github.com/kewton/MyCodeBranchDesk",target:"_blank",rel:"noopener noreferrer",children:c("activityBar.settingsMenu.github")})}),g&&(0,r.jsx)(R._2,{onSelect:()=>{Q()},children:c("activityBar.settingsMenu.logout")})]})]})}var er=n(59847),es=n(11010),ea=n(86651),ei=n(79651),el=n(92614),eo=n(51743);let ed=["global","terminal","composer","editor"],ec=[{id:"commandPalette",keys:["MOD","K"],scope:"global"},{id:"toggleSidebar",keys:["MOD","B"],scope:"global"},{id:"keyboardHelp",keys:["?"],scope:"global"},{id:"closeOverlay",keys:["Esc"],scope:"global"},{id:"navigateList",keys:["↑","↓"],scope:"global"},{id:"terminalSearch",keys:["MOD","F"],scope:"terminal"},{id:"toggleSurfaceMode",keys:["MOD","Shift","M"],scope:"terminal"},{id:"sendMessage",keys:["↵"],scope:"composer"},{id:"composerNewline",keys:["Shift","↵"],scope:"composer"},{id:"editorIndent",keys:["Tab"],scope:"editor"},{id:"editorOutdent",keys:["Shift","Tab"],scope:"editor"},{id:"editorTabFocus",keys:["Ctrl","M"],scope:"editor"},{id:"editorSave",keys:["MOD","S"],scope:"editor"},{id:"editorFullscreen",keys:["MOD","Shift","F"],scope:"editor"}];function eu(){if("undefined"==typeof navigator)return!1;let e=navigator.platform||navigator.userAgent||"";return/Mac|iPhone|iPad|iPod/.test(e)}function em(e,t){return"MOD"===e?t?"⌘":"Ctrl":e}var eh=n(26550),ex=n(78845),ef=n(65229);let ep="flex items-center justify-center rounded-md text-sidebar-muted transition-colors hover:bg-sidebar-hover hover:text-sidebar-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",eb={width:"".concat(P.KI,"px"),height:"".concat(P.KI,"px")};function eg(e){let{testId:t,onClose:n}=e,s=(0,f.c)("common"),{isOpen:a,toggle:l}=(0,i.VF)(),o=s(a?"sidebar.close":"sidebar.open"),d=a?eh.A:ex.A;return(0,r.jsx)("div",{"data-sidebar-toggle-cell":"",className:"flex flex-shrink-0",style:{padding:"".concat(P.df,"px")},children:n?(0,r.jsx)("button",{type:"button","data-testid":t,onClick:n,"aria-label":s("sidebar.close"),style:eb,className:ep,children:(0,r.jsx)(ef.A,{size:20,"aria-hidden":"true"})}):(0,r.jsx)(Y.m_,{content:o,placement:a?"bottom":"right",children:(0,r.jsx)("button",{type:"button","data-testid":t,onClick:l,"aria-label":o,"aria-expanded":a,style:eb,className:ep,children:(0,r.jsx)(d,{size:20,"aria-hidden":"true"})})})})}let ev="flex w-full min-w-0 items-center gap-2 rounded-md px-2 py-1.5 text-left text-sm text-sidebar-muted transition-colors hover:bg-sidebar-hover hover:text-sidebar-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-ring";function ew(e){let{drawer:t=!1}=e,n=(0,f.c)("common"),s=(0,f.c)("commandPalette"),{setOpen:l}=(0,el.C)(),{openNewTask:o}=(0,eo.hX)(),{closeMobileDrawer:d}=(0,i.VF)(),c=function(){let[e,t]=a.useState(null);return a.useEffect(()=>{t(eu()?"⌘":"Ctrl")},[]),e}(),u=t?d:void 0;return(0,r.jsxs)("div",{"data-testid":t?"sidebar-drawer-top-controls":"sidebar-top-controls",className:"flex-shrink-0",children:[(0,r.jsxs)("div",{className:"flex min-w-0 items-center",children:[t?(0,r.jsx)(eg,{testId:"sidebar-drawer-close",onClose:d}):(0,r.jsx)(eg,{testId:"sidebar-panel-toggle"}),(0,r.jsxs)(x,{href:"/",onClick:u,"data-testid":"sidebar-logo",className:"flex min-w-0 items-center gap-2 rounded-md px-1 py-1 transition-opacity hover:opacity-80 focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[(0,r.jsx)("span",{className:"flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-md bg-accent-600",children:(0,r.jsx)(er.A,{size:14,strokeWidth:2,className:"text-white","aria-hidden":"true"})}),(0,r.jsx)("span",{className:"truncate text-sm font-bold text-sidebar-foreground",children:"CommandMate"})]})]}),(0,r.jsxs)("div",{className:"space-y-0.5 px-2",children:[(0,r.jsxs)("button",{type:"button","data-testid":"sidebar-new-task",onClick:()=>{null==u||u(),o()},"aria-haspopup":"dialog",className:ev,children:[(0,r.jsx)(es.A,{className:"h-4 w-4 flex-shrink-0","aria-hidden":"true"}),(0,r.jsx)("span",{className:"min-w-0 flex-1 truncate",children:n("newTask.title")})]}),(0,r.jsxs)("button",{type:"button","data-testid":"sidebar-search",onClick:()=>{null==u||u(),l(!0)},"aria-label":s("mobileTrigger"),className:ev,children:[(0,r.jsx)(ea.A,{className:"h-4 w-4 flex-shrink-0","aria-hidden":"true"}),(0,r.jsx)("span",{className:"min-w-0 flex-1 truncate",children:s("searchAction")}),!t&&null!==c&&(0,r.jsxs)("span",{className:"flex flex-shrink-0 items-center gap-0.5","aria-hidden":"true",children:[(0,r.jsx)(ei.u,{children:c}),(0,r.jsx)(ei.u,{children:"K"})]})]})]})]})}var ej=n(94442),ey=n(24373),ek=n(80344),eN=n(54014),eC=n(55449),eS=n(98873);let eI="mcbd-sidebar-group-collapsed",eT="mcbd-sidebar-scroll-top",eA=0,eM=(0,a.memo)(function(){var e,t,n;let o=(0,h.Hq)(),{worktrees:d,repositories:c,selectedWorktreeId:u,selectWorktree:m,refreshWorktrees:x,isLoading:v,error:y}=(0,k.$f)(),{closeMobileDrawer:C,sortKey:S,sortDirection:M,viewMode:L,setViewMode:R,repositoryOrder:B,setRepositoryOrder:K}=(0,i.VF)(),O=(0,f.c)("common"),F=null!=(e=(0,s.usePathname)())?e:"",D=(0,P.jn)(F,u),W=(0,l.a)(),{count:z}=(0,ey.Lv)(),[_,H]=(0,a.useState)(""),Y=(0,a.useRef)(null),[U,q]=(0,a.useState)(()=>{try{let e=localStorage.getItem(eI);return e?function(e){try{let t=JSON.parse(e);if("object"!=typeof t||null===t||Array.isArray(t))return{};let n={},r=0;for(let[e,s]of Object.entries(t))if(!eR.has(e)&&"boolean"==typeof s){if(++r>100)break;n[e]=s}return n}catch(e){return{}}}(e):{}}catch(e){return{}}}),G=(0,a.useRef)(!1);(0,a.useEffect)(()=>{G.current||(G.current=!0,fetch("/api/sidebar/group-order").then(e=>e.json()).then(e=>{e.success&&Array.isArray(e.order)&&K(e.order)}).catch(()=>{}))},[K]);let X=(0,a.useMemo)(()=>(0,P.UZ)(c),[c]),J=(0,a.useMemo)(()=>(0,P.s6)(d,X),[d,X]),Z=(0,a.useMemo)(()=>(0,ey.Rc)(d),[d]),$=(0,a.useMemo)(()=>new Set(J.map(e=>e.id)),[J]),Q=(0,a.useMemo)(()=>J.map(T.XK),[J]),ee=(0,a.useMemo)(()=>new Map(Q.map(e=>[e.id,e])),[Q]),et=(0,a.useDeferredValue)(Q),en=(0,a.useRef)(null),er=(0,a.useRef)(null),es=(0,a.useRef)(null),ea=(0,a.useRef)(new Set),[ei,el]=(0,a.useState)(0);(0,a.useEffect)(()=>()=>{null!==er.current&&clearTimeout(er.current)},[]);let eo=(0,a.useCallback)(()=>{null!==er.current&&(clearTimeout(er.current),er.current=null),en.current=null,es.current=null},[]),ed=(0,a.useMemo)(()=>{let e=en.current;return!e||0===e.items.length||Date.now()>=e.expiresAt?et:e.items},[et,ei]),ec=(0,a.useRef)(ed),eu=es.current,em=new Set(ed.filter(e=>(null==eu?void 0:eu.has(e.id))===!0||(0,P.rL)(e,D,ee)).map(e=>e.id));(0,a.useLayoutEffect)(()=>{if(ec.current=ed,ea.current=em,es.current)for(let e of em)es.current.add(e);let e=en.current;e&&0===e.items.length&&et.length>0&&eo()});let eh=(0,a.useCallback)(()=>{if(0===ec.current.length)return;null!==er.current&&(clearTimeout(er.current),er.current=null);let e=en.current;if(e&&Date.now()<e.expiresAt){en.current={...e,expiresAt:1/0};return}en.current={items:ec.current,expiresAt:1/0},es.current=new Set(ea.current)},[]),ex=(0,a.useCallback)(()=>{en.current&&(en.current={...en.current,expiresAt:Date.now()+1e3},null!==er.current&&clearTimeout(er.current),er.current=setTimeout(()=>{eo(),el(e=>e+1)},1e3))},[eo]),{sortedItems:ef,groupedItems:ep}=(0,eS.D)({items:ed,sortKey:S,sortDirection:M,viewMode:L,filterText:_}),eb=(0,a.useMemo)(()=>"grouped"===L&&ep?_.trim()?ep:(0,P.Ew)(ep,B):null,[L,ep,B,_]),eg="grouped"===L?eb:null,ev=(0,a.useMemo)(()=>"sessions"===L?(0,P.EY)((0,P.UB)(ef),S,M):[],[L,ef,S,M]);(0,a.useEffect)(()=>{try{localStorage.setItem(eI,JSON.stringify(U))}catch(e){}},[U]);let ej=(0,a.useCallback)(e=>{q(t=>({...t,[e]:!t[e]}))},[]),ek=(0,a.useCallback)(()=>{var e,t,n=null!=(t=null==(e=Y.current)?void 0:e.scrollTop)?t:0;let r=Number.isFinite(n)&&n>0?n:0;eA=r;try{localStorage.setItem(eT,String(r))}catch(e){}},[]),eM=ef.length>0||(null!=(t=null==eg?void 0:eg.length)?t:0)>0||ev.length>0;(0,a.useEffect)(()=>{let e=Y.current;if(!e)return;let t=window.requestAnimationFrame(()=>{e.scrollTop=function(){try{let e=localStorage.getItem(eT);if(!e)return eA=0,0;let t=Number(e);Number.isFinite(t)&&t>=0&&(eA=t)}catch(e){}return eA}()});return()=>{window.cancelAnimationFrame(t)}},[eM,L]);let eP=(0,a.useRef)(d);(0,a.useEffect)(()=>{eP.current=d},[d]);let eO=(0,a.useCallback)(e=>{ek(),m(e);let t=eP.current.find(t=>t.id===e);o.push(t?function(e){let t=function(e){var t;let n=e.sessionStatusByInstance;if(!n)return null;let r=(e.agentInstances&&e.agentInstances.length>0?e.agentInstances:(0,eN.lu)(null!=(t=e.selectedAgents)?t:(0,eC.sA)())).map((e,t)=>({instance:e,index:t})).sort((e,t)=>{var n,r;return(null!=(n=e.instance.order)?n:0)-(null!=(r=t.instance.order)?r:0)||e.index-t.index}).map(e=>{let{instance:t}=e;return t}).flatMap((e,t)=>{let r=n[e.id];return(null==r?void 0:r.isWaitingForResponse)?[{id:e.id,index:t,entry:r}]:[]});if(0===r.length)return null;let{waitingKind:s}=(0,T.f_)(e),a=s?r.filter(e=>e.entry.waitingKind===s):[],i=(a.length>0?a:r).flatMap(e=>{let t=e.entry.waitingSince;return"number"==typeof t&&Number.isFinite(t)?[{...e,since:t}]:[]});return 0===i.length?null:(i.sort((e,t)=>e.since-t.since||e.index-t.index),i[0].id)}(e);return null===t?"/worktrees/".concat(e.id):(0,P.Ii)({worktreeId:e.id,instanceId:t})}(t):"/worktrees/".concat(e)),C()},[ek,m,o,C]),eF=(0,a.useCallback)(e=>{ek(),m(e.worktreeId),o.push((0,P.Ii)(e)),C()},[ek,m,o,C]),eD=(0,w.FR)((0,w.MS)(w.AN,{activationConstraint:{distance:8}})),e_=(0,a.useCallback)(e=>{let{active:t,over:n}=e;if(!n||t.id===n.id||!eg)return;let r=eg.map(e=>e.repositoryName),s=r.indexOf(String(t.id)),a=r.indexOf(String(n.id));if(-1===s||-1===a)return;let i=(0,j.be)(r,s,a);K(i),fetch("/api/sidebar/group-order",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({order:i})}).catch(()=>{K(r)})},[eg,K]),eH="grouped"===L?(null!=(n=null==eg?void 0:eg.length)?n:0)===0:"sessions"===L?0===ev.length:0===ef.length,eV=v&&0===d.length,eY=!eV&&!!y&&0===d.length,eU=(0,a.useCallback)(()=>{x()},[x]),eq={sessions:(0,r.jsx)("li",{className:"flex min-w-0",children:(0,r.jsx)(eB,{href:"/sessions",icon:p.A,label:O("nav.sessions"),testId:"sidebar-nav-sessions",isActive:F.startsWith("/sessions"),onNavigate:C})}),repositories:(0,r.jsxs)("li",{className:"flex min-w-0 items-center gap-1",children:[(0,r.jsx)(eB,{href:"/repositories",icon:b.A,label:O("nav.repositories"),testId:"sidebar-nav-repositories",isActive:F.startsWith("/repositories"),onNavigate:C}),(0,r.jsx)(eW,{refreshWorktrees:x})]}),review:(0,r.jsx)("li",{className:"flex min-w-0",children:(0,r.jsx)(eB,{href:z>0?I.ks:"/review",icon:g.A,label:O("nav.review"),testId:"sidebar-nav-review",isActive:F.startsWith("/review"),onNavigate:C,trailing:z>0?(0,r.jsx)("span",{"data-testid":"sidebar-nav-review-count",role:"status","aria-label":O("attention.badgeLabel",{count:z}),className:"flex-shrink-0 rounded-full bg-warning-subtle px-1.5 text-xs font-semibold leading-5 tabular-nums text-warning-foreground",children:z>99?"99+":z}):null})})};return(0,r.jsx)(N.Fy.Provider,{value:!W,children:(0,r.jsxs)("nav",{"data-testid":"sidebar","aria-label":O("sidebar.branchNavigation"),className:"h-full flex flex-col bg-sidebar text-sidebar-foreground",role:"navigation",children:[(0,r.jsx)(ew,{drawer:W}),(0,r.jsx)("div",{"data-testid":"sidebar-header",className:"flex-shrink-0 space-y-2 border-b border-sidebar-border px-2 py-2",children:(0,r.jsx)("ul",{"data-testid":"sidebar-nav",className:"space-y-0.5",children:P.go.map(e=>(0,r.jsx)(a.Fragment,{children:eq[e]},e))})}),(0,r.jsx)(A,{worktrees:Z,visibleWorktreeIds:$,selectedWorktreeId:D,onSelect:eO,onNavigate:C}),(0,r.jsx)(V,{searchQuery:_,onSearchChange:H,viewMode:L,onViewModeChange:R}),(0,r.jsx)("div",{ref:Y,"data-testid":"branch-list",onScroll:ek,onMouseEnter:eh,onMouseLeave:ex,className:"flex-1 overflow-y-auto overflow-x-hidden",children:eV?(0,r.jsx)(eE,{label:O("sidebar.loadingBranches")}):eY?(0,r.jsxs)("div",{"data-testid":"branch-list-error",role:"alert",className:"px-4 py-8 text-center text-sidebar-muted",children:[(0,r.jsx)("p",{className:"text-sm",children:O("sidebar.branchesLoadFailed")}),(0,r.jsx)(E.$n,{type:"button",variant:"secondary",size:"sm",className:"mt-3","data-testid":"branch-list-retry",onClick:eU,children:O("sidebar.retryLoadBranches")})]}):eH?(0,r.jsx)("div",{className:"px-4 py-8 text-center text-sidebar-muted",children:O(_?"sidebar.noBranchesFound":"sidebar.noBranchesAvailable")}):"sessions"===L?ev.map(e=>(0,r.jsx)(eK,{row:e,isSelected:e.worktreeId===D,onClick:eF},e.key)):"grouped"===L&&eg?(0,r.jsx)(w.Mp,{sensors:eD,collisionDetection:w.fp,onDragEnd:e_,children:(0,r.jsx)(j.gB,{items:eg.map(e=>e.repositoryName),strategy:j._G,children:eg.map(e=>{let t=!U[e.repositoryName]||!!_.trim();return(0,r.jsx)(eL,{group:e,isExpanded:t,selectedWorktreeId:D,onToggle:()=>ej(e.repositoryName),onBranchClick:eO,isDragDisabled:!!_.trim(),isFiltering:!!_.trim(),liveBranchById:ee,stickyShownIds:eu},e.repositoryName)})})}):ef.map(e=>(0,r.jsx)(N.yP,{branch:e,isSelected:e.id===D,onClick:()=>eO(e.id)},e.id))}),(0,r.jsx)("div",{"data-testid":"sidebar-footer",className:"flex-shrink-0 px-4 py-3 border-t border-sidebar-border",children:(0,r.jsx)(ez,{onNavigate:C})})]})})}),eE=(0,a.memo)(function(e){let{label:t}=e;return(0,r.jsxs)("div",{"data-testid":"branch-list-skeleton",role:"status","aria-live":"polite",className:"px-4 py-3 space-y-3",children:[(0,r.jsx)("span",{className:"sr-only",children:t}),[0,1,2,3,4].map(e=>(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(E.EA,{className:"h-2 w-2 rounded-full"}),(0,r.jsx)(E.EA,{className:"h-3 flex-1"})]},e))]})});function eL(e){let{group:t,isExpanded:n,selectedWorktreeId:s,onToggle:a,onBranchClick:i,isDragDisabled:l,isFiltering:o,liveBranchById:d,stickyShownIds:c}=e,{attributes:u,listeners:m,setNodeRef:h,setActivatorNodeRef:x,transform:f,transition:p,isDragging:b}=(0,j.gl)({id:t.repositoryName,disabled:l}),g={transform:y.Ks.Transform.toString(f),transition:p,opacity:b?.5:1},{shown:v,other:w}=(0,P.FS)(t.branches,s,d,null!=c?c:void 0);return(0,r.jsxs)("div",{ref:h,style:g,className:"w-full min-w-0 pt-2",children:[(0,r.jsx)(eP,{repositoryName:t.repositoryName,branchCount:t.branches.length,isExpanded:n,onClick:a,dragHandleRef:x,dragHandleListeners:l?void 0:m,dragHandleAttributes:l?void 0:u}),n&&v.map(e=>(0,r.jsx)(N.yP,{branch:e,isSelected:e.id===s,onClick:()=>i(e.id),showRepositoryName:!1},e.id)),n&&w.length>0&&(0,r.jsx)(M,{branches:w,selectedWorktreeId:s,onBranchClick:i,forceExpanded:o})]})}let eR=new Set(["__proto__","constructor","prototype"]);function eP(e){let{repositoryName:t,branchCount:n,isExpanded:s,onClick:a,dragHandleRef:i,dragHandleListeners:l,dragHandleAttributes:o}=e,d=(0,f.c)("common");return(0,r.jsxs)("div",{className:"group/header flex items-center w-full",children:[l&&(0,r.jsx)("div",{ref:i,...l,...o,"data-testid":"group-drag-handle","aria-label":d("sidebar.dragToReorderGroup"),className:" flex-shrink-0 flex items-center justify-center w-6 h-full pl-2 cursor-grab active:cursor-grabbing text-sidebar-muted hover:text-sidebar-foreground transition-[color,opacity] opacity-0 group-hover/header:opacity-100 group-focus-within/header:opacity-100 [@media(hover:none)]:opacity-100 rounded focus:outline-none focus-visible:ring-2 focus-visible:ring-ring ",children:(0,r.jsx)(eF,{})}),(0,r.jsxs)("button",{"data-testid":"group-header",type:"button",onClick:a,"aria-expanded":s,className:" flex-1 min-w-0 flex items-center gap-2 px-2 py-1 text-xs font-normal text-sidebar-muted focus:outline-none focus:ring-2 focus:ring-inset focus:ring-ring transition-colors ",children:[(0,r.jsx)(eO,{isExpanded:s}),(0,r.jsx)(E.nF,{color:(0,P.LV)(t)}),(0,r.jsx)(U.nR,{content:t,className:"flex-1 min-w-0 text-left truncate",children:t}),(0,r.jsx)("span",{className:"text-sidebar-muted font-normal tabular-nums pr-2",children:n})]})]})}function eB(e){let{href:t,icon:n,label:s,testId:a,isActive:i,onNavigate:l,trailing:o}=e;return(0,r.jsxs)(x,{href:t,"data-testid":a,"aria-current":i?"page":void 0,onClick:l,className:"flex min-w-0 flex-1 items-center gap-2 rounded-md px-2 py-1.5 text-sm transition-colors hover:bg-sidebar-hover hover:text-sidebar-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-ring ".concat(i?"bg-sidebar-hover font-medium text-sidebar-foreground":"text-sidebar-muted"),children:[(0,r.jsx)(n,{className:"h-4 w-4 flex-shrink-0","aria-hidden":"true"}),(0,r.jsx)("span",{className:"min-w-0 flex-1 truncate",children:s}),o]})}let eK=(0,a.memo)(function(e){let{row:t,isSelected:n,onClick:s}=e,a=(0,f.c)("common"),i=(0,C.Mq)(t.status,t.unclassified),l=a(i?C.rH:"status.".concat(t.status));return(0,r.jsx)("div",{className:"w-full min-w-0 ".concat(N.R8),children:(0,r.jsxs)("button",{type:"button","data-testid":"session-list-item","data-session-key":t.key,onClick:()=>s(t),"aria-current":n?"true":void 0,className:"w-full min-w-0 min-h-[34px] px-3 py-1.5 flex items-center gap-2 text-left ".concat((0,N.Xd)(n)),children:[(0,r.jsx)(E.md,{status:t.status,size:"sm",label:t.exited?"".concat(l," (").concat(a("branchItem.agentExited"),")"):l,className:i?C.Jd:void 0}),(0,r.jsx)("span",{className:"flex-shrink-0 max-w-[45%] truncate text-sm font-semibold text-sidebar-foreground",children:t.label}),(0,r.jsxs)("span",{className:"min-w-0 flex-1 truncate text-xs text-sidebar-muted",children:[t.branchName," \xb7 ",t.repositoryName]})]})})});function eO(e){let{isExpanded:t}=e;return(0,r.jsx)("svg",{className:"w-3 h-3 flex-shrink-0 transition-transform ".concat(t?"rotate-90":""),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})})}function eF(){return(0,r.jsxs)("svg",{className:"w-3 h-3",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,r.jsx)("circle",{cx:"9",cy:"5",r:"1.5"}),(0,r.jsx)("circle",{cx:"15",cy:"5",r:"1.5"}),(0,r.jsx)("circle",{cx:"9",cy:"12",r:"1.5"}),(0,r.jsx)("circle",{cx:"15",cy:"12",r:"1.5"}),(0,r.jsx)("circle",{cx:"9",cy:"19",r:"1.5"}),(0,r.jsx)("circle",{cx:"15",cy:"19",r:"1.5"})]})}function eD(e){let{className:t=""}=e;return(0,r.jsx)("svg",{className:"".concat("w-4 h-4"," ").concat(t),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 4v5h5M20 20v-5h-5M20.49 9A9 9 0 005.64 5.64L4 4m16 16l-1.64-1.64A9 9 0 014.51 15"})})}let eW=(0,a.memo)(function(e){let{refreshWorktrees:t}=e,[n,s]=(0,a.useState)(!1),i=(0,a.useRef)(!1),{showToast:l}=(0,ej.dj)(),o=(0,f.c)("common"),d=(0,a.useCallback)(async()=>{if(!i.current){i.current=!0,s(!0);try{let e=await ek.Rx.sync();await t(),l(o("syncSuccess",{count:e.worktreeCount}),"success",3e3)}catch(e){e instanceof ek.hD&&401===e.status?l(o("syncAuthError"),"error",5e3):l(o("syncError"),"error",5e3)}finally{i.current=!1,s(!1)}}},[t,l,o]);return(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(Y.m_,{content:o("tooltips.sync"),placement:"bottom",children:(0,r.jsx)("button",{type:"button",onClick:d,disabled:n,"aria-label":o("syncButtonLabel"),className:"p-1 rounded-md text-sidebar-muted hover:text-sidebar-foreground hover:bg-sidebar-hover focus:outline-none focus:ring-2 focus:ring-ring disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:(0,r.jsx)(eD,{className:n?"animate-spin":""})})})})});function ez(e){let{onNavigate:t}=e,n=(0,f.c)("common")("settings.title");return(0,r.jsx)(en,{testIdPrefix:"sidebar-settings-menu",side:"top",align:"start",showDisplayPreferences:!0,onNavigate:t,children:(0,r.jsx)(ee,{asChild:!0,children:(0,r.jsxs)("button",{type:"button","data-testid":"sidebar-settings-menu",className:"flex w-full items-center gap-2 px-2 py-1.5 rounded-md text-sm text-sidebar-muted hover:text-sidebar-foreground hover:bg-sidebar-hover focus:outline-none focus:ring-2 focus:ring-ring transition-colors",children:[(0,r.jsx)(v.A,{size:20,"aria-hidden":"true"}),(0,r.jsx)("span",{className:"truncate",children:n})]})})})}var e_=n(52407);function eH(){let{shouldSurface:e,isReconnecting:t}=(0,e_.Fx)(),n=(0,f.c)("common");if(!e)return null;let s=n(t?"connection.reconnecting":"connection.offline");return(0,r.jsxs)("span",{"data-testid":"connection-status-indicator","data-connection-state":t?"reconnecting":"offline",role:"status","aria-live":"polite",title:n(t?"connection.reconnectingTooltip":"connection.offlineTooltip"),className:"hidden sm:inline-flex items-center gap-1.5 rounded-full border border-border bg-surface px-2 py-0.5 text-xs text-muted-foreground",children:[(0,r.jsx)("span",{"aria-hidden":"true",className:["w-1.5 h-1.5 rounded-full",t?"bg-warning motion-safe:animate-pulse":"bg-muted-foreground"].join(" ")}),s]})}var eV=n(72137);let eY=[{prefix:"/sessions",labelKey:"nav.sessions"},{prefix:"/repositories",labelKey:"nav.repositories"},{prefix:"/review",labelKey:"nav.review"},{prefix:"/skills",labelKey:"nav.skills"},{prefix:"/more",labelKey:"nav.more"}];function eU(e){var t,n,a,i;let{title:l="CommandMate"}=e,o=null!==(n=null!=(t=(0,s.usePathname)())?t:"",null!=(i=null==(a=eY.find(e=>n.startsWith(e.prefix)))?void 0:a.labelKey)?i:null);return(0,r.jsxs)("header",{"data-testid":"screen-status-row",className:"flex flex-shrink-0 items-center justify-end gap-4 px-4 py-1.5 border-b border-border bg-background supports-[backdrop-filter]:bg-background/80 backdrop-blur-md empty:hidden",children:[!o&&(0,r.jsx)("h1",{"data-testid":"header-screen-title",className:"mr-auto min-w-0 truncate text-lg font-bold text-foreground",children:l}),(0,r.jsx)(eH,{}),(0,r.jsx)(eV.H,{})]})}function eq(e){let{count:t}=e,n=(0,f.c)("common");return 0===t?null:(0,r.jsx)("span",{"data-testid":"attention-badge-bubble",role:"status","aria-label":n("attention.badgeLabel",{count:t}),className:"absolute -top-1.5 -right-2.5 min-w-[1.05rem] rounded-full bg-warning-foreground px-1 text-[0.625rem] font-bold leading-[1.05rem] text-warning-subtle tabular-nums text-center",children:t>99?"99+":t})}let eG="relative flex h-10 w-10 items-center justify-center rounded-md transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",eX="text-sidebar-muted hover:bg-sidebar-hover hover:text-sidebar-foreground";function eJ(e){let{href:t,icon:n,label:s,testId:a,isActive:i,badge:l}=e;return(0,r.jsx)(Y.m_,{content:s,placement:"right",children:(0,r.jsx)(x,{href:t,"data-testid":a,"aria-label":s,"aria-current":i?"page":void 0,className:"".concat(eG," ").concat(i?"bg-sidebar-hover text-sidebar-foreground":eX),children:(0,r.jsxs)("span",{className:"relative flex",children:[(0,r.jsx)(n,{size:20,"aria-hidden":"true"}),l]})})})}function eZ(e){let{icon:t,label:n,testId:s,onClick:a,hasPopup:i}=e;return(0,r.jsx)(Y.m_,{content:n,placement:"right",children:(0,r.jsx)("button",{type:"button","data-testid":s,"aria-label":n,"aria-haspopup":i,onClick:a,className:"".concat(eG," ").concat(eX),children:(0,r.jsx)(t,{size:20,"aria-hidden":"true"})})})}function e$(){var e;let t=(0,f.c)("common"),n=(0,f.c)("commandPalette"),i=null!=(e=(0,s.usePathname)())?e:"",{setOpen:l}=(0,el.C)(),{openNewTask:o}=(0,eo.hX)(),{count:d}=(0,ey.Lv)(),c=t("settings.title"),u={sessions:(0,r.jsx)(eJ,{href:"/sessions",icon:p.A,label:t("nav.sessions"),testId:"sidebar-rail-sessions",isActive:i.startsWith("/sessions")}),repositories:(0,r.jsx)(eJ,{href:"/repositories",icon:b.A,label:t("nav.repositories"),testId:"sidebar-rail-repositories",isActive:i.startsWith("/repositories")}),review:(0,r.jsx)(eJ,{href:d>0?I.ks:"/review",icon:g.A,label:t("nav.review"),testId:"sidebar-rail-review",isActive:i.startsWith("/review"),badge:(0,r.jsx)(eq,{count:d})})};return(0,r.jsxs)("nav",{"data-testid":"sidebar-rail","aria-label":t("sidebar.railLabel"),className:"flex h-full flex-col items-center gap-1 bg-sidebar pb-2 text-sidebar-foreground",style:{width:"".concat(P.BN,"px")},children:[(0,r.jsx)(eg,{testId:"sidebar-rail-toggle"}),(0,r.jsx)(eZ,{icon:es.A,label:t("newTask.title"),testId:"sidebar-rail-new-task",onClick:()=>o(),hasPopup:"dialog"}),(0,r.jsx)(eZ,{icon:ea.A,label:n("mobileTrigger"),testId:"sidebar-rail-search",onClick:()=>l(!0)}),(0,r.jsx)("div",{className:"my-1 w-8 border-b border-sidebar-border","aria-hidden":"true"}),P.go.map(e=>(0,r.jsx)(a.Fragment,{children:u[e]},e)),(0,r.jsx)("div",{className:"mt-auto",children:(0,r.jsx)(en,{testIdPrefix:"sidebar-rail-settings",side:"right",align:"end",showDisplayPreferences:!0,children:(0,r.jsx)(Y.m_,{content:c,placement:"right",children:(0,r.jsx)(ee,{asChild:!0,children:(0,r.jsx)("button",{type:"button","data-testid":"sidebar-rail-settings","aria-label":c,className:"".concat(eG," ").concat(eX),children:(0,r.jsx)(v.A,{size:20,"aria-hidden":"true"})})})})})})]})}var eQ=n(46365),e0=n(12906),e1=n(37772),e2=n(9540),e5=n(55756);let e4=[{labelKey:"nav.sessions",href:"/sessions",isActive:e=>e.startsWith("/sessions"),icon:(0,r.jsx)(p.A,{size:20,"aria-hidden":"true"})},{labelKey:"nav.review",href:"/review",isActive:e=>e.startsWith("/review"),icon:(0,r.jsx)(g.A,{size:20,"aria-hidden":"true"}),showsAttentionBadge:!0},{labelKey:"nav.more",href:"/more",isActive:e=>e.startsWith("/more"),icon:(0,r.jsx)(e1.A,{size:20,"aria-hidden":"true"})}];function e3(){let e=(0,s.usePathname)(),{setOpen:t}=(0,el.C)(),n=(0,f.c)("commandPalette"),a=(0,f.c)("common"),{count:l}=(0,ey.Lv)(),o=(0,i.pT)();return(null==o?void 0:o.isMobileDrawerOpen)?null:(0,r.jsx)("nav",{"data-testid":"global-mobile-nav",className:"fixed bottom-0 left-0 right-0 z-50 border-t border-border bg-background supports-[backdrop-filter]:bg-background/80 backdrop-blur-md pb-safe",children:(0,r.jsxs)("div",{className:"flex items-center justify-around h-14",children:[o&&(0,r.jsxs)("button",{type:"button","data-testid":"mobile-nav-open-sidebar",...e5.cv,onClick:o.openMobileDrawer,className:"flex flex-col items-center justify-center flex-1 h-full text-xs text-muted-foreground hover:text-foreground transition-colors",children:[(0,r.jsx)(e2.A,{size:20,"aria-hidden":"true"}),(0,r.jsx)("span",{className:"mt-1 whitespace-nowrap",children:a("sidebar.branches")})]}),e4.map(t=>{let n=t.isActive(e),s=!0===t.showsAttentionBadge&&l>0;return(0,r.jsxs)(x,{href:s?I.ks:t.href,className:"flex flex-col items-center justify-center flex-1 h-full text-xs transition-colors ".concat(n?"text-accent-600 dark:text-accent-400":"text-muted-foreground hover:text-foreground"),children:[(0,r.jsxs)("span",{className:"relative inline-flex",children:[t.icon,!0===t.showsAttentionBadge&&(0,r.jsx)(eq,{count:l})]}),(0,r.jsx)("span",{className:"mt-1 whitespace-nowrap",children:a(t.labelKey)})]},t.href)}),(0,r.jsxs)("button",{type:"button","data-testid":"mobile-command-palette-trigger",onClick:()=>t(!0),"aria-label":n("mobileTrigger"),className:"flex flex-col items-center justify-center flex-1 h-full text-xs text-muted-foreground hover:text-foreground transition-colors",children:[(0,r.jsx)(ea.A,{size:20,"aria-hidden":"true"}),(0,r.jsx)("span",{className:"mt-1 whitespace-nowrap",children:n("mobileLabel")})]})]})})}function e9(){let{shouldSurface:e,isReconnecting:t}=(0,e_.Fx)(),n=(0,f.c)("common");if(!e)return null;let s=n(t?"connection.reconnecting":"connection.offline"),a=n(t?"connection.reconnectingTooltip":"connection.offlineTooltip");return(0,r.jsx)("div",{"data-testid":"mobile-connection-banner","data-connection-state":t?"reconnecting":"offline",role:"status","aria-live":"polite",title:a,className:"shrink-0 pt-safe border-b ".concat(t?"bg-warning-subtle border-warning-border text-warning-foreground":"bg-danger-subtle border-danger-border text-danger-foreground"),children:(0,r.jsxs)("div",{className:"flex items-center justify-center gap-1.5 px-3 py-1 text-xs",children:[(0,r.jsx)("span",{"aria-hidden":"true",className:"w-1.5 h-1.5 rounded-full ".concat(t?"bg-warning motion-safe:animate-pulse":"bg-danger")}),s]})})}var e6=n(45573),e7=n(94465),e8=n(70628);function te(e){return!0===e.isComposing||229===e.keyCode}let tt=[...ec,{id:"newTask",keys:["MOD","Shift","O"],scope:"global"},{id:"newTaskSend",keys:["MOD","↵"],scope:"global"}];function tn(){let{open:e,setOpen:t}=(0,e8.K)(),{open:n}=(0,el.C)(),{isOpen:s}=(0,eo.hX)(),i=(0,f.c)("keyboardShortcuts"),[l,o]=(0,a.useState)(!1);(0,a.useEffect)(()=>o(eu()),[]);let d=(0,a.useRef)(e);(0,a.useEffect)(()=>{d.current=e},[e]);let c=(0,a.useRef)(n);(0,a.useEffect)(()=>{c.current=n},[n]);let u=(0,a.useRef)(s);(0,a.useEffect)(()=>{u.current=s},[s]),(0,a.useEffect)(()=>{function e(e){"?"!==e.key||e.isComposing||229===e.keyCode||(0,e6.tJ)(e.target)||c.current||u.current||d.current||(e.preventDefault(),t(!0))}return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[t]);let m=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ec;return ed.map(t=>({scope:t,shortcuts:e.filter(e=>e.scope===t)})).filter(e=>e.shortcuts.length>0)}(tt);return(0,r.jsx)(e7.a,{isOpen:e,onClose:()=>t(!1),title:i("title"),size:"md",children:(0,r.jsx)("div",{"data-testid":"keyboard-shortcuts-overlay",className:"space-y-6",children:m.map(e=>{let{scope:t,shortcuts:n}=e;return(0,r.jsxs)("section",{"data-testid":"keyboard-shortcuts-scope-".concat(t),children:[(0,r.jsx)("h4",{className:"mb-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:i("scopes.".concat(t))}),(0,r.jsx)("ul",{className:"divide-y divide-border",children:n.map(e=>(0,r.jsxs)("li",{"data-testid":"keyboard-shortcut-".concat(e.id),className:"flex items-center justify-between gap-4 py-2",children:[(0,r.jsx)("span",{className:"text-sm text-foreground",children:i("shortcuts.".concat(e.id))}),(0,r.jsx)("span",{className:"flex flex-shrink-0 items-center gap-1",children:e.keys.map((e,t)=>(0,r.jsx)(ei.u,{children:em(e,l)},t))})]},e.id))})]},t)})})})}var tr=n(77016),ts=n(36809),ta=n(31166);let ti=/^v?\d+\.\d+\.\d+$/;function tl(e){return e.replace(/^v/,"").split(".").map(Number)}let to="commandmate.lastSeenAppVersion";function td(e){try{window.localStorage.setItem(to,e)}catch(e){}}let tc=[{key:"added",labelKey:"whatsNew.added"},{key:"improved",labelKey:"whatsNew.improved"},{key:"fixed",labelKey:"whatsNew.fixed"}];function tu(){let e=(0,f.c)("common"),t=(0,ts.Ym)(),[n,s]=(0,a.useState)(null),[i,l]=(0,a.useState)(!1);(0,a.useEffect)(()=>{let e,t="0.49.1";try{e=window.localStorage.getItem(to)}catch(e){return}let n=function(e,t){if(!ti.test(t))return{kind:"none"};if(null===e||!ti.test(e))return{kind:"remember"};let n=function(e,t){let n=tl(e),r=tl(t),s=Math.max(n.length,r.length);for(let e=0;e<s;e++){let t=n[e]||0,s=r[e]||0;if(t>s)return 1;if(t<s)return -1}return 0}(t,e);return 0===n?{kind:"none"}:n<0?{kind:"remember"}:{kind:"show",from:e}}(e,t);if("none"===n.kind)return;if("remember"===n.kind)return void td(t);let r=!1;return ek.GQ.getReleaseNotes(n.from,t).then(e=>{r||(s({from:n.from,to:t,notes:e.notes}),l(!0))},()=>{}),()=>{r=!0}},[]);let o=(0,a.useCallback)(()=>{n&&td(n.to),l(!1)},[n]);if(!n)return null;let d="ja"===t?"ja":"en";return(0,r.jsx)(e7.a,{isOpen:i,onClose:o,title:e("whatsNew.title",{from:n.from,to:n.to}),size:"md",children:(0,r.jsxs)("div",{className:"space-y-4","data-testid":"whats-new-dialog",children:[0===n.notes.length?(0,r.jsx)("p",{className:"text-sm text-foreground","data-testid":"whats-new-empty",children:e("whatsNew.empty")}):n.notes.map(t=>(0,r.jsxs)("section",{className:"space-y-3","data-testid":"whats-new-version-".concat(t.version),children:[(0,r.jsxs)("h4",{className:"text-sm font-semibold text-foreground",children:["v",t.version,(0,r.jsx)("span",{className:"ml-2 text-xs font-normal text-muted-foreground",children:t.date})]}),t.highlight&&(0,r.jsxs)("div",{"data-testid":"whats-new-highlight",children:[(0,r.jsx)("h5",{className:"text-xs font-medium text-muted-foreground",children:e("whatsNew.highlight")}),(0,r.jsx)("p",{className:"mt-1 text-sm text-foreground",children:t.highlight[d]})]}),tc.map(n=>{let{key:s,labelKey:a}=n;return t[s].length>0?(0,r.jsxs)("div",{"data-testid":"whats-new-".concat(s),children:[(0,r.jsx)("h5",{className:"text-xs font-medium text-muted-foreground",children:e(a)}),(0,r.jsx)("ul",{className:"mt-1 list-disc space-y-1 pl-5 text-sm text-foreground",children:t[s].map((e,t)=>(0,r.jsx)("li",{children:e[d]},t))})]},s):null})]},t.version)),(0,r.jsxs)("div",{className:"flex items-center justify-between gap-3 border-t border-border pt-3",children:[(0,r.jsx)("a",{href:"".concat("https://github.com/Kewton/CommandMate/releases/tag/v").concat(n.to),target:"_blank",rel:"noopener noreferrer",className:"text-sm text-accent-600 dark:text-accent-400 hover:underline","data-testid":"whats-new-release-link",children:e("whatsNew.releaseLink")}),(0,r.jsx)(ta.$,{type:"button",variant:"primary",size:"sm",onClick:o,"data-testid":"whats-new-close",children:e("whatsNew.close")})]})]})})}var tm=n(34325);let th="commandmate.newTask.recentTargets";function tx(e){if(null===e||"object"!=typeof e)return!1;let{worktreeId:t,instanceId:n}=e;return"string"==typeof t&&""!==t&&"string"==typeof n&&""!==n}function tf(e,t){return e.worktreeId===t.worktreeId&&e.instanceId===t.instanceId}function tp(){try{let e=window.localStorage.getItem(th);if(!e)return[];let t=JSON.parse(e);if(!Array.isArray(t))return[];return t.filter(tx).map(e=>{let{worktreeId:t,instanceId:n}=e;return{worktreeId:t,instanceId:n}}).slice(0,3)}catch(e){return[]}}function tb(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=new Map;for(let r of e){let e=n.get(r.repositoryPath);if(!e){let s=t.find(e=>e.path===r.repositoryPath);e={path:r.repositoryPath,name:(null==s?void 0:s.displayName)||(null==s?void 0:s.name)||r.repositoryName,worktrees:[]},n.set(r.repositoryPath,e)}e.worktrees.push(r)}let r=Array.from(n.values());for(let e of r)e.worktrees.sort((e,t)=>e.name.localeCompare(t.name));return r.sort((e,t)=>e.name.localeCompare(t.name))}function tg(e){return e.agentInstances&&e.agentInstances.length>0?e.agentInstances.slice().sort((e,t)=>e.order-t.order):e.selectedAgents&&e.selectedAgents.length>0?(0,eN.lu)(e.selectedAgents):e.cliToolId?(0,eN.lu)([e.cliToolId]):[]}function tv(e,t){let n=e.find(e=>e.id===t.worktreeId);if(!n)return null;let r=tg(n).find(e=>e.id===t.instanceId);return r?{worktree:n,instance:r}:null}function tw(e,t){var n,r,s,a;let i=null!=(a=null==(n=e.sessionStatusByInstance)?void 0:n[t.id])?a:t.id===t.cliTool?null==(r=e.sessionStatusByCli)?void 0:r[t.cliTool]:void 0,l=null==i?void 0:i.startingSince,o=null==(s=e.autoYesByInstance)?void 0:s[t.id];return{instance:t,label:(0,eN.sw)(t),running:(null==i?void 0:i.isRunning)===!0,starting:"number"==typeof l,autoYes:(null==o?void 0:o.enabled)&&"number"==typeof o.expiresAt?o:null}}var tj=n(56936),ty=n(14524);let tk={promptWaiting:"PROMPT_WAITING",sessionStarting:"SESSION_STARTING",instanceToolConflict:"instance_tool_conflict"};async function tN(e){try{let t=await e.json(),n=t&&"object"==typeof t?t.expiresAt:null;if("number"==typeof n)return{enabled:!0,expiresAt:n}}catch(e){}return null}async function tC(e){try{let t=await e.json();if(t&&"object"==typeof t){let{error:e,code:n}=t;return{error:"string"==typeof e&&""!==e?e:null,code:"string"==typeof n?n:null}}}catch(e){}return{error:null,code:null}}async function tS(e,t){let{modelRequested:n}=t;if(e.ok&&!e.redirected)return{ok:!0};let{status:r}=e,{error:s,code:a}=await tC(e);return{ok:!1,kind:409===r?a===tk.promptWaiting?"prompt_waiting":"conflict":503===r?a===tk.sessionStarting?"starting":"start_failed":400===r?n&&a!==tk.instanceToolConflict?"model_rejected":"invalid":"failed",status:e.ok?0:r,detail:s}}function tI(e){return{ok:!1,kind:"failed",status:0,detail:e instanceof ek.hD||e instanceof Error?e.message:null}}function tT(e,t){return new Promise((n,r)=>{let s=setTimeout(()=>{r(new ek.hD("Request timed out after ".concat(t,"ms"),0,void 0,"timeout"))},t);e().then(e=>{clearTimeout(s),n(e)},e=>{clearTimeout(s),r(e)})})}async function tA(e){var t;let n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ek.E,{target:s,cliToolId:a}=e,i="/api/worktrees/".concat(encodeURIComponent(s.worktreeId)),l={"Content-Type":"application/json"},o=!1,d=e.autoYesDuration;if(null!==d){let t,c=!1;try{t=await tT(async()=>{var t,u;let m=await r("".concat(i,"/auto-yes"),{method:"POST",headers:l,body:JSON.stringify({enabled:!0,cliToolId:a,instanceId:s.instanceId,duration:d,answerMode:null!=(t=e.autoYesAnswerMode)?t:ty.Rb})});if(!m.ok){let{error:e}=await tC(m);return{ok:!1,kind:"auto_yes_failed",status:m.status,detail:e}}return c=!0,n=null!=(u=await tN(m))?u:void 0,o=void 0===n,null},(0,tj.Z3)("POST"))}catch(e){if(!c){let t=tI(e);return t.ok?t:{...t,kind:"auto_yes_failed"}}return{...tI(e),autoYesStateUnknown:!0}}if(t)return t}let c=e=>n?{...e,armedAutoYes:n}:o?{...e,autoYesStateUnknown:!0}:e,u=(null==(t=e.model)?void 0:t.trim())||void 0,m=(0,tj.SE)();try{return c(await tT(async()=>{let t=await r("".concat(i,"/send"),{method:"POST",headers:l,body:JSON.stringify({content:e.content,cliToolId:a,instanceId:s.instanceId,...u?{model:u}:{}}),timeoutMs:m});return tS(t,{modelRequested:void 0!==u})},m))}catch(e){return c(tI(e))}}var tM=n(86068);let tE="w-full px-3 py-2 border border-input rounded-lg bg-surface text-foreground text-sm focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent disabled:opacity-60",tL="block text-xs font-medium text-muted-foreground mb-1";function tR(e){let{status:t,isEmpty:n,onRetry:s}=e,a=(0,f.c)("common");return(0,r.jsxs)(r.Fragment,{children:["loading"===t&&(0,r.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"new-task-loading",children:a("newTask.loading")}),"error"===t&&(0,r.jsxs)("div",{className:"space-y-2",role:"alert","data-testid":"new-task-load-error",children:[(0,r.jsx)("p",{className:"text-sm text-danger",children:a("newTask.loadError")}),(0,r.jsx)("button",{type:"button",onClick:s,className:"px-3 py-1.5 text-sm font-medium text-foreground bg-muted hover:bg-muted/80 rounded-lg",children:a("retry")})]}),"ready"===t&&n&&(0,r.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"new-task-empty",children:a("newTask.noTargets")})]})}function tP(e){let{recentOptions:t,targetState:n,worktreeId:s,onSelect:a}=e,i=(0,f.c)("common");return 0===t.length?null:(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:tL,children:i("newTask.recentLabel")}),(0,r.jsx)("div",{className:"flex flex-wrap gap-2","data-testid":"new-task-recents",children:t.map(e=>{let{target:t,label:i}=e,l=!!n&&tf(t,{worktreeId:s,instanceId:n.instance.id});return(0,r.jsx)("button",{type:"button","aria-pressed":l,"data-testid":"new-task-recent",onClick:()=>a(t),className:"max-w-full truncate rounded-full border px-3 py-1 text-xs transition-colors ".concat(l?"border-accent-500 bg-accent-500/15 text-foreground":"border-border text-muted-foreground hover:text-foreground"),children:i},"".concat(t.worktreeId,":").concat(t.instanceId))})})]})}function tB(e){var t,n,s;let{repositoryOptions:a,repository:i,worktreeId:l,worktree:o,instances:d,instance:c,onRepositoryChange:u,onBranchChange:m,onAgentChange:h}=e,x=(0,f.c)("common");return(0,r.jsxs)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-3",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{htmlFor:"new-task-repository",className:tL,children:x("newTask.repositoryLabel")}),(0,r.jsx)("select",{id:"new-task-repository","data-testid":"new-task-repository",value:null!=(t=null==i?void 0:i.path)?t:"",onChange:e=>u(e.target.value),className:tE,children:a.map(e=>(0,r.jsx)("option",{value:e.path,children:e.name},e.path))})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{htmlFor:"new-task-branch",className:tL,children:x("newTask.branchLabel")}),(0,r.jsx)("select",{id:"new-task-branch","data-testid":"new-task-branch",value:l,onChange:e=>m(e.target.value),className:tE,children:(null!=(n=null==i?void 0:i.worktrees)?n:[]).map(e=>(0,r.jsx)("option",{value:e.id,children:e.name},e.id))})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{htmlFor:"new-task-agent",className:tL,children:x("newTask.agentLabel")}),(0,r.jsx)("select",{id:"new-task-agent","data-testid":"new-task-agent",value:null!=(s=null==c?void 0:c.id)?s:"",onChange:e=>h(e.target.value),className:tE,disabled:0===d.length,children:d.map(e=>{var t;let n=o?tw(o,e):null,s=(null==n?void 0:n.starting)?"starting":(null==n?void 0:n.running)?"running":"stopped";return(0,r.jsx)("option",{value:e.id,children:"".concat(null!=(t=null==n?void 0:n.label)?t:e.id," — ").concat(x("newTask.agentStatus.".concat(s)))},e.id)})})]})]})}function tK(e){let{statusKey:t,agentLabel:n}=e,s=(0,f.c)("common");return(0,r.jsxs)(r.Fragment,{children:["stopped"===t&&(0,r.jsx)("p",{className:"text-xs text-foreground","data-testid":"new-task-will-start",children:s("newTask.willStart",{agent:n})}),"starting"===t&&(0,r.jsx)("p",{className:"text-xs text-warning-foreground","data-testid":"new-task-starting",children:s("newTask.startingNotice",{agent:n})})]})}function tO(e){let{modelAvailability:t,model:n,cliTool:s,agentLabel:a,onChange:i}=e,l=(0,f.c)("common");return(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{htmlFor:"new-task-model",className:tL,children:l("newTask.modelLabel")}),(0,r.jsx)("input",{id:"new-task-model","data-testid":"new-task-model",type:"text",value:(null==t?void 0:t.selectable)?n:"",onChange:e=>i(e.target.value),placeholder:l("newTask.modelPlaceholder"),disabled:!(null==t?void 0:t.selectable),className:tE}),t&&(0,r.jsx)("p",{className:"mt-1 text-xs text-muted-foreground","data-testid":"new-task-model-note",children:t.selectable?l("copilot"===s?"newTask.modelHintSwitch":"newTask.modelHintLaunch"):l("newTask.modelUnavailable.".concat(t.reason),{agent:a})})]})}function tF(e){let{armedAutoYes:t,autoYesChoice:n,autoYesUnknown:s,onChoiceChange:a,answerMode:i,onAnswerModeChange:l}=e,o=(0,f.c)("common"),d=(0,f.c)("autoYes");return(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{htmlFor:"new-task-auto-yes",className:tL,children:o("newTask.autoYesLabel")}),t?(0,r.jsx)("p",{className:"text-sm text-foreground","data-testid":"new-task-auto-yes-active",children:o("newTask.autoYesActive",{remaining:(0,tm.$B)(t.expiresAt)})}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("select",{id:"new-task-auto-yes","data-testid":"new-task-auto-yes",value:null!=n?n:"",onChange:e=>{let t=Number(e.target.value);a(""!==e.target.value&&(0,tm.dR)(t)?t:null)},className:tE,children:[(0,r.jsx)("option",{value:"",children:o(s?"newTask.autoYesKeepUnknown":"newTask.autoYesKeep")}),tm._q.map(e=>(0,r.jsx)("option",{value:e,children:o("newTask.autoYesEnableFor",{duration:d("durationHours",{hours:(0,tm.nG)(e)})})},e))]}),s&&(0,r.jsx)("p",{className:"mt-1 text-xs text-warning-foreground","data-testid":"new-task-auto-yes-unknown",children:o("newTask.autoYesUnknown")}),(0,r.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:o("newTask.autoYesScope")}),null!==n&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"mt-2",children:(0,r.jsx)(tM.o,{value:i,onChange:l,idPrefix:"new-task-auto-yes-answer-mode",labelClassName:tL})}),(0,r.jsx)("p",{className:"mt-1 text-xs text-warning-foreground","data-testid":"new-task-auto-yes-risk",children:d("riskWarning")})]})]})]})}function tD(e){let{failure:t,agentLabel:n}=e,s=(0,f.c)("common");return t?(0,r.jsxs)("div",{role:"alert","data-testid":"new-task-error","data-kind":t.kind,className:"rounded-lg border border-danger-border bg-danger-subtle px-3 py-2 text-sm text-danger-foreground",children:[(0,r.jsx)("p",{children:s("newTask.errors.".concat(t.kind),{agent:n})}),t.detail&&(0,r.jsx)("p",{className:"mt-1 break-words text-xs text-muted-foreground","data-testid":"new-task-error-detail",children:t.detail})]}):null}function tW(){var e,t,n,i,l,o,d;let{requestedTarget:c,screenTarget:u,closeNewTask:m,setCloseLocked:h}=(0,eo.hX)(),x=(0,s.useRouter)(),{showToast:p}=(0,ej.dj)(),b=(0,f.c)("common"),[g,v]=(0,a.useState)({status:"loading"}),[w,j]=(0,a.useState)(0),[y]=(0,a.useState)(()=>tp()),[k,N]=(0,a.useState)(""),[C,S]=(0,a.useState)(""),[I,T]=(0,a.useState)(""),[A,M]=(0,a.useState)(""),[E,L]=(0,a.useState)(null),[R,B]=(0,a.useState)(ty.Rb),[K,O]=(0,a.useState)(!1),[F,D]=(0,a.useState)(null),[W,z]=(0,a.useState)(!1),_=(0,a.useRef)(null),H=(0,a.useRef)(!0),V=(0,a.useRef)(!1),[Y,U]=(0,a.useState)({}),[q,G]=(0,a.useState)({});(0,a.useEffect)(()=>(H.current=!0,z(eu()),()=>{H.current=!1,h(!1)}),[h]);let X=(0,a.useCallback)(()=>{V.current||m()},[m]),J=(0,a.useRef)([c,u,null!=(e=y[0])?e:null]),Z=(0,a.useRef)(!1);(0,a.useEffect)(()=>{let e=!1;return v({status:"loading"}),ek.y.getAll().then(t=>{var n,r;if(e)return;let s=null!=(n=t.worktrees)?n:[],a=null!=(r=t.repositories)?r:[];if(v({status:"ready",worktrees:s,repositories:a}),Z.current)return;Z.current=!0;let i=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];for(let n of t){if(!n)continue;if(tv(e,n))return n;let t=e.find(e=>e.id===n.worktreeId),r=t?tg(t)[0]:void 0;if(t&&r)return{worktreeId:t.id,instanceId:r.id}}for(let t of tb(e,n))for(let e of t.worktrees){let t=tg(e)[0];if(t)return{worktreeId:e.id,instanceId:t.id}}return null}(s,J.current,a);i&&(N(i.worktreeId),S(i.instanceId))}).catch(()=>{e||v({status:"error"})}),()=>{e=!0}},[w]);let $=(0,a.useMemo)(()=>"ready"===g.status?g.worktrees:[],[g]),Q=(0,a.useMemo)(()=>"ready"===g.status?tb(g.worktrees,g.repositories):[],[g]),ee=null!=(t=$.find(e=>e.id===k))?t:null,et=(0,a.useMemo)(()=>ee?tg(ee):[],[ee]),en=null!=(n=et.find(e=>e.id===C))?n:null,er=ee&&en?tw(ee,en):null,es=ee&&null!=(i=Q.find(e=>e.path===ee.repositoryPath))?i:null,ea=er?(d=er.instance.cliTool,"copilot"===d?{selectable:!0}:"claude"===d||"antigravity"===d?er.running||er.starting?{selectable:!1,reason:"running"}:{selectable:!0}:{selectable:!1,reason:"unsupported"}):null,el=er?null!=(l=q["".concat(k,":").concat(er.instance.id)])?l:er.autoYes:null,ed=!function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now();return!!e&&e.enabled&&"number"==typeof e.expiresAt&&e.expiresAt-t>0}(el)?null:el,ec=!!er&&!0===Y["".concat(k,":").concat(er.instance.id)],[,eh]=(0,a.useState)(0);(0,a.useEffect)(()=>{if(!ed)return;let e=setInterval(()=>eh(Date.now()),tm.$s);return()=>clearInterval(e)},[ed]),(0,a.useEffect)(()=>{var e;"ready"===g.status&&(null==(e=_.current)||e.focus())},[g.status]);let ex=(0,a.useMemo)(()=>y.flatMap(e=>{var t;let n=tv($,e);if(!n)return[];let r=Q.find(e=>e.path===n.worktree.repositoryPath),s=tw(n.worktree,n.instance).label;return[{target:e,label:"".concat(null!=(t=null==r?void 0:r.name)?t:n.worktree.repositoryName," / ").concat(n.worktree.name," / ").concat(s)}]}),[y,$,Q]),ef=(0,a.useCallback)(e=>{N(e.worktreeId),S(e.instanceId),D(null)},[]),ep=(0,a.useCallback)(e=>{var t,n,r;let s=Q.find(t=>t.path===e),a=null!=(n=null==s?void 0:s.worktrees.find(e=>tg(e).length>0))?n:null==s?void 0:s.worktrees[0];a&&ef({worktreeId:a.id,instanceId:null!=(r=null==(t=tg(a)[0])?void 0:t.id)?r:""})},[Q,ef]),eb=(0,a.useCallback)(e=>{var t,n,r;let s=$.find(t=>t.id===e);if(!s)return;let a=tg(s),i=a.find(e=>e.id===C);ef({worktreeId:s.id,instanceId:null!=(r=null!=(n=null==i?void 0:i.id)?n:null==(t=a[0])?void 0:t.id)?r:""})},[$,C,ef]),eg=!!er&&""!==I.trim()&&!K,ev=(0,a.useCallback)(async()=>{if(!eg||!ee||!er)return;let e={worktreeId:ee.id,instanceId:er.instance.id};V.current=!0,h(!0),O(!0),D(null);let t=await tA({target:e,cliToolId:er.instance.cliTool,content:I.trim(),model:(null==ea?void 0:ea.selectable)?A:void 0,autoYesDuration:ed?null:E,autoYesAnswerMode:R});if(V.current=!1,h(!1),!H.current)return;let{armedAutoYes:n}=t,r="".concat(e.worktreeId,":").concat(e.instanceId);if(t.autoYesStateUnknown&&U(e=>({...e,[r]:!0})),n&&(U(e=>{let{[r]:t,...n}=e;return n}),G(e=>({...e,[r]:n})),L(null),B(ty.Rb)),!t.ok){D(t),O(!1);return}var s=e;let a=[{worktreeId:s.worktreeId,instanceId:s.instanceId},...tp().filter(e=>!tf(e,s))].slice(0,3);try{window.localStorage.setItem(th,JSON.stringify(a))}catch(e){}let i="".concat(window.location.pathname).concat(window.location.search),l="".concat(ee.name," / ").concat(er.label);m(),x.push((0,P.Ii)(e)),p(b("newTask.sentToast",{target:l}),"success",6e3,{onClick:()=>x.push(i)})},[eg,ee,er,I,ea,A,ed,E,R,m,h,x,p,b]),ew=(0,a.useCallback)(e=>{var t;te(t=e.nativeEvent)||"Enter"!==t.key||t.shiftKey||t.altKey||!t.metaKey&&!t.ctrlKey||(e.preventDefault(),ev())},[ev]),ey=null!=(o=null==er?void 0:er.label)?o:"",eN=er?er.starting?"starting":er.running?"running":"stopped":null;return(0,r.jsx)(e7.a,{isOpen:!0,onClose:X,title:b("newTask.title"),size:"md",disableClose:K,children:(0,r.jsxs)("div",{"data-testid":"new-task-dialog",className:"space-y-4",onKeyDown:ew,children:[(0,r.jsx)(tR,{status:g.status,isEmpty:0===Q.length,onRetry:()=>j(e=>e+1)}),"ready"===g.status&&Q.length>0&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(tP,{recentOptions:ex,targetState:er,worktreeId:k,onSelect:ef}),(0,r.jsx)(tB,{repositoryOptions:Q,repository:es,worktreeId:k,worktree:ee,instances:et,instance:en,onRepositoryChange:ep,onBranchChange:eb,onAgentChange:e=>ef({worktreeId:k,instanceId:e})}),(0,r.jsx)(tK,{statusKey:eN,agentLabel:ey}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{htmlFor:"new-task-message",className:tL,children:b("newTask.messageLabel")}),(0,r.jsx)("textarea",{ref:_,id:"new-task-message","data-testid":"new-task-message",value:I,onChange:e=>T(e.target.value),placeholder:b("newTask.messagePlaceholder"),rows:5,className:"".concat(tE," resize-y")})]}),(0,r.jsxs)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[(0,r.jsx)(tO,{modelAvailability:ea,model:A,cliTool:null==er?void 0:er.instance.cliTool,agentLabel:ey,onChange:M}),(0,r.jsx)(tF,{armedAutoYes:ed,autoYesChoice:E,autoYesUnknown:ec,onChoiceChange:L,answerMode:R,onAnswerModeChange:B})]})]}),(0,r.jsx)(tD,{failure:F,agentLabel:ey}),(0,r.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,r.jsxs)("span",{className:"mr-auto hidden items-center gap-1 text-xs text-muted-foreground sm:flex",children:[(0,r.jsx)(ei.u,{children:em("MOD",W)}),(0,r.jsx)(ei.u,{children:"↵"}),(0,r.jsx)("span",{children:b("newTask.sendHint")})]}),(0,r.jsx)("button",{type:"button","data-testid":"new-task-cancel",onClick:X,disabled:K,className:"px-4 py-2 text-sm font-medium text-foreground bg-muted hover:bg-muted/80 rounded-lg transition-colors disabled:opacity-50",children:b("cancel")}),(0,r.jsx)("button",{type:"button","data-testid":"new-task-send",onClick:()=>void ev(),disabled:!eg,className:"px-4 py-2 text-sm font-medium text-white bg-accent-600 hover:bg-accent-700 disabled:opacity-50 disabled:cursor-not-allowed rounded-lg transition-colors",children:K?b("newTask.sending"):b("newTask.send")})]})]})})}function tz(){let{isOpen:e,openNewTask:t}=(0,eo.hX)(),{open:n}=(0,el.C)(),s=(0,a.useRef)(n);return(0,a.useEffect)(()=>{s.current=n},[n]),(0,a.useEffect)(()=>{function e(e){if(!e.defaultPrevented)!te(e)&&e.shiftKey&&!e.altKey&&(e.metaKey||e.ctrlKey)&&("o"===e.key.toLowerCase()||"KeyO"===e.code)&&(s.current||(e.preventDefault(),t()))}return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[t]),e?(0,r.jsx)(tW,{}):null}var t_=n(59854);let tH="transform transition-transform duration-300 ease-out",tV=(0,a.memo)(function(e){let{children:t}=e,{isOpen:n,isMobileDrawerOpen:u,closeMobileDrawer:m,width:h,setWidth:x,repoTabBarMode:f,toggle:p}=(0,i.VF)(),b=(0,l.a)(),{showSidebar:g,showGlobalNav:v}=function(){var e=(0,s.usePathname)();for(let t of d)if(e.startsWith(t.prefix))return{...o,...t.config};return{...o}}();!function(e,t){let{open:n}=(0,el.C)(),r=(0,a.useRef)(n),s=(0,a.useRef)(t);(0,a.useEffect)(()=>{r.current=n,s.current=t},[n,t]),(0,a.useEffect)(()=>{if(e)return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t);function t(e){!(e.defaultPrevented||!(0,P.zg)(e)||r.current||(0,eQ.Sj)())&&((0,P.al)(e.target)||(e.preventDefault(),s.current()))}},[e])}(!b&&g,p);let{factor:w}=(0,c.Ps)(),j=Math.round(160*w),y=Math.round(480*w),k=Math.round(Math.min(y,Math.max(j,h*w))),N=(0,P.fs)(null!=f?f:P.PB,n),C=(0,a.useRef)(null),S=(0,a.useRef)(null),I=(0,a.useRef)(null),T=(0,a.useRef)(u);(0,a.useLayoutEffect)(()=>{var e;let t=T.current;if(T.current=u,!b||!t||u)return;let n=document.activeElement,r=n instanceof HTMLElement&&(null==(e=I.current)?void 0:e.contains(n))===!0;(r||null===n||n===document.body)&&!(0,e5.Bl)()&&r&&n.blur()},[b,u]);let A=(0,a.useCallback)(e=>{x(Math.round(e/w))},[x,w]);return b?(0,r.jsx)(eo.Zg,{children:(0,r.jsxs)("div",{"data-testid":"app-shell",className:"h-screen flex flex-col",children:[(0,r.jsx)(e9,{}),u&&(0,r.jsx)("div",{"data-testid":"drawer-overlay",className:"fixed inset-0 bg-black/50 z-40",onClick:m,"aria-hidden":"true"}),g&&(0,r.jsx)("aside",{ref:I,"data-testid":"sidebar-container",className:"\n fixed left-0 top-0 h-full w-72 max-w-[85vw] z-50 bg-sidebar pt-safe pb-safe\n ".concat(tH,"\n ").concat(u?"translate-x-0":"-translate-x-full","\n "),role:"complementary",children:(0,r.jsx)(eM,{})}),(0,r.jsx)("main",{className:"flex-1 min-h-0 overflow-hidden ".concat(v?"pb-nav-safe":""),role:"main","data-view-transition":"content",children:t}),v&&(0,r.jsx)(e3,{}),(0,r.jsx)(e6.xq,{}),(0,r.jsx)(tn,{}),(0,r.jsx)(tr.n,{}),(0,r.jsx)(tu,{}),(0,r.jsx)(tz,{})]})}):(0,r.jsx)(eo.Zg,{children:(0,r.jsxs)("div",{"data-testid":"app-shell",className:"h-screen flex flex-col",children:[(0,r.jsxs)("div",{className:"flex flex-1 min-h-0",children:[g&&(0,r.jsxs)("aside",{ref:C,"data-testid":"sidebar-container",className:"\n fixed left-0 top-0 h-full\n border-r border-border\n ".concat(tH,"\n ").concat(n?"translate-x-0":"-translate-x-full","\n "),style:{width:"".concat(k,"px"),zIndex:t_.M.SIDEBAR},role:"complementary","aria-hidden":!n,children:[(0,r.jsx)(eM,{}),(0,r.jsx)(tY,{currentWidth:k,minWidth:j,maxWidth:y,sidebarRef:C,mainRef:S,onWidthChange:A})]}),g&&!n&&(0,r.jsx)("aside",{"data-testid":"sidebar-rail-container",className:"\n fixed left-0 top-0 h-full\n border-r border-border\n ",style:{width:"".concat(P.BN,"px"),zIndex:t_.M.SIDEBAR},children:(0,r.jsx)(e$,{})}),(0,r.jsxs)("main",{ref:S,className:"flex-1 min-w-0 h-full overflow-hidden flex flex-col transition-[padding] duration-300 ease-out",style:{paddingLeft:g?"".concat(n?k:P.BN,"px"):0},role:"main","data-view-transition":"content",children:[N&&(0,r.jsx)(e0.vP,{}),v&&(0,r.jsx)(eU,{}),(0,r.jsx)("div",{className:"flex-1 min-h-0",children:t})]})]}),(0,r.jsx)(e6.xq,{}),(0,r.jsx)(tn,{}),(0,r.jsx)(tr.n,{}),(0,r.jsx)(tu,{}),(0,r.jsx)(tz,{})]})})});function tY(e){let{currentWidth:t,minWidth:n,maxWidth:s,sidebarRef:a,mainRef:i,onWidthChange:l}=e;return(0,r.jsx)("div",{"data-testid":"sidebar-resize-handle","aria-hidden":"true",onMouseDown:e=>{e.preventDefault();let r=e.clientX,o=t;i.current&&(i.current.style.transition="none");let d=e=>{o=Math.max(n,Math.min(s,t+(e.clientX-r))),a.current&&(a.current.style.width="".concat(o,"px")),i.current&&(i.current.style.paddingLeft="".concat(o,"px"))},c=()=>{document.body.style.cursor="",document.body.style.userSelect="",i.current&&(i.current.style.transition=""),document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",c),l(o)};document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",d),document.addEventListener("mouseup",c)},className:"absolute top-0 right-0 w-1 h-full cursor-col-resize hover:bg-accent-500/40 transition-colors"})}let tU=["/login","/offline","/proxy"],tq=/^\/worktrees\/[^/]+\/(terminal|files)(\/|$)/;function tG(e){var t;let{children:n}=e,a=(0,s.usePathname)();return(t=null!=a?a:"",tU.some(e=>t===e||t.startsWith("".concat(e,"/")))||tq.test(t)||0)?(0,r.jsx)(r.Fragment,{children:n}):(0,r.jsx)(tV,{children:n})}},65380:(e,t,n)=>{"use strict";n.d(t,{H:()=>l,O:()=>i});var r=n(95155),s=n(12115);let a=(0,s.createContext)(!1);function i(e){let{children:t,authEnabled:n}=e;return(0,r.jsx)(a.Provider,{value:n,children:t})}function l(){return(0,s.useContext)(a)}},77016:(e,t,n)=>{"use strict";n.d(t,{W:()=>g,n:()=>v});var r=n(95155),s=n(12115),a=n(18955),i=n(52056),l=n(89559),o=n(65229),d=n(59854),c=n(60199),u=n(52703);let m=0,h=new Set;function x(){for(let e of h)e()}function f(e){return h.add(e),()=>{h.delete(e)}}function p(){return m>0}function b(){return!1}function g(){return(0,s.useSyncExternalStore)(f,p,b)}function v(){let e=(0,a.c)("common"),[t,n]=(0,s.useState)(null),[h,f]=(0,s.useState)(null),p=(0,s.useCallback)(e=>{if(e.type!==u.Oo)return;let{serverVersion:t,clientVersion:r}=e;"string"==typeof t&&"string"==typeof r&&t&&r&&t!==h&&n({serverVersion:t,clientVersion:r})},[h]);(0,c.T3)(p);let b=null!==t;(0,s.useEffect)(()=>{if(b)return m+=1,x(),()=>{m-=1,x()}},[b]);let g=(0,s.useCallback)(()=>{window.location.reload()},[]),v=(0,s.useCallback)(()=>{n(e=>(e&&f(e.serverVersion),null))},[]);return t?(0,r.jsxs)("div",{"data-testid":"version-mismatch-banner",role:"alert","aria-live":"assertive",className:"fixed top-3 left-1/2 -translate-x-1/2 flex items-start gap-3 max-w-[92vw] rounded-lg border border-warning-border bg-warning-subtle px-4 py-3 text-warning-foreground shadow-lg",style:{zIndex:d.M.TOAST},children:[(0,r.jsx)(i.A,{className:"h-5 w-5 shrink-0 mt-0.5","aria-hidden":"true"}),(0,r.jsxs)("div",{className:"flex flex-col gap-0.5 text-sm",children:[(0,r.jsx)("span",{className:"font-semibold",children:e("versionMismatch.title")}),(0,r.jsx)("span",{children:e("versionMismatch.description",{serverVersion:t.serverVersion,clientVersion:t.clientVersion})})]}),(0,r.jsxs)("button",{type:"button","data-testid":"version-mismatch-reload",onClick:g,className:"shrink-0 inline-flex items-center gap-1.5 rounded-md border border-warning-border px-3 py-1.5 text-sm font-medium hover:opacity-80 focus:outline-none focus:ring-2 focus:ring-offset-2",children:[(0,r.jsx)(l.A,{className:"h-4 w-4","aria-hidden":"true"}),e("versionMismatch.reload")]}),(0,r.jsx)("button",{type:"button","data-testid":"version-mismatch-dismiss",onClick:v,"aria-label":e("versionMismatch.dismiss"),className:"shrink-0 hover:opacity-70 focus:outline-none focus:ring-2 focus:ring-offset-2",children:(0,r.jsx)(o.A,{className:"h-4 w-4","aria-hidden":"true"})})]}):null}},80903:(e,t,n)=>{Promise.resolve().then(n.t.bind(n,22311,23)),Promise.resolve().then(n.t.bind(n,7183,23)),Promise.resolve().then(n.t.bind(n,13673,23)),Promise.resolve().then(n.bind(n,61781)),Promise.resolve().then(n.bind(n,23252))}},e=>{e.O(0,[5373,2978,6809,4909,2770,2619,6606,7730,5927,8407,2407,344,6654,8606,4768,8165,7665,5794,8441,1255,7358],()=>e(e.s=80903)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3310],{6191:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(71847).A)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},8803:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(71847).A)("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]])},20063:(e,t,a)=>{"use strict";var s=a(47260);a.o(s,"useParams")&&a.d(t,{useParams:function(){return s.useParams}}),a.o(s,"usePathname")&&a.d(t,{usePathname:function(){return s.usePathname}}),a.o(s,"useRouter")&&a.d(t,{useRouter:function(){return s.useRouter}}),a.o(s,"useSearchParams")&&a.d(t,{useSearchParams:function(){return s.useSearchParams}})},20562:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(71847).A)("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]])},23327:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(71847).A)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]])},42529:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(71847).A)("circle-check-big",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]])},48314:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(71847).A)("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]])},52056:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(71847).A)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},57101:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>d});var s=a(95155),r=a(18955),c=a(58165);function d(){let e=(0,r.c)("common");return(0,s.jsxs)("div",{className:"container-custom py-8 overflow-auto h-full",children:[(0,s.jsxs)("div",{className:"mb-6",children:[(0,s.jsx)("h1",{className:"text-2xl font-bold text-foreground mb-2",children:e("nav.more")}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:e("settings.pageDescription")})]}),(0,s.jsx)(c.O3,{})]})}},65229:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(71847).A)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},68695:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(71847).A)("circle-arrow-up",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 12-4-4-4 4",key:"177agl"}],["path",{d:"M12 16V8",key:"1sbj14"}]])},78874:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(71847).A)("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])},80867:(e,t,a)=>{Promise.resolve().then(a.bind(a,57101))},85998:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(71847).A)("bell",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]])}},e=>{e.O(0,[6809,4909,2770,2619,8407,2407,344,6654,8165,8441,1255,7358],()=>e(e.s=80867)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8974],{20063:(e,t,s)=>{"use strict";var a=s(47260);s.o(a,"useParams")&&s.d(t,{useParams:function(){return a.useParams}}),s.o(a,"usePathname")&&s.d(t,{usePathname:function(){return a.usePathname}}),s.o(a,"useRouter")&&s.d(t,{useRouter:function(){return a.useRouter}}),s.o(a,"useSearchParams")&&s.d(t,{useSearchParams:function(){return a.useSearchParams}})},43424:(e,t,s)=>{"use strict";s.d(t,{OO:()=>i,cx:()=>r,hO:()=>n});let a="commandmate.lastOpenedWorktreeId";function r(){try{return window.localStorage.getItem(a)||null}catch(e){return null}}function n(e){if(e)try{window.localStorage.setItem(a,e)}catch(e){}}function i(e){let{lastOpenedId:t,worktreeIds:s}=e;return t&&s.includes(t)?"/worktrees/".concat(encodeURIComponent(t)):"/sessions"}},54799:(e,t,s)=>{Promise.resolve().then(s.bind(s,89957))},61362:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(71847).A)("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},65229:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(71847).A)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},89957:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>y});var a=s(95155),r=s(12115),n=s(52619),i=s.n(n),o=s(20063),c=s(18955),d=s(66966),l=s(65229),u=s(61362),m=s(99051),h=s(48407),g=s(2317);function f(e){return"boolean"==typeof e}let x=[{key:"registerRepository",href:"/repositories"},{key:"sendFirstMessage",href:"/sessions"}];function p(e){let{worktrees:t,repositories:s,isLoading:n=!1,error:o=null}=e,d=(0,c.c)("home"),{value:p,setValue:b}=(0,g.V)({key:"commandmate:onboarding-dismissed",defaultValue:!1,validate:f}),[v,y]=(0,r.useState)(!1);(0,r.useEffect)(()=>y(!0),[]);let k=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return{hasRepository:(null!=t?t:[]).length>0,hasSentMessage:(null!=e?e:[]).some(e=>!!e.lastUserMessageAt)}}(t,s),j=k.hasRepository&&k.hasSentMessage,N=v&&!n&&null===o;return((0,r.useEffect)(()=>{N&&j&&!p&&b(!0)},[N,j,p,b]),!N||j||p)?null:(0,a.jsx)("div",{className:"mb-8",children:(0,a.jsxs)(h.Zp,{variant:"elevated","data-testid":"onboarding-checklist",children:[(0,a.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,a.jsx)("h2",{className:"text-sm font-semibold text-foreground",children:d("onboarding.title")}),(0,a.jsx)(h.$n,{variant:"ghost",size:"sm","aria-label":d("onboarding.dismiss"),"data-testid":"onboarding-dismiss",onClick:()=>b(!0),children:(0,a.jsx)(l.A,{size:16,"aria-hidden":"true"})})]}),(0,a.jsx)("ol",{className:"mt-3 space-y-3",children:x.map(e=>{let{key:t,href:s}=e,r="registerRepository"===t?k.hasRepository:k.hasSentMessage;return(0,a.jsxs)("li",{className:"flex items-center gap-3","data-testid":"onboarding-step-".concat(t),"data-complete":r,children:[r?(0,a.jsx)(u.A,{size:20,className:"shrink-0 text-success-foreground","aria-hidden":"true"}):(0,a.jsx)(m.A,{size:20,className:"shrink-0 text-muted-foreground","aria-hidden":"true"}),(0,a.jsx)("span",{className:"min-w-0 flex-1 text-sm ".concat(r?"text-muted-foreground line-through":"text-foreground"),children:d("onboarding.steps.".concat(t))}),!r&&(0,a.jsx)(i(),{href:s,"data-testid":"onboarding-action-".concat(t),className:"shrink-0 rounded-md bg-accent-600 px-3 py-1.5 text-xs font-medium text-white transition-colors hover:bg-accent-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring dark:bg-accent-500 dark:hover:bg-accent-600",children:d("onboarding.actions.".concat(t))})]},t)})})]})})}var b=s(7636),v=s(43424);function y(){let e=(0,c.c)("common"),t=(0,o.useRouter)(),{worktrees:s,repositories:n,isLoading:l,error:u,refresh:m}=(0,d.Fn)(),g=l&&0===s.length,f=!g&&null!==u&&0===s.length,x=!g&&!f&&0===s.length,y=!g&&!f&&!x,k=(0,r.useMemo)(()=>(0,b.s6)(s,(0,b.UZ)(n)).map(e=>e.id),[s,n]),j=(0,r.useRef)(!1);return(0,r.useEffect)(()=>{y&&!j.current&&(j.current=!0,t.replace((0,v.OO)({lastOpenedId:(0,v.cx)(),worktreeIds:k})))},[y,k,t]),(0,a.jsx)("div",{className:"container-custom py-8 overflow-auto h-full",children:f?(0,a.jsxs)("div",{"data-testid":"home-load-error",role:"alert",className:"py-16 text-center",children:[(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:e("sidebar.branchesLoadFailed")}),(0,a.jsx)(h.$n,{type:"button",variant:"secondary",size:"sm",className:"mt-3","data-testid":"home-load-retry",onClick:()=>{m()},children:e("sidebar.retryLoadBranches")})]}):x?(0,a.jsxs)("div",{"data-testid":"home-empty",children:[(0,a.jsx)(p,{worktrees:s,repositories:n,isLoading:!1,error:null}),(0,a.jsxs)("div",{className:"text-center",children:[(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:e("sidebar.noBranchesAvailable")}),(0,a.jsx)(i(),{href:"/repositories","data-testid":"home-add-repository",className:"mt-3 inline-block rounded-md bg-accent-600 px-3 py-1.5 text-sm font-medium text-white transition-colors hover:bg-accent-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring dark:bg-accent-500 dark:hover:bg-accent-600",children:e("repositories.add")})]})]}):(0,a.jsx)("div",{"data-testid":"home-loading",role:"status","aria-label":e("loadingPage"),className:"flex justify-center py-16",children:(0,a.jsx)(h.y$,{size:"lg",variant:"muted"})})})}}},e=>{e.O(0,[6809,4909,2770,2619,8407,2407,344,6654,8606,4768,8441,1255,7358],()=>e(e.s=54799)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8975],{3199:(e,t,a)=>{"use strict";a.d(t,{Vt:()=>s,aN:()=>l,zK:()=>p,I_:()=>c,JY:()=>d,sd:()=>u,kj:()=>m,z7:()=>o});let r=/^[a-zA-Z0-9][a-zA-Z0-9\-._/:]*$/,n=/^[a-zA-Z0-9][a-zA-Z0-9\-._]*$/,s=new Set(["copilot","opencode","opencode-v2"]),l=new Set(["opencode","opencode-v2"]),i=new Set(["opencode-v2"]);function o(e,t,a){if(i.has(e)&&!(!(null==a?void 0:a.trim())||(null==t?void 0:t.trim())))return"".concat(e,' option "--variant" needs "--model" (sent as -m <provider/model>#<variant>)')}function c(e){let t=e.trim();if(!t)return{cliToolId:"claude",model:void 0};let{tokens:a,error:r}=function(e){let t=[],a="",r=!1,n=null;for(let s of e){if(n){s===n?n=null:a+=s;continue}if('"'===s||"'"===s){n=s,r=!0;continue}if(/\s/.test(s)){r&&(t.push(a),a="",r=!1);continue}a+=s,r=!0}return n?{tokens:[],error:"CLI Tool column has an unterminated quote"}:(r&&t.push(a),{tokens:t})}(t);if(r)return{cliToolId:t.split(/\s+/)[0],error:r};let n=a[0];return 1===a.length?{cliToolId:n,model:void 0}:s.has(n)?l.has(n)?function(e,t){let a={cliToolId:e},r=new Set,n=(e,a)=>{let r=t[a+1];return void 0===r||r.startsWith("-")?null:r};for(let s=0;s<t.length;s++){let l=t[s];if(r.has(l))return{cliToolId:e,error:"".concat(e,' option "').concat(l,'" is repeated')};switch(l){case"--model":case"-m":{let t=n(l,s);if(null===t)return{cliToolId:e,error:"".concat(e,' option "').concat(l,'" needs a value')};r.add("--model"),r.add("-m"),a.model=t,s++;break}case"--agent":{let t=n(l,s);if(null===t)return{cliToolId:e,error:"".concat(e,' option "').concat(l,'" needs a value')};r.add(l),a.agent=t,s++;break}case"--variant":{let t=n(l,s);if(null===t)return{cliToolId:e,error:"".concat(e,' option "').concat(l,'" needs a value')};r.add(l),a.variant=t,s++;break}case"--title":{let t=n(l,s);if(null===t)return{cliToolId:e,error:"".concat(e,' option "').concat(l,'" needs a value')};r.add(l),a.title=t,s++;break}case"--continue":case"-c":r.add("--continue"),r.add("-c"),a.continueSession=!0;break;default:{let t="opencode-v2"===e?"opencode-v2 [--model <provider/model> [--variant <name>]] [--agent <name>] [--continue] [--title <text>]":"opencode [--model <provider/model>] [--agent <name>] [--variant <name>] [--continue] [--title <text>]";return{cliToolId:e,error:"".concat(e," only supports: ").concat(t)}}}}let s=o(e,a.model,a.variant);return s?{cliToolId:e,error:s}:a}(n,a.slice(1)):3===a.length&&"--model"===a[1]?{cliToolId:n,model:a[2]}:{cliToolId:n,error:"".concat(n," only supports: ").concat(n," --model <modelName>")}:{cliToolId:n,error:'CLI Tool "'.concat(n,'" does not support additional options')}}function d(e){return/[\x00-\x1f\x7f]/.test(e)?{valid:!1,reason:"Model name contains control characters"}:""===e.trim()?{valid:!1,reason:"Model name must not be empty"}:r.test(e)?e.length>128?{valid:!1,reason:"Model name exceeds ".concat(128," characters")}:{valid:!0}:{valid:!1,reason:"Model name contains invalid characters"}}function u(e,t){return/[\x00-\x1f\x7f]/.test(e)?{valid:!1,reason:"opencode ".concat(t," contains control characters")}:""===e.trim()?{valid:!1,reason:"opencode ".concat(t," must not be empty")}:n.test(e)?e.length>64?{valid:!1,reason:"opencode ".concat(t," exceeds ").concat(64," characters")}:{valid:!0}:{valid:!1,reason:"opencode ".concat(t," contains invalid characters")}}function m(e){return/[\x00-\x1f\x7f]/.test(e)?{valid:!1,reason:"opencode title contains control characters"}:""===e.trim()?{valid:!1,reason:"opencode title must not be empty"}:e.startsWith("-")?{valid:!1,reason:'opencode title must not start with "-"'}:e.includes("|")?{valid:!1,reason:'opencode title must not contain "|"'}:e.length>200?{valid:!1,reason:"opencode title exceeds ".concat(200," characters")}:{valid:!0}}function p(e){let t=[],a=c(e);if(a.error&&t.push(a.error),a.model){let e=d(a.model);e.valid||t.push(e.reason)}if(a.agent){let e=u(a.agent,"agent");e.valid||t.push(e.reason)}if(a.variant){let e=u(a.variant,"variant");e.valid||t.push(e.reason)}if(a.title){let e=m(a.title);e.valid||t.push(e.reason)}return{result:a,errors:t}}},4138:(e,t,a)=>{"use strict";a.d(t,{q:()=>s});var r=a(12115),n=a(9900);function s(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:n.pX,[t,a]=(0,r.useState)(!1),s=(0,r.useRef)(null);return(0,r.useEffect)(()=>()=>{null!==s.current&&(clearTimeout(s.current),s.current=null)},[]),{copied:t,markCopied:(0,r.useCallback)(()=>{a(!0),null!==s.current&&clearTimeout(s.current),s.current=setTimeout(()=>{s.current=null,a(!1)},e)},[e]),reset:(0,r.useCallback)(()=>{null!==s.current&&(clearTimeout(s.current),s.current=null),a(!1)},[])}}},17442:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>E});var r=a(95155),n=a(12115),s=a(18955),l=a(48407),i=a(52619),o=a.n(i),c=a(20063),d=a(87531),u=a(44308),m=a(55449),p=a(38606),f=a(76471),v=a(54014),x=a(46892);let h={in_review:"status.inReview",approval:"status.approval",stalled:"status.stalled"},g=u.DR,b={in_review:e=>"in_review"===e.status,approval:e=>!0===e.isWaitingForResponse,stalled:e=>!0===e.isStalled};function y(e){let{status:t,label:a,unclassified:n}=e,l=(0,s.c)("common"),i=x.PL[t],o="w-2.5 h-2.5 rounded-full flex-shrink-0";if((0,f.Mq)(t,n))return(0,r.jsx)("span",{className:"".concat(o," ").concat(f.Jd),title:"".concat(a,": ").concat(l(f.rH)),"data-unclassified":"true"});let c="".concat(a,": ").concat(l(i.labelKey));return"spinner"===i.type?(0,r.jsx)("span",{className:"".concat(o," border-2 border-t-transparent animate-spin ").concat(i.className),title:c}):(0,r.jsx)("span",{className:"".concat(o," ").concat(i.className),title:c})}function j(){var e;let t=(0,s.c)("review"),[a,i]=(0,n.useState)([]),[f,x]=(0,n.useState)(!0),j=(0,c.useSearchParams)(),[w,N]=(0,n.useState)(()=>{var e;return null!=(e=(0,u._d)(null==j?void 0:j.get(u.z7)))?e:u.SD}),S=(0,n.useRef)(null),k=null!=(e=null==j?void 0:j.get(u.z7))?e:null;(0,n.useEffect)(()=>{let e=(0,u._d)(k);e&&N(e)},[k]);let C=(0,n.useCallback)(async()=>{try{let t=await fetch("/api/worktrees?include=review");if(t.ok){var e;let a=await t.json();(0,m.IK)(a.defaultSelectedAgents),i(null!=(e=a.worktrees)?e:[])}}catch(e){}finally{x(!1)}},[]);(0,n.useEffect)(()=>(C(),S.current=setInterval(C,u.Iu),()=>{S.current&&clearInterval(S.current)}),[C]);let z=(0,n.useMemo)(()=>a.filter(b[w]),[a,w]),T=(0,n.useMemo)(()=>({in_review:a.filter(b.in_review).length,approval:a.filter(b.approval).length,stalled:a.filter(b.stalled).length}),[a]),A=(0,n.useMemo)(()=>{switch(w){case"in_review":return t("empty.inReview");case"approval":return t("empty.approval");case"stalled":return t("empty.stalled")}},[w,t]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"mb-6 inline-flex items-center gap-1 rounded-lg bg-muted p-1",role:"group","aria-label":t("filters.ariaLabel"),"data-testid":"review-filters",children:g.map(e=>{let a=w===e;return(0,r.jsxs)("button",{type:"button","aria-pressed":a,onClick:()=>N(e),"data-testid":"review-filter-".concat(e),className:(0,d.cn)("inline-flex items-center gap-1.5 rounded-md px-3 py-1.5 text-sm font-medium transition-colors","focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",a?"bg-accent-500/15 text-accent-700 dark:text-accent-300":"text-muted-foreground hover:text-foreground"),children:[t(h[e]),(0,r.jsx)("span",{className:(0,d.cn)("text-xs font-semibold tabular-nums",a?"text-accent-700 dark:text-accent-300":"text-muted-foreground"),children:T[e]})]},e)})}),f&&(0,r.jsx)("div",{className:"space-y-2","data-testid":"review-loading",role:"status","aria-label":t("filters.loading"),children:[0,1,2].map(e=>(0,r.jsx)(l.Zp,{padding:"md",children:(0,r.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,r.jsxs)("div",{className:"min-w-0 flex-1 space-y-1.5",children:[(0,r.jsx)(l.EA,{className:"h-4 w-40 max-w-full"}),(0,r.jsx)(l.EA,{className:"h-3 w-24 max-w-full"})]}),(0,r.jsx)(l.EA,{className:"ml-4 h-5 w-16 flex-shrink-0"})]})},e))}),!f&&(0,r.jsx)("div",{className:"space-y-2","data-testid":"review-list",children:0===z.length?(0,r.jsx)("div",{className:"text-muted-foreground py-8 text-center","data-testid":"review-empty",children:A}):z.map(e=>{var a;let n=null!=(a=e.selectedAgents)?a:(0,m.sA)();return(0,r.jsx)(o(),{href:"/worktrees/".concat(e.id),className:"block","data-testid":"review-item-".concat(e.id),children:(0,r.jsxs)(l.Zp,{padding:"md",className:"transition-colors ".concat(function(e){switch(e){case"in_review":return"border-info-border hover:border-info-border";case"approval":return"border-warning-border hover:border-warning-border";case"stalled":return"border-danger-border hover:border-danger-border"}}(w)),children:[(0,r.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsx)("div",{className:"text-sm font-medium text-foreground truncate",children:e.name}),(0,r.jsx)("div",{className:"text-xs text-muted-foreground truncate",children:e.repositoryName})]}),(0,r.jsxs)("div",{className:"flex items-center gap-2 ml-4 flex-shrink-0",children:[(0,r.jsx)("span",{className:"px-2 py-0.5 text-xs font-medium rounded ".concat(function(e){switch(e){case"in_review":return"bg-info-subtle text-info-foreground";case"approval":return"bg-warning-subtle text-warning-foreground";case"stalled":return"bg-danger-subtle text-danger-foreground"}}(w)),children:t(h[w])}),n.map(t=>{var a;let n=null==(a=e.sessionStatusByCli)?void 0:a[t],s=(0,p.kA)(n);return(0,r.jsxs)("div",{className:"flex items-center gap-1",children:[(0,r.jsx)(y,{status:s,label:(0,v.oo)(t),unclassified:(0,p.px)(n)}),(0,r.jsx)("span",{className:"text-xs text-muted-foreground",children:(0,v.oo)(t)})]},t)})]})]}),e.description&&(0,r.jsx)("div",{className:"mt-2",children:(0,r.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-2 whitespace-pre-wrap",children:e.description})})]})},e.id)})})]})}function w(e){let t=e.getFullYear(),a=String(e.getMonth()+1).padStart(2,"0"),r=String(e.getDate()).padStart(2,"0");return"".concat(t,"-").concat(a,"-").concat(r)}function N(e){let{value:t,onChange:a}=e,n=(0,s.c)("review"),i=w(new Date),o=t===i;return(0,r.jsxs)("div",{className:"flex items-center gap-2","data-testid":"report-date-picker",children:[(0,r.jsx)(l.$n,{variant:"secondary",size:"sm",onClick:()=>{let e=new Date(t+"T00:00:00");e.setDate(e.getDate()-1),a(w(e))},"data-testid":"date-prev","aria-label":n("datePicker.previousDay"),children:"<"}),(0,r.jsx)(l.pd,{type:"date",inputSize:"sm",value:t,max:i,onChange:e=>a(e.target.value),className:"w-auto","data-testid":"date-input"}),(0,r.jsx)(l.$n,{variant:"secondary",size:"sm",onClick:()=>{if(o)return;let e=new Date(t+"T00:00:00");e.setDate(e.getDate()+1);let r=w(e);r>i||a(r)},disabled:o,"data-testid":"date-next","aria-label":n("datePicker.nextDay"),children:">"})]})}var S=a(36402),k=a(3199),C=a(4138),z=a(60322);let T=[{value:"none",labelKey:"report.modes.none"},{value:"template",labelKey:"report.modes.template"},{value:"custom",labelKey:"report.modes.custom"}];function A(){let e=(0,s.c)("review"),t=(0,S.SC)(),[a,i]=(0,n.useState)(function(){let e=new Date,t=e.getFullYear(),a=String(e.getMonth()+1).padStart(2,"0"),r=String(e.getDate()).padStart(2,"0");return"".concat(t,"-").concat(a,"-").concat(r)}()),[o,c]=(0,n.useState)("claude"),[d,m]=(0,n.useState)(""),[p,f]=(0,n.useState)(null),[v,x]=(0,n.useState)(0),[h,g]=(0,n.useState)(""),[b,y]=(0,n.useState)(!1),[j,w]=(0,n.useState)(!1),[A,_]=(0,n.useState)(!1),[P,E]=(0,n.useState)(!1),{copied:D,markCopied:I}=(0,C.q)(),[K,L]=(0,n.useState)(null),R=k.Vt.has(o),{mode:$,setMode:M,userInstruction:O,setUserInstruction:Z,isUserInstructionReadOnly:J,templates:q,selectedTemplateId:H,selectTemplate:V,isLoadingTemplates:F}=function(){let[e,t]=(0,n.useState)("none"),[a,r]=(0,n.useState)(""),[s,l]=(0,n.useState)([]),[i,o]=(0,n.useState)(null),[c,d]=(0,n.useState)(!1),u=(0,n.useCallback)(async()=>{d(!0);try{let e=await fetch("/api/templates");if(e.ok){let t=await e.json();l(t.templates||[])}}catch(e){}finally{d(!1)}},[]);(0,n.useEffect)(()=>{u()},[u]);let m=(0,n.useCallback)(e=>{t(e),r(""),o(null)},[]),p=(0,n.useCallback)(t=>{"custom"===e&&r(t)},[e]),f=(0,n.useCallback)(t=>{let a=s.find(e=>e.id===t);a&&"template"===e&&(o(t),r(a.content))},[s,e]);return{mode:e,setMode:m,userInstruction:a,setUserInstruction:p,isUserInstructionReadOnly:"template"===e,templates:s,selectedTemplateId:i,selectTemplate:f,isLoadingTemplates:c,refreshTemplates:u}}(),U=function(e){let[t,a]=(0,n.useState)({generating:!1}),r=(0,n.useRef)(null),s=(0,n.useCallback)(async()=>{try{let e=await fetch("/api/daily-summary/status");if(e.ok){let t=await e.json();a(t)}}catch(e){}},[]);return(0,n.useEffect)(()=>e?(s(),r.current=setInterval(s,5e3),()=>{r.current&&(clearInterval(r.current),r.current=null)}):void a({generating:!1}),[e,s]),t}(!A),W=U.generating&&!A,X=(0,n.useCallback)(async t=>{w(!0),L(null);try{let a=await fetch("/api/daily-summary?date=".concat(t));if(!a.ok){let t=await a.json();L(t.error||e("report.errors.fetch"));return}let r=await a.json();f(r.report),x(r.messageCount),r.report?g(r.report.content):g(""),y(!1)}catch(t){L(e("report.errors.fetch"))}finally{w(!1)}},[e]);(0,n.useEffect)(()=>{X(a)},[a,X]);let[B,Y]=(0,n.useState)(!1);(0,n.useEffect)(()=>{U.generating?Y(!0):B&&(Y(!1),X(a))},[U.generating,B,X,a]);let G=async()=>{if(!p||await t({description:e("report.regenerateConfirm")})){_(!0),L(null);try{let t={date:a,tool:o};R&&d.trim()&&(t.model=d.trim()),"none"!==$&&O.trim()&&(t.userInstruction=O.trim());let r=await fetch("/api/daily-summary",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(429===r.status)return void L(e("report.errors.rateLimited"));if(!r.ok){let t=await r.json();L(t.error||e("report.errors.generate"));return}let n=await r.json();f(n.report),g(n.report.content),y(!1)}catch(t){L(e("report.errors.generate"))}finally{_(!1)}}},Q=async()=>{if(!h.trim())return void L(e("report.errors.emptyContent"));E(!0),L(null);try{let t=await fetch("/api/daily-summary",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({date:a,content:h})});if(!t.ok){let a=await t.json();L(a.error||e("report.errors.save"));return}let r=await t.json();f(r.report),y(!1)}catch(t){L(e("report.errors.save"))}finally{E(!1)}};return(0,r.jsxs)("div",{"data-testid":"report-tab",children:[(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-4 mb-6",children:[(0,r.jsx)(N,{value:a,onChange:e=>{i(e)}}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("label",{className:"text-sm text-muted-foreground",children:e("report.toolLabel")}),(0,r.jsx)("select",{value:o,onChange:e=>c(e.target.value),className:"px-3 py-1 text-sm rounded border border-input bg-surface dark:bg-surface-2 text-surface-foreground","data-testid":"tool-selector",children:u.IH.map(e=>(0,r.jsx)("option",{value:e,children:e},e))}),R&&(0,r.jsx)(l.pd,{type:"text",inputSize:"sm",placeholder:"opencode"===o?e("report.modelPlaceholderOpencode"):e("report.modelPlaceholder"),value:d,onChange:e=>m(e.target.value),className:"w-auto","data-testid":"model-input"})]})]}),(0,r.jsxs)("div",{className:"mb-4","data-testid":"generation-mode-selector",children:[(0,r.jsx)("label",{className:"text-sm font-medium text-foreground mb-2 block",children:e("report.generationMode")}),(0,r.jsx)(l.z6,{value:$,onValueChange:e=>M(e),name:"generation-mode",className:"flex flex-row gap-4",children:T.map(t=>(0,r.jsxs)("label",{className:"flex items-center gap-2 text-sm cursor-pointer",children:[(0,r.jsx)(l.CU,{value:t.value,"data-testid":"mode-radio-".concat(t.value)}),(0,r.jsx)("span",{className:"text-foreground",children:e(t.labelKey)})]},t.value))})]}),"template"===$&&(0,r.jsxs)("div",{className:"mb-4","data-testid":"template-selector",children:[(0,r.jsx)("label",{className:"text-sm font-medium text-foreground mb-2 block",children:e("report.selectTemplate")}),F?(0,r.jsx)(l.EA,{className:"h-9 w-full","data-testid":"report-template-loading",role:"status","aria-label":e("report.loadingTemplates"),"aria-hidden":void 0}):0===q.length?(0,r.jsx)("div",{className:"text-sm text-muted-foreground",children:e("report.noTemplates")}):(0,r.jsxs)("select",{value:H||"",onChange:e=>V(e.target.value),className:"px-3 py-1 text-sm rounded border border-input bg-surface dark:bg-surface-2 text-surface-foreground","data-testid":"template-select",children:[(0,r.jsx)("option",{value:"",children:e("report.templatePlaceholderOption")}),q.map(e=>(0,r.jsx)("option",{value:e.id,children:e.name},e.id))]})]}),"none"!==$&&(0,r.jsx)("div",{className:"mb-4",children:(0,r.jsx)(l.k_,{value:O,onChange:e=>Z(e.target.value),rows:3,maxLength:u.t7,readOnly:J,placeholder:"template"===$?e("report.instructionPlaceholderTemplate"):e("report.instructionPlaceholderCustom"),className:"resize-y ".concat(J?"bg-muted cursor-not-allowed":""),"data-testid":"user-instruction-input"})}),(0,r.jsx)("div",{className:"mb-6",children:(0,r.jsx)(l.$n,{variant:"primary",onClick:G,disabled:A||W||0===v,"data-testid":"generate-button",children:A||W?e("report.generating"):e("report.generate")})}),(0,r.jsx)("div",{className:"mb-4 text-sm text-muted-foreground","data-testid":"message-count",children:j?(0,r.jsx)(l.EA,{className:"h-4 w-48"}):0===v?e("report.noMessages"):e("report.messagesFound",{count:v})}),K&&(0,r.jsx)("div",{className:"mb-4 p-3 bg-danger-subtle text-danger-foreground rounded-lg text-sm","data-testid":"report-error",children:K}),(A||W)&&(0,r.jsxs)("div",{className:"flex items-center gap-2 mb-4 text-sm text-muted-foreground","data-testid":"generating-spinner",children:[(0,r.jsx)(l.y$,{size:"sm",variant:"muted"}),W&&U.tool?U.startedAt?e("report.generatingRemoteWithTime",{tool:U.tool,seconds:Math.round((Date.now()-new Date(U.startedAt).getTime())/1e3)}):e("report.generatingRemote",{tool:U.tool}):e("report.generatingSummary")]}),!j&&p&&(0,r.jsxs)(l.Zp,{"data-testid":"report-content",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,r.jsxs)("div",{className:"text-xs text-muted-foreground",children:[e("report.generatedBy",{tool:p.generatedByTool}),p.model&&" (".concat(p.model,")")]}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(l.$n,{variant:"secondary",size:"sm",onClick:async()=>{await (0,z.l)(p.content),I()},"data-testid":"copy-report-button",children:D?e("report.copied"):e("report.copy")}),(0,r.jsx)(l.$n,{variant:"secondary",size:"sm",onClick:()=>{b?Q():y(!0)},disabled:P,"data-testid":"edit-save-button",children:P?e("report.saving"):b?e("report.save"):e("report.edit")})]})]}),b?(0,r.jsx)(l.k_,{value:h,onChange:e=>g(e.target.value),className:"h-64 p-3 font-mono","data-testid":"report-editor"}):(0,r.jsx)("div",{className:"prose dark:prose-invert max-w-none text-sm whitespace-pre-wrap","data-testid":"report-preview",children:p.content})]})]})}function _(){let e=(0,s.c)("review"),t=(0,S.SC)(),[a,i]=(0,n.useState)([]),[o,c]=(0,n.useState)(!1),[d,m]=(0,n.useState)(null),[p,f]=(0,n.useState)(""),[v,x]=(0,n.useState)(""),[h,g]=(0,n.useState)(!1),[b,y]=(0,n.useState)(null),[j,w]=(0,n.useState)(""),[N,k]=(0,n.useState)(""),[C,z]=(0,n.useState)(!1),T=(0,n.useCallback)(async()=>{c(!0),m(null);try{let t=await fetch("/api/templates");if(!t.ok){let a=await t.json();m(a.error||e("template.errors.fetch"));return}let a=await t.json();i(a.templates||[])}catch(t){m(e("template.errors.fetch"))}finally{c(!1)}},[e]);(0,n.useEffect)(()=>{T()},[T]);let A=async()=>{if(!p.trim()||!v.trim())return void m(e("template.errors.nameAndContentRequired"));g(!0),m(null);try{let t=await fetch("/api/templates",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:p.trim(),content:v.trim()})});if(!t.ok){let a=await t.json();m(a.error||e("template.errors.create"));return}f(""),x(""),await T()}catch(t){m(e("template.errors.create"))}finally{g(!1)}},_=async()=>{if(!b||!j.trim()||!N.trim())return void m(e("template.errors.nameAndContentRequired"));z(!0),m(null);try{let t=await fetch("/api/templates/".concat(b),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:j.trim(),content:N.trim()})});if(!t.ok){let a=await t.json();m(a.error||e("template.errors.update"));return}y(null),await T()}catch(t){m(e("template.errors.update"))}finally{z(!1)}},P=async a=>{if(await t({description:e("template.deleteConfirm"),variant:"danger"})){m(null);try{let t=await fetch("/api/templates/".concat(a),{method:"DELETE"});if(!t.ok){let a=await t.json();m(a.error||e("template.errors.delete"));return}await T()}catch(t){m(e("template.errors.delete"))}}},E=()=>{y(null),w(""),k("")};return(0,r.jsxs)("div",{"data-testid":"template-tab",children:[d&&(0,r.jsx)("div",{className:"mb-4 p-3 bg-danger-subtle text-danger-foreground rounded-lg text-sm","data-testid":"template-error",children:d}),(0,r.jsxs)("div",{className:"mb-6",children:[(0,r.jsx)("h2",{className:"text-lg font-semibold text-foreground mb-3",children:e("template.heading",{count:a.length,max:u.$h})}),o?(0,r.jsx)("div",{className:"space-y-3","data-testid":"template-loading",role:"status","aria-label":e("template.loading"),children:[0,1].map(e=>(0,r.jsx)(l.Zp,{padding:"md",children:(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(l.EA,{className:"h-4 w-32"}),(0,r.jsx)(l.EA,{className:"h-3 w-full"}),(0,r.jsx)(l.EA,{className:"h-3 w-2/3"})]})},e))}):0===a.length?(0,r.jsx)("div",{className:"text-sm text-muted-foreground","data-testid":"template-empty",children:e("template.empty")}):(0,r.jsx)("div",{className:"space-y-3","data-testid":"template-list",children:a.map(t=>(0,r.jsx)(l.Zp,{padding:"sm","data-testid":"template-item-".concat(t.id),children:b===t.id?(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(l.pd,{type:"text",inputSize:"sm",value:j,onChange:e=>w(e.target.value),maxLength:u.Nb,"data-testid":"edit-name-input"}),(0,r.jsx)(l.k_,{value:N,onChange:e=>k(e.target.value),maxLength:u.bm,rows:3,className:"resize-y","data-testid":"edit-content-input"}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(l.$n,{variant:"primary",size:"sm",onClick:_,disabled:C,"data-testid":"edit-save-button",children:C?e("template.saving"):e("template.save")}),(0,r.jsx)(l.$n,{variant:"secondary",size:"sm",onClick:E,"data-testid":"edit-cancel-button",children:e("template.cancel")})]})]}):(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,r.jsx)("span",{className:"font-medium text-sm text-foreground","data-testid":"template-name",children:t.name}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(l.$n,{variant:"secondary",size:"sm",onClick:()=>{y(t.id),w(t.name),k(t.content)},"data-testid":"edit-button-".concat(t.id),children:e("template.edit")}),(0,r.jsx)(l.$n,{variant:"danger",size:"sm",onClick:()=>P(t.id),"data-testid":"delete-button-".concat(t.id),children:e("template.delete")})]})]}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground whitespace-pre-wrap","data-testid":"template-content",children:t.content})]})},t.id))})]}),a.length<u.$h&&(0,r.jsxs)("div",{className:"p-4 bg-surface border border-border rounded-lg shadow-sm","data-testid":"create-form",children:[(0,r.jsx)("h3",{className:"text-sm font-semibold text-foreground mb-3",children:e("template.newHeading")}),(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsx)(l.pd,{type:"text",value:p,onChange:e=>f(e.target.value),maxLength:u.Nb,placeholder:e("template.namePlaceholder"),"data-testid":"new-name-input"}),(0,r.jsx)(l.k_,{value:v,onChange:e=>x(e.target.value),maxLength:u.bm,rows:3,placeholder:e("template.contentPlaceholder"),className:"resize-y","data-testid":"new-content-input"}),(0,r.jsx)(l.$n,{variant:"primary",onClick:A,disabled:h||!p.trim()||!v.trim(),"data-testid":"create-button",children:h?e("template.creating"):e("template.create")})]})]})]})}let P=[{value:"review",labelKey:"tabs.review"},{value:"report",labelKey:"tabs.report"},{value:"template",labelKey:"tabs.template"}];function E(){let e=(0,s.c)("review"),[t,a]=(0,n.useState)("review");return(0,r.jsxs)("div",{className:"container-custom py-8 overflow-auto h-full",children:[(0,r.jsxs)("div",{className:"mb-6",children:[(0,r.jsx)("h1",{className:"text-2xl font-bold text-foreground mb-2",children:e("page.title")}),(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:e("page.description")})]}),(0,r.jsxs)(l.tU,{value:t,onValueChange:e=>a(e),children:[(0,r.jsx)(l.j7,{className:"mb-6 w-full justify-start","data-testid":"page-tabs",children:P.map(t=>(0,r.jsx)(l.Xi,{value:t.value,"data-testid":"page-tab-".concat(t.value),children:e(t.labelKey)},t.value))}),(0,r.jsx)(l.av,{value:"review",children:(0,r.jsx)(n.Suspense,{fallback:null,children:(0,r.jsx)(j,{})})}),(0,r.jsx)(l.av,{value:"report",children:(0,r.jsx)(A,{})}),(0,r.jsx)(l.av,{value:"template",children:(0,r.jsx)(_,{})})]})]})}},20063:(e,t,a)=>{"use strict";var r=a(47260);a.o(r,"useParams")&&a.d(t,{useParams:function(){return r.useParams}}),a.o(r,"usePathname")&&a.d(t,{usePathname:function(){return r.usePathname}}),a.o(r,"useRouter")&&a.d(t,{useRouter:function(){return r.useRouter}}),a.o(r,"useSearchParams")&&a.d(t,{useSearchParams:function(){return r.useSearchParams}})},44308:(e,t,a)=>{"use strict";a.d(t,{$h:()=>u,DR:()=>n,IH:()=>c,Iu:()=>r,Nb:()=>m,SD:()=>s,_d:()=>o,bm:()=>p,ks:()=>i,t7:()=>d,z7:()=>l});let r=7e3,n=["in_review","approval","stalled"],s="in_review",l="filter",i="/review?".concat(l,"=approval");function o(e){return e&&n.includes(e)?e:null}let c=["claude","codex","copilot","antigravity","opencode"],d=1e3,u=5,m=100,p=1e3},46892:(e,t,a)=>{"use strict";a.d(t,{PL:()=>n,sb:()=>s});let r={idle:"bg-muted-foreground",ready:"bg-success",spinner:"border-info",waiting:"bg-warning"},n={idle:{className:r.idle,labelKey:"status.idle",type:"dot"},ready:{className:r.ready,labelKey:"status.ready",type:"dot"},running:{className:r.spinner,labelKey:"status.running",type:"spinner"},waiting:{className:r.waiting,labelKey:"status.waiting",type:"dot"},generating:{className:r.spinner,labelKey:"status.generating",type:"spinner"}},s={idle:"detailStatus.idle",ready:"detailStatus.ready",running:"detailStatus.running",waiting:"detailStatus.waiting"}},54014:(e,t,a)=>{"use strict";a.d(t,{Ab:()=>n,NL:()=>x,O6:()=>p,XH:()=>r,f_:()=>u,hR:()=>c,lu:()=>f,n6:()=>i,oo:()=>d,pQ:()=>s,sw:()=>m,vz:()=>v});let r=["claude","codex","gemini","vibe-local","opencode","copilot","antigravity","command-code","opencode-v2"],n=10,s=50,l=/^[a-zA-Z0-9_-]+$/;function i(e){return"string"==typeof e&&e.length>0&&e.length<=64&&l.test(e)}let o={claude:"Claude",codex:"Codex",gemini:"Gemini","vibe-local":"Vibe Local",opencode:"OpenCode",copilot:"Copilot",antigravity:"Antigravity","command-code":"Command Code","opencode-v2":"OpenCode V2"};function c(e){return r.includes(e)}function d(e){var t;return null!=(t=o[e])?t:e}function u(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Assistant";return e&&c(e)?d(e):t}function m(e){let t=e.alias;return"string"==typeof t&&t.trim().length>0?t:d(e.cliTool)}function p(e,t,a){let r=e.find(e=>e.id===t);return r?m(r):d(a)}function f(e){return e.map((e,t)=>({id:e,cliTool:e,alias:d(e),order:t}))}let v=128,x=2097152},55449:(e,t,a)=>{"use strict";a.d(t,{IK:()=>o,qD:()=>u,sA:()=>i,zk:()=>n});var r=a(63001);let n="/api/settings/default-agents",s=r.fJ,l=new Set;function i(){return s}function o(e){if(!Array.isArray(e))return!1;let t=(0,r.Lt)(e);if(!t.valid)return!1;let a=t.value;if(a.length===s.length&&a.every((e,t)=>e===s[t]))return!1;for(let e of(s=a,l))e();return!0}let c=null,d=!1;async function u(){return d?s:c||("function"!=typeof fetch?s:c=(async()=>{try{let e=await fetch(n);if(e.ok){let t=await e.json();o(null==t?void 0:t.defaultSelectedAgents),d=!0}}catch(e){}finally{c=null}return s})())}},60322:(e,t,a)=>{"use strict";a.d(t,{l:()=>n});let r=/\x1b\[[0-9;]*[a-zA-Z]|\x1b\][^\x07]*\x07|\[[0-9;]*m/g;async function n(e){var t;if(!e||0===e.trim().length)return;let a=e.replace(r,"");if(null==(t=navigator.clipboard)?void 0:t.writeText)try{await navigator.clipboard.writeText(a);return}catch(e){}let n=document.createElement("textarea");n.value=a,n.style.position="fixed",n.style.left="-9999px",n.style.top="-9999px",n.style.opacity="0",document.body.appendChild(n),n.focus(),n.select();try{document.execCommand("copy")}finally{document.body.removeChild(n)}}},63001:(e,t,a)=>{"use strict";a.d(t,{Lt:()=>i,Wj:()=>s,eu:()=>n,fJ:()=>l});var r=a(54014);let n=2,s=6,l=["claude","codex","antigravity"];function i(e){return e.length<n||e.length>s?{valid:!1,error:"Must be ".concat(n,"-").concat(s," elements")}:e.every(e=>"string"==typeof e&&r.XH.includes(e))?new Set(e).size!==e.length?{valid:!1,error:"Duplicate tool IDs not allowed"}:{valid:!0,value:e}:{valid:!1,error:"Invalid CLI tool ID"}}},76471:(e,t,a)=>{"use strict";a.d(t,{Ej:()=>d,Jd:()=>i,Mq:()=>c,rH:()=>o});var r=a(95155),n=a(12115),s=a(18955),l=a(48481);let i="bg-transparent border-2 border-muted-foreground",o="status.unknown";function c(e,t){return!0===t&&"ready"===e}let d=(0,n.memo)(function(e){let{status:t,label:a,waitingKind:n,unclassified:d}=e,u=(0,s.c)("common"),m=c(t,d);return(0,r.jsx)(l.m,{"data-testid":"status-indicator",status:t,label:m?null!=a?a:u(o):a,waitingKind:n,size:"sm",className:m?i:void 0,"data-unclassified":m?"true":void 0})})},80488:(e,t,a)=>{Promise.resolve().then(a.bind(a,17442))}},e=>{e.O(0,[6809,4909,2770,2619,8407,8606,8441,1255,7358],()=>e(e.s=80488)),_N_E=e.O()}]);