commandmate 0.34.1 → 0.35.0

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 (311) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-build-manifest.json +176 -163
  3. package/.next/app-path-routes-manifest.json +27 -27
  4. package/.next/build-manifest.json +2 -2
  5. package/.next/prerender-manifest.json +9 -9
  6. package/.next/required-server-files.json +1 -1
  7. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  8. package/.next/server/app/api/agents/update/route_client-reference-manifest.js +1 -1
  9. package/.next/server/app/api/agents/versions/route_client-reference-manifest.js +1 -1
  10. package/.next/server/app/api/app/update/route_client-reference-manifest.js +1 -1
  11. package/.next/server/app/api/app/update-check/route.js +1 -1
  12. package/.next/server/app/api/app/update-check/route_client-reference-manifest.js +1 -1
  13. package/.next/server/app/api/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.nft.json +1 -1
  16. package/.next/server/app/api/assistant/current-output/route_client-reference-manifest.js +1 -1
  17. package/.next/server/app/api/assistant/messages/route.js +1 -1
  18. package/.next/server/app/api/assistant/messages/route.js.nft.json +1 -1
  19. package/.next/server/app/api/assistant/messages/route_client-reference-manifest.js +1 -1
  20. package/.next/server/app/api/assistant/session/route.js +1 -1
  21. package/.next/server/app/api/assistant/session/route.js.nft.json +1 -1
  22. package/.next/server/app/api/assistant/session/route_client-reference-manifest.js +1 -1
  23. package/.next/server/app/api/assistant/start/route.js +1 -1
  24. package/.next/server/app/api/assistant/start/route.js.nft.json +1 -1
  25. package/.next/server/app/api/assistant/start/route_client-reference-manifest.js +1 -1
  26. package/.next/server/app/api/assistant/terminal/route.js +1 -1
  27. package/.next/server/app/api/assistant/terminal/route.js.nft.json +1 -1
  28. package/.next/server/app/api/assistant/terminal/route_client-reference-manifest.js +1 -1
  29. package/.next/server/app/api/assistant/tools/route.js.nft.json +1 -1
  30. package/.next/server/app/api/assistant/tools/route_client-reference-manifest.js +1 -1
  31. package/.next/server/app/api/auth/login/route_client-reference-manifest.js +1 -1
  32. package/.next/server/app/api/auth/logout/route_client-reference-manifest.js +1 -1
  33. package/.next/server/app/api/auth/status/route_client-reference-manifest.js +1 -1
  34. package/.next/server/app/api/capabilities/route.js +1 -1
  35. package/.next/server/app/api/capabilities/route_client-reference-manifest.js +1 -1
  36. package/.next/server/app/api/daily-summary/route_client-reference-manifest.js +1 -1
  37. package/.next/server/app/api/daily-summary/status/route_client-reference-manifest.js +1 -1
  38. package/.next/server/app/api/external-apps/[id]/health/route_client-reference-manifest.js +1 -1
  39. package/.next/server/app/api/external-apps/[id]/route_client-reference-manifest.js +1 -1
  40. package/.next/server/app/api/external-apps/route_client-reference-manifest.js +1 -1
  41. package/.next/server/app/api/fs/browse/route_client-reference-manifest.js +1 -1
  42. package/.next/server/app/api/fs/recent-paths/route_client-reference-manifest.js +1 -1
  43. package/.next/server/app/api/hooks/agent-event/route.js.nft.json +1 -1
  44. package/.next/server/app/api/hooks/agent-event/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/hooks/permission-request/route.js.nft.json +1 -1
  49. package/.next/server/app/api/hooks/permission-request/route_client-reference-manifest.js +1 -1
  50. package/.next/server/app/api/metrics/vibe/route_client-reference-manifest.js +1 -1
  51. package/.next/server/app/api/ollama/models/route_client-reference-manifest.js +1 -1
  52. package/.next/server/app/api/push/escalation/route_client-reference-manifest.js +1 -1
  53. package/.next/server/app/api/push/subscriptions/route_client-reference-manifest.js +1 -1
  54. package/.next/server/app/api/push/vapid/route_client-reference-manifest.js +1 -1
  55. package/.next/server/app/api/relays/[relayId]/cancel/route.js +1 -1
  56. package/.next/server/app/api/relays/[relayId]/cancel/route.js.nft.json +1 -1
  57. package/.next/server/app/api/relays/[relayId]/cancel/route_client-reference-manifest.js +1 -1
  58. package/.next/server/app/api/relays/route.js +1 -1
  59. package/.next/server/app/api/relays/route.js.nft.json +1 -1
  60. package/.next/server/app/api/relays/route_client-reference-manifest.js +1 -1
  61. package/.next/server/app/api/remote/pair/route_client-reference-manifest.js +1 -1
  62. package/.next/server/app/api/repositories/[id]/route_client-reference-manifest.js +1 -1
  63. package/.next/server/app/api/repositories/[id]/todos/[todoId]/route_client-reference-manifest.js +1 -1
  64. package/.next/server/app/api/repositories/[id]/todos/route_client-reference-manifest.js +1 -1
  65. package/.next/server/app/api/repositories/clone/[jobId]/route.js +1 -1
  66. package/.next/server/app/api/repositories/clone/[jobId]/route.js.nft.json +1 -1
  67. package/.next/server/app/api/repositories/clone/[jobId]/route_client-reference-manifest.js +1 -1
  68. package/.next/server/app/api/repositories/clone/route.js +1 -1
  69. package/.next/server/app/api/repositories/clone/route.js.nft.json +1 -1
  70. package/.next/server/app/api/repositories/clone/route_client-reference-manifest.js +1 -1
  71. package/.next/server/app/api/repositories/excluded/route_client-reference-manifest.js +1 -1
  72. package/.next/server/app/api/repositories/restore/route.js +1 -1
  73. package/.next/server/app/api/repositories/restore/route.js.nft.json +1 -1
  74. package/.next/server/app/api/repositories/restore/route_client-reference-manifest.js +1 -1
  75. package/.next/server/app/api/repositories/route.js +1 -1
  76. package/.next/server/app/api/repositories/route.js.nft.json +1 -1
  77. package/.next/server/app/api/repositories/route_client-reference-manifest.js +1 -1
  78. package/.next/server/app/api/repositories/scan/route.js +1 -1
  79. package/.next/server/app/api/repositories/scan/route.js.nft.json +1 -1
  80. package/.next/server/app/api/repositories/scan/route_client-reference-manifest.js +1 -1
  81. package/.next/server/app/api/repositories/sync/route.js +1 -1
  82. package/.next/server/app/api/repositories/sync/route.js.nft.json +1 -1
  83. package/.next/server/app/api/repositories/sync/route_client-reference-manifest.js +1 -1
  84. package/.next/server/app/api/repositories/validate-path/route_client-reference-manifest.js +1 -1
  85. package/.next/server/app/api/settings/default-agents/route.js.nft.json +1 -1
  86. package/.next/server/app/api/settings/default-agents/route_client-reference-manifest.js +1 -1
  87. package/.next/server/app/api/settings/default-surface-mode/route_client-reference-manifest.js +1 -1
  88. package/.next/server/app/api/sidebar/group-order/route_client-reference-manifest.js +1 -1
  89. package/.next/server/app/api/skills/[id]/route_client-reference-manifest.js +1 -1
  90. package/.next/server/app/api/skills/installations/route_client-reference-manifest.js +1 -1
  91. package/.next/server/app/api/skills/operations/route_client-reference-manifest.js +1 -1
  92. package/.next/server/app/api/skills/reindex/route_client-reference-manifest.js +1 -1
  93. package/.next/server/app/api/skills/route_client-reference-manifest.js +1 -1
  94. package/.next/server/app/api/slash-commands/route_client-reference-manifest.js +1 -1
  95. package/.next/server/app/api/tasks/[taskId]/cancel/route_client-reference-manifest.js +1 -1
  96. package/.next/server/app/api/tasks/[taskId]/route_client-reference-manifest.js +1 -1
  97. package/.next/server/app/api/templates/[id]/route_client-reference-manifest.js +1 -1
  98. package/.next/server/app/api/templates/route_client-reference-manifest.js +1 -1
  99. package/.next/server/app/api/todos/route_client-reference-manifest.js +1 -1
  100. package/.next/server/app/api/verification/runs/[runId]/route_client-reference-manifest.js +1 -1
  101. package/.next/server/app/api/verification/runs/route_client-reference-manifest.js +1 -1
  102. package/.next/server/app/api/worktrees/[id]/auto-yes/route.js +1 -1
  103. package/.next/server/app/api/worktrees/[id]/auto-yes/route.js.nft.json +1 -1
  104. package/.next/server/app/api/worktrees/[id]/auto-yes/route_client-reference-manifest.js +1 -1
  105. package/.next/server/app/api/worktrees/[id]/capture/route.js.nft.json +1 -1
  106. package/.next/server/app/api/worktrees/[id]/capture/route_client-reference-manifest.js +1 -1
  107. package/.next/server/app/api/worktrees/[id]/clear-composer/route.js +1 -1
  108. package/.next/server/app/api/worktrees/[id]/clear-composer/route.js.nft.json +1 -1
  109. package/.next/server/app/api/worktrees/[id]/clear-composer/route_client-reference-manifest.js +1 -1
  110. package/.next/server/app/api/worktrees/[id]/cli-reference/route_client-reference-manifest.js +1 -1
  111. package/.next/server/app/api/worktrees/[id]/cli-tool/route_client-reference-manifest.js +1 -1
  112. package/.next/server/app/api/worktrees/[id]/cmate/schedules/route_client-reference-manifest.js +1 -1
  113. package/.next/server/app/api/worktrees/[id]/current-output/route.js +1 -1
  114. package/.next/server/app/api/worktrees/[id]/current-output/route.js.nft.json +1 -1
  115. package/.next/server/app/api/worktrees/[id]/current-output/route_client-reference-manifest.js +1 -1
  116. package/.next/server/app/api/worktrees/[id]/env/route_client-reference-manifest.js +1 -1
  117. package/.next/server/app/api/worktrees/[id]/execution-logs/[logId]/route_client-reference-manifest.js +1 -1
  118. package/.next/server/app/api/worktrees/[id]/execution-logs/route_client-reference-manifest.js +1 -1
  119. package/.next/server/app/api/worktrees/[id]/files/[...path]/route.js +1 -1
  120. package/.next/server/app/api/worktrees/[id]/files/[...path]/route_client-reference-manifest.js +1 -1
  121. package/.next/server/app/api/worktrees/[id]/git/branch/create/route_client-reference-manifest.js +1 -1
  122. package/.next/server/app/api/worktrees/[id]/git/branch/delete/route_client-reference-manifest.js +1 -1
  123. package/.next/server/app/api/worktrees/[id]/git/branches/route_client-reference-manifest.js +1 -1
  124. package/.next/server/app/api/worktrees/[id]/git/checkout/route_client-reference-manifest.js +1 -1
  125. package/.next/server/app/api/worktrees/[id]/git/commit/route_client-reference-manifest.js +1 -1
  126. package/.next/server/app/api/worktrees/[id]/git/diff/route_client-reference-manifest.js +1 -1
  127. package/.next/server/app/api/worktrees/[id]/git/fetch/route_client-reference-manifest.js +1 -1
  128. package/.next/server/app/api/worktrees/[id]/git/log/route_client-reference-manifest.js +1 -1
  129. package/.next/server/app/api/worktrees/[id]/git/pull/route_client-reference-manifest.js +1 -1
  130. package/.next/server/app/api/worktrees/[id]/git/push/route_client-reference-manifest.js +1 -1
  131. package/.next/server/app/api/worktrees/[id]/git/reset/route_client-reference-manifest.js +1 -1
  132. package/.next/server/app/api/worktrees/[id]/git/revert/route_client-reference-manifest.js +1 -1
  133. package/.next/server/app/api/worktrees/[id]/git/show/[commitHash]/route_client-reference-manifest.js +1 -1
  134. package/.next/server/app/api/worktrees/[id]/git/stage/route_client-reference-manifest.js +1 -1
  135. package/.next/server/app/api/worktrees/[id]/git/staged/route_client-reference-manifest.js +1 -1
  136. package/.next/server/app/api/worktrees/[id]/git/stash/[index]/route_client-reference-manifest.js +1 -1
  137. package/.next/server/app/api/worktrees/[id]/git/stash/apply/route_client-reference-manifest.js +1 -1
  138. package/.next/server/app/api/worktrees/[id]/git/stash/pop/route_client-reference-manifest.js +1 -1
  139. package/.next/server/app/api/worktrees/[id]/git/stash/push/route_client-reference-manifest.js +1 -1
  140. package/.next/server/app/api/worktrees/[id]/git/stash/route_client-reference-manifest.js +1 -1
  141. package/.next/server/app/api/worktrees/[id]/git/status/route_client-reference-manifest.js +1 -1
  142. package/.next/server/app/api/worktrees/[id]/git/unstage/route_client-reference-manifest.js +1 -1
  143. package/.next/server/app/api/worktrees/[id]/git/working-diff/route_client-reference-manifest.js +1 -1
  144. package/.next/server/app/api/worktrees/[id]/instances/notes/route_client-reference-manifest.js +1 -1
  145. package/.next/server/app/api/worktrees/[id]/instances/opencode/route.js.nft.json +1 -1
  146. package/.next/server/app/api/worktrees/[id]/instances/opencode/route_client-reference-manifest.js +1 -1
  147. package/.next/server/app/api/worktrees/[id]/interrupt/route.js.nft.json +1 -1
  148. package/.next/server/app/api/worktrees/[id]/interrupt/route_client-reference-manifest.js +1 -1
  149. package/.next/server/app/api/worktrees/[id]/kill-session/route.js +1 -1
  150. package/.next/server/app/api/worktrees/[id]/kill-session/route.js.nft.json +1 -1
  151. package/.next/server/app/api/worktrees/[id]/kill-session/route_client-reference-manifest.js +1 -1
  152. package/.next/server/app/api/worktrees/[id]/logs/[filename]/route_client-reference-manifest.js +1 -1
  153. package/.next/server/app/api/worktrees/[id]/logs/route_client-reference-manifest.js +1 -1
  154. package/.next/server/app/api/worktrees/[id]/marp-render/route_client-reference-manifest.js +1 -1
  155. package/.next/server/app/api/worktrees/[id]/memos/[memoId]/route_client-reference-manifest.js +1 -1
  156. package/.next/server/app/api/worktrees/[id]/memos/route_client-reference-manifest.js +1 -1
  157. package/.next/server/app/api/worktrees/[id]/messages/route_client-reference-manifest.js +1 -1
  158. package/.next/server/app/api/worktrees/[id]/opencode/diff/route_client-reference-manifest.js +1 -1
  159. package/.next/server/app/api/worktrees/[id]/opencode/session/route_client-reference-manifest.js +1 -1
  160. package/.next/server/app/api/worktrees/[id]/opencode/share/route_client-reference-manifest.js +1 -1
  161. package/.next/server/app/api/worktrees/[id]/prompt-response/route.js +1 -1
  162. package/.next/server/app/api/worktrees/[id]/prompt-response/route.js.nft.json +1 -1
  163. package/.next/server/app/api/worktrees/[id]/prompt-response/route_client-reference-manifest.js +1 -1
  164. package/.next/server/app/api/worktrees/[id]/resolve-target/route_client-reference-manifest.js +1 -1
  165. package/.next/server/app/api/worktrees/[id]/respond/route.js +1 -1
  166. package/.next/server/app/api/worktrees/[id]/respond/route.js.nft.json +1 -1
  167. package/.next/server/app/api/worktrees/[id]/respond/route_client-reference-manifest.js +1 -1
  168. package/.next/server/app/api/worktrees/[id]/route.js +1 -1
  169. package/.next/server/app/api/worktrees/[id]/route.js.nft.json +1 -1
  170. package/.next/server/app/api/worktrees/[id]/route_client-reference-manifest.js +1 -1
  171. package/.next/server/app/api/worktrees/[id]/schedules/[scheduleId]/route_client-reference-manifest.js +1 -1
  172. package/.next/server/app/api/worktrees/[id]/schedules/active/route_client-reference-manifest.js +1 -1
  173. package/.next/server/app/api/worktrees/[id]/schedules/route_client-reference-manifest.js +1 -1
  174. package/.next/server/app/api/worktrees/[id]/search/route_client-reference-manifest.js +1 -1
  175. package/.next/server/app/api/worktrees/[id]/send/route.js +1 -1
  176. package/.next/server/app/api/worktrees/[id]/send/route.js.nft.json +1 -1
  177. package/.next/server/app/api/worktrees/[id]/send/route_client-reference-manifest.js +1 -1
  178. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route.js.nft.json +1 -1
  179. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route_client-reference-manifest.js +1 -1
  180. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/install/route_client-reference-manifest.js +1 -1
  181. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/plan/route_client-reference-manifest.js +1 -1
  182. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall/route_client-reference-manifest.js +1 -1
  183. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall-plan/route_client-reference-manifest.js +1 -1
  184. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/update/route_client-reference-manifest.js +1 -1
  185. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/update-plan/route_client-reference-manifest.js +1 -1
  186. package/.next/server/app/api/worktrees/[id]/skills/route_client-reference-manifest.js +1 -1
  187. package/.next/server/app/api/worktrees/[id]/slash-commands/route_client-reference-manifest.js +1 -1
  188. package/.next/server/app/api/worktrees/[id]/special-keys/route.js +1 -1
  189. package/.next/server/app/api/worktrees/[id]/special-keys/route.js.nft.json +1 -1
  190. package/.next/server/app/api/worktrees/[id]/special-keys/route_client-reference-manifest.js +1 -1
  191. package/.next/server/app/api/worktrees/[id]/tasks/route_client-reference-manifest.js +1 -1
  192. package/.next/server/app/api/worktrees/[id]/terminal/route.js.nft.json +1 -1
  193. package/.next/server/app/api/worktrees/[id]/terminal/route_client-reference-manifest.js +1 -1
  194. package/.next/server/app/api/worktrees/[id]/timers/history/route_client-reference-manifest.js +1 -1
  195. package/.next/server/app/api/worktrees/[id]/timers/route.js +1 -1
  196. package/.next/server/app/api/worktrees/[id]/timers/route.js.nft.json +1 -1
  197. package/.next/server/app/api/worktrees/[id]/timers/route_client-reference-manifest.js +1 -1
  198. package/.next/server/app/api/worktrees/[id]/todos/[todoId]/route_client-reference-manifest.js +1 -1
  199. package/.next/server/app/api/worktrees/[id]/todos/route_client-reference-manifest.js +1 -1
  200. package/.next/server/app/api/worktrees/[id]/tree/[...path]/route_client-reference-manifest.js +1 -1
  201. package/.next/server/app/api/worktrees/[id]/tree/route_client-reference-manifest.js +1 -1
  202. package/.next/server/app/api/worktrees/[id]/upload/[...path]/route_client-reference-manifest.js +1 -1
  203. package/.next/server/app/api/worktrees/[id]/verify/config/route_client-reference-manifest.js +1 -1
  204. package/.next/server/app/api/worktrees/[id]/verify/route_client-reference-manifest.js +1 -1
  205. package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/cancel/route_client-reference-manifest.js +1 -1
  206. package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/route_client-reference-manifest.js +1 -1
  207. package/.next/server/app/api/worktrees/[id]/verify/runs/route_client-reference-manifest.js +1 -1
  208. package/.next/server/app/api/worktrees/[id]/viewed/route_client-reference-manifest.js +1 -1
  209. package/.next/server/app/api/worktrees/apply-default-agents/route_client-reference-manifest.js +1 -1
  210. package/.next/server/app/api/worktrees/route.js +1 -1
  211. package/.next/server/app/api/worktrees/route.js.nft.json +1 -1
  212. package/.next/server/app/api/worktrees/route_client-reference-manifest.js +1 -1
  213. package/.next/server/app/chat/page.js +2 -2
  214. package/.next/server/app/chat/page.js.nft.json +1 -1
  215. package/.next/server/app/chat/page_client-reference-manifest.js +1 -1
  216. package/.next/server/app/login/page_client-reference-manifest.js +1 -1
  217. package/.next/server/app/manifest.webmanifest/route_client-reference-manifest.js +1 -1
  218. package/.next/server/app/more/page.js +2 -2
  219. package/.next/server/app/more/page.js.nft.json +1 -1
  220. package/.next/server/app/more/page_client-reference-manifest.js +1 -1
  221. package/.next/server/app/offline/page_client-reference-manifest.js +1 -1
  222. package/.next/server/app/page.js +1 -1
  223. package/.next/server/app/page.js.nft.json +1 -1
  224. package/.next/server/app/page_client-reference-manifest.js +1 -1
  225. package/.next/server/app/proxy/[...path]/route_client-reference-manifest.js +1 -1
  226. package/.next/server/app/repositories/page.js +2 -2
  227. package/.next/server/app/repositories/page.js.nft.json +1 -1
  228. package/.next/server/app/repositories/page_client-reference-manifest.js +1 -1
  229. package/.next/server/app/review/page.js +1 -1
  230. package/.next/server/app/review/page.js.nft.json +1 -1
  231. package/.next/server/app/review/page_client-reference-manifest.js +1 -1
  232. package/.next/server/app/sessions/page.js +1 -1
  233. package/.next/server/app/sessions/page.js.nft.json +1 -1
  234. package/.next/server/app/sessions/page_client-reference-manifest.js +1 -1
  235. package/.next/server/app/skills/[skillId]/page.js +2 -2
  236. package/.next/server/app/skills/[skillId]/page.js.nft.json +1 -1
  237. package/.next/server/app/skills/[skillId]/page_client-reference-manifest.js +1 -1
  238. package/.next/server/app/skills/installed/page.js +2 -2
  239. package/.next/server/app/skills/installed/page.js.nft.json +1 -1
  240. package/.next/server/app/skills/installed/page_client-reference-manifest.js +1 -1
  241. package/.next/server/app/skills/page.js +1 -1
  242. package/.next/server/app/skills/page.js.nft.json +1 -1
  243. package/.next/server/app/skills/page_client-reference-manifest.js +1 -1
  244. package/.next/server/app/worktrees/[id]/files/[...path]/page_client-reference-manifest.js +1 -1
  245. package/.next/server/app/worktrees/[id]/page.js +11 -11
  246. package/.next/server/app/worktrees/[id]/page.js.nft.json +1 -1
  247. package/.next/server/app/worktrees/[id]/page_client-reference-manifest.js +1 -1
  248. package/.next/server/app/worktrees/[id]/terminal/page_client-reference-manifest.js +1 -1
  249. package/.next/server/app-paths-manifest.json +27 -27
  250. package/.next/server/chunks/1210.js +1 -1
  251. package/.next/server/chunks/{6286.js → 1467.js} +6 -6
  252. package/.next/server/chunks/1886.js +1 -1
  253. package/.next/server/chunks/2980.js +1 -1
  254. package/.next/server/chunks/3077.js +1 -1
  255. package/.next/server/chunks/3241.js +1 -1
  256. package/.next/server/chunks/3323.js +1 -1
  257. package/.next/server/chunks/434.js +1 -1
  258. package/.next/server/chunks/4443.js +1 -1
  259. package/.next/server/chunks/450.js +1 -1
  260. package/.next/server/chunks/6130.js +1 -1
  261. package/.next/server/chunks/650.js +1 -1
  262. package/.next/server/chunks/6677.js +3 -3
  263. package/.next/server/chunks/7075.js +1 -1
  264. package/.next/server/chunks/7506.js +1 -1
  265. package/.next/server/chunks/7905.js +1 -1
  266. package/.next/server/chunks/8728.js +8 -0
  267. package/.next/server/chunks/8918.js +5 -5
  268. package/.next/server/chunks/9123.js +2 -2
  269. package/.next/server/middleware-manifest.json +5 -5
  270. package/.next/server/pages/500.html +1 -1
  271. package/.next/server/server-reference-manifest.json +1 -1
  272. package/.next/static/chunks/2407-b9001cc6041876e1.js +1 -0
  273. package/.next/static/chunks/{4322-dfd5a7119b5ba4fc.js → 4322-59a7dbd77a7763cc.js} +1 -1
  274. package/.next/static/chunks/4388-410b1d8ed0d8d98b.js +1 -0
  275. package/.next/static/chunks/4718-56ebb6e55073ed5e.js +1 -0
  276. package/.next/static/chunks/{2652-18b8fea64413467e.js → 4809-145884b958e7d9a6.js} +1 -1
  277. package/.next/static/chunks/app/chat/{page-e60d07c4c79602f0.js → page-609c9a0f5ce44799.js} +1 -1
  278. package/.next/static/chunks/app/error-c1dc1038d0a84a33.js +1 -0
  279. package/.next/static/chunks/app/global-error-49f765ecb7fd6527.js +1 -0
  280. package/.next/static/chunks/app/{layout-4c2f21e3f653ee4c.js → layout-114dc6e93e332392.js} +1 -1
  281. package/.next/static/chunks/app/more/{page-fc94f86aa881489e.js → page-7c5380e4a7561935.js} +1 -1
  282. package/.next/static/chunks/app/{page-26a42881c8648cd3.js → page-a4f03c188610c6c8.js} +1 -1
  283. package/.next/static/chunks/app/repositories/{page-2576158c8420fda0.js → page-a15efb4ce1d1721e.js} +1 -1
  284. package/.next/static/chunks/app/review/{page-35b99baaf3c93b38.js → page-90ac618489676cbc.js} +1 -1
  285. package/.next/static/chunks/app/sessions/{page-a3ab6f122ec60d5a.js → page-6486d9a643c1dc6f.js} +1 -1
  286. package/.next/static/chunks/app/skills/[skillId]/{page-06799157652e8fa9.js → page-844872df04f52943.js} +1 -1
  287. package/.next/static/chunks/app/skills/installed/{page-2f3987e3a131c8d0.js → page-566dfde26d7e63ba.js} +1 -1
  288. package/.next/static/chunks/app/skills/{page-e70bfcf5ed4e4865.js → page-7859540e8092aace.js} +1 -1
  289. package/.next/static/chunks/app/worktrees/[id]/page-3a58ae66e203f935.js +1 -0
  290. package/.next/trace +14 -13
  291. package/dist/lib/detection/tools/verified-against.d.ts +20 -0
  292. package/dist/lib/detection/tools/verified-against.d.ts.map +1 -1
  293. package/dist/lib/detection/tools/verified-against.js +20 -0
  294. package/dist/server/src/config/websocket-config.js +67 -0
  295. package/dist/server/src/lib/auto-yes-poller.js +40 -7
  296. package/dist/server/src/lib/detection/selection-shape.js +361 -3
  297. package/dist/server/src/lib/detection/tools/command-code/detect.js +96 -0
  298. package/dist/server/src/lib/detection/tools/command-code/dialog.js +314 -0
  299. package/dist/server/src/lib/detection/tools/verified-against.js +20 -0
  300. package/dist/server/src/lib/polling/response-checker.js +48 -2
  301. package/dist/server/src/lib/ws-server.js +111 -1
  302. package/package.json +1 -1
  303. package/public/sw.js +12 -0
  304. package/.next/server/chunks/595.js +0 -8
  305. package/.next/static/chunks/4718-29cfcfb806724d9a.js +0 -1
  306. package/.next/static/chunks/8361-0142beb59be2abf3.js +0 -1
  307. package/.next/static/chunks/app/error-27ab04bce6545dae.js +0 -1
  308. package/.next/static/chunks/app/global-error-7b761b8e181ffc1f.js +0 -1
  309. package/.next/static/chunks/app/worktrees/[id]/page-60eab4e24c37cb77.js +0 -1
  310. /package/.next/static/{oDWX0JcwfhUYrMnnqDWVC → 0vChXhzA5YWj3f0D6A-Cn}/_buildManifest.js +0 -0
  311. /package/.next/static/{oDWX0JcwfhUYrMnnqDWVC → 0vChXhzA5YWj3f0D6A-Cn}/_ssgManifest.js +0 -0
