commandmate 0.10.3 → 0.10.4

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 (383) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-build-manifest.json +135 -135
  3. package/.next/app-path-routes-manifest.json +28 -28
  4. package/.next/build-manifest.json +2 -2
  5. package/.next/prerender-manifest.json +15 -15
  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/app/update/route.js +3 -3
  9. package/.next/server/app/api/app/update/route_client-reference-manifest.js +1 -1
  10. package/.next/server/app/api/app/update-check/route.js +1 -1
  11. package/.next/server/app/api/app/update-check/route_client-reference-manifest.js +1 -1
  12. package/.next/server/app/api/assistant/conversation/route.js +1 -1
  13. package/.next/server/app/api/assistant/conversation/route.js.nft.json +1 -1
  14. package/.next/server/app/api/assistant/conversation/route_client-reference-manifest.js +1 -1
  15. package/.next/server/app/api/assistant/current-output/route.js +1 -1
  16. package/.next/server/app/api/assistant/current-output/route.js.nft.json +1 -1
  17. package/.next/server/app/api/assistant/current-output/route_client-reference-manifest.js +1 -1
  18. package/.next/server/app/api/assistant/messages/route.js +1 -1
  19. package/.next/server/app/api/assistant/messages/route.js.nft.json +1 -1
  20. package/.next/server/app/api/assistant/messages/route_client-reference-manifest.js +1 -1
  21. package/.next/server/app/api/assistant/session/route.js +1 -1
  22. package/.next/server/app/api/assistant/session/route.js.nft.json +1 -1
  23. package/.next/server/app/api/assistant/session/route_client-reference-manifest.js +1 -1
  24. package/.next/server/app/api/assistant/start/route.js +1 -1
  25. package/.next/server/app/api/assistant/start/route.js.nft.json +1 -1
  26. package/.next/server/app/api/assistant/start/route_client-reference-manifest.js +1 -1
  27. package/.next/server/app/api/assistant/terminal/route.js +3 -2
  28. package/.next/server/app/api/assistant/terminal/route.js.nft.json +1 -1
  29. package/.next/server/app/api/assistant/terminal/route_client-reference-manifest.js +1 -1
  30. package/.next/server/app/api/assistant/tools/route.js +1 -1
  31. package/.next/server/app/api/assistant/tools/route.js.nft.json +1 -1
  32. package/.next/server/app/api/assistant/tools/route_client-reference-manifest.js +1 -1
  33. package/.next/server/app/api/auth/login/route_client-reference-manifest.js +1 -1
  34. package/.next/server/app/api/auth/logout/route_client-reference-manifest.js +1 -1
  35. package/.next/server/app/api/auth/status/route_client-reference-manifest.js +1 -1
  36. package/.next/server/app/api/daily-summary/route.js +1 -1
  37. package/.next/server/app/api/daily-summary/route.js.nft.json +1 -1
  38. package/.next/server/app/api/daily-summary/route_client-reference-manifest.js +1 -1
  39. package/.next/server/app/api/daily-summary/status/route.js +1 -1
  40. package/.next/server/app/api/daily-summary/status/route.js.nft.json +1 -1
  41. package/.next/server/app/api/daily-summary/status/route_client-reference-manifest.js +1 -1
  42. package/.next/server/app/api/external-apps/[id]/health/route_client-reference-manifest.js +1 -1
  43. package/.next/server/app/api/external-apps/[id]/route_client-reference-manifest.js +1 -1
  44. package/.next/server/app/api/external-apps/route_client-reference-manifest.js +1 -1
  45. package/.next/server/app/api/hooks/claude-done/route.js +1 -1
  46. package/.next/server/app/api/hooks/claude-done/route.js.nft.json +1 -1
  47. package/.next/server/app/api/hooks/claude-done/route_client-reference-manifest.js +1 -1
  48. package/.next/server/app/api/ollama/models/route_client-reference-manifest.js +1 -1
  49. package/.next/server/app/api/push/subscriptions/route.js +1 -1
  50. package/.next/server/app/api/push/subscriptions/route.js.nft.json +1 -1
  51. package/.next/server/app/api/push/subscriptions/route_client-reference-manifest.js +1 -1
  52. package/.next/server/app/api/push/vapid/route_client-reference-manifest.js +1 -1
  53. package/.next/server/app/api/repositories/[id]/route.js +1 -47
  54. package/.next/server/app/api/repositories/[id]/route.js.nft.json +1 -1
  55. package/.next/server/app/api/repositories/[id]/route_client-reference-manifest.js +1 -1
  56. package/.next/server/app/api/repositories/[id]/todos/[todoId]/route.js +1 -1
  57. package/.next/server/app/api/repositories/[id]/todos/[todoId]/route.js.nft.json +1 -1
  58. package/.next/server/app/api/repositories/[id]/todos/[todoId]/route_client-reference-manifest.js +1 -1
  59. package/.next/server/app/api/repositories/[id]/todos/route.js +1 -1
  60. package/.next/server/app/api/repositories/[id]/todos/route.js.nft.json +1 -1
  61. package/.next/server/app/api/repositories/[id]/todos/route_client-reference-manifest.js +1 -1
  62. package/.next/server/app/api/repositories/clone/[jobId]/route.js +1 -1
  63. package/.next/server/app/api/repositories/clone/[jobId]/route.js.nft.json +1 -1
  64. package/.next/server/app/api/repositories/clone/[jobId]/route_client-reference-manifest.js +1 -1
  65. package/.next/server/app/api/repositories/clone/route.js +1 -1
  66. package/.next/server/app/api/repositories/clone/route.js.nft.json +1 -1
  67. package/.next/server/app/api/repositories/clone/route_client-reference-manifest.js +1 -1
  68. package/.next/server/app/api/repositories/excluded/route.js +1 -47
  69. package/.next/server/app/api/repositories/excluded/route.js.nft.json +1 -1
  70. package/.next/server/app/api/repositories/excluded/route_client-reference-manifest.js +1 -1
  71. package/.next/server/app/api/repositories/restore/route.js +1 -1
  72. package/.next/server/app/api/repositories/restore/route.js.nft.json +1 -1
  73. package/.next/server/app/api/repositories/restore/route_client-reference-manifest.js +1 -1
  74. package/.next/server/app/api/repositories/route.js +1 -1
  75. package/.next/server/app/api/repositories/route.js.nft.json +1 -1
  76. package/.next/server/app/api/repositories/route_client-reference-manifest.js +1 -1
  77. package/.next/server/app/api/repositories/scan/route.js +1 -1
  78. package/.next/server/app/api/repositories/scan/route.js.nft.json +1 -1
  79. package/.next/server/app/api/repositories/scan/route_client-reference-manifest.js +1 -1
  80. package/.next/server/app/api/repositories/sync/route.js +1 -1
  81. package/.next/server/app/api/repositories/sync/route.js.nft.json +1 -1
  82. package/.next/server/app/api/repositories/sync/route_client-reference-manifest.js +1 -1
  83. package/.next/server/app/api/sidebar/group-order/route_client-reference-manifest.js +1 -1
  84. package/.next/server/app/api/slash-commands/route_client-reference-manifest.js +1 -1
  85. package/.next/server/app/api/templates/[id]/route_client-reference-manifest.js +1 -1
  86. package/.next/server/app/api/templates/route_client-reference-manifest.js +1 -1
  87. package/.next/server/app/api/todos/route.js +1 -1
  88. package/.next/server/app/api/todos/route.js.nft.json +1 -1
  89. package/.next/server/app/api/todos/route_client-reference-manifest.js +1 -1
  90. package/.next/server/app/api/worktrees/[id]/auto-yes/route.js +1 -1
  91. package/.next/server/app/api/worktrees/[id]/auto-yes/route.js.nft.json +1 -1
  92. package/.next/server/app/api/worktrees/[id]/auto-yes/route_client-reference-manifest.js +1 -1
  93. package/.next/server/app/api/worktrees/[id]/capture/route.js +1 -1
  94. package/.next/server/app/api/worktrees/[id]/capture/route.js.nft.json +1 -1
  95. package/.next/server/app/api/worktrees/[id]/capture/route_client-reference-manifest.js +1 -1
  96. package/.next/server/app/api/worktrees/[id]/cli-tool/route.js +1 -1
  97. package/.next/server/app/api/worktrees/[id]/cli-tool/route.js.nft.json +1 -1
  98. package/.next/server/app/api/worktrees/[id]/cli-tool/route_client-reference-manifest.js +1 -1
  99. package/.next/server/app/api/worktrees/[id]/cmate/schedules/route.js +1 -1
  100. package/.next/server/app/api/worktrees/[id]/cmate/schedules/route.js.nft.json +1 -1
  101. package/.next/server/app/api/worktrees/[id]/cmate/schedules/route_client-reference-manifest.js +1 -1
  102. package/.next/server/app/api/worktrees/[id]/current-output/route.js +1 -1
  103. package/.next/server/app/api/worktrees/[id]/current-output/route.js.nft.json +1 -1
  104. package/.next/server/app/api/worktrees/[id]/current-output/route_client-reference-manifest.js +1 -1
  105. package/.next/server/app/api/worktrees/[id]/execution-logs/[logId]/route.js +1 -1
  106. package/.next/server/app/api/worktrees/[id]/execution-logs/[logId]/route.js.nft.json +1 -1
  107. package/.next/server/app/api/worktrees/[id]/execution-logs/[logId]/route_client-reference-manifest.js +1 -1
  108. package/.next/server/app/api/worktrees/[id]/execution-logs/route.js +2 -2
  109. package/.next/server/app/api/worktrees/[id]/execution-logs/route.js.nft.json +1 -1
  110. package/.next/server/app/api/worktrees/[id]/execution-logs/route_client-reference-manifest.js +1 -1
  111. package/.next/server/app/api/worktrees/[id]/files/[...path]/route.js +1 -1
  112. package/.next/server/app/api/worktrees/[id]/files/[...path]/route.js.nft.json +1 -1
  113. package/.next/server/app/api/worktrees/[id]/files/[...path]/route_client-reference-manifest.js +1 -1
  114. package/.next/server/app/api/worktrees/[id]/git/branch/create/route.js +1 -1
  115. package/.next/server/app/api/worktrees/[id]/git/branch/create/route.js.nft.json +1 -1
  116. package/.next/server/app/api/worktrees/[id]/git/branch/create/route_client-reference-manifest.js +1 -1
  117. package/.next/server/app/api/worktrees/[id]/git/branch/delete/route.js +1 -1
  118. package/.next/server/app/api/worktrees/[id]/git/branch/delete/route.js.nft.json +1 -1
  119. package/.next/server/app/api/worktrees/[id]/git/branch/delete/route_client-reference-manifest.js +1 -1
  120. package/.next/server/app/api/worktrees/[id]/git/branches/route.js +1 -1
  121. package/.next/server/app/api/worktrees/[id]/git/branches/route.js.nft.json +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.js.nft.json +1 -1
  125. package/.next/server/app/api/worktrees/[id]/git/checkout/route_client-reference-manifest.js +1 -1
  126. package/.next/server/app/api/worktrees/[id]/git/commit/route.js +1 -1
  127. package/.next/server/app/api/worktrees/[id]/git/commit/route.js.nft.json +1 -1
  128. package/.next/server/app/api/worktrees/[id]/git/commit/route_client-reference-manifest.js +1 -1
  129. package/.next/server/app/api/worktrees/[id]/git/diff/route.js +1 -1
  130. package/.next/server/app/api/worktrees/[id]/git/diff/route.js.nft.json +1 -1
  131. package/.next/server/app/api/worktrees/[id]/git/diff/route_client-reference-manifest.js +1 -1
  132. package/.next/server/app/api/worktrees/[id]/git/fetch/route.js +1 -1
  133. package/.next/server/app/api/worktrees/[id]/git/fetch/route.js.nft.json +1 -1
  134. package/.next/server/app/api/worktrees/[id]/git/fetch/route_client-reference-manifest.js +1 -1
  135. package/.next/server/app/api/worktrees/[id]/git/log/route.js +1 -1
  136. package/.next/server/app/api/worktrees/[id]/git/log/route.js.nft.json +1 -1
  137. package/.next/server/app/api/worktrees/[id]/git/log/route_client-reference-manifest.js +1 -1
  138. package/.next/server/app/api/worktrees/[id]/git/pull/route.js +1 -1
  139. package/.next/server/app/api/worktrees/[id]/git/pull/route.js.nft.json +1 -1
  140. package/.next/server/app/api/worktrees/[id]/git/pull/route_client-reference-manifest.js +1 -1
  141. package/.next/server/app/api/worktrees/[id]/git/push/route.js +1 -1
  142. package/.next/server/app/api/worktrees/[id]/git/push/route.js.nft.json +1 -1
  143. package/.next/server/app/api/worktrees/[id]/git/push/route_client-reference-manifest.js +1 -1
  144. package/.next/server/app/api/worktrees/[id]/git/reset/route.js +1 -1
  145. package/.next/server/app/api/worktrees/[id]/git/reset/route.js.nft.json +1 -1
  146. package/.next/server/app/api/worktrees/[id]/git/reset/route_client-reference-manifest.js +1 -1
  147. package/.next/server/app/api/worktrees/[id]/git/revert/route.js +1 -1
  148. package/.next/server/app/api/worktrees/[id]/git/revert/route.js.nft.json +1 -1
  149. package/.next/server/app/api/worktrees/[id]/git/revert/route_client-reference-manifest.js +1 -1
  150. package/.next/server/app/api/worktrees/[id]/git/show/[commitHash]/route.js +1 -1
  151. package/.next/server/app/api/worktrees/[id]/git/show/[commitHash]/route.js.nft.json +1 -1
  152. package/.next/server/app/api/worktrees/[id]/git/show/[commitHash]/route_client-reference-manifest.js +1 -1
  153. package/.next/server/app/api/worktrees/[id]/git/stage/route.js +1 -1
  154. package/.next/server/app/api/worktrees/[id]/git/stage/route.js.nft.json +1 -1
  155. package/.next/server/app/api/worktrees/[id]/git/stage/route_client-reference-manifest.js +1 -1
  156. package/.next/server/app/api/worktrees/[id]/git/staged/route.js +1 -1
  157. package/.next/server/app/api/worktrees/[id]/git/staged/route.js.nft.json +1 -1
  158. package/.next/server/app/api/worktrees/[id]/git/staged/route_client-reference-manifest.js +1 -1
  159. package/.next/server/app/api/worktrees/[id]/git/stash/[index]/route.js +1 -1
  160. package/.next/server/app/api/worktrees/[id]/git/stash/[index]/route.js.nft.json +1 -1
  161. package/.next/server/app/api/worktrees/[id]/git/stash/[index]/route_client-reference-manifest.js +1 -1
  162. package/.next/server/app/api/worktrees/[id]/git/stash/apply/route.js +1 -1
  163. package/.next/server/app/api/worktrees/[id]/git/stash/apply/route.js.nft.json +1 -1
  164. package/.next/server/app/api/worktrees/[id]/git/stash/apply/route_client-reference-manifest.js +1 -1
  165. package/.next/server/app/api/worktrees/[id]/git/stash/pop/route.js +1 -1
  166. package/.next/server/app/api/worktrees/[id]/git/stash/pop/route.js.nft.json +1 -1
  167. package/.next/server/app/api/worktrees/[id]/git/stash/pop/route_client-reference-manifest.js +1 -1
  168. package/.next/server/app/api/worktrees/[id]/git/stash/push/route.js +1 -1
  169. package/.next/server/app/api/worktrees/[id]/git/stash/push/route.js.nft.json +1 -1
  170. package/.next/server/app/api/worktrees/[id]/git/stash/push/route_client-reference-manifest.js +1 -1
  171. package/.next/server/app/api/worktrees/[id]/git/stash/route.js +1 -1
  172. package/.next/server/app/api/worktrees/[id]/git/stash/route.js.nft.json +1 -1
  173. package/.next/server/app/api/worktrees/[id]/git/stash/route_client-reference-manifest.js +1 -1
  174. package/.next/server/app/api/worktrees/[id]/git/status/route.js +1 -1
  175. package/.next/server/app/api/worktrees/[id]/git/status/route.js.nft.json +1 -1
  176. package/.next/server/app/api/worktrees/[id]/git/status/route_client-reference-manifest.js +1 -1
  177. package/.next/server/app/api/worktrees/[id]/git/unstage/route.js +1 -1
  178. package/.next/server/app/api/worktrees/[id]/git/unstage/route.js.nft.json +1 -1
  179. package/.next/server/app/api/worktrees/[id]/git/unstage/route_client-reference-manifest.js +1 -1
  180. package/.next/server/app/api/worktrees/[id]/git/working-diff/route.js +1 -1
  181. package/.next/server/app/api/worktrees/[id]/git/working-diff/route.js.nft.json +1 -1
  182. package/.next/server/app/api/worktrees/[id]/git/working-diff/route_client-reference-manifest.js +1 -1
  183. package/.next/server/app/api/worktrees/[id]/interrupt/route.js +1 -1
  184. package/.next/server/app/api/worktrees/[id]/interrupt/route.js.nft.json +1 -1
  185. package/.next/server/app/api/worktrees/[id]/interrupt/route_client-reference-manifest.js +1 -1
  186. package/.next/server/app/api/worktrees/[id]/kill-session/route.js +1 -1
  187. package/.next/server/app/api/worktrees/[id]/kill-session/route.js.nft.json +1 -1
  188. package/.next/server/app/api/worktrees/[id]/kill-session/route_client-reference-manifest.js +1 -1
  189. package/.next/server/app/api/worktrees/[id]/logs/[filename]/route.js +1 -1
  190. package/.next/server/app/api/worktrees/[id]/logs/[filename]/route.js.nft.json +1 -1
  191. package/.next/server/app/api/worktrees/[id]/logs/[filename]/route_client-reference-manifest.js +1 -1
  192. package/.next/server/app/api/worktrees/[id]/logs/route.js +1 -1
  193. package/.next/server/app/api/worktrees/[id]/logs/route.js.nft.json +1 -1
  194. package/.next/server/app/api/worktrees/[id]/logs/route_client-reference-manifest.js +1 -1
  195. package/.next/server/app/api/worktrees/[id]/marp-render/route.js +2 -2
  196. package/.next/server/app/api/worktrees/[id]/marp-render/route.js.nft.json +1 -1
  197. package/.next/server/app/api/worktrees/[id]/marp-render/route_client-reference-manifest.js +1 -1
  198. package/.next/server/app/api/worktrees/[id]/memos/[memoId]/route.js +1 -1
  199. package/.next/server/app/api/worktrees/[id]/memos/[memoId]/route.js.nft.json +1 -1
  200. package/.next/server/app/api/worktrees/[id]/memos/[memoId]/route_client-reference-manifest.js +1 -1
  201. package/.next/server/app/api/worktrees/[id]/memos/route.js +1 -1
  202. package/.next/server/app/api/worktrees/[id]/memos/route.js.nft.json +1 -1
  203. package/.next/server/app/api/worktrees/[id]/memos/route_client-reference-manifest.js +1 -1
  204. package/.next/server/app/api/worktrees/[id]/messages/route.js +1 -1
  205. package/.next/server/app/api/worktrees/[id]/messages/route.js.nft.json +1 -1
  206. package/.next/server/app/api/worktrees/[id]/messages/route_client-reference-manifest.js +1 -1
  207. package/.next/server/app/api/worktrees/[id]/prompt-response/route.js +1 -1
  208. package/.next/server/app/api/worktrees/[id]/prompt-response/route.js.nft.json +1 -1
  209. package/.next/server/app/api/worktrees/[id]/prompt-response/route_client-reference-manifest.js +1 -1
  210. package/.next/server/app/api/worktrees/[id]/respond/route.js +1 -1
  211. package/.next/server/app/api/worktrees/[id]/respond/route.js.nft.json +1 -1
  212. package/.next/server/app/api/worktrees/[id]/respond/route_client-reference-manifest.js +1 -1
  213. package/.next/server/app/api/worktrees/[id]/route.js +1 -1
  214. package/.next/server/app/api/worktrees/[id]/route.js.nft.json +1 -1
  215. package/.next/server/app/api/worktrees/[id]/route_client-reference-manifest.js +1 -1
  216. package/.next/server/app/api/worktrees/[id]/schedules/[scheduleId]/route.js +1 -1
  217. package/.next/server/app/api/worktrees/[id]/schedules/[scheduleId]/route.js.nft.json +1 -1
  218. package/.next/server/app/api/worktrees/[id]/schedules/[scheduleId]/route_client-reference-manifest.js +1 -1
  219. package/.next/server/app/api/worktrees/[id]/schedules/active/route.js +1 -1
  220. package/.next/server/app/api/worktrees/[id]/schedules/active/route.js.nft.json +1 -1
  221. package/.next/server/app/api/worktrees/[id]/schedules/active/route_client-reference-manifest.js +1 -1
  222. package/.next/server/app/api/worktrees/[id]/schedules/route.js +2 -2
  223. package/.next/server/app/api/worktrees/[id]/schedules/route.js.nft.json +1 -1
  224. package/.next/server/app/api/worktrees/[id]/schedules/route_client-reference-manifest.js +1 -1
  225. package/.next/server/app/api/worktrees/[id]/search/route.js +1 -1
  226. package/.next/server/app/api/worktrees/[id]/search/route.js.nft.json +1 -1
  227. package/.next/server/app/api/worktrees/[id]/search/route_client-reference-manifest.js +1 -1
  228. package/.next/server/app/api/worktrees/[id]/send/route.js +1 -1
  229. package/.next/server/app/api/worktrees/[id]/send/route.js.nft.json +1 -1
  230. package/.next/server/app/api/worktrees/[id]/send/route_client-reference-manifest.js +1 -1
  231. package/.next/server/app/api/worktrees/[id]/slash-commands/route.js +1 -1
  232. package/.next/server/app/api/worktrees/[id]/slash-commands/route.js.nft.json +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]/start-polling/route.js +1 -1
  238. package/.next/server/app/api/worktrees/[id]/start-polling/route.js.nft.json +1 -1
  239. package/.next/server/app/api/worktrees/[id]/start-polling/route_client-reference-manifest.js +1 -1
  240. package/.next/server/app/api/worktrees/[id]/terminal/route.js +1 -1
  241. package/.next/server/app/api/worktrees/[id]/terminal/route.js.nft.json +1 -1
  242. package/.next/server/app/api/worktrees/[id]/terminal/route_client-reference-manifest.js +1 -1
  243. package/.next/server/app/api/worktrees/[id]/timers/history/route.js +1 -1
  244. package/.next/server/app/api/worktrees/[id]/timers/history/route.js.nft.json +1 -1
  245. package/.next/server/app/api/worktrees/[id]/timers/history/route_client-reference-manifest.js +1 -1
  246. package/.next/server/app/api/worktrees/[id]/timers/route.js +1 -1
  247. package/.next/server/app/api/worktrees/[id]/timers/route.js.nft.json +1 -1
  248. package/.next/server/app/api/worktrees/[id]/timers/route_client-reference-manifest.js +1 -1
  249. package/.next/server/app/api/worktrees/[id]/todos/[todoId]/route.js +1 -1
  250. package/.next/server/app/api/worktrees/[id]/todos/[todoId]/route.js.nft.json +1 -1
  251. package/.next/server/app/api/worktrees/[id]/todos/[todoId]/route_client-reference-manifest.js +1 -1
  252. package/.next/server/app/api/worktrees/[id]/todos/route.js +1 -1
  253. package/.next/server/app/api/worktrees/[id]/todos/route.js.nft.json +1 -1
  254. package/.next/server/app/api/worktrees/[id]/todos/route_client-reference-manifest.js +1 -1
  255. package/.next/server/app/api/worktrees/[id]/tree/[...path]/route.js +1 -1
  256. package/.next/server/app/api/worktrees/[id]/tree/[...path]/route.js.nft.json +1 -1
  257. package/.next/server/app/api/worktrees/[id]/tree/[...path]/route_client-reference-manifest.js +1 -1
  258. package/.next/server/app/api/worktrees/[id]/tree/route.js +1 -1
  259. package/.next/server/app/api/worktrees/[id]/tree/route.js.nft.json +1 -1
  260. package/.next/server/app/api/worktrees/[id]/tree/route_client-reference-manifest.js +1 -1
  261. package/.next/server/app/api/worktrees/[id]/upload/[...path]/route.js +1 -1
  262. package/.next/server/app/api/worktrees/[id]/upload/[...path]/route.js.nft.json +1 -1
  263. package/.next/server/app/api/worktrees/[id]/upload/[...path]/route_client-reference-manifest.js +1 -1
  264. package/.next/server/app/api/worktrees/[id]/viewed/route.js +1 -1
  265. package/.next/server/app/api/worktrees/[id]/viewed/route.js.nft.json +1 -1
  266. package/.next/server/app/api/worktrees/[id]/viewed/route_client-reference-manifest.js +1 -1
  267. package/.next/server/app/api/worktrees/route.js +1 -1
  268. package/.next/server/app/api/worktrees/route.js.nft.json +1 -1
  269. package/.next/server/app/api/worktrees/route_client-reference-manifest.js +1 -1
  270. package/.next/server/app/chat/page.js +1 -1
  271. package/.next/server/app/chat/page.js.nft.json +1 -1
  272. package/.next/server/app/chat/page_client-reference-manifest.js +1 -1
  273. package/.next/server/app/login/page_client-reference-manifest.js +1 -1
  274. package/.next/server/app/manifest.webmanifest/route_client-reference-manifest.js +1 -1
  275. package/.next/server/app/more/page.js +2 -2
  276. package/.next/server/app/more/page.js.nft.json +1 -1
  277. package/.next/server/app/more/page_client-reference-manifest.js +1 -1
  278. package/.next/server/app/offline/page_client-reference-manifest.js +1 -1
  279. package/.next/server/app/page.js +1 -1
  280. package/.next/server/app/page.js.nft.json +1 -1
  281. package/.next/server/app/page_client-reference-manifest.js +1 -1
  282. package/.next/server/app/proxy/[...path]/route_client-reference-manifest.js +1 -1
  283. package/.next/server/app/repositories/page.js +1 -1
  284. package/.next/server/app/repositories/page.js.nft.json +1 -1
  285. package/.next/server/app/repositories/page_client-reference-manifest.js +1 -1
  286. package/.next/server/app/review/page.js +1 -1
  287. package/.next/server/app/review/page.js.nft.json +1 -1
  288. package/.next/server/app/review/page_client-reference-manifest.js +1 -1
  289. package/.next/server/app/sessions/page.js +1 -1
  290. package/.next/server/app/sessions/page.js.nft.json +1 -1
  291. package/.next/server/app/sessions/page_client-reference-manifest.js +1 -1
  292. package/.next/server/app/worktrees/[id]/files/[...path]/page_client-reference-manifest.js +1 -1
  293. package/.next/server/app/worktrees/[id]/page.js +8 -8
  294. package/.next/server/app/worktrees/[id]/page.js.nft.json +1 -1
  295. package/.next/server/app/worktrees/[id]/page_client-reference-manifest.js +1 -1
  296. package/.next/server/app/worktrees/[id]/terminal/page_client-reference-manifest.js +1 -1
  297. package/.next/server/app-paths-manifest.json +28 -28
  298. package/.next/server/chunks/1068.js +1 -1
  299. package/.next/server/chunks/1117.js +1 -0
  300. package/.next/server/chunks/233.js +1 -1
  301. package/.next/server/chunks/2404.js +1 -1
  302. package/.next/server/chunks/3270.js +1 -1
  303. package/.next/server/chunks/3480.js +2 -2
  304. package/.next/server/chunks/3543.js +1 -1
  305. package/.next/server/chunks/3945.js +1 -1
  306. package/.next/server/chunks/406.js +47 -0
  307. package/.next/server/chunks/4444.js +1 -1
  308. package/.next/server/chunks/5381.js +1 -47
  309. package/.next/server/chunks/5959.js +2 -2
  310. package/.next/server/chunks/646.js +33 -0
  311. package/.next/server/chunks/8681.js +1 -0
  312. package/.next/server/chunks/8807.js +305 -300
  313. package/.next/server/chunks/9355.js +1 -1
  314. package/.next/server/chunks/9687.js +1 -1
  315. package/.next/server/middleware-manifest.json +5 -5
  316. package/.next/server/pages/500.html +1 -1
  317. package/.next/server/pages-manifest.json +1 -1
  318. package/.next/server/server-reference-manifest.json +1 -1
  319. package/.next/static/chunks/4560-2bf9cb6504cc4425.js +1 -0
  320. package/.next/static/chunks/7347-a013a163a75030ec.js +1 -0
  321. package/.next/static/chunks/app/chat/page-5d20240f98c07cee.js +1 -0
  322. package/.next/static/chunks/app/layout-fe5857360dfba2b9.js +1 -0
  323. package/.next/static/chunks/app/more/page-af1d2af13ea901d2.js +1 -0
  324. package/.next/static/chunks/app/page-3bbe737ec910d1fb.js +1 -0
  325. package/.next/static/chunks/app/repositories/page-ace9134ac165a6de.js +1 -0
  326. package/.next/static/chunks/app/review/page-331b80f4f58582bc.js +1 -0
  327. package/.next/static/chunks/app/sessions/page-d694149a7e8649b6.js +1 -0
  328. package/.next/static/chunks/app/worktrees/[id]/page-932a52f8d11971f7.js +1 -0
  329. package/.next/static/css/d7e2e8d1b8d69d36.css +1 -0
  330. package/.next/trace +10 -10
  331. package/dist/cli/commands/quickstart.d.ts.map +1 -1
  332. package/dist/cli/commands/quickstart.js +27 -0
  333. package/dist/cli/commands/status.d.ts.map +1 -1
  334. package/dist/cli/commands/status.js +19 -0
  335. package/dist/cli/types/index.d.ts +6 -0
  336. package/dist/cli/types/index.d.ts.map +1 -1
  337. package/dist/cli/utils/agent-instances.d.ts +1 -1
  338. package/dist/cli/utils/agent-instances.d.ts.map +1 -1
  339. package/dist/cli/utils/agent-instances.js +8 -1
  340. package/dist/cli/utils/api-client.d.ts +36 -0
  341. package/dist/cli/utils/api-client.d.ts.map +1 -1
  342. package/dist/cli/utils/api-client.js +82 -0
  343. package/dist/cli/utils/daemon.d.ts.map +1 -1
  344. package/dist/cli/utils/daemon.js +44 -9
  345. package/dist/cli/utils/package-info.d.ts +17 -0
  346. package/dist/cli/utils/package-info.d.ts.map +1 -0
  347. package/dist/cli/utils/package-info.js +31 -0
  348. package/dist/cli/utils/pid-manager.d.ts +65 -9
  349. package/dist/cli/utils/pid-manager.d.ts.map +1 -1
  350. package/dist/cli/utils/pid-manager.js +81 -21
  351. package/dist/cli/utils/process-inspector.d.ts +27 -0
  352. package/dist/cli/utils/process-inspector.d.ts.map +1 -0
  353. package/dist/cli/utils/process-inspector.js +37 -0
  354. package/dist/server/src/config/github-links.js +22 -0
  355. package/dist/server/src/lib/db/db-instance.js +22 -3
  356. package/dist/server/src/lib/db/db-repository.js +107 -19
  357. package/dist/server/src/lib/db/db.js +3 -2
  358. package/dist/server/src/lib/db/memo-db.js +32 -1
  359. package/dist/server/src/lib/db/migrations/index.js +2 -0
  360. package/dist/server/src/lib/db/migrations/runner.js +11 -1
  361. package/dist/server/src/lib/db/migrations/v43-remove-cm-root-dir-ghost-repository.js +126 -0
  362. package/dist/server/src/lib/git/worktrees.js +90 -0
  363. package/dist/server/src/lib/job-executor.js +8 -2
  364. package/dist/server/src/lib/realtime/types.js +76 -0
  365. package/dist/server/src/lib/schedule-manager.js +9 -1
  366. package/dist/server/src/lib/version-checker.js +297 -0
  367. package/dist/server/src/lib/ws-server.js +37 -0
  368. package/package.json +1 -1
  369. package/.next/server/chunks/2464.js +0 -33
  370. package/.next/server/chunks/6791.js +0 -47
  371. package/.next/static/chunks/7347-4a031aecf4664a6d.js +0 -1
  372. package/.next/static/chunks/8954-ce15ee4d0423f1b1.js +0 -1
  373. package/.next/static/chunks/app/chat/page-dee86bdf87516e40.js +0 -1
  374. package/.next/static/chunks/app/layout-d02f4691a4eff86b.js +0 -1
  375. package/.next/static/chunks/app/more/page-39ec8b5f27cf52e7.js +0 -1
  376. package/.next/static/chunks/app/page-ebf1db9826b4065d.js +0 -1
  377. package/.next/static/chunks/app/repositories/page-2be54cae5fcc1f7a.js +0 -1
  378. package/.next/static/chunks/app/review/page-ac4efe6857a0f3bf.js +0 -1
  379. package/.next/static/chunks/app/sessions/page-dc545a3d45374187.js +0 -1
  380. package/.next/static/chunks/app/worktrees/[id]/page-9eb2f37809919531.js +0 -1
  381. package/.next/static/css/eabd34bf2ab147a4.css +0 -1
  382. /package/.next/static/{Ndx_NzkoP54cD0UCmjUlu → uBCIYS1Hth7V4unroKqGu}/_buildManifest.js +0 -0
  383. /package/.next/static/{Ndx_NzkoP54cD0UCmjUlu → uBCIYS1Hth7V4unroKqGu}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- exports.id=9355,exports.ids=[9355],exports.modules={1483:(a,b,c)=>{var d={"./en/keyboardShortcuts.json":[53722,3722],"./ja/keyboardShortcuts.json":[88356,8356]};function e(a){if(!c.o(d,a))return Promise.resolve().then(()=>{var b=Error("Cannot find module '"+a+"'");throw b.code="MODULE_NOT_FOUND",b});var b=d[a],e=b[0];return c.e(b[1]).then(()=>c.t(e,19))}e.keys=()=>Object.keys(d),e.id=1483,a.exports=e},4558:(a,b,c)=>{"use strict";c.d(b,{A:()=>g});var d=c(43692),e=c(86802),f=c(25754);let g=(0,d.A)(async({requestLocale:a})=>{let b=await a;if(!(0,f.d9)(b)){let a=await (0,e.UL)(),c=await (0,e.b3)();b=(0,f.rv)(a.get(f.gB)?.value,c.get("accept-language"))}let[d,g,h,i,j,k,l,m,n,o,p,q,r,s]=await Promise.all([c(61118)(`./${b}/common.json`),c(90338)(`./${b}/worktree.json`),c(62081)(`./${b}/autoYes.json`),c(66125)(`./${b}/error.json`),c(72637)(`./${b}/prompt.json`),c(51877)(`./${b}/auth.json`),c(38898)(`./${b}/schedule.json`),c(80407)(`./${b}/commandPalette.json`),c(70288)(`./${b}/home.json`),c(60887)(`./${b}/review.json`),c(75567)(`./${b}/pwa.json`),c(99127)(`./${b}/notifications.json`),c(1483)(`./${b}/keyboardShortcuts.json`),c(80812)(`./${b}/externalApps.json`)]);return{locale:b,timeZone:"UTC",messages:{common:d.default,worktree:g.default,autoYes:h.default,error:i.default,prompt:j.default,auth:k.default,schedule:l.default,commandPalette:m.default,home:n.default,review:o.default,pwa:p.default,notifications:q.default,keyboardShortcuts:r.default,externalApps:s.default}}})},5772:(a,b,c)=>{"use strict";c.d(b,{Ps:()=>k,W5:()=>j});var d=c(21124),e=c(38301),f=c(90076),g=c(12480);let h={size:g.r5,setSize:()=>{},isMobile:!1,factor:g.d8[g.r5].factor,isAvailable:!1},i=(0,e.createContext)(h);function j({children:a}){let{size:b,setSize:c,isAvailable:h}=(0,g.of)(),j=(0,f.a)(),k=(0,e.useMemo)(()=>({size:b,setSize:c,isMobile:j,factor:g.d8[b].factor,isAvailable:h}),[b,c,j,h]);return(0,d.jsx)(i.Provider,{value:k,children:a})}function k(){return(0,e.useContext)(i)}},6074:(a,b,c)=>{"use strict";c.d(b,{O:()=>e});var d=c(38301);function e(a,b){let[c,e]=(0,d.useState)(a?"open":"closed");return a&&"open"!==c?e("open"):a||"open"!==c||e("exiting"),{shouldRender:a||"closed"!==c,isExiting:!a&&"exiting"===c}}},11010:(a,b,c)=>{"use strict";c.d(b,{M:()=>d});let d={DROPDOWN:10,SIDEBAR:30,MODAL:50,MAXIMIZED_EDITOR:55,TOAST:60,POPOVER:65,CONTEXT_MENU:70}},12305:(a,b,c)=>{Promise.resolve().then(c.t.bind(c,54160,23)),Promise.resolve().then(c.t.bind(c,31603,23)),Promise.resolve().then(c.t.bind(c,68495,23)),Promise.resolve().then(c.t.bind(c,75170,23)),Promise.resolve().then(c.t.bind(c,77526,23)),Promise.resolve().then(c.t.bind(c,78922,23)),Promise.resolve().then(c.t.bind(c,29234,23)),Promise.resolve().then(c.t.bind(c,12263,23)),Promise.resolve().then(c.bind(c,82146))},12480:(a,b,c)=>{"use strict";c.d(b,{Uf:()=>f,d8:()=>g,fM:()=>h,of:()=>j,r5:()=>e,rq:()=>i});var d=c(53237);let e="medium",f=["large","medium","small","xsmall"],g={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 h(a){return"string"==typeof a&&Object.prototype.hasOwnProperty.call(g,a)}function i(a){return g[a].terminalFontSize}function j(){let{value:a,setValue:b,isAvailable:c}=(0,d.V)({key:"mcbd-pc-display-size",defaultValue:e,validate:h});return{size:a,setSize:b,isAvailable:c}}},17793:(a,b,c)=>{"use strict";c.d(b,{y:()=>h});var d=c(21124);c(38301);var e=c(35595);let f={xs:"h-3 w-3",sm:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6",xl:"h-8 w-8"},g={current:"",accent:"text-accent-600 dark:text-accent-400",muted:"text-muted-foreground"};function h({size:a="md",variant:b="current",className:c,...h}){return(0,d.jsxs)("svg",{className:(0,e.cn)("animate-spin",f[a],g[b],c),xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true",...h,children:[(0,d.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,d.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}},22033:(a,b,c)=>{Promise.resolve().then(c.t.bind(c,81170,23)),Promise.resolve().then(c.t.bind(c,23597,23)),Promise.resolve().then(c.t.bind(c,36893,23)),Promise.resolve().then(c.t.bind(c,89748,23)),Promise.resolve().then(c.t.bind(c,6060,23)),Promise.resolve().then(c.t.bind(c,7184,23)),Promise.resolve().then(c.t.bind(c,69576,23)),Promise.resolve().then(c.t.bind(c,73041,23)),Promise.resolve().then(c.t.bind(c,51384,23))},25754:(a,b,c)=>{"use strict";c.d(b,{Xn:()=>e,d9:()=>g,gB:()=>f,rv:()=>h});let d=["en","ja"],e="en",f="locale";function g(a){return"string"==typeof a&&d.includes(a)}function h(a,b){return g(a)?a:d.find(a=>(b??"").includes(a))??e}},26808:(a,b,c)=>{Promise.resolve().then(c.bind(c,58315))},32482:(a,b,c)=>{"use strict";c.d(b,{LV:()=>i,Si:()=>e,UZ:()=>g,Xn:()=>k,_s:()=>l,nO:()=>j,s6:()=>h});let d=["updatedAt","repositoryName","branchName","status","lastSent"],e=a=>d.includes(a),f={waiting:0,ready:1,running:2,generating:3,idle:4};function g(a){let b=new Set;for(let c of a)!1===c.visible&&b.add(c.path);return b}function h(a,b){return 0===b.size?a.slice():a.filter(a=>{let c=a.repositoryPath;return!c||!b.has(c)})}function i(a){let b=function(a){let b=5381;for(let c=0;c<a.length;c++)b=(b<<5)+b+a.charCodeAt(c)|0;return Math.abs(b)}(a)%360;return`hsl(${b}, 65%, 60%)`}function j(a,b){if(!a&&!b)return 0;if(!a)return 1;if(!b)return -1;let c=a instanceof Date?a.getTime():new Date(a).getTime();return(b instanceof Date?b.getTime():new Date(b).getTime())-c}function k(a,b,c){let d=[...a];return d.sort((a,d)=>{let e=0;switch(b){case"updatedAt":{let b=a=>a?a instanceof Date?a.getTime():new Date(a).getTime():0,c=b(a.lastActivity);e=b(d.lastActivity)-c;break}case"repositoryName":{let b=a.repositoryName.toLowerCase(),c=d.repositoryName.toLowerCase();e=b.localeCompare(c);break}case"branchName":{let b=a.name.toLowerCase(),c=d.name.toLowerCase();e=b.localeCompare(c);break}case"status":e=f[a.status]-f[d.status];break;case"lastSent":{let b=j(a.lastActivity,d.lastActivity);if(!a.lastActivity&&!d.lastActivity){e=0;break}if(!a.lastActivity)return 1;if(!d.lastActivity)return -1;e=b;break}default:e=0}return("updatedAt"===b||"lastSent"===b?"desc"===c:"asc"===c)?e:-e}),d}function l(a,b,c){let d=new Map;for(let b of a){let a=b.repositoryName;d.has(a)||d.set(a,[]),d.get(a).push(b)}return[...d.keys()].sort((a,b)=>a.toLowerCase().localeCompare(b.toLowerCase())).map(a=>({repositoryName:a,branches:k(d.get(a),b,c)}))}},35595:(a,b,c)=>{"use strict";c.d(b,{cn:()=>f});var d=c(43249),e=c(58829);function f(...a){return(0,e.QP)((0,d.$)(a))}},36536:(a,b,c)=>{Promise.resolve().then(c.bind(c,80776))},38898:(a,b,c)=>{var d={"./en/schedule.json":[95571,5571],"./ja/schedule.json":[26285,6285]};function e(a){if(!c.o(d,a))return Promise.resolve().then(()=>{var b=Error("Cannot find module '"+a+"'");throw b.code="MODULE_NOT_FOUND",b});var b=d[a],e=b[0];return c.e(b[1]).then(()=>c.t(e,19))}e.keys=()=>Object.keys(d),e.id=38898,a.exports=e},40695:(a,b,c)=>{"use strict";c.d(b,{tS:()=>i,xM:()=>j});var d=c(21124),e=c(38301);let f=()=>{},g={status:"disconnected",connected:!1,subscribe:f,unsubscribe:f,addListener:()=>f},h=(0,e.createContext)(null);function i({children:a,enabled:b=!0}){let c=(0,e.useRef)(new Set),f=(0,e.useRef)(new Map),{status:g,subscribe:i,unsubscribe:j}=function(a={}){let{onEvent:b,onStatusChange:c,autoReconnect:d=!0,reconnectBaseDelay:f=1e3,reconnectMaxDelay:g=3e4,enabled:h=!0}=a,[i,j]=(0,e.useState)("disconnected"),k=(0,e.useRef)(null),l=(0,e.useRef)(null);(0,e.useRef)(0);let m=(0,e.useRef)(new Set),n=(0,e.useRef)(!1);(0,e.useRef)(b).current=b;let o=(0,e.useRef)(c);o.current=c;let p=(0,e.useCallback)(a=>{j(a),o.current?.(a)},[]),q=(0,e.useCallback)(()=>{null!==l.current&&(clearTimeout(l.current),l.current=null)},[]);(0,e.useCallback)(()=>{},[h,d,f,g,p,q]),(0,e.useCallback)(()=>{if(q(),n.current=!0,k.current){try{k.current.close(1e3,"Client disconnect")}catch{}k.current=null}},[q]);let r=(0,e.useCallback)(a=>{let b=k.current,c="undefined"!=typeof globalThis&&"function"==typeof globalThis.WebSocket?globalThis.WebSocket:null;if(b&&c&&b.readyState===c.OPEN)try{b.send(JSON.stringify(a))}catch{}},[]);return{status:i,subscribe:(0,e.useCallback)(a=>{m.current.has(a)||(m.current.add(a),r({type:"subscribe",worktreeId:a}))},[r]),unsubscribe:(0,e.useCallback)(a=>{m.current.has(a)&&(m.current.delete(a),r({type:"unsubscribe",worktreeId:a}))},[r]),send:r}}({enabled:b,onEvent:(0,e.useCallback)(a=>{c.current.forEach(b=>{try{b(a)}catch{}})},[])}),k=(0,e.useCallback)(a=>{let b=f.current,c=b.get(a)??0;b.set(a,c+1),0===c&&i(a)},[i]),l=(0,e.useCallback)(a=>{let b=f.current,c=b.get(a)??0;c<=1?(b.delete(a),j(a)):b.set(a,c-1)},[j]),m=(0,e.useCallback)(a=>(c.current.add(a),()=>{c.current.delete(a)}),[]),n=(0,e.useMemo)(()=>({status:g,connected:"connected"===g,subscribe:k,unsubscribe:l,addListener:m}),[g,k,l,m]);return(0,d.jsx)(h.Provider,{value:n,children:a})}function j(){return(0,e.useContext)(h)??g}},43084:(a,b,c)=>{"use strict";c.d(b,{k:()=>g});var d=c(75338),e=c(94596);let f=["[animation-delay:0ms]","[animation-delay:150ms]","[animation-delay:300ms]"];function g(){let a=(0,e.A)("common");return(0,d.jsx)("div",{className:"flex min-h-screen w-full items-center justify-center p-8",role:"status","aria-label":a("loadingPage"),"data-testid":"route-loading",children:(0,d.jsx)("div",{className:"flex items-center gap-2","aria-hidden":"true",children:f.map(a=>(0,d.jsx)("span",{className:`h-2.5 w-2.5 rounded-full bg-muted-foreground animate-pulse ${a}`},a))})})}},47817:(a,b,c)=>{"use strict";c.d(b,{$f:()=>k,H8:()=>j});var d=c(21124),e=c(38301),f=c(78352);let g=(0,e.createContext)(null),h={selectedWorktreeId:null,worktrees:[],repositories:[],selectedWorktreeDetail:null,isLoading:!0,isLoadingDetail:!1,error:null};function i(a,b){switch(b.type){case"SET_WORKTREES":return{...a,worktrees:b.worktrees,isLoading:!1};case"SET_REPOSITORIES":return{...a,repositories:b.repositories};case"SELECT_WORKTREE":{let c=a.worktrees.find(a=>a.id===b.id)??null;return{...a,selectedWorktreeId:b.id,selectedWorktreeDetail:c??a.selectedWorktreeDetail,isLoadingDetail:null===c}}case"SET_WORKTREE_DETAIL":return{...a,selectedWorktreeDetail:b.detail};case"SET_LOADING":return{...a,isLoading:b.isLoading};case"SET_LOADING_DETAIL":return{...a,isLoadingDetail:b.isLoadingDetail};case"SET_ERROR":return{...a,error:b.error,isLoading:!1};default:return a}}function j({children:a,externalWorktrees:b,externalRepositories:c}){let j=void 0!==b,[k,l]=(0,e.useReducer)(i,h),m=(0,e.useCallback)(async()=>{if(!j){l({type:"SET_LOADING",isLoading:!0}),l({type:"SET_ERROR",error:null});try{let a=await f.y.getAll();l({type:"SET_WORKTREES",worktrees:a.worktrees}),l({type:"SET_REPOSITORIES",repositories:a.repositories??[]})}catch(a){l({type:"SET_ERROR",error:a instanceof Error?a.message:"Failed to fetch worktrees"})}}},[j]),n=(0,e.useCallback)(async a=>{l({type:"SELECT_WORKTREE",id:a}),l({type:"SET_ERROR",error:null});try{f.y.markAsViewed(a).catch(a=>{console.warn("[WorktreeSelectionContext] Failed to mark as viewed:",a)});let b=await f.y.getById(a);l({type:"SET_WORKTREE_DETAIL",detail:b})}catch(a){l({type:"SET_ERROR",error:a instanceof Error?a.message:"Failed to fetch worktree detail"})}finally{l({type:"SET_LOADING_DETAIL",isLoadingDetail:!1})}},[]),o=(0,e.useCallback)(async()=>{await m()},[m]),p={selectedWorktreeId:k.selectedWorktreeId,worktrees:k.worktrees,repositories:k.repositories,selectedWorktreeDetail:k.selectedWorktreeDetail,isLoadingDetail:k.isLoadingDetail,error:k.error,selectWorktree:n,refreshWorktrees:o};return(0,d.jsx)(g.Provider,{value:p,children:a})}function k(){let a=(0,e.useContext)(g);if(!a)throw Error("useWorktreeSelection must be used within a WorktreeSelectionProvider");return a}},48620:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>f});var d=c(75338),e=c(43084);function f(){return(0,d.jsx)(e.k,{})}},51472:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>p,generateMetadata:()=>n,viewport:()=>o});var d=c(75338),e=c(68071),f=c(22513),g=c(42531),h=c(10620),i=c(4986),j=c.n(i),k=c(68034),l=c.n(k),m=c(58315);async function n(){return{title:{default:"CommandMate",template:"%s | CommandMate"},description:(await (0,e.A)("common"))("meta.description"),appleWebApp:{capable:!0,title:"CommandMate",statusBarStyle:"default"}}}c(61135);let o={themeColor:[{media:"(prefers-color-scheme: light)",color:"#fafafb"},{media:"(prefers-color-scheme: dark)",color:"#0a0c12"}],viewportFit:"cover"};async function p({children:a}){let b=await (0,f.A)(),c=await (0,g.A)(),e=await (0,h.A)();return(0,d.jsx)("html",{lang:b,className:`${j().variable} ${l().variable}`,suppressHydrationWarning:!0,children:(0,d.jsx)("body",{className:"min-h-screen bg-background",children:(0,d.jsx)(m.AppProviders,{locale:b,messages:c,timeZone:e,authEnabled:!!process.env.CM_AUTH_TOKEN_HASH,children:a})})})}},51877:(a,b,c)=>{var d={"./en/auth.json":[43440,3440],"./ja/auth.json":[11162,1162]};function e(a){if(!c.o(d,a))return Promise.resolve().then(()=>{var b=Error("Cannot find module '"+a+"'");throw b.code="MODULE_NOT_FOUND",b});var b=d[a],e=b[0];return c.e(b[1]).then(()=>c.t(e,19))}e.keys=()=>Object.keys(d),e.id=51877,a.exports=e},52130:(a,b,c)=>{Promise.resolve().then(c.bind(c,53523))},52761:(a,b,c)=>{"use strict";c.d(b,{Bo:()=>k,Hq:()=>i});var d=c(21124),e=c(38301),f=c(42378);let g={startTransition:a=>a()},h=(0,e.createContext)(null);function i(){let a=(0,f.useRouter)(),{startTransition:b}=(0,e.useContext)(h)??g;return(0,e.useMemo)(()=>({push:c=>b(()=>a.push(c)),replace:c=>b(()=>a.replace(c))}),[a,b])}function j({onCommit:a}){return(0,f.usePathname)(),(0,e.useRef)(!1),null}function k({children:a}){let b=(0,e.useRef)(null),c=(0,e.useCallback)(()=>{b.current?.()},[]),f=(0,e.useCallback)(a=>{var c;c=()=>new Promise(c=>{let d=!1,e=()=>{d||(d=!0,c())};b.current=e,a(),window.setTimeout(e,500)}),"undefined"==typeof document||"function"!=typeof document.startViewTransition?c():document.startViewTransition(c)},[]),g=(0,e.useMemo)(()=>({startTransition:f}),[f]);return(0,d.jsxs)(h.Provider,{value:g,children:[(0,d.jsx)(j,{onCommit:c}),a]})}},53237:(a,b,c)=>{"use strict";c.d(b,{V:()=>e});var d=c(38301);function e(a){let{key:b,defaultValue:c,validate:e,serialize:f=JSON.stringify,deserialize:g=JSON.parse}=a,h=(0,d.useRef)(c),i=(0,d.useRef)(e),j=(0,d.useRef)(f),k=(0,d.useRef)(g);h.current=c,i.current=e,j.current=f,k.current=g;let[l,m]=(0,d.useState)(!1),[n,o]=(0,d.useState)(c);(0,d.useCallback)(()=>h.current,[b]);let p=(0,d.useCallback)(a=>{},[b]);return{value:n,setValue:(0,d.useCallback)(a=>{o(b=>{let c="function"==typeof a?a(b):a;return p(c),c})},[p]),removeValue:(0,d.useCallback)(()=>{o(h.current)},[b]),isAvailable:l}}},57482:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>e});var d=c(97523);let e=async a=>[{type:"image/png",sizes:"192x192",url:(0,d.fillMetadataSegment)(".",await a.params,"icon2.png")+"?6e2321fdb8624653"}]},58315:(a,b,c)=>{"use strict";c.d(b,{AppProviders:()=>d});let d=(0,c(97954).registerClientReference)(function(){throw Error("Attempted to call AppProviders() from the server but AppProviders is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/CommandMate/CommandMate/src/components/providers/AppProviders.tsx","AppProviders")},58970:(a,b,c)=>{"use strict";c.d(b,{$B:()=>j,I2:()=>f,LK:()=>h,Ys:()=>i,pX:()=>d,s7:()=>e,tX:()=>g});let d=2e3,e=1500,f=2e3,g=150,h=100,i=200,j=100},60345:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>e});var d=c(97523);let e=async a=>[{type:"image/png",sizes:"96x96",url:(0,d.fillMetadataSegment)(".",await a.params,"icon1.png")+"?901e04bb11e9b7fd"}]},60887:(a,b,c)=>{var d={"./en/review.json":[83346,3346],"./ja/review.json":[49328,9328]};function e(a){if(!c.o(d,a))return Promise.resolve().then(()=>{var b=Error("Cannot find module '"+a+"'");throw b.code="MODULE_NOT_FOUND",b});var b=d[a],e=b[0];return c.e(b[1]).then(()=>c.t(e,19))}e.keys=()=>Object.keys(d),e.id=60887,a.exports=e},61118:(a,b,c)=>{var d={"./en/common.json":[73543,3543],"./ja/common.json":[53945,3945]};function e(a){if(!c.o(d,a))return Promise.resolve().then(()=>{var b=Error("Cannot find module '"+a+"'");throw b.code="MODULE_NOT_FOUND",b});var b=d[a],e=b[0];return c.e(b[1]).then(()=>c.t(e,19))}e.keys=()=>Object.keys(d),e.id=61118,a.exports=e},61135:()=>{},62081:(a,b,c)=>{var d={"./en/autoYes.json":[44248,4248],"./ja/autoYes.json":[92534,2534]};function e(a){if(!c.o(d,a))return Promise.resolve().then(()=>{var b=Error("Cannot find module '"+a+"'");throw b.code="MODULE_NOT_FOUND",b});var b=d[a],e=b[0];return c.e(b[1]).then(()=>c.t(e,19))}e.keys=()=>Object.keys(d),e.id=62081,a.exports=e},63157:(a,b,c)=>{"use strict";c.d(b,{g7:()=>i,rC:()=>k,Fn:()=>j});var d=c(21124),e=c(38301),f=c(40695),g=c(47817);let h=(0,e.createContext)(null);function i({children:a}){let{worktrees:b,repositories:c,isLoading:i,error:j,refresh:k}=function(){let[a,b]=(0,e.useState)([]),[c,d]=(0,e.useState)([]),[g,h]=(0,e.useState)(!0),[i,j]=(0,e.useState)(null),k=(0,e.useRef)(null),l=(0,e.useRef)([]),m=(0,e.useRef)(null),{connected:n,subscribe:o,unsubscribe:p,addListener:q}=(0,f.xM)(),r=(0,e.useRef)(n);r.current=n;let s=(0,e.useCallback)(async()=>{try{j(null);let a=await fetch("/api/worktrees");if(!a.ok)throw Error(`Failed to fetch worktrees: ${a.status}`);let c=await a.json(),f=c.worktrees??[],g=c.repositories??[];(0,e.startTransition)(()=>{b(f),d(g)}),l.current=f}catch(a){j(a instanceof Error?a:Error(String(a)))}finally{h(!1)}},[]),t=(0,e.useCallback)(()=>l.current.some(a=>!0===a.isSessionRunning),[]),u=(0,e.useCallback)(()=>{let a=t();return r.current?a?2e4:6e4:a?5e3:3e4},[t]),v=(0,e.useCallback)(()=>{null!==k.current&&(clearInterval(k.current),k.current=null),m.current=null},[]);return(0,e.useCallback)(()=>{v();let a=u();m.current=a,k.current=setInterval(()=>{s()},a)},[u,s,v]),a.map(a=>a.id).sort().join(" "),{worktrees:a,repositories:c,isLoading:g,error:i,refresh:s}}(),l=(0,e.useMemo)(()=>({worktrees:b,repositories:c,isLoading:i,error:j,refresh:k}),[b,c,i,j,k]);return(0,d.jsx)(h.Provider,{value:l,children:(0,d.jsx)(g.H8,{externalWorktrees:b,externalRepositories:c,children:a})})}function j(){let a=(0,e.useContext)(h);if(null===a)throw Error("useWorktreesCacheContext must be used within a WorktreesCacheProvider");return a}function k(){return(0,e.useContext)(h)}},64632:(a,b,c)=>{"use strict";c.d(b,{C:()=>h,E:()=>g});var d=c(21124),e=c(38301);let f=(0,e.createContext)({open:!1,setOpen:()=>{},toggle:()=>{}});function g({children:a}){let[b,c]=(0,e.useState)(!1),g=(0,e.useCallback)(()=>c(a=>!a),[]),h=(0,e.useMemo)(()=>({open:b,setOpen:c,toggle:g}),[b,g]);return(0,d.jsx)(f.Provider,{value:h,children:a})}function h(){return(0,e.useContext)(f)}},66125:(a,b,c)=>{var d={"./en/error.json":[22980,2980],"./ja/error.json":[10450,450]};function e(a){if(!c.o(d,a))return Promise.resolve().then(()=>{var b=Error("Cannot find module '"+a+"'");throw b.code="MODULE_NOT_FOUND",b});var b=d[a],e=b[0];return c.e(b[1]).then(()=>c.t(e,19))}e.keys=()=>Object.keys(d),e.id=66125,a.exports=e},70288:(a,b,c)=>{var d={"./en/home.json":[41825,1825],"./ja/home.json":[26159,6159]};function e(a){if(!c.o(d,a))return Promise.resolve().then(()=>{var b=Error("Cannot find module '"+a+"'");throw b.code="MODULE_NOT_FOUND",b});var b=d[a],e=b[0];return c.e(b[1]).then(()=>c.t(e,19))}e.keys=()=>Object.keys(d),e.id=70288,a.exports=e},72637:(a,b,c)=>{var d={"./en/prompt.json":[72816,2816],"./ja/prompt.json":[80066,7685]};function e(a){if(!c.o(d,a))return Promise.resolve().then(()=>{var b=Error("Cannot find module '"+a+"'");throw b.code="MODULE_NOT_FOUND",b});var b=d[a],e=b[0];return c.e(b[1]).then(()=>c.t(e,19))}e.keys=()=>Object.keys(d),e.id=72637,a.exports=e},75567:(a,b,c)=>{var d={"./en/pwa.json":[51262,1262],"./ja/pwa.json":[46072,6072]};function e(a){if(!c.o(d,a))return Promise.resolve().then(()=>{var b=Error("Cannot find module '"+a+"'");throw b.code="MODULE_NOT_FOUND",b});var b=d[a],e=b[0];return c.e(b[1]).then(()=>c.t(e,19))}e.keys=()=>Object.keys(d),e.id=75567,a.exports=e},78162:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>e});var d=c(97523);let e=async a=>[{type:"image/png",sizes:"32x32",url:(0,d.fillMetadataSegment)(".",await a.params,"icon.png")+"?eeae29d23f3aae17"}]},78352:(a,b,c)=>{"use strict";c.d(b,{$T:()=>i,GQ:()=>k,Rx:()=>h,hD:()=>d,hS:()=>j,y:()=>g});class d extends Error{constructor(a,b,c){super(a),this.status=b,this.data=c,this.name="ApiError"}}async function e(a,b,c){if(!(a.headers.get("content-type")||"").includes("application/json"))return b;try{return await a.json()}catch{return b}}async function f(a,b){try{let c=new Headers(b?.headers);c.set("Content-Type","application/json");let f=await fetch(a,{...b,headers:c}),g=f.headers.get("content-type")||"";if(f.redirected&&f.url.includes("/login"))throw new d("Authentication required",401);if(!f.ok){let a=await e(f,{},"error-body");throw new d(a.error||`HTTP error ${f.status}`,f.status,a)}if(!g.includes("application/json"))throw new d("Unexpected response format",f.status);return f.json()}catch(a){if(a instanceof d)throw a;throw new d(a instanceof Error?a.message:"Unknown error",0,a)}}let g={getAll:async()=>f("/api/worktrees"),getById:async a=>f(`/api/worktrees/${a}`),updateDescription:async(a,b)=>f(`/api/worktrees/${a}`,{method:"PATCH",body:JSON.stringify({description:b})}),updateLink:async(a,b)=>f(`/api/worktrees/${a}`,{method:"PATCH",body:JSON.stringify({link:b})}),toggleFavorite:async(a,b)=>f(`/api/worktrees/${a}`,{method:"PATCH",body:JSON.stringify({favorite:b})}),updateStatus:async(a,b)=>f(`/api/worktrees/${a}`,{method:"PATCH",body:JSON.stringify({status:b})}),updateCliTool:async(a,b)=>f(`/api/worktrees/${a}`,{method:"PATCH",body:JSON.stringify({cliToolId:b})}),markAsViewed:async a=>f(`/api/worktrees/${a}/viewed`,{method:"PATCH"}),async getMessages(a,b,c,d){let e=new URLSearchParams;return b&&e.append("cliTool",b),c&&e.append("includeArchived","true"),"number"==typeof d&&Number.isFinite(d)&&e.append("limit",String(d)),f(`/api/worktrees/${a}/messages${e.toString()?`?${e.toString()}`:""}`)},async sendMessage(a,b,c){let d={content:b};return c?.cliToolId&&(d.cliToolId=c.cliToolId),c?.instanceId&&(d.instanceId=c.instanceId),c?.imagePath&&(d.imagePath=c.imagePath),f(`/api/worktrees/${a}/send`,{method:"POST",body:JSON.stringify(d)})},async uploadImageFile(a,b){let c=Date.now(),d=`${c}-${b.name}`,f=".commandmate/attachments",g=new FormData;g.append("file",new File([b],d,{type:b.type}));let h=await fetch(`/api/worktrees/${a}/upload/${f}`,{method:"POST",body:g});if(!h.ok){let a=await e(h,{},"error-body");throw Error(a?.error?.message||`Upload failed (HTTP ${h.status})`)}return{path:(await e(h,{},"response-body")).path||`${f}/${d}`}},getLogs:async a=>f(`/api/worktrees/${a}/logs`),async getLogFile(a,b,c){let d=c?.sanitize?"?sanitize=true":"";return f(`/api/worktrees/${a}/logs/${b}${d}`)},async killSession(a,b,c){let d=new URLSearchParams;b&&d.set("cliTool",b),c&&d.set("instance",c);let e=d.toString();return f(`/api/worktrees/${a}/kill-session${e?`?${e}`:""}`,{method:"POST"})}},h={scan:async a=>f("/api/repositories/scan",{method:"POST",body:JSON.stringify({repositoryPath:a})}),sync:async()=>f("/api/repositories/sync",{method:"POST"}),delete:async a=>f("/api/repositories",{method:"DELETE",body:JSON.stringify({repositoryPath:a})}),clone:async a=>f("/api/repositories/clone",{method:"POST",body:JSON.stringify({cloneUrl:a})}),getCloneStatus:async a=>f(`/api/repositories/clone/${a}`),getExcluded:async()=>f("/api/repositories/excluded"),restore:async a=>f("/api/repositories/restore",{method:"PUT",body:JSON.stringify({repositoryPath:a})}),list:async()=>f("/api/repositories"),updateDisplayName:async(a,b)=>f(`/api/repositories/${encodeURIComponent(a)}`,{method:"PUT",body:JSON.stringify({displayName:b})}),updateVisibility:async(a,b)=>f(`/api/repositories/${encodeURIComponent(a)}`,{method:"PUT",body:JSON.stringify({visible:b})})},i={getAll:async a=>(await f(`/api/worktrees/${a}/memos`)).memos,create:async(a,b)=>(await f(`/api/worktrees/${a}/memos`,{method:"POST",body:JSON.stringify(b||{})})).memo,update:async(a,b,c)=>(await f(`/api/worktrees/${a}/memos/${b}`,{method:"PUT",body:JSON.stringify(c)})).memo,delete:async(a,b)=>f(`/api/worktrees/${a}/memos/${b}`,{method:"DELETE"}),async reorder(a,b){await f(`/api/worktrees/${a}/memos`,{method:"PATCH",body:JSON.stringify({memoIds:b})})}};function j(a){return a instanceof d||a instanceof Error?a.message:"An unknown error occurred"}let k={checkForUpdate:async()=>f("/api/app/update-check",{method:"GET"}),startUpdate:async()=>f("/api/app/update",{method:"POST"}),async ping(){try{return(await fetch("/api/auth/status",{cache:"no-store"})).ok}catch{return!1}}}},79782:(a,b,c)=>{"use strict";c.d(b,{SC:()=>m,TM:()=>i,aF:()=>k});var d=c(21124),e=c(38301),f=c(20481),g=c(98033),h=c(94260);function i({isOpen:a,title:b,description:c,confirmLabel:e,cancelLabel:i,variant:j="default",onConfirm:k,onCancel:l}){let m=(0,f.c)("common"),n="danger"===j;return(0,d.jsx)(g.a,{isOpen:a,onClose:l,title:b??m("confirmDialog.title"),size:"sm",showCloseButton:!1,children:(0,d.jsxs)("div",{className:"space-y-4","data-testid":"confirm-dialog",children:[(0,d.jsx)("p",{className:"text-sm text-foreground whitespace-pre-line",children:c}),(0,d.jsxs)("div",{className:"flex justify-end gap-3",children:[(0,d.jsx)(h.$,{type:"button",variant:"secondary",size:"sm",autoFocus:n,onClick:l,"data-testid":"confirm-dialog-cancel",children:i??m("cancel")}),(0,d.jsx)(h.$,{type:"button",variant:n?"danger":"primary",size:"sm",autoFocus:!n,onClick:k,"data-testid":"confirm-dialog-confirm",children:e??m("confirmDialog.confirm")})]})]})})}let j=(0,e.createContext)(null);function k({children:a}){let[b,c]=(0,e.useState)(null),f=(0,e.useRef)(null),g=(0,e.useRef)(null),h=b?.options??g.current,k=(0,e.useCallback)(a=>new Promise(b=>{f.current=document.activeElement instanceof HTMLElement?document.activeElement:null,c(c=>(c?.resolve(!1),{options:a,resolve:b}))}),[]),l=(0,e.useCallback)(a=>{c(b=>(b?.resolve(a),null)),f.current?.focus(),f.current=null},[]);return(0,d.jsxs)(j.Provider,{value:k,children:[a,(0,d.jsx)(i,{isOpen:null!==b,title:h?.title,description:h?.description??"",confirmLabel:h?.confirmLabel,cancelLabel:h?.cancelLabel,variant:h?.variant,onConfirm:()=>l(!0),onCancel:()=>l(!1)})]})}let l=async()=>!1;function m(){return(0,e.useContext)(j)??l}},80407:(a,b,c)=>{var d={"./en/commandPalette.json":[28098,8098],"./ja/commandPalette.json":[12560,2560]};function e(a){if(!c.o(d,a))return Promise.resolve().then(()=>{var b=Error("Cannot find module '"+a+"'");throw b.code="MODULE_NOT_FOUND",b});var b=d[a],e=b[0];return c.e(b[1]).then(()=>c.t(e,19))}e.keys=()=>Object.keys(d),e.id=80407,a.exports=e},80776:(a,b,c)=>{"use strict";c.d(b,{AppProviders:()=>u});var d=c(21124),e=c(37397),f=c(45523),g=c(81092),h=c(84342),i=c(5772),j=c(64632),k=c(89184),l=c(63157),m=c(52761),n=c(40695),o=c(79782),p=c(38301),q=c(20481),r=c(25345),s=c(11010);function t(){let a=(0,q.c)("pwa"),[b,c]=(0,p.useState)(null);return((0,p.useRef)(!1),b)?(0,d.jsx)("div",{role:"status","aria-live":"polite",className:"fixed inset-x-0 bottom-0 flex justify-center px-4 pb-safe",style:{zIndex:s.M.TOAST},children:(0,d.jsxs)("div",{className:"mb-4 flex items-center gap-3 rounded-lg border border-border bg-surface px-4 py-3 shadow-lg",children:[(0,d.jsx)("span",{className:"text-sm font-medium text-foreground",children:a("update.available")}),(0,d.jsxs)("button",{type:"button",onClick:()=>{b.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,d.jsx)(r.A,{className:"h-4 w-4"}),a("update.reload")]})]})}):null}function u({children:a,locale:b,messages:c,timeZone:p,authEnabled:q=!1}){return(0,d.jsx)(e.default,{locale:b,messages:c,timeZone:p,children:(0,d.jsx)(f.N,{attribute:"class",defaultTheme:"system",enableSystem:!0,children:(0,d.jsx)(h.O,{authEnabled:q,children:(0,d.jsx)(i.W5,{children:(0,d.jsx)(g.GB,{children:(0,d.jsx)(n.tS,{children:(0,d.jsx)(l.g7,{children:(0,d.jsx)(j.E,{children:(0,d.jsx)(k.S,{children:(0,d.jsxs)(o.aF,{children:[(0,d.jsx)(m.Bo,{children:a}),(0,d.jsx)(t,{})]})})})})})})})})})})}},80812:(a,b,c)=>{var d={"./en/externalApps.json":[37941,7941],"./ja/externalApps.json":[99211,9211]};function e(a){if(!c.o(d,a))return Promise.resolve().then(()=>{var b=Error("Cannot find module '"+a+"'");throw b.code="MODULE_NOT_FOUND",b});var b=d[a],e=b[0];return c.e(b[1]).then(()=>c.t(e,19))}e.keys=()=>Object.keys(d),e.id=80812,a.exports=e},81092:(a,b,c)=>{"use strict";c.d(b,{GB:()=>j,VF:()=>k});var d=c(21124),e=c(38301),f=c(32482);let g="updatedAt",h=(0,e.createContext)(null);function i(a,b){switch(b.type){case"TOGGLE":return{...a,isOpen:!a.isOpen};case"SET_WIDTH":return{...a,width:b.width};case"OPEN_MOBILE_DRAWER":return{...a,isMobileDrawerOpen:!0};case"CLOSE_MOBILE_DRAWER":return{...a,isMobileDrawerOpen:!1};case"SET_SORT_KEY":return{...a,sortKey:b.sortKey};case"SET_SORT_DIRECTION":return{...a,sortDirection:b.sortDirection};case"LOAD_SORT_SETTINGS":return{...a,sortKey:b.sortKey,sortDirection:b.sortDirection};case"SET_VIEW_MODE":return{...a,viewMode:b.viewMode};default:return a}}function j({children:a,initialOpen:b=!0,initialWidth:c=224}){let[j,k]=(0,e.useReducer)(i,{isOpen:b,width:c,isMobileDrawerOpen:!1,sortKey:g,sortDirection:"desc",viewMode:"grouped"});j.sortKey,j.sortDirection,(0,e.useRef)(!0),j.viewMode,(0,e.useRef)(!0),j.width,(0,e.useRef)(!0);let l=(0,e.useCallback)(()=>{k({type:"TOGGLE"})},[]),m=(0,e.useCallback)(a=>{k({type:"SET_WIDTH",width:a})},[]),n=(0,e.useCallback)(()=>{k({type:"OPEN_MOBILE_DRAWER"})},[]),o=(0,e.useCallback)(()=>{k({type:"CLOSE_MOBILE_DRAWER"})},[]),p=(0,e.useCallback)(a=>{k({type:"SET_SORT_KEY",sortKey:a})},[]),q=(0,e.useCallback)(a=>{k({type:"SET_SORT_DIRECTION",sortDirection:a})},[]),r=(0,e.useCallback)(a=>{k({type:"SET_VIEW_MODE",viewMode:a})},[]),s=(0,e.useMemo)(()=>({isOpen:j.isOpen,width:j.width,isMobileDrawerOpen:j.isMobileDrawerOpen,sortKey:j.sortKey,sortDirection:j.sortDirection,toggle:l,setWidth:m,openMobileDrawer:n,closeMobileDrawer:o,setSortKey:p,setSortDirection:q,viewMode:j.viewMode,setViewMode:r}),[j.isOpen,j.width,j.isMobileDrawerOpen,j.sortKey,j.sortDirection,j.viewMode,l,m,n,o,p,q,r]);return(0,d.jsx)(h.Provider,{value:s,children:a})}function k(){let a=(0,e.useContext)(h);if(!a)throw Error("useSidebarContext must be used within a SidebarProvider");return a}},84342:(a,b,c)=>{"use strict";c.d(b,{H:()=>h,O:()=>g});var d=c(21124),e=c(38301);let f=(0,e.createContext)(!1);function g({children:a,authEnabled:b}){return(0,d.jsx)(f.Provider,{value:b,children:a})}function h(){return(0,e.useContext)(f)}},86634:(a,b,c)=>{Promise.resolve().then(c.bind(c,37397))},89184:(a,b,c)=>{"use strict";c.d(b,{K:()=>h,S:()=>g});var d=c(21124),e=c(38301);let f=(0,e.createContext)({open:!1,setOpen:()=>{},toggle:()=>{}});function g({children:a}){let[b,c]=(0,e.useState)(!1),g=(0,e.useCallback)(()=>c(a=>!a),[]),h=(0,e.useMemo)(()=>({open:b,setOpen:c,toggle:g}),[b,g]);return(0,d.jsx)(f.Provider,{value:h,children:a})}function h(){return(0,e.useContext)(f)}},90076:(a,b,c)=>{"use strict";c.d(b,{D:()=>f,a:()=>g});var d=c(38301);let e=d.useEffect,f=768;function g(a={}){let{breakpoint:b=f}=a,[c,h]=(0,d.useState)(!1);return e(()=>{let a=window.matchMedia(`(max-width: ${b-1}px)`);h(a.matches);let c=a=>{h(a.matches)};return a.addEventListener("change",c),()=>{a.removeEventListener("change",c)}},[b]),c}},90338:(a,b,c)=>{var d={"./en/worktree.json":[72119,2119],"./ja/worktree.json":[52445,2445]};function e(a){if(!c.o(d,a))return Promise.resolve().then(()=>{var b=Error("Cannot find module '"+a+"'");throw b.code="MODULE_NOT_FOUND",b});var b=d[a],e=b[0];return c.e(b[1]).then(()=>c.t(e,19))}e.keys=()=>Object.keys(d),e.id=90338,a.exports=e},94260:(a,b,c)=>{"use strict";c.d(b,{$:()=>i});var d=c(21124);c(38301);var e=c(26691),f=c(35595),g=c(17793);let h=(0,e.F)("inline-flex items-center justify-center px-4 py-2 rounded-md font-medium transition-all duration-200 touch-manipulation focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ring-offset-background",{variants:{variant:{primary:"bg-accent-600 dark:bg-accent-500 text-white hover:bg-accent-700 dark:hover:bg-accent-600",secondary:"bg-muted text-foreground hover:bg-muted/80",danger:"bg-danger text-white hover:bg-danger/90",ghost:"bg-transparent text-foreground hover:bg-muted"},size:{sm:"px-3 py-1.5 text-sm",md:"",lg:"px-6 py-3 text-lg"},fullWidth:{true:"w-full",false:""}},defaultVariants:{variant:"primary",size:"md",fullWidth:!1}});function i({variant:a="primary",size:b="md",fullWidth:c=!1,loading:e=!1,disabled:i,className:j="",children:k,...l}){let m=i||e,n=(0,f.cn)(h({variant:a,size:b,fullWidth:c}),!m&&"motion-safe:hover:-translate-y-0.5 motion-safe:active:translate-y-0",m&&"opacity-50 cursor-not-allowed",j);return(0,d.jsxs)("button",{className:n,disabled:m,...l,children:[e&&(0,d.jsx)(g.y,{size:"sm",className:"-ml-1 mr-2"}),k]})}},94650:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>e});var d=c(97523);let e=async a=>[{type:"image/png",sizes:"180x180",url:(0,d.fillMetadataSegment)(".",await a.params,"apple-icon.png")+"?31a89e65aa4ac65b"}]},95427:(a,b,c)=>{"use strict";c.d(b,{r:()=>e});var d=c(38301);function e(a={}){let{active:b=!0,initialFocus:c=!0,restoreFocus:f=!0}=a;return(0,d.useRef)(null)}},98033:(a,b,c)=>{"use strict";c.d(b,{a:()=>o});var d=c(21124),e=c(38301),f=c(23312),g=c(20481),h=c(26691),i=c(11010),j=c(58970),k=c(6074),l=c(95427),m=c(35595);let n=(0,h.F)("",{variants:{size:{sm:"max-w-[calc(100vw-2rem)] sm:max-w-md",md:"max-w-[calc(100vw-2rem)] sm:max-w-2xl",lg:"max-w-[calc(100vw-2rem)] sm:max-w-4xl",xl:"max-w-[calc(100vw-2rem)] sm:max-w-6xl",full:"max-w-[calc(100vw-2rem)] sm:max-w-[95vw]"}},defaultVariants:{size:"lg"}});function o({isOpen:a,onClose:b,title:c,children:h,size:o="lg",showCloseButton:p=!0,disableClose:q=!1}){let r=(0,g.c)("common"),s=(0,e.useId)(),t=(0,l.r)({active:a}),{shouldRender:u,isExiting:v}=(0,k.O)(a,j.Ys),w=v?"closed":"open";return u?(0,f.createPortal)((0,d.jsxs)("div",{className:"fixed inset-0 overflow-y-auto",style:{zIndex:i.M.MODAL},children:[(0,d.jsx)("div",{"data-state":w,className:"fixed inset-0 bg-black/50 transition-opacity data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:duration-200 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:duration-200 data-[state=closed]:fill-mode-forwards",onClick:q||v?void 0:b}),(0,d.jsx)("div",{className:"relative flex min-h-full items-center justify-center p-2 sm:p-4",children:(0,d.jsxs)("div",{ref:t,"data-state":w,"data-testid":"modal-panel",role:"dialog","aria-modal":"true","aria-labelledby":c?s:void 0,tabIndex:-1,className:(0,m.cn)("relative w-full",n({size:o}),"max-h-[calc(100vh-1rem)] sm:max-h-[calc(100vh-2rem)] flex flex-col bg-surface rounded-lg shadow-xl transform transition-all","data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:duration-200","data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:duration-200 data-[state=closed]:fill-mode-forwards"),children:[(c||p)&&(0,d.jsxs)("div",{className:"flex items-center justify-between px-4 sm:px-6 py-3 sm:py-4 border-b border-border flex-shrink-0",children:[(0,d.jsx)("h3",{id:s,className:"text-base sm:text-lg font-semibold text-foreground truncate pr-2",children:c}),p&&(0,d.jsx)("button",{onClick:b,"aria-label":r("close"),className:"text-muted-foreground hover:text-foreground transition-colors flex-shrink-0 touch-manipulation",children:(0,d.jsx)("svg",{className:"w-5 h-5 sm:w-6 sm:h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,d.jsx)("div",{className:"px-4 sm:px-6 py-3 sm:py-4 overflow-y-auto flex-1 min-h-0",children:h})]})})]}),document.body):null}},99127:(a,b,c)=>{var d={"./en/notifications.json":[49358,9358],"./ja/notifications.json":[61296,1296]};function e(a){if(!c.o(d,a))return Promise.resolve().then(()=>{var b=Error("Cannot find module '"+a+"'");throw b.code="MODULE_NOT_FOUND",b});var b=d[a],e=b[0];return c.e(b[1]).then(()=>c.t(e,19))}e.keys=()=>Object.keys(d),e.id=99127,a.exports=e}};
1
+ exports.id=9355,exports.ids=[9355],exports.modules={1483:(a,b,c)=>{var d={"./en/keyboardShortcuts.json":[53722,3722],"./ja/keyboardShortcuts.json":[88356,8356]};function e(a){if(!c.o(d,a))return Promise.resolve().then(()=>{var b=Error("Cannot find module '"+a+"'");throw b.code="MODULE_NOT_FOUND",b});var b=d[a],e=b[0];return c.e(b[1]).then(()=>c.t(e,19))}e.keys=()=>Object.keys(d),e.id=1483,a.exports=e},4558:(a,b,c)=>{"use strict";c.d(b,{A:()=>g});var d=c(43692),e=c(86802),f=c(25754);let g=(0,d.A)(async({requestLocale:a})=>{let b=await a;if(!(0,f.d9)(b)){let a=await (0,e.UL)(),c=await (0,e.b3)();b=(0,f.rv)(a.get(f.gB)?.value,c.get("accept-language"))}let[d,g,h,i,j,k,l,m,n,o,p,q,r,s]=await Promise.all([c(61118)(`./${b}/common.json`),c(90338)(`./${b}/worktree.json`),c(62081)(`./${b}/autoYes.json`),c(66125)(`./${b}/error.json`),c(72637)(`./${b}/prompt.json`),c(51877)(`./${b}/auth.json`),c(38898)(`./${b}/schedule.json`),c(80407)(`./${b}/commandPalette.json`),c(70288)(`./${b}/home.json`),c(60887)(`./${b}/review.json`),c(75567)(`./${b}/pwa.json`),c(99127)(`./${b}/notifications.json`),c(1483)(`./${b}/keyboardShortcuts.json`),c(80812)(`./${b}/externalApps.json`)]);return{locale:b,timeZone:"UTC",messages:{common:d.default,worktree:g.default,autoYes:h.default,error:i.default,prompt:j.default,auth:k.default,schedule:l.default,commandPalette:m.default,home:n.default,review:o.default,pwa:p.default,notifications:q.default,keyboardShortcuts:r.default,externalApps:s.default}}})},5772:(a,b,c)=>{"use strict";c.d(b,{Ps:()=>k,W5:()=>j});var d=c(21124),e=c(38301),f=c(90076),g=c(12480);let h={size:g.r5,setSize:()=>{},isMobile:!1,factor:g.d8[g.r5].factor,isAvailable:!1},i=(0,e.createContext)(h);function j({children:a}){let{size:b,setSize:c,isAvailable:h}=(0,g.of)(),j=(0,f.a)(),k=(0,e.useMemo)(()=>({size:b,setSize:c,isMobile:j,factor:g.d8[b].factor,isAvailable:h}),[b,c,j,h]);return(0,d.jsx)(i.Provider,{value:k,children:a})}function k(){return(0,e.useContext)(i)}},6074:(a,b,c)=>{"use strict";c.d(b,{O:()=>e});var d=c(38301);function e(a,b){let[c,e]=(0,d.useState)(a?"open":"closed");return a&&"open"!==c?e("open"):a||"open"!==c||e("exiting"),{shouldRender:a||"closed"!==c,isExiting:!a&&"exiting"===c}}},11010:(a,b,c)=>{"use strict";c.d(b,{M:()=>d});let d={DROPDOWN:10,SIDEBAR:30,MODAL:50,MAXIMIZED_EDITOR:55,TOAST:60,POPOVER:65,CONTEXT_MENU:70}},12055:(a,b,c)=>{"use strict";c.d(b,{Oo:()=>e,ST:()=>d,zS:()=>f});let d="client_version",e="version_mismatch";function f(a){let b;try{b=JSON.parse(a)}catch{return null}if(!b||"object"!=typeof b)return null;let c=b;if("broadcast"===c.type){let a=c.data;return a&&"object"==typeof a?"string"!=typeof a.type?null:(void 0===a.worktreeId&&"string"==typeof c.worktreeId&&(a.worktreeId=c.worktreeId),a):null}return"string"==typeof c.type?c:null}},12305:(a,b,c)=>{Promise.resolve().then(c.t.bind(c,54160,23)),Promise.resolve().then(c.t.bind(c,31603,23)),Promise.resolve().then(c.t.bind(c,68495,23)),Promise.resolve().then(c.t.bind(c,75170,23)),Promise.resolve().then(c.t.bind(c,77526,23)),Promise.resolve().then(c.t.bind(c,78922,23)),Promise.resolve().then(c.t.bind(c,29234,23)),Promise.resolve().then(c.t.bind(c,12263,23)),Promise.resolve().then(c.bind(c,82146))},12480:(a,b,c)=>{"use strict";c.d(b,{Uf:()=>f,d8:()=>g,fM:()=>h,of:()=>j,r5:()=>e,rq:()=>i});var d=c(53237);let e="medium",f=["large","medium","small","xsmall"],g={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 h(a){return"string"==typeof a&&Object.prototype.hasOwnProperty.call(g,a)}function i(a){return g[a].terminalFontSize}function j(){let{value:a,setValue:b,isAvailable:c}=(0,d.V)({key:"mcbd-pc-display-size",defaultValue:e,validate:h});return{size:a,setSize:b,isAvailable:c}}},17793:(a,b,c)=>{"use strict";c.d(b,{y:()=>h});var d=c(21124);c(38301);var e=c(35595);let f={xs:"h-3 w-3",sm:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6",xl:"h-8 w-8"},g={current:"",accent:"text-accent-600 dark:text-accent-400",muted:"text-muted-foreground"};function h({size:a="md",variant:b="current",className:c,...h}){return(0,d.jsxs)("svg",{className:(0,e.cn)("animate-spin",f[a],g[b],c),xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true",...h,children:[(0,d.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,d.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}},22033:(a,b,c)=>{Promise.resolve().then(c.t.bind(c,81170,23)),Promise.resolve().then(c.t.bind(c,23597,23)),Promise.resolve().then(c.t.bind(c,36893,23)),Promise.resolve().then(c.t.bind(c,89748,23)),Promise.resolve().then(c.t.bind(c,6060,23)),Promise.resolve().then(c.t.bind(c,7184,23)),Promise.resolve().then(c.t.bind(c,69576,23)),Promise.resolve().then(c.t.bind(c,73041,23)),Promise.resolve().then(c.t.bind(c,51384,23))},25754:(a,b,c)=>{"use strict";c.d(b,{Xn:()=>e,d9:()=>g,gB:()=>f,rv:()=>h});let d=["en","ja"],e="en",f="locale";function g(a){return"string"==typeof a&&d.includes(a)}function h(a,b){return g(a)?a:d.find(a=>(b??"").includes(a))??e}},26808:(a,b,c)=>{Promise.resolve().then(c.bind(c,58315))},32482:(a,b,c)=>{"use strict";c.d(b,{LV:()=>i,Si:()=>e,UZ:()=>g,Xn:()=>k,_s:()=>l,nO:()=>j,s6:()=>h});let d=["updatedAt","repositoryName","branchName","status","lastSent"],e=a=>d.includes(a),f={waiting:0,ready:1,running:2,generating:3,idle:4};function g(a){let b=new Set;for(let c of a)!1===c.visible&&b.add(c.path);return b}function h(a,b){return 0===b.size?a.slice():a.filter(a=>{let c=a.repositoryPath;return!c||!b.has(c)})}function i(a){let b=function(a){let b=5381;for(let c=0;c<a.length;c++)b=(b<<5)+b+a.charCodeAt(c)|0;return Math.abs(b)}(a)%360;return`hsl(${b}, 65%, 60%)`}function j(a,b){if(!a&&!b)return 0;if(!a)return 1;if(!b)return -1;let c=a instanceof Date?a.getTime():new Date(a).getTime();return(b instanceof Date?b.getTime():new Date(b).getTime())-c}function k(a,b,c){let d=[...a];return d.sort((a,d)=>{let e=0;switch(b){case"updatedAt":{let b=a=>a?a instanceof Date?a.getTime():new Date(a).getTime():0,c=b(a.lastActivity);e=b(d.lastActivity)-c;break}case"repositoryName":{let b=a.repositoryName.toLowerCase(),c=d.repositoryName.toLowerCase();e=b.localeCompare(c);break}case"branchName":{let b=a.name.toLowerCase(),c=d.name.toLowerCase();e=b.localeCompare(c);break}case"status":e=f[a.status]-f[d.status];break;case"lastSent":{let b=j(a.lastActivity,d.lastActivity);if(!a.lastActivity&&!d.lastActivity){e=0;break}if(!a.lastActivity)return 1;if(!d.lastActivity)return -1;e=b;break}default:e=0}return("updatedAt"===b||"lastSent"===b?"desc"===c:"asc"===c)?e:-e}),d}function l(a,b,c){let d=new Map;for(let b of a){let a=b.repositoryName;d.has(a)||d.set(a,[]),d.get(a).push(b)}return[...d.keys()].sort((a,b)=>a.toLowerCase().localeCompare(b.toLowerCase())).map(a=>({repositoryName:a,branches:k(d.get(a),b,c)}))}},35595:(a,b,c)=>{"use strict";c.d(b,{cn:()=>f});var d=c(43249),e=c(58829);function f(...a){return(0,e.QP)((0,d.$)(a))}},36536:(a,b,c)=>{Promise.resolve().then(c.bind(c,80776))},38898:(a,b,c)=>{var d={"./en/schedule.json":[95571,5571],"./ja/schedule.json":[26285,6285]};function e(a){if(!c.o(d,a))return Promise.resolve().then(()=>{var b=Error("Cannot find module '"+a+"'");throw b.code="MODULE_NOT_FOUND",b});var b=d[a],e=b[0];return c.e(b[1]).then(()=>c.t(e,19))}e.keys=()=>Object.keys(d),e.id=38898,a.exports=e},43084:(a,b,c)=>{"use strict";c.d(b,{k:()=>g});var d=c(75338),e=c(94596);let f=["[animation-delay:0ms]","[animation-delay:150ms]","[animation-delay:300ms]"];function g(){let a=(0,e.A)("common");return(0,d.jsx)("div",{className:"flex min-h-screen w-full items-center justify-center p-8",role:"status","aria-label":a("loadingPage"),"data-testid":"route-loading",children:(0,d.jsx)("div",{className:"flex items-center gap-2","aria-hidden":"true",children:f.map(a=>(0,d.jsx)("span",{className:`h-2.5 w-2.5 rounded-full bg-muted-foreground animate-pulse ${a}`},a))})})}},47817:(a,b,c)=>{"use strict";c.d(b,{$f:()=>k,H8:()=>j});var d=c(21124),e=c(38301),f=c(78352);let g=(0,e.createContext)(null),h={selectedWorktreeId:null,worktrees:[],repositories:[],selectedWorktreeDetail:null,isLoading:!0,isLoadingDetail:!1,error:null};function i(a,b){switch(b.type){case"SET_WORKTREES":return{...a,worktrees:b.worktrees,isLoading:!1};case"SET_REPOSITORIES":return{...a,repositories:b.repositories};case"SELECT_WORKTREE":{let c=a.worktrees.find(a=>a.id===b.id)??null;return{...a,selectedWorktreeId:b.id,selectedWorktreeDetail:c??a.selectedWorktreeDetail,isLoadingDetail:null===c}}case"SET_WORKTREE_DETAIL":return{...a,selectedWorktreeDetail:b.detail};case"SET_LOADING":return{...a,isLoading:b.isLoading};case"SET_LOADING_DETAIL":return{...a,isLoadingDetail:b.isLoadingDetail};case"SET_ERROR":return{...a,error:b.error,isLoading:!1};default:return a}}function j({children:a,externalWorktrees:b,externalRepositories:c}){let j=void 0!==b,[k,l]=(0,e.useReducer)(i,h),m=(0,e.useCallback)(async()=>{if(!j){l({type:"SET_LOADING",isLoading:!0}),l({type:"SET_ERROR",error:null});try{let a=await f.y.getAll();l({type:"SET_WORKTREES",worktrees:a.worktrees}),l({type:"SET_REPOSITORIES",repositories:a.repositories??[]})}catch(a){l({type:"SET_ERROR",error:a instanceof Error?a.message:"Failed to fetch worktrees"})}}},[j]),n=(0,e.useCallback)(async a=>{l({type:"SELECT_WORKTREE",id:a}),l({type:"SET_ERROR",error:null});try{f.y.markAsViewed(a).catch(a=>{console.warn("[WorktreeSelectionContext] Failed to mark as viewed:",a)});let b=await f.y.getById(a);l({type:"SET_WORKTREE_DETAIL",detail:b})}catch(a){l({type:"SET_ERROR",error:a instanceof Error?a.message:"Failed to fetch worktree detail"})}finally{l({type:"SET_LOADING_DETAIL",isLoadingDetail:!1})}},[]),o=(0,e.useCallback)(async()=>{await m()},[m]),p={selectedWorktreeId:k.selectedWorktreeId,worktrees:k.worktrees,repositories:k.repositories,selectedWorktreeDetail:k.selectedWorktreeDetail,isLoadingDetail:k.isLoadingDetail,error:k.error,selectWorktree:n,refreshWorktrees:o};return(0,d.jsx)(g.Provider,{value:p,children:a})}function k(){let a=(0,e.useContext)(g);if(!a)throw Error("useWorktreeSelection must be used within a WorktreeSelectionProvider");return a}},48620:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>f});var d=c(75338),e=c(43084);function f(){return(0,d.jsx)(e.k,{})}},51472:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>p,generateMetadata:()=>n,viewport:()=>o});var d=c(75338),e=c(68071),f=c(22513),g=c(42531),h=c(10620),i=c(4986),j=c.n(i),k=c(68034),l=c.n(k),m=c(58315);async function n(){return{title:{default:"CommandMate",template:"%s | CommandMate"},description:(await (0,e.A)("common"))("meta.description"),appleWebApp:{capable:!0,title:"CommandMate",statusBarStyle:"default"}}}c(61135);let o={themeColor:[{media:"(prefers-color-scheme: light)",color:"#fafafb"},{media:"(prefers-color-scheme: dark)",color:"#0a0c12"}],viewportFit:"cover"};async function p({children:a}){let b=await (0,f.A)(),c=await (0,g.A)(),e=await (0,h.A)();return(0,d.jsx)("html",{lang:b,className:`${j().variable} ${l().variable}`,suppressHydrationWarning:!0,children:(0,d.jsx)("body",{className:"min-h-screen bg-background",children:(0,d.jsx)(m.AppProviders,{locale:b,messages:c,timeZone:e,authEnabled:!!process.env.CM_AUTH_TOKEN_HASH,children:a})})})}},51877:(a,b,c)=>{var d={"./en/auth.json":[43440,3440],"./ja/auth.json":[11162,1162]};function e(a){if(!c.o(d,a))return Promise.resolve().then(()=>{var b=Error("Cannot find module '"+a+"'");throw b.code="MODULE_NOT_FOUND",b});var b=d[a],e=b[0];return c.e(b[1]).then(()=>c.t(e,19))}e.keys=()=>Object.keys(d),e.id=51877,a.exports=e},52130:(a,b,c)=>{Promise.resolve().then(c.bind(c,53523))},52761:(a,b,c)=>{"use strict";c.d(b,{Bo:()=>k,Hq:()=>i});var d=c(21124),e=c(38301),f=c(42378);let g={startTransition:a=>a()},h=(0,e.createContext)(null);function i(){let a=(0,f.useRouter)(),{startTransition:b}=(0,e.useContext)(h)??g;return(0,e.useMemo)(()=>({push:c=>b(()=>a.push(c)),replace:c=>b(()=>a.replace(c))}),[a,b])}function j({onCommit:a}){return(0,f.usePathname)(),(0,e.useRef)(!1),null}function k({children:a}){let b=(0,e.useRef)(null),c=(0,e.useCallback)(()=>{b.current?.()},[]),f=(0,e.useCallback)(a=>{var c;c=()=>new Promise(c=>{let d=!1,e=()=>{d||(d=!0,c())};b.current=e,a(),window.setTimeout(e,500)}),"undefined"==typeof document||"function"!=typeof document.startViewTransition?c():document.startViewTransition(c)},[]),g=(0,e.useMemo)(()=>({startTransition:f}),[f]);return(0,d.jsxs)(h.Provider,{value:g,children:[(0,d.jsx)(j,{onCommit:c}),a]})}},53237:(a,b,c)=>{"use strict";c.d(b,{V:()=>e});var d=c(38301);function e(a){let{key:b,defaultValue:c,validate:e,serialize:f=JSON.stringify,deserialize:g=JSON.parse}=a,h=(0,d.useRef)(c),i=(0,d.useRef)(e),j=(0,d.useRef)(f),k=(0,d.useRef)(g);h.current=c,i.current=e,j.current=f,k.current=g;let[l,m]=(0,d.useState)(!1),[n,o]=(0,d.useState)(c);(0,d.useCallback)(()=>h.current,[b]);let p=(0,d.useCallback)(a=>{},[b]);return{value:n,setValue:(0,d.useCallback)(a=>{o(b=>{let c="function"==typeof a?a(b):a;return p(c),c})},[p]),removeValue:(0,d.useCallback)(()=>{o(h.current)},[b]),isAvailable:l}}},57482:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>e});var d=c(97523);let e=async a=>[{type:"image/png",sizes:"192x192",url:(0,d.fillMetadataSegment)(".",await a.params,"icon2.png")+"?6e2321fdb8624653"}]},58315:(a,b,c)=>{"use strict";c.d(b,{AppProviders:()=>d});let d=(0,c(97954).registerClientReference)(function(){throw Error("Attempted to call AppProviders() from the server but AppProviders is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/CommandMate/CommandMate/src/components/providers/AppProviders.tsx","AppProviders")},58970:(a,b,c)=>{"use strict";c.d(b,{$B:()=>j,I2:()=>f,LK:()=>h,Ys:()=>i,pX:()=>d,s7:()=>e,tX:()=>g});let d=2e3,e=1500,f=2e3,g=150,h=100,i=200,j=100},60345:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>e});var d=c(97523);let e=async a=>[{type:"image/png",sizes:"96x96",url:(0,d.fillMetadataSegment)(".",await a.params,"icon1.png")+"?901e04bb11e9b7fd"}]},60887:(a,b,c)=>{var d={"./en/review.json":[83346,3346],"./ja/review.json":[49328,9328]};function e(a){if(!c.o(d,a))return Promise.resolve().then(()=>{var b=Error("Cannot find module '"+a+"'");throw b.code="MODULE_NOT_FOUND",b});var b=d[a],e=b[0];return c.e(b[1]).then(()=>c.t(e,19))}e.keys=()=>Object.keys(d),e.id=60887,a.exports=e},61118:(a,b,c)=>{var d={"./en/common.json":[73543,3543],"./ja/common.json":[53945,3945]};function e(a){if(!c.o(d,a))return Promise.resolve().then(()=>{var b=Error("Cannot find module '"+a+"'");throw b.code="MODULE_NOT_FOUND",b});var b=d[a],e=b[0];return c.e(b[1]).then(()=>c.t(e,19))}e.keys=()=>Object.keys(d),e.id=61118,a.exports=e},61135:()=>{},62081:(a,b,c)=>{var d={"./en/autoYes.json":[44248,4248],"./ja/autoYes.json":[92534,2534]};function e(a){if(!c.o(d,a))return Promise.resolve().then(()=>{var b=Error("Cannot find module '"+a+"'");throw b.code="MODULE_NOT_FOUND",b});var b=d[a],e=b[0];return c.e(b[1]).then(()=>c.t(e,19))}e.keys=()=>Object.keys(d),e.id=62081,a.exports=e},63157:(a,b,c)=>{"use strict";c.d(b,{g7:()=>i,rC:()=>k,Fn:()=>j});var d=c(21124),e=c(38301),f=c(67619),g=c(47817);let h=(0,e.createContext)(null);function i({children:a}){let{worktrees:b,repositories:c,isLoading:i,error:j,refresh:k}=function(){let[a,b]=(0,e.useState)([]),[c,d]=(0,e.useState)([]),[g,h]=(0,e.useState)(!0),[i,j]=(0,e.useState)(null),k=(0,e.useRef)(null),l=(0,e.useRef)([]),m=(0,e.useRef)(null),{connected:n,subscribe:o,unsubscribe:p,addListener:q}=(0,f.xM)(),r=(0,e.useRef)(n);r.current=n;let s=(0,e.useCallback)(async()=>{try{j(null);let a=await fetch("/api/worktrees");if(!a.ok)throw Error(`Failed to fetch worktrees: ${a.status}`);let c=await a.json(),f=c.worktrees??[],g=c.repositories??[];(0,e.startTransition)(()=>{b(f),d(g)}),l.current=f}catch(a){j(a instanceof Error?a:Error(String(a)))}finally{h(!1)}},[]),t=(0,e.useCallback)(()=>l.current.some(a=>!0===a.isSessionRunning),[]),u=(0,e.useCallback)(()=>{let a=t();return r.current?a?2e4:6e4:a?5e3:3e4},[t]),v=(0,e.useCallback)(()=>{null!==k.current&&(clearInterval(k.current),k.current=null),m.current=null},[]);return(0,e.useCallback)(()=>{v();let a=u();m.current=a,k.current=setInterval(()=>{s()},a)},[u,s,v]),a.map(a=>a.id).sort().join(" "),{worktrees:a,repositories:c,isLoading:g,error:i,refresh:s}}(),l=(0,e.useMemo)(()=>({worktrees:b,repositories:c,isLoading:i,error:j,refresh:k}),[b,c,i,j,k]);return(0,d.jsx)(h.Provider,{value:l,children:(0,d.jsx)(g.H8,{externalWorktrees:b,externalRepositories:c,children:a})})}function j(){let a=(0,e.useContext)(h);if(null===a)throw Error("useWorktreesCacheContext must be used within a WorktreesCacheProvider");return a}function k(){return(0,e.useContext)(h)}},64632:(a,b,c)=>{"use strict";c.d(b,{C:()=>h,E:()=>g});var d=c(21124),e=c(38301);let f=(0,e.createContext)({open:!1,setOpen:()=>{},toggle:()=>{}});function g({children:a}){let[b,c]=(0,e.useState)(!1),g=(0,e.useCallback)(()=>c(a=>!a),[]),h=(0,e.useMemo)(()=>({open:b,setOpen:c,toggle:g}),[b,g]);return(0,d.jsx)(f.Provider,{value:h,children:a})}function h(){return(0,e.useContext)(f)}},66125:(a,b,c)=>{var d={"./en/error.json":[22980,2980],"./ja/error.json":[10450,450]};function e(a){if(!c.o(d,a))return Promise.resolve().then(()=>{var b=Error("Cannot find module '"+a+"'");throw b.code="MODULE_NOT_FOUND",b});var b=d[a],e=b[0];return c.e(b[1]).then(()=>c.t(e,19))}e.keys=()=>Object.keys(d),e.id=66125,a.exports=e},67619:(a,b,c)=>{"use strict";c.d(b,{tS:()=>i,xM:()=>j,T3:()=>k});var d=c(21124),e=c(38301);c(12055);let f=()=>{},g={status:"disconnected",connected:!1,subscribe:f,unsubscribe:f,addListener:()=>f},h=(0,e.createContext)(null);function i({children:a,enabled:b=!0}){let c=(0,e.useRef)(new Set),f=(0,e.useRef)(new Map),{status:g,subscribe:i,unsubscribe:j}=function(a={}){let{onEvent:b,onStatusChange:c,autoReconnect:d=!0,reconnectBaseDelay:f=1e3,reconnectMaxDelay:g=3e4,enabled:h=!0}=a,[i,j]=(0,e.useState)("disconnected"),k=(0,e.useRef)(null),l=(0,e.useRef)(null);(0,e.useRef)(0);let m=(0,e.useRef)(new Set),n=(0,e.useRef)(!1);(0,e.useRef)(b).current=b;let o=(0,e.useRef)(c);o.current=c;let p=(0,e.useCallback)(a=>{j(a),o.current?.(a)},[]),q=(0,e.useCallback)(()=>{null!==l.current&&(clearTimeout(l.current),l.current=null)},[]);(0,e.useCallback)(()=>{},[h,d,f,g,p,q]),(0,e.useCallback)(()=>{if(q(),n.current=!0,k.current){try{k.current.close(1e3,"Client disconnect")}catch{}k.current=null}},[q]);let r=(0,e.useCallback)(a=>{let b=k.current,c="undefined"!=typeof globalThis&&"function"==typeof globalThis.WebSocket?globalThis.WebSocket:null;if(b&&c&&b.readyState===c.OPEN)try{b.send(JSON.stringify(a))}catch{}},[]);return{status:i,subscribe:(0,e.useCallback)(a=>{m.current.has(a)||(m.current.add(a),r({type:"subscribe",worktreeId:a}))},[r]),unsubscribe:(0,e.useCallback)(a=>{m.current.has(a)&&(m.current.delete(a),r({type:"unsubscribe",worktreeId:a}))},[r]),send:r}}({enabled:b,onEvent:(0,e.useCallback)(a=>{c.current.forEach(b=>{try{b(a)}catch{}})},[])}),k=(0,e.useCallback)(a=>{let b=f.current,c=b.get(a)??0;b.set(a,c+1),0===c&&i(a)},[i]),l=(0,e.useCallback)(a=>{let b=f.current,c=b.get(a)??0;c<=1?(b.delete(a),j(a)):b.set(a,c-1)},[j]),m=(0,e.useCallback)(a=>(c.current.add(a),()=>{c.current.delete(a)}),[]),n=(0,e.useMemo)(()=>({status:g,connected:"connected"===g,subscribe:k,unsubscribe:l,addListener:m}),[g,k,l,m]);return(0,d.jsx)(h.Provider,{value:n,children:a})}function j(){return(0,e.useContext)(h)??g}function k(a){let{addListener:b}=j();(0,e.useRef)(a).current=a}},70288:(a,b,c)=>{var d={"./en/home.json":[41825,1825],"./ja/home.json":[26159,6159]};function e(a){if(!c.o(d,a))return Promise.resolve().then(()=>{var b=Error("Cannot find module '"+a+"'");throw b.code="MODULE_NOT_FOUND",b});var b=d[a],e=b[0];return c.e(b[1]).then(()=>c.t(e,19))}e.keys=()=>Object.keys(d),e.id=70288,a.exports=e},72637:(a,b,c)=>{var d={"./en/prompt.json":[72816,2816],"./ja/prompt.json":[80066,7685]};function e(a){if(!c.o(d,a))return Promise.resolve().then(()=>{var b=Error("Cannot find module '"+a+"'");throw b.code="MODULE_NOT_FOUND",b});var b=d[a],e=b[0];return c.e(b[1]).then(()=>c.t(e,19))}e.keys=()=>Object.keys(d),e.id=72637,a.exports=e},75567:(a,b,c)=>{var d={"./en/pwa.json":[51262,1262],"./ja/pwa.json":[46072,6072]};function e(a){if(!c.o(d,a))return Promise.resolve().then(()=>{var b=Error("Cannot find module '"+a+"'");throw b.code="MODULE_NOT_FOUND",b});var b=d[a],e=b[0];return c.e(b[1]).then(()=>c.t(e,19))}e.keys=()=>Object.keys(d),e.id=75567,a.exports=e},78162:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>e});var d=c(97523);let e=async a=>[{type:"image/png",sizes:"32x32",url:(0,d.fillMetadataSegment)(".",await a.params,"icon.png")+"?eeae29d23f3aae17"}]},78352:(a,b,c)=>{"use strict";c.d(b,{$T:()=>i,GQ:()=>k,Rx:()=>h,hD:()=>d,hS:()=>j,y:()=>g});class d extends Error{constructor(a,b,c){super(a),this.status=b,this.data=c,this.name="ApiError"}}async function e(a,b,c){if(!(a.headers.get("content-type")||"").includes("application/json"))return b;try{return await a.json()}catch{return b}}async function f(a,b){try{let c=new Headers(b?.headers);c.set("Content-Type","application/json");let f=await fetch(a,{...b,headers:c}),g=f.headers.get("content-type")||"";if(f.redirected&&f.url.includes("/login"))throw new d("Authentication required",401);if(!f.ok){let a=await e(f,{},"error-body");throw new d(a.error||`HTTP error ${f.status}`,f.status,a)}if(!g.includes("application/json"))throw new d("Unexpected response format",f.status);return f.json()}catch(a){if(a instanceof d)throw a;throw new d(a instanceof Error?a.message:"Unknown error",0,a)}}let g={getAll:async()=>f("/api/worktrees"),getById:async a=>f(`/api/worktrees/${a}`),updateDescription:async(a,b)=>f(`/api/worktrees/${a}`,{method:"PATCH",body:JSON.stringify({description:b})}),updateLink:async(a,b)=>f(`/api/worktrees/${a}`,{method:"PATCH",body:JSON.stringify({link:b})}),toggleFavorite:async(a,b)=>f(`/api/worktrees/${a}`,{method:"PATCH",body:JSON.stringify({favorite:b})}),updateStatus:async(a,b)=>f(`/api/worktrees/${a}`,{method:"PATCH",body:JSON.stringify({status:b})}),updateCliTool:async(a,b)=>f(`/api/worktrees/${a}`,{method:"PATCH",body:JSON.stringify({cliToolId:b})}),markAsViewed:async a=>f(`/api/worktrees/${a}/viewed`,{method:"PATCH"}),async getMessages(a,b,c,d){let e=new URLSearchParams;return b&&e.append("cliTool",b),c&&e.append("includeArchived","true"),"number"==typeof d&&Number.isFinite(d)&&e.append("limit",String(d)),f(`/api/worktrees/${a}/messages${e.toString()?`?${e.toString()}`:""}`)},async sendMessage(a,b,c){let d={content:b};return c?.cliToolId&&(d.cliToolId=c.cliToolId),c?.instanceId&&(d.instanceId=c.instanceId),c?.imagePath&&(d.imagePath=c.imagePath),f(`/api/worktrees/${a}/send`,{method:"POST",body:JSON.stringify(d)})},async uploadImageFile(a,b){let c=Date.now(),d=`${c}-${b.name}`,f=".commandmate/attachments",g=new FormData;g.append("file",new File([b],d,{type:b.type}));let h=await fetch(`/api/worktrees/${a}/upload/${f}`,{method:"POST",body:g});if(!h.ok){let a=await e(h,{},"error-body");throw Error(a?.error?.message||`Upload failed (HTTP ${h.status})`)}return{path:(await e(h,{},"response-body")).path||`${f}/${d}`}},getLogs:async a=>f(`/api/worktrees/${a}/logs`),async getLogFile(a,b,c){let d=c?.sanitize?"?sanitize=true":"";return f(`/api/worktrees/${a}/logs/${b}${d}`)},async killSession(a,b,c){let d=new URLSearchParams;b&&d.set("cliTool",b),c&&d.set("instance",c);let e=d.toString();return f(`/api/worktrees/${a}/kill-session${e?`?${e}`:""}`,{method:"POST"})}},h={scan:async a=>f("/api/repositories/scan",{method:"POST",body:JSON.stringify({repositoryPath:a})}),sync:async()=>f("/api/repositories/sync",{method:"POST"}),delete:async a=>f("/api/repositories",{method:"DELETE",body:JSON.stringify({repositoryPath:a})}),clone:async a=>f("/api/repositories/clone",{method:"POST",body:JSON.stringify({cloneUrl:a})}),getCloneStatus:async a=>f(`/api/repositories/clone/${a}`),getExcluded:async()=>f("/api/repositories/excluded"),restore:async a=>f("/api/repositories/restore",{method:"PUT",body:JSON.stringify({repositoryPath:a})}),list:async()=>f("/api/repositories"),updateDisplayName:async(a,b)=>f(`/api/repositories/${encodeURIComponent(a)}`,{method:"PUT",body:JSON.stringify({displayName:b})}),updateVisibility:async(a,b)=>f(`/api/repositories/${encodeURIComponent(a)}`,{method:"PUT",body:JSON.stringify({visible:b})})},i={getAll:async a=>(await f(`/api/worktrees/${a}/memos`)).memos,create:async(a,b)=>(await f(`/api/worktrees/${a}/memos`,{method:"POST",body:JSON.stringify(b||{})})).memo,update:async(a,b,c)=>(await f(`/api/worktrees/${a}/memos/${b}`,{method:"PUT",body:JSON.stringify(c)})).memo,delete:async(a,b)=>f(`/api/worktrees/${a}/memos/${b}`,{method:"DELETE"}),async reorder(a,b){await f(`/api/worktrees/${a}/memos`,{method:"PATCH",body:JSON.stringify({memoIds:b})})}};function j(a){return a instanceof d||a instanceof Error?a.message:"An unknown error occurred"}let k={checkForUpdate:async()=>f("/api/app/update-check",{method:"GET"}),startUpdate:async()=>f("/api/app/update",{method:"POST"}),async ping(){try{return(await fetch("/api/auth/status",{cache:"no-store"})).ok}catch{return!1}}}},79782:(a,b,c)=>{"use strict";c.d(b,{SC:()=>m,TM:()=>i,aF:()=>k});var d=c(21124),e=c(38301),f=c(20481),g=c(98033),h=c(94260);function i({isOpen:a,title:b,description:c,confirmLabel:e,cancelLabel:i,variant:j="default",onConfirm:k,onCancel:l}){let m=(0,f.c)("common"),n="danger"===j;return(0,d.jsx)(g.a,{isOpen:a,onClose:l,title:b??m("confirmDialog.title"),size:"sm",showCloseButton:!1,children:(0,d.jsxs)("div",{className:"space-y-4","data-testid":"confirm-dialog",children:[(0,d.jsx)("p",{className:"text-sm text-foreground whitespace-pre-line",children:c}),(0,d.jsxs)("div",{className:"flex justify-end gap-3",children:[(0,d.jsx)(h.$,{type:"button",variant:"secondary",size:"sm",autoFocus:n,onClick:l,"data-testid":"confirm-dialog-cancel",children:i??m("cancel")}),(0,d.jsx)(h.$,{type:"button",variant:n?"danger":"primary",size:"sm",autoFocus:!n,onClick:k,"data-testid":"confirm-dialog-confirm",children:e??m("confirmDialog.confirm")})]})]})})}let j=(0,e.createContext)(null);function k({children:a}){let[b,c]=(0,e.useState)(null),f=(0,e.useRef)(null),g=(0,e.useRef)(null),h=b?.options??g.current,k=(0,e.useCallback)(a=>new Promise(b=>{f.current=document.activeElement instanceof HTMLElement?document.activeElement:null,c(c=>(c?.resolve(!1),{options:a,resolve:b}))}),[]),l=(0,e.useCallback)(a=>{c(b=>(b?.resolve(a),null)),f.current?.focus(),f.current=null},[]);return(0,d.jsxs)(j.Provider,{value:k,children:[a,(0,d.jsx)(i,{isOpen:null!==b,title:h?.title,description:h?.description??"",confirmLabel:h?.confirmLabel,cancelLabel:h?.cancelLabel,variant:h?.variant,onConfirm:()=>l(!0),onCancel:()=>l(!1)})]})}let l=async()=>!1;function m(){return(0,e.useContext)(j)??l}},80407:(a,b,c)=>{var d={"./en/commandPalette.json":[28098,8098],"./ja/commandPalette.json":[12560,2560]};function e(a){if(!c.o(d,a))return Promise.resolve().then(()=>{var b=Error("Cannot find module '"+a+"'");throw b.code="MODULE_NOT_FOUND",b});var b=d[a],e=b[0];return c.e(b[1]).then(()=>c.t(e,19))}e.keys=()=>Object.keys(d),e.id=80407,a.exports=e},80776:(a,b,c)=>{"use strict";c.d(b,{AppProviders:()=>u});var d=c(21124),e=c(37397),f=c(45523),g=c(81092),h=c(84342),i=c(5772),j=c(64632),k=c(89184),l=c(63157),m=c(52761),n=c(67619),o=c(79782),p=c(38301),q=c(20481),r=c(25345),s=c(11010);function t(){let a=(0,q.c)("pwa"),[b,c]=(0,p.useState)(null);return((0,p.useRef)(!1),b)?(0,d.jsx)("div",{role:"status","aria-live":"polite",className:"fixed inset-x-0 bottom-0 flex justify-center px-4 pb-safe",style:{zIndex:s.M.TOAST},children:(0,d.jsxs)("div",{className:"mb-4 flex items-center gap-3 rounded-lg border border-border bg-surface px-4 py-3 shadow-lg",children:[(0,d.jsx)("span",{className:"text-sm font-medium text-foreground",children:a("update.available")}),(0,d.jsxs)("button",{type:"button",onClick:()=>{b.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,d.jsx)(r.A,{className:"h-4 w-4"}),a("update.reload")]})]})}):null}function u({children:a,locale:b,messages:c,timeZone:p,authEnabled:q=!1}){return(0,d.jsx)(e.default,{locale:b,messages:c,timeZone:p,children:(0,d.jsx)(f.N,{attribute:"class",defaultTheme:"system",enableSystem:!0,children:(0,d.jsx)(h.O,{authEnabled:q,children:(0,d.jsx)(i.W5,{children:(0,d.jsx)(g.GB,{children:(0,d.jsx)(n.tS,{children:(0,d.jsx)(l.g7,{children:(0,d.jsx)(j.E,{children:(0,d.jsx)(k.S,{children:(0,d.jsxs)(o.aF,{children:[(0,d.jsx)(m.Bo,{children:a}),(0,d.jsx)(t,{})]})})})})})})})})})})}},80812:(a,b,c)=>{var d={"./en/externalApps.json":[37941,7941],"./ja/externalApps.json":[99211,9211]};function e(a){if(!c.o(d,a))return Promise.resolve().then(()=>{var b=Error("Cannot find module '"+a+"'");throw b.code="MODULE_NOT_FOUND",b});var b=d[a],e=b[0];return c.e(b[1]).then(()=>c.t(e,19))}e.keys=()=>Object.keys(d),e.id=80812,a.exports=e},81092:(a,b,c)=>{"use strict";c.d(b,{GB:()=>j,VF:()=>k});var d=c(21124),e=c(38301),f=c(32482);let g="updatedAt",h=(0,e.createContext)(null);function i(a,b){switch(b.type){case"TOGGLE":return{...a,isOpen:!a.isOpen};case"SET_WIDTH":return{...a,width:b.width};case"OPEN_MOBILE_DRAWER":return{...a,isMobileDrawerOpen:!0};case"CLOSE_MOBILE_DRAWER":return{...a,isMobileDrawerOpen:!1};case"SET_SORT_KEY":return{...a,sortKey:b.sortKey};case"SET_SORT_DIRECTION":return{...a,sortDirection:b.sortDirection};case"LOAD_SORT_SETTINGS":return{...a,sortKey:b.sortKey,sortDirection:b.sortDirection};case"SET_VIEW_MODE":return{...a,viewMode:b.viewMode};default:return a}}function j({children:a,initialOpen:b=!0,initialWidth:c=224}){let[j,k]=(0,e.useReducer)(i,{isOpen:b,width:c,isMobileDrawerOpen:!1,sortKey:g,sortDirection:"desc",viewMode:"grouped"});j.sortKey,j.sortDirection,(0,e.useRef)(!0),j.viewMode,(0,e.useRef)(!0),j.width,(0,e.useRef)(!0);let l=(0,e.useCallback)(()=>{k({type:"TOGGLE"})},[]),m=(0,e.useCallback)(a=>{k({type:"SET_WIDTH",width:a})},[]),n=(0,e.useCallback)(()=>{k({type:"OPEN_MOBILE_DRAWER"})},[]),o=(0,e.useCallback)(()=>{k({type:"CLOSE_MOBILE_DRAWER"})},[]),p=(0,e.useCallback)(a=>{k({type:"SET_SORT_KEY",sortKey:a})},[]),q=(0,e.useCallback)(a=>{k({type:"SET_SORT_DIRECTION",sortDirection:a})},[]),r=(0,e.useCallback)(a=>{k({type:"SET_VIEW_MODE",viewMode:a})},[]),s=(0,e.useMemo)(()=>({isOpen:j.isOpen,width:j.width,isMobileDrawerOpen:j.isMobileDrawerOpen,sortKey:j.sortKey,sortDirection:j.sortDirection,toggle:l,setWidth:m,openMobileDrawer:n,closeMobileDrawer:o,setSortKey:p,setSortDirection:q,viewMode:j.viewMode,setViewMode:r}),[j.isOpen,j.width,j.isMobileDrawerOpen,j.sortKey,j.sortDirection,j.viewMode,l,m,n,o,p,q,r]);return(0,d.jsx)(h.Provider,{value:s,children:a})}function k(){let a=(0,e.useContext)(h);if(!a)throw Error("useSidebarContext must be used within a SidebarProvider");return a}},84342:(a,b,c)=>{"use strict";c.d(b,{H:()=>h,O:()=>g});var d=c(21124),e=c(38301);let f=(0,e.createContext)(!1);function g({children:a,authEnabled:b}){return(0,d.jsx)(f.Provider,{value:b,children:a})}function h(){return(0,e.useContext)(f)}},86634:(a,b,c)=>{Promise.resolve().then(c.bind(c,37397))},89184:(a,b,c)=>{"use strict";c.d(b,{K:()=>h,S:()=>g});var d=c(21124),e=c(38301);let f=(0,e.createContext)({open:!1,setOpen:()=>{},toggle:()=>{}});function g({children:a}){let[b,c]=(0,e.useState)(!1),g=(0,e.useCallback)(()=>c(a=>!a),[]),h=(0,e.useMemo)(()=>({open:b,setOpen:c,toggle:g}),[b,g]);return(0,d.jsx)(f.Provider,{value:h,children:a})}function h(){return(0,e.useContext)(f)}},90076:(a,b,c)=>{"use strict";c.d(b,{D:()=>f,a:()=>g});var d=c(38301);let e=d.useEffect,f=768;function g(a={}){let{breakpoint:b=f}=a,[c,h]=(0,d.useState)(!1);return e(()=>{let a=window.matchMedia(`(max-width: ${b-1}px)`);h(a.matches);let c=a=>{h(a.matches)};return a.addEventListener("change",c),()=>{a.removeEventListener("change",c)}},[b]),c}},90338:(a,b,c)=>{var d={"./en/worktree.json":[72119,2119],"./ja/worktree.json":[52445,2445]};function e(a){if(!c.o(d,a))return Promise.resolve().then(()=>{var b=Error("Cannot find module '"+a+"'");throw b.code="MODULE_NOT_FOUND",b});var b=d[a],e=b[0];return c.e(b[1]).then(()=>c.t(e,19))}e.keys=()=>Object.keys(d),e.id=90338,a.exports=e},94260:(a,b,c)=>{"use strict";c.d(b,{$:()=>i});var d=c(21124);c(38301);var e=c(26691),f=c(35595),g=c(17793);let h=(0,e.F)("inline-flex items-center justify-center px-4 py-2 rounded-md font-medium transition-all duration-200 touch-manipulation focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ring-offset-background",{variants:{variant:{primary:"bg-accent-600 dark:bg-accent-500 text-white hover:bg-accent-700 dark:hover:bg-accent-600",secondary:"bg-muted text-foreground hover:bg-muted/80",danger:"bg-danger text-white hover:bg-danger/90",ghost:"bg-transparent text-foreground hover:bg-muted"},size:{sm:"px-3 py-1.5 text-sm",md:"",lg:"px-6 py-3 text-lg"},fullWidth:{true:"w-full",false:""}},defaultVariants:{variant:"primary",size:"md",fullWidth:!1}});function i({variant:a="primary",size:b="md",fullWidth:c=!1,loading:e=!1,disabled:i,className:j="",children:k,...l}){let m=i||e,n=(0,f.cn)(h({variant:a,size:b,fullWidth:c}),!m&&"motion-safe:hover:-translate-y-0.5 motion-safe:active:translate-y-0",m&&"opacity-50 cursor-not-allowed",j);return(0,d.jsxs)("button",{className:n,disabled:m,...l,children:[e&&(0,d.jsx)(g.y,{size:"sm",className:"-ml-1 mr-2"}),k]})}},94650:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>e});var d=c(97523);let e=async a=>[{type:"image/png",sizes:"180x180",url:(0,d.fillMetadataSegment)(".",await a.params,"apple-icon.png")+"?31a89e65aa4ac65b"}]},95427:(a,b,c)=>{"use strict";c.d(b,{r:()=>e});var d=c(38301);function e(a={}){let{active:b=!0,initialFocus:c=!0,restoreFocus:f=!0}=a;return(0,d.useRef)(null)}},98033:(a,b,c)=>{"use strict";c.d(b,{a:()=>o});var d=c(21124),e=c(38301),f=c(23312),g=c(20481),h=c(26691),i=c(11010),j=c(58970),k=c(6074),l=c(95427),m=c(35595);let n=(0,h.F)("",{variants:{size:{sm:"max-w-[calc(100vw-2rem)] sm:max-w-md",md:"max-w-[calc(100vw-2rem)] sm:max-w-2xl",lg:"max-w-[calc(100vw-2rem)] sm:max-w-4xl",xl:"max-w-[calc(100vw-2rem)] sm:max-w-6xl",full:"max-w-[calc(100vw-2rem)] sm:max-w-[95vw]"}},defaultVariants:{size:"lg"}});function o({isOpen:a,onClose:b,title:c,children:h,size:o="lg",showCloseButton:p=!0,disableClose:q=!1}){let r=(0,g.c)("common"),s=(0,e.useId)(),t=(0,l.r)({active:a}),{shouldRender:u,isExiting:v}=(0,k.O)(a,j.Ys),w=v?"closed":"open";return u?(0,f.createPortal)((0,d.jsxs)("div",{className:"fixed inset-0 overflow-y-auto",style:{zIndex:i.M.MODAL},children:[(0,d.jsx)("div",{"data-state":w,className:"fixed inset-0 bg-black/50 transition-opacity data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:duration-200 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:duration-200 data-[state=closed]:fill-mode-forwards",onClick:q||v?void 0:b}),(0,d.jsx)("div",{className:"relative flex min-h-full items-center justify-center p-2 sm:p-4",children:(0,d.jsxs)("div",{ref:t,"data-state":w,"data-testid":"modal-panel",role:"dialog","aria-modal":"true","aria-labelledby":c?s:void 0,tabIndex:-1,className:(0,m.cn)("relative w-full",n({size:o}),"max-h-[calc(100vh-1rem)] sm:max-h-[calc(100vh-2rem)] flex flex-col bg-surface rounded-lg shadow-xl transform transition-all","data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:duration-200","data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:duration-200 data-[state=closed]:fill-mode-forwards"),children:[(c||p)&&(0,d.jsxs)("div",{className:"flex items-center justify-between px-4 sm:px-6 py-3 sm:py-4 border-b border-border flex-shrink-0",children:[(0,d.jsx)("h3",{id:s,className:"text-base sm:text-lg font-semibold text-foreground truncate pr-2",children:c}),p&&(0,d.jsx)("button",{onClick:b,"aria-label":r("close"),className:"text-muted-foreground hover:text-foreground transition-colors flex-shrink-0 touch-manipulation",children:(0,d.jsx)("svg",{className:"w-5 h-5 sm:w-6 sm:h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,d.jsx)("div",{className:"px-4 sm:px-6 py-3 sm:py-4 overflow-y-auto flex-1 min-h-0",children:h})]})})]}),document.body):null}},99127:(a,b,c)=>{var d={"./en/notifications.json":[49358,9358],"./ja/notifications.json":[61296,1296]};function e(a){if(!c.o(d,a))return Promise.resolve().then(()=>{var b=Error("Cannot find module '"+a+"'");throw b.code="MODULE_NOT_FOUND",b});var b=d[a],e=b[0];return c.e(b[1]).then(()=>c.t(e,19))}e.keys=()=>Object.keys(d),e.id=99127,a.exports=e}};
@@ -1,3 +1,3 @@
1
- "use strict";exports.id=9687,exports.ids=[9687],exports.modules={12462:(a,b,c)=>{c.d(b,{T8:()=>j,o4:()=>k});var d=c(31766),e=c(56791),f=c(1722),g=c(82450),h=c(15194);let i=(0,c(72626).h)("assistant-response-saver");function j(a,b){switch(b){case"claude":return(0,g.NN)(a);case"gemini":return(0,g.IS)(a);case"opencode":return(0,g.aW)(a);case"copilot":return(0,g.LH)(a);default:return a.trim()}}async function k(a,b,c,g,k){let l=k??c;try{let m;if((0,h.VA)(c))return null;let n=(0,e.y1)(a,b,l),o=n?.lastCapturedLine||0;try{m=await (0,d.Wh)(b,c,1e4,k)}catch{return i.info("failed-to-capture"),null}if(!m)return null;let p=m.split("\n"),q=p.length;for(;q>0&&""===p[q-1].trim();)q--;let r=q,{bufferReset:s,reason:t}=r>0&&o>25&&r+25<o?{bufferReset:!0,reason:"shrink"}:r>0&&o>50&&r<50?{bufferReset:!0,reason:"restart"}:{bufferReset:!1,reason:null};s&&i.info("buffer:reset-detected",{reason:t,currentLineCount:r,lastCapturedLine:o});let u=s?0:o;if(!s&&r<=o)return r<o&&((0,e.gb)(a,b,c,r,k),i.info("position:corrected-stale",{from:o,to:r})),null;let v=p.slice(u).join("\n"),w=j(v,c);if(!w||""===w.trim())return(0,e.gb)(a,b,c,r,k),i.debug("response:empty-after-clean",{currentLineCount:r}),null;let x=new Date(g.getTime()-1),y=(0,e.oH)(a,{worktreeId:b,role:"assistant",content:w,messageType:"normal",timestamp:x,cliToolId:c,instanceId:l});return(0,e.gb)(a,b,c,r,k),(0,f.Lo)("message",{worktreeId:b,message:y}),i.info("response:saved",{fromLine:o,toLine:r}),y}catch(a){return i.error("error:",{error:a instanceof Error?a.message:String(a)}),null}}},39687:(a,b,c)=>{c.d(b,{d:()=>o});var d=c(56791),e=c(31268),f=c(15194),g=c(95220),h=c(12462),i=c(11665),j=c(93997),k=c(72626),l=c(56263);let m=(0,k.h)("session/send-user-message");function n(a){return a instanceof Error?a.message:String(a)}async function o(a,b){let{worktreeId:c,content:k,cliToolId:o,instanceId:p,absoluteImagePath:q,copilotModel:r}=b,s=b.messageType??"normal",t=e.s.getInstance().getTool(o),u=new Date;try{await (0,h.o4)(a,c,o,u,p)}catch(a){m.error("failed-to-save-pending-assistant-response:",{error:n(a)})}let v=null;try{let b=(0,d.VL)(a,c,{limit:1,cliToolId:o,instanceId:p});b.length>0&&"user"===b[0].role&&b[0].content===k&&(v=b[0].id)}catch(a){m.error("failed-to-detect-orphaned-messages:",{error:n(a)})}if(r&&"copilot"===o)try{await t.sendModelCommand(c,r,p),m.info("copilot-model-command-sent",{model:r})}catch(a){return m.error("failed-to-send-model-command:",{error:n(a)}),{ok:!1,stage:"model",error:n(a)}}try{if(q)if((0,f._J)(t))await t.sendMessageWithImage(c,k,q,p);else{let a=k?`${k}
1
+ "use strict";exports.id=9687,exports.ids=[9687],exports.modules={12462:(a,b,c)=>{c.d(b,{T8:()=>j,o4:()=>k});var d=c(31766),e=c(56791),f=c(49997),g=c(82450),h=c(15194);let i=(0,c(72626).h)("assistant-response-saver");function j(a,b){switch(b){case"claude":return(0,g.NN)(a);case"gemini":return(0,g.IS)(a);case"opencode":return(0,g.aW)(a);case"copilot":return(0,g.LH)(a);default:return a.trim()}}async function k(a,b,c,g,k){let l=k??c;try{let m;if((0,h.VA)(c))return null;let n=(0,e.y1)(a,b,l),o=n?.lastCapturedLine||0;try{m=await (0,d.Wh)(b,c,1e4,k)}catch{return i.info("failed-to-capture"),null}if(!m)return null;let p=m.split("\n"),q=p.length;for(;q>0&&""===p[q-1].trim();)q--;let r=q,{bufferReset:s,reason:t}=r>0&&o>25&&r+25<o?{bufferReset:!0,reason:"shrink"}:r>0&&o>50&&r<50?{bufferReset:!0,reason:"restart"}:{bufferReset:!1,reason:null};s&&i.info("buffer:reset-detected",{reason:t,currentLineCount:r,lastCapturedLine:o});let u=s?0:o;if(!s&&r<=o)return r<o&&((0,e.gb)(a,b,c,r,k),i.info("position:corrected-stale",{from:o,to:r})),null;let v=p.slice(u).join("\n"),w=j(v,c);if(!w||""===w.trim())return(0,e.gb)(a,b,c,r,k),i.debug("response:empty-after-clean",{currentLineCount:r}),null;let x=new Date(g.getTime()-1),y=(0,e.oH)(a,{worktreeId:b,role:"assistant",content:w,messageType:"normal",timestamp:x,cliToolId:c,instanceId:l});return(0,e.gb)(a,b,c,r,k),(0,f.Lo)("message",{worktreeId:b,message:y}),i.info("response:saved",{fromLine:o,toLine:r}),y}catch(a){return i.error("error:",{error:a instanceof Error?a.message:String(a)}),null}}},39687:(a,b,c)=>{c.d(b,{d:()=>o});var d=c(56791),e=c(31268),f=c(15194),g=c(95220),h=c(12462),i=c(11665),j=c(93997),k=c(72626),l=c(56263);let m=(0,k.h)("session/send-user-message");function n(a){return a instanceof Error?a.message:String(a)}async function o(a,b){let{worktreeId:c,content:k,cliToolId:o,instanceId:p,absoluteImagePath:q,copilotModel:r}=b,s=b.messageType??"normal",t=e.s.getInstance().getTool(o),u=new Date;try{await (0,h.o4)(a,c,o,u,p)}catch(a){m.error("failed-to-save-pending-assistant-response:",{error:n(a)})}let v=null;try{let b=(0,d.VL)(a,c,{limit:1,cliToolId:o,instanceId:p});b.length>0&&"user"===b[0].role&&b[0].content===k&&(v=b[0].id)}catch(a){m.error("failed-to-detect-orphaned-messages:",{error:n(a)})}if(r&&"copilot"===o)try{await t.sendModelCommand(c,r,p),m.info("copilot-model-command-sent",{model:r})}catch(a){return m.error("failed-to-send-model-command:",{error:n(a)}),{ok:!1,stage:"model",error:n(a)}}try{if(q)if((0,f._J)(t))await t.sendMessageWithImage(c,k,q,p);else{let a=k?`${k}
2
2
 
3
3
  [添付画像: ${q}]`:`[添付画像: ${q}]`;await t.sendMessage(c,a,p)}else if("copilot"===o){let a=t.getSessionName(c,p),b=k.replace(/\n+/g," ").trim();await (0,i.V1)(a,b,!1),await new Promise(a=>setTimeout(a,l.wp)),await (0,i.KB)(a,["Enter"]),(0,j.gm)(a)}else await t.sendMessage(c,k,p)}catch(a){return m.error("failed-to-send-message-to:",{error:n(a)}),{ok:!1,stage:"send",error:n(a)}}let w=(0,d.oH)(a,{worktreeId:c,role:"user",content:k,messageType:s,timestamp:u,cliToolId:o,instanceId:p});if(v)try{(0,d.DF)(a,v)&&m.info("cleaned-up-orphaned-user")}catch(a){m.error("failed-to-clean-up-orphaned-message:",{error:n(a)})}return(0,d.EU)(a,c,k,u),(0,d.YX)(a,c,o,p),m.info("cleared-in-progress-message-for"),(0,g.startPolling)(c,o,p),{ok:!0,message:w}}}};
@@ -17,11 +17,11 @@
17
17
  "wasm": [],
18
18
  "assets": [],
19
19
  "env": {
20
- "__NEXT_BUILD_ID": "Ndx_NzkoP54cD0UCmjUlu",
21
- "NEXT_SERVER_ACTIONS_ENCRYPTION_KEY": "+Rl2jTeBUIodgnKGrvxTitueQFFu2THRPgd8+yozBBQ=",
22
- "__NEXT_PREVIEW_MODE_ID": "eb09bfde030abb7d296ce1ed8573df3d",
23
- "__NEXT_PREVIEW_MODE_SIGNING_KEY": "ff739e82e7c7e019fa39b25a996a5baa2118373338a2e6b09bd39f8ddd5eb2c2",
24
- "__NEXT_PREVIEW_MODE_ENCRYPTION_KEY": "1dfa0039b231d8839508262e321b8d1ccece4de3fd4c15dc320991f1a8393248"
20
+ "__NEXT_BUILD_ID": "uBCIYS1Hth7V4unroKqGu",
21
+ "NEXT_SERVER_ACTIONS_ENCRYPTION_KEY": "3zyx1JRyA202ce4qzM2CwV/35oxN2TaxiQH3hSAtPTM=",
22
+ "__NEXT_PREVIEW_MODE_ID": "e6dc15a1dbdb111f7e6a3da4b3e323ca",
23
+ "__NEXT_PREVIEW_MODE_SIGNING_KEY": "064885d60dd5e22c524990d6dbafa0cb0ef34732d44e9e932a9a4dc7de61694e",
24
+ "__NEXT_PREVIEW_MODE_ENCRYPTION_KEY": "955096c8842e550e02a8cf17e8135173659f4c43b6b3eab3959064e867a38845"
25
25
  }
26
26
  }
27
27
  },
@@ -1 +1 @@
1
- <!DOCTYPE html><html><head><meta charSet="utf-8" data-next-head=""/><meta name="viewport" content="width=device-width" data-next-head=""/><title data-next-head="">500: Internal Server Error</title><noscript data-n-css=""></noscript><script defer="" noModule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-4fbc38b2e3abb013.js" defer=""></script><script src="/_next/static/chunks/framework-eaf13c96191cb608.js" defer=""></script><script src="/_next/static/chunks/main-6092074a0dc78280.js" defer=""></script><script src="/_next/static/chunks/pages/_app-4b3fb5e477a0267f.js" defer=""></script><script src="/_next/static/chunks/pages/_error-c970d8b55ace1b48.js" defer=""></script><script src="/_next/static/Ndx_NzkoP54cD0UCmjUlu/_buildManifest.js" defer=""></script><script src="/_next/static/Ndx_NzkoP54cD0UCmjUlu/_ssgManifest.js" defer=""></script></head><body><div id="__next"><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div style="line-height:48px"><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding-right:23px;font-size:24px;font-weight:500;vertical-align:top">500</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:28px">Internal Server Error<!-- -->.</h2></div></div></div></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":500}},"page":"/_error","query":{},"buildId":"Ndx_NzkoP54cD0UCmjUlu","nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>
1
+ <!DOCTYPE html><html><head><meta charSet="utf-8" data-next-head=""/><meta name="viewport" content="width=device-width" data-next-head=""/><title data-next-head="">500: Internal Server Error</title><noscript data-n-css=""></noscript><script defer="" noModule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-4fbc38b2e3abb013.js" defer=""></script><script src="/_next/static/chunks/framework-eaf13c96191cb608.js" defer=""></script><script src="/_next/static/chunks/main-6092074a0dc78280.js" defer=""></script><script src="/_next/static/chunks/pages/_app-4b3fb5e477a0267f.js" defer=""></script><script src="/_next/static/chunks/pages/_error-c970d8b55ace1b48.js" defer=""></script><script src="/_next/static/uBCIYS1Hth7V4unroKqGu/_buildManifest.js" defer=""></script><script src="/_next/static/uBCIYS1Hth7V4unroKqGu/_ssgManifest.js" defer=""></script></head><body><div id="__next"><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div style="line-height:48px"><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding-right:23px;font-size:24px;font-weight:500;vertical-align:top">500</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:28px">Internal Server Error<!-- -->.</h2></div></div></div></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":500}},"page":"/_error","query":{},"buildId":"uBCIYS1Hth7V4unroKqGu","nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>
@@ -1,5 +1,5 @@
1
1
  {
2
- "/_error": "pages/_error.js",
3
2
  "/_app": "pages/_app.js",
3
+ "/_error": "pages/_error.js",
4
4
  "/_document": "pages/_document.js"
5
5
  }
@@ -1 +1 @@
1
- {"node":{},"edge":{},"encryptionKey":"+Rl2jTeBUIodgnKGrvxTitueQFFu2THRPgd8+yozBBQ="}
1
+ {"node":{},"edge":{},"encryptionKey":"3zyx1JRyA202ce4qzM2CwV/35oxN2TaxiQH3hSAtPTM="}
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4560],{4560:(e,t,r)=>{r.d(t,{GV:()=>tt});var n=r(95155),s=r(12115),a=r(20063),o=r(52619),i=r.n(o),l=r(89275);let c=(0,s.forwardRef)(function(e,t){let{href:r,onClick:s,target:o,...c}=e,d=(0,a.usePathname)(),u=(0,l.Hq)();return(0,n.jsx)(i(),{ref:t,href:r,target:o,onClick:e=>{var t;null==s||s(e),e.defaultPrevented||0!==(t=e).button||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||void 0!==o&&"_self"!==o||/^([a-z][a-z0-9+.-]*:)?\/\//i.test(r)||/^(mailto:|tel:)/i.test(r)||(e.preventDefault(),r!==d&&u.push(r))},...c})});var d=r(18955),u=r(59847),m=r(86651),f=r(94684),h=r(34681),x=r(5379),p=r(59427),g=r(37494);function b(){let{theme:e,setTheme:t}=(0,x.D)(),[r,a]=(0,s.useState)(!1);if((0,s.useEffect)(()=>{a(!0)},[]),!r)return(0,n.jsx)("div",{"data-testid":"theme-toggle-placeholder",className:"w-8 h-8","aria-hidden":"true"});let o="dark"===e;return(0,n.jsx)("button",{"data-testid":"theme-toggle",onClick:()=>t(o?"light":"dark"),className:"p-1.5 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted transition-colors focus:outline-none focus:ring-2 focus:ring-ring","aria-label":o?"Switch to light mode":"Switch to dark mode",title:o?"Switch to light mode":"Switch to dark mode",children:o?(0,n.jsx)(p.A,{className:"w-5 h-5","data-testid":"theme-icon-sun"}):(0,n.jsx)(g.A,{className:"w-5 h-5","data-testid":"theme-icon-moon"})})}var v=r(63365);function y(){let{status:e}=(0,v.xM)(),t=(0,d.c)("common");if("connected"===e)return null;let r="connecting"===e,s=t(r?"connection.reconnecting":"connection.offline");return(0,n.jsxs)("span",{"data-testid":"connection-status-indicator",role:"status","aria-live":"polite",title:t(r?"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,n.jsx)("span",{"aria-hidden":"true",className:["w-1.5 h-1.5 rounded-full",r?"bg-warning motion-safe:animate-pulse":"bg-muted-foreground"].join(" ")}),s]})}var j=r(79651),w=r(92614);let k=[{labelKey:"nav.home",href:"/",isActive:e=>"/"===e},{labelKey:"nav.chat",href:"/chat",isActive:e=>e.startsWith("/chat")},{labelKey:"nav.sessions",href:"/sessions",isActive:e=>e.startsWith("/sessions")},{labelKey:"nav.repositoriesShort",href:"/repositories",isActive:e=>e.startsWith("/repositories")},{labelKey:"nav.reviewReport",href:"/review",isActive:e=>e.startsWith("/review")},{labelKey:"nav.more",href:"/more",isActive:e=>e.startsWith("/more")}];function N(e){let{title:t="CommandMate"}=e,r=(0,a.usePathname)(),o=(0,d.c)("commandPalette"),i=(0,d.c)("common"),{setOpen:l}=(0,w.C)(),[x,p]=s.useState(null);return s.useEffect(()=>{p("undefined"!=typeof navigator&&/Mac|iPhone|iPad|iPod/i.test(navigator.platform||"")?"⌘":"Ctrl")},[]),(0,n.jsx)("header",{className:"sticky top-0 z-50 border-b border-border bg-background supports-[backdrop-filter]:bg-background/80 backdrop-blur-md",children:(0,n.jsx)("div",{className:"container-custom",children:(0,n.jsxs)("div",{className:"flex items-center justify-between h-16",children:[(0,n.jsx)("div",{className:"flex items-center space-x-4",children:(0,n.jsxs)(c,{href:"/",className:"flex items-center space-x-2 hover:opacity-80 transition-opacity",children:[(0,n.jsx)("div",{className:"w-8 h-8 bg-accent-600 rounded-lg flex items-center justify-center",children:(0,n.jsx)(u.A,{size:20,strokeWidth:2,className:"text-white","aria-hidden":"true"})}),(0,n.jsx)("h1",{className:"text-xl font-bold text-foreground",children:t})]})}),(0,n.jsxs)("nav",{className:"flex items-center space-x-6",role:"navigation",children:[k.map(e=>{let t=e.isActive(r);return(0,n.jsx)(c,{href:e.href,"aria-current":t?"page":void 0,className:"relative py-1 text-sm font-medium transition-colors after:absolute after:inset-x-0 after:bottom-0 after:h-0.5 after:rounded-full after:bg-accent-600 dark:after:bg-accent-400 after:origin-center motion-safe:after:transition-transform after:duration-200 after:ease-[var(--motion-ease-out)] ".concat(t?"text-accent-600 dark:text-accent-400 after:scale-x-100":"text-muted-foreground hover:text-foreground after:scale-x-0"),children:i(e.labelKey)},e.href)}),(0,n.jsxs)("button",{type:"button","data-testid":"header-command-palette-trigger",onClick:()=>l(!0),"aria-label":o("mobileTrigger"),className:"hidden md:inline-flex items-center gap-2 rounded-md border border-border bg-surface px-2.5 py-1.5 text-sm text-muted-foreground hover:bg-surface-2 transition-colors",children:[(0,n.jsx)(m.A,{size:16,strokeWidth:2,"aria-hidden":"true",className:"shrink-0"}),(0,n.jsx)("span",{children:o("searchAction")}),x&&(0,n.jsxs)("span",{className:"flex items-center gap-0.5",children:[(0,n.jsx)(j.u,{children:x}),(0,n.jsx)(j.u,{children:"K"})]})]}),(0,n.jsx)(y,{}),(0,n.jsx)(h.g,{}),(0,n.jsx)(b,{}),(0,n.jsxs)("a",{href:"https://github.com/kewton/MyCodeBranchDesk",target:"_blank",rel:"noopener noreferrer",className:"text-sm font-medium text-muted-foreground hover:text-foreground transition-colors flex items-center space-x-1",children:[(0,n.jsx)(f.A,{size:20,strokeWidth:2,"aria-hidden":"true"}),(0,n.jsx)("span",{children:"GitHub"})]})]})]})})})}var C=r(32916),S=r(38218);let A={showSidebar:!0,showGlobalNav:!0,showLocalNav:!1,autoCollapseSidebar:!1},M=[{prefix:"/worktrees/",config:{showGlobalNav:!1,showLocalNav:!0}},{prefix:"/sessions",config:{autoCollapseSidebar:!0}}];var E=r(22592),L=r(85710),R=r(17787),z=r(49027),T=r(27587),B=r(39649),D=r(47650),W=r(55142),P=r(48481);let K=(0,s.memo)(function(e){let{status:t,label:r}=e;return(0,n.jsx)(P.m,{"data-testid":"status-indicator",status:t,label:r,size:"lg"})});function I(e,t,r){let n=r-8-t;return n<=8?8:Math.min(Math.max(e,8),n)}function O(e){let{id:t,branch:r,isVisible:a,anchorRef:o}=e,[i,l]=(0,s.useState)({top:-9999,left:-9999}),c=(0,s.useRef)(null);if((0,s.useEffect)(()=>{var e,t,r;if(!a||!o.current)return;let n=o.current.getBoundingClientRect(),s=null==(e=c.current)?void 0:e.getBoundingClientRect(),i=null!=(t=null==s?void 0:s.width)?t:0,d=null!=(r=null==s?void 0:s.height)?r:0,u=window.innerWidth,m=window.innerHeight,f=n.right+8;if(f+i>u-8){let e=n.left-8-i;e>=8&&(f=e)}l({top:I(n.top,d,m),left:I(f,i,u)})},[a,o]),"undefined"==typeof document||!a)return null;let d=Math.min(384,Math.max(0,window.innerWidth-16));return D.createPortal((0,n.jsxs)("div",{ref:c,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:i.top,left:i.left,maxWidth:d},children:[(0,n.jsx)("p",{className:"font-medium text-sidebar-foreground whitespace-nowrap",children:r.name}),(0,n.jsx)("p",{className:"text-sidebar-muted whitespace-nowrap",children:r.repositoryName}),(0,n.jsxs)("p",{className:"text-sidebar-muted whitespace-nowrap",children:["Status: ",r.status]}),r.worktreePath&&(0,n.jsx)("p",{className:"text-sidebar-muted truncate",children:r.worktreePath}),r.description&&(0,n.jsx)("p",{className:"text-sidebar-muted mt-1 border-t border-sidebar-border pt-1 whitespace-pre-wrap break-words",children:r.description})]}),document.body)}let _=0,F=(0,s.memo)(function(e){let{branch:t,isSelected:r,onClick:a,showRepositoryName:o=!0}=e,i=(0,d.c)("common"),l="tooltip-".concat(t.id),c=(0,s.useRef)(null),[u,m]=(0,s.useState)(!1),f=(0,s.useRef)(null),h=(0,s.useCallback)(()=>{null!==f.current&&(clearTimeout(f.current),f.current=null)},[]);(0,s.useEffect)(()=>()=>h(),[h]);let x=u&&!r;return(0,s.useEffect)(()=>{r&&m(!1)},[r]),(0,s.useEffect)(()=>{if(!u)return;let e=()=>m(!1);return document.addEventListener("click",e),()=>document.removeEventListener("click",e)},[u]),(0,n.jsxs)("button",{ref:c,"data-testid":"branch-list-item",onClick:()=>{h(),_=Date.now()+400,m(!1),a()},onMouseEnter:()=>{h(),Date.now()>=_&&(f.current=setTimeout(()=>{m(!0)},150))},onMouseLeave:()=>{h(),m(!1)},onFocus:e=>{h(),e.target.matches(":focus-visible")&&(f.current=setTimeout(()=>{m(!0)},150))},onBlur:()=>{h(),m(!1)},"aria-current":r?"true":void 0,"aria-describedby":x?l:void 0,"aria-label":o?void 0:"".concat(t.name," - ").concat(t.repositoryName),className:"\n group relative w-full px-4 py-3 flex flex-col gap-1\n hover:bg-sidebar-hover transition-colors\n focus:outline-none focus:ring-2 focus:ring-inset focus:ring-ring\n ".concat(r?"bg-sidebar-hover border-l-2 border-accent-500":"border-l-2 border-transparent","\n "),children:[(0,n.jsxs)("div",{className:"flex items-center gap-3 w-full",children:[t.cliStatus&&Object.keys(t.cliStatus).length>0&&(0,n.jsx)("div",{className:"flex items-center justify-center flex-shrink-0 w-4","aria-label":i("branchItem.cliToolStatus"),children:(0,n.jsx)(K,{status:(0,W.A7)(t.cliStatus),label:(0,W.dw)(t.cliStatus,t.cliStatusLabels)})}),(0,n.jsxs)("div",{className:"flex-1 min-w-0 text-left",children:[(0,n.jsx)("p",{className:"text-sm font-medium text-sidebar-foreground truncate",children:t.name}),o&&(0,n.jsx)("p",{className:"text-xs text-sidebar-muted truncate",children:t.repositoryName})]}),t.hasUnread&&(0,n.jsx)("span",{"data-testid":"unread-indicator",className:"w-2 h-2 rounded-full bg-accent-500 flex-shrink-0","aria-label":i("branchItem.hasUnread")})]}),t.description&&(0,n.jsx)("div",{"data-testid":"branch-description",className:"pl-6 pr-2 mt-1 text-left",children:(0,n.jsx)("p",{className:"text-xs text-sidebar-muted line-clamp-2",children:t.description})}),(0,n.jsx)(O,{id:l,branch:t,isVisible:x,anchorRef:c})]})});var V=r(41898);function H(e,t,r){if(t<=0||r<=0)return 0;let n=e+t+8-r;return n>0?-Math.min(n,Math.max(0,e-8)):e<8?8-e:0}let G=(0,s.memo)(function(e){var t;let{sortKey:r,sortDirection:a,onSortKeyChange:o,onSortDirectionChange:i,options:l,defaultDirections:c,compact:u,tooltip:m,iconClassName:f="w-3 h-3"}=e,h=(0,d.c)("common"),[x,p]=(0,s.useState)(!1),g=(0,s.useRef)(null),b=(0,s.useRef)(null),v=(0,s.useRef)({x:0,y:0}),[y,j]=(0,s.useState)({x:0,y:0});(0,s.useEffect)(()=>{function e(e){g.current&&!g.current.contains(e.target)&&p(!1)}if(x)return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[x]),(0,s.useEffect)(()=>{function e(e){"Escape"===e.key&&p(!1)}if(x)return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[x]),(0,s.useLayoutEffect)(()=>{let e=e=>{v.current=e,j(t=>t.x===e.x&&t.y===e.y?t:e)};if(!x)return void e({x:0,y:0});let t=b.current;if(!t)return;let r=t.getBoundingClientRect();e({x:H(r.left-v.current.x,r.width,window.innerWidth),y:H(r.top-v.current.y,r.height,window.innerHeight)})},[x]);let w=(0,s.useCallback)(()=>{p(e=>!e)},[]),k=(0,s.useCallback)(e=>{if(e===r)i("asc"===a?"desc":"asc");else{var t;o(e),i(null!=(t=null==c?void 0:c[e])?t:"asc")}p(!1)},[r,a,o,i,c]),N=(0,s.useCallback)(()=>{i("asc"===a?"desc":"asc")},[a,i]),C=(null==(t=l.find(e=>e.key===r))?void 0:t.label)||"Sort",S=(0,n.jsxs)("button",{type:"button",onClick:w,"aria-expanded":x,"aria-haspopup":"listbox","aria-label":"Sort by ".concat(C),className:" flex items-center gap-1 px-2 py-1 rounded text-xs text-sidebar-muted hover:text-sidebar-foreground hover:bg-sidebar-hover focus:outline-none focus:ring-2 focus:ring-ring transition-colors ",children:[(0,n.jsx)(J,{className:f}),(0,n.jsx)("span",{className:u?"hidden":"hidden sm:inline",children:C})]});return(0,n.jsxs)("div",{ref:g,className:"relative","data-testid":"sort-selector-base",children:[(0,n.jsxs)("div",{className:"flex items-center gap-1",children:[m?(0,n.jsx)(V.m_,{content:m,placement:"bottom",children:S}):S,(0,n.jsx)("button",{type:"button",onClick:N,"aria-label":"asc"===a?"Sort ascending":"Sort descending",className:" p-1 rounded text-sidebar-muted hover:text-sidebar-foreground hover:bg-sidebar-hover focus:outline-none focus:ring-2 focus:ring-ring transition-colors ",children:"asc"===a?(0,n.jsx)(X,{className:f}):(0,n.jsx)(U,{className:f})})]}),x&&(0,n.jsx)("div",{ref:b,role:"listbox","aria-label":h("sort.options"),className:" absolute right-0 top-full mt-1 z-50 min-w-[140px] py-1 rounded-md shadow-lg bg-sidebar border border-sidebar-border ",style:0!==y.x||0!==y.y?{transform:"translate(".concat(y.x,"px, ").concat(y.y,"px)")}:void 0,children:l.map(e=>(0,n.jsxs)("button",{type:"button",role:"option","aria-selected":r===e.key,onClick:()=>k(e.key),className:"\n w-full px-3 py-2 text-left text-sm\n flex items-center justify-between\n hover:bg-sidebar-hover transition-colors\n ".concat(r===e.key?"text-accent-700 dark:text-accent-400":"text-sidebar-muted","\n "),children:[(0,n.jsx)("span",{children:e.label}),r===e.key&&(0,n.jsx)("span",{className:"text-xs",children:"asc"===a?"ASC":"DESC"})]},e.key))})]})});function J(e){let{className:t}=e;return(0,n.jsx)("svg",{className:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 4h13M3 8h9m-9 4h6m4 0l4-4m0 0l4 4m-4-4v12"})})}function X(e){let{className:t}=e;return(0,n.jsx)("svg",{className:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 15l7-7 7 7"})})}function U(e){let{className:t}=e;return(0,n.jsx)("svg",{className:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})}let q=[{key:"updatedAt",labelKey:"sort.updatedAt"},{key:"repositoryName",labelKey:"sort.repositoryName"},{key:"branchName",labelKey:"sort.branchName"},{key:"status",labelKey:"sort.status"}],Y={updatedAt:"desc"},Z=(0,s.memo)(function(){let{sortKey:e,sortDirection:t,setSortKey:r,setSortDirection:a}=(0,C.VF)(),o=(0,d.c)("common"),i=(0,s.useMemo)(()=>q.map(e=>{let{key:t,labelKey:r}=e;return{key:t,label:o(r)}}),[o]);return(0,n.jsx)(G,{sortKey:e,sortDirection:t,onSortKeyChange:r,onSortDirectionChange:a,options:i,defaultDirections:Y,compact:!0,tooltip:o("tooltips.sort"),iconClassName:"w-4 h-4"})});var $=r(744),Q=r(30061),ee=r(36809);let et=["en","ja"],er={en:"English",ja:"日本語"};function en(){return{currentLocale:(0,ee.Ym)(),switchLocale:e=>{if(et.includes(e)){let t="https:"===window.location.protocol;document.cookie="".concat("locale","=").concat(e,";path=/;max-age=").concat(31536e3,";SameSite=Lax").concat(t?";Secure":""),localStorage.setItem("locale",e),window.location.reload()}}}}function es(){let{currentLocale:e,switchLocale:t}=en(),r=(0,d.c)("common");return(0,n.jsx)("select",{value:e,onChange:e=>t(e.target.value),"data-testid":"locale-switcher","aria-label":r("language"),className:" w-full px-3 py-2 rounded-md bg-sidebar text-sidebar-foreground border border-sidebar-border focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent text-sm ",children:et.map(e=>(0,n.jsx)("option",{value:e,children:er[e]},e))})}var ea=r(65380);function eo(){let e=(0,d.c)("auth"),t=(0,ea.H)(),[r,a]=(0,s.useState)(!1);if(!t)return null;async function o(){a(!0);try{await fetch("/api/auth/logout",{method:"POST"}),window.location.href="/login"}catch(e){window.location.href="/login"}}return(0,n.jsx)("button",{type:"button",onClick:o,disabled:r,"data-testid":"logout-button",className:" w-full px-3 py-2 text-sm text-left rounded-md text-muted-foreground hover:text-foreground hover:bg-muted focus:outline-none focus:ring-2 focus:ring-ring disabled:opacity-50 transition-colors ",children:r?"...":e("logout.button")})}var ei=r(94442),el=r(80344),ec=r(7636);let ed="mcbd-sidebar-group-collapsed",eu="mcbd-sidebar-scroll-top",em="mcbd-sidebar-group-order-cache",ef="w-4 h-4",eh=0;function ex(){try{let e=localStorage.getItem(em);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 ep(e){try{localStorage.setItem(em,JSON.stringify(e))}catch(e){}}let eg=(0,s.memo)(function(){var e,t;let r=(0,l.Hq)(),{worktrees:a,repositories:o,selectedWorktreeId:c,selectWorktree:u,refreshWorktrees:m}=(0,B.$f)(),{closeMobileDrawer:f,sortKey:h,sortDirection:x,viewMode:p,setViewMode:g}=(0,C.VF)(),v=(0,d.c)("common"),[y,j]=(0,s.useState)(""),w=(0,s.useRef)(null),[k,N]=(0,s.useState)(()=>{try{let e=localStorage.getItem(ed);return e?function(e){try{let t=JSON.parse(e);if("object"!=typeof t||null===t||Array.isArray(t))return{};let r={},n=0;for(let[e,s]of Object.entries(t))if(!ev.has(e)&&"boolean"==typeof s){if(++n>100)break;r[e]=s}return r}catch(e){return{}}}(e):{}}catch(e){return{}}}),[S,A]=(0,s.useState)(ex),M=(0,s.useRef)(!1);(0,s.useEffect)(()=>{M.current||(M.current=!0,fetch("/api/sidebar/group-order").then(e=>e.json()).then(e=>{e.success&&Array.isArray(e.order)&&(A(e.order),ep(e.order))}).catch(()=>{}))},[]);let E=(0,s.useMemo)(()=>(0,ec.UZ)(o),[o]),T=(0,s.useMemo)(()=>(0,ec.s6)(a,E),[a,E]),D=(0,s.useMemo)(()=>T.map(W.XK),[T]),P=(0,s.useDeferredValue)(D),K=(0,s.useRef)(null),I=(0,s.useRef)(null);(0,s.useEffect)(()=>()=>{null!==I.current&&clearTimeout(I.current)},[]);let O=(0,s.useMemo)(()=>{let e=K.current;return!e||Date.now()>=e.expiresAt?P:e.items},[P]),_=(0,s.useRef)(O);(0,s.useLayoutEffect)(()=>{_.current=O});let H=(0,s.useCallback)(()=>{null!==I.current&&(clearTimeout(I.current),I.current=null);let e=K.current;if(e&&Date.now()<e.expiresAt){K.current={...e,expiresAt:1/0};return}K.current={items:_.current,expiresAt:1/0}},[]),G=(0,s.useCallback)(()=>{K.current&&(K.current={...K.current,expiresAt:Date.now()+1e3},null!==I.current&&clearTimeout(I.current),I.current=setTimeout(()=>{K.current=null},1e3))},[]),{sortedItems:J,groupedItems:X}=function(e){let{items:t,sortKey:r,sortDirection:n,viewMode:a,filterText:o}=e,i=(0,s.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,s.useMemo)(()=>(0,ec.Xn)(i,r,n),[i,r,n]),groupedItems:(0,s.useMemo)(()=>"grouped"===a?(0,ec._s)(i,r,n):[],[i,r,n,a])}}({items:O,sortKey:h,sortDirection:x,viewMode:p,filterText:y}),U=(0,s.useMemo)(()=>{if("grouped"!==p||!X)return null;if(y.trim()||0===S.length)return X;let e=new Map(S.map((e,t)=>[e,t]));return[...X].sort((t,r)=>{let n=e.has(t.repositoryName)?e.get(t.repositoryName):1/0,s=e.has(r.repositoryName)?e.get(r.repositoryName):1/0;return n===s?t.repositoryName.localeCompare(r.repositoryName):n-s})},[p,X,S,y]),q="grouped"===p?U:null;(0,s.useEffect)(()=>{try{localStorage.setItem(ed,JSON.stringify(k))}catch(e){}},[k]);let Y=(0,s.useCallback)(e=>{N(t=>({...t,[e]:!t[e]}))},[]),Q=(0,s.useCallback)(()=>{var e,t,r=null!=(t=null==(e=w.current)?void 0:e.scrollTop)?t:0;let n=Number.isFinite(r)&&r>0?r:0;eh=n;try{localStorage.setItem(eu,String(n))}catch(e){}},[]),ee=J.length>0||(null!=(e=null==q?void 0:q.length)?e:0)>0;(0,s.useEffect)(()=>{let e=w.current;if(!e)return;let t=window.requestAnimationFrame(()=>{e.scrollTop=function(){try{let e=localStorage.getItem(eu);if(!e)return eh=0,0;let t=Number(e);Number.isFinite(t)&&t>=0&&(eh=t)}catch(e){}return eh}()});return()=>{window.cancelAnimationFrame(t)}},[ee,p]);let et=(0,s.useCallback)(e=>{Q(),u(e),r.push("/worktrees/".concat(e)),f()},[Q,u,r,f]),er=(0,R.FR)((0,R.MS)(R.AN,{activationConstraint:{distance:8}})),en=(0,s.useCallback)(e=>{let{active:t,over:r}=e;if(!r||t.id===r.id||!q)return;let n=q.map(e=>e.repositoryName),s=n.indexOf(String(t.id)),a=n.indexOf(String(r.id));if(-1===s||-1===a)return;let o=(0,z.be)(n,s,a);A(o),ep(o),fetch("/api/sidebar/group-order",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({order:o})}).catch(()=>{A(n),ep(n)})},[q]),ea="flat"===p?0===J.length:(null!=(t=null==q?void 0:q.length)?t:0)===0;return(0,n.jsxs)("nav",{"data-testid":"sidebar","aria-label":v("sidebar.branchNavigation"),className:"h-full flex flex-col bg-sidebar text-sidebar-foreground",role:"navigation",children:[(0,n.jsx)("div",{"data-testid":"sidebar-header",className:"flex-shrink-0 px-4 py-4 border-b border-sidebar-border",children:(0,n.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-y-2",children:[(0,n.jsx)("h2",{className:"min-w-0 truncate text-lg font-semibold text-sidebar-foreground",children:v("sidebar.branches")}),(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-1",children:[(0,n.jsx)(ej,{viewMode:p,onToggle:g}),(0,n.jsx)(Z,{}),(0,n.jsx)(eA,{refreshWorktrees:m}),(0,n.jsx)(V.m_,{content:v("tooltips.repositories"),placement:"bottom",children:(0,n.jsx)(i(),{href:"/repositories","aria-label":v("nav.repositories"),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 transition-colors inline-flex items-center",children:(0,n.jsx)(L.A,{className:ef,"aria-hidden":"true"})})})]})]})}),(0,n.jsx)("div",{className:"flex-shrink-0 px-4 py-3 border-b border-sidebar-border",children:(0,n.jsx)($.pd,{type:"text",placeholder:v("sidebar.searchBranches"),value:y,onChange:e=>j(e.target.value),className:"bg-background shadow-none"})}),(0,n.jsx)("div",{ref:w,"data-testid":"branch-list",onScroll:Q,onMouseEnter:H,onMouseLeave:G,className:"flex-1 overflow-y-auto overflow-x-hidden",children:ea?(0,n.jsx)("div",{className:"px-4 py-8 text-center text-sidebar-muted",children:v(y?"sidebar.noBranchesFound":"sidebar.noBranchesAvailable")}):"grouped"===p&&q?(0,n.jsx)(R.Mp,{sensors:er,collisionDetection:R.fp,onDragEnd:en,children:(0,n.jsx)(z.gB,{items:q.map(e=>e.repositoryName),strategy:z._G,children:q.map(e=>{let t=!k[e.repositoryName]||!!y.trim();return(0,n.jsx)(eb,{group:e,isExpanded:t,selectedWorktreeId:c,onToggle:()=>Y(e.repositoryName),onBranchClick:et,isDragDisabled:!!y.trim()},e.repositoryName)})})}):J.map(e=>(0,n.jsx)(F,{branch:e,isSelected:e.id===c,onClick:()=>et(e.id)},e.id))}),(0,n.jsxs)("div",{className:"flex-shrink-0 px-4 py-3 border-t border-sidebar-border space-y-2",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("div",{className:"flex-1",children:(0,n.jsx)(es,{})}),(0,n.jsx)(b,{})]}),(0,n.jsx)(eo,{})]})]})});function eb(e){let{group:t,isExpanded:r,selectedWorktreeId:s,onToggle:a,onBranchClick:o,isDragDisabled:i}=e,{attributes:l,listeners:c,setNodeRef:d,setActivatorNodeRef:u,transform:m,transition:f,isDragging:h}=(0,z.gl)({id:t.repositoryName,disabled:i}),x={transform:T.Ks.Transform.toString(m),transition:f,opacity:h?.5:1};return(0,n.jsxs)("div",{ref:d,style:x,className:"w-full min-w-0",children:[(0,n.jsx)(ey,{repositoryName:t.repositoryName,branchCount:t.branches.length,isExpanded:r,onClick:a,dragHandleRef:u,dragHandleListeners:i?void 0:c,dragHandleAttributes:i?void 0:l}),r&&t.branches.map(e=>(0,n.jsx)(F,{branch:e,isSelected:e.id===s,onClick:()=>o(e.id),showRepositoryName:!1},e.id))]})}let ev=new Set(["__proto__","constructor","prototype"]);function ey(e){let{repositoryName:t,branchCount:r,isExpanded:s,onClick:a,dragHandleRef:o,dragHandleListeners:i,dragHandleAttributes:l}=e,c=(0,d.c)("common");return(0,n.jsxs)("div",{className:"flex items-center w-full",children:[i&&(0,n.jsx)("div",{ref:o,...i,...l,"aria-label":c("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-colors ",children:(0,n.jsx)(eC,{})}),(0,n.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-2 text-xs font-semibold text-sidebar-muted uppercase tracking-wider focus:outline-none focus:ring-2 focus:ring-inset focus:ring-ring transition-colors ",children:[(0,n.jsx)(ew,{isExpanded:s}),(0,n.jsx)(ek,{color:(0,ec.LV)(t)}),(0,n.jsx)(Q.nR,{content:t,className:"flex-1 min-w-0 text-left truncate",children:t}),(0,n.jsx)("span",{className:"text-sidebar-muted font-normal tabular-nums pr-2",children:r})]})]})}function ej(e){let{viewMode:t,onToggle:r}=e,s=(0,d.c)("common");return(0,n.jsx)(V.m_,{content:s("tooltips.viewMode"),placement:"bottom",children:(0,n.jsx)("button",{"data-testid":"view-mode-toggle",type:"button",onClick:()=>{r("grouped"===t?"flat":"grouped")},"aria-label":s("grouped"===t?"sidebar.switchToFlatView":"sidebar.switchToGroupedView"),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 transition-colors ",children:"grouped"===t?(0,n.jsx)(eN,{className:ef}):(0,n.jsx)(ek,{className:ef})})})}function ew(e){let{isExpanded:t}=e;return(0,n.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,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})})}function ek(e){let{className:t="w-3.5 h-3.5",color:r}=e;return(0,n.jsx)("svg",{className:"".concat(t," flex-shrink-0"),viewBox:"0 0 24 24",fill:null!=r?r:"none",stroke:r?"none":"currentColor",strokeWidth:2*!r,"aria-hidden":"true",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"})})}function eN(e){let{className:t="w-3 h-3"}=e;return(0,n.jsx)("svg",{className:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6h16M4 12h16M4 18h16"})})}function eC(){return(0,n.jsxs)("svg",{className:"w-3 h-3",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,n.jsx)("circle",{cx:"9",cy:"5",r:"1.5"}),(0,n.jsx)("circle",{cx:"15",cy:"5",r:"1.5"}),(0,n.jsx)("circle",{cx:"9",cy:"12",r:"1.5"}),(0,n.jsx)("circle",{cx:"15",cy:"12",r:"1.5"}),(0,n.jsx)("circle",{cx:"9",cy:"19",r:"1.5"}),(0,n.jsx)("circle",{cx:"15",cy:"19",r:"1.5"})]})}function eS(e){let{className:t=""}=e;return(0,n.jsx)("svg",{className:"".concat(ef," ").concat(t),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,n.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 eA=(0,s.memo)(function(e){let{refreshWorktrees:t}=e,[r,a]=(0,s.useState)(!1),o=(0,s.useRef)(!1),{showToast:i,toasts:l,removeToast:c}=(0,ei.dj)(),u=(0,d.c)("common"),m=(0,s.useCallback)(async()=>{if(!o.current){o.current=!0,a(!0);try{let e=await el.Rx.sync();await t(),i(u("syncSuccess",{count:e.worktreeCount}),"success",3e3)}catch(e){e instanceof el.hD&&401===e.status?i(u("syncAuthError"),"error",5e3):i(u("syncError"),"error",5e3)}finally{o.current=!1,a(!1)}}},[t,i,u]);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(V.m_,{content:u("tooltips.sync"),placement:"bottom",children:(0,n.jsx)("button",{type:"button",onClick:m,disabled:r,"aria-label":u("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,n.jsx)(eS,{className:r?"animate-spin":""})})}),(0,n.jsx)(ei.N9,{toasts:l,onClose:c})]})});var eM=r(65993),eE=r(37586),eL=r(66685),eR=r(61362),ez=r(37772);let eT=[{labelKey:"nav.home",href:"/",isActive:e=>"/"===e,icon:(0,n.jsx)(eM.A,{size:20,"aria-hidden":"true"})},{labelKey:"nav.chat",href:"/chat",isActive:e=>e.startsWith("/chat"),icon:(0,n.jsx)(eE.A,{size:20,"aria-hidden":"true"})},{labelKey:"nav.sessions",href:"/sessions",isActive:e=>e.startsWith("/sessions"),icon:(0,n.jsx)(eL.A,{size:20,"aria-hidden":"true"})},{labelKey:"nav.review",href:"/review",isActive:e=>e.startsWith("/review"),icon:(0,n.jsx)(eR.A,{size:20,"aria-hidden":"true"})},{labelKey:"nav.more",href:"/more",isActive:e=>e.startsWith("/more"),icon:(0,n.jsx)(ez.A,{size:20,"aria-hidden":"true"})}];function eB(){let e=(0,a.usePathname)(),{setOpen:t}=(0,w.C)(),r=(0,d.c)("commandPalette"),s=(0,d.c)("common");return(0,n.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,n.jsxs)("div",{className:"flex items-center justify-around h-14",children:[eT.map(t=>{let r=t.isActive(e);return(0,n.jsxs)(c,{href:t.href,className:"flex flex-col items-center justify-center flex-1 h-full text-xs transition-colors ".concat(r?"text-accent-600 dark:text-accent-400":"text-muted-foreground hover:text-foreground"),children:[t.icon,(0,n.jsx)("span",{className:"mt-1 whitespace-nowrap",children:s(t.labelKey)})]},t.href)}),(0,n.jsxs)("button",{type:"button","data-testid":"mobile-command-palette-trigger",onClick:()=>t(!0),"aria-label":r("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,n.jsx)(m.A,{size:20,"aria-hidden":"true"}),(0,n.jsx)("span",{className:"mt-1 whitespace-nowrap",children:r("mobileLabel")})]})]})})}var eD=r(79698),eW=r(24533),eP=r(79451),eK=r(89559),eI=r(97470),eO=r(76482),e_=r(39332),eF=r(87531),eV=r(59854),eH=r(70628),eG=r(66966),eJ=r(68704);let eX=[{key:"home",href:"/"},{key:"chat",href:"/chat"},{key:"sessions",href:"/sessions"},{key:"repositories",href:"/repositories"},{key:"review",href:"/review"},{key:"more",href:"/more"}],eU={home:eM.A,chat:eE.A,sessions:eL.A,repositories:eW.A,review:eR.A,more:ez.A},eq="cm.palette.recents";function eY(e){if(!e||"object"!=typeof e)return!1;let{kind:t,id:r}=e;return("nav"===t||"worktree"===t||"action"===t)&&"string"==typeof r}function eZ(e){return e.isWaitingForResponse?"waiting":e.isProcessing?"running":e.isSessionRunning?"ready":"idle"}function e$(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 eQ=(0,eF.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"),e0="shrink-0 text-muted-foreground";function e1(){var e,t,r;let{open:o,setOpen:i}=(0,w.C)(),{setOpen:l}=(0,eH.K)(),c=(0,a.useRouter)(),u=(0,d.c)("commandPalette"),h=(0,d.c)("common"),{theme:b,setTheme:v}=(0,x.D)(),{setSize:y,isMobile:k}=(0,E.Ps)(),{currentLocale:N,switchLocale:C}=en(),S=(0,eG.rC)(),{toasts:A,showToast:M,removeToast:L}=(0,ei.dj)(),[R,z]=(0,s.useState)(!1),[T,B]=(0,s.useState)(""),[W,K]=(0,s.useState)([]),I=(0,s.useRef)(null),O=(0,s.useRef)(null),_=(0,s.useRef)(o);(0,s.useEffect)(()=>{_.current=o},[o]),(0,s.useEffect)(()=>{z(!0)},[]),(0,s.useEffect)(()=>{function e(e){if(("k"===e.key||"K"===e.key)&&(e.metaKey||e.ctrlKey)){if(_.current){e.preventDefault(),e.stopPropagation(),i(!1);return}if(e$(e.target))return;e.preventDefault(),i(!0);return}"Escape"===e.key&&_.current&&(e.preventDefault(),e.stopPropagation(),i(!1))}return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[i]),(0,s.useEffect)(()=>{var e,t,r,n;o?(O.current=null!=(t=document.activeElement)?t:null,null==(e=I.current)||e.focus(),B(""),K(function(){try{let e=localStorage.getItem(eq);if(!e)return[];let t=JSON.parse(e);if(!Array.isArray(t))return[];return t.filter(eY).slice(0,8)}catch(e){return[]}}())):O.current&&(null==(r=(n=O.current).focus)||r.call(n),O.current=null)},[o]);let F=(0,s.useCallback)((e,t)=>{t&&K(e=>(function(e,t){let r=e.filter(e=>e.kind!==t.kind||e.id!==t.id),n=[t,...r].slice(0,8);try{localStorage.setItem(eq,JSON.stringify(n))}catch(e){}return n})(e,t)),i(!1),e()},[i]),V=(0,s.useCallback)(async()=>{try{var e;await el.Rx.sync(),await (null==S||null==(e=S.refresh)?void 0:e.call(S)),M(u("actions.syncSuccess"),"success")}catch(e){M(u("actions.syncError"),"error")}},[S,M,u]),H="dark"===b,G=""===T.trim(),J=null!=(e=null==S?void 0:S.error)?e:null,X=null!=(t=null==S?void 0:S.isLoading)&&t,U=J?[]:null!=(r=null==S?void 0:S.worktrees)?r:[],q=U.length>0,Y=!J&&X&&0===U.length,Z=[...U].sort((e,t)=>{let r=+!!e.isSessionRunning,n=+!!t.isSessionRunning;if(r!==n)return n-r;let s=e.updatedAt?new Date(e.updatedAt).getTime():0;return(t.updatedAt?new Date(t.updatedAt).getTime():0)-s}),$=G?Z.slice(0,8):Z,Q=[{id:"theme",label:H?u("actions.toLight"):u("actions.toDark"),icon:H?p.A:g.A,run:()=>v(H?"light":"dark")},...k?[]:eJ.Uf.map(e=>({id:"displaysize:".concat(e),label:"".concat(u("actions.displaySizePrefix"),": ").concat(h("displaySize.".concat(e))),icon:eP.A,run:()=>y(e)})),{id:"sync",label:u("actions.syncRepositories"),icon:eK.A,run:()=>{V()}},{id:"locale",label:u("actions.switchLanguage"),icon:eI.A,run:()=>C("ja"===N?"en":"ja")},{id:"github",label:u("actions.openGitHub"),icon:f.A,run:()=>window.open("https://github.com/kewton/MyCodeBranchDesk","_blank","noopener,noreferrer")},{id:"keyboardShortcuts",label:u("actions.keyboardShortcuts"),icon:eO.A,run:()=>l(!0)}],ee=G?W.map(e=>{if("nav"===e.kind){let t=eX.find(t=>t.key===e.id);if(!t)return null;let r=eU[t.key],s=h("nav.".concat(t.key));return{id:"nav-".concat(t.key),value:"recent nav ".concat(t.key),node:(0,n.jsxs)(n.Fragment,{children:[r&&(0,n.jsx)(r,{size:16,className:e0,"aria-hidden":"true"}),(0,n.jsx)("span",{className:"truncate",children:s})]}),onSelect:()=>F(()=>c.push(t.href),{kind:"nav",id:t.key})}}if("worktree"===e.kind){let t=U.find(t=>t.id===e.id);if(!t)return null;let r=t.repositoryDisplayName||t.repositoryName||"",s=t.branch||t.name;return{id:"worktree-".concat(t.id),value:"recent worktree ".concat(t.id),node:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(e_.A,{size:16,className:e0,"aria-hidden":"true"}),(0,n.jsx)("span",{className:"truncate",children:s}),r&&(0,n.jsx)("span",{className:"ml-auto truncate pl-2 text-xs text-muted-foreground",children:r}),(0,n.jsx)(P.m,{status:eZ(t),size:"sm",className:r?"ml-2":"ml-auto"})]}),onSelect:()=>F(()=>c.push("/worktrees/".concat(t.id)),{kind:"worktree",id:t.id})}}let t=Q.find(t=>t.id===e.id);if(!t)return null;let r=t.icon;return{id:"action-".concat(t.id),value:"recent action ".concat(t.id),node:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(r,{size:16,className:e0,"aria-hidden":"true"}),(0,n.jsx)("span",{className:"truncate",children:t.label})]}),onSelect:()=>F(t.run,{kind:"action",id:t.id})}}).filter(e=>null!==e):[];return R?(0,D.createPortal)((0,n.jsxs)(n.Fragment,{children:[o&&(0,n.jsxs)("div",{className:"fixed inset-0 overflow-y-auto",style:{zIndex:eV.M.MODAL},"data-testid":"command-palette",children:[(0,n.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:()=>i(!1)}),(0,n.jsx)("div",{className:"relative flex min-h-full items-start justify-center p-4 pt-[15vh]",children:(0,n.jsx)("div",{"data-state":"open","data-testid":"command-palette-panel",className:(0,eF.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,n.jsxs)(eD.uB,{label:u("title"),className:(0,eF.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,n.jsxs)("div",{className:"flex items-center gap-2 border-b border-border px-3",children:[(0,n.jsx)(m.A,{size:16,strokeWidth:2,"aria-hidden":"true",className:"shrink-0 text-muted-foreground"}),(0,n.jsx)(eD.uB.Input,{ref:I,value:T,onValueChange:B,placeholder:u("placeholder"),"data-testid":"command-palette-input",className:"flex-1 bg-transparent py-3 text-sm text-foreground outline-none placeholder:text-muted-foreground"})]}),(0,n.jsxs)(eD.uB.List,{className:"max-h-[min(60vh,360px)] overflow-y-auto p-2",children:[(0,n.jsx)(eD.uB.Empty,{"data-testid":"command-palette-empty",className:"py-6 text-center text-sm text-muted-foreground",children:u("empty")}),Y&&(0,n.jsx)(eD.uB.Loading,{"data-testid":"command-palette-loading",className:"py-6 text-center text-sm text-muted-foreground",children:u("loading")}),ee.length>0&&(0,n.jsx)(eD.uB.Group,{heading:u("groups.recent"),children:ee.map(e=>(0,n.jsx)(eD.uB.Item,{value:e.value,onSelect:e.onSelect,className:eQ,children:e.node},e.id))}),(0,n.jsx)(eD.uB.Group,{heading:u("groups.navigation"),children:eX.map(e=>{let t=h("nav.".concat(e.key)),r=eU[e.key];return(0,n.jsxs)(eD.uB.Item,{value:"nav ".concat(t," ").concat(e.href),onSelect:()=>F(()=>c.push(e.href),{kind:"nav",id:e.key}),className:eQ,children:[r&&(0,n.jsx)(r,{size:16,className:e0,"aria-hidden":"true"}),(0,n.jsx)("span",{className:"truncate",children:t})]},e.key)})}),q&&(0,n.jsx)(eD.uB.Group,{heading:u("groups.worktrees"),children:$.map(e=>{let t=e.repositoryDisplayName||e.repositoryName||"",r=e.branch||e.name;return(0,n.jsxs)(eD.uB.Item,{value:"worktree ".concat(t," ").concat(r," ").concat(e.name," ").concat(e.id),onSelect:()=>F(()=>c.push("/worktrees/".concat(e.id)),{kind:"worktree",id:e.id}),className:eQ,children:[(0,n.jsx)(e_.A,{size:16,className:e0,"aria-hidden":"true"}),(0,n.jsx)("span",{className:"truncate",children:r}),t&&(0,n.jsx)("span",{className:"ml-auto truncate pl-2 text-xs text-muted-foreground",children:t}),(0,n.jsx)(P.m,{status:eZ(e),size:"sm",className:t?"ml-2":"ml-auto"})]},e.id)})}),(0,n.jsx)(eD.uB.Group,{heading:u("groups.actions"),children:Q.map(e=>{let t=e.icon;return(0,n.jsxs)(eD.uB.Item,{value:"action ".concat(e.id," ").concat(e.label),onSelect:()=>F(e.run,{kind:"action",id:e.id}),className:eQ,children:[(0,n.jsx)(t,{size:16,className:e0,"aria-hidden":"true"}),(0,n.jsx)("span",{className:"truncate",children:e.label})]},e.id)})})]}),(0,n.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,n.jsxs)("span",{className:"flex items-center gap-1",children:[(0,n.jsx)(j.u,{children:"↑"}),(0,n.jsx)(j.u,{children:"↓"}),u("footer.navigate")]}),(0,n.jsxs)("span",{className:"flex items-center gap-1",children:[(0,n.jsx)(j.u,{children:"↵"}),u("footer.select")]}),(0,n.jsxs)("span",{className:"flex items-center gap-1",children:[(0,n.jsx)(j.u,{children:"esc"}),u("footer.close")]})]})]})})})]}),(0,n.jsx)(ei.N9,{toasts:A,onClose:L})]}),document.body):null}var e2=r(94465);let e4=["global","terminal","composer"],e5=[{id:"commandPalette",keys:["MOD","K"],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:"sendMessage",keys:["↵"],scope:"composer"},{id:"composerNewline",keys:["Shift","↵"],scope:"composer"}];function e9(){let{open:e,setOpen:t}=(0,eH.K)(),{open:r}=(0,w.C)(),a=(0,d.c)("keyboardShortcuts"),[o,i]=(0,s.useState)(!1);(0,s.useEffect)(()=>i(function(){if("undefined"==typeof navigator)return!1;let e=navigator.platform||navigator.userAgent||"";return/Mac|iPhone|iPad|iPod/.test(e)}()),[]);let l=(0,s.useRef)(e);(0,s.useEffect)(()=>{l.current=e},[e]);let c=(0,s.useRef)(r);(0,s.useEffect)(()=>{c.current=r},[r]),(0,s.useEffect)(()=>{function e(e){"?"!==e.key||e.isComposing||229===e.keyCode||e$(e.target)||c.current||l.current||(e.preventDefault(),t(!0))}return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[t]);let u=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e5;return e4.map(t=>({scope:t,shortcuts:e.filter(e=>e.scope===t)})).filter(e=>e.shortcuts.length>0)}();return(0,n.jsx)(e2.a,{isOpen:e,onClose:()=>t(!1),title:a("title"),size:"md",children:(0,n.jsx)("div",{"data-testid":"keyboard-shortcuts-overlay",className:"space-y-6",children:u.map(e=>{let{scope:t,shortcuts:r}=e;return(0,n.jsxs)("section",{"data-testid":"keyboard-shortcuts-scope-".concat(t),children:[(0,n.jsx)("h4",{className:"mb-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:a("scopes.".concat(t))}),(0,n.jsx)("ul",{className:"divide-y divide-border",children:r.map(e=>(0,n.jsxs)("li",{"data-testid":"keyboard-shortcut-".concat(e.id),className:"flex items-center justify-between gap-4 py-2",children:[(0,n.jsx)("span",{className:"text-sm text-foreground",children:a("shortcuts.".concat(e.id))}),(0,n.jsx)("span",{className:"flex flex-shrink-0 items-center gap-1",children:e.keys.map((e,t)=>(0,n.jsx)(j.u,{children:"MOD"===e?o?"⌘":"Ctrl":e},t))})]},e.id))})]},t)})})})}var e6=r(52056),e3=r(65229),e8=r(52703);function e7(){let e=(0,d.c)("common"),[t,r]=(0,s.useState)(null),[a,o]=(0,s.useState)(null),i=(0,s.useCallback)(e=>{if(e.type!==e8.Oo)return;let{serverVersion:t,clientVersion:n}=e;"string"==typeof t&&"string"==typeof n&&t&&n&&t!==a&&r({serverVersion:t,clientVersion:n})},[a]);(0,v.T3)(i);let l=(0,s.useCallback)(()=>{window.location.reload()},[]),c=(0,s.useCallback)(()=>{r(e=>(e&&o(e.serverVersion),null))},[]);return t?(0,n.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:eV.M.TOAST},children:[(0,n.jsx)(e6.A,{className:"h-5 w-5 shrink-0 mt-0.5","aria-hidden":"true"}),(0,n.jsxs)("div",{className:"flex flex-col gap-0.5 text-sm",children:[(0,n.jsx)("span",{className:"font-semibold",children:e("versionMismatch.title")}),(0,n.jsx)("span",{children:e("versionMismatch.description",{serverVersion:t.serverVersion,clientVersion:t.clientVersion})})]}),(0,n.jsxs)("button",{type:"button","data-testid":"version-mismatch-reload",onClick:l,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,n.jsx)(eK.A,{className:"h-4 w-4","aria-hidden":"true"}),e("versionMismatch.reload")]}),(0,n.jsx)("button",{type:"button","data-testid":"version-mismatch-dismiss",onClick:c,"aria-label":e("versionMismatch.dismiss"),className:"shrink-0 hover:opacity-70 focus:outline-none focus:ring-2 focus:ring-offset-2",children:(0,n.jsx)(e3.A,{className:"h-4 w-4","aria-hidden":"true"})})]}):null}let te="transform transition-transform duration-300 ease-out",tt=(0,s.memo)(function(e){let{children:t}=e,{isOpen:r,isMobileDrawerOpen:o,closeMobileDrawer:i,width:l,setWidth:c}=(0,C.VF)(),d=(0,S.a)(),{showSidebar:u,showGlobalNav:m}=function(){var e=(0,a.usePathname)();for(let t of M)if(e.startsWith(t.prefix))return{...A,...t.config};return{...A}}(),{factor:f}=(0,E.Ps)(),h=Math.round(160*f),x=Math.round(480*f),p=Math.round(Math.min(x,Math.max(h,l*f))),g=(0,s.useRef)(null),b=(0,s.useRef)(null),v=(0,s.useCallback)(e=>{c(Math.round(e/f))},[c,f]);return d?(0,n.jsxs)("div",{"data-testid":"app-shell",className:"h-screen flex flex-col",children:[o&&(0,n.jsx)("div",{"data-testid":"drawer-overlay",className:"fixed inset-0 bg-black/50 z-40",onClick:i,"aria-hidden":"true"}),u&&(0,n.jsx)("aside",{"data-testid":"sidebar-container",className:"\n fixed left-0 top-0 h-full w-72 z-50\n ".concat(te,"\n ").concat(o?"translate-x-0":"-translate-x-full","\n "),role:"complementary",children:(0,n.jsx)(eg,{})}),(0,n.jsx)("main",{className:"flex-1 min-h-0 overflow-hidden ".concat(m?"pb-14":""),role:"main","data-view-transition":"content",children:t}),m&&(0,n.jsx)(eB,{}),(0,n.jsx)(e1,{}),(0,n.jsx)(e9,{}),(0,n.jsx)(e7,{})]}):(0,n.jsxs)("div",{"data-testid":"app-shell",className:"h-screen flex flex-col",children:[m&&(0,n.jsx)(N,{}),(0,n.jsxs)("div",{className:"flex flex-1 min-h-0",children:[u&&(0,n.jsxs)("aside",{ref:g,"data-testid":"sidebar-container",className:"\n fixed left-0\n ".concat(m?"top-16 h-[calc(100vh-4rem)]":"top-0 h-full","\n border-r border-border\n ").concat(te,"\n ").concat(r?"translate-x-0":"-translate-x-full","\n "),style:{width:"".concat(p,"px"),zIndex:eV.M.SIDEBAR},role:"complementary","aria-hidden":!r,children:[(0,n.jsx)(eg,{}),(0,n.jsx)(tr,{currentWidth:p,minWidth:h,maxWidth:x,sidebarRef:g,mainRef:b,onWidthChange:v})]}),(0,n.jsx)("main",{ref:b,className:"flex-1 min-w-0 h-full overflow-hidden transition-[padding] duration-300 ease-out",style:{paddingLeft:u&&r?"".concat(p,"px"):0},role:"main","data-view-transition":"content",children:t})]}),(0,n.jsx)(e1,{}),(0,n.jsx)(e9,{}),(0,n.jsx)(e7,{})]})});function tr(e){let{currentWidth:t,minWidth:r,maxWidth:s,sidebarRef:a,mainRef:o,onWidthChange:i}=e;return(0,n.jsx)("div",{"data-testid":"sidebar-resize-handle","aria-hidden":"true",onMouseDown:e=>{e.preventDefault();let n=e.clientX,l=t;o.current&&(o.current.style.transition="none");let c=e=>{l=Math.max(r,Math.min(s,t+(e.clientX-n))),a.current&&(a.current.style.width="".concat(l,"px")),o.current&&(o.current.style.paddingLeft="".concat(l,"px"))},d=()=>{document.body.style.cursor="",document.body.style.userSelect="",o.current&&(o.current.style.transition=""),document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",d),i(l)};document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",c),document.addEventListener("mouseup",d)},className:"absolute top-0 right-0 w-1 h-full cursor-col-resize hover:bg-accent-500/40 transition-colors"})}},30061:(e,t,r)=>{r.d(t,{nR:()=>o});var n=r(95155),s=r(12115),a=r(47650);function o(e){let{content:t,delay:r=200,className:o,children:i,metadata:l}=e,c=(0,s.useRef)(null),d=(0,s.useRef)(null),u=(0,s.useRef)(null),m=(0,s.useRef)(null),[f,h]=(0,s.useState)(!1),[x,p]=(0,s.useState)({top:-9999,left:-9999}),g=(0,s.useCallback)(()=>{null!==u.current&&(clearTimeout(u.current),u.current=null)},[]),b=(0,s.useCallback)(()=>{let e=c.current;e&&(e.scrollWidth>e.clientWidth||l)&&(g(),u.current=setTimeout(()=>{let t=e.getBoundingClientRect(),r=Math.max(4,window.innerWidth-384-4);m.current={top:t.top,bottom:t.bottom},p({top:t.bottom+4,left:Math.min(t.left,r)}),h(!0),u.current=null},r))},[g,r,l]);(0,s.useLayoutEffect)(()=>{if(!f)return;let e=d.current,t=m.current;if(!e||!t)return;let{height:r}=e.getBoundingClientRect();if(r<=0)return;let n=window.innerHeight;if(t.bottom+4+r+4<=n)return;let s=t.top-4-r,a=s>=4?s:Math.max(4,n-r-4);p(e=>e.top===a?e:{...e,top:a})},[f]);let v=(0,s.useCallback)(()=>{g(),h(!1)},[g]);return(0,s.useEffect)(()=>()=>g(),[g]),(0,n.jsxs)("span",{ref:c,className:o,onMouseEnter:b,onMouseLeave:v,children:[null!=i?i:t,f&&"undefined"!=typeof document&&(0,a.createPortal)((0,n.jsxs)("span",{ref:d,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:x.top,left:x.left},children:[(0,n.jsx)("span",{className:"block break-all",children:t}),l&&(0,n.jsx)("span",{className:"mt-0.5 block whitespace-pre-line font-normal text-background/70",children:l})]}),document.body)]})}},34681:(e,t,r)=>{r.d(t,{g:()=>i});var n=r(95155);r(12115);var s=r(18955),a=r(22592),o=r(68704);function i(){let{size:e,setSize:t,isMobile:r}=(0,a.Ps)(),i=(0,s.c)("common");if(r)return null;let l=i("displaySize.ariaLabel");return(0,n.jsxs)("div",{className:"flex items-center",children:[(0,n.jsx)("label",{htmlFor:"pc-display-size",className:"sr-only",children:l}),(0,n.jsx)("select",{id:"pc-display-size","data-testid":"pc-display-size-select","aria-label":l,value:e,onChange:e=>{let r=e.target.value;(0,o.fM)(r)&&t(r)},className:"text-sm bg-transparent text-foreground border border-input rounded-md px-2 py-1 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:o.Uf.map(e=>(0,n.jsx)("option",{value:e,children:i("displaySize.".concat(e))},e))})]})}},41898:(e,t,r)=>{r.d(t,{m_:()=>l});var n=r(95155),s=r(12115),a=r(47650);function o(e,t,r){return Math.min(Math.max(e,4),Math.max(4,r-t-4))}let i={top:-9999,left:-9999};function l(e){let{content:t,placement:r="right",delay:l=100,children:c}=e,[d,u]=(0,s.useState)(!1),[m,f]=(0,s.useState)(null),h=(0,s.useRef)(null),x=(0,s.useRef)(null),p=(0,s.useRef)(null),g=(0,s.useCallback)(()=>{null!==p.current&&(clearTimeout(p.current),p.current=null)},[]),b=(0,s.useCallback)(()=>{g(),p.current=setTimeout(()=>{u(!0),p.current=null},l)},[l,g]),v=(0,s.useCallback)(()=>{g(),u(!1),f(null)},[g]),y=(0,s.useCallback)(()=>{let e=h.current,t=x.current;if(!e||!t)return;let n=e.getBoundingClientRect(),s=t.getBoundingClientRect();f(function(e,t,r,n){let s,a,i=t.left+t.width/2-r.width/2,l=t.top+t.height/2-r.height/2;switch(e){case"top":s=t.top-r.height-8,a=i;break;case"bottom":s=t.top+t.height+8,a=i;break;case"left":s=l,a=t.left-r.width-8;break;default:s=l,a=t.left+t.width+8}return{top:o(s,r.height,n.height),left:o(a,r.width,n.width)}}(r,{top:n.top,left:n.left,width:n.width,height:n.height},{width:s.width,height:s.height},{width:window.innerWidth,height:window.innerHeight}))},[r]);return(0,s.useLayoutEffect)(()=>{if(d)return y(),window.addEventListener("resize",y),window.addEventListener("scroll",y,!0),()=>{window.removeEventListener("resize",y),window.removeEventListener("scroll",y,!0)}},[d,y]),(0,s.useEffect)(()=>()=>{g()},[g]),(0,n.jsxs)("span",{ref:h,"data-testid":"tooltip-wrapper",className:"relative inline-flex",tabIndex:-1,onMouseEnter:b,onMouseLeave:v,children:[c,d&&"undefined"!=typeof document&&(0,a.createPortal)((0,n.jsx)("span",{ref:x,role:"tooltip","aria-hidden":"true","data-placement":r,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!=m?m:i,children:t}),document.body)]})}},54014:(e,t,r)=>{r.d(t,{Ab:()=>s,NL:()=>p,O6:()=>f,XH:()=>n,f_:()=>u,hR:()=>c,lu:()=>h,n6:()=>i,oo:()=>d,pQ:()=>a,sw:()=>m,vz:()=>x});let n=["claude","codex","gemini","vibe-local","opencode","copilot","antigravity"],s=10,a=50,o=/^[a-zA-Z0-9_-]+$/;function i(e){return"string"==typeof e&&e.length>0&&e.length<=64&&o.test(e)}let l={claude:"Claude",codex:"Codex",gemini:"Gemini","vibe-local":"Vibe Local",opencode:"OpenCode",copilot:"Copilot",antigravity:"Antigravity"};function c(e){return n.includes(e)}function d(e){var t;return null!=(t=l[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 f(e,t,r){let n=e.find(e=>e.id===t);return n?m(n):d(r)}function h(e){return e.map((e,t)=>({id:e,cliTool:e,alias:d(e),order:t}))}let x=128,p=2097152},55142:(e,t,r)=>{r.d(t,{A7:()=>o,XK:()=>l,dw:()=>i,kA:()=>a});var n=r(54014),s=r(63001);function a(e){return e?e.isWaitingForResponse?"waiting":e.isProcessing?"running":e.isRunning?"ready":"idle":"idle"}function o(e){if(!e)return"idle";let t=Object.values(e).filter(e=>void 0!==e);return 0===t.length?"idle":t.includes("waiting")?"waiting":t.includes("running")?"running":t.includes("generating")?"generating":t.includes("ready")?"ready":"idle"}function i(e,t){return e?Object.entries(e).map(e=>{var r;let[s,a]=e;return"".concat(null!=(r=null==t?void 0:t[s])?r:(0,n.f_)(s,s),": ").concat(null!=a?a:"idle")}).join(", "):""}function l(e){var t,r,o,i;let l=a(void 0!==e.isSessionRunning?{isRunning:null!=(t=e.isSessionRunning)&&t,isWaitingForResponse:null!=(r=e.isWaitingForResponse)&&r,isProcessing:null!=(o=e.isProcessing)&&o}:void 0),c=!!e.lastAssistantMessageAt&&(!e.lastViewedAt||new Date(e.lastAssistantMessageAt)>new Date(e.lastViewedAt)),{cliStatus:d,cliStatusLabels:u}=function(e){var t,r,o;let i={},l={},c=e.sessionStatusByInstance;if(!c){for(let o of null!=(t=e.selectedAgents)?t:s.fJ)i[o]=a(null==(r=e.sessionStatusByCli)?void 0:r[o]),l[o]=(0,n.oo)(o);return{cliStatus:i,cliStatusLabels:l}}let d=e.agentInstances&&e.agentInstances.length>0?e.agentInstances:(0,n.lu)(null!=(o=e.selectedAgents)?o:s.fJ),u=new Set;for(let e of d)u.add(e.id),i[e.id]=a(c[e.id]),l[e.id]=(0,n.sw)(e);for(let[e,t]of Object.entries(c)){if(u.has(e))continue;let r=a(t);"idle"!==r&&(i[e]=r,l[e]=function(e){let t=n.XH.find(t=>e.startsWith("".concat(t,"-")));if(t){let r=e.slice(t.length+1);return"".concat((0,n.oo)(t)," ").concat(r)}return(0,n.f_)(e,e)}(e))}return{cliStatus:i,cliStatusLabels:l}}(e);return{id:e.id,name:e.name,repositoryName:null!=(i=e.repositoryDisplayName)?i:e.repositoryName,status:l,hasUnread:c,lastActivity:e.updatedAt,description:e.description,cliStatus:d,cliStatusLabels:u,worktreePath:e.path}}},63001:(e,t,r)=>{r.d(t,{fJ:()=>n}),r(54014);let n=["claude","codex","gemini","opencode","copilot","antigravity"]},94442:(e,t,r)=>{r.d(t,{N9:()=>p,dj:()=>g});var n=r(95155),s=r(12115),a=r(18955),o=r(42529),i=r(78874),l=r(52056),c=r(23327),d=r(65229),u=r(59854),m=r(9900),f=r(9286);function h(e){let{type:t,iconColor:r}=e,s="h-5 w-5 ".concat(r);switch(t){case"success":return(0,n.jsx)(o.A,{className:s,"data-testid":"toast-icon-success"});case"error":return(0,n.jsx)(i.A,{className:s,"data-testid":"toast-icon-error"});case"warning":return(0,n.jsx)(l.A,{className:s,"data-testid":"toast-icon-warning"});default:return(0,n.jsx)(c.A,{className:s,"data-testid":"toast-icon-info"})}}function x(e){let{id:t,message:r,type:o,onClose:i,duration:l=3e3}=e,c=(0,a.c)("common"),u=(0,s.useRef)(null),x=function(e){switch(e){case"success":return{bgColor:"bg-success-subtle",borderColor:"border-success-border",textColor:"text-success-foreground",iconColor:"text-success-foreground"};case"error":return{bgColor:"bg-danger-subtle",borderColor:"border-danger-border",textColor:"text-danger-foreground",iconColor:"text-danger-foreground"};case"warning":return{bgColor:"bg-warning-subtle",borderColor:"border-warning-border",textColor:"text-warning-foreground",iconColor:"text-warning-foreground"};default:return{bgColor:"bg-info-subtle",borderColor:"border-info-border",textColor:"text-info-foreground",iconColor:"text-info-foreground"}}}(o),[p,g]=(0,s.useState)(!0),{shouldRender:b,isExiting:v}=(0,f.O)(p,m.Ys),y=(0,s.useRef)(i);y.current=i,(0,s.useEffect)(()=>{b||y.current(t)},[b,t]),(0,s.useEffect)(()=>(l>0&&(u.current=setTimeout(()=>{g(!1)},l)),()=>{u.current&&clearTimeout(u.current)}),[l]);let j=(0,s.useCallback)(()=>{u.current&&clearTimeout(u.current),g(!1)},[]);return(0,n.jsxs)("div",{"data-testid":"toast-".concat(t),role:"alert",className:"\n ".concat(x.bgColor,"\n ").concat(x.borderColor,"\n ").concat(x.textColor,"\n border rounded-lg shadow-lg p-4 min-w-[300px] max-w-[400px]\n flex items-start gap-3\n ").concat(v?"animate-out fade-out-0 slide-out-to-right-full duration-200 fill-mode-forwards pointer-events-none":"animate-slide-in","\n "),children:[(0,n.jsx)(h,{type:o,iconColor:x.iconColor}),(0,n.jsx)("p",{className:"flex-1 text-sm font-medium",children:r}),(0,n.jsx)("button",{"data-testid":"toast-close-button",onClick:j,"aria-label":c("closeNotification"),className:"\n ".concat(x.textColor,"\n hover:opacity-70\n focus:outline-none focus:ring-2 focus:ring-offset-2\n transition-opacity\n "),children:(0,n.jsx)(d.A,{className:"h-4 w-4"})})]})}function p(e){let{toasts:t,onClose:r}=e;return(0,n.jsx)("div",{"data-testid":"toast-container","aria-live":"polite",className:"fixed bottom-4 right-4 flex flex-col gap-2",style:{zIndex:u.M.TOAST},children:t.map(e=>(0,n.jsx)(x,{id:e.id,message:e.message,type:e.type,onClose:r,duration:e.duration},e.id))})}function g(){let[e,t]=(0,s.useState)([]),r=(0,s.useRef)(0),n=(0,s.useCallback)(function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"info",s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3e3,a="toast-".concat(++r.current,"-").concat(Date.now()),o={id:a,message:e,type:n,duration:s};return t(e=>[...e,o]),a},[]);return{toasts:e,showToast:n,removeToast:(0,s.useCallback)(e=>{t(t=>t.filter(t=>t.id!==e))},[]),clearToasts:(0,s.useCallback)(()=>{t([])},[])}}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7347],{2317:(e,t,r)=>{r.d(t,{V:()=>a});var n=r(12115);function o(){try{let e="__localStorage_test__";return window.localStorage.setItem(e,"test"),window.localStorage.removeItem(e),!0}catch(e){return!1}}function a(e){let{key:t,defaultValue:r,validate:a,serialize:i=JSON.stringify,deserialize:s=JSON.parse}=e,c=(0,n.useRef)(r),l=(0,n.useRef)(a),u=(0,n.useRef)(i),d=(0,n.useRef)(s);c.current=r,l.current=a,u.current=i,d.current=s;let[f,p]=(0,n.useState)(!1),[y,m]=(0,n.useState)(r),S=(0,n.useCallback)(()=>{if(!o())return c.current;try{let e=window.localStorage.getItem(t);if(null===e)return c.current;let r=d.current(e);if(l.current)return l.current(r)?r:c.current;return r}catch(e){return c.current}},[t]),w=(0,n.useCallback)(e=>{if(o())try{let r=u.current(e);window.localStorage.setItem(t,r)}catch(e){}},[t]),h=(0,n.useCallback)(e=>{m(t=>{let r="function"==typeof e?e(t):e;return w(r),r})},[w]),E=(0,n.useCallback)(()=>{if(o())try{window.localStorage.removeItem(t)}catch(e){}m(c.current)},[t]);return(0,n.useEffect)(()=>{p(o()),m(S())},[S]),{value:y,setValue:h,removeValue:E,isAvailable:f}}},7636:(e,t,r)=>{r.d(t,{LV:()=>c,Si:()=>o,UZ:()=>i,Xn:()=>u,_s:()=>d,nO:()=>l,s6:()=>s});let n=["updatedAt","repositoryName","branchName","status","lastSent"],o=e=>n.includes(e),a={waiting:0,ready:1,running:2,generating:3,idle:4};function i(e){let t=new Set;for(let r of e)!1===r.visible&&t.add(r.path);return t}function s(e,t){return 0===t.size?e.slice():e.filter(e=>{let r=e.repositoryPath;return!r||!t.has(r)})}function c(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 l(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 u(e,t,r){let n=[...e];return n.sort((e,n)=>{let o=0;switch(t){case"updatedAt":{let t=e=>e?e instanceof Date?e.getTime():new Date(e).getTime():0,r=t(e.lastActivity);o=t(n.lastActivity)-r;break}case"repositoryName":{let t=e.repositoryName.toLowerCase(),r=n.repositoryName.toLowerCase();o=t.localeCompare(r);break}case"branchName":{let t=e.name.toLowerCase(),r=n.name.toLowerCase();o=t.localeCompare(r);break}case"status":o=a[e.status]-a[n.status];break;case"lastSent":{let t=l(e.lastActivity,n.lastActivity);if(!e.lastActivity&&!n.lastActivity){o=0;break}if(!e.lastActivity)return 1;if(!n.lastActivity)return -1;o=t;break}default:o=0}return("updatedAt"===t||"lastSent"===t?"desc"===r:"asc"===r)?o:-o}),n}function d(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:u(n.get(e),t,r)}))}},22592:(e,t,r)=>{r.d(t,{Ps:()=>d,W5:()=>u});var n=r(95155),o=r(12115),a=r(38218),i=r(68704);let s="data-pc-size",c={size:i.r5,setSize:()=>{},isMobile:!1,factor:i.d8[i.r5].factor,isAvailable:!1},l=(0,o.createContext)(c);function u(e){let{children:t}=e,{size:r,setSize:c,isAvailable:u}=(0,i.of)(),d=(0,a.a)();(0,o.useEffect)(()=>{if("undefined"==typeof document)return;let e=document.documentElement;return d?void e.removeAttribute(s):(e.setAttribute(s,r),()=>{e.removeAttribute(s)})},[r,d]);let f=(0,o.useMemo)(()=>({size:r,setSize:c,isMobile:d,factor:i.d8[r].factor,isAvailable:u}),[r,c,d,u]);return(0,n.jsx)(l.Provider,{value:f,children:t})}function d(){return(0,o.useContext)(l)}},32916:(e,t,r)=>{r.d(t,{GB:()=>u,VF:()=>d});var n=r(95155),o=r(12115),a=r(7636);let i="updatedAt",s=(0,o.createContext)(null);function c(e,t,r,n){let a=(0,o.useRef)(!0);(0,o.useEffect)(()=>{try{let t=localStorage.getItem(e);t&&n(t)}catch(e){}},[]),(0,o.useEffect)(()=>{if(a.current){a.current=!1;return}try{localStorage.setItem(e,r())}catch(e){}},[t])}function l(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};default:return e}}function u(e){let{children:t,initialOpen:r=!0,initialWidth:u=224}=e,[d,f]=(0,o.useReducer)(l,{isOpen:r,width:u,isMobileDrawerOpen:!1,sortKey:i,sortDirection:"desc",viewMode:"grouped"});c("mcbd-sidebar-sort","".concat(d.sortKey,":").concat(d.sortDirection),()=>JSON.stringify({sortKey:d.sortKey,sortDirection:d.sortDirection}),e=>{try{let t=JSON.parse(e),r=t.sortDirection,n=(0,a.Si)(t.sortKey)?t.sortKey:i;n&&("asc"===r||"desc"===r)&&f({type:"LOAD_SORT_SETTINGS",sortKey:n,sortDirection:r})}catch(e){}}),c("mcbd-sidebar-view-mode",d.viewMode,()=>d.viewMode,e=>{("grouped"===e||"flat"===e)&&f({type:"SET_VIEW_MODE",viewMode:e})}),c("mcbd-sidebar-width",d.width,()=>String(d.width),e=>{let t=Number(e);!isNaN(t)&&t>0&&f({type:"SET_WIDTH",width:288===t?224:t})});let p=(0,o.useCallback)(()=>{f({type:"TOGGLE"})},[]),y=(0,o.useCallback)(e=>{f({type:"SET_WIDTH",width:e})},[]),m=(0,o.useCallback)(()=>{f({type:"OPEN_MOBILE_DRAWER"})},[]),S=(0,o.useCallback)(()=>{f({type:"CLOSE_MOBILE_DRAWER"})},[]),w=(0,o.useCallback)(e=>{f({type:"SET_SORT_KEY",sortKey:e})},[]),h=(0,o.useCallback)(e=>{f({type:"SET_SORT_DIRECTION",sortDirection:e})},[]),E=(0,o.useCallback)(e=>{f({type:"SET_VIEW_MODE",viewMode:e})},[]),g=(0,o.useMemo)(()=>({isOpen:d.isOpen,width:d.width,isMobileDrawerOpen:d.isMobileDrawerOpen,sortKey:d.sortKey,sortDirection:d.sortDirection,toggle:p,setWidth:y,openMobileDrawer:m,closeMobileDrawer:S,setSortKey:w,setSortDirection:h,viewMode:d.viewMode,setViewMode:E}),[d.isOpen,d.width,d.isMobileDrawerOpen,d.sortKey,d.sortDirection,d.viewMode,p,y,m,S,w,h,E]);return(0,n.jsx)(s.Provider,{value:g,children:t})}function d(){let e=(0,o.useContext)(s);if(!e)throw Error("useSidebarContext must be used within a SidebarProvider");return e}},38218:(e,t,r)=>{r.d(t,{D:()=>a,a:()=>i});var n=r(12115);let o=n.useLayoutEffect,a=768;function i(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{breakpoint:t=a}=e,[r,i]=(0,n.useState)(!1);return o(()=>{let e=window.matchMedia("(max-width: ".concat(t-1,"px)"));i(e.matches);let r=e=>{i(e.matches)};return e.addEventListener("change",r),()=>{e.removeEventListener("change",r)}},[t]),r}},39649:(e,t,r)=>{r.d(t,{$f:()=>d,H8:()=>u});var n=r(95155),o=r(12115),a=r(80344);let i={PROCESSING:2e3,SESSION_RUNNING:5e3,IDLE:1e4},s=(0,o.createContext)(null),c={selectedWorktreeId:null,worktrees:[],repositories:[],selectedWorktreeDetail:null,isLoading:!0,isLoadingDetail:!1,error:null};function l(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 u(e){let{children:t,externalWorktrees:r,externalRepositories:u}=e,d=void 0!==r,[f,p]=(0,o.useReducer)(l,c);(0,o.useEffect)(()=>{d&&r&&p({type:"SET_WORKTREES",worktrees:r})},[d,r]),(0,o.useEffect)(()=>{d&&u&&p({type:"SET_REPOSITORIES",repositories:u})},[d,u]);let y=(0,o.useCallback)(async()=>{if(!d){p({type:"SET_LOADING",isLoading:!0}),p({type:"SET_ERROR",error:null});try{var e;let t=await a.y.getAll();p({type:"SET_WORKTREES",worktrees:t.worktrees}),p({type:"SET_REPOSITORIES",repositories:null!=(e=t.repositories)?e:[]})}catch(e){p({type:"SET_ERROR",error:e instanceof Error?e.message:"Failed to fetch worktrees"})}}},[d]),m=(0,o.useCallback)(async e=>{p({type:"SELECT_WORKTREE",id:e}),p({type:"SET_ERROR",error:null});try{a.y.markAsViewed(e).catch(e=>{console.warn("[WorktreeSelectionContext] Failed to mark as viewed:",e)});let t=await a.y.getById(e);p({type:"SET_WORKTREE_DETAIL",detail:t})}catch(e){p({type:"SET_ERROR",error:e instanceof Error?e.message:"Failed to fetch worktree detail"})}finally{p({type:"SET_LOADING_DETAIL",isLoadingDetail:!1})}},[]),S=(0,o.useCallback)(async()=>{await y()},[y]);(0,o.useEffect)(()=>{d||y()},[y,d]),(0,o.useEffect)(()=>{if(d)return;let e=null,t=!0,r=async()=>{if(t)try{var n,o;let s=await a.y.getAll();p({type:"SET_WORKTREES",worktrees:s.worktrees}),p({type:"SET_REPOSITORIES",repositories:null!=(n=s.repositories)?n:[]});let c=(o=s.worktrees).some(e=>e.isProcessing||e.isWaitingForResponse)?i.PROCESSING:o.some(e=>e.isSessionRunning)?i.SESSION_RUNNING:i.IDLE;t&&(e=setTimeout(r,c))}catch(n){if(n instanceof a.hD&&401===n.status)return;console.error("[WorktreeSelectionContext] Polling error:",n),t&&(e=setTimeout(r,i.SESSION_RUNNING))}};return r(),()=>{t=!1,e&&clearTimeout(e)}},[d]);let w={selectedWorktreeId:f.selectedWorktreeId,worktrees:f.worktrees,repositories:f.repositories,selectedWorktreeDetail:f.selectedWorktreeDetail,isLoadingDetail:f.isLoadingDetail,error:f.error,selectWorktree:m,refreshWorktrees:S};return(0,n.jsx)(s.Provider,{value:w,children:t})}function d(){let e=(0,o.useContext)(s);if(!e)throw Error("useWorktreeSelection must be used within a WorktreeSelectionProvider");return e}},52703:(e,t,r)=>{r.d(t,{Oo:()=>o,ST:()=>n,zS:()=>a});let n="client_version",o="version_mismatch";function a(e){let t;try{t=JSON.parse(e)}catch(e){return null}if(!t||"object"!=typeof t)return null;let r=t;if("broadcast"===r.type){let e=r.data;return e&&"object"==typeof e?"string"!=typeof e.type?null:(void 0===e.worktreeId&&"string"==typeof r.worktreeId&&(e.worktreeId=r.worktreeId),e):null}return"string"==typeof r.type?r:null}},63365:(e,t,r)=>{r.d(t,{tS:()=>u,xM:()=>d,T3:()=>f});var n=r(95155),o=r(12115),a=r(52703);function i(){return"undefined"!=typeof globalThis&&"function"==typeof globalThis.WebSocket?globalThis.WebSocket:null}let s=()=>{},c={status:"disconnected",connected:!1,subscribe:s,unsubscribe:s,addListener:()=>s},l=(0,o.createContext)(null);function u(e){let{children:t,enabled:r=!0}=e,s=(0,o.useRef)(new Set),c=(0,o.useRef)(new Map),{status:u,subscribe:d,unsubscribe:f}=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{onEvent:t,onStatusChange:r,autoReconnect:n=!0,reconnectBaseDelay:s=1e3,reconnectMaxDelay:c=3e4,enabled:l=!0}=e,[u,d]=(0,o.useState)("disconnected"),f=(0,o.useRef)(null),p=(0,o.useRef)(null),y=(0,o.useRef)(0),m=(0,o.useRef)(new Set),S=(0,o.useRef)(!1),w=(0,o.useRef)(t);w.current=t;let h=(0,o.useRef)(r);h.current=r;let E=(0,o.useCallback)(e=>{var t;d(e),null==(t=h.current)||t.call(h,e)},[]),g=(0,o.useCallback)(()=>{null!==p.current&&(clearTimeout(p.current),p.current=null)},[]),T=(0,o.useCallback)(()=>{if(!l)return;let e=i();if(!e||f.current&&(f.current.readyState===e.OPEN||f.current.readyState===e.CONNECTING))return;g(),S.current=!1,E("connecting");let t="https:"===window.location.protocol?"wss:":"ws:",r=new e("".concat(t,"//").concat(window.location.host));f.current=r,r.onopen=()=>{y.current=0,E("connected");try{r.send(JSON.stringify({type:a.ST,version:"0.10.4"}))}catch(e){}m.current.forEach(e=>{try{r.send(JSON.stringify({type:"subscribe",worktreeId:e}))}catch(e){}})},r.onmessage=e=>{var t;let r="string"==typeof e.data?e.data:String(e.data),n=(0,a.zS)(r);n&&(null==(t=w.current)||t.call(w,n))},r.onerror=()=>{E("error")},r.onclose=()=>{var e;if(f.current=null,E("disconnected"),S.current||!n||"undefined"!=typeof document&&"hidden"===document.visibilityState)return;let t=(e=y.current,Math.min(s*2**Math.max(0,e),c));y.current+=1,p.current=setTimeout(()=>{p.current=null,T()},t)}},[l,n,s,c,E,g]),b=(0,o.useCallback)(()=>{if(g(),S.current=!0,f.current){try{f.current.close(1e3,"Client disconnect")}catch(e){}f.current=null}},[g]),k=(0,o.useCallback)(e=>{let t=f.current,r=i();if(t&&r&&t.readyState===r.OPEN)try{t.send(JSON.stringify(e))}catch(e){}},[]),v=(0,o.useCallback)(e=>{m.current.has(e)||(m.current.add(e),k({type:"subscribe",worktreeId:e}))},[k]),O=(0,o.useCallback)(e=>{m.current.has(e)&&(m.current.delete(e),k({type:"unsubscribe",worktreeId:e}))},[k]);return(0,o.useEffect)(()=>{if(l)return T(),()=>{b()}},[l,T,b]),(0,o.useEffect)(()=>{if(!l||"undefined"==typeof document)return;let e=()=>{"visible"===document.visibilityState&&(f.current||(y.current=0,T()))};return document.addEventListener("visibilitychange",e),()=>document.removeEventListener("visibilitychange",e)},[l,T]),{status:u,subscribe:v,unsubscribe:O,send:k}}({enabled:r,onEvent:(0,o.useCallback)(e=>{s.current.forEach(t=>{try{t(e)}catch(e){}})},[])}),p=(0,o.useCallback)(e=>{var t;let r=c.current,n=null!=(t=r.get(e))?t:0;r.set(e,n+1),0===n&&d(e)},[d]),y=(0,o.useCallback)(e=>{var t;let r=c.current,n=null!=(t=r.get(e))?t:0;n<=1?(r.delete(e),f(e)):r.set(e,n-1)},[f]),m=(0,o.useCallback)(e=>(s.current.add(e),()=>{s.current.delete(e)}),[]),S=(0,o.useMemo)(()=>({status:u,connected:"connected"===u,subscribe:p,unsubscribe:y,addListener:m}),[u,p,y,m]);return(0,n.jsx)(l.Provider,{value:S,children:t})}function d(){var e;return null!=(e=(0,o.useContext)(l))?e:c}function f(e){let{addListener:t}=d(),r=(0,o.useRef)(e);r.current=e,(0,o.useEffect)(()=>t(e=>r.current(e)),[t])}},65380:(e,t,r)=>{r.d(t,{H:()=>s,O:()=>i});var n=r(95155),o=r(12115);let a=(0,o.createContext)(!1);function i(e){let{children:t,authEnabled:r}=e;return(0,n.jsx)(a.Provider,{value:r,children:t})}function s(){return(0,o.useContext)(a)}},66966:(e,t,r)=>{r.d(t,{g7:()=>c,rC:()=>u,Fn:()=>l});var n=r(95155),o=r(12115),a=r(63365),i=r(39649);let s=(0,o.createContext)(null);function c(e){let{children:t}=e,{worktrees:r,repositories:c,isLoading:l,error:u,refresh:d}=function(){let[e,t]=(0,o.useState)([]),[r,n]=(0,o.useState)([]),[i,s]=(0,o.useState)(!0),[c,l]=(0,o.useState)(null),u=(0,o.useRef)(null),d=(0,o.useRef)([]),f=(0,o.useRef)(null),{connected:p,subscribe:y,unsubscribe:m,addListener:S}=(0,a.xM)(),w=(0,o.useRef)(p);w.current=p;let h=(0,o.useCallback)(async()=>{try{var e,r;l(null);let a=await fetch("/api/worktrees");if(!a.ok)throw Error("Failed to fetch worktrees: ".concat(a.status));let i=await a.json(),s=null!=(e=i.worktrees)?e:[],c=null!=(r=i.repositories)?r:[];(0,o.startTransition)(()=>{t(s),n(c)}),d.current=s}catch(e){l(e instanceof Error?e:Error(String(e)))}finally{s(!1)}},[]);(0,o.useEffect)(()=>{h()},[h]);let E=(0,o.useCallback)(()=>d.current.some(e=>!0===e.isSessionRunning),[]),g=(0,o.useCallback)(()=>{let e=E();return w.current?e?2e4:6e4:e?5e3:3e4},[E]),T=(0,o.useCallback)(()=>{null!==u.current&&(clearInterval(u.current),u.current=null),f.current=null},[]),b=(0,o.useCallback)(()=>{T();let e=g();f.current=e,u.current=setInterval(()=>{h()},e)},[g,h,T]);(0,o.useEffect)(()=>{let e=()=>{document.hidden?T():(h(),b())},t=setTimeout(()=>{b()},0);return document.addEventListener("visibilitychange",e),()=>{clearTimeout(t),T(),document.removeEventListener("visibilitychange",e)}},[h,b,T]),(0,o.useEffect)(()=>{if(d.current=e,"undefined"!=typeof document&&document.hidden||null===f.current)return;let t=g();f.current!==t&&b()},[e,p,g,b]);let k=e.map(e=>e.id).sort().join(" ");return(0,o.useEffect)(()=>{let e=k.length>0?k.split(" "):[];return e.forEach(e=>y(e)),()=>{e.forEach(e=>m(e))}},[k,y,m]),(0,o.useEffect)(()=>S(e=>{if("session_status_changed"===e.type&&"string"==typeof e.worktreeId){let r=e.worktreeId,n=e.isRunning;if("boolean"==typeof n){if((null!=e.cliTool||null!=e.instance)&&!1===n)return void h();(0,o.startTransition)(()=>{t(e=>{let t=!1,o=e.map(e=>e.id===r&&e.isSessionRunning!==n?(t=!0,{...e,isSessionRunning:n}):e);return t?o:e})})}}else("message"===e.type||"message_updated"===e.type)&&h()}),[S,h]),{worktrees:e,repositories:r,isLoading:i,error:c,refresh:h}}(),f=(0,o.useMemo)(()=>({worktrees:r,repositories:c,isLoading:l,error:u,refresh:d}),[r,c,l,u,d]);return(0,n.jsx)(s.Provider,{value:f,children:(0,n.jsx)(i.H8,{externalWorktrees:r,externalRepositories:c,children:t})})}function l(){let e=(0,o.useContext)(s);if(null===e)throw Error("useWorktreesCacheContext must be used within a WorktreesCacheProvider");return e}function u(){return(0,o.useContext)(s)}},68704:(e,t,r)=>{r.d(t,{Uf:()=>a,d8:()=>i,fM:()=>s,of:()=>l,r5:()=>o,rq:()=>c});var n=r(2317);let o="medium",a=["large","medium","small","xsmall"],i={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 s(e){return"string"==typeof e&&Object.prototype.hasOwnProperty.call(i,e)}function c(e){return i[e].terminalFontSize}function l(){let{value:e,setValue:t,isAvailable:r}=(0,n.V)({key:"mcbd-pc-display-size",defaultValue:o,validate:s});return{size:e,setSize:t,isAvailable:r}}},70628:(e,t,r)=>{r.d(t,{K:()=>s,S:()=>i});var n=r(95155),o=r(12115);let a=(0,o.createContext)({open:!1,setOpen:()=>{},toggle:()=>{}});function i(e){let{children:t}=e,[r,i]=(0,o.useState)(!1),s=(0,o.useCallback)(()=>i(e=>!e),[]),c=(0,o.useMemo)(()=>({open:r,setOpen:i,toggle:s}),[r,s]);return(0,n.jsx)(a.Provider,{value:c,children:t})}function s(){return(0,o.useContext)(a)}},80344:(e,t,r)=>{r.d(t,{$T:()=>c,GQ:()=>u,Rx:()=>s,hD:()=>n,hS:()=>l,y:()=>i});class n extends Error{constructor(e,t,r){super(e),this.status=t,this.data=r,this.name="ApiError"}}async function o(e,t,r){if(!(e.headers.get("content-type")||"").includes("application/json"))return t;try{return await e.json()}catch(e){return t}}async function a(e,t){try{let r=new Headers(null==t?void 0:t.headers);r.set("Content-Type","application/json");let a=await fetch(e,{...t,headers:r}),i=a.headers.get("content-type")||"";if(a.redirected&&a.url.includes("/login"))throw new n("Authentication required",401);if(!a.ok){let e=await o(a,{},"error-body");throw new n(e.error||"HTTP error ".concat(a.status),a.status,e)}if(!i.includes("application/json"))throw new n("Unexpected response format",a.status);return a.json()}catch(e){if(e instanceof n)throw e;throw new n(e instanceof Error?e.message:"Unknown error",0,e)}}let i={getAll:async()=>a("/api/worktrees"),getById:async e=>a("/api/worktrees/".concat(e)),updateDescription:async(e,t)=>a("/api/worktrees/".concat(e),{method:"PATCH",body:JSON.stringify({description:t})}),updateLink:async(e,t)=>a("/api/worktrees/".concat(e),{method:"PATCH",body:JSON.stringify({link:t})}),toggleFavorite:async(e,t)=>a("/api/worktrees/".concat(e),{method:"PATCH",body:JSON.stringify({favorite:t})}),updateStatus:async(e,t)=>a("/api/worktrees/".concat(e),{method:"PATCH",body:JSON.stringify({status:t})}),updateCliTool:async(e,t)=>a("/api/worktrees/".concat(e),{method:"PATCH",body:JSON.stringify({cliToolId:t})}),markAsViewed:async e=>a("/api/worktrees/".concat(e,"/viewed"),{method:"PATCH"}),async getMessages(e,t,r,n){let o=new URLSearchParams;return t&&o.append("cliTool",t),r&&o.append("includeArchived","true"),"number"==typeof n&&Number.isFinite(n)&&o.append("limit",String(n)),a("/api/worktrees/".concat(e,"/messages").concat(o.toString()?"?".concat(o.toString()):""))},async sendMessage(e,t,r){let n={content:t};return(null==r?void 0:r.cliToolId)&&(n.cliToolId=r.cliToolId),(null==r?void 0:r.instanceId)&&(n.instanceId=r.instanceId),(null==r?void 0:r.imagePath)&&(n.imagePath=r.imagePath),a("/api/worktrees/".concat(e,"/send"),{method:"POST",body:JSON.stringify(n)})},async uploadImageFile(e,t){let r=Date.now(),n="".concat(r,"-").concat(t.name),a=".commandmate/attachments",i=new FormData;i.append("file",new File([t],n,{type:t.type}));let s=await fetch("/api/worktrees/".concat(e,"/upload/").concat(a),{method:"POST",body:i});if(!s.ok){var c;let e=await o(s,{},"error-body");throw Error((null==e||null==(c=e.error)?void 0:c.message)||"Upload failed (HTTP ".concat(s.status,")"))}return{path:(await o(s,{},"response-body")).path||"".concat(a,"/").concat(n)}},getLogs:async e=>a("/api/worktrees/".concat(e,"/logs")),async getLogFile(e,t,r){let n=(null==r?void 0:r.sanitize)?"?sanitize=true":"";return a("/api/worktrees/".concat(e,"/logs/").concat(t).concat(n))},async killSession(e,t,r){let n=new URLSearchParams;t&&n.set("cliTool",t),r&&n.set("instance",r);let o=n.toString();return a("/api/worktrees/".concat(e,"/kill-session").concat(o?"?".concat(o):""),{method:"POST"})}},s={scan:async e=>a("/api/repositories/scan",{method:"POST",body:JSON.stringify({repositoryPath:e})}),sync:async()=>a("/api/repositories/sync",{method:"POST"}),delete:async e=>a("/api/repositories",{method:"DELETE",body:JSON.stringify({repositoryPath:e})}),clone:async e=>a("/api/repositories/clone",{method:"POST",body:JSON.stringify({cloneUrl:e})}),getCloneStatus:async e=>a("/api/repositories/clone/".concat(e)),getExcluded:async()=>a("/api/repositories/excluded"),restore:async e=>a("/api/repositories/restore",{method:"PUT",body:JSON.stringify({repositoryPath:e})}),list:async()=>a("/api/repositories"),updateDisplayName:async(e,t)=>a("/api/repositories/".concat(encodeURIComponent(e)),{method:"PUT",body:JSON.stringify({displayName:t})}),updateVisibility:async(e,t)=>a("/api/repositories/".concat(encodeURIComponent(e)),{method:"PUT",body:JSON.stringify({visible:t})})},c={getAll:async e=>(await a("/api/worktrees/".concat(e,"/memos"))).memos,create:async(e,t)=>(await a("/api/worktrees/".concat(e,"/memos"),{method:"POST",body:JSON.stringify(t||{})})).memo,update:async(e,t,r)=>(await a("/api/worktrees/".concat(e,"/memos/").concat(t),{method:"PUT",body:JSON.stringify(r)})).memo,delete:async(e,t)=>a("/api/worktrees/".concat(e,"/memos/").concat(t),{method:"DELETE"}),async reorder(e,t){await a("/api/worktrees/".concat(e,"/memos"),{method:"PATCH",body:JSON.stringify({memoIds:t})})}};function l(e){return e instanceof n||e instanceof Error?e.message:"An unknown error occurred"}let u={checkForUpdate:async()=>a("/api/app/update-check",{method:"GET"}),startUpdate:async()=>a("/api/app/update",{method:"POST"}),async ping(){try{return(await fetch("/api/auth/status",{cache:"no-store"})).ok}catch(e){return!1}}}},89275:(e,t,r)=>{r.d(t,{Bo:()=>u,Hq:()=>c});var n=r(95155),o=r(12115),a=r(20063);let i={startTransition:e=>e()},s=(0,o.createContext)(null);function c(){var e;let t=(0,a.useRouter)(),{startTransition:r}=null!=(e=(0,o.useContext)(s))?e:i;return(0,o.useMemo)(()=>({push:e=>r(()=>t.push(e)),replace:e=>r(()=>t.replace(e))}),[t,r])}function l(e){let{onCommit:t}=e,r=(0,a.usePathname)(),n=(0,o.useRef)(!1);return(0,o.useEffect)(()=>{if(!n.current){n.current=!0;return}t()},[r,t]),null}function u(e){let{children:t}=e,r=(0,o.useRef)(null),a=(0,o.useCallback)(()=>{var e;null==(e=r.current)||e.call(r)},[]),i=(0,o.useCallback)(e=>{var t;t=()=>new Promise(t=>{let n=!1,o=()=>{n||(n=!0,t())};r.current=o,e(),window.setTimeout(o,500)}),"undefined"==typeof document||"function"!=typeof document.startViewTransition||"function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches?t():document.startViewTransition(t)},[]),c=(0,o.useMemo)(()=>({startTransition:i}),[i]);return(0,n.jsxs)(s.Provider,{value:c,children:[(0,n.jsx)(l,{onCommit:a}),t]})}},92614:(e,t,r)=>{r.d(t,{C:()=>s,E:()=>i});var n=r(95155),o=r(12115);let a=(0,o.createContext)({open:!1,setOpen:()=>{},toggle:()=>{}});function i(e){let{children:t}=e,[r,i]=(0,o.useState)(!1),s=(0,o.useCallback)(()=>i(e=>!e),[]),c=(0,o.useMemo)(()=>({open:r,setOpen:i,toggle:s}),[r,s]);return(0,n.jsx)(a.Provider,{value:c,children:t})}function s(){return(0,o.useContext)(a)}}}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[838],{1226:()=>{},38038:(e,t,s)=>{Promise.resolve().then(s.bind(s,60675))},53482:(e,t,s)=>{"use strict";s.d(t,{i:()=>c});var a=s(95155),n=s(12115),r=s(60322),i=s(9900);function o(){return(0,a.jsx)("svg",{className:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})}function l(){return(0,a.jsx)("svg",{className:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})}function c(e){let{text:t,className:s="",label:c="Copy"}=e,[d,u]=(0,n.useState)(!1),m=(0,n.useRef)(null);(0,n.useEffect)(()=>()=>{m.current&&clearTimeout(m.current)},[]);let p=(0,n.useCallback)(async()=>{try{await (0,r.l)(t),u(!0),m.current&&clearTimeout(m.current),m.current=setTimeout(()=>u(!1),i.s7)}catch(e){}},[t]);return(0,a.jsxs)("button",{type:"button",onClick:p,className:"inline-flex items-center gap-1 rounded border border-border bg-surface px-2 py-0.5 text-[11px] font-medium text-foreground transition-colors hover:bg-muted ".concat(s),"aria-label":d?"Copied":c,title:d?"Copied!":c,children:[d?(0,a.jsx)(l,{}):(0,a.jsx)(o,{}),(0,a.jsx)("span",{children:d?"Copied":c})]})}},60322:(e,t,s)=>{"use strict";s.d(t,{l:()=>n});let a=/\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 s=e.replace(a,"");if(null==(t=navigator.clipboard)?void 0:t.writeText)try{await navigator.clipboard.writeText(s);return}catch(e){}let n=document.createElement("textarea");n.value=s,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)}}},60675:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>I});var a=s(95155),n=s(4560),r=s(12115),i=s(18955),o=s(71360),l=s(744),c=s(36402);let d=(0,r.memo)(function(e){let{onSend:t,disabled:s=!1,placeholder:n}=e,o=(0,i.c)("home"),[c,d]=(0,r.useState)(""),[u,m]=(0,r.useState)(!1),[p,h]=(0,r.useState)(!1),x=(0,r.useRef)(null),f=(0,r.useRef)(null),g=(0,r.useRef)(!1);(0,r.useEffect)(()=>{let e=x.current;e&&(c?(e.style.height="auto",e.style.height="".concat(Math.min(e.scrollHeight,120),"px")):e.style.height="24px")},[c]);let b=(0,r.useCallback)(async()=>{if(!p&&c.trim()&&!u&&!s)try{m(!0),await t(c.trim()),d("")}catch(e){}finally{m(!1)}},[p,c,u,s,t]),v=(0,r.useCallback)(async e=>{e.preventDefault(),await b()},[b]),y=(0,r.useCallback)(()=>{h(!0),g.current=!1,f.current&&clearTimeout(f.current)},[]),w=(0,r.useCallback)(()=>{h(!1),g.current=!0,f.current&&clearTimeout(f.current),f.current=setTimeout(()=>{g.current=!1},300)},[]),j=(0,r.useCallback)(e=>{let{keyCode:t}=e.nativeEvent;if(229!==t){if(g.current&&"Enter"===e.key){g.current=!1;return}"Enter"!==e.key||p||e.shiftKey||(e.preventDefault(),b())}},[p,b]);return(0,a.jsxs)("form",{onSubmit:v,className:"flex shrink-0 items-center gap-2 rounded-lg border border-input bg-surface dark:bg-surface-2 px-3 py-1.5 focus-within:border-accent-500 focus-within:ring-1 focus-within:ring-accent-500","data-testid":"assistant-message-input",children:[(0,a.jsx)("textarea",{ref:x,value:c,onChange:e=>d(e.target.value),onKeyDown:j,onCompositionStart:y,onCompositionEnd:w,placeholder:null!=n?n:o("assistant.input.defaultPlaceholder"),disabled:u||s,rows:1,className:"flex-1 outline-none bg-transparent resize-none overflow-y-auto scrollbar-thin text-sm",style:{minHeight:"24px",maxHeight:"120px",paddingTop:"4px",paddingBottom:"4px",lineHeight:"18px"},"data-testid":"assistant-message-textarea"}),(0,a.jsx)(l.$n,{type:"submit",variant:"ghost",disabled:!c.trim()||u||s,className:"flex-shrink-0 rounded-full p-1.5 text-accent-600 hover:bg-accent-50 dark:text-accent-400 dark:hover:bg-accent-900/30 disabled:text-muted-foreground disabled:hover:bg-transparent","aria-label":o("assistant.input.send"),"data-testid":"assistant-send-button",children:u?(0,a.jsx)(l.y$,{size:"sm"}):(0,a.jsx)("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 19l9 2-9-18-9 18 9-2zm0 0v-8"})})})]})});var u=s(28857),m=s(22133),p=s(10934),h=s(5225);s(1226);var x=s(53482),f=s(3005);function g(e){return e.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}function b(){return(0,a.jsx)("svg",{className:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})})}function v(e){let{message:t}=e;return(0,a.jsx)("div",{className:"text-center text-xs font-medium uppercase tracking-[0.14em] text-muted-foreground",children:(0,a.jsx)("span",{className:"rounded-full border border-border bg-surface-2 px-3 py-1",children:t.content})})}function y(e){let{message:t,canEdit:s,onEdit:n}=e,o=(0,i.c)("home"),[l,c]=(0,r.useState)(!1),[d,u]=(0,r.useState)(t.content),[m,p]=(0,r.useState)(!1),[h,f]=(0,r.useState)(null),v=t.deliveryStatus?"pending"===t.deliveryStatus?o("assistant.message.sending"):"failed"===t.deliveryStatus?o("assistant.message.failed"):o("assistant.message.sent"):null,y=(0,r.useCallback)(()=>{u(t.content),f(null),c(!0)},[t.content]),w=(0,r.useCallback)(()=>{c(!1),f(null)},[]),j=(0,r.useCallback)(async()=>{if(!n||m)return;let e=d.trim();if(!e||e===t.content.trim())return void c(!1);p(!0),f(null);try{await n(t,e),c(!1)}catch(e){f(e instanceof Error?e.message:o("assistant.errors.resubmitMessage"))}finally{p(!1)}},[d,t,n,m,o]);return(0,a.jsxs)("div",{className:"group ml-auto max-w-[88%] rounded-2xl border border-accent-500/40 bg-accent-500/10 px-4 py-3 text-foreground shadow-sm",children:[(0,a.jsxs)("div",{className:"mb-2 flex items-center justify-between gap-3 text-[11px] uppercase tracking-[0.12em] text-muted-foreground",children:[(0,a.jsx)("span",{children:o("assistant.message.you")}),(0,a.jsx)("span",{children:g(t.timestamp)})]}),l?(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("textarea",{className:"w-full resize-y rounded border border-input bg-surface p-2 text-sm text-foreground focus:border-accent-500 focus:outline-none focus:ring-1 focus:ring-ring",value:d,onChange:e=>u(e.target.value),rows:Math.max(3,Math.min(12,d.split("\n").length+1)),disabled:m,"data-testid":"assistant-edit-textarea"}),h&&(0,a.jsx)("p",{className:"text-[11px] text-danger-foreground",children:h}),(0,a.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,a.jsx)("button",{type:"button",onClick:w,disabled:m,className:"rounded border border-border bg-surface px-3 py-1 text-[11px] text-foreground transition-colors hover:bg-muted disabled:opacity-50",children:o("assistant.message.cancel")}),(0,a.jsx)("button",{type:"button",onClick:j,disabled:m||!d.trim(),className:"rounded bg-accent-600 px-3 py-1 text-[11px] font-medium text-white transition-colors hover:bg-accent-700 disabled:cursor-not-allowed disabled:bg-muted disabled:text-muted-foreground","data-testid":"assistant-edit-save",children:m?o("assistant.message.resending"):o("assistant.message.saveAndResend")})]})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("p",{className:"whitespace-pre-wrap break-words text-sm leading-6",children:t.content}),(0,a.jsxs)("div",{className:"mt-2 flex items-center justify-between gap-3",children:[(0,a.jsx)("span",{className:"text-[11px] font-medium ".concat("failed"===t.deliveryStatus?"text-danger-foreground":"text-muted-foreground"),children:null!=v?v:""}),(0,a.jsxs)("div",{className:"flex items-center gap-1.5 opacity-60 transition-opacity group-hover:opacity-100",children:[(0,a.jsx)(x.i,{text:t.content}),s&&n&&(0,a.jsxs)("button",{type:"button",onClick:y,className:"inline-flex items-center gap-1 rounded border border-border bg-surface px-2 py-0.5 text-[11px] font-medium text-foreground transition-colors hover:bg-muted","aria-label":o("assistant.message.editMessage"),"data-testid":"assistant-edit-button",title:o("assistant.message.editAndResend"),children:[(0,a.jsx)(b,{}),(0,a.jsx)("span",{children:o("assistant.message.edit")})]})]})]})]})]})}function w(e){let{message:t,assistantLabel:s}=e;return(0,a.jsxs)("div",{className:"group mr-auto max-w-[88%] rounded-2xl border border-border bg-surface px-4 py-3 text-foreground shadow-sm",children:[(0,a.jsxs)("div",{className:"mb-2 flex items-center justify-between gap-3 text-[11px] uppercase tracking-[0.12em] text-muted-foreground",children:[(0,a.jsx)("span",{children:s}),(0,a.jsx)("span",{children:g(t.timestamp)})]}),(0,a.jsx)("div",{className:"assistant-md text-sm leading-6",children:(0,a.jsx)(u.oz,{remarkPlugins:[m.A],rehypePlugins:[p.A,h.A],children:t.content})}),(0,a.jsx)("div",{className:"mt-2 flex justify-end opacity-60 transition-opacity group-hover:opacity-100",children:(0,a.jsx)(x.i,{text:t.content})})]})}function j(e){let{messages:t,assistantLabel:s,sessionActive:n,waitingForResponse:o=!1,canEdit:l=!1,onEditMessage:c}=e,d=(0,i.c)("home"),u=(0,r.useRef)(null),m=(0,r.useRef)(!0),p=(0,r.useMemo)(()=>{var e;let s=t[t.length-1];return s?"".concat(t.length,":").concat(s.id,":").concat(null!=(e=s.deliveryStatus)?e:"",":").concat(s.content.length,":").concat(o?"waiting":"idle"):"empty:".concat(o?"waiting":"idle")},[t,o]);(0,r.useEffect)(()=>{u.current&&m.current&&(u.current.scrollTop=u.current.scrollHeight)},[p]);let h=(0,r.useMemo)(()=>{let e=t[t.length-1];return n&&e&&"user"===e.role&&"failed"!==e.deliveryStatus?d("assistant.working"):d("assistant.emptyState")},[t,n,d]);return(0,a.jsx)("div",{ref:u,className:"h-full min-h-0 overflow-y-scroll rounded-xl border border-border bg-surface-2 p-3",style:{scrollbarGutter:"stable"},onScroll:e=>{let t=e.currentTarget;m.current=t.scrollHeight-t.scrollTop-t.clientHeight<48},"data-testid":"assistant-message-list",children:0!==t.length||o?(0,a.jsxs)("div",{className:"space-y-3",children:[t.map(e=>"system"===e.role&&"session_boundary"===e.messageType?(0,a.jsx)(v,{message:e},e.id):"user"===e.role?(0,a.jsx)(y,{message:e,canEdit:l,onEdit:c},e.id):(0,a.jsx)(w,{message:e,assistantLabel:s},e.id)),o&&(0,a.jsxs)("div",{className:"mr-auto flex max-w-[88%] items-center gap-3 rounded-2xl border border-border bg-surface px-4 py-3 shadow-sm","data-testid":"assistant-waiting-indicator","aria-live":"polite",children:[(0,a.jsx)(f.y,{size:"sm",variant:"accent"}),(0,a.jsx)("span",{className:"text-sm text-foreground",children:d("assistant.thinking",{label:s})})]})]}):(0,a.jsx)("div",{className:"flex h-full min-h-[160px] items-center justify-center text-sm text-muted-foreground",children:h})})}function k(e){return e?{...e,createdAt:new Date(e.createdAt),updatedAt:new Date(e.updatedAt),lastStartedAt:e.lastStartedAt?new Date(e.lastStartedAt):void 0,lastStoppedAt:e.lastStoppedAt?new Date(e.lastStoppedAt):void 0,contextSentAt:e.contextSentAt?new Date(e.contextSentAt):void 0}:null}function N(e){return{...e,timestamp:new Date(e.timestamp)}}let C={async getConversation(e,t){let s=await fetch("/api/assistant/conversation?repositoryId=".concat(encodeURIComponent(e),"&cliToolId=").concat(encodeURIComponent(t)));if(!s.ok)throw Error((await s.json().catch(()=>({}))).error||"Failed to get conversation (".concat(s.status,")"));return k((await s.json()).conversation)},async getMessages(e){let t=await fetch("/api/assistant/messages?conversationId=".concat(encodeURIComponent(e)));if(!t.ok)throw Error((await t.json().catch(()=>({}))).error||"Failed to get messages (".concat(t.status,")"));return(await t.json()).messages.map(N)},async clearMessages(e,t){var s;let a=new URLSearchParams({conversationId:e});(null==t?void 0:t.fromMessageId)&&a.set("fromMessageId",t.fromMessageId);let n=await fetch("/api/assistant/messages?".concat(a.toString()),{method:"DELETE"});if(!n.ok)throw Error((await n.json().catch(()=>({}))).error||"Failed to clear messages (".concat(n.status,")"));return{archivedCount:null!=(s=(await n.json()).archivedCount)?s:0}},async startSession(e,t){let s=await fetch("/api/assistant/start",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cliToolId:e,repositoryId:t})});if(!s.ok)throw Error((await s.json().catch(()=>({}))).error||"Failed to start session (".concat(s.status,")"));let a=await s.json();return{...a,conversation:k(a.conversation)}},async sendCommand(e,t,s){let a=await fetch("/api/assistant/terminal",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cliToolId:e,conversationId:t,command:s})});if(!a.ok)throw Error((await a.json().catch(()=>({}))).error||"Failed to send command (".concat(a.status,")"))},async getCurrentOutput(e,t){let s=await fetch("/api/assistant/current-output?cliToolId=".concat(encodeURIComponent(e),"&conversationId=").concat(encodeURIComponent(t)));if(!s.ok)throw Error((await s.json().catch(()=>({}))).error||"Failed to get output (".concat(s.status,")"));return s.json()},async stopSession(e,t){let s=await fetch("/api/assistant/session?cliToolId=".concat(encodeURIComponent(e),"&conversationId=").concat(encodeURIComponent(t)),{method:"DELETE"});if(!s.ok)throw Error((await s.json().catch(()=>({}))).error||"Failed to stop session (".concat(s.status,")"));return s.json()},async getInstalledTools(){var e;let t=await fetch("/api/assistant/tools");return t.ok&&null!=(e=(await t.json()).tools)?e:[]}},S="commandmate-assistant-cli-tool",E=["claude","codex","antigravity"];function M(e){return E.includes(e)}function A(){var e;let t=(0,i.c)("home"),s=(0,c.SC)(),[n,u]=(0,r.useState)([]),[m,p]=(0,r.useState)([]),[h,x]=(0,r.useState)(""),[f,g]=(0,r.useState)("claude"),[b,v]=(0,r.useState)(null),[y,w]=(0,r.useState)([]),[k,N]=(0,r.useState)(null),[E,A]=(0,r.useState)(!1),[I,T]=(0,r.useState)(!1),[R,L]=(0,r.useState)(!1),[H,D]=(0,r.useState)(!1),[P,_]=(0,r.useState)(null),z="".concat(h,":").concat(f),F=!H||""!==h&&P!==z,U=(0,r.useRef)(null),O=(null==b?void 0:b.status)==="ready"||(null==b?void 0:b.status)==="running",B=(null==b?void 0:b.status)==="running",W=(null==b?void 0:b.status)==="ready",$=n.find(e=>e.id===h),V=(0,r.useMemo)(()=>m.filter(e=>M(e.id)),[m]),G=V.find(e=>e.id===f),J=null!=(e=null==G?void 0:G.name)?e:f,K=(0,r.useCallback)(async e=>{w(await C.getMessages(e))},[]),Z=(0,r.useCallback)(async()=>{if(!h){v(null),w([]);return}let e=await C.getConversation(h,f);v(e),e?await K(e.id):w([])},[K,h,f]);(0,r.useEffect)(()=>{{let e=localStorage.getItem(S);e&&M(e)&&g(e)}},[]),(0,r.useEffect)(()=>{async function e(){let e=await C.getInstalledTools();p(e);let t=e.filter(e=>M(e.id)),s=t.find(e=>e.installed);s&&g(e=>{let a=t.find(t=>t.id===e);return(null==a?void 0:a.installed)?e:s.id})}(async function(){try{var e;let t=await fetch("/api/worktrees");if(!t.ok)return;let s=(null!=(e=(await t.json()).repositories)?e:[]).map(e=>({id:e.id,path:e.path,name:e.name,displayName:e.displayName}));u(s),s.length>0&&x(e=>e||s[0].id)}catch(e){}finally{D(!0)}})(),e()},[]),(0,r.useEffect)(()=>{if(!h)return;let e=!1;return(async()=>{try{let t=await C.getConversation(h,f);if(e)return;if(v(t),t){let s=await C.getMessages(t.id);e||w(s)}else w([])}catch(s){e||N(s instanceof Error?s.message:t("assistant.errors.loadConversation"))}finally{e||_("".concat(h,":").concat(f))}})(),()=>{e=!0}},[h,f,t]),(0,r.useEffect)(()=>{if(U.current&&(clearInterval(U.current),U.current=null),!b)return;let e=async()=>{try{await Z()}catch(e){}};return e(),U.current=setInterval(e,2e3),()=>{U.current&&(clearInterval(U.current),U.current=null)}},[null==b?void 0:b.id,Z,b]);let q=(0,r.useCallback)(e=>{M(e)&&(g(e),localStorage.setItem(S,e))},[]),Q=(0,r.useCallback)(async()=>{if(h&&!E){A(!0),N(null);try{let e=await C.startSession(f,h);v(e.conversation),await K(e.conversation.id)}catch(e){N(e instanceof Error?e.message:t("assistant.errors.startSession"))}finally{A(!1)}}},[K,h,f,E,t]),X=(0,r.useCallback)(async()=>{if(b&&!I){T(!0),N(null);try{await C.stopSession(f,b.id),await Z()}catch(e){N(e instanceof Error?e.message:t("assistant.errors.stopSession"))}finally{T(!1)}}},[b,Z,f,I,t]),Y=(0,r.useCallback)(async()=>{if(b&&!R&&!B&&await s({description:t("assistant.clearHistoryConfirm"),variant:"danger"})){L(!0),N(null);try{await C.clearMessages(b.id),await Z()}catch(e){N(e instanceof Error?e.message:t("assistant.errors.clearHistory"))}finally{L(!1)}}},[R,b,B,Z,s,t]),ee=(0,r.useCallback)(async e=>{if(b&&W){N(null);try{await C.sendCommand(f,b.id,e),v(e=>e?{...e,status:"running"}:e),await Promise.all([K(b.id),Z()])}catch(e){throw N(e instanceof Error?e.message:t("assistant.errors.sendMessage")),e}}},[W,b,Z,K,f,t]),et=(0,r.useCallback)(async(e,s)=>{if(!b||!W)throw Error(t("assistant.errors.notReadyToResend"));N(null),await C.clearMessages(b.id,{fromMessageId:e.id}),await C.sendCommand(f,b.id,s),v(e=>e?{...e,status:"running"}:e),await Promise.all([K(b.id),Z()])},[W,b,Z,K,f,t]),es=(0,r.useCallback)(async e=>{if(O){if(!await s({description:t("assistant.changeRepoConfirm")}))return;try{await C.stopSession(f,b.id)}catch(e){N(e instanceof Error?e.message:t("assistant.errors.stopSession"));return}}x(e),N(null)},[b,O,f,s,t]);return(0,a.jsx)(l.Zp,{variant:"elevated",padding:"none",className:"overflow-hidden rounded-xl shadow-lg","data-testid":"assistant-chat-panel",children:(0,a.jsxs)("div",{className:"flex h-[78vh] min-h-[34rem] max-h-[48rem] flex-col gap-4 overflow-hidden bg-gradient-to-br from-transparent to-accent-500/5 p-4",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsxs)("div",{className:"grid gap-3 md:grid-cols-[minmax(0,1.6fr)_minmax(0,1fr)_auto]",children:[(0,a.jsx)("span",{className:"text-xs font-medium uppercase tracking-[0.16em] text-muted-foreground",children:t("assistant.repositoryLabel")}),(0,a.jsx)("span",{className:"text-xs font-medium uppercase tracking-[0.16em] text-muted-foreground",children:t("assistant.cliLabel")}),(0,a.jsx)("span",{className:"hidden md:block"})]}),(0,a.jsxs)("div",{className:"grid gap-3 md:grid-cols-[minmax(0,1.6fr)_minmax(0,1fr)_auto] md:items-center",children:[(0,a.jsxs)("select",{value:h,onChange:e=>void es(e.target.value),disabled:0===n.length,className:"w-full rounded-lg border border-input bg-surface px-3 py-2 text-sm text-foreground shadow-sm transition-colors focus:border-accent-500 focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:bg-muted disabled:text-muted-foreground","data-testid":"assistant-repo-select",children:[0===n.length&&(0,a.jsx)("option",{value:"",children:t("assistant.noRepositories")}),n.map(e=>(0,a.jsx)("option",{value:e.id,children:e.displayName||e.name},e.id))]}),(0,a.jsx)("select",{value:f,onChange:e=>q(e.target.value),disabled:O,className:"w-full rounded-lg border border-input bg-surface px-3 py-2 text-sm text-foreground shadow-sm transition-colors focus:border-accent-500 focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:bg-muted disabled:text-muted-foreground","data-testid":"assistant-tool-select",children:V.map(e=>(0,a.jsx)("option",{value:e.id,disabled:!e.installed,children:e.installed?e.name:t("assistant.toolNotInstalled",{name:e.name})},e.id))}),(0,a.jsx)("div",{children:O?(0,a.jsx)(l.$n,{variant:"danger",onClick:X,disabled:I,className:"w-full md:w-auto","data-testid":"assistant-stop-button",children:I?t("assistant.stopping"):t("assistant.stop")}):(0,a.jsx)(l.$n,{variant:"primary",onClick:Q,disabled:!h||E,className:"w-full md:w-auto","data-testid":"assistant-start-button",children:E?t("assistant.starting"):t("assistant.start")})})]}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:$?t("assistant.startDirectory",{repository:$.displayName||$.name,path:$.path}):t("assistant.startDirectoryHint")})]}),k&&(0,a.jsx)("div",{className:"rounded border border-danger/40 bg-danger/10 p-2 text-sm text-danger-foreground",children:k}),(0,a.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col gap-3 overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex shrink-0 items-center justify-between",children:[(0,a.jsx)("span",{className:"text-xs font-medium uppercase tracking-[0.14em] text-muted-foreground",children:t("assistant.history")}),(0,a.jsxs)(l.$n,{type:"button",variant:"ghost",size:"sm",onClick:Y,disabled:!b||R||B||0===y.length,className:"gap-1","data-testid":"assistant-clear-button",children:[(0,a.jsx)(o.A,{className:"h-3.5 w-3.5","aria-hidden":"true"}),R?t("assistant.clearing"):t("assistant.clearHistory")]})]}),(0,a.jsx)("div",{className:"min-h-0 flex-1 overflow-hidden",children:F&&0===y.length?(0,a.jsx)("div",{className:"h-full min-h-0 overflow-hidden rounded-xl border border-border bg-surface-2 p-3","data-testid":"assistant-chat-loading",role:"status","aria-label":t("assistant.loadingConversation"),children:(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsx)(l.EA,{className:"ml-auto h-10 w-3/5 rounded-2xl"}),(0,a.jsx)(l.EA,{className:"mr-auto h-16 w-4/5 rounded-2xl"}),(0,a.jsx)(l.EA,{className:"ml-auto h-10 w-2/5 rounded-2xl"})]})}):(0,a.jsx)(j,{messages:y,assistantLabel:J,sessionActive:O,waitingForResponse:B,canEdit:W,onEditMessage:et})}),(0,a.jsx)("div",{className:"shrink-0",children:(0,a.jsx)(d,{onSend:ee,disabled:!W,placeholder:W?t("assistant.inputPlaceholder"):O?t("assistant.inputPlaceholderWaiting"):t("assistant.inputPlaceholderNoSession")})})]})]})})}function I(){return(0,a.jsx)(n.GV,{children:(0,a.jsxs)("div",{className:"container-custom py-8 overflow-auto h-full",children:[(0,a.jsxs)("div",{className:"mb-6",children:[(0,a.jsx)("h1",{className:"text-2xl font-bold text-foreground mb-2",children:"Assistant Chat"}),(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:"Converse with a local CLI assistant (Claude or Codex) scoped to a selected repository."})]}),(0,a.jsx)(A,{})]})})}},71360:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(71847).A)("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]])}},e=>{e.O(0,[6481,6809,4909,2770,3165,4974,8566,2069,934,6402,744,7347,4560,8441,1255,7358],()=>e(e.s=38038)),_N_E=e.O()}]);