@@ -1,4 +1,4 @@
1
- exports.id=9123,exports.ids=[9123],exports.modules={762:(a,b,c)=>{Promise.resolve().then(c.bind(c,96908))},1483:(a,b,c)=>{var d={"./en/keyboardShortcuts.json":[53722,1341],"./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},4267:(a,b,c)=>{"use strict";c.d(b,{Lt:()=>h,Wj:()=>f,eu:()=>e,fJ:()=>g});var d=c(17252);let e=2,f=6,g=["claude","codex","antigravity"];function h(a){return a.length<e||a.length>f?{valid:!1,error:`Must be ${e}-${f} elements`}:a.every(a=>"string"==typeof a&&d.XH.includes(a))?new Set(a).size!==a.length?{valid:!1,error:"Duplicate tool IDs not allowed"}:{valid:!0,value:a}:{valid:!1,error:"Invalid CLI tool ID"}}},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,t]=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`),c(18913)(`./${b}/skills.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,skills:t.default}}})},5682:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>d});let d=(0,c(97954).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/runner/work/CommandMate/CommandMate/src/app/error.tsx\" from the server, but it's 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/app/error.tsx","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,T4:()=>h,dz:()=>g,rz:()=>f,zS:()=>i});let d="client_version",e="version_mismatch",f="chat_turn_progress",g="messages_invalidated",h="model_changed";function i(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}},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}}},17252:(a,b,c)=>{"use strict";c.d(b,{Ab:()=>e,NL:()=>q,O6:()=>n,XH:()=>d,f_:()=>l,hR:()=>j,lu:()=>o,n6:()=>h,oo:()=>k,pQ:()=>f,sw:()=>m,vz:()=>p});let d=["claude","codex","gemini","vibe-local","opencode","copilot","antigravity","command-code"],e=10,f=50,g=/^[a-zA-Z0-9_-]+$/;function h(a){return"string"==typeof a&&a.length>0&&a.length<=64&&g.test(a)}let i={claude:"Claude",codex:"Codex",gemini:"Gemini","vibe-local":"Vibe Local",opencode:"OpenCode",copilot:"Copilot",antigravity:"Antigravity","command-code":"Command Code"};function j(a){return d.includes(a)}function k(a){return i[a]??a}function l(a,b="Assistant"){return a&&j(a)?k(a):b}function m(a){let b=a.alias;return"string"==typeof b&&b.trim().length>0?b:k(a.cliTool)}function n(a,b,c){let d=a.find(a=>a.id===b);return d?m(d):k(c)}function o(a){return a.map((a,b)=>({id:a,cliTool:a,alias:k(a),order:b}))}let p=128,q=2097152},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"})]})}},18608:(a,b,c)=>{"use strict";c.d(b,{W:()=>q,n:()=>r});var d=c(21124),e=c(38301),f=c(20481),g=c(16945),h=c(25345),i=c(47089),j=c(11010),k=c(67619),l=c(12055);let m=new Set;function n(a){return m.add(a),()=>{m.delete(a)}}function o(){return!1}function p(){return!1}function q(){return(0,e.useSyncExternalStore)(n,o,p)}function r(){let a=(0,f.c)("common"),[b,c]=(0,e.useState)(null),[m,n]=(0,e.useState)(null),o=(0,e.useCallback)(a=>{if(a.type!==l.Oo)return;let{serverVersion:b,clientVersion:d}=a;"string"==typeof b&&"string"==typeof d&&b&&d&&b!==m&&c({serverVersion:b,clientVersion:d})},[m]);(0,k.T3)(o);let p=(0,e.useCallback)(()=>{window.location.reload()},[]),q=(0,e.useCallback)(()=>{c(a=>(a&&n(a.serverVersion),null))},[]);return b?(0,d.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:j.M.TOAST},children:[(0,d.jsx)(g.A,{className:"h-5 w-5 shrink-0 mt-0.5","aria-hidden":"true"}),(0,d.jsxs)("div",{className:"flex flex-col gap-0.5 text-sm",children:[(0,d.jsx)("span",{className:"font-semibold",children:a("versionMismatch.title")}),(0,d.jsx)("span",{children:a("versionMismatch.description",{serverVersion:b.serverVersion,clientVersion:b.clientVersion})})]}),(0,d.jsxs)("button",{type:"button","data-testid":"version-mismatch-reload",onClick:p,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,d.jsx)(h.A,{className:"h-4 w-4","aria-hidden":"true"}),a("versionMismatch.reload")]}),(0,d.jsx)("button",{type:"button","data-testid":"version-mismatch-dismiss",onClick:q,"aria-label":a("versionMismatch.dismiss"),className:"shrink-0 hover:opacity-70 focus:outline-none focus:ring-2 focus:ring-offset-2",children:(0,d.jsx)(i.A,{className:"h-4 w-4","aria-hidden":"true"})})]}):null}},18913:(a,b,c)=>{var d={"./en/skills.json":[55064,5064],"./ja/skills.json":[20022,22]};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=18913,a.exports=e},19463:(a,b,c)=>{"use strict";c.d(b,{Kg:()=>f,Lv:()=>g});var d=c(38301),e=c(63157);function f(a){let b=0;for(let c of a)!0===c.isWaitingForResponse&&b++;return b}function g(){let a=(0,e.rC)(),b=a?.worktrees;return(0,d.useMemo)(()=>{let a=b?b.filter(a=>!0===a.isWaitingForResponse):[];return{count:a.length,worktrees:a}},[b])}},25754:(a,b,c)=>{"use strict";c.d(b,{Xn:()=>e,d9:()=>g,dI:()=>d,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,{BN:()=>y,EN:()=>g,LV:()=>n,PB:()=>i,Si:()=>f,UZ:()=>l,Xn:()=>t,ZC:()=>x,ZD:()=>w,_s:()=>u,fs:()=>z,j:()=>s,m3:()=>h,nO:()=>o,s6:()=>m,zD:()=>r});var d=c(89877);let e=["updatedAt","repositoryName","branchName","status","lastSent"],f=a=>e.includes(a),g=["always","collapsed","hidden"],h=a=>g.includes(a),i="collapsed",j={waiting:0,ready:1,running:2,generating:3,idle:4},k=["waiting","running","generating","ready","idle"];function l(a){let b=new Set;for(let c of a)!1===c.visible&&b.add(c.path);return b}function m(a,b){return 0===b.size?a.slice():a.filter(a=>{let c=a.repositoryPath;return!c||!b.has(c)})}function n(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 o(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 p(a){return a.cliStatus&&Object.keys(a.cliStatus).length>0?(0,d.A7)(a.cliStatus):a.status}function q(a){return"waiting"===p(a)}function r(a){let b=new Set(a.map(p));for(let a of k)if(b.has(a))return a;return"idle"}function s(a){let b=0;for(let c of a)q(c)&&b++;return b}function t(a,b,c){let d=[...a],e="status"!==b;return d.sort((a,d)=>{if(e){let b=Number(q(d))-Number(q(a));if(0!==b)return b}let f=0;switch(b){case"updatedAt":{let b=a=>a?a instanceof Date?a.getTime():new Date(a).getTime():0,c=b(a.lastActivity);f=b(d.lastActivity)-c;break}case"repositoryName":{let b=a.repositoryName.toLowerCase(),c=d.repositoryName.toLowerCase();f=b.localeCompare(c);break}case"branchName":{let b=a.name.toLowerCase(),c=d.name.toLowerCase();f=b.localeCompare(c);break}case"status":f=j[a.status]-j[d.status];break;case"lastSent":{let b=o(a.lastActivity,d.lastActivity);if(!a.lastActivity&&!d.lastActivity){f=0;break}if(!a.lastActivity)return 1;if(!d.lastActivity)return -1;f=b;break}default:f=0}return("updatedAt"===b||"lastSent"===b?"desc"===c:"asc"===c)?f:-f}),d}function u(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:t(d.get(a),b,c)}))}let v=null;function w(){return v??[]}function x(a){v=a}function y(a,b){if(0===b.length)return a.slice();let c=new Map(b.map((a,b)=>[a,b]));return a.slice().sort((a,b)=>{let d=c.has(a.repositoryName)?c.get(a.repositoryName):1/0,e=c.has(b.repositoryName)?c.get(b.repositoryName):1/0;return d===e?a.repositoryName.localeCompare(b.repositoryName):d-e})}function z(a,b){return"hidden"!==a&&("always"===a||!b)}},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))}},35914:(a,b,c)=>{"use strict";c.d(b,{oz:()=>d,tV:()=>e});function d(a){if(null==a||"object"!=typeof a)return!1;let{name:b,message:c}=a;return"ChunkLoadError"===b||"string"==typeof c&&(c.includes("Loading chunk")||c.includes("Failed to fetch dynamically imported module"))}function e(a){return"skipped"}},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},39800:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>h});var d=c(21124),e=c(38301),f=c(35914);let g={en:{chunkTitle:"Updating to the latest version",chunkDescription:"A newer version of CommandMate is available. Reloading to get the latest update…",genericTitle:"Something went wrong",genericDescription:"An unexpected error occurred. Please reload the page.",reload:"Reload"},ja:{chunkTitle:"最新バージョンに更新しています",chunkDescription:"CommandMate の新しいバージョンが利用可能です。最新の状態にするため再読み込みします…",genericTitle:"問題が発生しました",genericDescription:"予期しないエラーが発生しました。ページを再読み込みしてください。",reload:"再読み込み"}};function h({error:a}){let b=(0,f.oz)(a),[c,h]=(0,e.useState)("en"),i=g[c];return(0,d.jsx)("html",{lang:c,style:{colorScheme:"light dark"},children:(0,d.jsxs)("body",{style:{margin:0,minHeight:"100vh",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"1.5rem",padding:"1.5rem",textAlign:"center",background:"Canvas",color:"CanvasText",fontFamily:'system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif'},children:[(0,d.jsxs)("div",{style:{maxWidth:"24rem"},children:[(0,d.jsx)("h1",{style:{fontSize:"1.5rem",fontWeight:600,margin:"0 0 0.5rem"},children:b?i.chunkTitle:i.genericTitle}),(0,d.jsx)("p",{style:{fontSize:"0.875rem",opacity:.75,margin:0},children:b?i.chunkDescription:i.genericDescription})]}),(0,d.jsx)("button",{type:"button",onClick:()=>window.location.reload(),style:{appearance:"none",cursor:"pointer",borderRadius:"0.5rem",border:"1px solid currentColor",background:"transparent",color:"inherit",padding:"0.5rem 1rem",fontSize:"0.875rem",fontWeight:500},children:i.reload})]})})}},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))})})}},44164:(a,b,c)=>{Promise.resolve().then(c.bind(c,64182))},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,externalIsLoading:j,externalError:k,externalRefresh:l}){let m=void 0!==b,[n,o]=(0,e.useReducer)(i,h),p=(0,e.useCallback)(async()=>{if(!m){o({type:"SET_LOADING",isLoading:!0}),o({type:"SET_ERROR",error:null});try{let a=await f.y.getAll();o({type:"SET_WORKTREES",worktrees:a.worktrees}),o({type:"SET_REPOSITORIES",repositories:a.repositories??[]})}catch(a){o({type:"SET_ERROR",error:a instanceof Error?a.message:"Failed to fetch worktrees"})}}},[m]),q=(0,e.useCallback)(async a=>{o({type:"SELECT_WORKTREE",id:a}),o({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);o({type:"SET_WORKTREE_DETAIL",detail:b})}catch(a){o({type:"SET_ERROR",error:a instanceof Error?a.message:"Failed to fetch worktree detail"})}finally{o({type:"SET_LOADING_DETAIL",isLoadingDetail:!1})}},[]),r=(0,e.useCallback)(async()=>{if(m&&l)return void await l();await p()},[m,l,p]),s=m&&void 0!==j?j:n.isLoading,t=m&&k?k.message:null,u={selectedWorktreeId:n.selectedWorktreeId,worktrees:n.worktrees,repositories:n.repositories,selectedWorktreeDetail:n.selectedWorktreeDetail,isLoading:s,isLoadingDetail:n.isLoadingDetail,error:t??n.error,selectWorktree:q,refreshWorktrees:r};return(0,d.jsx)(g.Provider,{value:u,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}}},53906:(a,b,c)=>{Promise.resolve().then(c.bind(c,5682))},54834:(a,b,c)=>{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))},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:()=>k,rC:()=>m,Fn:()=>l});var d=c(21124),e=c(38301),f=c(78352),g=c(67619);let h=[2e3,5e3,1e4];var i=c(47817);let j=(0,e.createContext)(null);function k({children:a}){let{worktrees:b,repositories:c,isLoading:k,error:l,refresh:m}=function(){let[a,b]=(0,e.useState)([]),[c,d]=(0,e.useState)([]),[i,j]=(0,e.useState)(!0),[k,l]=(0,e.useState)(null),m=(0,e.useRef)(null),n=(0,e.useRef)([]),o=(0,e.useRef)(null),p=(0,e.useRef)(0),q=(0,e.useRef)(null),r=(0,e.useRef)(async()=>{}),s=(0,e.useCallback)(()=>{null!==q.current&&(clearTimeout(q.current),q.current=null)},[]),{connected:t,subscribe:u,unsubscribe:v,addListener:w}=(0,g.xM)(),x=(0,e.useRef)(t);x.current=t;let y=(0,e.useCallback)(async()=>{try{l(null);let a=await fetch("/api/worktrees"),c=(0,f.O0)(a);if(c)throw c;if(!a.ok)throw Error(`Failed to fetch worktrees: ${a.status}`);let g=(0,f.xd)(a);if(g)throw g;let h=await a.json(),i=h.worktrees??[],j=h.repositories??[];(0,e.startTransition)(()=>{b(i),d(j)}),n.current=i,p.current=0,s()}catch(c){let a=c instanceof Error?c:Error(String(c));console.error("[useWorktreesCache] Failed to fetch worktrees:",a),l(a);let b=p.current;0===n.current.length&&b<h.length&&(p.current=b+1,s(),q.current=setTimeout(()=>{q.current=null,r.current()},h[b]))}finally{j(!1)}},[s]);r.current=y;let z=(0,e.useCallback)(()=>n.current.some(a=>!0===a.isSessionRunning),[]),A=(0,e.useCallback)(()=>{let a=z();return x.current?a?2e4:6e4:a?5e3:3e4},[z]),B=(0,e.useCallback)(()=>{null!==m.current&&(clearInterval(m.current),m.current=null),o.current=null},[]);return(0,e.useCallback)(()=>{B();let a=A();o.current=a,m.current=setInterval(()=>{y()},a)},[A,y,B]),a.map(a=>a.id).sort().join(" "),{worktrees:a,repositories:c,isLoading:i,error:k,refresh:y}}(),n=(0,e.useMemo)(()=>({worktrees:b,repositories:c,isLoading:k,error:l,refresh:m}),[b,c,k,l,m]);return(0,d.jsx)(j.Provider,{value:n,children:(0,d.jsx)(i.H8,{externalWorktrees:b,externalRepositories:c,externalIsLoading:k,externalError:l,externalRefresh:m,children:a})})}function l(){let a=(0,e.useContext)(j);if(null===a)throw Error("useWorktreesCacheContext must be used within a WorktreesCacheProvider");return a}function m(){return(0,e.useContext)(j)}},63474:(a,b,c)=>{"use strict";c.d(b,{dj:()=>w,tE:()=>v});var d=c(21124),e=c(38301),f=c(23312),g=c(20481),h=c(75219),i=c(91292),j=c(16945),k=c(71117),l=c(47089),m=c(11010),n=c(58970),o=c(6074);let p=3e3;function q({type:a,iconColor:b}){let c=`h-5 w-5 ${b}`;switch(a){case"success":return(0,d.jsx)(h.A,{className:c,"data-testid":"toast-icon-success"});case"error":return(0,d.jsx)(i.A,{className:c,"data-testid":"toast-icon-error"});case"warning":return(0,d.jsx)(j.A,{className:c,"data-testid":"toast-icon-warning"});default:return(0,d.jsx)(k.A,{className:c,"data-testid":"toast-icon-info"})}}function r({id:a,message:b,type:c,onClose:f,duration:h=p,onClick:i}){let j=(0,g.c)("common"),k=(0,e.useRef)(null),m=function(a){switch(a){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"}}}(c),[r,s]=(0,e.useState)(!0),{shouldRender:t,isExiting:u}=(0,o.O)(r,n.Ys);(0,e.useRef)(f).current=f;let v=(0,e.useCallback)(()=>{k.current&&clearTimeout(k.current),s(!1)},[]);return(0,d.jsxs)("div",{"data-testid":`toast-${a}`,role:"alert",className:`
1
+ exports.id=9123,exports.ids=[9123],exports.modules={762:(a,b,c)=>{Promise.resolve().then(c.bind(c,96908))},1483:(a,b,c)=>{var d={"./en/keyboardShortcuts.json":[53722,1341],"./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},4267:(a,b,c)=>{"use strict";c.d(b,{Lt:()=>h,Wj:()=>f,eu:()=>e,fJ:()=>g});var d=c(17252);let e=2,f=6,g=["claude","codex","antigravity"];function h(a){return a.length<e||a.length>f?{valid:!1,error:`Must be ${e}-${f} elements`}:a.every(a=>"string"==typeof a&&d.XH.includes(a))?new Set(a).size!==a.length?{valid:!1,error:"Duplicate tool IDs not allowed"}:{valid:!0,value:a}:{valid:!1,error:"Invalid CLI tool ID"}}},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,t]=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`),c(18913)(`./${b}/skills.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,skills:t.default}}})},5682:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>d});let d=(0,c(97954).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/runner/work/CommandMate/CommandMate/src/app/error.tsx\" from the server, but it's 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/app/error.tsx","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,T4:()=>h,dz:()=>g,rz:()=>f,zS:()=>i});let d="client_version",e="version_mismatch",f="chat_turn_progress",g="messages_invalidated",h="model_changed";function i(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}},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}}},16730:(a,b,c)=>{"use strict";c.d(b,{BV:()=>n,Ct:()=>g,Hi:()=>d,K3:()=>e,PS:()=>l,SR:()=>f,T2:()=>j,Z3:()=>m,nk:()=>k});let d=0,e=8e3,f=2,g=2e4,h=[408,425,429,500,502,503,504],i=["GET","HEAD","OPTIONS"],j=3e4;function k(a){let b=(a??"GET").toUpperCase();return i.includes(b)}function l(a){return h.includes(a)}function m(a){return k(a)?1e4:3e4}function n(a,b=Math.random()){let c=Number.isFinite(a)&&a>0?Math.floor(a):0,d=Math.min(500*2**c,4e3);return Math.max(0,Math.round(d+.25*d*(2*b-1)))}},17252:(a,b,c)=>{"use strict";c.d(b,{Ab:()=>e,NL:()=>q,O6:()=>n,XH:()=>d,f_:()=>l,hR:()=>j,lu:()=>o,n6:()=>h,oo:()=>k,pQ:()=>f,sw:()=>m,vz:()=>p});let d=["claude","codex","gemini","vibe-local","opencode","copilot","antigravity","command-code"],e=10,f=50,g=/^[a-zA-Z0-9_-]+$/;function h(a){return"string"==typeof a&&a.length>0&&a.length<=64&&g.test(a)}let i={claude:"Claude",codex:"Codex",gemini:"Gemini","vibe-local":"Vibe Local",opencode:"OpenCode",copilot:"Copilot",antigravity:"Antigravity","command-code":"Command Code"};function j(a){return d.includes(a)}function k(a){return i[a]??a}function l(a,b="Assistant"){return a&&j(a)?k(a):b}function m(a){let b=a.alias;return"string"==typeof b&&b.trim().length>0?b:k(a.cliTool)}function n(a,b,c){let d=a.find(a=>a.id===b);return d?m(d):k(c)}function o(a){return a.map((a,b)=>({id:a,cliTool:a,alias:k(a),order:b}))}let p=128,q=2097152},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"})]})}},18608:(a,b,c)=>{"use strict";c.d(b,{W:()=>q,n:()=>r});var d=c(21124),e=c(38301),f=c(20481),g=c(16945),h=c(25345),i=c(47089),j=c(11010),k=c(74930),l=c(12055);let m=new Set;function n(a){return m.add(a),()=>{m.delete(a)}}function o(){return!1}function p(){return!1}function q(){return(0,e.useSyncExternalStore)(n,o,p)}function r(){let a=(0,f.c)("common"),[b,c]=(0,e.useState)(null),[m,n]=(0,e.useState)(null),o=(0,e.useCallback)(a=>{if(a.type!==l.Oo)return;let{serverVersion:b,clientVersion:d}=a;"string"==typeof b&&"string"==typeof d&&b&&d&&b!==m&&c({serverVersion:b,clientVersion:d})},[m]);(0,k.T3)(o);let p=(0,e.useCallback)(()=>{window.location.reload()},[]),q=(0,e.useCallback)(()=>{c(a=>(a&&n(a.serverVersion),null))},[]);return b?(0,d.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:j.M.TOAST},children:[(0,d.jsx)(g.A,{className:"h-5 w-5 shrink-0 mt-0.5","aria-hidden":"true"}),(0,d.jsxs)("div",{className:"flex flex-col gap-0.5 text-sm",children:[(0,d.jsx)("span",{className:"font-semibold",children:a("versionMismatch.title")}),(0,d.jsx)("span",{children:a("versionMismatch.description",{serverVersion:b.serverVersion,clientVersion:b.clientVersion})})]}),(0,d.jsxs)("button",{type:"button","data-testid":"version-mismatch-reload",onClick:p,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,d.jsx)(h.A,{className:"h-4 w-4","aria-hidden":"true"}),a("versionMismatch.reload")]}),(0,d.jsx)("button",{type:"button","data-testid":"version-mismatch-dismiss",onClick:q,"aria-label":a("versionMismatch.dismiss"),className:"shrink-0 hover:opacity-70 focus:outline-none focus:ring-2 focus:ring-offset-2",children:(0,d.jsx)(i.A,{className:"h-4 w-4","aria-hidden":"true"})})]}):null}},18913:(a,b,c)=>{var d={"./en/skills.json":[55064,5064],"./ja/skills.json":[20022,22]};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=18913,a.exports=e},19463:(a,b,c)=>{"use strict";c.d(b,{Kg:()=>f,Lv:()=>g});var d=c(38301),e=c(63157);function f(a){let b=0;for(let c of a)!0===c.isWaitingForResponse&&b++;return b}function g(){let a=(0,e.rC)(),b=a?.worktrees;return(0,d.useMemo)(()=>{let a=b?b.filter(a=>!0===a.isWaitingForResponse):[];return{count:a.length,worktrees:a}},[b])}},25754:(a,b,c)=>{"use strict";c.d(b,{Xn:()=>e,d9:()=>g,dI:()=>d,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,{BN:()=>y,EN:()=>g,LV:()=>n,PB:()=>i,Si:()=>f,UZ:()=>l,Xn:()=>t,ZC:()=>x,ZD:()=>w,_s:()=>u,fs:()=>z,j:()=>s,m3:()=>h,nO:()=>o,s6:()=>m,zD:()=>r});var d=c(89877);let e=["updatedAt","repositoryName","branchName","status","lastSent"],f=a=>e.includes(a),g=["always","collapsed","hidden"],h=a=>g.includes(a),i="collapsed",j={waiting:0,ready:1,running:2,generating:3,idle:4},k=["waiting","running","generating","ready","idle"];function l(a){let b=new Set;for(let c of a)!1===c.visible&&b.add(c.path);return b}function m(a,b){return 0===b.size?a.slice():a.filter(a=>{let c=a.repositoryPath;return!c||!b.has(c)})}function n(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 o(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 p(a){return a.cliStatus&&Object.keys(a.cliStatus).length>0?(0,d.A7)(a.cliStatus):a.status}function q(a){return"waiting"===p(a)}function r(a){let b=new Set(a.map(p));for(let a of k)if(b.has(a))return a;return"idle"}function s(a){let b=0;for(let c of a)q(c)&&b++;return b}function t(a,b,c){let d=[...a],e="status"!==b;return d.sort((a,d)=>{if(e){let b=Number(q(d))-Number(q(a));if(0!==b)return b}let f=0;switch(b){case"updatedAt":{let b=a=>a?a instanceof Date?a.getTime():new Date(a).getTime():0,c=b(a.lastActivity);f=b(d.lastActivity)-c;break}case"repositoryName":{let b=a.repositoryName.toLowerCase(),c=d.repositoryName.toLowerCase();f=b.localeCompare(c);break}case"branchName":{let b=a.name.toLowerCase(),c=d.name.toLowerCase();f=b.localeCompare(c);break}case"status":f=j[a.status]-j[d.status];break;case"lastSent":{let b=o(a.lastActivity,d.lastActivity);if(!a.lastActivity&&!d.lastActivity){f=0;break}if(!a.lastActivity)return 1;if(!d.lastActivity)return -1;f=b;break}default:f=0}return("updatedAt"===b||"lastSent"===b?"desc"===c:"asc"===c)?f:-f}),d}function u(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:t(d.get(a),b,c)}))}let v=null;function w(){return v??[]}function x(a){v=a}function y(a,b){if(0===b.length)return a.slice();let c=new Map(b.map((a,b)=>[a,b]));return a.slice().sort((a,b)=>{let d=c.has(a.repositoryName)?c.get(a.repositoryName):1/0,e=c.has(b.repositoryName)?c.get(b.repositoryName):1/0;return d===e?a.repositoryName.localeCompare(b.repositoryName):d-e})}function z(a,b){return"hidden"!==a&&("always"===a||!b)}},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))}},35914:(a,b,c)=>{"use strict";c.d(b,{$7:()=>f,oz:()=>d,tV:()=>e,v9:()=>g});function d(a){if(null==a||"object"!=typeof a)return!1;let{name:b,message:c}=a;return"ChunkLoadError"===b||"string"==typeof c&&(c.includes("Loading chunk")||c.includes("Failed to fetch dynamically imported module"))}function e(a){return"skipped"}function f(a,b){let c=!1,d=null,e=null,f=()=>{d?.(),e?.(),d=null,e=null},g=()=>{c||(c=!0,f(),a())};return d=b.subscribeOnline(()=>{c||b.probe().then(a=>{a&&g()})}),e=b.subscribeReachability(a=>{a&&g()}),()=>{c=!0,f()}}function g(a){return{subscribeOnline:a=>()=>{},subscribeReachability:a.subscribeReachability,probe:a.probe}}},36536:(a,b,c)=>{Promise.resolve().then(c.bind(c,80776))},38557:(a,b,c)=>{"use strict";c.d(b,{Fx:()=>o,Rh:()=>n,_X:()=>g,fl:()=>k,nG:()=>m,sV:()=>h});var d=c(38301),e=c(74930);let f="/api/capabilities";function g(a){return"connected"===a.realtimeStatus||!0===a.serverReachable}function h(a){return!1===a.browserOnline||!1===a.serverReachable}let i=new Map;async function j(a,b){let c="function"==typeof AbortController?new AbortController:void 0,d=c?setTimeout(()=>c.abort(),b):void 0;try{return await fetch(a,{method:"GET",cache:"no-store",credentials:"same-origin",signal:c?.signal}),!0}catch{return!1}finally{void 0!==d&&clearTimeout(d)}}function k(a=f,b=5e3){if("function"!=typeof fetch)return Promise.resolve(!1);let c=i.get(a);if(c)return c;let d=j(a,b).finally(()=>{i.delete(a)});return i.set(a,d),d}let l=new Set;function m(a){l.forEach(b=>{try{b(a)}catch{}})}function n(a){return l.add(a),()=>{l.delete(a)}}function o(a={}){let{probeUrl:b=f,probeDelayMs:c=1e3,probeIntervalMs:g=15e3,probeTimeoutMs:h=5e3,surfaceDelayMs:i=1500,probe:j=!0}=a,{status:l}=(0,e.xM)(),[m,n]=(0,d.useState)(!0),[p,q]=(0,d.useState)(null),[r,s]=(0,d.useState)(null),t=(0,d.useCallback)(a=>{q(b=>b===a?b:a),a&&s(Date.now())},[]),u=(0,d.useMemo)(()=>({browserOnline:m,realtimeStatus:l,serverReachable:p}),[m,l,p]),v=u.browserOnline?"connected"===u.realtimeStatus?"online":!1===u.serverReachable?"offline":!0===u.serverReachable||"connecting"===u.realtimeStatus?"reconnecting":"offline":"offline",w="online"!==v,x=(0,d.useRef)({url:b,timeoutMs:h});x.current={url:b,timeoutMs:h};let[y,z]=(0,d.useState)(!1),A=(0,d.useCallback)(()=>{if("function"!=typeof fetch)return;let{url:a,timeoutMs:b}=x.current;k(a,b).then(t)},[t]);return(0,d.useMemo)(()=>({status:v,isOnline:"online"===v,isReconnecting:"reconnecting"===v,isOffline:"offline"===v,shouldSurface:w&&y,signals:u,lastReachableAt:r,recheck:A}),[v,w,y,u,r,A])}},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},39800:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>h});var d=c(21124),e=c(38301),f=c(35914);c(38557);let g={en:{chunkTitle:"Updating to the latest version",chunkDescription:"A newer version of CommandMate is available. Reloading to get the latest update…",offlineTitle:"You're offline",offlineDescription:"Part of the page could not be loaded because the device is off the network. It will be retried automatically as soon as the connection is back.",offlineWaiting:"Waiting for the connection to come back…",genericTitle:"Something went wrong",genericDescription:"An unexpected error occurred. Please reload the page.",reload:"Reload",retry:"Retry"},ja:{chunkTitle:"最新バージョンに更新しています",chunkDescription:"CommandMate の新しいバージョンが利用可能です。最新の状態にするため再読み込みします…",offlineTitle:"接続が切れています",offlineDescription:"ネットワークに接続できないため、ページの一部を読み込めませんでした。接続が戻り次第、自動でやり直します。",offlineWaiting:"接続の回復を待っています…",genericTitle:"問題が発生しました",genericDescription:"予期しないエラーが発生しました。ページを再読み込みしてください。",reload:"再読み込み",retry:"再試行"}};function h({error:a,reset:b}){let c=(0,f.oz)(a),[h,i]=(0,e.useState)("en"),[j,k]=(0,e.useState)(!1),l=(0,e.useCallback)(()=>{j?b():window.location.reload()},[j,b]),m=g[h],n=j?m.offlineTitle:c?m.chunkTitle:m.genericTitle,o=j?m.offlineDescription:c?m.chunkDescription:m.genericDescription;return(0,d.jsx)("html",{lang:h,style:{colorScheme:"light dark"},children:(0,d.jsxs)("body",{"data-error-kind":j?"chunk-offline":c?"chunk-reload":"unexpected",style:{margin:0,minHeight:"100vh",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"1.5rem",padding:"1.5rem",textAlign:"center",background:"Canvas",color:"CanvasText",fontFamily:'system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif'},children:[(0,d.jsxs)("div",{style:{maxWidth:"24rem"},children:[(0,d.jsx)("h1",{style:{fontSize:"1.5rem",fontWeight:600,margin:"0 0 0.5rem"},children:n}),(0,d.jsx)("p",{style:{fontSize:"0.875rem",opacity:.75,margin:0},children:o}),j&&(0,d.jsx)("p",{role:"status","aria-live":"polite",style:{fontSize:"0.75rem",opacity:.6,margin:"0.5rem 0 0"},children:m.offlineWaiting})]}),(0,d.jsx)("button",{type:"button",onClick:l,style:{appearance:"none",cursor:"pointer",borderRadius:"0.5rem",border:"1px solid currentColor",background:"transparent",color:"inherit",padding:"0.5rem 1rem",fontSize:"0.875rem",fontWeight:500},children:j?m.retry:m.reload})]})})}},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))})})}},44164:(a,b,c)=>{Promise.resolve().then(c.bind(c,64182))},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,externalIsLoading:j,externalError:k,externalRefresh:l}){let m=void 0!==b,[n,o]=(0,e.useReducer)(i,h),p=(0,e.useCallback)(async()=>{if(!m){o({type:"SET_LOADING",isLoading:!0}),o({type:"SET_ERROR",error:null});try{let a=await f.y.getAll();o({type:"SET_WORKTREES",worktrees:a.worktrees}),o({type:"SET_REPOSITORIES",repositories:a.repositories??[]})}catch(a){o({type:"SET_ERROR",error:a instanceof Error?a.message:"Failed to fetch worktrees"})}}},[m]),q=(0,e.useCallback)(async a=>{o({type:"SELECT_WORKTREE",id:a}),o({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);o({type:"SET_WORKTREE_DETAIL",detail:b})}catch(a){o({type:"SET_ERROR",error:a instanceof Error?a.message:"Failed to fetch worktree detail"})}finally{o({type:"SET_LOADING_DETAIL",isLoadingDetail:!1})}},[]),r=(0,e.useCallback)(async()=>{if(m&&l)return void await l();await p()},[m,l,p]),s=m&&void 0!==j?j:n.isLoading,t=m&&k?k.message:null,u={selectedWorktreeId:n.selectedWorktreeId,worktrees:n.worktrees,repositories:n.repositories,selectedWorktreeDetail:n.selectedWorktreeDetail,isLoading:s,isLoadingDetail:n.isLoadingDetail,error:t??n.error,selectWorktree:q,refreshWorktrees:r};return(0,d.jsx)(g.Provider,{value:u,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}}},53906:(a,b,c)=>{Promise.resolve().then(c.bind(c,5682))},54834:(a,b,c)=>{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))},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:()=>k,rC:()=>m,Fn:()=>l});var d=c(21124),e=c(38301),f=c(78352),g=c(74930);let h=[2e3,5e3,1e4];var i=c(47817);let j=(0,e.createContext)(null);function k({children:a}){let{worktrees:b,repositories:c,isLoading:k,error:l,refresh:m}=function(){let[a,b]=(0,e.useState)([]),[c,d]=(0,e.useState)([]),[i,j]=(0,e.useState)(!0),[k,l]=(0,e.useState)(null),m=(0,e.useRef)(null),n=(0,e.useRef)([]),o=(0,e.useRef)(null),p=(0,e.useRef)(0),q=(0,e.useRef)(null),r=(0,e.useRef)(async()=>{}),s=(0,e.useCallback)(()=>{null!==q.current&&(clearTimeout(q.current),q.current=null)},[]),{connected:t,subscribe:u,unsubscribe:v,addListener:w}=(0,g.xM)(),x=(0,e.useRef)(t);x.current=t;let y=(0,e.useCallback)(async()=>{try{l(null);let a=await fetch("/api/worktrees"),c=(0,f.O0)(a);if(c)throw c;if(!a.ok)throw Error(`Failed to fetch worktrees: ${a.status}`);let g=(0,f.xd)(a);if(g)throw g;let h=await a.json(),i=h.worktrees??[],j=h.repositories??[];(0,e.startTransition)(()=>{b(i),d(j)}),n.current=i,p.current=0,s()}catch(c){let a=c instanceof Error?c:Error(String(c));console.error("[useWorktreesCache] Failed to fetch worktrees:",a),l(a);let b=p.current;0===n.current.length&&b<h.length&&(p.current=b+1,s(),q.current=setTimeout(()=>{q.current=null,r.current()},h[b]))}finally{j(!1)}},[s]);r.current=y;let z=(0,e.useCallback)(()=>n.current.some(a=>!0===a.isSessionRunning),[]),A=(0,e.useCallback)(()=>{let a=z();return x.current?a?2e4:6e4:a?5e3:3e4},[z]),B=(0,e.useCallback)(()=>{null!==m.current&&(clearInterval(m.current),m.current=null),o.current=null},[]);return(0,e.useCallback)(()=>{B();let a=A();o.current=a,m.current=setInterval(()=>{y()},a)},[A,y,B]),a.map(a=>a.id).sort().join(" "),{worktrees:a,repositories:c,isLoading:i,error:k,refresh:y}}(),n=(0,e.useMemo)(()=>({worktrees:b,repositories:c,isLoading:k,error:l,refresh:m}),[b,c,k,l,m]);return(0,d.jsx)(j.Provider,{value:n,children:(0,d.jsx)(i.H8,{externalWorktrees:b,externalRepositories:c,externalIsLoading:k,externalError:l,externalRefresh:m,children:a})})}function l(){let a=(0,e.useContext)(j);if(null===a)throw Error("useWorktreesCacheContext must be used within a WorktreesCacheProvider");return a}function m(){return(0,e.useContext)(j)}},63474:(a,b,c)=>{"use strict";c.d(b,{dj:()=>w,tE:()=>v});var d=c(21124),e=c(38301),f=c(23312),g=c(20481),h=c(75219),i=c(91292),j=c(16945),k=c(71117),l=c(47089),m=c(11010),n=c(58970),o=c(6074);let p=3e3;function q({type:a,iconColor:b}){let c=`h-5 w-5 ${b}`;switch(a){case"success":return(0,d.jsx)(h.A,{className:c,"data-testid":"toast-icon-success"});case"error":return(0,d.jsx)(i.A,{className:c,"data-testid":"toast-icon-error"});case"warning":return(0,d.jsx)(j.A,{className:c,"data-testid":"toast-icon-warning"});default:return(0,d.jsx)(k.A,{className:c,"data-testid":"toast-icon-info"})}}function r({id:a,message:b,type:c,onClose:f,duration:h=p,onClick:i}){let j=(0,g.c)("common"),k=(0,e.useRef)(null),m=function(a){switch(a){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"}}}(c),[r,s]=(0,e.useState)(!0),{shouldRender:t,isExiting:u}=(0,o.O)(r,n.Ys);(0,e.useRef)(f).current=f;let v=(0,e.useCallback)(()=>{k.current&&clearTimeout(k.current),s(!1)},[]);return(0,d.jsxs)("div",{"data-testid":`toast-${a}`,role:"alert",className:`
2
2
  ${m.bgColor}
3
3
  ${m.borderColor}
4
4
  ${m.textColor}
@@ -10,4 +10,4 @@ exports.id=9123,exports.ids=[9123],exports.modules={762:(a,b,c)=>{Promise.resolv
10
10
  hover:opacity-70
11
11
  focus:outline-none focus:ring-2 focus:ring-offset-2
12
12
  transition-opacity
13
- `,children:(0,d.jsx)(l.A,{className:"h-4 w-4"})})]})}function s({toasts:a,onClose:b}){let[c,g]=(0,e.useState)(!1),h=(0,d.jsx)("div",{"data-testid":"toast-container","aria-live":"polite",className:"fixed bottom-4 right-4 flex flex-col gap-2",style:{zIndex:m.M.TOAST},children:a.map(a=>(0,d.jsx)(r,{id:a.id,message:a.message,type:a.type,onClose:b,duration:a.duration,onClick:a.onClick},a.id))});return c?(0,f.createPortal)(h,document.body):null}function t(){let[a,b]=(0,e.useState)([]),c=(0,e.useRef)(0),d=(0,e.useCallback)((a,d="info",e=p,f)=>{let g=`toast-${++c.current}-${Date.now()}`,h={id:g,message:a,type:d,duration:e,...f?.onClick?{onClick:f.onClick}:{}};return b(a=>[...a,h]),g},[]),f=(0,e.useCallback)(a=>{b(b=>b.filter(b=>b.id!==a))},[]),g=(0,e.useCallback)(()=>{b([])},[]);return(0,e.useMemo)(()=>({toasts:a,showToast:d,removeToast:f,clearToasts:g}),[a,d,f,g])}let u=(0,e.createContext)(null);function v({children:a}){let b=t();return(0,d.jsxs)(u.Provider,{value:b,children:[a,(0,d.jsx)(s,{toasts:b.toasts,onClose:b.removeToast})]})}function w(){let a=(0,e.useContext)(u),b=t();return a??b}},64182:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>d});let d=(0,c(97954).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/runner/work/CommandMate/CommandMate/src/app/global-error.tsx\" from the server, but it's 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/app/global-error.tsx","default")},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}},67693:(a,b,c)=>{"use strict";c.d(b,{H:()=>g});var d=c(38301),e=c(67619),f=c(96823);function g(){let{addListener:a}=(0,e.xM)(),{enabled:b}=(0,f.Ql)();return(0,d.useRef)({enabled:b}).current={enabled:b},(0,d.useRef)(new Set),null}c(74132)},68132:(a,b,c)=>{Promise.resolve().then(c.bind(c,39800))},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},74132:(a,b,c)=>{"use strict";c.d(b,{dS:()=>k,rM:()=>l});var d=c(38301),e=c(42378),f=c(20481),g=c(63474),h=c(63157),i=c(67619),j=c(96823);function k(a,b,c){return`${a}|${b??"-"}|${c??"no-since"}`}function l(){let a=(0,f.c)("notifications"),{showToast:b}=(0,g.dj)(),{addListener:c}=(0,i.xM)(),{enabled:k}=(0,j.qG)(),l=(0,e.usePathname)(),m=(0,e.useRouter)(),n=(0,h.rC)();return(0,d.useRef)({enabled:k,pathname:l,worktrees:n?.worktrees,showToast:b,t:a,router:m}).current={enabled:k,pathname:l,worktrees:n?.worktrees,showToast:b,t:a,router:m},(0,d.useRef)(new Set),null}},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:()=>l,GQ:()=>n,O0:()=>f,Rx:()=>j,gC:()=>k,hD:()=>d,hS:()=>m,xd:()=>g,y:()=>i});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}}function f(a){return a.redirected&&(a.url??"").includes("/login")?new d("Authentication required",401):null}function g(a){return a.headers?(a.headers.get("content-type")||"").includes("application/json")?null:new d("Unexpected response format",a.status):null}async function h(a,b){try{let c=new Headers(b?.headers);c.set("Content-Type","application/json");let h=await fetch(a,{...b,headers:c}),i=f(h);if(i)throw i;if(!h.ok){let a=await e(h,{},"error-body");throw new d(a.error||`HTTP error ${h.status}`,h.status,a)}let j=g(h);if(j)throw j;return h.json()}catch(a){if(a instanceof d)throw a;throw new d(a instanceof Error?a.message:"Unknown error",0,a)}}let i={getAll:async()=>h("/api/worktrees"),getById:async a=>h(`/api/worktrees/${a}`),updateDescription:async(a,b)=>h(`/api/worktrees/${a}`,{method:"PATCH",body:JSON.stringify({description:b})}),updateLink:async(a,b)=>h(`/api/worktrees/${a}`,{method:"PATCH",body:JSON.stringify({link:b})}),toggleFavorite:async(a,b)=>h(`/api/worktrees/${a}`,{method:"PATCH",body:JSON.stringify({favorite:b})}),updateStatus:async(a,b)=>h(`/api/worktrees/${a}`,{method:"PATCH",body:JSON.stringify({status:b})}),updateCliTool:async(a,b)=>h(`/api/worktrees/${a}`,{method:"PATCH",body:JSON.stringify({cliToolId:b})}),markAsViewed:async a=>h(`/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)),h(`/api/worktrees/${a}/messages${e.toString()?`?${e.toString()}`:""}`)},async sendMessage(a,b,c){var d;let e={content:b};return c?.cliToolId&&(e.cliToolId=c.cliToolId),c?.instanceId&&(e.instanceId=c.instanceId),c?.imagePath&&(e.imagePath=c.imagePath),null===(d=await h(`/api/worktrees/${a}/send`,{method:"POST",body:JSON.stringify(e)}))||"object"!=typeof d||d.timestamp instanceof Date?d:{...d,timestamp:new Date(d.timestamp)}},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=>h(`/api/worktrees/${a}/logs`),async getLogFile(a,b,c){let d=c?.sanitize?"?sanitize=true":"";return h(`/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 h(`/api/worktrees/${a}/kill-session${e?`?${e}`:""}`,{method:"POST"})}},j={scan:async a=>h("/api/repositories/scan",{method:"POST",body:JSON.stringify({repositoryPath:a})}),sync:async()=>h("/api/repositories/sync",{method:"POST"}),delete:async a=>h("/api/repositories",{method:"DELETE",body:JSON.stringify({repositoryPath:a})}),clone:async(a,b)=>h("/api/repositories/clone",{method:"POST",body:JSON.stringify({cloneUrl:a,fork:b?.fork??!1})}),getCloneStatus:async a=>h(`/api/repositories/clone/${a}`),getExcluded:async()=>h("/api/repositories/excluded"),restore:async a=>h("/api/repositories/restore",{method:"PUT",body:JSON.stringify({repositoryPath:a})}),list:async()=>h("/api/repositories"),updateDisplayName:async(a,b)=>h(`/api/repositories/${encodeURIComponent(a)}`,{method:"PUT",body:JSON.stringify({displayName:b})}),updateVisibility:async(a,b)=>h(`/api/repositories/${encodeURIComponent(a)}`,{method:"PUT",body:JSON.stringify({visible:b})}),updateEnabled:async(a,b)=>h(`/api/repositories/${encodeURIComponent(a)}`,{method:"PUT",body:JSON.stringify({enabled:b})}),validatePath:async a=>h("/api/repositories/validate-path",{method:"POST",body:JSON.stringify({repositoryPath:a})})},k={async browse(a){let b=a?`?path=${encodeURIComponent(a)}`:"";return h(`/api/fs/browse${b}`)},addRecentPath:async a=>h("/api/fs/recent-paths",{method:"POST",body:JSON.stringify({path:a})})},l={getAll:async a=>(await h(`/api/worktrees/${a}/memos`)).memos,create:async(a,b)=>(await h(`/api/worktrees/${a}/memos`,{method:"POST",body:JSON.stringify(b||{})})).memo,update:async(a,b,c)=>(await h(`/api/worktrees/${a}/memos/${b}`,{method:"PUT",body:JSON.stringify(c)})).memo,delete:async(a,b)=>h(`/api/worktrees/${a}/memos/${b}`,{method:"DELETE"}),async reorder(a,b){await h(`/api/worktrees/${a}/memos`,{method:"PATCH",body:JSON.stringify({memoIds:b})})}};function m(a){return a instanceof d||a instanceof Error?a.message:"An unknown error occurred"}let n={checkForUpdate:async()=>h("/api/app/update-check",{method:"GET"}),startUpdate:async()=>h("/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:()=>z});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(63474),q=c(74132),r=c(67693),s=c(90102),t=c(38301),u=c(20481),v=c(25345),w=c(11010),x=c(18608);function y(){let a=(0,u.c)("pwa"),[b,c]=(0,t.useState)(null);(0,t.useRef)(!1);let e=(0,x.W)();return!b||e?null:(0,d.jsx)("div",{"data-testid":"pwa-update-toast",role:"status","aria-live":"polite",className:"pointer-events-none fixed bottom-0 right-0 flex max-w-full justify-end px-4 pb-safe",style:{zIndex:w.M.TOAST},children:(0,d.jsxs)("div",{"data-testid":"pwa-update-toast-card",className:"pointer-events-auto mb-4 flex items-center gap-3 rounded-lg border border-border bg-surface px-4 py-3 shadow-lg",children:[(0,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)(v.A,{className:"h-4 w-4"}),a("update.reload")]})]})})}function z({children:a,locale:b,messages:c,timeZone:t,authEnabled:u=!1}){return(0,d.jsx)(e.default,{locale:b,messages:c,timeZone:t,children:(0,d.jsx)(p.tE,{children:(0,d.jsx)(f.N,{attribute:"class",defaultTheme:"system",enableSystem:!0,children:(0,d.jsx)(h.O,{authEnabled:u,children:(0,d.jsx)(i.W5,{children:(0,d.jsx)(g.GB,{children:(0,d.jsx)(n.tS,{children:(0,d.jsxs)(l.g7,{children:[(0,d.jsx)(q.rM,{}),(0,d.jsx)(s.o,{}),(0,d.jsx)(r.H,{}),(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)(y,{})]})})})]})})})})})})})})}},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:()=>k,VF:()=>l,pT:()=>m});var d=c(21124),e=c(38301),f=c(32482);let g="updatedAt",h=(0,e.createContext)(null);function i(a,b,c,d){(0,e.useRef)(!0)}function j(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};case"SET_OPEN":return a.isOpen===b.isOpen?a:{...a,isOpen:b.isOpen};case"SET_REPOSITORY_ORDER":return{...a,repositoryOrder:b.repositoryOrder};case"SET_REPO_TAB_BAR_MODE":return{...a,repoTabBarMode:b.repoTabBarMode};default:return a}}function k({children:a,initialOpen:b=!0,initialWidth:c=224}){let[k,l]=(0,e.useReducer)(j,{isOpen:b,width:c,isMobileDrawerOpen:!1,sortKey:g,sortDirection:"desc",viewMode:"grouped",repositoryOrder:(0,f.ZD)(),repoTabBarMode:f.PB});i("mcbd-sidebar-sort",`${k.sortKey}:${k.sortDirection}`,()=>JSON.stringify({sortKey:k.sortKey,sortDirection:k.sortDirection}),a=>{try{let b=JSON.parse(a),c=b.sortDirection,d=(0,f.Si)(b.sortKey)?b.sortKey:g;d&&("asc"===c||"desc"===c)&&l({type:"LOAD_SORT_SETTINGS",sortKey:d,sortDirection:c})}catch{}}),i("mcbd-sidebar-view-mode",k.viewMode,()=>k.viewMode,a=>{("grouped"===a||"flat"===a)&&l({type:"SET_VIEW_MODE",viewMode:a})}),i("mcbd-sidebar-width",k.width,()=>String(k.width),a=>{let b=Number(a);!isNaN(b)&&b>0&&l({type:"SET_WIDTH",width:288===b?224:b})}),i("mcbd-sidebar-open",k.isOpen,()=>String(k.isOpen),a=>{("true"===a||"false"===a)&&l({type:"SET_OPEN",isOpen:"true"===a})}),i("mcbd-repo-tab-bar-mode",k.repoTabBarMode,()=>k.repoTabBarMode,a=>{(0,f.m3)(a)&&l({type:"SET_REPO_TAB_BAR_MODE",repoTabBarMode:a})});let m=(0,e.useCallback)(()=>{l({type:"TOGGLE"})},[]),n=(0,e.useCallback)(a=>{l({type:"SET_WIDTH",width:a})},[]),o=(0,e.useCallback)(()=>{l({type:"OPEN_MOBILE_DRAWER"})},[]),p=(0,e.useCallback)(()=>{l({type:"CLOSE_MOBILE_DRAWER"})},[]),q=(0,e.useCallback)(a=>{l({type:"SET_SORT_KEY",sortKey:a})},[]),r=(0,e.useCallback)(a=>{l({type:"SET_SORT_DIRECTION",sortDirection:a})},[]),s=(0,e.useCallback)(a=>{l({type:"SET_VIEW_MODE",viewMode:a})},[]),t=(0,e.useCallback)(a=>{l({type:"SET_REPOSITORY_ORDER",repositoryOrder:a}),(0,f.ZC)(a)},[]),u=(0,e.useCallback)(a=>{l({type:"SET_REPO_TAB_BAR_MODE",repoTabBarMode:a})},[]),v=(0,e.useMemo)(()=>({isOpen:k.isOpen,width:k.width,isMobileDrawerOpen:k.isMobileDrawerOpen,sortKey:k.sortKey,sortDirection:k.sortDirection,toggle:m,setWidth:n,openMobileDrawer:o,closeMobileDrawer:p,setSortKey:q,setSortDirection:r,viewMode:k.viewMode,setViewMode:s,repositoryOrder:k.repositoryOrder,setRepositoryOrder:t,repoTabBarMode:k.repoTabBarMode,setRepoTabBarMode:u}),[k.isOpen,k.width,k.isMobileDrawerOpen,k.sortKey,k.sortDirection,k.viewMode,k.repositoryOrder,k.repoTabBarMode,m,n,o,p,q,r,s,t,u]);return(0,d.jsx)(h.Provider,{value:v,children:a})}function l(){let a=(0,e.useContext)(h);if(!a)throw Error("useSidebarContext must be used within a SidebarProvider");return a}function m(){return(0,e.useContext)(h)}},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)}},89877:(a,b,c)=>{"use strict";c.d(b,{A7:()=>j,kA:()=>f,f_:()=>m,dw:()=>k,XK:()=>n});var d=c(17252),e=c(89907);function f(a){return a?a.isWaitingForResponse?"waiting":a.isProcessing?"running":a.isRunning?"ready":"idle":"idle"}let g={start:"nextAction.start",sendMessage:"nextAction.sendMessage",approveReject:"nextAction.approveReject",replyToPrompt:"nextAction.replyToPrompt",checkStalled:"nextAction.checkStalled",running:"nextAction.running"};Object.values(g);let h="exited",i={idle:null,ready:"ready",running:"running",generating:"running",waiting:"waiting"};function j(a){if(!a)return"idle";let b=Object.values(a).filter(a=>void 0!==a);return 0===b.length?"idle":b.includes("waiting")?"waiting":b.includes("running")?"running":b.includes("generating")?"generating":b.includes("ready")?"ready":"idle"}function k(a,b,c){return a?Object.entries(a).map(([a,e])=>{let f=b?.[a]??(0,d.f_)(a,a),g=c?.(a);return`${f}: ${e??"idle"}${g?` (${g})`:""}`}).join(", "):""}let l=["prompt","menu","unclassified"];function m(a){let b=Object.values(a.sessionStatusByInstance??a.sessionStatusByCli??{}).filter(a=>void 0!==a),c=!1,d=new Set;for(let a of b)a.awaitingInstruction&&(c=!0),a.waitingKind&&d.add(a.waitingKind);return{waitingKind:l.find(a=>d.has(a))??null,awaitingInstruction:c}}function n(a){var b,c;let k=f(void 0!==a.isSessionRunning?{isRunning:a.isSessionRunning??!1,isWaitingForResponse:a.isWaitingForResponse??!1,isProcessing:a.isProcessing??!1}:void 0),l=!!a.lastAssistantMessageAt&&(!a.lastViewedAt||new Date(a.lastAssistantMessageAt)>new Date(a.lastViewedAt)),{cliStatus:n,cliStatusLabels:o,exitedInstanceIds:p}=function(a){let b={},c={},g=[],i=a.sessionStatusByInstance;if(!i){for(let i of a.selectedAgents??(0,e.sA)())b[i]=f(a.sessionStatusByCli?.[i]),c[i]=(0,d.oo)(i),a.sessionStatusByCli?.[i]?.sessionStatusReason===h&&g.push(i);return{cliStatus:b,cliStatusLabels:c,exitedInstanceIds:g}}let j=a.agentInstances&&a.agentInstances.length>0?a.agentInstances:(0,d.lu)(a.selectedAgents??(0,e.sA)()),k=new Set;for(let a of j)k.add(a.id),b[a.id]=f(i[a.id]),c[a.id]=(0,d.sw)(a),i[a.id]?.sessionStatusReason===h&&g.push(a.id);for(let[a,e]of Object.entries(i)){if(k.has(a))continue;let g=f(e);"idle"!==g&&(b[a]=g,c[a]=function(a){let b=d.XH.find(b=>a.startsWith(`${b}-`));if(b){let c=a.slice(b.length+1);return`${(0,d.oo)(b)} ${c}`}return(0,d.f_)(a,a)}(a))}return{cliStatus:b,cliStatusLabels:c,exitedInstanceIds:g}}(a),q=j(n),{waitingKind:r,awaitingInstruction:s}=m(a);return{id:a.id,name:a.name,repositoryName:a.repositoryDisplayName??a.repositoryName,status:k,hasUnread:l,lastActivity:a.updatedAt,description:a.description,cliStatus:n,cliStatusLabels:o,exitedInstanceIds:p,worktreePath:a.path,waitingKind:r,awaitingInstruction:s,nextActionKey:(b=i[q],c="waiting"===q?"approval":null,b&&"idle"!==b?"ready"===b?g.sendMessage:"waiting"===b&&"approval"===c?g.approveReject:"waiting"===b?g.replyToPrompt:(0,g.running):g.start)}}},89907:(a,b,c)=>{"use strict";c.d(b,{IK:()=>i,qD:()=>l,sA:()=>h,zk:()=>e});var d=c(4267);let e="/api/settings/default-agents",f=d.fJ,g=new Set;function h(){return f}function i(a){if(!Array.isArray(a))return!1;let b=(0,d.Lt)(a);if(!b.valid)return!1;let c=b.value;if(c.length===f.length&&c.every((a,b)=>a===f[b]))return!1;for(let a of(f=c,g))a();return!0}let j=null,k=!1;async function l(){return k?f:j||("function"!=typeof fetch?f:j=(async()=>{try{let a=await fetch(e);if(a.ok){let b=await a.json();i(b?.defaultSelectedAgents),k=!0}}catch{}finally{j=null}return 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}},90102:(a,b,c)=>{"use strict";c.d(b,{o:()=>f});var d=c(38301),e=c(19463);function f(){return!function(){let{count:a}=(0,e.Lv)();(0,d.useRef)([]),(0,d.useRef)(null)}(),null}},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},91786:(a,b,c)=>{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))},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)}},96823:(a,b,c)=>{"use strict";c.d(b,{Ql:()=>f,qG:()=>e});var d=c(38301);function e(){let[a,b]=(0,d.useState)(!0);return{enabled:a,setEnabled:(0,d.useCallback)(a=>{b(a)},[])}}function f(){let[a,b]=(0,d.useState)(!1);return{enabled:a,setEnabled:(0,d.useCallback)(a=>{b(a)},[])}}},96908:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>g});var d=c(21124);c(38301);var e=c(20481),f=c(35914);function g({error:a,reset:b}){let c=(0,e.c)("error"),g=(0,e.c)("common"),h=(0,f.oz)(a);return(0,d.jsxs)("main",{className:"flex min-h-screen flex-col items-center justify-center gap-6 bg-background px-6 pt-safe pb-safe text-center",children:[(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsx)("h1",{className:"text-2xl font-semibold text-foreground",children:c(h?"chunkReload.title":"unexpected.title")}),(0,d.jsx)("p",{className:"mx-auto max-w-sm text-sm text-muted-foreground",children:c(h?"chunkReload.description":"unexpected.description")})]}),(0,d.jsx)("button",{type:"button",onClick:h?()=>window.location.reload():b,className:"rounded-lg bg-accent-600 px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-accent-700",children:g(h?"reload":"retry")})]})}},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}};
13
+ `,children:(0,d.jsx)(l.A,{className:"h-4 w-4"})})]})}function s({toasts:a,onClose:b}){let[c,g]=(0,e.useState)(!1),h=(0,d.jsx)("div",{"data-testid":"toast-container","aria-live":"polite",className:"fixed bottom-4 right-4 flex flex-col gap-2",style:{zIndex:m.M.TOAST},children:a.map(a=>(0,d.jsx)(r,{id:a.id,message:a.message,type:a.type,onClose:b,duration:a.duration,onClick:a.onClick},a.id))});return c?(0,f.createPortal)(h,document.body):null}function t(){let[a,b]=(0,e.useState)([]),c=(0,e.useRef)(0),d=(0,e.useCallback)((a,d="info",e=p,f)=>{let g=`toast-${++c.current}-${Date.now()}`,h={id:g,message:a,type:d,duration:e,...f?.onClick?{onClick:f.onClick}:{}};return b(a=>[...a,h]),g},[]),f=(0,e.useCallback)(a=>{b(b=>b.filter(b=>b.id!==a))},[]),g=(0,e.useCallback)(()=>{b([])},[]);return(0,e.useMemo)(()=>({toasts:a,showToast:d,removeToast:f,clearToasts:g}),[a,d,f,g])}let u=(0,e.createContext)(null);function v({children:a}){let b=t();return(0,d.jsxs)(u.Provider,{value:b,children:[a,(0,d.jsx)(s,{toasts:b.toasts,onClose:b.removeToast})]})}function w(){let a=(0,e.useContext)(u),b=t();return a??b}},64182:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>d});let d=(0,c(97954).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/runner/work/CommandMate/CommandMate/src/app/global-error.tsx\" from the server, but it's 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/app/global-error.tsx","default")},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},67693:(a,b,c)=>{"use strict";c.d(b,{H:()=>g});var d=c(38301),e=c(74930),f=c(96823);function g(){let{addListener:a}=(0,e.xM)(),{enabled:b}=(0,f.Ql)();return(0,d.useRef)({enabled:b}).current={enabled:b},(0,d.useRef)(new Set),null}c(74132)},68132:(a,b,c)=>{Promise.resolve().then(c.bind(c,39800))},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},74132:(a,b,c)=>{"use strict";c.d(b,{dS:()=>k,rM:()=>l});var d=c(38301),e=c(42378),f=c(20481),g=c(63474),h=c(63157),i=c(74930),j=c(96823);function k(a,b,c){return`${a}|${b??"-"}|${c??"no-since"}`}function l(){let a=(0,f.c)("notifications"),{showToast:b}=(0,g.dj)(),{addListener:c}=(0,i.xM)(),{enabled:k}=(0,j.qG)(),l=(0,e.usePathname)(),m=(0,e.useRouter)(),n=(0,h.rC)();return(0,d.useRef)({enabled:k,pathname:l,worktrees:n?.worktrees,showToast:b,t:a,router:m}).current={enabled:k,pathname:l,worktrees:n?.worktrees,showToast:b,t:a,router:m},(0,d.useRef)(new Set),null}},74930:(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,livenessTimeout:h=75e3,livenessCheckInterval:i=5e3,enabled:j=!0}=a,[k,l]=(0,e.useState)("disconnected"),m=(0,e.useRef)(null),n=(0,e.useRef)(null),o=(0,e.useRef)(0),p=(0,e.useRef)(new Set),q=(0,e.useRef)(!1);(0,e.useRef)(0);let r=(0,e.useRef)(()=>{});(0,e.useRef)(b).current=b;let s=(0,e.useRef)(c);s.current=c;let t=(0,e.useCallback)(a=>{l(a),s.current?.(a)},[]),u=(0,e.useCallback)(()=>{null!==n.current&&(clearTimeout(n.current),n.current=null)},[]),v=(0,e.useCallback)(()=>{if(q.current||!d||"undefined"!=typeof document&&"hidden"===document.visibilityState)return;u();let a=function(a,b,c,d=Math.random){return Math.max(0,Math.round(Math.min(b*2**Math.max(0,a),c)*(1+(2*d()-1)*.2)))}(o.current,f,g);o.current+=1,n.current=setTimeout(()=>{n.current=null,r.current()},a)},[d,f,g,u]);r.current=(0,e.useCallback)(()=>{},[j,t,u,v]),(0,e.useCallback)(()=>{let a=m.current;if(a){a.onopen=null,a.onmessage=null,a.onerror=null,a.onclose=null,m.current=null;try{a.close(4001,"half-open")}catch{}t("disconnected"),v()}},[t,v]),(0,e.useCallback)(()=>{if(u(),q.current=!0,m.current){try{m.current.close(1e3,"Client disconnect")}catch{}m.current=null}},[u]);let w=(0,e.useCallback)(a=>{let b=m.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:k,subscribe:(0,e.useCallback)(a=>{p.current.has(a)||(p.current.add(a),w({type:"subscribe",worktreeId:a}))},[w]),unsubscribe:(0,e.useCallback)(a=>{p.current.has(a)&&(p.current.delete(a),w({type:"unsubscribe",worktreeId:a}))},[w]),send:w}}({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}},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:()=>s,E:()=>n,GQ:()=>u,O0:()=>h,Rx:()=>q,gC:()=>r,hD:()=>f,hS:()=>t,xd:()=>i,y:()=>p});var d=c(16730),e=c(38557);class f extends Error{constructor(a,b,c,d){super(a),this.status=b,this.data=c,this.name="ApiError",this.kind=d??(b>0?"http":"network")}}async function g(a,b,c){if(!(a.headers.get("content-type")||"").includes("application/json"))return b;try{return await a.json()}catch{return b}}function h(a){return a.redirected&&(a.url??"").includes("/login")?new f("Authentication required",401):null}function i(a){return a.headers?(a.headers.get("content-type")||"").includes("application/json")?null:new f("Unexpected response format",a.status):null}let j=null;function k(a){let b=Date.now();null!==j&&j.reachable===a&&b-j.at<d.T2||(j={reachable:a,at:b},(0,e.nG)(a))}async function l(a,b,c){let d=b.signal??void 0;if(d?.aborted)throw new f("Request aborted",0,void 0,"aborted");if(c<=0||"function"!=typeof AbortController)return fetch(a,b);let e=new AbortController,g=!1,h=setTimeout(()=>{g=!0,e.abort()},c),i=()=>e.abort();d?.addEventListener("abort",i);try{return await fetch(a,{...b,signal:e.signal})}catch(a){if(d?.aborted)throw new f("Request aborted",0,a,"aborted");if(g)throw new f(`Request timed out after ${c}ms`,0,a,"timeout");throw a}finally{clearTimeout(h),d?.removeEventListener("abort",i)}}function m(a){return new Promise(b=>setTimeout(b,a))}async function n(a,b){let{timeoutMs:c,retries:e,...g}=b??{},h=(g.method??"GET").toUpperCase(),i=(0,d.nk)(h)?Math.max(0,e??d.SR):0,j=void 0===c?(0,d.Z3)(h):c??d.Hi,n=Date.now(),o=a=>a<i&&Date.now()-n<d.Ct;for(let b=0;;b++){if("undefined"!=typeof navigator&&!1===navigator.onLine)throw new f("No network connection",0,void 0,"offline");try{let c=await l(a,g,j);if(k(!0),(0,d.PS)(c.status)&&o(b)){await m((0,d.BV)(b));continue}return c}catch(c){let a=function(a){if(a instanceof f)return a;let b=a instanceof Error?a.name:"";return"AbortError"===b||"TimeoutError"===b?new f("Request aborted",0,a,"aborted"):new f(a instanceof Error?a.message:"Unknown error",0,a,"network")}(c);if("aborted"===a.kind||(k(!1),!o(b)))throw a;await m((0,d.BV)(b))}}}async function o(a,b){try{let c=new Headers(b?.headers);c.set("Content-Type","application/json");let d=await n(a,{...b,headers:c}),e=h(d);if(e)throw e;if(!d.ok){let a=await g(d,{},"error-body");throw new f(a.error||`HTTP error ${d.status}`,d.status,a)}let j=i(d);if(j)throw j;return d.json()}catch(a){if(a instanceof f)throw a;throw new f(a instanceof Error?a.message:"Unknown error",0,a)}}let p={getAll:async()=>o("/api/worktrees"),getById:async a=>o(`/api/worktrees/${a}`),updateDescription:async(a,b)=>o(`/api/worktrees/${a}`,{method:"PATCH",body:JSON.stringify({description:b})}),updateLink:async(a,b)=>o(`/api/worktrees/${a}`,{method:"PATCH",body:JSON.stringify({link:b})}),toggleFavorite:async(a,b)=>o(`/api/worktrees/${a}`,{method:"PATCH",body:JSON.stringify({favorite:b})}),updateStatus:async(a,b)=>o(`/api/worktrees/${a}`,{method:"PATCH",body:JSON.stringify({status:b})}),updateCliTool:async(a,b)=>o(`/api/worktrees/${a}`,{method:"PATCH",body:JSON.stringify({cliToolId:b})}),markAsViewed:async a=>o(`/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)),o(`/api/worktrees/${a}/messages${e.toString()?`?${e.toString()}`:""}`)},async sendMessage(a,b,c){var d;let e={content:b};return c?.cliToolId&&(e.cliToolId=c.cliToolId),c?.instanceId&&(e.instanceId=c.instanceId),c?.imagePath&&(e.imagePath=c.imagePath),null===(d=await o(`/api/worktrees/${a}/send`,{method:"POST",body:JSON.stringify(e)}))||"object"!=typeof d||d.timestamp instanceof Date?d:{...d,timestamp:new Date(d.timestamp)}},async uploadImageFile(a,b){let c=Date.now(),d=`${c}-${b.name}`,e=".commandmate/attachments",f=new FormData;f.append("file",new File([b],d,{type:b.type}));let h=await fetch(`/api/worktrees/${a}/upload/${e}`,{method:"POST",body:f});if(!h.ok){let a=await g(h,{},"error-body");throw Error(a?.error?.message||`Upload failed (HTTP ${h.status})`)}return{path:(await g(h,{},"response-body")).path||`${e}/${d}`}},getLogs:async a=>o(`/api/worktrees/${a}/logs`),async getLogFile(a,b,c){let d=c?.sanitize?"?sanitize=true":"";return o(`/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 o(`/api/worktrees/${a}/kill-session${e?`?${e}`:""}`,{method:"POST"})}},q={scan:async a=>o("/api/repositories/scan",{method:"POST",body:JSON.stringify({repositoryPath:a})}),sync:async()=>o("/api/repositories/sync",{method:"POST"}),delete:async a=>o("/api/repositories",{method:"DELETE",body:JSON.stringify({repositoryPath:a})}),clone:async(a,b)=>o("/api/repositories/clone",{method:"POST",body:JSON.stringify({cloneUrl:a,fork:b?.fork??!1})}),getCloneStatus:async a=>o(`/api/repositories/clone/${a}`),getExcluded:async()=>o("/api/repositories/excluded"),restore:async a=>o("/api/repositories/restore",{method:"PUT",body:JSON.stringify({repositoryPath:a})}),list:async()=>o("/api/repositories"),updateDisplayName:async(a,b)=>o(`/api/repositories/${encodeURIComponent(a)}`,{method:"PUT",body:JSON.stringify({displayName:b})}),updateVisibility:async(a,b)=>o(`/api/repositories/${encodeURIComponent(a)}`,{method:"PUT",body:JSON.stringify({visible:b})}),updateEnabled:async(a,b)=>o(`/api/repositories/${encodeURIComponent(a)}`,{method:"PUT",body:JSON.stringify({enabled:b})}),validatePath:async a=>o("/api/repositories/validate-path",{method:"POST",body:JSON.stringify({repositoryPath:a})})},r={async browse(a){let b=a?`?path=${encodeURIComponent(a)}`:"";return o(`/api/fs/browse${b}`)},addRecentPath:async a=>o("/api/fs/recent-paths",{method:"POST",body:JSON.stringify({path:a})})},s={getAll:async a=>(await o(`/api/worktrees/${a}/memos`)).memos,create:async(a,b)=>(await o(`/api/worktrees/${a}/memos`,{method:"POST",body:JSON.stringify(b||{})})).memo,update:async(a,b,c)=>(await o(`/api/worktrees/${a}/memos/${b}`,{method:"PUT",body:JSON.stringify(c)})).memo,delete:async(a,b)=>o(`/api/worktrees/${a}/memos/${b}`,{method:"DELETE"}),async reorder(a,b){await o(`/api/worktrees/${a}/memos`,{method:"PATCH",body:JSON.stringify({memoIds:b})})}};function t(a){return a instanceof f||a instanceof Error?a.message:"An unknown error occurred"}let u={checkForUpdate:async()=>o("/api/app/update-check",{method:"GET"}),startUpdate:async()=>o("/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:()=>z});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(74930),o=c(79782),p=c(63474),q=c(74132),r=c(67693),s=c(90102),t=c(38301),u=c(20481),v=c(25345),w=c(11010),x=c(18608);function y(){let a=(0,u.c)("pwa"),[b,c]=(0,t.useState)(null);(0,t.useRef)(!1);let e=(0,x.W)();return!b||e?null:(0,d.jsx)("div",{"data-testid":"pwa-update-toast",role:"status","aria-live":"polite",className:"pointer-events-none fixed bottom-0 right-0 flex max-w-full justify-end px-4 pb-safe",style:{zIndex:w.M.TOAST},children:(0,d.jsxs)("div",{"data-testid":"pwa-update-toast-card",className:"pointer-events-auto mb-4 flex items-center gap-3 rounded-lg border border-border bg-surface px-4 py-3 shadow-lg",children:[(0,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)(v.A,{className:"h-4 w-4"}),a("update.reload")]})]})})}function z({children:a,locale:b,messages:c,timeZone:t,authEnabled:u=!1}){return(0,d.jsx)(e.default,{locale:b,messages:c,timeZone:t,children:(0,d.jsx)(p.tE,{children:(0,d.jsx)(f.N,{attribute:"class",defaultTheme:"system",enableSystem:!0,children:(0,d.jsx)(h.O,{authEnabled:u,children:(0,d.jsx)(i.W5,{children:(0,d.jsx)(g.GB,{children:(0,d.jsx)(n.tS,{children:(0,d.jsxs)(l.g7,{children:[(0,d.jsx)(q.rM,{}),(0,d.jsx)(s.o,{}),(0,d.jsx)(r.H,{}),(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)(y,{})]})})})]})})})})})})})})}},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:()=>k,VF:()=>l,pT:()=>m});var d=c(21124),e=c(38301),f=c(32482);let g="updatedAt",h=(0,e.createContext)(null);function i(a,b,c,d){(0,e.useRef)(!0)}function j(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};case"SET_OPEN":return a.isOpen===b.isOpen?a:{...a,isOpen:b.isOpen};case"SET_REPOSITORY_ORDER":return{...a,repositoryOrder:b.repositoryOrder};case"SET_REPO_TAB_BAR_MODE":return{...a,repoTabBarMode:b.repoTabBarMode};default:return a}}function k({children:a,initialOpen:b=!0,initialWidth:c=224}){let[k,l]=(0,e.useReducer)(j,{isOpen:b,width:c,isMobileDrawerOpen:!1,sortKey:g,sortDirection:"desc",viewMode:"grouped",repositoryOrder:(0,f.ZD)(),repoTabBarMode:f.PB});i("mcbd-sidebar-sort",`${k.sortKey}:${k.sortDirection}`,()=>JSON.stringify({sortKey:k.sortKey,sortDirection:k.sortDirection}),a=>{try{let b=JSON.parse(a),c=b.sortDirection,d=(0,f.Si)(b.sortKey)?b.sortKey:g;d&&("asc"===c||"desc"===c)&&l({type:"LOAD_SORT_SETTINGS",sortKey:d,sortDirection:c})}catch{}}),i("mcbd-sidebar-view-mode",k.viewMode,()=>k.viewMode,a=>{("grouped"===a||"flat"===a)&&l({type:"SET_VIEW_MODE",viewMode:a})}),i("mcbd-sidebar-width",k.width,()=>String(k.width),a=>{let b=Number(a);!isNaN(b)&&b>0&&l({type:"SET_WIDTH",width:288===b?224:b})}),i("mcbd-sidebar-open",k.isOpen,()=>String(k.isOpen),a=>{("true"===a||"false"===a)&&l({type:"SET_OPEN",isOpen:"true"===a})}),i("mcbd-repo-tab-bar-mode",k.repoTabBarMode,()=>k.repoTabBarMode,a=>{(0,f.m3)(a)&&l({type:"SET_REPO_TAB_BAR_MODE",repoTabBarMode:a})});let m=(0,e.useCallback)(()=>{l({type:"TOGGLE"})},[]),n=(0,e.useCallback)(a=>{l({type:"SET_WIDTH",width:a})},[]),o=(0,e.useCallback)(()=>{l({type:"OPEN_MOBILE_DRAWER"})},[]),p=(0,e.useCallback)(()=>{l({type:"CLOSE_MOBILE_DRAWER"})},[]),q=(0,e.useCallback)(a=>{l({type:"SET_SORT_KEY",sortKey:a})},[]),r=(0,e.useCallback)(a=>{l({type:"SET_SORT_DIRECTION",sortDirection:a})},[]),s=(0,e.useCallback)(a=>{l({type:"SET_VIEW_MODE",viewMode:a})},[]),t=(0,e.useCallback)(a=>{l({type:"SET_REPOSITORY_ORDER",repositoryOrder:a}),(0,f.ZC)(a)},[]),u=(0,e.useCallback)(a=>{l({type:"SET_REPO_TAB_BAR_MODE",repoTabBarMode:a})},[]),v=(0,e.useMemo)(()=>({isOpen:k.isOpen,width:k.width,isMobileDrawerOpen:k.isMobileDrawerOpen,sortKey:k.sortKey,sortDirection:k.sortDirection,toggle:m,setWidth:n,openMobileDrawer:o,closeMobileDrawer:p,setSortKey:q,setSortDirection:r,viewMode:k.viewMode,setViewMode:s,repositoryOrder:k.repositoryOrder,setRepositoryOrder:t,repoTabBarMode:k.repoTabBarMode,setRepoTabBarMode:u}),[k.isOpen,k.width,k.isMobileDrawerOpen,k.sortKey,k.sortDirection,k.viewMode,k.repositoryOrder,k.repoTabBarMode,m,n,o,p,q,r,s,t,u]);return(0,d.jsx)(h.Provider,{value:v,children:a})}function l(){let a=(0,e.useContext)(h);if(!a)throw Error("useSidebarContext must be used within a SidebarProvider");return a}function m(){return(0,e.useContext)(h)}},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)}},89877:(a,b,c)=>{"use strict";c.d(b,{A7:()=>j,kA:()=>f,f_:()=>m,dw:()=>k,XK:()=>n});var d=c(17252),e=c(89907);function f(a){return a?a.isWaitingForResponse?"waiting":a.isProcessing?"running":a.isRunning?"ready":"idle":"idle"}let g={start:"nextAction.start",sendMessage:"nextAction.sendMessage",approveReject:"nextAction.approveReject",replyToPrompt:"nextAction.replyToPrompt",checkStalled:"nextAction.checkStalled",running:"nextAction.running"};Object.values(g);let h="exited",i={idle:null,ready:"ready",running:"running",generating:"running",waiting:"waiting"};function j(a){if(!a)return"idle";let b=Object.values(a).filter(a=>void 0!==a);return 0===b.length?"idle":b.includes("waiting")?"waiting":b.includes("running")?"running":b.includes("generating")?"generating":b.includes("ready")?"ready":"idle"}function k(a,b,c){return a?Object.entries(a).map(([a,e])=>{let f=b?.[a]??(0,d.f_)(a,a),g=c?.(a);return`${f}: ${e??"idle"}${g?` (${g})`:""}`}).join(", "):""}let l=["prompt","menu","unclassified"];function m(a){let b=Object.values(a.sessionStatusByInstance??a.sessionStatusByCli??{}).filter(a=>void 0!==a),c=!1,d=new Set;for(let a of b)a.awaitingInstruction&&(c=!0),a.waitingKind&&d.add(a.waitingKind);return{waitingKind:l.find(a=>d.has(a))??null,awaitingInstruction:c}}function n(a){var b,c;let k=f(void 0!==a.isSessionRunning?{isRunning:a.isSessionRunning??!1,isWaitingForResponse:a.isWaitingForResponse??!1,isProcessing:a.isProcessing??!1}:void 0),l=!!a.lastAssistantMessageAt&&(!a.lastViewedAt||new Date(a.lastAssistantMessageAt)>new Date(a.lastViewedAt)),{cliStatus:n,cliStatusLabels:o,exitedInstanceIds:p}=function(a){let b={},c={},g=[],i=a.sessionStatusByInstance;if(!i){for(let i of a.selectedAgents??(0,e.sA)())b[i]=f(a.sessionStatusByCli?.[i]),c[i]=(0,d.oo)(i),a.sessionStatusByCli?.[i]?.sessionStatusReason===h&&g.push(i);return{cliStatus:b,cliStatusLabels:c,exitedInstanceIds:g}}let j=a.agentInstances&&a.agentInstances.length>0?a.agentInstances:(0,d.lu)(a.selectedAgents??(0,e.sA)()),k=new Set;for(let a of j)k.add(a.id),b[a.id]=f(i[a.id]),c[a.id]=(0,d.sw)(a),i[a.id]?.sessionStatusReason===h&&g.push(a.id);for(let[a,e]of Object.entries(i)){if(k.has(a))continue;let g=f(e);"idle"!==g&&(b[a]=g,c[a]=function(a){let b=d.XH.find(b=>a.startsWith(`${b}-`));if(b){let c=a.slice(b.length+1);return`${(0,d.oo)(b)} ${c}`}return(0,d.f_)(a,a)}(a))}return{cliStatus:b,cliStatusLabels:c,exitedInstanceIds:g}}(a),q=j(n),{waitingKind:r,awaitingInstruction:s}=m(a);return{id:a.id,name:a.name,repositoryName:a.repositoryDisplayName??a.repositoryName,status:k,hasUnread:l,lastActivity:a.updatedAt,description:a.description,cliStatus:n,cliStatusLabels:o,exitedInstanceIds:p,worktreePath:a.path,waitingKind:r,awaitingInstruction:s,nextActionKey:(b=i[q],c="waiting"===q?"approval":null,b&&"idle"!==b?"ready"===b?g.sendMessage:"waiting"===b&&"approval"===c?g.approveReject:"waiting"===b?g.replyToPrompt:(0,g.running):g.start)}}},89907:(a,b,c)=>{"use strict";c.d(b,{IK:()=>i,qD:()=>l,sA:()=>h,zk:()=>e});var d=c(4267);let e="/api/settings/default-agents",f=d.fJ,g=new Set;function h(){return f}function i(a){if(!Array.isArray(a))return!1;let b=(0,d.Lt)(a);if(!b.valid)return!1;let c=b.value;if(c.length===f.length&&c.every((a,b)=>a===f[b]))return!1;for(let a of(f=c,g))a();return!0}let j=null,k=!1;async function l(){return k?f:j||("function"!=typeof fetch?f:j=(async()=>{try{let a=await fetch(e);if(a.ok){let b=await a.json();i(b?.defaultSelectedAgents),k=!0}}catch{}finally{j=null}return 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}},90102:(a,b,c)=>{"use strict";c.d(b,{o:()=>f});var d=c(38301),e=c(19463);function f(){return!function(){let{count:a}=(0,e.Lv)();(0,d.useRef)([]),(0,d.useRef)(null)}(),null}},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},91786:(a,b,c)=>{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))},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)}},96823:(a,b,c)=>{"use strict";c.d(b,{Ql:()=>f,qG:()=>e});var d=c(38301);function e(){let[a,b]=(0,d.useState)(!0);return{enabled:a,setEnabled:(0,d.useCallback)(a=>{b(a)},[])}}function f(){let[a,b]=(0,d.useState)(!1);return{enabled:a,setEnabled:(0,d.useCallback)(a=>{b(a)},[])}}},96908:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>h});var d=c(21124),e=c(38301),f=c(20481),g=c(35914);function h({error:a,reset:b}){let c=(0,f.c)("error"),h=(0,f.c)("common"),i=(0,g.oz)(a),[j,k]=(0,e.useState)(!1),l=c(j?"chunkOffline.title":i?"chunkReload.title":"unexpected.title"),m=c(j?"chunkOffline.description":i?"chunkReload.description":"unexpected.description");return(0,d.jsxs)("main",{"data-testid":"app-error","data-error-kind":j?"chunk-offline":i?"chunk-reload":"unexpected",className:"flex min-h-screen flex-col items-center justify-center gap-6 bg-background px-6 pt-safe pb-safe text-center",children:[(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsx)("h1",{className:"text-2xl font-semibold text-foreground",children:l}),(0,d.jsx)("p",{className:"mx-auto max-w-sm text-sm text-muted-foreground",children:m}),j&&(0,d.jsx)("p",{className:"mx-auto max-w-sm text-xs text-muted-foreground",role:"status","aria-live":"polite",children:c("chunkOffline.waiting")})]}),(0,d.jsx)("button",{type:"button",onClick:i&&!j?()=>window.location.reload():b,className:"rounded-lg bg-accent-600 px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-accent-700",children:h(i&&!j?"reload":"retry")})]})}c(38557)},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}};
@@ -17,11 +17,11 @@
17
17
  "wasm": [],
18
18
  "assets": [],
19
19
  "env": {
20
- "__NEXT_BUILD_ID": "oDWX0JcwfhUYrMnnqDWVC",
21
- "NEXT_SERVER_ACTIONS_ENCRYPTION_KEY": "YRGwTaArUsNkPqrtXupbFI5bTCIybHRpBE7dHnrP7gc=",
22
- "__NEXT_PREVIEW_MODE_ID": "c75bd8c76a6d2110fd6791c1cebb1fde",
23
- "__NEXT_PREVIEW_MODE_SIGNING_KEY": "925d7e42a1608fe7bf0579a420aa753700fb33b33882b9f483ba2e4f37021ee5",
24
- "__NEXT_PREVIEW_MODE_ENCRYPTION_KEY": "33bf65f3d8eca17e7169efd01ba3897cac87423521a510398ffa85a4aa828c86"
20
+ "__NEXT_BUILD_ID": "0vChXhzA5YWj3f0D6A-Cn",
21
+ "NEXT_SERVER_ACTIONS_ENCRYPTION_KEY": "fWYDEMjIlp9WQvwQZ/0o6RDb6O5TfeJKzSKrjJJ1Mjw=",
22
+ "__NEXT_PREVIEW_MODE_ID": "36ebc18bcbf952cfa776b881b5a1f249",
23
+ "__NEXT_PREVIEW_MODE_SIGNING_KEY": "2f87508b5d756a6526e7c7563ff594b47c4c346f65ab8baddebeef2b87f91238",
24
+ "__NEXT_PREVIEW_MODE_ENCRYPTION_KEY": "c5cfa44c7b64a8f8b0d61573b2c263a7aa8b5de9d553475cae8a610ef1a54e11"
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-1dc9eb5ebb4fa5ff.js" defer=""></script><script src="/_next/static/chunks/framework-eaf13c96191cb608.js" defer=""></script><script src="/_next/static/chunks/main-ac91ed6e71380841.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/oDWX0JcwfhUYrMnnqDWVC/_buildManifest.js" defer=""></script><script src="/_next/static/oDWX0JcwfhUYrMnnqDWVC/_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":"oDWX0JcwfhUYrMnnqDWVC","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-1dc9eb5ebb4fa5ff.js" defer=""></script><script src="/_next/static/chunks/framework-eaf13c96191cb608.js" defer=""></script><script src="/_next/static/chunks/main-ac91ed6e71380841.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/0vChXhzA5YWj3f0D6A-Cn/_buildManifest.js" defer=""></script><script src="/_next/static/0vChXhzA5YWj3f0D6A-Cn/_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":"0vChXhzA5YWj3f0D6A-Cn","nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>
@@ -1 +1 @@
1
- {"node":{},"edge":{},"encryptionKey":"YRGwTaArUsNkPqrtXupbFI5bTCIybHRpBE7dHnrP7gc="}
1
+ {"node":{},"edge":{},"encryptionKey":"fWYDEMjIlp9WQvwQZ/0o6RDb6O5TfeJKzSKrjJJ1Mjw="}
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2407],{52407:(e,t,n)=>{n.d(t,{Fx:()=>h,Rh:()=>b,_X:()=>c,fl:()=>s,nG:()=>d,sV:()=>o});var r=n(12115),u=n(60199);let l="/api/capabilities";function c(e){return"connected"===e.realtimeStatus||!0===e.serverReachable}function o(e){return!1===e.browserOnline||!1===e.serverReachable}let i=new Map;async function a(e,t){let n="function"==typeof AbortController?new AbortController:void 0,r=n?setTimeout(()=>n.abort(),t):void 0;try{return await fetch(e,{method:"GET",cache:"no-store",credentials:"same-origin",signal:null==n?void 0:n.signal}),!0}catch(e){return!1}finally{void 0!==r&&clearTimeout(r)}}function s(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5e3;if("function"!=typeof fetch)return Promise.resolve(!1);let n=i.get(e);if(n)return n;let r=a(e,t).finally(()=>{i.delete(e)});return i.set(e,r),r}let f=new Set;function d(e){f.forEach(t=>{try{t(e)}catch(e){}})}function b(e){return f.add(e),()=>{f.delete(e)}}function h(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{probeUrl:t=l,probeDelayMs:n=1e3,probeIntervalMs:c=15e3,probeTimeoutMs:o=5e3,surfaceDelayMs:i=1500,probe:a=!0}=e,{status:f}=(0,u.xM)(),[d,h]=(0,r.useState)(!0),[v,y]=(0,r.useState)(null),[w,m]=(0,r.useState)(null),p=(0,r.useCallback)(e=>{y(t=>t===e?t:e),e&&m(Date.now())},[]);(0,r.useEffect)(()=>{if("undefined"==typeof navigator)return;h(!1!==navigator.onLine);let e=()=>{y(null),h(!0)},t=()=>h(!1);return window.addEventListener("online",e),window.addEventListener("offline",t),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",t)}},[]),(0,r.useEffect)(()=>{"connected"===f&&p(!0)},[f,p]),(0,r.useEffect)(()=>b(p),[p]);let g=(0,r.useMemo)(()=>({browserOnline:d,realtimeStatus:f,serverReachable:v}),[d,f,v]),S=g.browserOnline?"connected"===g.realtimeStatus?"online":!1===g.serverReachable?"offline":!0===g.serverReachable||"connecting"===g.realtimeStatus?"reconnecting":"offline":"offline",E="online"!==S,k=(0,r.useRef)({url:t,timeoutMs:o});k.current={url:t,timeoutMs:o};let C=a&&E&&d;(0,r.useEffect)(()=>{let e;if(!C||"function"!=typeof fetch)return;let t=!1,r=async()=>{let{url:n,timeoutMs:u}=k.current,l=await s(n,u);t||(p(l),e=setTimeout(r,c))};return e=setTimeout(r,n),()=>{t=!0,void 0!==e&&clearTimeout(e)}},[C,n,c,p]);let[R,T]=(0,r.useState)(!1);(0,r.useEffect)(()=>{if(!E)return void T(!1);if(i<=0)return void T(!0);let e=setTimeout(()=>T(!0),i);return()=>clearTimeout(e)},[E,i]);let M=(0,r.useCallback)(()=>{if("function"!=typeof fetch)return;let{url:e,timeoutMs:t}=k.current;s(e,t).then(p)},[p]);return(0,r.useMemo)(()=>({status:S,isOnline:"online"===S,isReconnecting:"reconnecting"===S,isOffline:"offline"===S,shouldSurface:E&&R,signals:g,lastReachableAt:w,recheck:M}),[S,E,R,g,w,M])}},52703:(e,t,n)=>{n.d(t,{Oo:()=>u,ST:()=>r,T4:()=>o,dz:()=>c,rz:()=>l,zS:()=>i});let r="client_version",u="version_mismatch",l="chat_turn_progress",c="messages_invalidated",o="model_changed";function i(e){let t;try{t=JSON.parse(e)}catch(e){return null}if(!t||"object"!=typeof t)return null;let n=t;if("broadcast"===n.type){let e=n.data;return e&&"object"==typeof e?"string"!=typeof e.type?null:(void 0===e.worktreeId&&"string"==typeof n.worktreeId&&(e.worktreeId=n.worktreeId),e):null}return"string"==typeof n.type?n:null}},60199:(e,t,n)=>{n.d(t,{tS:()=>s,xM:()=>f,T3:()=>d});var r=n(95155),u=n(12115),l=n(52703);function c(){return"undefined"!=typeof globalThis&&"function"==typeof globalThis.WebSocket?globalThis.WebSocket:null}let o=()=>{},i={status:"disconnected",connected:!1,subscribe:o,unsubscribe:o,addListener:()=>o},a=(0,u.createContext)(null);function s(e){let{children:t,enabled:n=!0}=e,o=(0,u.useRef)(new Set),i=(0,u.useRef)(new Map),{status:s,subscribe:f,unsubscribe:d}=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{onEvent:t,onStatusChange:n,autoReconnect:r=!0,reconnectBaseDelay:o=1e3,reconnectMaxDelay:i=3e4,livenessTimeout:a=75e3,livenessCheckInterval:s=5e3,enabled:f=!0}=e,[d,b]=(0,u.useState)("disconnected"),h=(0,u.useRef)(null),v=(0,u.useRef)(null),y=(0,u.useRef)(0),w=(0,u.useRef)(new Set),m=(0,u.useRef)(!1),p=(0,u.useRef)(0),g=(0,u.useRef)(()=>{}),S=(0,u.useRef)(t);S.current=t;let E=(0,u.useRef)(n);E.current=n;let k=(0,u.useCallback)(e=>{var t;b(e),null==(t=E.current)||t.call(E,e)},[]),C=(0,u.useCallback)(()=>{null!==v.current&&(clearTimeout(v.current),v.current=null)},[]),R=(0,u.useCallback)(()=>{if(m.current||!r||"undefined"!=typeof document&&"hidden"===document.visibilityState)return;C();let e=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Math.random;return Math.max(0,Math.round(Math.min(t*2**Math.max(0,e),n)*(1+(2*r()-1)*.2)))}(y.current,o,i);y.current+=1,v.current=setTimeout(()=>{v.current=null,g.current()},e)},[r,o,i,C]),T=(0,u.useCallback)(()=>{if(!f)return;let e=c();if(!e||h.current&&(h.current.readyState===e.OPEN||h.current.readyState===e.CONNECTING))return;C(),m.current=!1,p.current=Date.now(),k("connecting");let t="https:"===window.location.protocol?"wss:":"ws:",n=new e("".concat(t,"//").concat(window.location.host));h.current=n,n.onopen=()=>{y.current=0,p.current=Date.now(),k("connected");try{n.send(JSON.stringify({type:l.ST,version:"0.35.0"}))}catch(e){}w.current.forEach(e=>{try{n.send(JSON.stringify({type:"subscribe",worktreeId:e}))}catch(e){}})},n.onmessage=e=>{var t;p.current=Date.now();let n="string"==typeof e.data?e.data:String(e.data),r=(0,l.zS)(n);r&&"heartbeat"!==r.type&&(null==(t=S.current)||t.call(S,r))},n.onerror=()=>{k("error")},n.onclose=()=>{h.current=null,k("disconnected"),R()}},[f,k,C,R]);g.current=T;let M=(0,u.useCallback)(()=>{let e=h.current;if(e){e.onopen=null,e.onmessage=null,e.onerror=null,e.onclose=null,h.current=null;try{e.close(4001,"half-open")}catch(e){}k("disconnected"),R()}},[k,R]),O=(0,u.useCallback)(()=>{if(C(),m.current=!0,h.current){try{h.current.close(1e3,"Client disconnect")}catch(e){}h.current=null}},[C]),N=(0,u.useCallback)(e=>{let t=h.current,n=c();if(t&&n&&t.readyState===n.OPEN)try{t.send(JSON.stringify(e))}catch(e){}},[]),_=(0,u.useCallback)(e=>{w.current.has(e)||(w.current.add(e),N({type:"subscribe",worktreeId:e}))},[N]),L=(0,u.useCallback)(e=>{w.current.has(e)&&(w.current.delete(e),N({type:"unsubscribe",worktreeId:e}))},[N]);return(0,u.useEffect)(()=>{if(f)return T(),()=>{O()}},[f,T,O]),(0,u.useEffect)(()=>{if(!f)return;let e=setInterval(()=>{let e=h.current,t=c();e&&t&&e.readyState===t.OPEN&&(Date.now()-p.current<a||M())},s);return()=>clearInterval(e)},[f,a,s,M]),(0,u.useEffect)(()=>{if(!f||"undefined"==typeof document)return;let e=()=>{"visible"===document.visibilityState&&(h.current||(y.current=0,T()))};return document.addEventListener("visibilitychange",e),()=>document.removeEventListener("visibilitychange",e)},[f,T]),(0,u.useEffect)(()=>{if(!f)return;let e=()=>{h.current||(y.current=0,T())};return window.addEventListener("online",e),()=>window.removeEventListener("online",e)},[f,T]),{status:d,subscribe:_,unsubscribe:L,send:N}}({enabled:n,onEvent:(0,u.useCallback)(e=>{o.current.forEach(t=>{try{t(e)}catch(e){}})},[])}),b=(0,u.useCallback)(e=>{var t;let n=i.current,r=null!=(t=n.get(e))?t:0;n.set(e,r+1),0===r&&f(e)},[f]),h=(0,u.useCallback)(e=>{var t;let n=i.current,r=null!=(t=n.get(e))?t:0;r<=1?(n.delete(e),d(e)):n.set(e,r-1)},[d]),v=(0,u.useCallback)(e=>(o.current.add(e),()=>{o.current.delete(e)}),[]),y=(0,u.useMemo)(()=>({status:s,connected:"connected"===s,subscribe:b,unsubscribe:h,addListener:v}),[s,b,h,v]);return(0,r.jsx)(a.Provider,{value:y,children:t})}function f(){var e;return null!=(e=(0,u.useContext)(a))?e:i}function d(e){let{addListener:t}=f(),n=(0,u.useRef)(e);n.current=e,(0,u.useEffect)(()=>t(e=>n.current(e)),[t])}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4322],{72604:(e,t,n)=>{n.d(t,{dS:()=>f,rM:()=>s});var r=n(12115),l=n(20063),u=n(18955),i=n(94442),o=n(66966),a=n(63365),c=n(81978);function f(e,t,n){return"".concat(e,"|").concat(null!=t?t:"-","|").concat(null!=n?n:"no-since")}function s(){let e=(0,u.c)("notifications"),{showToast:t}=(0,i.dj)(),{addListener:n}=(0,a.xM)(),{enabled:s}=(0,c.qG)(),d=(0,l.usePathname)(),h=(0,l.useRouter)(),w=(0,o.rC)(),m=(0,r.useRef)({enabled:s,pathname:d,worktrees:null==w?void 0:w.worktrees,showToast:t,t:e,router:h});m.current={enabled:s,pathname:d,worktrees:null==w?void 0:w.worktrees,showToast:t,t:e,router:h};let p=(0,r.useRef)(new Set);return(0,r.useEffect)(()=>n(e=>{var t,n,r,l,u;if("session_status_changed"!==e.type)return;let i=e.worktreeId;if("string"!=typeof i||0===i.length)return;let o=e.isWaitingForResponse;if("boolean"!=typeof o)return;let a=null!=(r=e.instance)?r:null,c=null!=(l=e.waitingSince)?l:null;if(!o){let e="".concat(i,"|").concat(null!=a?a:"-","|");for(let t of p.current)t.startsWith(e)&&p.current.delete(t);return}let s=m.current;if(!s.enabled||function(e){if(!e)return null;let t=/^\/worktrees\/([^/]+)/.exec(e);if(!t)return null;try{return decodeURIComponent(t[1])}catch(e){return t[1]}}(s.pathname)===i)return;let d=f(i,a,c);if(p.current.has(d))return;p.current.size>=500&&p.current.clear(),p.current.add(d);let h=null!=(u=null==(n=s.worktrees)||null==(t=n.find(e=>e.id===i))?void 0:t.name)?u:i;s.showToast(s.t("inApp.waitingToast",{name:h}),"warning",8e3,{onClick:()=>s.router.push("/worktrees/".concat(encodeURIComponent(i)))})}),[n]),null}},79832:(e,t,n)=>{n.d(t,{o:()=>a});var r=n(12115),l=n(24373);let u=/^\(\d+\+?\)(?:\s+|$)/;function i(e){return e.replace(u,"").trim()}function o(e){return Array.from(e.querySelectorAll('link[rel~="icon"]'))}function a(){return!function(){let{count:e}=(0,l.Lv)(),t=(0,r.useRef)([]),n=(0,r.useRef)(null);(0,r.useEffect)(()=>{if("undefined"==typeof document)return;let t=()=>{let t=function(e,t){let n=i(e);if(!Number.isFinite(t)||t<=0)return n;let r="(".concat(Math.floor(t),")");return n?"".concat(r," ").concat(n):r}(document.title,e);t!==document.title&&(document.title=t)};t();let n=null;return"undefined"!=typeof MutationObserver&&document.head&&(n=new MutationObserver(t)).observe(document.head,{childList:!0,subtree:!0,characterData:!0}),()=>{null==n||n.disconnect();let e=i(document.title);e!==document.title&&(document.title=e)}},[e]),(0,r.useEffect)(()=>{if("undefined"==typeof document||e<=0)return;let r=t.current,l=()=>{let t=n.current,l=function(e){var t,n;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!Number.isFinite(e)||e<=0)return null;let l=null!=(t=r.document)?t:"undefined"!=typeof document?document:null;if(!l)return null;let u=null!=(n=r.size)?n:64;try{let t=l.createElement("canvas");t.width=u,t.height=u;let n=t.getContext("2d");if(!n)return null;n.clearRect(0,0,u,u),r.base?n.drawImage(r.base,0,0,u,u):(n.fillStyle="#111827",n.fillRect(0,0,u,u));let i=Math.floor(e)>9,o=.34*u,a=u-o-.03*u;n.beginPath(),n.arc(a,a,o,0,2*Math.PI),n.fillStyle=i?"#ef4444":"#f59e0b",n.fill(),n.lineWidth=.05*u,n.strokeStyle="rgba(0, 0, 0, 0.55)",n.stroke();let c=function(e){if(!Number.isFinite(e)||e<=0)return"";let t=Math.floor(e);return t>9?"".concat(9,"+"):String(t)}(e);return n.fillStyle=i?"#ffffff":"#1c1300",n.font="bold ".concat(Math.round(u*(c.length>1?.38:.48)),"px sans-serif"),n.textAlign="center",n.textBaseline="middle",n.fillText(c,a,a+.02*u),t.toDataURL("image/png")}catch(e){return null}}(e,{base:t&&t.complete&&t.naturalWidth>0?t:null,document});l&&function(e,t,n){let r=o(e);if(0===r.length){let t=e.createElement("link");t.setAttribute("rel","icon"),t.setAttribute("type","image/png"),e.head.appendChild(t),n.push({link:t,originalHref:null,created:!0}),r=[t]}for(let e of r)n.some(t=>t.link===e)||n.push({link:e,originalHref:e.getAttribute("href"),created:!1}),e.setAttribute("href",t)}(document,l,r)};l();let u=n.current;if(!u&&"undefined"!=typeof Image){let e=function(e,t){var n;for(let e of t)if(!e.created&&e.originalHref)return e.originalHref;let r=o(e).find(e=>e.getAttribute("href"));return null!=(n=null==r?void 0:r.getAttribute("href"))?n:null}(document,r);e&&(n.current=u=new Image,u.src=e)}let i=null;return u&&!(u.complete&&u.naturalWidth>0)?(i=()=>l(),u.addEventListener("load",i)):u&&l(),()=>{u&&i&&u.removeEventListener("load",i);for(let e of r){if(e.created){e.link.remove();continue}null===e.originalHref?e.link.removeAttribute("href"):e.link.setAttribute("href",e.originalHref)}r.length=0}},[e]),(0,r.useEffect)(()=>{!function(e,t){let n="undefined"!=typeof navigator?navigator:null;if(!n)return;let r=e=>{e&&"function"==typeof e.catch&&e.catch(()=>{})};try{if(Number.isFinite(e)&&e>0){if("function"!=typeof n.setAppBadge)return!1;return r(n.setAppBadge(Math.floor(e))),!0}if("function"!=typeof n.clearAppBadge)return!1;r(n.clearAppBadge())}catch(e){return!1}}(e)},[e])}(),null}},81978:(e,t,n)=>{n.d(t,{Ql:()=>a,qG:()=>i});var r=n(12115);let l="mcbd-inapp-waiting-toast",u="mcbd:inapp-notification-prefs-changed";function i(){let[e,t]=(0,r.useState)(!0);return(0,r.useEffect)(()=>{let e=()=>t(function(){try{let e=window.localStorage.getItem(l);if(null===e)return!0;return"false"!==e}catch(e){return!0}}());return e(),window.addEventListener(u,e),window.addEventListener("storage",e),()=>{window.removeEventListener(u,e),window.removeEventListener("storage",e)}},[]),{enabled:e,setEnabled:(0,r.useCallback)(e=>{t(e);try{window.localStorage.setItem(l,e?"true":"false")}catch(e){}window.dispatchEvent(new CustomEvent(u))},[])}}let o="mcbd-inapp-waiting-sound";function a(){let[e,t]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{let e=()=>t(function(){try{let e=window.localStorage.getItem(o);if(null===e)return!1;return"true"===e}catch(e){return!1}}());return e(),window.addEventListener(u,e),window.addEventListener("storage",e),()=>{window.removeEventListener(u,e),window.removeEventListener("storage",e)}},[]),{enabled:e,setEnabled:(0,r.useCallback)(e=>{t(e);try{window.localStorage.setItem(o,e?"true":"false")}catch(e){}window.dispatchEvent(new CustomEvent(u))},[])}}},95275:(e,t,n)=>{n.d(t,{H:()=>d});var r=n(12115),l=n(63365),u=n(81978),i=n(72604);let o=[{frequency:880,offset:0,duration:.12},{frequency:1318.5,offset:.13,duration:.18}],a=null;function c(){if(a)return a;let e=function(){var e,t;let n=window;return null!=(t=null!=(e=n.AudioContext)?e:n.webkitAudioContext)?t:null}();if(!e)return null;try{a=new e}catch(e){return null}return a}function f(e){e&&"function"==typeof e.catch&&e.catch(()=>{})}let s=["pointerdown","touchstart","keydown"];function d(){let{addListener:e}=(0,l.xM)(),{enabled:t}=(0,u.Ql)(),n=(0,r.useRef)({enabled:t});n.current={enabled:t};let a=(0,r.useRef)(new Set);return(0,r.useEffect)(()=>{let e=()=>(function(){let e=c();if(e)try{var t;"suspended"===e.state&&f(null==(t=e.resume)?void 0:t.call(e))}catch(e){}})();for(let t of s)window.addEventListener(t,e,{once:!0,passive:!0});return()=>{for(let t of s)window.removeEventListener(t,e)}},[]),(0,r.useEffect)(()=>e(e=>{var t,r;if("session_status_changed"!==e.type)return;let l=e.worktreeId;if("string"!=typeof l||0===l.length)return;let u=e.isWaitingForResponse;if("boolean"!=typeof u)return;let s=null!=(t=e.instance)?t:null,d=null!=(r=e.waitingSince)?r:null;if(!u){let e="".concat(l,"|").concat(null!=s?s:"-","|");for(let t of a.current)t.startsWith(e)&&a.current.delete(t);return}if(!n.current.enabled)return;let h=(0,i.dS)(l,s,d);a.current.has(h)||(a.current.size>=500&&a.current.clear(),a.current.add(h),function(){let e=c();if(e)try{var t,n;"suspended"===e.state&&f(null==(t=e.resume)?void 0:t.call(e));let r=null!=(n=e.currentTime)?n:0;for(let t of o){let n=e.createOscillator(),l=e.createGain();n.type="sine",n.frequency.value=t.frequency;let u=r+t.offset,i=u+t.duration;l.gain.setValueAtTime(0,u),l.gain.linearRampToValueAtTime(.12,u+.015),l.gain.linearRampToValueAtTime(1e-4,i),n.connect(l),l.connect(e.destination),n.start(u),n.stop(i+.02)}}catch(e){return!1}}())}),[e]),null}}}]);
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4322],{72604:(e,t,n)=>{n.d(t,{dS:()=>f,rM:()=>s});var r=n(12115),l=n(20063),u=n(18955),i=n(94442),o=n(66966),a=n(60199),c=n(81978);function f(e,t,n){return"".concat(e,"|").concat(null!=t?t:"-","|").concat(null!=n?n:"no-since")}function s(){let e=(0,u.c)("notifications"),{showToast:t}=(0,i.dj)(),{addListener:n}=(0,a.xM)(),{enabled:s}=(0,c.qG)(),d=(0,l.usePathname)(),h=(0,l.useRouter)(),w=(0,o.rC)(),m=(0,r.useRef)({enabled:s,pathname:d,worktrees:null==w?void 0:w.worktrees,showToast:t,t:e,router:h});m.current={enabled:s,pathname:d,worktrees:null==w?void 0:w.worktrees,showToast:t,t:e,router:h};let p=(0,r.useRef)(new Set);return(0,r.useEffect)(()=>n(e=>{var t,n,r,l,u;if("session_status_changed"!==e.type)return;let i=e.worktreeId;if("string"!=typeof i||0===i.length)return;let o=e.isWaitingForResponse;if("boolean"!=typeof o)return;let a=null!=(r=e.instance)?r:null,c=null!=(l=e.waitingSince)?l:null;if(!o){let e="".concat(i,"|").concat(null!=a?a:"-","|");for(let t of p.current)t.startsWith(e)&&p.current.delete(t);return}let s=m.current;if(!s.enabled||function(e){if(!e)return null;let t=/^\/worktrees\/([^/]+)/.exec(e);if(!t)return null;try{return decodeURIComponent(t[1])}catch(e){return t[1]}}(s.pathname)===i)return;let d=f(i,a,c);if(p.current.has(d))return;p.current.size>=500&&p.current.clear(),p.current.add(d);let h=null!=(u=null==(n=s.worktrees)||null==(t=n.find(e=>e.id===i))?void 0:t.name)?u:i;s.showToast(s.t("inApp.waitingToast",{name:h}),"warning",8e3,{onClick:()=>s.router.push("/worktrees/".concat(encodeURIComponent(i)))})}),[n]),null}},79832:(e,t,n)=>{n.d(t,{o:()=>a});var r=n(12115),l=n(24373);let u=/^\(\d+\+?\)(?:\s+|$)/;function i(e){return e.replace(u,"").trim()}function o(e){return Array.from(e.querySelectorAll('link[rel~="icon"]'))}function a(){return!function(){let{count:e}=(0,l.Lv)(),t=(0,r.useRef)([]),n=(0,r.useRef)(null);(0,r.useEffect)(()=>{if("undefined"==typeof document)return;let t=()=>{let t=function(e,t){let n=i(e);if(!Number.isFinite(t)||t<=0)return n;let r="(".concat(Math.floor(t),")");return n?"".concat(r," ").concat(n):r}(document.title,e);t!==document.title&&(document.title=t)};t();let n=null;return"undefined"!=typeof MutationObserver&&document.head&&(n=new MutationObserver(t)).observe(document.head,{childList:!0,subtree:!0,characterData:!0}),()=>{null==n||n.disconnect();let e=i(document.title);e!==document.title&&(document.title=e)}},[e]),(0,r.useEffect)(()=>{if("undefined"==typeof document||e<=0)return;let r=t.current,l=()=>{let t=n.current,l=function(e){var t,n;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!Number.isFinite(e)||e<=0)return null;let l=null!=(t=r.document)?t:"undefined"!=typeof document?document:null;if(!l)return null;let u=null!=(n=r.size)?n:64;try{let t=l.createElement("canvas");t.width=u,t.height=u;let n=t.getContext("2d");if(!n)return null;n.clearRect(0,0,u,u),r.base?n.drawImage(r.base,0,0,u,u):(n.fillStyle="#111827",n.fillRect(0,0,u,u));let i=Math.floor(e)>9,o=.34*u,a=u-o-.03*u;n.beginPath(),n.arc(a,a,o,0,2*Math.PI),n.fillStyle=i?"#ef4444":"#f59e0b",n.fill(),n.lineWidth=.05*u,n.strokeStyle="rgba(0, 0, 0, 0.55)",n.stroke();let c=function(e){if(!Number.isFinite(e)||e<=0)return"";let t=Math.floor(e);return t>9?"".concat(9,"+"):String(t)}(e);return n.fillStyle=i?"#ffffff":"#1c1300",n.font="bold ".concat(Math.round(u*(c.length>1?.38:.48)),"px sans-serif"),n.textAlign="center",n.textBaseline="middle",n.fillText(c,a,a+.02*u),t.toDataURL("image/png")}catch(e){return null}}(e,{base:t&&t.complete&&t.naturalWidth>0?t:null,document});l&&function(e,t,n){let r=o(e);if(0===r.length){let t=e.createElement("link");t.setAttribute("rel","icon"),t.setAttribute("type","image/png"),e.head.appendChild(t),n.push({link:t,originalHref:null,created:!0}),r=[t]}for(let e of r)n.some(t=>t.link===e)||n.push({link:e,originalHref:e.getAttribute("href"),created:!1}),e.setAttribute("href",t)}(document,l,r)};l();let u=n.current;if(!u&&"undefined"!=typeof Image){let e=function(e,t){var n;for(let e of t)if(!e.created&&e.originalHref)return e.originalHref;let r=o(e).find(e=>e.getAttribute("href"));return null!=(n=null==r?void 0:r.getAttribute("href"))?n:null}(document,r);e&&(n.current=u=new Image,u.src=e)}let i=null;return u&&!(u.complete&&u.naturalWidth>0)?(i=()=>l(),u.addEventListener("load",i)):u&&l(),()=>{u&&i&&u.removeEventListener("load",i);for(let e of r){if(e.created){e.link.remove();continue}null===e.originalHref?e.link.removeAttribute("href"):e.link.setAttribute("href",e.originalHref)}r.length=0}},[e]),(0,r.useEffect)(()=>{!function(e,t){let n="undefined"!=typeof navigator?navigator:null;if(!n)return;let r=e=>{e&&"function"==typeof e.catch&&e.catch(()=>{})};try{if(Number.isFinite(e)&&e>0){if("function"!=typeof n.setAppBadge)return!1;return r(n.setAppBadge(Math.floor(e))),!0}if("function"!=typeof n.clearAppBadge)return!1;r(n.clearAppBadge())}catch(e){return!1}}(e)},[e])}(),null}},81978:(e,t,n)=>{n.d(t,{Ql:()=>a,qG:()=>i});var r=n(12115);let l="mcbd-inapp-waiting-toast",u="mcbd:inapp-notification-prefs-changed";function i(){let[e,t]=(0,r.useState)(!0);return(0,r.useEffect)(()=>{let e=()=>t(function(){try{let e=window.localStorage.getItem(l);if(null===e)return!0;return"false"!==e}catch(e){return!0}}());return e(),window.addEventListener(u,e),window.addEventListener("storage",e),()=>{window.removeEventListener(u,e),window.removeEventListener("storage",e)}},[]),{enabled:e,setEnabled:(0,r.useCallback)(e=>{t(e);try{window.localStorage.setItem(l,e?"true":"false")}catch(e){}window.dispatchEvent(new CustomEvent(u))},[])}}let o="mcbd-inapp-waiting-sound";function a(){let[e,t]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{let e=()=>t(function(){try{let e=window.localStorage.getItem(o);if(null===e)return!1;return"true"===e}catch(e){return!1}}());return e(),window.addEventListener(u,e),window.addEventListener("storage",e),()=>{window.removeEventListener(u,e),window.removeEventListener("storage",e)}},[]),{enabled:e,setEnabled:(0,r.useCallback)(e=>{t(e);try{window.localStorage.setItem(o,e?"true":"false")}catch(e){}window.dispatchEvent(new CustomEvent(u))},[])}}},95275:(e,t,n)=>{n.d(t,{H:()=>d});var r=n(12115),l=n(60199),u=n(81978),i=n(72604);let o=[{frequency:880,offset:0,duration:.12},{frequency:1318.5,offset:.13,duration:.18}],a=null;function c(){if(a)return a;let e=function(){var e,t;let n=window;return null!=(t=null!=(e=n.AudioContext)?e:n.webkitAudioContext)?t:null}();if(!e)return null;try{a=new e}catch(e){return null}return a}function f(e){e&&"function"==typeof e.catch&&e.catch(()=>{})}let s=["pointerdown","touchstart","keydown"];function d(){let{addListener:e}=(0,l.xM)(),{enabled:t}=(0,u.Ql)(),n=(0,r.useRef)({enabled:t});n.current={enabled:t};let a=(0,r.useRef)(new Set);return(0,r.useEffect)(()=>{let e=()=>(function(){let e=c();if(e)try{var t;"suspended"===e.state&&f(null==(t=e.resume)?void 0:t.call(e))}catch(e){}})();for(let t of s)window.addEventListener(t,e,{once:!0,passive:!0});return()=>{for(let t of s)window.removeEventListener(t,e)}},[]),(0,r.useEffect)(()=>e(e=>{var t,r;if("session_status_changed"!==e.type)return;let l=e.worktreeId;if("string"!=typeof l||0===l.length)return;let u=e.isWaitingForResponse;if("boolean"!=typeof u)return;let s=null!=(t=e.instance)?t:null,d=null!=(r=e.waitingSince)?r:null;if(!u){let e="".concat(l,"|").concat(null!=s?s:"-","|");for(let t of a.current)t.startsWith(e)&&a.current.delete(t);return}if(!n.current.enabled)return;let h=(0,i.dS)(l,s,d);a.current.has(h)||(a.current.size>=500&&a.current.clear(),a.current.add(h),function(){let e=c();if(e)try{var t,n;"suspended"===e.state&&f(null==(t=e.resume)?void 0:t.call(e));let r=null!=(n=e.currentTime)?n:0;for(let t of o){let n=e.createOscillator(),l=e.createGain();n.type="sine",n.frequency.value=t.frequency;let u=r+t.offset,i=u+t.duration;l.gain.setValueAtTime(0,u),l.gain.linearRampToValueAtTime(.12,u+.015),l.gain.linearRampToValueAtTime(1e-4,i),n.connect(l),l.connect(e.destination),n.start(u),n.stop(i+.02)}}catch(e){return!1}}())}),[e]),null}}}]);