commandmate 0.24.0 → 0.26.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 (295) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-build-manifest.json +266 -266
  3. package/.next/app-path-routes-manifest.json +15 -15
  4. package/.next/build-manifest.json +5 -5
  5. package/.next/prerender-manifest.json +3 -3
  6. package/.next/react-loadable-manifest.json +3 -3
  7. package/.next/required-server-files.json +1 -1
  8. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  9. package/.next/server/app/api/app/update/route_client-reference-manifest.js +1 -1
  10. package/.next/server/app/api/app/update-check/route.js +1 -1
  11. package/.next/server/app/api/app/update-check/route_client-reference-manifest.js +1 -1
  12. package/.next/server/app/api/assistant/conversation/route_client-reference-manifest.js +1 -1
  13. package/.next/server/app/api/assistant/current-output/route_client-reference-manifest.js +1 -1
  14. package/.next/server/app/api/assistant/messages/route_client-reference-manifest.js +1 -1
  15. package/.next/server/app/api/assistant/session/route_client-reference-manifest.js +1 -1
  16. package/.next/server/app/api/assistant/start/route_client-reference-manifest.js +1 -1
  17. package/.next/server/app/api/assistant/terminal/route_client-reference-manifest.js +1 -1
  18. package/.next/server/app/api/assistant/tools/route_client-reference-manifest.js +1 -1
  19. package/.next/server/app/api/auth/login/route_client-reference-manifest.js +1 -1
  20. package/.next/server/app/api/auth/logout/route_client-reference-manifest.js +1 -1
  21. package/.next/server/app/api/auth/status/route_client-reference-manifest.js +1 -1
  22. package/.next/server/app/api/daily-summary/route_client-reference-manifest.js +1 -1
  23. package/.next/server/app/api/daily-summary/status/route_client-reference-manifest.js +1 -1
  24. package/.next/server/app/api/external-apps/[id]/health/route_client-reference-manifest.js +1 -1
  25. package/.next/server/app/api/external-apps/[id]/route_client-reference-manifest.js +1 -1
  26. package/.next/server/app/api/external-apps/route_client-reference-manifest.js +1 -1
  27. package/.next/server/app/api/fs/browse/route_client-reference-manifest.js +1 -1
  28. package/.next/server/app/api/fs/recent-paths/route_client-reference-manifest.js +1 -1
  29. package/.next/server/app/api/hooks/agent-event/route_client-reference-manifest.js +1 -1
  30. package/.next/server/app/api/hooks/claude-done/route_client-reference-manifest.js +1 -1
  31. package/.next/server/app/api/hooks/permission-request/route.js +1 -1
  32. package/.next/server/app/api/hooks/permission-request/route_client-reference-manifest.js +1 -1
  33. package/.next/server/app/api/metrics/vibe/route_client-reference-manifest.js +1 -1
  34. package/.next/server/app/api/ollama/models/route_client-reference-manifest.js +1 -1
  35. package/.next/server/app/api/push/escalation/route_client-reference-manifest.js +1 -1
  36. package/.next/server/app/api/push/subscriptions/route_client-reference-manifest.js +1 -1
  37. package/.next/server/app/api/push/vapid/route_client-reference-manifest.js +1 -1
  38. package/.next/server/app/api/repositories/[id]/route_client-reference-manifest.js +1 -1
  39. package/.next/server/app/api/repositories/[id]/todos/[todoId]/route_client-reference-manifest.js +1 -1
  40. package/.next/server/app/api/repositories/[id]/todos/route_client-reference-manifest.js +1 -1
  41. package/.next/server/app/api/repositories/clone/[jobId]/route_client-reference-manifest.js +1 -1
  42. package/.next/server/app/api/repositories/clone/route_client-reference-manifest.js +1 -1
  43. package/.next/server/app/api/repositories/excluded/route_client-reference-manifest.js +1 -1
  44. package/.next/server/app/api/repositories/restore/route_client-reference-manifest.js +1 -1
  45. package/.next/server/app/api/repositories/route_client-reference-manifest.js +1 -1
  46. package/.next/server/app/api/repositories/scan/route_client-reference-manifest.js +1 -1
  47. package/.next/server/app/api/repositories/sync/route_client-reference-manifest.js +1 -1
  48. package/.next/server/app/api/repositories/validate-path/route_client-reference-manifest.js +1 -1
  49. package/.next/server/app/api/sidebar/group-order/route_client-reference-manifest.js +1 -1
  50. package/.next/server/app/api/skills/[id]/route_client-reference-manifest.js +1 -1
  51. package/.next/server/app/api/skills/installations/route_client-reference-manifest.js +1 -1
  52. package/.next/server/app/api/skills/operations/route_client-reference-manifest.js +1 -1
  53. package/.next/server/app/api/skills/reindex/route_client-reference-manifest.js +1 -1
  54. package/.next/server/app/api/skills/route_client-reference-manifest.js +1 -1
  55. package/.next/server/app/api/slash-commands/route_client-reference-manifest.js +1 -1
  56. package/.next/server/app/api/tasks/[taskId]/cancel/route_client-reference-manifest.js +1 -1
  57. package/.next/server/app/api/tasks/[taskId]/route_client-reference-manifest.js +1 -1
  58. package/.next/server/app/api/templates/[id]/route_client-reference-manifest.js +1 -1
  59. package/.next/server/app/api/templates/route_client-reference-manifest.js +1 -1
  60. package/.next/server/app/api/todos/route_client-reference-manifest.js +1 -1
  61. package/.next/server/app/api/verification/runs/[runId]/route_client-reference-manifest.js +1 -1
  62. package/.next/server/app/api/verification/runs/route_client-reference-manifest.js +1 -1
  63. package/.next/server/app/api/worktrees/[id]/auto-yes/route_client-reference-manifest.js +1 -1
  64. package/.next/server/app/api/worktrees/[id]/capture/route_client-reference-manifest.js +1 -1
  65. package/.next/server/app/api/worktrees/[id]/cli-tool/route_client-reference-manifest.js +1 -1
  66. package/.next/server/app/api/worktrees/[id]/cmate/schedules/route_client-reference-manifest.js +1 -1
  67. package/.next/server/app/api/worktrees/[id]/current-output/route.js +1 -1
  68. package/.next/server/app/api/worktrees/[id]/current-output/route_client-reference-manifest.js +1 -1
  69. package/.next/server/app/api/worktrees/[id]/execution-logs/[logId]/route_client-reference-manifest.js +1 -1
  70. package/.next/server/app/api/worktrees/[id]/execution-logs/route_client-reference-manifest.js +1 -1
  71. package/.next/server/app/api/worktrees/[id]/files/[...path]/route_client-reference-manifest.js +1 -1
  72. package/.next/server/app/api/worktrees/[id]/git/branch/create/route_client-reference-manifest.js +1 -1
  73. package/.next/server/app/api/worktrees/[id]/git/branch/delete/route_client-reference-manifest.js +1 -1
  74. package/.next/server/app/api/worktrees/[id]/git/branches/route_client-reference-manifest.js +1 -1
  75. package/.next/server/app/api/worktrees/[id]/git/checkout/route_client-reference-manifest.js +1 -1
  76. package/.next/server/app/api/worktrees/[id]/git/commit/route_client-reference-manifest.js +1 -1
  77. package/.next/server/app/api/worktrees/[id]/git/diff/route_client-reference-manifest.js +1 -1
  78. package/.next/server/app/api/worktrees/[id]/git/fetch/route_client-reference-manifest.js +1 -1
  79. package/.next/server/app/api/worktrees/[id]/git/log/route_client-reference-manifest.js +1 -1
  80. package/.next/server/app/api/worktrees/[id]/git/pull/route_client-reference-manifest.js +1 -1
  81. package/.next/server/app/api/worktrees/[id]/git/push/route_client-reference-manifest.js +1 -1
  82. package/.next/server/app/api/worktrees/[id]/git/reset/route_client-reference-manifest.js +1 -1
  83. package/.next/server/app/api/worktrees/[id]/git/revert/route_client-reference-manifest.js +1 -1
  84. package/.next/server/app/api/worktrees/[id]/git/show/[commitHash]/route_client-reference-manifest.js +1 -1
  85. package/.next/server/app/api/worktrees/[id]/git/stage/route_client-reference-manifest.js +1 -1
  86. package/.next/server/app/api/worktrees/[id]/git/staged/route_client-reference-manifest.js +1 -1
  87. package/.next/server/app/api/worktrees/[id]/git/stash/[index]/route_client-reference-manifest.js +1 -1
  88. package/.next/server/app/api/worktrees/[id]/git/stash/apply/route_client-reference-manifest.js +1 -1
  89. package/.next/server/app/api/worktrees/[id]/git/stash/pop/route_client-reference-manifest.js +1 -1
  90. package/.next/server/app/api/worktrees/[id]/git/stash/push/route_client-reference-manifest.js +1 -1
  91. package/.next/server/app/api/worktrees/[id]/git/stash/route_client-reference-manifest.js +1 -1
  92. package/.next/server/app/api/worktrees/[id]/git/status/route_client-reference-manifest.js +1 -1
  93. package/.next/server/app/api/worktrees/[id]/git/unstage/route_client-reference-manifest.js +1 -1
  94. package/.next/server/app/api/worktrees/[id]/git/working-diff/route_client-reference-manifest.js +1 -1
  95. package/.next/server/app/api/worktrees/[id]/interrupt/route_client-reference-manifest.js +1 -1
  96. package/.next/server/app/api/worktrees/[id]/kill-session/route_client-reference-manifest.js +1 -1
  97. package/.next/server/app/api/worktrees/[id]/logs/[filename]/route_client-reference-manifest.js +1 -1
  98. package/.next/server/app/api/worktrees/[id]/logs/route_client-reference-manifest.js +1 -1
  99. package/.next/server/app/api/worktrees/[id]/marp-render/route_client-reference-manifest.js +1 -1
  100. package/.next/server/app/api/worktrees/[id]/memos/[memoId]/route_client-reference-manifest.js +1 -1
  101. package/.next/server/app/api/worktrees/[id]/memos/route_client-reference-manifest.js +1 -1
  102. package/.next/server/app/api/worktrees/[id]/messages/route_client-reference-manifest.js +1 -1
  103. package/.next/server/app/api/worktrees/[id]/prompt-response/route_client-reference-manifest.js +1 -1
  104. package/.next/server/app/api/worktrees/[id]/respond/route_client-reference-manifest.js +1 -1
  105. package/.next/server/app/api/worktrees/[id]/route_client-reference-manifest.js +1 -1
  106. package/.next/server/app/api/worktrees/[id]/schedules/[scheduleId]/route_client-reference-manifest.js +1 -1
  107. package/.next/server/app/api/worktrees/[id]/schedules/active/route_client-reference-manifest.js +1 -1
  108. package/.next/server/app/api/worktrees/[id]/schedules/route_client-reference-manifest.js +1 -1
  109. package/.next/server/app/api/worktrees/[id]/search/route_client-reference-manifest.js +1 -1
  110. package/.next/server/app/api/worktrees/[id]/send/route_client-reference-manifest.js +1 -1
  111. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route_client-reference-manifest.js +1 -1
  112. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/install/route_client-reference-manifest.js +1 -1
  113. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/plan/route_client-reference-manifest.js +1 -1
  114. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall/route_client-reference-manifest.js +1 -1
  115. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall-plan/route_client-reference-manifest.js +1 -1
  116. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/update/route_client-reference-manifest.js +1 -1
  117. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/update-plan/route_client-reference-manifest.js +1 -1
  118. package/.next/server/app/api/worktrees/[id]/skills/route_client-reference-manifest.js +1 -1
  119. package/.next/server/app/api/worktrees/[id]/slash-commands/route_client-reference-manifest.js +1 -1
  120. package/.next/server/app/api/worktrees/[id]/special-keys/route_client-reference-manifest.js +1 -1
  121. package/.next/server/app/api/worktrees/[id]/start-polling/route_client-reference-manifest.js +1 -1
  122. package/.next/server/app/api/worktrees/[id]/tasks/route_client-reference-manifest.js +1 -1
  123. package/.next/server/app/api/worktrees/[id]/terminal/route_client-reference-manifest.js +1 -1
  124. package/.next/server/app/api/worktrees/[id]/timers/history/route_client-reference-manifest.js +1 -1
  125. package/.next/server/app/api/worktrees/[id]/timers/route_client-reference-manifest.js +1 -1
  126. package/.next/server/app/api/worktrees/[id]/todos/[todoId]/route_client-reference-manifest.js +1 -1
  127. package/.next/server/app/api/worktrees/[id]/todos/route_client-reference-manifest.js +1 -1
  128. package/.next/server/app/api/worktrees/[id]/tree/[...path]/route_client-reference-manifest.js +1 -1
  129. package/.next/server/app/api/worktrees/[id]/tree/route_client-reference-manifest.js +1 -1
  130. package/.next/server/app/api/worktrees/[id]/upload/[...path]/route_client-reference-manifest.js +1 -1
  131. package/.next/server/app/api/worktrees/[id]/verify/route_client-reference-manifest.js +1 -1
  132. package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/route_client-reference-manifest.js +1 -1
  133. package/.next/server/app/api/worktrees/[id]/verify/runs/route_client-reference-manifest.js +1 -1
  134. package/.next/server/app/api/worktrees/[id]/viewed/route_client-reference-manifest.js +1 -1
  135. package/.next/server/app/api/worktrees/route_client-reference-manifest.js +1 -1
  136. package/.next/server/app/chat/page.js +2 -2
  137. package/.next/server/app/chat/page.js.nft.json +1 -1
  138. package/.next/server/app/chat/page_client-reference-manifest.js +1 -1
  139. package/.next/server/app/login/page.js +2 -2
  140. package/.next/server/app/login/page.js.nft.json +1 -1
  141. package/.next/server/app/login/page_client-reference-manifest.js +1 -1
  142. package/.next/server/app/manifest.webmanifest/route_client-reference-manifest.js +1 -1
  143. package/.next/server/app/more/page.js +2 -2
  144. package/.next/server/app/more/page.js.nft.json +1 -1
  145. package/.next/server/app/more/page_client-reference-manifest.js +1 -1
  146. package/.next/server/app/offline/page_client-reference-manifest.js +1 -1
  147. package/.next/server/app/page.js +1 -1
  148. package/.next/server/app/page.js.nft.json +1 -1
  149. package/.next/server/app/page_client-reference-manifest.js +1 -1
  150. package/.next/server/app/proxy/[...path]/route_client-reference-manifest.js +1 -1
  151. package/.next/server/app/repositories/page.js +2 -2
  152. package/.next/server/app/repositories/page.js.nft.json +1 -1
  153. package/.next/server/app/repositories/page_client-reference-manifest.js +1 -1
  154. package/.next/server/app/review/page.js +1 -1
  155. package/.next/server/app/review/page.js.nft.json +1 -1
  156. package/.next/server/app/review/page_client-reference-manifest.js +1 -1
  157. package/.next/server/app/sessions/page.js +1 -1
  158. package/.next/server/app/sessions/page.js.nft.json +1 -1
  159. package/.next/server/app/sessions/page_client-reference-manifest.js +1 -1
  160. package/.next/server/app/skills/[skillId]/page.js +2 -2
  161. package/.next/server/app/skills/[skillId]/page.js.nft.json +1 -1
  162. package/.next/server/app/skills/[skillId]/page_client-reference-manifest.js +1 -1
  163. package/.next/server/app/skills/installed/page.js +2 -2
  164. package/.next/server/app/skills/installed/page.js.nft.json +1 -1
  165. package/.next/server/app/skills/installed/page_client-reference-manifest.js +1 -1
  166. package/.next/server/app/skills/page.js +2 -2
  167. package/.next/server/app/skills/page.js.nft.json +1 -1
  168. package/.next/server/app/skills/page_client-reference-manifest.js +1 -1
  169. package/.next/server/app/worktrees/[id]/files/[...path]/page.js +2 -2
  170. package/.next/server/app/worktrees/[id]/files/[...path]/page.js.nft.json +1 -1
  171. package/.next/server/app/worktrees/[id]/files/[...path]/page_client-reference-manifest.js +1 -1
  172. package/.next/server/app/worktrees/[id]/page.js +6 -6
  173. package/.next/server/app/worktrees/[id]/page.js.nft.json +1 -1
  174. package/.next/server/app/worktrees/[id]/page_client-reference-manifest.js +1 -1
  175. package/.next/server/app/worktrees/[id]/terminal/page_client-reference-manifest.js +1 -1
  176. package/.next/server/app-paths-manifest.json +15 -15
  177. package/.next/server/chunks/2119.js +1 -1
  178. package/.next/server/chunks/2404.js +1 -1
  179. package/.next/server/chunks/2445.js +1 -1
  180. package/.next/server/chunks/3241.js +1 -1
  181. package/.next/server/chunks/3346.js +1 -1
  182. package/.next/server/chunks/4455.js +1 -1
  183. package/.next/server/chunks/5164.js +1 -1
  184. package/.next/server/chunks/5571.js +1 -1
  185. package/.next/server/chunks/5959.js +4 -4
  186. package/.next/server/chunks/6130.js +1 -1
  187. package/.next/server/chunks/6274.js +12 -9
  188. package/.next/server/chunks/6285.js +1 -1
  189. package/.next/server/chunks/7458.js +6 -6
  190. package/.next/server/chunks/848.js +1 -1
  191. package/.next/server/chunks/8730.js +1 -0
  192. package/.next/server/chunks/880.js +1 -1
  193. package/.next/server/chunks/9328.js +1 -1
  194. package/.next/server/chunks/9373.js +4 -3
  195. package/.next/server/middleware-build-manifest.js +1 -1
  196. package/.next/server/middleware-manifest.json +5 -5
  197. package/.next/server/middleware-react-loadable-manifest.js +1 -1
  198. package/.next/server/pages/500.html +1 -1
  199. package/.next/server/server-reference-manifest.json +1 -1
  200. package/.next/static/chunks/2053-dfac2d49227cc942.js +1 -0
  201. package/.next/static/chunks/3898-ef488bfa804507d9.js +1 -0
  202. package/.next/static/chunks/5229-35f9acab97a553c5.js +1 -0
  203. package/.next/static/chunks/{6381-18a6a02a94d00d76.js → 6381-9303430933084b56.js} +1 -1
  204. package/.next/static/chunks/{9599-d29d2f8eeaf7c249.js → 8649-f551b0010dba4986.js} +1 -1
  205. package/.next/static/chunks/9263.f2034ec525abcf72.js +1 -0
  206. package/.next/static/chunks/app/chat/page-439b35c9cb90dbe0.js +1 -0
  207. package/.next/static/chunks/app/login/page-eefd515d8c37e5ee.js +1 -0
  208. package/.next/static/chunks/app/more/page-889b7546a8a553dc.js +1 -0
  209. package/.next/static/chunks/app/page-a8d04ac0e3e4c9fc.js +1 -0
  210. package/.next/static/chunks/app/repositories/page-f3c4d8839b1ca203.js +1 -0
  211. package/.next/static/chunks/app/review/page-6dc88649fe88ac16.js +1 -0
  212. package/.next/static/chunks/app/sessions/page-2c9ed9e969097688.js +1 -0
  213. package/.next/static/chunks/app/skills/[skillId]/page-19beef6121c4c982.js +1 -0
  214. package/.next/static/chunks/app/skills/installed/page-d5b9cef6d21fabda.js +1 -0
  215. package/.next/static/chunks/app/skills/page-06ef637e07dd9377.js +1 -0
  216. package/.next/static/chunks/app/worktrees/[id]/files/[...path]/{page-9ddcb224594f620f.js → page-5fed3984fafcd910.js} +1 -1
  217. package/.next/static/chunks/app/worktrees/[id]/page-fbdf4621a2911ac1.js +1 -0
  218. package/.next/static/chunks/{webpack-3534d858912a6c92.js → webpack-9d892a9ff07c289d.js} +1 -1
  219. package/.next/static/css/e865c4979a41aa03.css +1 -0
  220. package/.next/trace +12 -12
  221. package/README.md +96 -45
  222. package/dist/cli/commands/task.d.ts.map +1 -1
  223. package/dist/cli/commands/task.js +2 -1
  224. package/dist/cli/commands/verify.d.ts +14 -0
  225. package/dist/cli/commands/verify.d.ts.map +1 -1
  226. package/dist/cli/commands/verify.js +109 -3
  227. package/dist/cli/commands/wait.d.ts +2 -0
  228. package/dist/cli/commands/wait.d.ts.map +1 -1
  229. package/dist/cli/commands/wait.js +184 -4
  230. package/dist/cli/types/api-responses.d.ts +172 -0
  231. package/dist/cli/types/api-responses.d.ts.map +1 -1
  232. package/dist/cli/types/index.d.ts +31 -0
  233. package/dist/cli/types/index.d.ts.map +1 -1
  234. package/dist/cli/types/index.js +26 -0
  235. package/dist/cli/utils/verify-runner.d.ts +36 -1
  236. package/dist/cli/utils/verify-runner.d.ts.map +1 -1
  237. package/dist/cli/utils/verify-runner.js +114 -6
  238. package/dist/server/src/config/activity-bar-config.js +5 -1
  239. package/dist/server/src/lib/auto-yes-poller.js +40 -4
  240. package/dist/server/src/lib/auto-yes-state.js +108 -3
  241. package/dist/server/src/lib/cli-tools/antigravity.js +8 -4
  242. package/dist/server/src/lib/cli-tools/codex.js +63 -30
  243. package/dist/server/src/lib/cli-tools/copilot.js +5 -1
  244. package/dist/server/src/lib/cli-tools/gemini.js +15 -15
  245. package/dist/server/src/lib/cli-tools/opencode.js +9 -3
  246. package/dist/server/src/lib/detection/cli-patterns.js +148 -6
  247. package/dist/server/src/lib/detection/status-detector.js +28 -0
  248. package/dist/server/src/lib/detection/upstream-faults.js +120 -0
  249. package/dist/server/src/lib/hooks/permission-decision-service.js +13 -5
  250. package/dist/server/src/lib/hooks/sources/antigravity/hooks-config.js +18 -11
  251. package/dist/server/src/lib/hooks/sources/antigravity/source.js +10 -9
  252. package/dist/server/src/lib/hooks/sources/claude/source.js +5 -2
  253. package/dist/server/src/lib/hooks/sources/codex/hooks-config.js +26 -18
  254. package/dist/server/src/lib/hooks/sources/codex/source.js +6 -9
  255. package/dist/server/src/lib/hooks/sources/copilot/hook-settings.js +22 -12
  256. package/dist/server/src/lib/hooks/sources/copilot/source.js +1 -1
  257. package/dist/server/src/lib/hooks/sources/define-source.js +6 -4
  258. package/dist/server/src/lib/hooks/sources/gemini/settings-generator.js +14 -8
  259. package/dist/server/src/lib/hooks/sources/gemini/source.js +29 -29
  260. package/dist/server/src/lib/hooks/sources/index.js +4 -1
  261. package/dist/server/src/lib/hooks/sources/launch-command.js +61 -0
  262. package/dist/server/src/lib/hooks/sources/legacy-relay.js +2 -1
  263. package/dist/server/src/lib/hooks/sources/opencode/source.js +10 -7
  264. package/dist/server/src/lib/polling/prompt-dedup-state.js +95 -0
  265. package/dist/server/src/lib/polling/response-checker.js +12 -0
  266. package/dist/server/src/lib/polling/response-poller-core.js +11 -1
  267. package/dist/server/src/lib/session/agent-session-lifecycle.js +28 -7
  268. package/dist/server/src/lib/session/claude-session.js +5 -1
  269. package/dist/server/src/lib/session/current-output-builder.js +34 -0
  270. package/dist/server/src/lib/verification/env-snapshot.js +21 -3
  271. package/dist/server/src/lib/verification/gate-runner.js +258 -7
  272. package/dist/server/src/lib/verification/machine-lock.js +204 -0
  273. package/dist/server/src/lib/verification/scope-gate.js +126 -13
  274. package/dist/server/src/lib/verification/verify-config.js +85 -3
  275. package/dist/server/src/lib/verification/worktree-index.js +140 -0
  276. package/package.json +1 -1
  277. package/.next/server/chunks/3451.js +0 -1
  278. package/.next/static/chunks/2053-52d3c82014e1cd54.js +0 -1
  279. package/.next/static/chunks/5229-0610b4e3288e777d.js +0 -1
  280. package/.next/static/chunks/744-3ad06d8c8ca482fc.js +0 -1
  281. package/.next/static/chunks/9263.5259f73f89220d64.js +0 -1
  282. package/.next/static/chunks/app/chat/page-15d13fc024d78f5d.js +0 -1
  283. package/.next/static/chunks/app/login/page-0247a3fb569bb22b.js +0 -1
  284. package/.next/static/chunks/app/more/page-b8ba537baeac8d5b.js +0 -1
  285. package/.next/static/chunks/app/page-afc64708362f31e5.js +0 -1
  286. package/.next/static/chunks/app/repositories/page-3469dacb6be7842f.js +0 -1
  287. package/.next/static/chunks/app/review/page-2d9cb7e068f8f35a.js +0 -1
  288. package/.next/static/chunks/app/sessions/page-7470c2bfd89e0df9.js +0 -1
  289. package/.next/static/chunks/app/skills/[skillId]/page-5e24481162f7ea78.js +0 -1
  290. package/.next/static/chunks/app/skills/installed/page-efd2d710a27f9735.js +0 -1
  291. package/.next/static/chunks/app/skills/page-0498adfc6e48684b.js +0 -1
  292. package/.next/static/chunks/app/worktrees/[id]/page-e611d30e47989e5d.js +0 -1
  293. package/.next/static/css/3ac44cfc082d02ad.css +0 -1
  294. /package/.next/static/{smu4mnL7qMf8w38n9dQJE → hNdNiFes2xLls68SWhAU9}/_buildManifest.js +0 -0
  295. /package/.next/static/{smu4mnL7qMf8w38n9dQJE → hNdNiFes2xLls68SWhAU9}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- "use strict";exports.id=848,exports.ids=[848],exports.modules={9758:(a,b,c)=>{c.d(b,{Ck:()=>h});var d=c(21124),e=c(38301),f=c.n(e),g=c(62484);function h({children:a,as:b="div",className:c=""}){let e=function a(b){return null==b||"boolean"==typeof b?"":"string"==typeof b?b:"number"==typeof b?String(b):Array.isArray(b)?b.map(a).join(""):f().isValidElement(b)?a(b.props.children):""}(a);if(!e||0===e.trim().length)return(0,d.jsx)(b,{className:c||void 0,children:a});let h=`relative group ${"span"===b?"block ":""}${c}`.trim();return(0,d.jsxs)(b,{className:h,"data-testid":"code-block-with-copy",children:[a,(0,d.jsx)(g.i,{text:e,className:"absolute right-2 top-2 z-10 opacity-100 md:opacity-0 md:group-hover:opacity-100 md:group-focus-within:opacity-100 focus:opacity-100"})]})}},9815:(a,b,c)=>{c.d(b,{B:()=>B});var d=c(21124),e=c(38301),f=c(20481),g=c(73451),h=c(17252),i=c(90349),j=c(85389),k=c(3805);let l={status:"loading",options:[]};function m({selectedWorktreeId:a,onSelect:b,disabled:c=!1}){let h=(0,f.c)("skills"),[i,j]=(0,e.useState)(l),[m,o]=(0,e.useState)(0),p=(0,e.useCallback)(()=>o(a=>a+1),[]);return"loading"===i.status?(0,d.jsxs)("div",{className:"space-y-2","data-testid":"skill-target-loading",children:[(0,d.jsx)("p",{className:"text-sm text-muted-foreground",children:h("target.loading")}),(0,d.jsx)(g.EA,{className:"h-24 w-full rounded-lg"})]}):"error"===i.status?(0,d.jsxs)(g.Zp,{className:"space-y-3","data-testid":"skill-target-error",children:[(0,d.jsx)(k.u,{tone:"danger",children:h("target.errorNotice")}),(0,d.jsx)(g.$n,{variant:"secondary",size:"sm",onClick:p,"data-testid":"skill-target-retry",children:h("target.retry")})]}):0===i.options.length?(0,d.jsx)(g.Zp,{"data-testid":"skill-target-empty",children:(0,d.jsx)("p",{className:"text-sm text-muted-foreground",children:h("target.empty")})}):(0,d.jsxs)("div",{className:"space-y-3","data-testid":"skill-target-selector",children:[(0,d.jsx)("div",{role:"radiogroup","aria-label":h("target.heading"),className:"space-y-2",children:i.options.map(e=>(0,d.jsx)(n,{option:e,selected:e.id===a,disabled:c,onSelect:b},e.id))}),(0,d.jsx)(k.u,{tone:"neutral","data-testid":"skill-target-branch-notice",children:h("target.branchFreshnessNotice")})]})}function n({option:a,selected:b,disabled:c,onSelect:e}){let h=(0,f.c)("skills"),i=a.liveBranch??a.syncedBranch;return(0,d.jsxs)("button",{type:"button",role:"radio","aria-checked":b,disabled:c,onClick:()=>e(a.id),"data-testid":`skill-target-option-${a.id}`,className:`w-full rounded-lg border px-3 py-2.5 text-left transition-colors disabled:cursor-not-allowed disabled:opacity-60 ${b?"border-accent-500 bg-accent-50 dark:bg-accent-950/40":"border-border bg-card hover:bg-muted"}`,children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,d.jsx)("span",{className:"text-sm font-semibold text-foreground break-all",children:a.name}),b&&(0,d.jsx)(g.Ex,{variant:"info",children:h("target.selected")})]}),(0,d.jsxs)("dl",{className:"mt-1.5 grid grid-cols-1 gap-x-4 gap-y-1 sm:grid-cols-2",children:[(0,d.jsx)(o,{label:h("target.repository"),children:a.repositoryName}),(0,d.jsx)(o,{label:h("target.branch"),children:i??h("target.branchUnknown")}),(0,d.jsx)(o,{label:h("target.agents"),children:a.agents.length>0?a.agents.join(", "):h("target.agentsNone")}),(0,d.jsx)(o,{label:h("target.workingTree"),children:h(null===a.dirty?"target.workingTreeUnknown":a.dirty?"target.workingTreeDirty":"target.workingTreeClean")})]}),a.sessionRunning&&(0,d.jsx)("p",{className:"mt-1.5 text-xs text-muted-foreground","data-testid":`skill-target-session-${a.id}`,children:h("target.sessionRunning")})]})}function o({label:a,children:b}){return(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsx)("dt",{className:"text-xs font-medium text-muted-foreground",children:a}),(0,d.jsx)("dd",{className:"text-xs text-foreground break-words",children:b})]})}var p=c(27884);function q({label:a,children:b}){return(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsx)("dt",{className:"text-xs font-medium text-muted-foreground",children:a}),(0,d.jsx)("dd",{className:"mt-0.5 break-words text-sm text-foreground",children:b})]})}function r({level:a,kind:b,label:c}){let e=(0,f.c)("skills");return(0,d.jsxs)(g.Ex,{variant:p.eK[a],"data-testid":`skill-plan-risk-${b}-${a}`,children:[c,": ",e(p.pP[a])]})}function s({entry:a}){let b=(0,f.c)("skills"),c=p.KL[a.reason];return(0,d.jsxs)("li",{className:"space-y-1.5 rounded-md border border-border px-3 py-2","data-testid":`skill-plan-file-${a.path}`,children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,d.jsx)(g.Ex,{variant:p.tC[a.change],children:b(p.AS[a.change])}),(0,d.jsx)("span",{className:"break-all font-mono text-xs text-foreground",children:a.path}),a.generated&&(0,d.jsx)(g.Ex,{variant:"gray",children:b("plan.fileGenerated")})]}),c&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:b(c)}),a.gitIgnored&&(0,d.jsx)("p",{className:"text-xs text-warning-foreground",children:b("plan.gitIgnored")}),a.binary?(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:b("plan.diffBinary")}):a.diff?(0,d.jsxs)("details",{children:[(0,d.jsx)("summary",{className:"cursor-pointer text-xs text-accent-600 dark:text-accent-400",children:b("plan.diffToggle",{additions:a.additions,deletions:a.deletions})}),(0,d.jsx)("pre",{className:"mt-1 overflow-x-auto rounded bg-muted p-2 font-mono text-[11px] leading-snug text-foreground",children:a.diff}),a.diffTruncated&&(0,d.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:b("plan.diffTruncated")})]}):null]})}function t({plan:a}){let b=(0,f.c)("skills"),{target:c,skill:e}=a,h=e.compatibility.commandmate;return(0,d.jsxs)(g.Zp,{className:"space-y-4","data-testid":"skill-install-plan",children:[(0,d.jsxs)("div",{className:"space-y-1",children:[(0,d.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:b("plan.heading")}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:b("plan.expiresAt",{timestamp:a.expiresAt})})]}),(0,d.jsxs)("section",{className:"space-y-2",children:[(0,d.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:b("plan.targetHeading")}),(0,d.jsxs)("dl",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[(0,d.jsx)(q,{label:b("target.repository"),children:c.repositoryName}),(0,d.jsx)(q,{label:b("target.heading"),children:c.worktreeName}),(0,d.jsx)(q,{label:b("target.branch"),children:c.branch??b("target.branchUnknown")}),(0,d.jsx)(q,{label:b("plan.headStateLabel"),children:b(p.kF[c.headState]??"plan.headState.unknown")}),(0,d.jsx)(q,{label:b("target.workingTree"),children:c.workingTreeDirty?b("target.workingTreeDirty"):b("target.workingTreeClean")}),(0,d.jsx)(q,{label:b("plan.installRoot"),children:(0,d.jsx)("span",{className:"break-all font-mono text-xs",children:(c.installRoots&&c.installRoots.length>0?c.installRoots:[c.installRoot]).map(a=>(0,d.jsx)("span",{className:"block",children:a},a))})}),(0,d.jsx)(q,{label:b("plan.existingInstall"),children:c.existingInstall?b("plan.existingInstallVersion",{version:c.existingInstall.version}):b("plan.existingInstallNone")}),(0,d.jsx)(q,{label:b("detail.recommendedVersion"),children:(0,d.jsx)("span",{className:"font-mono text-xs",children:e.version})})]})]}),(0,d.jsxs)("section",{className:"space-y-2","data-testid":"skill-plan-risk-section",children:[(0,d.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:b("plan.riskHeading")}),(0,d.jsxs)("div",{className:"flex flex-wrap gap-1.5",children:[(0,d.jsx)(r,{level:e.declaredRisk,kind:"declared",label:b("plan.riskDeclared")}),(0,d.jsx)(r,{level:e.computedRisk,kind:"computed",label:b("plan.riskComputed")}),(0,d.jsx)(r,{level:e.effectiveRisk,kind:"effective",label:b("plan.riskEffective")})]}),(0,d.jsx)("p",{className:"break-words text-sm text-foreground",children:e.riskRationale}),(0,d.jsx)(k.u,{tone:"neutral",children:b("plan.riskNotice")})]}),(0,d.jsxs)("section",{className:"space-y-2","data-testid":"skill-plan-permissions",children:[(0,d.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:b("permissions.heading")}),e.declaredPermissions.length>0?(0,d.jsx)("div",{className:"flex flex-wrap gap-1.5",children:e.declaredPermissions.map(a=>(0,d.jsx)(g.Ex,{variant:"warning",children:p.z2[a]?b(p.z2[a]):a},a))}):(0,d.jsx)("p",{className:"text-sm text-muted-foreground",children:b("plan.permissionsNone")}),(0,d.jsx)(k.u,{tone:"warning",children:b("permissions.declarationOnlyNotice")})]}),(0,d.jsxs)("section",{className:"space-y-2","data-testid":"skill-plan-requirements",children:[(0,d.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:b("requirements.heading")}),0===e.requirements.commands.length&&0===e.requirements.networkHosts.length?(0,d.jsx)("p",{className:"text-sm text-muted-foreground",children:b("plan.requirementsNone")}):(0,d.jsxs)("dl",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[e.requirements.commands.length>0&&(0,d.jsx)(q,{label:b("plan.requirementsCommands"),children:e.requirements.commands.map(a=>`${a.name} ${a.versionRange??b("plan.commandAnyVersion")}`).join(", ")}),e.requirements.networkHosts.length>0&&(0,d.jsx)(q,{label:b("plan.requirementsHosts"),children:e.requirements.networkHosts.join(", ")})]})]}),(0,d.jsxs)("section",{className:"space-y-2","data-testid":"skill-plan-scripts",children:[(0,d.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:b("plan.scriptsHeading")}),0===e.executablePaths.length&&0===e.scriptPaths.length?(0,d.jsx)("p",{className:"text-sm text-muted-foreground",children:b("plan.scriptsNone")}):(0,d.jsx)("ul",{className:"space-y-1",children:[...new Set([...e.scriptPaths,...e.executablePaths])].map(a=>(0,d.jsx)("li",{className:"break-all font-mono text-xs text-foreground",children:a},a))})]}),"compatible"!==h.status&&(0,d.jsx)(k.u,{tone:"warning","data-testid":"skill-plan-compatibility-notice",children:b((0,p.e5)(h.messageKey),{range:h.requiredRange,currentVersion:h.currentVersion??""})}),a.warnings.length>0&&(0,d.jsxs)("section",{className:"space-y-2","data-testid":"skill-plan-warnings",children:[(0,d.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:b("plan.warningsHeading")}),(0,d.jsx)("ul",{className:"space-y-1",children:a.warnings.map(a=>(0,d.jsx)("li",{className:"text-xs text-warning-foreground",children:p.RO[a]?b(p.RO[a]):a},a))})]}),(0,d.jsxs)("section",{className:"space-y-2","data-testid":"skill-plan-files",children:[(0,d.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:b("plan.filesHeading")}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"skill-plan-stats",children:b("plan.stats",{added:a.stats.added,modified:a.stats.modified,unchanged:a.stats.unchanged,conflicted:a.stats.conflicted,unmanaged:a.stats.unmanaged})}),0===a.files.length?(0,d.jsx)("p",{className:"text-sm text-muted-foreground",children:b("plan.filesEmpty")}):(0,d.jsx)("ul",{className:"space-y-2",children:a.files.map(a=>(0,d.jsx)(s,{entry:a},a.path))})]}),a.blockers.length>0&&(0,d.jsxs)("section",{className:"space-y-2","data-testid":"skill-install-blockers",children:[(0,d.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-danger-foreground",children:b("plan.blockersHeading")}),(0,d.jsx)("ul",{className:"space-y-1",children:a.blockers.map(a=>(0,d.jsxs)("li",{className:"text-xs text-danger-foreground",children:[a.path&&(0,d.jsx)("span",{className:"mr-1 break-all font-mono",children:a.path}),a.code.startsWith("skills.")?b((0,p.e5)(a.code),{range:h.requiredRange,currentVersion:h.currentVersion??""}):p.KL[a.code]?b(p.KL[a.code]):a.code]},`${a.code}:${a.path??""}`))}),(0,d.jsx)(k.u,{tone:"danger",children:b("plan.blockedNotice")})]})]})}function u({entry:a}){let b=(0,f.c)("skills"),c=p.Mj[a.disposition],e=p.hJ[a.reason];return(0,d.jsxs)("li",{className:"flex flex-wrap items-center gap-2","data-testid":`skill-uninstall-file-${a.path}`,children:[(0,d.jsx)(g.Ex,{variant:"remove"===a.disposition?"info":"warning",children:c?b(c):a.disposition}),(0,d.jsx)("span",{className:"break-all font-mono text-xs text-foreground",children:a.path}),e&&(0,d.jsx)("span",{className:"text-xs text-muted-foreground",children:b(e)})]})}function v({plan:a}){let b=(0,f.c)("skills"),{target:c,skill:e}=a;return(0,d.jsxs)(g.Zp,{className:"space-y-4","data-testid":"skill-uninstall-plan",children:[(0,d.jsxs)("div",{className:"space-y-1",children:[(0,d.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:b("uninstall.heading")}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:b("uninstall.expiresAt",{timestamp:a.expiresAt})})]}),(0,d.jsxs)("dl",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[(0,d.jsx)(q,{label:b("target.repository"),children:c.repositoryName}),(0,d.jsx)(q,{label:b("target.heading"),children:c.worktreeName}),(0,d.jsx)(q,{label:b("target.branch"),children:c.branch??b("target.branchUnknown")}),(0,d.jsx)(q,{label:b("uninstall.installedVersion"),children:(0,d.jsx)("span",{className:"font-mono text-xs",children:e.version||b("uninstall.versionUnknown")})}),(0,d.jsx)(q,{label:b("plan.installRoot"),children:(0,d.jsx)("span",{className:"break-all font-mono text-xs",children:c.installRoot})}),(0,d.jsx)(q,{label:b("target.workingTree"),children:c.workingTreeDirty?b("target.workingTreeDirty"):b("target.workingTreeClean")})]}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"skill-uninstall-stats",children:b("uninstall.stats",{removable:a.stats.removable,modified:a.stats.modified,missing:a.stats.missing,unknown:a.stats.unknown,irregular:a.stats.irregular})}),(0,d.jsxs)("section",{className:"space-y-2",children:[(0,d.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:b("uninstall.removalsHeading")}),0===a.removals.length?(0,d.jsx)("p",{className:"text-sm text-muted-foreground",children:b("uninstall.removalsEmpty")}):(0,d.jsx)("ul",{className:"space-y-1.5",children:a.removals.map(a=>(0,d.jsx)(u,{entry:a},a.path))})]}),(0,d.jsxs)("section",{className:"space-y-2",children:[(0,d.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:b("uninstall.retainedHeading")}),0===a.retained.length?(0,d.jsx)("p",{className:"text-sm text-muted-foreground",children:b("uninstall.retainedEmpty")}):(0,d.jsx)("ul",{className:"space-y-1.5",children:a.retained.map(a=>(0,d.jsx)(u,{entry:a},a.path))})]}),(0,d.jsxs)("div",{className:"space-y-2",children:[a.skill.agents.length>0&&(0,d.jsx)("div",{className:"flex flex-wrap gap-1.5","data-testid":"skill-uninstall-agents",children:a.skill.agents.map(a=>(0,d.jsx)(g.Ex,{variant:"gray",children:(0,h.f_)(a.agent)},a.agent))}),(0,d.jsx)(k.u,{tone:"neutral",children:b((0,p.e5)(a.nextActionKey))})]}),a.blockers.length>0&&(0,d.jsxs)("section",{className:"space-y-2","data-testid":"skill-uninstall-blockers",children:[(0,d.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-danger-foreground",children:b("uninstall.blockersHeading")}),(0,d.jsx)("ul",{className:"space-y-1",children:a.blockers.map(a=>(0,d.jsxs)("li",{className:"text-xs text-danger-foreground",children:[a.path&&(0,d.jsx)("span",{className:"mr-1 break-all font-mono",children:a.path}),b((0,p.e5)(a.messageKey))]},`${a.code}:${a.path??""}`))})]})]})}var w=c(30156);let x={worktreeId:null,busy:null,installPlan:null,uninstallPlan:null,installResult:null,uninstallResult:null,riskAcknowledged:!1,failure:null};function y(a){return{...a,installPlan:null,uninstallPlan:null,installResult:null,uninstallResult:null,riskAcknowledged:!1,failure:null}}function z({failure:a}){let b=(0,f.c)("skills");return(0,d.jsxs)("div",{className:"space-y-2","data-testid":"skill-operation-error",children:[(0,d.jsxs)(k.u,{tone:"danger",children:[(0,d.jsx)("p",{className:"font-medium",children:b("operation.errorHeading")}),(0,d.jsx)("p",{className:"mt-1",children:b((0,p.FW)(a.code))}),(0,d.jsx)("p",{className:"mt-1 break-words",children:b("state.errorCode",{code:a.code})})]}),a.nextActionKey&&(0,d.jsx)(k.u,{tone:"warning",children:b((0,p.e5)(a.nextActionKey))}),a.blockers&&a.blockers.length>0&&(0,d.jsx)("ul",{className:"space-y-1","data-testid":"skill-operation-error-blockers",children:a.blockers.map(a=>(0,d.jsxs)("li",{className:"text-xs text-danger-foreground",children:[a.path&&(0,d.jsx)("span",{className:"mr-1 break-all font-mono",children:a.path}),b((0,p.e5)(a.messageKey))]},`${a.code}:${a.path??""}`))})]})}function A({agents:a,skillId:b,version:c}){let e=(0,f.c)("skills");return 0===a.length?null:(0,d.jsxs)("div",{className:"space-y-1","data-testid":"skill-operation-reload",children:[(0,d.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:e("operation.reloadHeading")}),(0,d.jsx)("ul",{className:"space-y-1",children:a.map(a=>(0,d.jsx)("li",{className:"text-xs text-muted-foreground",children:e((0,p.e5)(a.messageKey),{agent:(0,h.f_)(a.agent),skillId:b,version:c})},a.agent))})]})}function B({skillId:a,version:b,blockedReason:c,worktreeId:h,agents:l=[]}){let n=(0,f.c)("skills"),[o,q]=(0,e.useState)(()=>h?{...x,worktreeId:h}:x),r=(0,e.useCallback)(a=>{q(b=>b.worktreeId===a?b:y({...b,worktreeId:a,busy:null}))},[]),s=(0,e.useCallback)(async()=>{let c=o.worktreeId;if(!c)return;q(a=>({...y(a),busy:"install-plan"}));let d=await (0,w.Q6)(c,a,{version:b??void 0});q(a=>({...a,busy:null,installPlan:d.ok?d.data.plan:null,failure:d.ok?null:d.failure}))},[a,o.worktreeId,b]),u=(0,e.useCallback)(async()=>{var b;let c=o.worktreeId,d=o.installPlan;if(!c||!d||d.requiresRiskAcknowledgement&&!o.riskAcknowledged)return;q(a=>({...a,busy:"install-apply",failure:null}));let e=await (0,w.Xi)(c,a,{planToken:d.token,version:d.skill.version,acknowledgeRisk:!!d.requiresRiskAcknowledgement||void 0,idempotencyKey:(b=d.token,`skill-install-${b}`)});e.ok&&(0,i.k)(c),q(a=>({...a,busy:null,installPlan:e.ok?null:a.installPlan,installResult:e.ok?e.data:null,failure:e.ok?null:e.failure}))},[a,o.installPlan,o.riskAcknowledged,o.worktreeId]),B=(0,e.useCallback)(async()=>{let b=o.worktreeId;if(!b)return;q(a=>({...y(a),busy:"uninstall-plan"}));let c=await (0,w.hN)(b,a);q(a=>({...a,busy:null,uninstallPlan:c.ok?c.data.plan:null,failure:c.ok?null:c.failure}))},[a,o.worktreeId]),C=(0,e.useCallback)(async()=>{var b;let c=o.worktreeId,d=o.uninstallPlan;if(!c||!d)return;q(a=>({...a,busy:"uninstall-apply",failure:null}));let e=await (0,w.E)(c,a,{planToken:d.token,idempotencyKey:(b=d.token,`skill-uninstall-${b}`)});q(a=>({...a,busy:null,uninstallPlan:e.ok?null:a.uninstallPlan,uninstallResult:e.ok?e.data:null,failure:e.ok?null:e.failure}))},[a,o.uninstallPlan,o.worktreeId]),D=(0,e.useCallback)(()=>{q(a=>y(a))},[]),E=null!==o.busy,F=o.installPlan,G=o.uninstallPlan,H=c??n(o.worktreeId?"plan.ready":"plan.chooseTarget"),I=null!==F&&F.requiresRiskAcknowledgement&&!o.riskAcknowledged;return(0,d.jsxs)("div",{className:"space-y-3","data-testid":"skill-install-panel",children:[!h&&(0,d.jsx)(m,{selectedWorktreeId:o.worktreeId,onSelect:r,disabled:E}),(0,d.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,d.jsx)(g.$n,{variant:"primary",disabled:E||null!==c||!o.worktreeId,onClick:s,"data-testid":"skill-install-action","aria-describedby":"skill-install-reason",children:n("install-plan"===o.busy?"plan.building":"plan.build")}),(0,d.jsx)(g.$n,{variant:"secondary",disabled:E||!o.worktreeId,onClick:B,"data-testid":"skill-uninstall-action",children:n("uninstall-plan"===o.busy?"uninstall.building":"uninstall.build")})]}),(0,d.jsx)("p",{id:"skill-install-reason",className:"text-sm text-muted-foreground","data-testid":"skill-install-reason",children:H}),l.length>0&&(0,d.jsxs)("div",{className:"space-y-1","data-testid":"skill-install-reload-preview",children:[(0,d.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:n("operation.reloadHeading")}),(0,d.jsx)("ul",{className:"space-y-1",children:l.map(a=>(0,d.jsx)(j.m,{agent:a,variant:"reload"},a.agent))})]}),o.failure&&(0,d.jsx)(z,{failure:o.failure}),F&&(0,d.jsxs)("div",{className:"space-y-3",children:[(0,d.jsx)(t,{plan:F}),F.requiresRiskAcknowledgement&&(0,d.jsxs)(g.Zp,{className:"space-y-3","data-testid":"skill-install-risk-acknowledgement",children:[(0,d.jsx)(k.u,{tone:"danger",children:n((0,p.e5)(F.riskAcknowledgementMessageKey??"skills.plan.highRiskAcknowledgement"))}),(0,d.jsxs)("label",{className:"flex items-start gap-2 text-sm text-foreground",children:[(0,d.jsx)(g.Sc,{checked:o.riskAcknowledged,onCheckedChange:a=>q(b=>({...b,riskAcknowledged:!0===a})),disabled:E,"data-testid":"skill-install-risk-checkbox",className:"mt-0.5"}),(0,d.jsx)("span",{children:n("plan.acknowledgeLabel")})]})]}),(0,d.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,d.jsx)(g.$n,{variant:F.requiresRiskAcknowledgement?"danger":"primary",disabled:E||!F.installable||I,onClick:u,"data-testid":"skill-install-confirm",children:n("install-apply"===o.busy?"plan.confirming":"plan.confirm")}),(0,d.jsx)(g.$n,{variant:"ghost",disabled:E,onClick:D,"data-testid":"skill-install-discard",children:n("plan.discard")})]})]}),G&&(0,d.jsxs)("div",{className:"space-y-3",children:[(0,d.jsx)(v,{plan:G}),(0,d.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,d.jsx)(g.$n,{variant:"danger",disabled:E||!G.removable,onClick:C,"data-testid":"skill-uninstall-confirm",children:n("uninstall-apply"===o.busy?"uninstall.confirming":"uninstall.confirm")}),(0,d.jsx)(g.$n,{variant:"ghost",disabled:E,onClick:D,"data-testid":"skill-uninstall-discard",children:n("plan.discard")})]})]}),o.installResult&&(0,d.jsxs)(g.Zp,{className:"space-y-3","data-testid":"skill-install-result",children:[(0,d.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:n("operation.installedHeading")}),(0,d.jsx)(k.u,{tone:"info",children:n((0,p.e5)(o.installResult.operation.nextActionKey))}),o.installResult.operation.replayed&&(0,d.jsx)(k.u,{tone:"neutral","data-testid":"skill-operation-replayed",children:n("operation.replayNotice")}),o.installResult.install&&"files"in o.installResult.install&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:n("operation.filesWritten",{count:o.installResult.install.files.length})}),"reload"in o.installResult&&(0,d.jsx)(A,{agents:o.installResult.reload.agents,skillId:o.installResult.reload.skillId,version:o.installResult.reload.version}),(0,d.jsx)(g.$n,{variant:"secondary",size:"sm",onClick:D,"data-testid":"skill-operation-reset",children:n("operation.startOver")})]}),o.uninstallResult&&(0,d.jsxs)(g.Zp,{className:"space-y-3","data-testid":"skill-uninstall-result",children:[(0,d.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:n("operation.uninstalledHeading")}),(0,d.jsx)(k.u,{tone:"info",children:n((0,p.e5)(o.uninstallResult.operation.nextActionKey))}),o.uninstallResult.operation.replayed&&(0,d.jsx)(k.u,{tone:"neutral","data-testid":"skill-operation-replayed",children:n("operation.replayNotice")}),o.uninstallResult.uninstall&&"removedFiles"in o.uninstallResult.uninstall&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:n("operation.filesRemoved",{count:o.uninstallResult.uninstall.removedFiles.length})}),"reload"in o.uninstallResult&&(0,d.jsx)(A,{agents:o.uninstallResult.reload.agents,skillId:o.uninstallResult.reload.skillId,version:o.uninstallResult.reload.version}),(0,d.jsx)(g.$n,{variant:"secondary",size:"sm",onClick:D,"data-testid":"skill-operation-reset",children:n("operation.startOver")})]})]})}},12894:(a,b,c)=>{c.d(b,{o:()=>d});function d(a){return a?a.split("/").map(encodeURIComponent).join("/"):""}},28593:(a,b,c)=>{c.d(b,{Xz:()=>j,qW:()=>k,uE:()=>l});var d=c(21124);c(38301);var e=c(20481),f=c(93983),g=c(73451),h=c(17252),i=c(27884);function j({status:a,className:b}){let c=(0,e.c)("skills");return(0,d.jsx)(g.Ex,{variant:i.H$[a],className:b,"data-testid":`skill-compatibility-${a}`,children:c(i.OV[a])})}function k({risk:a,className:b}){let c=(0,e.c)("skills");return(0,d.jsxs)(g.Ex,{variant:i.eK[a],className:b,"data-testid":`skill-declared-risk-${a}`,children:["high"===a&&(0,d.jsx)(f.A,{size:12,"aria-hidden":"true",className:"mr-1 shrink-0"}),c("risk.declaredLabel",{level:c(i.pP[a])})]})}function l({agent:a}){let b=(0,e.c)("skills");return(0,d.jsxs)(g.Ex,{variant:i.Et[a.support],"data-testid":`skill-agent-${a.agent}-${a.support}`,children:[(0,h.f_)(a.agent),": ",b((0,i.e5)(a.labelKey))]})}},62484:(a,b,c)=>{c.d(b,{i:()=>j});var d=c(21124),e=c(38301),f=c(63156),g=c(58970);function h(){return(0,d.jsx)("svg",{className:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})}function i(){return(0,d.jsx)("svg",{className:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})}function j({text:a,className:b="",label:c="Copy"}){let[j,k]=(0,e.useState)(!1),l=(0,e.useRef)(null),m=(0,e.useCallback)(async()=>{try{await (0,f.l)(a),k(!0),l.current&&clearTimeout(l.current),l.current=setTimeout(()=>k(!1),g.s7)}catch{}},[a]);return(0,d.jsxs)("button",{type:"button",onClick:m,className:`inline-flex items-center gap-1 rounded border border-border bg-surface px-2 py-0.5 text-[11px] font-medium text-foreground transition-colors hover:bg-muted ${b}`,"aria-label":j?"Copied":c,title:j?"Copied!":c,children:[j?(0,d.jsx)(i,{}):(0,d.jsx)(h,{}),(0,d.jsx)("span",{children:j?"Copied":c})]})}},63156:(a,b,c)=>{c.d(b,{l:()=>e});let d=/\x1b\[[0-9;]*[a-zA-Z]|\x1b\][^\x07]*\x07|\[[0-9;]*m/g;async function e(a){if(!a||0===a.trim().length)return;let b=a.replace(d,"");if(navigator.clipboard?.writeText)try{await navigator.clipboard.writeText(b);return}catch{}let c=document.createElement("textarea");c.value=b,c.style.position="fixed",c.style.left="-9999px",c.style.top="-9999px",c.style.opacity="0",document.body.appendChild(c),c.focus(),c.select();try{document.execCommand("copy")}finally{document.body.removeChild(c)}}},80855:(a,b,c)=>{c.d(b,{G8:()=>x});var d=c(21124),e=c(38301),f=c.n(e),g=c(20481),h=c(79206),i=c(18954),j=c(26295),k=c(29701),l=c(28752),m=c(37950);c(31230);var n=c(13973),o=c(17793);let p=(0,n.default)(async()=>{},{loadableGenerated:{modules:["components/worktree/MermaidCodeBlock.tsx -> ./MermaidDiagram"]},ssr:!1,loading:function(){let a=(0,g.c)("worktree");return(0,d.jsxs)("div",{className:"mermaid-loading flex items-center gap-2 text-muted-foreground p-4",children:[(0,d.jsx)(o.y,{size:"sm"}),(0,d.jsx)("span",{children:a("mermaid.loading")})]})}});function q({className:a,children:b}){if(a&&a.split(" ").includes("language-mermaid")){let a=null==b?"":"string"==typeof b?b:Array.isArray(b)?b.map(a=>"string"==typeof a?a:"").join(""):String(b);return(0,d.jsx)(p,{code:a})}return(0,d.jsx)("code",{className:a,children:b})}var r=c(9758),s=c(46831);function t(a,b){if(!b)return null;let c=a.substring(0,a.lastIndexOf("/")+1);try{let a=new URL(c,"file:///"),d=new URL(b,a),e=decodeURIComponent(d.pathname);if(e.startsWith("/")){let a=e.substring(1);if(a.length>0)return a}}catch{}return null}let u={...s.j,attributes:{...s.j.attributes,a:[...(s.j.attributes?.a??[]).filter(a=>"href"!==a),["href",/^(?:#|mailto:|tel:|https?:\/\/|(?![a-zA-Z][a-zA-Z0-9+.-]*:))/]],img:[...(s.j.attributes?.img??[]).filter(a=>"src"!==a),["src",/^(?:https?:\/\/|(?![a-zA-Z][a-zA-Z0-9+.-]*:))/],"alt","width","height"]}};var v=c(12894);function w({apiUrl:a,alt:b,width:c,height:f}){let h=(0,g.c)("worktree"),[i,j]=(0,e.useState)(null);return i?(0,d.jsx)("img",{src:i,alt:b,width:c,height:f,style:{maxWidth:c||"100%"}}):(0,d.jsx)("span",{style:{color:"#999"},children:h("markdownPreview.loadingImage")})}let x=(0,e.memo)(function({content:a,onOpenFile:b,currentFilePath:c,worktreeId:g}){let n=(0,e.useRef)(b);n.current=b;let o=(0,e.useRef)(c);o.current=c;let p=(0,e.useRef)(g);p.current=g;let s=(0,e.useCallback)((a,b)=>{let c=!b||0===b.length||b.length>2048||/[\x00-\x1f\x7f]/.test(b)?null:b;if(c)switch(c.startsWith("#")?"anchor":c.startsWith("http://")||c.startsWith("https://")||c.startsWith("mailto:")||c.startsWith("tel:")?"external":"relative"){case"anchor":break;case"external":a.preventDefault(),window.open(c,"_blank","noopener,noreferrer");break;case"relative":{a.preventDefault();let b=o.current,d=n.current;if(b&&d){let a=t(b,c);a&&d(a)}}}},[]),x=(0,e.useMemo)(()=>({code:q,pre:({children:a})=>!function(a){let b=f().Children.toArray(a)[0];if(!f().isValidElement(b))return!1;let c=b.props.className;return"string"==typeof c&&c.split(" ").includes("language-mermaid")}(a)?(0,d.jsx)(r.Ck,{children:(0,d.jsx)("pre",{className:"overflow-x-auto",children:a})}):(0,d.jsx)("pre",{children:a}),img:({src:a,alt:b,width:c,height:e,...f})=>{let g=c??f.node?.properties?.width,h=e??f.node?.properties?.height;if("string"==typeof a&&!a.startsWith("http://")&&!a.startsWith("https://")&&!a.startsWith("data:")){let c=o.current,e=p.current;if(c&&e){let f=t(c,a);if(f){let a=`/api/worktrees/${e}/files/${(0,v.o)(f)}`;return(0,d.jsx)(w,{apiUrl:a,alt:b??"",width:g,height:h})}}}return(0,d.jsx)("img",{src:a,alt:b??"",width:g,height:h,style:{maxWidth:g||"100%"}})},a:({href:a,children:b,...c})=>a?(0,d.jsx)("a",{...c,href:a,onClick:b=>s(b,a),children:b}):(0,d.jsx)("a",{...c,children:b})}),[s]),y=(0,e.useMemo)(()=>[i.A],[]),z=(0,e.useMemo)(()=>[j.A,[k.A,u],l.A,m.A],[]);return(0,d.jsx)(h.oz,{remarkPlugins:y,rehypePlugins:z,components:x,children:a})})},81136:(a,b,c)=>{c.d(b,{Co:()=>d,Ms:()=>f,td:()=>e});let d=".agents/skills",e=".claude/skills",f="skills.permissions.declarationOnlyNotice"},85389:(a,b,c)=>{c.d(b,{m:()=>j});var d=c(21124);c(38301);var e=c(20481),f=c(17252),g=c(3805),h=c(27884);function i({axis:a,agentName:b}){let c=(0,e.c)("skills");return(0,d.jsxs)("li",{className:"text-xs text-muted-foreground","data-testid":`skill-agent-axis-${a.axis}`,children:[(0,d.jsx)("span",{className:"font-medium text-foreground",children:c((0,h.e5)(a.axisKey))}),": ",(0,d.jsx)("span",{"data-testid":`skill-agent-axis-${a.axis}-${a.outcome}`,children:c((0,h.e5)(a.outcomeKey))})," — ",c((0,h.e5)(a.evidenceKindKey)),a.limitationKey&&(0,d.jsx)("span",{className:"mt-0.5 block","data-testid":`skill-agent-axis-${a.axis}-limitation`,children:c((0,h.e5)(a.limitationKey),{agent:b})})]})}function j({agent:a,variant:b="full"}){let c=(0,e.c)("skills"),j=(0,f.f_)(a.agent),k=a.measured;return"reload"===b?(0,d.jsx)("li",{className:"text-xs text-muted-foreground","data-testid":`skill-agent-reload-${a.agent}`,children:c((0,h.e5)(a.reloadKey),{agent:j})}):(0,d.jsxs)("div",{className:"space-y-1","data-testid":`skill-agent-evidence-${a.agent}`,children:[(0,d.jsx)("p",{className:"text-xs font-medium text-foreground",children:j}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground break-words",children:c("compatibility.declaredLabel",{support:c((0,h.e5)(a.declaredLabelKey))})}),(0,d.jsxs)("p",{className:"text-xs text-muted-foreground break-words",children:[c("compatibility.evidence"),": ",a.evidence]}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground break-words","data-testid":`skill-agent-verification-${a.agent}`,children:c((0,h.e5)(a.verificationKey))}),k?(0,d.jsxs)("div",{className:"space-y-0.5 border-l-2 border-border pl-2",children:[(0,d.jsx)("p",{className:"text-xs font-medium text-foreground",children:c("compatibility.measuredHeading")}),(0,d.jsxs)("ul",{className:"space-y-0.5",children:[(0,d.jsx)(i,{axis:k.discovery,agentName:j}),(0,d.jsx)(i,{axis:k.invocation,agentName:j})]}),k.testedVersion&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:c("compatibility.testedVersion",{agent:j,version:k.testedVersion})}),k.testedDate&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:c("compatibility.testedDate",{date:k.testedDate})}),k.discoveryRoots.length>0&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground break-all",children:c("compatibility.discoveryRoots",{roots:k.discoveryRoots.join(", ")})}),k.evidenceSource&&(0,d.jsxs)("p",{className:"text-xs text-muted-foreground break-all",children:[c("compatibility.evidenceSource"),": ",k.evidenceSource]}),k.stale&&(0,d.jsx)(g.u,{tone:"warning","data-testid":`skill-agent-evidence-stale-${a.agent}`,children:c("compatibility.evidenceStale",{days:k.ageDays??0})})]}):a.skipReasonKey&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground break-words","data-testid":`skill-agent-skip-reason-${a.agent}`,children:c((0,h.e5)(a.skipReasonKey))}),(0,d.jsxs)("p",{className:"text-xs text-muted-foreground break-words",children:[(0,d.jsx)("span",{className:"font-medium text-foreground",children:c("compatibility.reloadHeading",{agent:j})}),": ",c((0,h.e5)(a.reloadKey),{agent:j})]})]})}},90349:(a,b,c)=>{c.d(b,{I:()=>d,k:()=>e});let d="skill:installed";function e(a){}}};
1
+ "use strict";exports.id=848,exports.ids=[848],exports.modules={9758:(a,b,c)=>{c.d(b,{Ck:()=>h});var d=c(21124),e=c(38301),f=c.n(e),g=c(62484);function h({children:a,as:b="div",className:c=""}){let e=function a(b){return null==b||"boolean"==typeof b?"":"string"==typeof b?b:"number"==typeof b?String(b):Array.isArray(b)?b.map(a).join(""):f().isValidElement(b)?a(b.props.children):""}(a);if(!e||0===e.trim().length)return(0,d.jsx)(b,{className:c||void 0,children:a});let h=`relative group ${"span"===b?"block ":""}${c}`.trim();return(0,d.jsxs)(b,{className:h,"data-testid":"code-block-with-copy",children:[a,(0,d.jsx)(g.i,{text:e,className:"absolute right-2 top-2 z-10 opacity-100 md:opacity-0 md:group-hover:opacity-100 md:group-focus-within:opacity-100 focus:opacity-100"})]})}},9815:(a,b,c)=>{c.d(b,{B:()=>B});var d=c(21124),e=c(38301),f=c(20481),g=c(8730),h=c(17252),i=c(90349),j=c(85389),k=c(3805);let l={status:"loading",options:[]};function m({selectedWorktreeId:a,onSelect:b,disabled:c=!1}){let h=(0,f.c)("skills"),[i,j]=(0,e.useState)(l),[m,o]=(0,e.useState)(0),p=(0,e.useCallback)(()=>o(a=>a+1),[]);return"loading"===i.status?(0,d.jsxs)("div",{className:"space-y-2","data-testid":"skill-target-loading",children:[(0,d.jsx)("p",{className:"text-sm text-muted-foreground",children:h("target.loading")}),(0,d.jsx)(g.EA,{className:"h-24 w-full rounded-lg"})]}):"error"===i.status?(0,d.jsxs)(g.Zp,{className:"space-y-3","data-testid":"skill-target-error",children:[(0,d.jsx)(k.u,{tone:"danger",children:h("target.errorNotice")}),(0,d.jsx)(g.$n,{variant:"secondary",size:"sm",onClick:p,"data-testid":"skill-target-retry",children:h("target.retry")})]}):0===i.options.length?(0,d.jsx)(g.Zp,{"data-testid":"skill-target-empty",children:(0,d.jsx)("p",{className:"text-sm text-muted-foreground",children:h("target.empty")})}):(0,d.jsxs)("div",{className:"space-y-3","data-testid":"skill-target-selector",children:[(0,d.jsx)("div",{role:"radiogroup","aria-label":h("target.heading"),className:"space-y-2",children:i.options.map(e=>(0,d.jsx)(n,{option:e,selected:e.id===a,disabled:c,onSelect:b},e.id))}),(0,d.jsx)(k.u,{tone:"neutral","data-testid":"skill-target-branch-notice",children:h("target.branchFreshnessNotice")})]})}function n({option:a,selected:b,disabled:c,onSelect:e}){let h=(0,f.c)("skills"),i=a.liveBranch??a.syncedBranch;return(0,d.jsxs)("button",{type:"button",role:"radio","aria-checked":b,disabled:c,onClick:()=>e(a.id),"data-testid":`skill-target-option-${a.id}`,className:`w-full rounded-lg border px-3 py-2.5 text-left transition-colors disabled:cursor-not-allowed disabled:opacity-60 ${b?"border-accent-500 bg-accent-50 dark:bg-accent-950/40":"border-border bg-card hover:bg-muted"}`,children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,d.jsx)("span",{className:"text-sm font-semibold text-foreground break-all",children:a.name}),b&&(0,d.jsx)(g.Ex,{variant:"info",children:h("target.selected")})]}),(0,d.jsxs)("dl",{className:"mt-1.5 grid grid-cols-1 gap-x-4 gap-y-1 sm:grid-cols-2",children:[(0,d.jsx)(o,{label:h("target.repository"),children:a.repositoryName}),(0,d.jsx)(o,{label:h("target.branch"),children:i??h("target.branchUnknown")}),(0,d.jsx)(o,{label:h("target.agents"),children:a.agents.length>0?a.agents.join(", "):h("target.agentsNone")}),(0,d.jsx)(o,{label:h("target.workingTree"),children:h(null===a.dirty?"target.workingTreeUnknown":a.dirty?"target.workingTreeDirty":"target.workingTreeClean")})]}),a.sessionRunning&&(0,d.jsx)("p",{className:"mt-1.5 text-xs text-muted-foreground","data-testid":`skill-target-session-${a.id}`,children:h("target.sessionRunning")})]})}function o({label:a,children:b}){return(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsx)("dt",{className:"text-xs font-medium text-muted-foreground",children:a}),(0,d.jsx)("dd",{className:"text-xs text-foreground break-words",children:b})]})}var p=c(27884);function q({label:a,children:b}){return(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsx)("dt",{className:"text-xs font-medium text-muted-foreground",children:a}),(0,d.jsx)("dd",{className:"mt-0.5 break-words text-sm text-foreground",children:b})]})}function r({level:a,kind:b,label:c}){let e=(0,f.c)("skills");return(0,d.jsxs)(g.Ex,{variant:p.eK[a],"data-testid":`skill-plan-risk-${b}-${a}`,children:[c,": ",e(p.pP[a])]})}function s({entry:a}){let b=(0,f.c)("skills"),c=p.KL[a.reason];return(0,d.jsxs)("li",{className:"space-y-1.5 rounded-md border border-border px-3 py-2","data-testid":`skill-plan-file-${a.path}`,children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,d.jsx)(g.Ex,{variant:p.tC[a.change],children:b(p.AS[a.change])}),(0,d.jsx)("span",{className:"break-all font-mono text-xs text-foreground",children:a.path}),a.generated&&(0,d.jsx)(g.Ex,{variant:"gray",children:b("plan.fileGenerated")})]}),c&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:b(c)}),a.gitIgnored&&(0,d.jsx)("p",{className:"text-xs text-warning-foreground",children:b("plan.gitIgnored")}),a.binary?(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:b("plan.diffBinary")}):a.diff?(0,d.jsxs)("details",{children:[(0,d.jsx)("summary",{className:"cursor-pointer text-xs text-accent-600 dark:text-accent-400",children:b("plan.diffToggle",{additions:a.additions,deletions:a.deletions})}),(0,d.jsx)("pre",{className:"mt-1 overflow-x-auto rounded bg-muted p-2 font-mono text-[11px] leading-snug text-foreground",children:a.diff}),a.diffTruncated&&(0,d.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:b("plan.diffTruncated")})]}):null]})}function t({plan:a}){let b=(0,f.c)("skills"),{target:c,skill:e}=a,h=e.compatibility.commandmate;return(0,d.jsxs)(g.Zp,{className:"space-y-4","data-testid":"skill-install-plan",children:[(0,d.jsxs)("div",{className:"space-y-1",children:[(0,d.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:b("plan.heading")}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:b("plan.expiresAt",{timestamp:a.expiresAt})})]}),(0,d.jsxs)("section",{className:"space-y-2",children:[(0,d.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:b("plan.targetHeading")}),(0,d.jsxs)("dl",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[(0,d.jsx)(q,{label:b("target.repository"),children:c.repositoryName}),(0,d.jsx)(q,{label:b("target.heading"),children:c.worktreeName}),(0,d.jsx)(q,{label:b("target.branch"),children:c.branch??b("target.branchUnknown")}),(0,d.jsx)(q,{label:b("plan.headStateLabel"),children:b(p.kF[c.headState]??"plan.headState.unknown")}),(0,d.jsx)(q,{label:b("target.workingTree"),children:c.workingTreeDirty?b("target.workingTreeDirty"):b("target.workingTreeClean")}),(0,d.jsx)(q,{label:b("plan.installRoot"),children:(0,d.jsx)("span",{className:"break-all font-mono text-xs",children:(c.installRoots&&c.installRoots.length>0?c.installRoots:[c.installRoot]).map(a=>(0,d.jsx)("span",{className:"block",children:a},a))})}),(0,d.jsx)(q,{label:b("plan.existingInstall"),children:c.existingInstall?b("plan.existingInstallVersion",{version:c.existingInstall.version}):b("plan.existingInstallNone")}),(0,d.jsx)(q,{label:b("detail.recommendedVersion"),children:(0,d.jsx)("span",{className:"font-mono text-xs",children:e.version})})]})]}),(0,d.jsxs)("section",{className:"space-y-2","data-testid":"skill-plan-risk-section",children:[(0,d.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:b("plan.riskHeading")}),(0,d.jsxs)("div",{className:"flex flex-wrap gap-1.5",children:[(0,d.jsx)(r,{level:e.declaredRisk,kind:"declared",label:b("plan.riskDeclared")}),(0,d.jsx)(r,{level:e.computedRisk,kind:"computed",label:b("plan.riskComputed")}),(0,d.jsx)(r,{level:e.effectiveRisk,kind:"effective",label:b("plan.riskEffective")})]}),(0,d.jsx)("p",{className:"break-words text-sm text-foreground",children:e.riskRationale}),(0,d.jsx)(k.u,{tone:"neutral",children:b("plan.riskNotice")})]}),(0,d.jsxs)("section",{className:"space-y-2","data-testid":"skill-plan-permissions",children:[(0,d.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:b("permissions.heading")}),e.declaredPermissions.length>0?(0,d.jsx)("div",{className:"flex flex-wrap gap-1.5",children:e.declaredPermissions.map(a=>(0,d.jsx)(g.Ex,{variant:"warning",children:p.z2[a]?b(p.z2[a]):a},a))}):(0,d.jsx)("p",{className:"text-sm text-muted-foreground",children:b("plan.permissionsNone")}),(0,d.jsx)(k.u,{tone:"warning",children:b("permissions.declarationOnlyNotice")})]}),(0,d.jsxs)("section",{className:"space-y-2","data-testid":"skill-plan-requirements",children:[(0,d.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:b("requirements.heading")}),0===e.requirements.commands.length&&0===e.requirements.networkHosts.length?(0,d.jsx)("p",{className:"text-sm text-muted-foreground",children:b("plan.requirementsNone")}):(0,d.jsxs)("dl",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[e.requirements.commands.length>0&&(0,d.jsx)(q,{label:b("plan.requirementsCommands"),children:e.requirements.commands.map(a=>`${a.name} ${a.versionRange??b("plan.commandAnyVersion")}`).join(", ")}),e.requirements.networkHosts.length>0&&(0,d.jsx)(q,{label:b("plan.requirementsHosts"),children:e.requirements.networkHosts.join(", ")})]})]}),(0,d.jsxs)("section",{className:"space-y-2","data-testid":"skill-plan-scripts",children:[(0,d.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:b("plan.scriptsHeading")}),0===e.executablePaths.length&&0===e.scriptPaths.length?(0,d.jsx)("p",{className:"text-sm text-muted-foreground",children:b("plan.scriptsNone")}):(0,d.jsx)("ul",{className:"space-y-1",children:[...new Set([...e.scriptPaths,...e.executablePaths])].map(a=>(0,d.jsx)("li",{className:"break-all font-mono text-xs text-foreground",children:a},a))})]}),"compatible"!==h.status&&(0,d.jsx)(k.u,{tone:"warning","data-testid":"skill-plan-compatibility-notice",children:b((0,p.e5)(h.messageKey),{range:h.requiredRange,currentVersion:h.currentVersion??""})}),a.warnings.length>0&&(0,d.jsxs)("section",{className:"space-y-2","data-testid":"skill-plan-warnings",children:[(0,d.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:b("plan.warningsHeading")}),(0,d.jsx)("ul",{className:"space-y-1",children:a.warnings.map(a=>(0,d.jsx)("li",{className:"text-xs text-warning-foreground",children:p.RO[a]?b(p.RO[a]):a},a))})]}),(0,d.jsxs)("section",{className:"space-y-2","data-testid":"skill-plan-files",children:[(0,d.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:b("plan.filesHeading")}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"skill-plan-stats",children:b("plan.stats",{added:a.stats.added,modified:a.stats.modified,unchanged:a.stats.unchanged,conflicted:a.stats.conflicted,unmanaged:a.stats.unmanaged})}),0===a.files.length?(0,d.jsx)("p",{className:"text-sm text-muted-foreground",children:b("plan.filesEmpty")}):(0,d.jsx)("ul",{className:"space-y-2",children:a.files.map(a=>(0,d.jsx)(s,{entry:a},a.path))})]}),a.blockers.length>0&&(0,d.jsxs)("section",{className:"space-y-2","data-testid":"skill-install-blockers",children:[(0,d.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-danger-foreground",children:b("plan.blockersHeading")}),(0,d.jsx)("ul",{className:"space-y-1",children:a.blockers.map(a=>(0,d.jsxs)("li",{className:"text-xs text-danger-foreground",children:[a.path&&(0,d.jsx)("span",{className:"mr-1 break-all font-mono",children:a.path}),a.code.startsWith("skills.")?b((0,p.e5)(a.code),{range:h.requiredRange,currentVersion:h.currentVersion??""}):p.KL[a.code]?b(p.KL[a.code]):a.code]},`${a.code}:${a.path??""}`))}),(0,d.jsx)(k.u,{tone:"danger",children:b("plan.blockedNotice")})]})]})}function u({entry:a}){let b=(0,f.c)("skills"),c=p.Mj[a.disposition],e=p.hJ[a.reason];return(0,d.jsxs)("li",{className:"flex flex-wrap items-center gap-2","data-testid":`skill-uninstall-file-${a.path}`,children:[(0,d.jsx)(g.Ex,{variant:"remove"===a.disposition?"info":"warning",children:c?b(c):a.disposition}),(0,d.jsx)("span",{className:"break-all font-mono text-xs text-foreground",children:a.path}),e&&(0,d.jsx)("span",{className:"text-xs text-muted-foreground",children:b(e)})]})}function v({plan:a}){let b=(0,f.c)("skills"),{target:c,skill:e}=a;return(0,d.jsxs)(g.Zp,{className:"space-y-4","data-testid":"skill-uninstall-plan",children:[(0,d.jsxs)("div",{className:"space-y-1",children:[(0,d.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:b("uninstall.heading")}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:b("uninstall.expiresAt",{timestamp:a.expiresAt})})]}),(0,d.jsxs)("dl",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[(0,d.jsx)(q,{label:b("target.repository"),children:c.repositoryName}),(0,d.jsx)(q,{label:b("target.heading"),children:c.worktreeName}),(0,d.jsx)(q,{label:b("target.branch"),children:c.branch??b("target.branchUnknown")}),(0,d.jsx)(q,{label:b("uninstall.installedVersion"),children:(0,d.jsx)("span",{className:"font-mono text-xs",children:e.version||b("uninstall.versionUnknown")})}),(0,d.jsx)(q,{label:b("plan.installRoot"),children:(0,d.jsx)("span",{className:"break-all font-mono text-xs",children:c.installRoot})}),(0,d.jsx)(q,{label:b("target.workingTree"),children:c.workingTreeDirty?b("target.workingTreeDirty"):b("target.workingTreeClean")})]}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"skill-uninstall-stats",children:b("uninstall.stats",{removable:a.stats.removable,modified:a.stats.modified,missing:a.stats.missing,unknown:a.stats.unknown,irregular:a.stats.irregular})}),(0,d.jsxs)("section",{className:"space-y-2",children:[(0,d.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:b("uninstall.removalsHeading")}),0===a.removals.length?(0,d.jsx)("p",{className:"text-sm text-muted-foreground",children:b("uninstall.removalsEmpty")}):(0,d.jsx)("ul",{className:"space-y-1.5",children:a.removals.map(a=>(0,d.jsx)(u,{entry:a},a.path))})]}),(0,d.jsxs)("section",{className:"space-y-2",children:[(0,d.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:b("uninstall.retainedHeading")}),0===a.retained.length?(0,d.jsx)("p",{className:"text-sm text-muted-foreground",children:b("uninstall.retainedEmpty")}):(0,d.jsx)("ul",{className:"space-y-1.5",children:a.retained.map(a=>(0,d.jsx)(u,{entry:a},a.path))})]}),(0,d.jsxs)("div",{className:"space-y-2",children:[a.skill.agents.length>0&&(0,d.jsx)("div",{className:"flex flex-wrap gap-1.5","data-testid":"skill-uninstall-agents",children:a.skill.agents.map(a=>(0,d.jsx)(g.Ex,{variant:"gray",children:(0,h.f_)(a.agent)},a.agent))}),(0,d.jsx)(k.u,{tone:"neutral",children:b((0,p.e5)(a.nextActionKey))})]}),a.blockers.length>0&&(0,d.jsxs)("section",{className:"space-y-2","data-testid":"skill-uninstall-blockers",children:[(0,d.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-danger-foreground",children:b("uninstall.blockersHeading")}),(0,d.jsx)("ul",{className:"space-y-1",children:a.blockers.map(a=>(0,d.jsxs)("li",{className:"text-xs text-danger-foreground",children:[a.path&&(0,d.jsx)("span",{className:"mr-1 break-all font-mono",children:a.path}),b((0,p.e5)(a.messageKey))]},`${a.code}:${a.path??""}`))})]})]})}var w=c(30156);let x={worktreeId:null,busy:null,installPlan:null,uninstallPlan:null,installResult:null,uninstallResult:null,riskAcknowledged:!1,failure:null};function y(a){return{...a,installPlan:null,uninstallPlan:null,installResult:null,uninstallResult:null,riskAcknowledged:!1,failure:null}}function z({failure:a}){let b=(0,f.c)("skills");return(0,d.jsxs)("div",{className:"space-y-2","data-testid":"skill-operation-error",children:[(0,d.jsxs)(k.u,{tone:"danger",children:[(0,d.jsx)("p",{className:"font-medium",children:b("operation.errorHeading")}),(0,d.jsx)("p",{className:"mt-1",children:b((0,p.FW)(a.code))}),(0,d.jsx)("p",{className:"mt-1 break-words",children:b("state.errorCode",{code:a.code})})]}),a.nextActionKey&&(0,d.jsx)(k.u,{tone:"warning",children:b((0,p.e5)(a.nextActionKey))}),a.blockers&&a.blockers.length>0&&(0,d.jsx)("ul",{className:"space-y-1","data-testid":"skill-operation-error-blockers",children:a.blockers.map(a=>(0,d.jsxs)("li",{className:"text-xs text-danger-foreground",children:[a.path&&(0,d.jsx)("span",{className:"mr-1 break-all font-mono",children:a.path}),b((0,p.e5)(a.messageKey))]},`${a.code}:${a.path??""}`))})]})}function A({agents:a,skillId:b,version:c}){let e=(0,f.c)("skills");return 0===a.length?null:(0,d.jsxs)("div",{className:"space-y-1","data-testid":"skill-operation-reload",children:[(0,d.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:e("operation.reloadHeading")}),(0,d.jsx)("ul",{className:"space-y-1",children:a.map(a=>(0,d.jsx)("li",{className:"text-xs text-muted-foreground",children:e((0,p.e5)(a.messageKey),{agent:(0,h.f_)(a.agent),skillId:b,version:c})},a.agent))})]})}function B({skillId:a,version:b,blockedReason:c,worktreeId:h,agents:l=[]}){let n=(0,f.c)("skills"),[o,q]=(0,e.useState)(()=>h?{...x,worktreeId:h}:x),r=(0,e.useCallback)(a=>{q(b=>b.worktreeId===a?b:y({...b,worktreeId:a,busy:null}))},[]),s=(0,e.useCallback)(async()=>{let c=o.worktreeId;if(!c)return;q(a=>({...y(a),busy:"install-plan"}));let d=await (0,w.Q6)(c,a,{version:b??void 0});q(a=>({...a,busy:null,installPlan:d.ok?d.data.plan:null,failure:d.ok?null:d.failure}))},[a,o.worktreeId,b]),u=(0,e.useCallback)(async()=>{var b;let c=o.worktreeId,d=o.installPlan;if(!c||!d||d.requiresRiskAcknowledgement&&!o.riskAcknowledged)return;q(a=>({...a,busy:"install-apply",failure:null}));let e=await (0,w.Xi)(c,a,{planToken:d.token,version:d.skill.version,acknowledgeRisk:!!d.requiresRiskAcknowledgement||void 0,idempotencyKey:(b=d.token,`skill-install-${b}`)});e.ok&&(0,i.k)(c),q(a=>({...a,busy:null,installPlan:e.ok?null:a.installPlan,installResult:e.ok?e.data:null,failure:e.ok?null:e.failure}))},[a,o.installPlan,o.riskAcknowledged,o.worktreeId]),B=(0,e.useCallback)(async()=>{let b=o.worktreeId;if(!b)return;q(a=>({...y(a),busy:"uninstall-plan"}));let c=await (0,w.hN)(b,a);q(a=>({...a,busy:null,uninstallPlan:c.ok?c.data.plan:null,failure:c.ok?null:c.failure}))},[a,o.worktreeId]),C=(0,e.useCallback)(async()=>{var b;let c=o.worktreeId,d=o.uninstallPlan;if(!c||!d)return;q(a=>({...a,busy:"uninstall-apply",failure:null}));let e=await (0,w.E)(c,a,{planToken:d.token,idempotencyKey:(b=d.token,`skill-uninstall-${b}`)});q(a=>({...a,busy:null,uninstallPlan:e.ok?null:a.uninstallPlan,uninstallResult:e.ok?e.data:null,failure:e.ok?null:e.failure}))},[a,o.uninstallPlan,o.worktreeId]),D=(0,e.useCallback)(()=>{q(a=>y(a))},[]),E=null!==o.busy,F=o.installPlan,G=o.uninstallPlan,H=c??n(o.worktreeId?"plan.ready":"plan.chooseTarget"),I=null!==F&&F.requiresRiskAcknowledgement&&!o.riskAcknowledged;return(0,d.jsxs)("div",{className:"space-y-3","data-testid":"skill-install-panel",children:[!h&&(0,d.jsx)(m,{selectedWorktreeId:o.worktreeId,onSelect:r,disabled:E}),(0,d.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,d.jsx)(g.$n,{variant:"primary",disabled:E||null!==c||!o.worktreeId,onClick:s,"data-testid":"skill-install-action","aria-describedby":"skill-install-reason",children:n("install-plan"===o.busy?"plan.building":"plan.build")}),(0,d.jsx)(g.$n,{variant:"secondary",disabled:E||!o.worktreeId,onClick:B,"data-testid":"skill-uninstall-action",children:n("uninstall-plan"===o.busy?"uninstall.building":"uninstall.build")})]}),(0,d.jsx)("p",{id:"skill-install-reason",className:"text-sm text-muted-foreground","data-testid":"skill-install-reason",children:H}),l.length>0&&(0,d.jsxs)("div",{className:"space-y-1","data-testid":"skill-install-reload-preview",children:[(0,d.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:n("operation.reloadHeading")}),(0,d.jsx)("ul",{className:"space-y-1",children:l.map(a=>(0,d.jsx)(j.m,{agent:a,variant:"reload"},a.agent))})]}),o.failure&&(0,d.jsx)(z,{failure:o.failure}),F&&(0,d.jsxs)("div",{className:"space-y-3",children:[(0,d.jsx)(t,{plan:F}),F.requiresRiskAcknowledgement&&(0,d.jsxs)(g.Zp,{className:"space-y-3","data-testid":"skill-install-risk-acknowledgement",children:[(0,d.jsx)(k.u,{tone:"danger",children:n((0,p.e5)(F.riskAcknowledgementMessageKey??"skills.plan.highRiskAcknowledgement"))}),(0,d.jsxs)("label",{className:"flex items-start gap-2 text-sm text-foreground",children:[(0,d.jsx)(g.Sc,{checked:o.riskAcknowledged,onCheckedChange:a=>q(b=>({...b,riskAcknowledged:!0===a})),disabled:E,"data-testid":"skill-install-risk-checkbox",className:"mt-0.5"}),(0,d.jsx)("span",{children:n("plan.acknowledgeLabel")})]})]}),(0,d.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,d.jsx)(g.$n,{variant:F.requiresRiskAcknowledgement?"danger":"primary",disabled:E||!F.installable||I,onClick:u,"data-testid":"skill-install-confirm",children:n("install-apply"===o.busy?"plan.confirming":"plan.confirm")}),(0,d.jsx)(g.$n,{variant:"ghost",disabled:E,onClick:D,"data-testid":"skill-install-discard",children:n("plan.discard")})]})]}),G&&(0,d.jsxs)("div",{className:"space-y-3",children:[(0,d.jsx)(v,{plan:G}),(0,d.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,d.jsx)(g.$n,{variant:"danger",disabled:E||!G.removable,onClick:C,"data-testid":"skill-uninstall-confirm",children:n("uninstall-apply"===o.busy?"uninstall.confirming":"uninstall.confirm")}),(0,d.jsx)(g.$n,{variant:"ghost",disabled:E,onClick:D,"data-testid":"skill-uninstall-discard",children:n("plan.discard")})]})]}),o.installResult&&(0,d.jsxs)(g.Zp,{className:"space-y-3","data-testid":"skill-install-result",children:[(0,d.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:n("operation.installedHeading")}),(0,d.jsx)(k.u,{tone:"info",children:n((0,p.e5)(o.installResult.operation.nextActionKey))}),o.installResult.operation.replayed&&(0,d.jsx)(k.u,{tone:"neutral","data-testid":"skill-operation-replayed",children:n("operation.replayNotice")}),o.installResult.install&&"files"in o.installResult.install&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:n("operation.filesWritten",{count:o.installResult.install.files.length})}),"reload"in o.installResult&&(0,d.jsx)(A,{agents:o.installResult.reload.agents,skillId:o.installResult.reload.skillId,version:o.installResult.reload.version}),(0,d.jsx)(g.$n,{variant:"secondary",size:"sm",onClick:D,"data-testid":"skill-operation-reset",children:n("operation.startOver")})]}),o.uninstallResult&&(0,d.jsxs)(g.Zp,{className:"space-y-3","data-testid":"skill-uninstall-result",children:[(0,d.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:n("operation.uninstalledHeading")}),(0,d.jsx)(k.u,{tone:"info",children:n((0,p.e5)(o.uninstallResult.operation.nextActionKey))}),o.uninstallResult.operation.replayed&&(0,d.jsx)(k.u,{tone:"neutral","data-testid":"skill-operation-replayed",children:n("operation.replayNotice")}),o.uninstallResult.uninstall&&"removedFiles"in o.uninstallResult.uninstall&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:n("operation.filesRemoved",{count:o.uninstallResult.uninstall.removedFiles.length})}),"reload"in o.uninstallResult&&(0,d.jsx)(A,{agents:o.uninstallResult.reload.agents,skillId:o.uninstallResult.reload.skillId,version:o.uninstallResult.reload.version}),(0,d.jsx)(g.$n,{variant:"secondary",size:"sm",onClick:D,"data-testid":"skill-operation-reset",children:n("operation.startOver")})]})]})}},12894:(a,b,c)=>{c.d(b,{o:()=>d});function d(a){return a?a.split("/").map(encodeURIComponent).join("/"):""}},28593:(a,b,c)=>{c.d(b,{Xz:()=>j,qW:()=>k,uE:()=>l});var d=c(21124);c(38301);var e=c(20481),f=c(93983),g=c(8730),h=c(17252),i=c(27884);function j({status:a,className:b}){let c=(0,e.c)("skills");return(0,d.jsx)(g.Ex,{variant:i.H$[a],className:b,"data-testid":`skill-compatibility-${a}`,children:c(i.OV[a])})}function k({risk:a,className:b}){let c=(0,e.c)("skills");return(0,d.jsxs)(g.Ex,{variant:i.eK[a],className:b,"data-testid":`skill-declared-risk-${a}`,children:["high"===a&&(0,d.jsx)(f.A,{size:12,"aria-hidden":"true",className:"mr-1 shrink-0"}),c("risk.declaredLabel",{level:c(i.pP[a])})]})}function l({agent:a}){let b=(0,e.c)("skills");return(0,d.jsxs)(g.Ex,{variant:i.Et[a.support],"data-testid":`skill-agent-${a.agent}-${a.support}`,children:[(0,h.f_)(a.agent),": ",b((0,i.e5)(a.labelKey))]})}},62484:(a,b,c)=>{c.d(b,{i:()=>j});var d=c(21124),e=c(38301),f=c(63156),g=c(58970);function h(){return(0,d.jsx)("svg",{className:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})}function i(){return(0,d.jsx)("svg",{className:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})}function j({text:a,className:b="",label:c="Copy"}){let[j,k]=(0,e.useState)(!1),l=(0,e.useRef)(null),m=(0,e.useCallback)(async()=>{try{await (0,f.l)(a),k(!0),l.current&&clearTimeout(l.current),l.current=setTimeout(()=>k(!1),g.s7)}catch{}},[a]);return(0,d.jsxs)("button",{type:"button",onClick:m,className:`inline-flex items-center gap-1 rounded border border-border bg-surface px-2 py-0.5 text-[11px] font-medium text-foreground transition-colors hover:bg-muted ${b}`,"aria-label":j?"Copied":c,title:j?"Copied!":c,children:[j?(0,d.jsx)(i,{}):(0,d.jsx)(h,{}),(0,d.jsx)("span",{children:j?"Copied":c})]})}},63156:(a,b,c)=>{c.d(b,{l:()=>e});let d=/\x1b\[[0-9;]*[a-zA-Z]|\x1b\][^\x07]*\x07|\[[0-9;]*m/g;async function e(a){if(!a||0===a.trim().length)return;let b=a.replace(d,"");if(navigator.clipboard?.writeText)try{await navigator.clipboard.writeText(b);return}catch{}let c=document.createElement("textarea");c.value=b,c.style.position="fixed",c.style.left="-9999px",c.style.top="-9999px",c.style.opacity="0",document.body.appendChild(c),c.focus(),c.select();try{document.execCommand("copy")}finally{document.body.removeChild(c)}}},80855:(a,b,c)=>{c.d(b,{G8:()=>x});var d=c(21124),e=c(38301),f=c.n(e),g=c(20481),h=c(79206),i=c(18954),j=c(26295),k=c(29701),l=c(28752),m=c(37950);c(31230);var n=c(13973),o=c(17793);let p=(0,n.default)(async()=>{},{loadableGenerated:{modules:["components/worktree/MermaidCodeBlock.tsx -> ./MermaidDiagram"]},ssr:!1,loading:function(){let a=(0,g.c)("worktree");return(0,d.jsxs)("div",{className:"mermaid-loading flex items-center gap-2 text-muted-foreground p-4",children:[(0,d.jsx)(o.y,{size:"sm"}),(0,d.jsx)("span",{children:a("mermaid.loading")})]})}});function q({className:a,children:b}){if(a&&a.split(" ").includes("language-mermaid")){let a=null==b?"":"string"==typeof b?b:Array.isArray(b)?b.map(a=>"string"==typeof a?a:"").join(""):String(b);return(0,d.jsx)(p,{code:a})}return(0,d.jsx)("code",{className:a,children:b})}var r=c(9758),s=c(46831);function t(a,b){if(!b)return null;let c=a.substring(0,a.lastIndexOf("/")+1);try{let a=new URL(c,"file:///"),d=new URL(b,a),e=decodeURIComponent(d.pathname);if(e.startsWith("/")){let a=e.substring(1);if(a.length>0)return a}}catch{}return null}let u={...s.j,attributes:{...s.j.attributes,a:[...(s.j.attributes?.a??[]).filter(a=>"href"!==a),["href",/^(?:#|mailto:|tel:|https?:\/\/|(?![a-zA-Z][a-zA-Z0-9+.-]*:))/]],img:[...(s.j.attributes?.img??[]).filter(a=>"src"!==a),["src",/^(?:https?:\/\/|(?![a-zA-Z][a-zA-Z0-9+.-]*:))/],"alt","width","height"]}};var v=c(12894);function w({apiUrl:a,alt:b,width:c,height:f}){let h=(0,g.c)("worktree"),[i,j]=(0,e.useState)(null);return i?(0,d.jsx)("img",{src:i,alt:b,width:c,height:f,style:{maxWidth:c||"100%"}}):(0,d.jsx)("span",{style:{color:"#999"},children:h("markdownPreview.loadingImage")})}let x=(0,e.memo)(function({content:a,onOpenFile:b,currentFilePath:c,worktreeId:g}){let n=(0,e.useRef)(b);n.current=b;let o=(0,e.useRef)(c);o.current=c;let p=(0,e.useRef)(g);p.current=g;let s=(0,e.useCallback)((a,b)=>{let c=!b||0===b.length||b.length>2048||/[\x00-\x1f\x7f]/.test(b)?null:b;if(c)switch(c.startsWith("#")?"anchor":c.startsWith("http://")||c.startsWith("https://")||c.startsWith("mailto:")||c.startsWith("tel:")?"external":"relative"){case"anchor":break;case"external":a.preventDefault(),window.open(c,"_blank","noopener,noreferrer");break;case"relative":{a.preventDefault();let b=o.current,d=n.current;if(b&&d){let a=t(b,c);a&&d(a)}}}},[]),x=(0,e.useMemo)(()=>({code:q,pre:({children:a})=>!function(a){let b=f().Children.toArray(a)[0];if(!f().isValidElement(b))return!1;let c=b.props.className;return"string"==typeof c&&c.split(" ").includes("language-mermaid")}(a)?(0,d.jsx)(r.Ck,{children:(0,d.jsx)("pre",{className:"overflow-x-auto",children:a})}):(0,d.jsx)("pre",{children:a}),img:({src:a,alt:b,width:c,height:e,...f})=>{let g=c??f.node?.properties?.width,h=e??f.node?.properties?.height;if("string"==typeof a&&!a.startsWith("http://")&&!a.startsWith("https://")&&!a.startsWith("data:")){let c=o.current,e=p.current;if(c&&e){let f=t(c,a);if(f){let a=`/api/worktrees/${e}/files/${(0,v.o)(f)}`;return(0,d.jsx)(w,{apiUrl:a,alt:b??"",width:g,height:h})}}}return(0,d.jsx)("img",{src:a,alt:b??"",width:g,height:h,style:{maxWidth:g||"100%"}})},a:({href:a,children:b,...c})=>a?(0,d.jsx)("a",{...c,href:a,onClick:b=>s(b,a),children:b}):(0,d.jsx)("a",{...c,children:b})}),[s]),y=(0,e.useMemo)(()=>[i.A],[]),z=(0,e.useMemo)(()=>[j.A,[k.A,u],l.A,m.A],[]);return(0,d.jsx)(h.oz,{remarkPlugins:y,rehypePlugins:z,components:x,children:a})})},81136:(a,b,c)=>{c.d(b,{Co:()=>d,Ms:()=>f,td:()=>e});let d=".agents/skills",e=".claude/skills",f="skills.permissions.declarationOnlyNotice"},85389:(a,b,c)=>{c.d(b,{m:()=>j});var d=c(21124);c(38301);var e=c(20481),f=c(17252),g=c(3805),h=c(27884);function i({axis:a,agentName:b}){let c=(0,e.c)("skills");return(0,d.jsxs)("li",{className:"text-xs text-muted-foreground","data-testid":`skill-agent-axis-${a.axis}`,children:[(0,d.jsx)("span",{className:"font-medium text-foreground",children:c((0,h.e5)(a.axisKey))}),": ",(0,d.jsx)("span",{"data-testid":`skill-agent-axis-${a.axis}-${a.outcome}`,children:c((0,h.e5)(a.outcomeKey))})," — ",c((0,h.e5)(a.evidenceKindKey)),a.limitationKey&&(0,d.jsx)("span",{className:"mt-0.5 block","data-testid":`skill-agent-axis-${a.axis}-limitation`,children:c((0,h.e5)(a.limitationKey),{agent:b})})]})}function j({agent:a,variant:b="full"}){let c=(0,e.c)("skills"),j=(0,f.f_)(a.agent),k=a.measured;return"reload"===b?(0,d.jsx)("li",{className:"text-xs text-muted-foreground","data-testid":`skill-agent-reload-${a.agent}`,children:c((0,h.e5)(a.reloadKey),{agent:j})}):(0,d.jsxs)("div",{className:"space-y-1","data-testid":`skill-agent-evidence-${a.agent}`,children:[(0,d.jsx)("p",{className:"text-xs font-medium text-foreground",children:j}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground break-words",children:c("compatibility.declaredLabel",{support:c((0,h.e5)(a.declaredLabelKey))})}),(0,d.jsxs)("p",{className:"text-xs text-muted-foreground break-words",children:[c("compatibility.evidence"),": ",a.evidence]}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground break-words","data-testid":`skill-agent-verification-${a.agent}`,children:c((0,h.e5)(a.verificationKey))}),k?(0,d.jsxs)("div",{className:"space-y-0.5 border-l-2 border-border pl-2",children:[(0,d.jsx)("p",{className:"text-xs font-medium text-foreground",children:c("compatibility.measuredHeading")}),(0,d.jsxs)("ul",{className:"space-y-0.5",children:[(0,d.jsx)(i,{axis:k.discovery,agentName:j}),(0,d.jsx)(i,{axis:k.invocation,agentName:j})]}),k.testedVersion&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:c("compatibility.testedVersion",{agent:j,version:k.testedVersion})}),k.testedDate&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:c("compatibility.testedDate",{date:k.testedDate})}),k.discoveryRoots.length>0&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground break-all",children:c("compatibility.discoveryRoots",{roots:k.discoveryRoots.join(", ")})}),k.evidenceSource&&(0,d.jsxs)("p",{className:"text-xs text-muted-foreground break-all",children:[c("compatibility.evidenceSource"),": ",k.evidenceSource]}),k.stale&&(0,d.jsx)(g.u,{tone:"warning","data-testid":`skill-agent-evidence-stale-${a.agent}`,children:c("compatibility.evidenceStale",{days:k.ageDays??0})})]}):a.skipReasonKey&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground break-words","data-testid":`skill-agent-skip-reason-${a.agent}`,children:c((0,h.e5)(a.skipReasonKey))}),(0,d.jsxs)("p",{className:"text-xs text-muted-foreground break-words",children:[(0,d.jsx)("span",{className:"font-medium text-foreground",children:c("compatibility.reloadHeading",{agent:j})}),": ",c((0,h.e5)(a.reloadKey),{agent:j})]})]})}},90349:(a,b,c)=>{c.d(b,{I:()=>d,k:()=>e});let d="skill:installed";function e(a){}}};
@@ -0,0 +1 @@
1
+ "use strict";exports.id=8730,exports.ids=[8730],exports.modules={8730:(a,b,c)=>{c.d(b,{Ex:()=>o.E,$n:()=>d.$,Zp:()=>k,Wu:()=>n,aR:()=>l,ZB:()=>m,Sc:()=>B,TM:()=>r.TM,pd:()=>t,Jh:()=>q.a,z6:()=>E,CU:()=>F,l6:()=>Q,gC:()=>T,eb:()=>U,bq:()=>S,yv:()=>R,EA:()=>v.E,y$:()=>w.y,md:()=>p.m,dO:()=>x.d,tU:()=>I,av:()=>L,j7:()=>J,Xi:()=>K,k_:()=>u,j1:()=>s});var d=c(94260),e=c(21124),f=c(38301),g=c.n(f),h=c(26691),i=c(35595);let j=(0,h.F)("bg-surface text-surface-foreground rounded-lg border border-border shadow-sm",{variants:{variant:{default:"",elevated:"bg-gradient-to-b from-surface to-surface-2 shadow-md",interactive:"cursor-pointer transition-all duration-200 hover:border-accent-500 hover:shadow-md motion-safe:hover:-translate-y-0.5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:border-accent-500 focus-visible:shadow-md motion-safe:focus-visible:-translate-y-0.5"},hover:{true:"transition-shadow duration-200 hover:shadow-md",false:""},interactive:{true:"cursor-pointer transition-all duration-200 hover:shadow-lg active:shadow-md motion-safe:hover:-translate-y-0.5 motion-safe:active:translate-y-0",false:""},padding:{none:"",sm:"p-3",md:"p-4",lg:"p-6"}},defaultVariants:{variant:"default",hover:!1,interactive:!1,padding:"md"}});function k({variant:a="default",hover:b=!1,interactive:c=!1,padding:d="md",className:f="",children:g,...h}){return(0,e.jsx)("div",{className:(0,i.cn)(j({variant:a,hover:b,interactive:c,padding:d}),f),...h,children:g})}function l({className:a="",children:b,...c}){return(0,e.jsx)("div",{className:(0,i.cn)("mb-3",a),...c,children:b})}function m({className:a="",children:b,...c}){return(0,e.jsx)("h3",{className:(0,i.cn)("text-lg font-semibold text-surface-foreground",a),...c,children:b})}function n({className:a="",children:b,...c}){return(0,e.jsx)("div",{className:(0,i.cn)(a),...c,children:b})}var o=c(80755),p=c(22317),q=c(98033),r=c(79782);let s=(0,h.F)("flex w-full rounded-md border border-input bg-surface dark:bg-surface-2 text-surface-foreground shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:border-ring disabled:cursor-not-allowed disabled:opacity-50",{variants:{inputSize:{sm:"h-8 px-2.5 py-1 text-sm",md:"px-3 py-2 text-sm",lg:"px-4 py-2.5 text-base"}},defaultVariants:{inputSize:"md"}}),t=g().forwardRef(({className:a,inputSize:b,type:c="text",...d},f)=>(0,e.jsx)("input",{ref:f,type:c,className:(0,i.cn)(s({inputSize:b}),a),...d}));t.displayName="Input";let u=g().forwardRef(({className:a,...b},c)=>(0,e.jsx)("textarea",{ref:c,className:(0,i.cn)("flex min-h-[80px] w-full rounded-md border border-input bg-surface dark:bg-surface-2 px-3 py-2 text-sm text-surface-foreground shadow-sm","placeholder:text-muted-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:border-ring","disabled:cursor-not-allowed disabled:opacity-50",a),...b}));u.displayName="Textarea";var v=c(79689),w=c(17793),x=c(74892),y=c(89339),z=c(51881),A=c(71613);let B=g().forwardRef(({className:a,...b},c)=>(0,e.jsx)(y.bL,{ref:c,className:(0,i.cn)("peer inline-flex h-4 w-4 shrink-0 cursor-pointer items-center justify-center rounded-sm border border-input bg-surface text-surface-foreground shadow-sm transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50","data-[state=checked]:border-accent-600 data-[state=checked]:bg-accent-600 data-[state=checked]:text-white","data-[state=indeterminate]:border-accent-600 data-[state=indeterminate]:bg-accent-600 data-[state=indeterminate]:text-white",a),...b,children:(0,e.jsx)(y.C1,{className:"flex items-center justify-center text-current",children:"indeterminate"===b.checked?(0,e.jsx)(z.A,{className:"h-3 w-3",strokeWidth:3,"aria-hidden":"true"}):(0,e.jsx)(A.A,{className:"h-3 w-3",strokeWidth:3,"aria-hidden":"true"})})}));B.displayName="Checkbox";var C=c(64450),D=c(90133);let E=g().forwardRef(({className:a,...b},c)=>(0,e.jsx)(C.bL,{ref:c,className:(0,i.cn)("grid gap-2",a),...b}));E.displayName="RadioGroup";let F=g().forwardRef(({className:a,...b},c)=>(0,e.jsx)(C.q7,{ref:c,className:(0,i.cn)("aspect-square h-4 w-4 shrink-0 cursor-pointer rounded-full border border-input bg-surface text-accent-600 shadow-sm","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50","data-[state=checked]:border-accent-600",a),...b,children:(0,e.jsx)(C.C1,{className:"flex items-center justify-center",children:(0,e.jsx)(D.A,{className:"h-2 w-2 fill-accent-600 text-accent-600","aria-hidden":"true"})})}));F.displayName="RadioGroupItem";var G=c(89989);let H=g().createContext("underline"),I=g().forwardRef(({variant:a="underline",...b},c)=>(0,e.jsx)(H.Provider,{value:a,children:(0,e.jsx)(G.bL,{ref:c,...b})}));I.displayName="Tabs";let J=g().forwardRef(({className:a,...b},c)=>{let d=g().useContext(H);return(0,e.jsx)(G.B8,{ref:c,className:(0,i.cn)("inline-flex items-center","pill"===d?"gap-1 rounded-lg bg-muted p-1":"gap-4 border-b border-border",a),...b})});J.displayName="TabsList";let K=g().forwardRef(({className:a,...b},c)=>{let d=g().useContext(H);return(0,e.jsx)(G.l9,{ref:c,className:(0,i.cn)("inline-flex items-center justify-center whitespace-nowrap text-sm font-medium transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","disabled:pointer-events-none disabled:opacity-50","pill"===d?"rounded-md px-3 py-1.5 text-muted-foreground data-[state=active]:bg-surface data-[state=active]:text-surface-foreground data-[state=active]:shadow-sm":"-mb-px border-b-2 border-transparent px-1 py-2 text-muted-foreground hover:text-foreground data-[state=active]:border-accent-500 data-[state=active]:text-accent-600",a),...b})});K.displayName="TabsTrigger";let L=g().forwardRef(({className:a,...b},c)=>(0,e.jsx)(G.UC,{ref:c,className:(0,i.cn)("mt-2 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",a),...b}));L.displayName="TabsContent";var M=c(39567),N=c(85351),O=c(82042),P=c(11010);let Q=M.bL;M.YJ;let R=M.WT,S=g().forwardRef(({className:a,children:b,...c},d)=>(0,e.jsxs)(M.l9,{ref:d,className:(0,i.cn)("flex h-9 w-full items-center justify-between gap-2 rounded-md border border-input bg-surface dark:bg-surface-2 px-3 py-2 text-sm text-surface-foreground shadow-sm","placeholder:text-muted-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:border-ring","disabled:cursor-not-allowed disabled:opacity-50","[&>span]:line-clamp-1",a),...c,children:[b,(0,e.jsx)(M.In,{asChild:!0,children:(0,e.jsx)(N.A,{size:16,className:"opacity-60","aria-hidden":"true"})})]}));S.displayName="SelectTrigger";let T=g().forwardRef(({className:a,children:b,position:c="popper",...d},f)=>(0,e.jsx)(M.ZL,{children:(0,e.jsxs)(M.UC,{ref:f,position:c,style:{zIndex:P.M.POPOVER},className:(0,i.cn)("relative max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-hidden rounded-md border border-border bg-surface text-surface-foreground shadow-lg","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2","data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2","popper"===c&&"data-[side=bottom]:translate-y-1 data-[side=top]:-translate-y-1",a),...d,children:[(0,e.jsx)(M.PP,{className:"flex h-6 items-center justify-center",children:(0,e.jsx)(O.A,{size:16,"aria-hidden":"true"})}),(0,e.jsx)(M.LM,{className:(0,i.cn)("p-1","popper"===c&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:b}),(0,e.jsx)(M.wn,{className:"flex h-6 items-center justify-center",children:(0,e.jsx)(N.A,{size:16,"aria-hidden":"true"})})]})}));T.displayName="SelectContent",g().forwardRef(({className:a,...b},c)=>(0,e.jsx)(M.JU,{ref:c,className:(0,i.cn)("px-2 py-1.5 text-xs font-semibold text-muted-foreground",a),...b})).displayName="SelectLabel";let U=g().forwardRef(({className:a,children:b,...c},d)=>(0,e.jsxs)(M.q7,{ref:d,className:(0,i.cn)("relative flex w-full cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none","focus:bg-muted focus:text-surface-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a),...c,children:[(0,e.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,e.jsx)(M.VF,{children:(0,e.jsx)(A.A,{size:16,"aria-hidden":"true"})})}),(0,e.jsx)(M.p4,{children:b})]}));U.displayName="SelectItem",g().forwardRef(({className:a,...b},c)=>(0,e.jsx)(M.wv,{ref:c,className:(0,i.cn)("-mx-1 my-1 h-px bg-border",a),...b})).displayName="SelectSeparator";var V=c(16992);V.Kq,V.bL,V.l9,g().forwardRef(({className:a,sideOffset:b=4,children:c,...d},f)=>(0,e.jsx)(V.ZL,{children:(0,e.jsxs)(V.UC,{ref:f,sideOffset:b,style:{zIndex:P.M.POPOVER},className:(0,i.cn)("overflow-hidden rounded-md bg-foreground px-2.5 py-1.5 text-xs text-background shadow-md","animate-in fade-in-0 zoom-in-95","data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95","data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2","data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",a),...d,children:[c,(0,e.jsx)(V.i3,{className:"fill-foreground"})]})})).displayName="TooltipContent",c(10290),c(85647)},10290:(a,b,c)=>{c.d(b,{Hr:()=>q,Ht:()=>p,SQ:()=>n,_2:()=>o,mB:()=>r,rI:()=>l,ty:()=>m});var d=c(21124),e=c(38301),f=c.n(e),g=c(12927),h=c(71613),i=c(90133),j=c(11010),k=c(35595);let l=g.bL,m=g.l9;g.YJ;let n=f().forwardRef(({className:a,sideOffset:b=4,...c},e)=>(0,d.jsx)(g.ZL,{children:(0,d.jsx)(g.UC,{ref:e,sideOffset:b,style:{zIndex:j.M.POPOVER},className:(0,k.cn)("min-w-[8rem] overflow-hidden rounded-md border border-border bg-surface p-1 text-surface-foreground shadow-lg","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2","data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",a),...c})}));n.displayName="DropdownMenuContent";let o=f().forwardRef(({className:a,inset:b,...c},e)=>(0,d.jsx)(g.q7,{ref:e,className:(0,k.cn)("relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none","focus:bg-muted focus:text-surface-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",b&&"pl-8",a),...c}));o.displayName="DropdownMenuItem",f().forwardRef(({className:a,children:b,checked:c,...e},f)=>(0,d.jsxs)(g.H_,{ref:f,checked:c,className:(0,k.cn)("relative flex cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none","focus:bg-muted focus:text-surface-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a),...e,children:[(0,d.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,d.jsx)(g.VF,{children:(0,d.jsx)(h.A,{size:16,"aria-hidden":"true"})})}),b]})).displayName="DropdownMenuCheckboxItem";let p=f().forwardRef(({className:a,children:b,...c},e)=>(0,d.jsxs)(g.hN,{ref:e,className:(0,k.cn)("relative flex cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none","focus:bg-muted focus:text-surface-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a),...c,children:[(0,d.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,d.jsx)(g.VF,{children:(0,d.jsx)(i.A,{size:8,className:"fill-current","aria-hidden":"true"})})}),b]}));p.displayName="DropdownMenuRadioItem";let q=g.z6;f().forwardRef(({className:a,inset:b,...c},e)=>(0,d.jsx)(g.JU,{ref:e,className:(0,k.cn)("px-2 py-1.5 text-xs font-semibold text-muted-foreground",b&&"pl-8",a),...c})).displayName="DropdownMenuLabel";let r=f().forwardRef(({className:a,...b},c)=>(0,d.jsx)(g.wv,{ref:c,className:(0,k.cn)("-mx-1 my-1 h-px bg-border",a),...b}));r.displayName="DropdownMenuSeparator"},22317:(a,b,c)=>{c.d(b,{m:()=>l});var d=c(21124);c(38301);var e=c(20481),f=c(35595);let g={idle:{colorClass:"bg-muted-foreground",labelKey:"status.idle"},ready:{colorClass:"bg-success",labelKey:"status.ready"},running:{colorClass:"bg-success text-success ring-2 ring-success/40",animationClass:"animate-status-glow",labelKey:"status.running"},generating:{colorClass:"bg-success text-success ring-2 ring-success/40",animationClass:"animate-status-glow",labelKey:"status.generating"},waiting:{colorClass:"bg-warning text-warning ring-4 ring-warning/50",animationClass:"animate-status-attention",labelKey:"status.waiting"},error:{colorClass:"bg-danger",labelKey:"status.error"}},h={colorClass:"bg-warning text-warning ring-2 ring-warning/40",animationClass:"animate-status-glow",labelKey:"status.waiting"},i=new Set(["menu","unclassified"]),j={colorClass:"bg-muted-foreground",labelKey:"status.unknown"},k={sm:"w-2 h-2",md:"w-2.5 h-2.5",lg:"w-3 h-3"};function l({status:a,size:b="md",label:c,waitingKind:l,className:m,...n}){let o=(0,e.c)("common"),p=function(a,b){let c=g[a]??j;return"waiting"!==a?c:b&&i.has(b)?h:c}(a,l),q=c??o(p.labelKey);return(0,d.jsx)("span",{className:(0,f.cn)("inline-block flex-shrink-0 rounded-full",k[b],p.colorClass,p.animationClass,m),title:q,"aria-label":q,...n})}},74892:(a,b,c)=>{c.d(b,{d:()=>i});var d=c(21124),e=c(38301),f=c.n(e),g=c(75441),h=c(35595);let i=f().forwardRef(({className:a,...b},c)=>(0,d.jsx)(g.bL,{ref:c,className:(0,h.cn)("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50","data-[state=checked]:bg-accent-600 data-[state=unchecked]:bg-muted",a),...b,children:(0,d.jsx)(g.zi,{className:(0,h.cn)("pointer-events-none block h-4 w-4 rounded-full bg-surface shadow-lg ring-0 transition-transform","data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));i.displayName="Switch"},79689:(a,b,c)=>{c.d(b,{E:()=>f});var d=c(21124);c(38301);var e=c(35595);function f({className:a,...b}){return(0,d.jsx)("div",{className:(0,e.cn)("animate-pulse rounded-md bg-muted",a),"aria-hidden":"true",...b})}},80755:(a,b,c)=>{c.d(b,{E:()=>i});var d=c(21124);c(38301);var e=c(26691),f=c(35595);let g=(0,e.F)("inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium",{variants:{variant:{success:"bg-success-subtle text-success-foreground",warning:"bg-warning-subtle text-warning-foreground",error:"bg-danger-subtle text-danger-foreground",info:"bg-accent-100 dark:bg-accent-900 text-accent-800 dark:text-accent-300",gray:"bg-muted text-muted-foreground"}},defaultVariants:{variant:"gray"}}),h={success:"bg-success",warning:"bg-warning",error:"bg-danger",info:"bg-info",gray:"bg-muted-foreground"};function i({variant:a="gray",dot:b=!1,className:c="",children:e,...i}){return(0,d.jsxs)("span",{className:(0,f.cn)(g({variant:a}),c),...i,children:[b&&(0,d.jsx)("span",{className:(0,f.cn)("mr-1.5 inline-block h-2 w-2 rounded-full",h[a]),"aria-hidden":"true"}),e]})}},85647:(a,b,c)=>{c.d(b,{u:()=>f});var d=c(21124);c(38301);var e=c(35595);function f({className:a,children:b,...c}){return(0,d.jsx)("kbd",{className:(0,e.cn)("inline-flex h-5 min-w-[1.25rem] items-center justify-center rounded-sm border border-border bg-surface px-1","font-mono text-[10px] font-medium leading-none text-muted-foreground",a),...c,children:b})}}};
@@ -8,7 +8,7 @@
8
8
  flex items-center justify-between
9
9
  hover:bg-sidebar-hover transition-colors
10
10
  ${a===c.key?"text-accent-700 dark:text-accent-400":"text-sidebar-muted"}
11
- `,children:[(0,d.jsx)("span",{children:c.label}),a===c.key&&(0,d.jsx)("span",{className:"text-xs",children:"asc"===b?"ASC":"DESC"})]},c.key))})]})});function V({className:a}){return(0,d.jsx)("svg",{className:a,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 4h13M3 8h9m-9 4h6m4 0l4-4m0 0l4 4m-4-4v12"})})}function W({className:a}){return(0,d.jsx)("svg",{className:a,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 15l7-7 7 7"})})}function X({className:a}){return(0,d.jsx)("svg",{className:a,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})}let Y=[{key:"updatedAt",labelKey:"sort.updatedAt"},{key:"repositoryName",labelKey:"sort.repositoryName"},{key:"branchName",labelKey:"sort.branchName"},{key:"status",labelKey:"sort.status"}],Z={updatedAt:"desc"},$=(0,e.memo)(function(){let{sortKey:a,sortDirection:b,setSortKey:c,setSortDirection:f}=(0,A.VF)(),g=(0,l.c)("common"),h=(0,e.useMemo)(()=>Y.map(({key:a,labelKey:b})=>({key:a,label:g(b)})),[g]);return(0,d.jsx)(U,{sortKey:a,sortDirection:b,onSortKeyChange:c,onSortDirectionChange:f,options:h,defaultDirections:Z,compact:!0,tooltip:g("tooltips.sort"),iconClassName:"w-4 h-4"})});var _=c(73451),aa=c(81497),ab=c(55992);let ac=["en","ja"],ad={en:"English",ja:"日本語"};function ae(){return{currentLocale:(0,ab.Ym)(),switchLocale:a=>{if(ac.includes(a)){let b="https:"===window.location.protocol;document.cookie=`locale=${a};path=/;max-age=31536000;SameSite=Lax${b?";Secure":""}`,localStorage.setItem("locale",a),window.location.reload()}}}}function af(){let{currentLocale:a,switchLocale:b}=ae(),c=(0,l.c)("common");return(0,d.jsx)("select",{value:a,onChange:a=>b(a.target.value),"data-testid":"locale-switcher","aria-label":c("language"),className:" w-full px-3 py-2 rounded-md bg-sidebar text-sidebar-foreground border border-sidebar-border focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent text-sm ",children:ac.map(a=>(0,d.jsx)("option",{value:a,children:ad[a]},a))})}var ag=c(84342);function ah(){let a=(0,l.c)("auth"),b=(0,ag.H)(),[c,f]=(0,e.useState)(!1);if(!b)return null;async function g(){f(!0);try{await fetch("/api/auth/logout",{method:"POST"}),window.location.href="/login"}catch{window.location.href="/login"}}return(0,d.jsx)("button",{type:"button",onClick:g,disabled:c,"data-testid":"logout-button",className:" w-full px-3 py-2 text-sm text-left rounded-md text-muted-foreground hover:text-foreground hover:bg-muted focus:outline-none focus:ring-2 focus:ring-ring disabled:opacity-50 transition-colors ",children:c?"...":a("logout.button")})}var ai=c(63474),aj=c(77560),ak=c(19463);function al(){let a=(0,l.c)("common"),{count:b}=(0,ak.Lv)();return 0===b?null:(0,d.jsxs)(i(),{href:aj.ks,"data-testid":"attention-badge","aria-label":a("attention.badgeLabel",{count:b}),className:"mt-2 inline-flex w-full items-center justify-between gap-2 rounded-md border border-warning-border bg-warning-subtle px-2 py-1 text-xs font-medium text-warning-foreground transition-colors hover:brightness-105 focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[(0,d.jsx)("span",{className:"min-w-0 truncate",children:a("attention.label")}),(0,d.jsx)("span",{"data-testid":"attention-badge-count",className:"tabular-nums font-semibold",children:b})]})}function am({count:a}){let b=(0,l.c)("common");return 0===a?null:(0,d.jsx)("span",{"data-testid":"attention-badge-bubble",role:"status","aria-label":b("attention.badgeLabel",{count:a}),className:"absolute -top-1.5 -right-2.5 min-w-[1.05rem] rounded-full bg-warning-foreground px-1 text-[0.625rem] font-bold leading-[1.05rem] text-warning-subtle tabular-nums text-center",children:a>99?"99+":a})}var an=c(78352),ao=c(32482);let ap="w-4 h-4",aq=0,ar=null;function as(){return ar??[]}let at=(0,e.memo)(function(){let a=(0,j.Hq)(),{worktrees:b,repositories:c,selectedWorktreeId:f,selectWorktree:g,refreshWorktrees:h}=(0,J.$f)(),{closeMobileDrawer:k,sortKey:m,sortDirection:n,viewMode:o,setViewMode:p}=(0,A.VF)(),q=(0,l.c)("common"),[r,s]=(0,e.useState)(""),u=(0,e.useRef)(null),[v,w]=(0,e.useState)(()=>({})),[x,y]=(0,e.useState)(as),z=(0,e.useRef)(!1);(0,e.useEffect)(()=>{z.current||(z.current=!0,fetch("/api/sidebar/group-order").then(a=>a.json()).then(a=>{a.success&&Array.isArray(a.order)&&(y(a.order),ar=a.order)}).catch(()=>{}))},[]);let B=(0,e.useMemo)(()=>(0,ao.UZ)(c),[c]),C=(0,e.useMemo)(()=>(0,ao.s6)(b,B),[b,B]),D=(0,e.useMemo)(()=>C.map(M.XK),[C]),E=(0,e.useDeferredValue)(D),I=(0,e.useRef)(null),K=(0,e.useRef)(null);(0,e.useEffect)(()=>()=>{null!==K.current&&clearTimeout(K.current)},[]);let L=(0,e.useMemo)(()=>{let a=I.current;return!a||Date.now()>=a.expiresAt?E:a.items},[E]),N=(0,e.useRef)(L);(0,e.useLayoutEffect)(()=>{N.current=L});let O=(0,e.useCallback)(()=>{null!==K.current&&(clearTimeout(K.current),K.current=null);let a=I.current;if(a&&Date.now()<a.expiresAt){I.current={...a,expiresAt:1/0};return}I.current={items:N.current,expiresAt:1/0}},[]),P=(0,e.useCallback)(()=>{I.current&&(I.current={...I.current,expiresAt:Date.now()+1e3},null!==K.current&&clearTimeout(K.current),K.current=setTimeout(()=>{I.current=null},1e3))},[]),{sortedItems:Q,groupedItems:T}=function(a){let{items:b,sortKey:c,sortDirection:d,viewMode:f,filterText:g}=a,h=(0,e.useMemo)(()=>{if(!g)return b;let a=g.toLowerCase();return b.filter(b=>b.name.toLowerCase().includes(a)||b.repositoryName.toLowerCase().includes(a))},[b,g]);return{sortedItems:(0,e.useMemo)(()=>(0,ao.Xn)(h,c,d),[h,c,d]),groupedItems:(0,e.useMemo)(()=>"grouped"===f?(0,ao._s)(h,c,d):[],[h,c,d,f])}}({items:L,sortKey:m,sortDirection:n,viewMode:o,filterText:r}),U=(0,e.useMemo)(()=>{if("grouped"!==o||!T)return null;if(r.trim()||0===x.length)return T;let a=new Map(x.map((a,b)=>[a,b]));return[...T].sort((b,c)=>{let d=a.has(b.repositoryName)?a.get(b.repositoryName):1/0,e=a.has(c.repositoryName)?a.get(c.repositoryName):1/0;return d===e?b.repositoryName.localeCompare(c.repositoryName):d-e})},[o,T,x,r]),V="grouped"===o?U:null;(0,e.useEffect)(()=>{},[v]);let W=(0,e.useCallback)(a=>{w(b=>({...b,[a]:!b[a]}))},[]),X=(0,e.useCallback)(()=>{var a;aq=Number.isFinite(a=u.current?.scrollTop??0)&&a>0?a:0},[]),Y=Q.length>0||(V?.length??0)>0;(0,e.useEffect)(()=>{let a=u.current;if(!a)return;let b=window.requestAnimationFrame(()=>{a.scrollTop=aq});return()=>{window.cancelAnimationFrame(b)}},[Y,o]);let Z=(0,e.useCallback)(b=>{X(),g(b),a.push(`/worktrees/${b}`),k()},[X,g,a,k]),aa=(0,G.FR)((0,G.MS)(G.AN,{activationConstraint:{distance:8}})),ab=(0,e.useCallback)(a=>{let{active:b,over:c}=a;if(!c||b.id===c.id||!V)return;let d=V.map(a=>a.repositoryName),e=d.indexOf(String(b.id)),f=d.indexOf(String(c.id));if(-1===e||-1===f)return;let g=(0,H.be)(d,e,f);y(g),ar=g,fetch("/api/sidebar/group-order",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({order:g})}).catch(()=>{y(d),ar=d})},[V]),ac="flat"===o?0===Q.length:(V?.length??0)===0;return(0,d.jsxs)("nav",{"data-testid":"sidebar","aria-label":q("sidebar.branchNavigation"),className:"h-full flex flex-col bg-sidebar text-sidebar-foreground",role:"navigation",children:[(0,d.jsxs)("div",{"data-testid":"sidebar-header",className:"flex-shrink-0 px-4 py-4 border-b border-sidebar-border",children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-y-2",children:[(0,d.jsx)("h2",{className:"min-w-0 truncate text-lg font-semibold text-sidebar-foreground",children:q("sidebar.branches")}),(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-1",children:[(0,d.jsx)(aw,{viewMode:o,onToggle:p}),(0,d.jsx)($,{}),(0,d.jsx)(aC,{refreshWorktrees:h}),(0,d.jsx)(S.m_,{content:q("tooltips.repositories"),placement:"bottom",children:(0,d.jsx)(i(),{href:"/repositories","aria-label":q("nav.repositories"),className:"p-1 rounded-md text-sidebar-muted hover:text-sidebar-foreground hover:bg-sidebar-hover focus:outline-none focus:ring-2 focus:ring-ring transition-colors inline-flex items-center",children:(0,d.jsx)(F.A,{className:ap,"aria-hidden":"true"})})})]})]}),(0,d.jsx)(al,{})]}),(0,d.jsx)("div",{className:"flex-shrink-0 px-4 py-3 border-b border-sidebar-border",children:(0,d.jsx)(_.pd,{type:"text",placeholder:q("sidebar.searchBranches"),value:r,onChange:a=>s(a.target.value),className:"bg-background shadow-none"})}),(0,d.jsx)("div",{ref:u,"data-testid":"branch-list",onScroll:X,onMouseEnter:O,onMouseLeave:P,className:"flex-1 overflow-y-auto overflow-x-hidden",children:ac?(0,d.jsx)("div",{className:"px-4 py-8 text-center text-sidebar-muted",children:q(r?"sidebar.noBranchesFound":"sidebar.noBranchesAvailable")}):"grouped"===o&&V?(0,d.jsx)(G.Mp,{sensors:aa,collisionDetection:G.fp,onDragEnd:ab,children:(0,d.jsx)(H.gB,{items:V.map(a=>a.repositoryName),strategy:H._G,children:V.map(a=>{let b=!v[a.repositoryName]||!!r.trim();return(0,d.jsx)(au,{group:a,isExpanded:b,selectedWorktreeId:f,onToggle:()=>W(a.repositoryName),onBranchClick:Z,isDragDisabled:!!r.trim()},a.repositoryName)})})}):Q.map(a=>(0,d.jsx)(R,{branch:a,isSelected:a.id===f,onClick:()=>Z(a.id)},a.id))}),(0,d.jsxs)("div",{className:"flex-shrink-0 px-4 py-3 border-t border-sidebar-border space-y-2",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("div",{className:"flex-1",children:(0,d.jsx)(af,{})}),(0,d.jsx)(t,{})]}),(0,d.jsx)(ah,{})]})]})});function au({group:a,isExpanded:b,selectedWorktreeId:c,onToggle:e,onBranchClick:f,isDragDisabled:g}){let{attributes:h,listeners:i,setNodeRef:j,setActivatorNodeRef:k,transform:l,transition:m,isDragging:n}=(0,H.gl)({id:a.repositoryName,disabled:g}),o={transform:I.Ks.Transform.toString(l),transition:m,opacity:n?.5:1};return(0,d.jsxs)("div",{ref:j,style:o,className:"w-full min-w-0",children:[(0,d.jsx)(av,{repositoryName:a.repositoryName,branchCount:a.branches.length,isExpanded:b,onClick:e,dragHandleRef:k,dragHandleListeners:g?void 0:i,dragHandleAttributes:g?void 0:h}),b&&a.branches.map(a=>(0,d.jsx)(R,{branch:a,isSelected:a.id===c,onClick:()=>f(a.id),showRepositoryName:!1},a.id))]})}function av({repositoryName:a,branchCount:b,isExpanded:c,onClick:e,dragHandleRef:f,dragHandleListeners:g,dragHandleAttributes:h}){let i=(0,l.c)("common");return(0,d.jsxs)("div",{className:"flex items-center w-full",children:[g&&(0,d.jsx)("div",{ref:f,...g,...h,"aria-label":i("sidebar.dragToReorderGroup"),className:" flex-shrink-0 flex items-center justify-center w-6 h-full pl-2 cursor-grab active:cursor-grabbing text-sidebar-muted hover:text-sidebar-foreground transition-colors ",children:(0,d.jsx)(aA,{})}),(0,d.jsxs)("button",{"data-testid":"group-header",type:"button",onClick:e,"aria-expanded":c,className:" flex-1 min-w-0 flex items-center gap-2 px-2 py-2 text-xs font-semibold text-sidebar-muted uppercase tracking-wider focus:outline-none focus:ring-2 focus:ring-inset focus:ring-ring transition-colors ",children:[(0,d.jsx)(ax,{isExpanded:c}),(0,d.jsx)(ay,{color:(0,ao.LV)(a)}),(0,d.jsx)(aa.nR,{content:a,className:"flex-1 min-w-0 text-left truncate",children:a}),(0,d.jsx)("span",{className:"text-sidebar-muted font-normal tabular-nums pr-2",children:b})]})]})}function aw({viewMode:a,onToggle:b}){let c=(0,l.c)("common");return(0,d.jsx)(S.m_,{content:c("tooltips.viewMode"),placement:"bottom",children:(0,d.jsx)("button",{"data-testid":"view-mode-toggle",type:"button",onClick:()=>{b("grouped"===a?"flat":"grouped")},"aria-label":c("grouped"===a?"sidebar.switchToFlatView":"sidebar.switchToGroupedView"),className:" p-1 rounded-md text-sidebar-muted hover:text-sidebar-foreground hover:bg-sidebar-hover focus:outline-none focus:ring-2 focus:ring-ring transition-colors ",children:"grouped"===a?(0,d.jsx)(az,{className:ap}):(0,d.jsx)(ay,{className:ap})})})}function ax({isExpanded:a}){return(0,d.jsx)("svg",{className:`w-3 h-3 flex-shrink-0 transition-transform ${a?"rotate-90":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})})}function ay({className:a="w-3.5 h-3.5",color:b}){return(0,d.jsx)("svg",{className:`${a} flex-shrink-0`,viewBox:"0 0 24 24",fill:b??"none",stroke:b?"none":"currentColor",strokeWidth:2*!b,"aria-hidden":"true",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"})})}function az({className:a="w-3 h-3"}){return(0,d.jsx)("svg",{className:a,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6h16M4 12h16M4 18h16"})})}function aA(){return(0,d.jsxs)("svg",{className:"w-3 h-3",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,d.jsx)("circle",{cx:"9",cy:"5",r:"1.5"}),(0,d.jsx)("circle",{cx:"15",cy:"5",r:"1.5"}),(0,d.jsx)("circle",{cx:"9",cy:"12",r:"1.5"}),(0,d.jsx)("circle",{cx:"15",cy:"12",r:"1.5"}),(0,d.jsx)("circle",{cx:"9",cy:"19",r:"1.5"}),(0,d.jsx)("circle",{cx:"15",cy:"19",r:"1.5"})]})}function aB({className:a=""}){return(0,d.jsx)("svg",{className:`${ap} ${a}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 4v5h5M20 20v-5h-5M20.49 9A9 9 0 005.64 5.64L4 4m16 16l-1.64-1.64A9 9 0 014.51 15"})})}let aC=(0,e.memo)(function({refreshWorktrees:a}){let[b,c]=(0,e.useState)(!1),f=(0,e.useRef)(!1),{showToast:g}=(0,ai.dj)(),h=(0,l.c)("common"),i=(0,e.useCallback)(async()=>{if(!f.current){f.current=!0,c(!0);try{let b=await an.Rx.sync();await a(),g(h("syncSuccess",{count:b.worktreeCount}),"success",3e3)}catch(a){a instanceof an.hD&&401===a.status?g(h("syncAuthError"),"error",5e3):g(h("syncError"),"error",5e3)}finally{f.current=!1,c(!1)}}},[a,g,h]);return(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(S.m_,{content:h("tooltips.sync"),placement:"bottom",children:(0,d.jsx)("button",{type:"button",onClick:i,disabled:b,"aria-label":h("syncButtonLabel"),className:"p-1 rounded-md text-sidebar-muted hover:text-sidebar-foreground hover:bg-sidebar-hover focus:outline-none focus:ring-2 focus:ring-ring disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:(0,d.jsx)(aB,{className:b?"animate-spin":""})})})})});var aD=c(78733),aE=c(44688),aF=c(75903),aG=c(59268),aH=c(38882);let aI=[{labelKey:"nav.home",href:"/",isActive:a=>"/"===a,icon:(0,d.jsx)(aD.A,{size:20,"aria-hidden":"true"})},{labelKey:"nav.chat",href:"/chat",isActive:a=>a.startsWith("/chat"),icon:(0,d.jsx)(aE.A,{size:20,"aria-hidden":"true"})},{labelKey:"nav.sessions",href:"/sessions",isActive:a=>a.startsWith("/sessions"),icon:(0,d.jsx)(aF.A,{size:20,"aria-hidden":"true"})},{labelKey:"nav.review",href:"/review",isActive:a=>a.startsWith("/review"),icon:(0,d.jsx)(aG.A,{size:20,"aria-hidden":"true"}),showsAttentionBadge:!0},{labelKey:"nav.more",href:"/more",isActive:a=>a.startsWith("/more"),icon:(0,d.jsx)(aH.A,{size:20,"aria-hidden":"true"})}];function aJ(){let a=(0,g.usePathname)(),{setOpen:b}=(0,x.C)(),c=(0,l.c)("commandPalette"),e=(0,l.c)("common"),{count:f}=(0,ak.Lv)();return(0,d.jsx)("nav",{"data-testid":"global-mobile-nav",className:"fixed bottom-0 left-0 right-0 z-50 border-t border-border bg-background supports-[backdrop-filter]:bg-background/80 backdrop-blur-md pb-safe",children:(0,d.jsxs)("div",{className:"flex items-center justify-around h-14",children:[aI.map(b=>{let c=b.isActive(a),g=!0===b.showsAttentionBadge&&f>0;return(0,d.jsxs)(k,{href:g?aj.ks:b.href,className:`flex flex-col items-center justify-center flex-1 h-full text-xs transition-colors ${c?"text-accent-600 dark:text-accent-400":"text-muted-foreground hover:text-foreground"}`,children:[(0,d.jsxs)("span",{className:"relative inline-flex",children:[b.icon,!0===b.showsAttentionBadge&&(0,d.jsx)(am,{count:f})]}),(0,d.jsx)("span",{className:"mt-1 whitespace-nowrap",children:e(b.labelKey)})]},b.href)}),(0,d.jsxs)("button",{type:"button","data-testid":"mobile-command-palette-trigger",onClick:()=>b(!0),"aria-label":c("mobileTrigger"),className:"flex flex-col items-center justify-center flex-1 h-full text-xs text-muted-foreground hover:text-foreground transition-colors",children:[(0,d.jsx)(n.A,{size:20,"aria-hidden":"true"}),(0,d.jsx)("span",{className:"mt-1 whitespace-nowrap",children:c("mobileLabel")})]})]})})}var aK=c(67565),aL=c(50987),aM=c(75234),aN=c(34487),aO=c(25345),aP=c(96558),aQ=c(75692),aR=c(57898),aS=c(35595),aT=c(11010),aU=c(89184),aV=c(63157),aW=c(12480);let aX=[{key:"home",href:"/"},{key:"chat",href:"/chat"},{key:"sessions",href:"/sessions"},{key:"repositories",href:"/repositories"},{key:"review",href:"/review"},{key:"skills",href:"/skills"},{key:"more",href:"/more"}],aY={home:aD.A,chat:aE.A,sessions:aF.A,repositories:aL.A,review:aG.A,skills:aM.A,more:aH.A};function aZ(a){return a.isWaitingForResponse?"waiting":a.isProcessing?"running":a.isSessionRunning?"ready":"idle"}let a$=(0,aS.cn)("flex cursor-pointer items-center gap-2 rounded-md px-2 py-2 text-sm","text-foreground","data-[selected=true]:bg-accent-500/15 data-[selected=true]:text-accent-700","dark:data-[selected=true]:text-accent-300"),a_="shrink-0 text-muted-foreground";function a0(){let{open:a,setOpen:b}=(0,x.C)(),{setOpen:c}=(0,aU.K)(),f=(0,g.useRouter)(),h=(0,l.c)("commandPalette"),i=(0,l.c)("common"),{theme:j,setTheme:k}=(0,q.D)(),{setSize:m,isMobile:p}=(0,E.Ps)(),{currentLocale:t,switchLocale:u}=ae(),v=(0,aV.rC)(),{showToast:y}=(0,ai.dj)(),[z,A]=(0,e.useState)(!1),[B,C]=(0,e.useState)(""),[D,F]=(0,e.useState)([]),G=(0,e.useRef)(null);(0,e.useRef)(null),(0,e.useRef)(a);let H=(0,e.useCallback)((a,c)=>{c&&F(a=>(function(a,b){let c=a.filter(a=>a.kind!==b.kind||a.id!==b.id),d=[b,...c].slice(0,8);try{localStorage.setItem("cm.palette.recents",JSON.stringify(d))}catch{}return d})(a,c)),b(!1),a()},[b]),I=(0,e.useCallback)(async()=>{try{await an.Rx.sync(),await v?.refresh?.(),y(h("actions.syncSuccess"),"success")}catch{y(h("actions.syncError"),"error")}},[v,y,h]),J="dark"===j,L=""===B.trim(),M=v?.error??null,O=v?.isLoading??!1,P=M?[]:v?.worktrees??[],Q=P.length>0,R=!M&&O&&0===P.length,S=[...P].sort((a,b)=>{let c=+!!a.isSessionRunning,d=+!!b.isSessionRunning;if(c!==d)return d-c;let e=a.updatedAt?new Date(a.updatedAt).getTime():0;return(b.updatedAt?new Date(b.updatedAt).getTime():0)-e}),T=L?S.slice(0,8):S,U=[{id:"theme",label:J?h("actions.toLight"):h("actions.toDark"),icon:J?r.A:s.A,run:()=>k(J?"light":"dark")},...p?[]:aW.Uf.map(a=>({id:`displaysize:${a}`,label:`${h("actions.displaySizePrefix")}: ${i(`displaySize.${a}`)}`,icon:aN.A,run:()=>m(a)})),{id:"sync",label:h("actions.syncRepositories"),icon:aO.A,run:()=>{I()}},{id:"locale",label:h("actions.switchLanguage"),icon:aP.A,run:()=>u("ja"===t?"en":"ja")},{id:"github",label:h("actions.openGitHub"),icon:o.A,run:()=>window.open("https://github.com/kewton/MyCodeBranchDesk","_blank","noopener,noreferrer")},{id:"keyboardShortcuts",label:h("actions.keyboardShortcuts"),icon:aQ.A,run:()=>c(!0)}],V=L?D.map(a=>{if("nav"===a.kind){let b=aX.find(b=>b.key===a.id);if(!b)return null;let c=aY[b.key],e=i(`nav.${b.key}`);return{id:`nav-${b.key}`,value:`recent nav ${b.key}`,node:(0,d.jsxs)(d.Fragment,{children:[c&&(0,d.jsx)(c,{size:16,className:a_,"aria-hidden":"true"}),(0,d.jsx)("span",{className:"truncate",children:e})]}),onSelect:()=>H(()=>f.push(b.href),{kind:"nav",id:b.key})}}if("worktree"===a.kind){let b=P.find(b=>b.id===a.id);if(!b)return null;let c=b.repositoryDisplayName||b.repositoryName||"",e=b.branch||b.name;return{id:`worktree-${b.id}`,value:`recent worktree ${b.id}`,node:(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(aR.A,{size:16,className:a_,"aria-hidden":"true"}),(0,d.jsx)("span",{className:"truncate",children:e}),c&&(0,d.jsx)("span",{className:"ml-auto truncate pl-2 text-xs text-muted-foreground",children:c}),(0,d.jsx)(N.m,{status:aZ(b),size:"sm",className:c?"ml-2":"ml-auto"})]}),onSelect:()=>H(()=>f.push(`/worktrees/${b.id}`),{kind:"worktree",id:b.id})}}let b=U.find(b=>b.id===a.id);if(!b)return null;let c=b.icon;return{id:`action-${b.id}`,value:`recent action ${b.id}`,node:(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(c,{size:16,className:a_,"aria-hidden":"true"}),(0,d.jsx)("span",{className:"truncate",children:b.label})]}),onSelect:()=>H(b.run,{kind:"action",id:b.id})}}).filter(a=>null!==a):[];return z?(0,K.createPortal)((0,d.jsx)(d.Fragment,{children:a&&(0,d.jsxs)("div",{className:"fixed inset-0 overflow-y-auto",style:{zIndex:aT.M.MODAL},"data-testid":"command-palette",children:[(0,d.jsx)("div",{"data-state":"open","aria-hidden":"true",className:"fixed inset-0 bg-black/40 backdrop-blur-sm transition-opacity data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:duration-200",onClick:()=>b(!1)}),(0,d.jsx)("div",{className:"relative flex min-h-full items-start justify-center p-4 pt-[15vh]",children:(0,d.jsx)("div",{"data-state":"open","data-testid":"command-palette-panel",className:(0,aS.cn)("relative w-full max-w-lg overflow-hidden rounded-xl bg-surface/95 shadow-2xl ring-1 ring-border backdrop-blur-xl","data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:duration-200"),children:(0,d.jsxs)(aK.uB,{label:h("title"),className:(0,aS.cn)("flex flex-col","[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:pb-1 [&_[cmdk-group-heading]]:pt-2","[&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground"),children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 border-b border-border px-3",children:[(0,d.jsx)(n.A,{size:16,strokeWidth:2,"aria-hidden":"true",className:"shrink-0 text-muted-foreground"}),(0,d.jsx)(aK.uB.Input,{ref:G,value:B,onValueChange:C,placeholder:h("placeholder"),"data-testid":"command-palette-input",className:"flex-1 bg-transparent py-3 text-sm text-foreground outline-none placeholder:text-muted-foreground"})]}),(0,d.jsxs)(aK.uB.List,{className:"max-h-[min(60vh,360px)] overflow-y-auto p-2",children:[(0,d.jsx)(aK.uB.Empty,{"data-testid":"command-palette-empty",className:"py-6 text-center text-sm text-muted-foreground",children:h("empty")}),R&&(0,d.jsx)(aK.uB.Loading,{"data-testid":"command-palette-loading",className:"py-6 text-center text-sm text-muted-foreground",children:h("loading")}),V.length>0&&(0,d.jsx)(aK.uB.Group,{heading:h("groups.recent"),children:V.map(a=>(0,d.jsx)(aK.uB.Item,{value:a.value,onSelect:a.onSelect,className:a$,children:a.node},a.id))}),(0,d.jsx)(aK.uB.Group,{heading:h("groups.navigation"),children:aX.map(a=>{let b=i(`nav.${a.key}`),c=aY[a.key];return(0,d.jsxs)(aK.uB.Item,{value:`nav ${b} ${a.href}`,onSelect:()=>H(()=>f.push(a.href),{kind:"nav",id:a.key}),className:a$,children:[c&&(0,d.jsx)(c,{size:16,className:a_,"aria-hidden":"true"}),(0,d.jsx)("span",{className:"truncate",children:b})]},a.key)})}),Q&&(0,d.jsx)(aK.uB.Group,{heading:h("groups.worktrees"),children:T.map(a=>{let b=a.repositoryDisplayName||a.repositoryName||"",c=a.branch||a.name;return(0,d.jsxs)(aK.uB.Item,{value:`worktree ${b} ${c} ${a.name} ${a.id}`,onSelect:()=>H(()=>f.push(`/worktrees/${a.id}`),{kind:"worktree",id:a.id}),className:a$,children:[(0,d.jsx)(aR.A,{size:16,className:a_,"aria-hidden":"true"}),(0,d.jsx)("span",{className:"truncate",children:c}),b&&(0,d.jsx)("span",{className:"ml-auto truncate pl-2 text-xs text-muted-foreground",children:b}),(0,d.jsx)(N.m,{status:aZ(a),size:"sm",className:b?"ml-2":"ml-auto"})]},a.id)})}),(0,d.jsx)(aK.uB.Group,{heading:h("groups.actions"),children:U.map(a=>{let b=a.icon;return(0,d.jsxs)(aK.uB.Item,{value:`action ${a.id} ${a.label}`,onSelect:()=>H(a.run,{kind:"action",id:a.id}),className:a$,children:[(0,d.jsx)(b,{size:16,className:a_,"aria-hidden":"true"}),(0,d.jsx)("span",{className:"truncate",children:a.label})]},a.id)})})]}),(0,d.jsxs)("div",{className:"flex items-center gap-3 border-t border-border bg-surface-2 px-3 py-2 text-[11px] text-muted-foreground",children:[(0,d.jsxs)("span",{className:"flex items-center gap-1",children:[(0,d.jsx)(w.u,{children:"↑"}),(0,d.jsx)(w.u,{children:"↓"}),h("footer.navigate")]}),(0,d.jsxs)("span",{className:"flex items-center gap-1",children:[(0,d.jsx)(w.u,{children:"↵"}),h("footer.select")]}),(0,d.jsxs)("span",{className:"flex items-center gap-1",children:[(0,d.jsx)(w.u,{children:"esc"}),h("footer.close")]})]})]})})})]})}),document.body):null}var a1=c(98033);let a2=["global","terminal","composer","editor"],a3=[{id:"commandPalette",keys:["MOD","K"],scope:"global"},{id:"keyboardHelp",keys:["?"],scope:"global"},{id:"closeOverlay",keys:["Esc"],scope:"global"},{id:"navigateList",keys:["↑","↓"],scope:"global"},{id:"terminalSearch",keys:["MOD","F"],scope:"terminal"},{id:"sendMessage",keys:["↵"],scope:"composer"},{id:"composerNewline",keys:["Shift","↵"],scope:"composer"},{id:"editorIndent",keys:["Tab"],scope:"editor"},{id:"editorOutdent",keys:["Shift","Tab"],scope:"editor"},{id:"editorTabFocus",keys:["Ctrl","M"],scope:"editor"},{id:"editorSave",keys:["MOD","S"],scope:"editor"},{id:"editorFullscreen",keys:["MOD","Shift","F"],scope:"editor"}];function a4(){let{open:a,setOpen:b}=(0,aU.K)(),{open:c}=(0,x.C)(),f=(0,l.c)("keyboardShortcuts"),[g,h]=(0,e.useState)(!1);(0,e.useRef)(a),(0,e.useRef)(c);let i=function(a=a3){return a2.map(b=>({scope:b,shortcuts:a.filter(a=>a.scope===b)})).filter(a=>a.shortcuts.length>0)}();return(0,d.jsx)(a1.a,{isOpen:a,onClose:()=>b(!1),title:f("title"),size:"md",children:(0,d.jsx)("div",{"data-testid":"keyboard-shortcuts-overlay",className:"space-y-6",children:i.map(({scope:a,shortcuts:b})=>(0,d.jsxs)("section",{"data-testid":`keyboard-shortcuts-scope-${a}`,children:[(0,d.jsx)("h4",{className:"mb-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:f(`scopes.${a}`)}),(0,d.jsx)("ul",{className:"divide-y divide-border",children:b.map(a=>(0,d.jsxs)("li",{"data-testid":`keyboard-shortcut-${a.id}`,className:"flex items-center justify-between gap-4 py-2",children:[(0,d.jsx)("span",{className:"text-sm text-foreground",children:f(`shortcuts.${a.id}`)}),(0,d.jsx)("span",{className:"flex flex-shrink-0 items-center gap-1",children:a.keys.map((a,b)=>(0,d.jsx)(w.u,{children:"MOD"===a?g?"⌘":"Ctrl":a},b))})]},a.id))})]},a))})})}var a5=c(16945),a6=c(47089),a7=c(12055);function a8(){let a=(0,l.c)("common"),[b,c]=(0,e.useState)(null),[f,g]=(0,e.useState)(null),h=(0,e.useCallback)(a=>{if(a.type!==a7.Oo)return;let{serverVersion:b,clientVersion:d}=a;"string"==typeof b&&"string"==typeof d&&b&&d&&b!==f&&c({serverVersion:b,clientVersion:d})},[f]);(0,u.T3)(h);let i=(0,e.useCallback)(()=>{window.location.reload()},[]),j=(0,e.useCallback)(()=>{c(a=>(a&&g(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:aT.M.TOAST},children:[(0,d.jsx)(a5.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:i,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)(aO.A,{className:"h-4 w-4","aria-hidden":"true"}),a("versionMismatch.reload")]}),(0,d.jsx)("button",{type:"button","data-testid":"version-mismatch-dismiss",onClick:j,"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)(a6.A,{className:"h-4 w-4","aria-hidden":"true"})})]}):null}let a9="transform transition-transform duration-300 ease-out",ba=(0,e.memo)(function({children:a}){let{isOpen:b,isMobileDrawerOpen:c,closeMobileDrawer:f,width:h,setWidth:i}=(0,A.VF)(),j=(0,B.a)(),{showSidebar:k,showGlobalNav:l}=function(){var a=(0,g.usePathname)();for(let b of D)if(a.startsWith(b.prefix))return{...C,...b.config};return{...C}}(),{factor:m}=(0,E.Ps)(),n=Math.round(160*m),o=Math.round(480*m),p=Math.round(Math.min(o,Math.max(n,h*m))),q=(0,e.useRef)(null),r=(0,e.useRef)(null),s=(0,e.useCallback)(a=>{i(Math.round(a/m))},[i,m]);return j?(0,d.jsxs)("div",{"data-testid":"app-shell",className:"h-screen flex flex-col",children:[c&&(0,d.jsx)("div",{"data-testid":"drawer-overlay",className:"fixed inset-0 bg-black/50 z-40",onClick:f,"aria-hidden":"true"}),k&&(0,d.jsx)("aside",{"data-testid":"sidebar-container",className:`
11
+ `,children:[(0,d.jsx)("span",{children:c.label}),a===c.key&&(0,d.jsx)("span",{className:"text-xs",children:"asc"===b?"ASC":"DESC"})]},c.key))})]})});function V({className:a}){return(0,d.jsx)("svg",{className:a,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 4h13M3 8h9m-9 4h6m4 0l4-4m0 0l4 4m-4-4v12"})})}function W({className:a}){return(0,d.jsx)("svg",{className:a,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 15l7-7 7 7"})})}function X({className:a}){return(0,d.jsx)("svg",{className:a,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})}let Y=[{key:"updatedAt",labelKey:"sort.updatedAt"},{key:"repositoryName",labelKey:"sort.repositoryName"},{key:"branchName",labelKey:"sort.branchName"},{key:"status",labelKey:"sort.status"}],Z={updatedAt:"desc"},$=(0,e.memo)(function(){let{sortKey:a,sortDirection:b,setSortKey:c,setSortDirection:f}=(0,A.VF)(),g=(0,l.c)("common"),h=(0,e.useMemo)(()=>Y.map(({key:a,labelKey:b})=>({key:a,label:g(b)})),[g]);return(0,d.jsx)(U,{sortKey:a,sortDirection:b,onSortKeyChange:c,onSortDirectionChange:f,options:h,defaultDirections:Z,compact:!0,tooltip:g("tooltips.sort"),iconClassName:"w-4 h-4"})});var _=c(8730),aa=c(81497),ab=c(55992);let ac=["en","ja"],ad={en:"English",ja:"日本語"};function ae(){return{currentLocale:(0,ab.Ym)(),switchLocale:a=>{if(ac.includes(a)){let b="https:"===window.location.protocol;document.cookie=`locale=${a};path=/;max-age=31536000;SameSite=Lax${b?";Secure":""}`,localStorage.setItem("locale",a),window.location.reload()}}}}function af(){let{currentLocale:a,switchLocale:b}=ae(),c=(0,l.c)("common");return(0,d.jsx)("select",{value:a,onChange:a=>b(a.target.value),"data-testid":"locale-switcher","aria-label":c("language"),className:" w-full px-3 py-2 rounded-md bg-sidebar text-sidebar-foreground border border-sidebar-border focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent text-sm ",children:ac.map(a=>(0,d.jsx)("option",{value:a,children:ad[a]},a))})}var ag=c(84342);function ah(){let a=(0,l.c)("auth"),b=(0,ag.H)(),[c,f]=(0,e.useState)(!1);if(!b)return null;async function g(){f(!0);try{await fetch("/api/auth/logout",{method:"POST"}),window.location.href="/login"}catch{window.location.href="/login"}}return(0,d.jsx)("button",{type:"button",onClick:g,disabled:c,"data-testid":"logout-button",className:" w-full px-3 py-2 text-sm text-left rounded-md text-muted-foreground hover:text-foreground hover:bg-muted focus:outline-none focus:ring-2 focus:ring-ring disabled:opacity-50 transition-colors ",children:c?"...":a("logout.button")})}var ai=c(63474),aj=c(77560),ak=c(19463);function al(){let a=(0,l.c)("common"),{count:b}=(0,ak.Lv)();return 0===b?null:(0,d.jsxs)(i(),{href:aj.ks,"data-testid":"attention-badge","aria-label":a("attention.badgeLabel",{count:b}),className:"mt-2 inline-flex w-full items-center justify-between gap-2 rounded-md border border-warning-border bg-warning-subtle px-2 py-1 text-xs font-medium text-warning-foreground transition-colors hover:brightness-105 focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[(0,d.jsx)("span",{className:"min-w-0 truncate",children:a("attention.label")}),(0,d.jsx)("span",{"data-testid":"attention-badge-count",className:"tabular-nums font-semibold",children:b})]})}function am({count:a}){let b=(0,l.c)("common");return 0===a?null:(0,d.jsx)("span",{"data-testid":"attention-badge-bubble",role:"status","aria-label":b("attention.badgeLabel",{count:a}),className:"absolute -top-1.5 -right-2.5 min-w-[1.05rem] rounded-full bg-warning-foreground px-1 text-[0.625rem] font-bold leading-[1.05rem] text-warning-subtle tabular-nums text-center",children:a>99?"99+":a})}var an=c(78352),ao=c(32482);let ap="w-4 h-4",aq=0,ar=null;function as(){return ar??[]}let at=(0,e.memo)(function(){let a=(0,j.Hq)(),{worktrees:b,repositories:c,selectedWorktreeId:f,selectWorktree:g,refreshWorktrees:h}=(0,J.$f)(),{closeMobileDrawer:k,sortKey:m,sortDirection:n,viewMode:o,setViewMode:p}=(0,A.VF)(),q=(0,l.c)("common"),[r,s]=(0,e.useState)(""),u=(0,e.useRef)(null),[v,w]=(0,e.useState)(()=>({})),[x,y]=(0,e.useState)(as),z=(0,e.useRef)(!1);(0,e.useEffect)(()=>{z.current||(z.current=!0,fetch("/api/sidebar/group-order").then(a=>a.json()).then(a=>{a.success&&Array.isArray(a.order)&&(y(a.order),ar=a.order)}).catch(()=>{}))},[]);let B=(0,e.useMemo)(()=>(0,ao.UZ)(c),[c]),C=(0,e.useMemo)(()=>(0,ao.s6)(b,B),[b,B]),D=(0,e.useMemo)(()=>C.map(M.XK),[C]),E=(0,e.useDeferredValue)(D),I=(0,e.useRef)(null),K=(0,e.useRef)(null);(0,e.useEffect)(()=>()=>{null!==K.current&&clearTimeout(K.current)},[]);let L=(0,e.useMemo)(()=>{let a=I.current;return!a||Date.now()>=a.expiresAt?E:a.items},[E]),N=(0,e.useRef)(L);(0,e.useLayoutEffect)(()=>{N.current=L});let O=(0,e.useCallback)(()=>{null!==K.current&&(clearTimeout(K.current),K.current=null);let a=I.current;if(a&&Date.now()<a.expiresAt){I.current={...a,expiresAt:1/0};return}I.current={items:N.current,expiresAt:1/0}},[]),P=(0,e.useCallback)(()=>{I.current&&(I.current={...I.current,expiresAt:Date.now()+1e3},null!==K.current&&clearTimeout(K.current),K.current=setTimeout(()=>{I.current=null},1e3))},[]),{sortedItems:Q,groupedItems:T}=function(a){let{items:b,sortKey:c,sortDirection:d,viewMode:f,filterText:g}=a,h=(0,e.useMemo)(()=>{if(!g)return b;let a=g.toLowerCase();return b.filter(b=>b.name.toLowerCase().includes(a)||b.repositoryName.toLowerCase().includes(a))},[b,g]);return{sortedItems:(0,e.useMemo)(()=>(0,ao.Xn)(h,c,d),[h,c,d]),groupedItems:(0,e.useMemo)(()=>"grouped"===f?(0,ao._s)(h,c,d):[],[h,c,d,f])}}({items:L,sortKey:m,sortDirection:n,viewMode:o,filterText:r}),U=(0,e.useMemo)(()=>{if("grouped"!==o||!T)return null;if(r.trim()||0===x.length)return T;let a=new Map(x.map((a,b)=>[a,b]));return[...T].sort((b,c)=>{let d=a.has(b.repositoryName)?a.get(b.repositoryName):1/0,e=a.has(c.repositoryName)?a.get(c.repositoryName):1/0;return d===e?b.repositoryName.localeCompare(c.repositoryName):d-e})},[o,T,x,r]),V="grouped"===o?U:null;(0,e.useEffect)(()=>{},[v]);let W=(0,e.useCallback)(a=>{w(b=>({...b,[a]:!b[a]}))},[]),X=(0,e.useCallback)(()=>{var a;aq=Number.isFinite(a=u.current?.scrollTop??0)&&a>0?a:0},[]),Y=Q.length>0||(V?.length??0)>0;(0,e.useEffect)(()=>{let a=u.current;if(!a)return;let b=window.requestAnimationFrame(()=>{a.scrollTop=aq});return()=>{window.cancelAnimationFrame(b)}},[Y,o]);let Z=(0,e.useCallback)(b=>{X(),g(b),a.push(`/worktrees/${b}`),k()},[X,g,a,k]),aa=(0,G.FR)((0,G.MS)(G.AN,{activationConstraint:{distance:8}})),ab=(0,e.useCallback)(a=>{let{active:b,over:c}=a;if(!c||b.id===c.id||!V)return;let d=V.map(a=>a.repositoryName),e=d.indexOf(String(b.id)),f=d.indexOf(String(c.id));if(-1===e||-1===f)return;let g=(0,H.be)(d,e,f);y(g),ar=g,fetch("/api/sidebar/group-order",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({order:g})}).catch(()=>{y(d),ar=d})},[V]),ac="flat"===o?0===Q.length:(V?.length??0)===0;return(0,d.jsxs)("nav",{"data-testid":"sidebar","aria-label":q("sidebar.branchNavigation"),className:"h-full flex flex-col bg-sidebar text-sidebar-foreground",role:"navigation",children:[(0,d.jsxs)("div",{"data-testid":"sidebar-header",className:"flex-shrink-0 px-4 py-4 border-b border-sidebar-border",children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-y-2",children:[(0,d.jsx)("h2",{className:"min-w-0 truncate text-lg font-semibold text-sidebar-foreground",children:q("sidebar.branches")}),(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-1",children:[(0,d.jsx)(aw,{viewMode:o,onToggle:p}),(0,d.jsx)($,{}),(0,d.jsx)(aC,{refreshWorktrees:h}),(0,d.jsx)(S.m_,{content:q("tooltips.repositories"),placement:"bottom",children:(0,d.jsx)(i(),{href:"/repositories","aria-label":q("nav.repositories"),className:"p-1 rounded-md text-sidebar-muted hover:text-sidebar-foreground hover:bg-sidebar-hover focus:outline-none focus:ring-2 focus:ring-ring transition-colors inline-flex items-center",children:(0,d.jsx)(F.A,{className:ap,"aria-hidden":"true"})})})]})]}),(0,d.jsx)(al,{})]}),(0,d.jsx)("div",{className:"flex-shrink-0 px-4 py-3 border-b border-sidebar-border",children:(0,d.jsx)(_.pd,{type:"text",placeholder:q("sidebar.searchBranches"),value:r,onChange:a=>s(a.target.value),className:"bg-background shadow-none"})}),(0,d.jsx)("div",{ref:u,"data-testid":"branch-list",onScroll:X,onMouseEnter:O,onMouseLeave:P,className:"flex-1 overflow-y-auto overflow-x-hidden",children:ac?(0,d.jsx)("div",{className:"px-4 py-8 text-center text-sidebar-muted",children:q(r?"sidebar.noBranchesFound":"sidebar.noBranchesAvailable")}):"grouped"===o&&V?(0,d.jsx)(G.Mp,{sensors:aa,collisionDetection:G.fp,onDragEnd:ab,children:(0,d.jsx)(H.gB,{items:V.map(a=>a.repositoryName),strategy:H._G,children:V.map(a=>{let b=!v[a.repositoryName]||!!r.trim();return(0,d.jsx)(au,{group:a,isExpanded:b,selectedWorktreeId:f,onToggle:()=>W(a.repositoryName),onBranchClick:Z,isDragDisabled:!!r.trim()},a.repositoryName)})})}):Q.map(a=>(0,d.jsx)(R,{branch:a,isSelected:a.id===f,onClick:()=>Z(a.id)},a.id))}),(0,d.jsxs)("div",{className:"flex-shrink-0 px-4 py-3 border-t border-sidebar-border space-y-2",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("div",{className:"flex-1",children:(0,d.jsx)(af,{})}),(0,d.jsx)(t,{})]}),(0,d.jsx)(ah,{})]})]})});function au({group:a,isExpanded:b,selectedWorktreeId:c,onToggle:e,onBranchClick:f,isDragDisabled:g}){let{attributes:h,listeners:i,setNodeRef:j,setActivatorNodeRef:k,transform:l,transition:m,isDragging:n}=(0,H.gl)({id:a.repositoryName,disabled:g}),o={transform:I.Ks.Transform.toString(l),transition:m,opacity:n?.5:1};return(0,d.jsxs)("div",{ref:j,style:o,className:"w-full min-w-0",children:[(0,d.jsx)(av,{repositoryName:a.repositoryName,branchCount:a.branches.length,isExpanded:b,onClick:e,dragHandleRef:k,dragHandleListeners:g?void 0:i,dragHandleAttributes:g?void 0:h}),b&&a.branches.map(a=>(0,d.jsx)(R,{branch:a,isSelected:a.id===c,onClick:()=>f(a.id),showRepositoryName:!1},a.id))]})}function av({repositoryName:a,branchCount:b,isExpanded:c,onClick:e,dragHandleRef:f,dragHandleListeners:g,dragHandleAttributes:h}){let i=(0,l.c)("common");return(0,d.jsxs)("div",{className:"flex items-center w-full",children:[g&&(0,d.jsx)("div",{ref:f,...g,...h,"aria-label":i("sidebar.dragToReorderGroup"),className:" flex-shrink-0 flex items-center justify-center w-6 h-full pl-2 cursor-grab active:cursor-grabbing text-sidebar-muted hover:text-sidebar-foreground transition-colors ",children:(0,d.jsx)(aA,{})}),(0,d.jsxs)("button",{"data-testid":"group-header",type:"button",onClick:e,"aria-expanded":c,className:" flex-1 min-w-0 flex items-center gap-2 px-2 py-2 text-xs font-semibold text-sidebar-muted uppercase tracking-wider focus:outline-none focus:ring-2 focus:ring-inset focus:ring-ring transition-colors ",children:[(0,d.jsx)(ax,{isExpanded:c}),(0,d.jsx)(ay,{color:(0,ao.LV)(a)}),(0,d.jsx)(aa.nR,{content:a,className:"flex-1 min-w-0 text-left truncate",children:a}),(0,d.jsx)("span",{className:"text-sidebar-muted font-normal tabular-nums pr-2",children:b})]})]})}function aw({viewMode:a,onToggle:b}){let c=(0,l.c)("common");return(0,d.jsx)(S.m_,{content:c("tooltips.viewMode"),placement:"bottom",children:(0,d.jsx)("button",{"data-testid":"view-mode-toggle",type:"button",onClick:()=>{b("grouped"===a?"flat":"grouped")},"aria-label":c("grouped"===a?"sidebar.switchToFlatView":"sidebar.switchToGroupedView"),className:" p-1 rounded-md text-sidebar-muted hover:text-sidebar-foreground hover:bg-sidebar-hover focus:outline-none focus:ring-2 focus:ring-ring transition-colors ",children:"grouped"===a?(0,d.jsx)(az,{className:ap}):(0,d.jsx)(ay,{className:ap})})})}function ax({isExpanded:a}){return(0,d.jsx)("svg",{className:`w-3 h-3 flex-shrink-0 transition-transform ${a?"rotate-90":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})})}function ay({className:a="w-3.5 h-3.5",color:b}){return(0,d.jsx)("svg",{className:`${a} flex-shrink-0`,viewBox:"0 0 24 24",fill:b??"none",stroke:b?"none":"currentColor",strokeWidth:2*!b,"aria-hidden":"true",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"})})}function az({className:a="w-3 h-3"}){return(0,d.jsx)("svg",{className:a,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6h16M4 12h16M4 18h16"})})}function aA(){return(0,d.jsxs)("svg",{className:"w-3 h-3",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,d.jsx)("circle",{cx:"9",cy:"5",r:"1.5"}),(0,d.jsx)("circle",{cx:"15",cy:"5",r:"1.5"}),(0,d.jsx)("circle",{cx:"9",cy:"12",r:"1.5"}),(0,d.jsx)("circle",{cx:"15",cy:"12",r:"1.5"}),(0,d.jsx)("circle",{cx:"9",cy:"19",r:"1.5"}),(0,d.jsx)("circle",{cx:"15",cy:"19",r:"1.5"})]})}function aB({className:a=""}){return(0,d.jsx)("svg",{className:`${ap} ${a}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 4v5h5M20 20v-5h-5M20.49 9A9 9 0 005.64 5.64L4 4m16 16l-1.64-1.64A9 9 0 014.51 15"})})}let aC=(0,e.memo)(function({refreshWorktrees:a}){let[b,c]=(0,e.useState)(!1),f=(0,e.useRef)(!1),{showToast:g}=(0,ai.dj)(),h=(0,l.c)("common"),i=(0,e.useCallback)(async()=>{if(!f.current){f.current=!0,c(!0);try{let b=await an.Rx.sync();await a(),g(h("syncSuccess",{count:b.worktreeCount}),"success",3e3)}catch(a){a instanceof an.hD&&401===a.status?g(h("syncAuthError"),"error",5e3):g(h("syncError"),"error",5e3)}finally{f.current=!1,c(!1)}}},[a,g,h]);return(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(S.m_,{content:h("tooltips.sync"),placement:"bottom",children:(0,d.jsx)("button",{type:"button",onClick:i,disabled:b,"aria-label":h("syncButtonLabel"),className:"p-1 rounded-md text-sidebar-muted hover:text-sidebar-foreground hover:bg-sidebar-hover focus:outline-none focus:ring-2 focus:ring-ring disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:(0,d.jsx)(aB,{className:b?"animate-spin":""})})})})});var aD=c(78733),aE=c(44688),aF=c(75903),aG=c(59268),aH=c(38882);let aI=[{labelKey:"nav.home",href:"/",isActive:a=>"/"===a,icon:(0,d.jsx)(aD.A,{size:20,"aria-hidden":"true"})},{labelKey:"nav.chat",href:"/chat",isActive:a=>a.startsWith("/chat"),icon:(0,d.jsx)(aE.A,{size:20,"aria-hidden":"true"})},{labelKey:"nav.sessions",href:"/sessions",isActive:a=>a.startsWith("/sessions"),icon:(0,d.jsx)(aF.A,{size:20,"aria-hidden":"true"})},{labelKey:"nav.review",href:"/review",isActive:a=>a.startsWith("/review"),icon:(0,d.jsx)(aG.A,{size:20,"aria-hidden":"true"}),showsAttentionBadge:!0},{labelKey:"nav.more",href:"/more",isActive:a=>a.startsWith("/more"),icon:(0,d.jsx)(aH.A,{size:20,"aria-hidden":"true"})}];function aJ(){let a=(0,g.usePathname)(),{setOpen:b}=(0,x.C)(),c=(0,l.c)("commandPalette"),e=(0,l.c)("common"),{count:f}=(0,ak.Lv)();return(0,d.jsx)("nav",{"data-testid":"global-mobile-nav",className:"fixed bottom-0 left-0 right-0 z-50 border-t border-border bg-background supports-[backdrop-filter]:bg-background/80 backdrop-blur-md pb-safe",children:(0,d.jsxs)("div",{className:"flex items-center justify-around h-14",children:[aI.map(b=>{let c=b.isActive(a),g=!0===b.showsAttentionBadge&&f>0;return(0,d.jsxs)(k,{href:g?aj.ks:b.href,className:`flex flex-col items-center justify-center flex-1 h-full text-xs transition-colors ${c?"text-accent-600 dark:text-accent-400":"text-muted-foreground hover:text-foreground"}`,children:[(0,d.jsxs)("span",{className:"relative inline-flex",children:[b.icon,!0===b.showsAttentionBadge&&(0,d.jsx)(am,{count:f})]}),(0,d.jsx)("span",{className:"mt-1 whitespace-nowrap",children:e(b.labelKey)})]},b.href)}),(0,d.jsxs)("button",{type:"button","data-testid":"mobile-command-palette-trigger",onClick:()=>b(!0),"aria-label":c("mobileTrigger"),className:"flex flex-col items-center justify-center flex-1 h-full text-xs text-muted-foreground hover:text-foreground transition-colors",children:[(0,d.jsx)(n.A,{size:20,"aria-hidden":"true"}),(0,d.jsx)("span",{className:"mt-1 whitespace-nowrap",children:c("mobileLabel")})]})]})})}var aK=c(67565),aL=c(50987),aM=c(75234),aN=c(34487),aO=c(25345),aP=c(96558),aQ=c(75692),aR=c(57898),aS=c(35595),aT=c(11010),aU=c(89184),aV=c(63157),aW=c(12480);let aX=[{key:"home",href:"/"},{key:"chat",href:"/chat"},{key:"sessions",href:"/sessions"},{key:"repositories",href:"/repositories"},{key:"review",href:"/review"},{key:"skills",href:"/skills"},{key:"more",href:"/more"}],aY={home:aD.A,chat:aE.A,sessions:aF.A,repositories:aL.A,review:aG.A,skills:aM.A,more:aH.A};function aZ(a){return a.isWaitingForResponse?"waiting":a.isProcessing?"running":a.isSessionRunning?"ready":"idle"}let a$=(0,aS.cn)("flex cursor-pointer items-center gap-2 rounded-md px-2 py-2 text-sm","text-foreground","data-[selected=true]:bg-accent-500/15 data-[selected=true]:text-accent-700","dark:data-[selected=true]:text-accent-300"),a_="shrink-0 text-muted-foreground";function a0(){let{open:a,setOpen:b}=(0,x.C)(),{setOpen:c}=(0,aU.K)(),f=(0,g.useRouter)(),h=(0,l.c)("commandPalette"),i=(0,l.c)("common"),{theme:j,setTheme:k}=(0,q.D)(),{setSize:m,isMobile:p}=(0,E.Ps)(),{currentLocale:t,switchLocale:u}=ae(),v=(0,aV.rC)(),{showToast:y}=(0,ai.dj)(),[z,A]=(0,e.useState)(!1),[B,C]=(0,e.useState)(""),[D,F]=(0,e.useState)([]),G=(0,e.useRef)(null);(0,e.useRef)(null),(0,e.useRef)(a);let H=(0,e.useCallback)((a,c)=>{c&&F(a=>(function(a,b){let c=a.filter(a=>a.kind!==b.kind||a.id!==b.id),d=[b,...c].slice(0,8);try{localStorage.setItem("cm.palette.recents",JSON.stringify(d))}catch{}return d})(a,c)),b(!1),a()},[b]),I=(0,e.useCallback)(async()=>{try{await an.Rx.sync(),await v?.refresh?.(),y(h("actions.syncSuccess"),"success")}catch{y(h("actions.syncError"),"error")}},[v,y,h]),J="dark"===j,L=""===B.trim(),M=v?.error??null,O=v?.isLoading??!1,P=M?[]:v?.worktrees??[],Q=P.length>0,R=!M&&O&&0===P.length,S=[...P].sort((a,b)=>{let c=+!!a.isSessionRunning,d=+!!b.isSessionRunning;if(c!==d)return d-c;let e=a.updatedAt?new Date(a.updatedAt).getTime():0;return(b.updatedAt?new Date(b.updatedAt).getTime():0)-e}),T=L?S.slice(0,8):S,U=[{id:"theme",label:J?h("actions.toLight"):h("actions.toDark"),icon:J?r.A:s.A,run:()=>k(J?"light":"dark")},...p?[]:aW.Uf.map(a=>({id:`displaysize:${a}`,label:`${h("actions.displaySizePrefix")}: ${i(`displaySize.${a}`)}`,icon:aN.A,run:()=>m(a)})),{id:"sync",label:h("actions.syncRepositories"),icon:aO.A,run:()=>{I()}},{id:"locale",label:h("actions.switchLanguage"),icon:aP.A,run:()=>u("ja"===t?"en":"ja")},{id:"github",label:h("actions.openGitHub"),icon:o.A,run:()=>window.open("https://github.com/kewton/MyCodeBranchDesk","_blank","noopener,noreferrer")},{id:"keyboardShortcuts",label:h("actions.keyboardShortcuts"),icon:aQ.A,run:()=>c(!0)}],V=L?D.map(a=>{if("nav"===a.kind){let b=aX.find(b=>b.key===a.id);if(!b)return null;let c=aY[b.key],e=i(`nav.${b.key}`);return{id:`nav-${b.key}`,value:`recent nav ${b.key}`,node:(0,d.jsxs)(d.Fragment,{children:[c&&(0,d.jsx)(c,{size:16,className:a_,"aria-hidden":"true"}),(0,d.jsx)("span",{className:"truncate",children:e})]}),onSelect:()=>H(()=>f.push(b.href),{kind:"nav",id:b.key})}}if("worktree"===a.kind){let b=P.find(b=>b.id===a.id);if(!b)return null;let c=b.repositoryDisplayName||b.repositoryName||"",e=b.branch||b.name;return{id:`worktree-${b.id}`,value:`recent worktree ${b.id}`,node:(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(aR.A,{size:16,className:a_,"aria-hidden":"true"}),(0,d.jsx)("span",{className:"truncate",children:e}),c&&(0,d.jsx)("span",{className:"ml-auto truncate pl-2 text-xs text-muted-foreground",children:c}),(0,d.jsx)(N.m,{status:aZ(b),size:"sm",className:c?"ml-2":"ml-auto"})]}),onSelect:()=>H(()=>f.push(`/worktrees/${b.id}`),{kind:"worktree",id:b.id})}}let b=U.find(b=>b.id===a.id);if(!b)return null;let c=b.icon;return{id:`action-${b.id}`,value:`recent action ${b.id}`,node:(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(c,{size:16,className:a_,"aria-hidden":"true"}),(0,d.jsx)("span",{className:"truncate",children:b.label})]}),onSelect:()=>H(b.run,{kind:"action",id:b.id})}}).filter(a=>null!==a):[];return z?(0,K.createPortal)((0,d.jsx)(d.Fragment,{children:a&&(0,d.jsxs)("div",{className:"fixed inset-0 overflow-y-auto",style:{zIndex:aT.M.MODAL},"data-testid":"command-palette",children:[(0,d.jsx)("div",{"data-state":"open","aria-hidden":"true",className:"fixed inset-0 bg-black/40 backdrop-blur-sm transition-opacity data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:duration-200",onClick:()=>b(!1)}),(0,d.jsx)("div",{className:"relative flex min-h-full items-start justify-center p-4 pt-[15vh]",children:(0,d.jsx)("div",{"data-state":"open","data-testid":"command-palette-panel",className:(0,aS.cn)("relative w-full max-w-lg overflow-hidden rounded-xl bg-surface/95 shadow-2xl ring-1 ring-border backdrop-blur-xl","data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:duration-200"),children:(0,d.jsxs)(aK.uB,{label:h("title"),className:(0,aS.cn)("flex flex-col","[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:pb-1 [&_[cmdk-group-heading]]:pt-2","[&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground"),children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 border-b border-border px-3",children:[(0,d.jsx)(n.A,{size:16,strokeWidth:2,"aria-hidden":"true",className:"shrink-0 text-muted-foreground"}),(0,d.jsx)(aK.uB.Input,{ref:G,value:B,onValueChange:C,placeholder:h("placeholder"),"data-testid":"command-palette-input",className:"flex-1 bg-transparent py-3 text-sm text-foreground outline-none placeholder:text-muted-foreground"})]}),(0,d.jsxs)(aK.uB.List,{className:"max-h-[min(60vh,360px)] overflow-y-auto p-2",children:[(0,d.jsx)(aK.uB.Empty,{"data-testid":"command-palette-empty",className:"py-6 text-center text-sm text-muted-foreground",children:h("empty")}),R&&(0,d.jsx)(aK.uB.Loading,{"data-testid":"command-palette-loading",className:"py-6 text-center text-sm text-muted-foreground",children:h("loading")}),V.length>0&&(0,d.jsx)(aK.uB.Group,{heading:h("groups.recent"),children:V.map(a=>(0,d.jsx)(aK.uB.Item,{value:a.value,onSelect:a.onSelect,className:a$,children:a.node},a.id))}),(0,d.jsx)(aK.uB.Group,{heading:h("groups.navigation"),children:aX.map(a=>{let b=i(`nav.${a.key}`),c=aY[a.key];return(0,d.jsxs)(aK.uB.Item,{value:`nav ${b} ${a.href}`,onSelect:()=>H(()=>f.push(a.href),{kind:"nav",id:a.key}),className:a$,children:[c&&(0,d.jsx)(c,{size:16,className:a_,"aria-hidden":"true"}),(0,d.jsx)("span",{className:"truncate",children:b})]},a.key)})}),Q&&(0,d.jsx)(aK.uB.Group,{heading:h("groups.worktrees"),children:T.map(a=>{let b=a.repositoryDisplayName||a.repositoryName||"",c=a.branch||a.name;return(0,d.jsxs)(aK.uB.Item,{value:`worktree ${b} ${c} ${a.name} ${a.id}`,onSelect:()=>H(()=>f.push(`/worktrees/${a.id}`),{kind:"worktree",id:a.id}),className:a$,children:[(0,d.jsx)(aR.A,{size:16,className:a_,"aria-hidden":"true"}),(0,d.jsx)("span",{className:"truncate",children:c}),b&&(0,d.jsx)("span",{className:"ml-auto truncate pl-2 text-xs text-muted-foreground",children:b}),(0,d.jsx)(N.m,{status:aZ(a),size:"sm",className:b?"ml-2":"ml-auto"})]},a.id)})}),(0,d.jsx)(aK.uB.Group,{heading:h("groups.actions"),children:U.map(a=>{let b=a.icon;return(0,d.jsxs)(aK.uB.Item,{value:`action ${a.id} ${a.label}`,onSelect:()=>H(a.run,{kind:"action",id:a.id}),className:a$,children:[(0,d.jsx)(b,{size:16,className:a_,"aria-hidden":"true"}),(0,d.jsx)("span",{className:"truncate",children:a.label})]},a.id)})})]}),(0,d.jsxs)("div",{className:"flex items-center gap-3 border-t border-border bg-surface-2 px-3 py-2 text-[11px] text-muted-foreground",children:[(0,d.jsxs)("span",{className:"flex items-center gap-1",children:[(0,d.jsx)(w.u,{children:"↑"}),(0,d.jsx)(w.u,{children:"↓"}),h("footer.navigate")]}),(0,d.jsxs)("span",{className:"flex items-center gap-1",children:[(0,d.jsx)(w.u,{children:"↵"}),h("footer.select")]}),(0,d.jsxs)("span",{className:"flex items-center gap-1",children:[(0,d.jsx)(w.u,{children:"esc"}),h("footer.close")]})]})]})})})]})}),document.body):null}var a1=c(98033);let a2=["global","terminal","composer","editor"],a3=[{id:"commandPalette",keys:["MOD","K"],scope:"global"},{id:"keyboardHelp",keys:["?"],scope:"global"},{id:"closeOverlay",keys:["Esc"],scope:"global"},{id:"navigateList",keys:["↑","↓"],scope:"global"},{id:"terminalSearch",keys:["MOD","F"],scope:"terminal"},{id:"sendMessage",keys:["↵"],scope:"composer"},{id:"composerNewline",keys:["Shift","↵"],scope:"composer"},{id:"editorIndent",keys:["Tab"],scope:"editor"},{id:"editorOutdent",keys:["Shift","Tab"],scope:"editor"},{id:"editorTabFocus",keys:["Ctrl","M"],scope:"editor"},{id:"editorSave",keys:["MOD","S"],scope:"editor"},{id:"editorFullscreen",keys:["MOD","Shift","F"],scope:"editor"}];function a4(){let{open:a,setOpen:b}=(0,aU.K)(),{open:c}=(0,x.C)(),f=(0,l.c)("keyboardShortcuts"),[g,h]=(0,e.useState)(!1);(0,e.useRef)(a),(0,e.useRef)(c);let i=function(a=a3){return a2.map(b=>({scope:b,shortcuts:a.filter(a=>a.scope===b)})).filter(a=>a.shortcuts.length>0)}();return(0,d.jsx)(a1.a,{isOpen:a,onClose:()=>b(!1),title:f("title"),size:"md",children:(0,d.jsx)("div",{"data-testid":"keyboard-shortcuts-overlay",className:"space-y-6",children:i.map(({scope:a,shortcuts:b})=>(0,d.jsxs)("section",{"data-testid":`keyboard-shortcuts-scope-${a}`,children:[(0,d.jsx)("h4",{className:"mb-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:f(`scopes.${a}`)}),(0,d.jsx)("ul",{className:"divide-y divide-border",children:b.map(a=>(0,d.jsxs)("li",{"data-testid":`keyboard-shortcut-${a.id}`,className:"flex items-center justify-between gap-4 py-2",children:[(0,d.jsx)("span",{className:"text-sm text-foreground",children:f(`shortcuts.${a.id}`)}),(0,d.jsx)("span",{className:"flex flex-shrink-0 items-center gap-1",children:a.keys.map((a,b)=>(0,d.jsx)(w.u,{children:"MOD"===a?g?"⌘":"Ctrl":a},b))})]},a.id))})]},a))})})}var a5=c(16945),a6=c(47089),a7=c(12055);function a8(){let a=(0,l.c)("common"),[b,c]=(0,e.useState)(null),[f,g]=(0,e.useState)(null),h=(0,e.useCallback)(a=>{if(a.type!==a7.Oo)return;let{serverVersion:b,clientVersion:d}=a;"string"==typeof b&&"string"==typeof d&&b&&d&&b!==f&&c({serverVersion:b,clientVersion:d})},[f]);(0,u.T3)(h);let i=(0,e.useCallback)(()=>{window.location.reload()},[]),j=(0,e.useCallback)(()=>{c(a=>(a&&g(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:aT.M.TOAST},children:[(0,d.jsx)(a5.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:i,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)(aO.A,{className:"h-4 w-4","aria-hidden":"true"}),a("versionMismatch.reload")]}),(0,d.jsx)("button",{type:"button","data-testid":"version-mismatch-dismiss",onClick:j,"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)(a6.A,{className:"h-4 w-4","aria-hidden":"true"})})]}):null}let a9="transform transition-transform duration-300 ease-out",ba=(0,e.memo)(function({children:a}){let{isOpen:b,isMobileDrawerOpen:c,closeMobileDrawer:f,width:h,setWidth:i}=(0,A.VF)(),j=(0,B.a)(),{showSidebar:k,showGlobalNav:l}=function(){var a=(0,g.usePathname)();for(let b of D)if(a.startsWith(b.prefix))return{...C,...b.config};return{...C}}(),{factor:m}=(0,E.Ps)(),n=Math.round(160*m),o=Math.round(480*m),p=Math.round(Math.min(o,Math.max(n,h*m))),q=(0,e.useRef)(null),r=(0,e.useRef)(null),s=(0,e.useCallback)(a=>{i(Math.round(a/m))},[i,m]);return j?(0,d.jsxs)("div",{"data-testid":"app-shell",className:"h-screen flex flex-col",children:[c&&(0,d.jsx)("div",{"data-testid":"drawer-overlay",className:"fixed inset-0 bg-black/50 z-40",onClick:f,"aria-hidden":"true"}),k&&(0,d.jsx)("aside",{"data-testid":"sidebar-container",className:`
12
12
  fixed left-0 top-0 h-full w-72 z-50
13
13
  ${a9}
14
14
  ${c?"translate-x-0":"-translate-x-full"}
@@ -1 +1 @@
1
- "use strict";exports.id=9328,exports.ids=[9328],exports.modules={49328:a=>{a.exports=JSON.parse('{"page":{"title":"レビュー","description":"対応が必要な worktree。"},"tabs":{"review":"レビュー","report":"レポート","template":"テンプレート"},"status":{"done":"完了","inReview":"レビュー中","approval":"承認待ち","stalled":"停滞"},"filters":{"ariaLabel":"レビューフィルター","loading":"レビューを読み込み中"},"empty":{"inReview":"レビュー中のワークツリーはありません。","approval":"承認待ちのワークツリーはありません。","stalled":"停滞しているワークツリーはありません。"},"datePicker":{"previousDay":"前日","nextDay":"翌日"},"report":{"regenerateConfirm":"この日付のレポートは既に存在します。再生成して上書きしますか?","toolLabel":"ツール:","modelPlaceholder":"モデル(任意)","generationMode":"生成モード","modes":{"none":"指示なし","template":"テンプレート","custom":"カスタム"},"selectTemplate":"テンプレートを選択","loadingTemplates":"テンプレートを読み込み中","noTemplates":"利用できるテンプレートがありません。Template タブで作成してください。","templatePlaceholderOption":"-- テンプレートを選択 --","instructionPlaceholderTemplate":"上でテンプレートを選択するとこの欄に反映されます","instructionPlaceholderCustom":"サマリー生成への追加指示","generate":"サマリーを生成","generating":"生成中...","noMessages":"この日付のメッセージはありません。","messagesFound":"この日付のメッセージが{count}件見つかりました。","generatingRemote":"レポートを生成中...(ツール: {tool})","generatingRemoteWithTime":"レポートを生成中...(ツール: {tool}、開始: {seconds}秒前)","generatingSummary":"サマリーを生成中...","generatedBy":"生成ツール: {tool}","copy":"コピー","copied":"コピーしました!","edit":"編集","save":"保存","saving":"保存中...","errors":{"fetch":"レポートの取得に失敗しました","rateLimited":"別のサマリーを生成中です。しばらくお待ちください。","generate":"サマリーの生成に失敗しました","emptyContent":"内容を入力してください","save":"レポートの保存に失敗しました"}},"template":{"deleteConfirm":"このテンプレートを削除しますか?","heading":"テンプレート({count}/{max})","loading":"テンプレートを読み込み中","empty":"テンプレートはまだありません。","edit":"編集","delete":"削除","save":"保存","saving":"保存中...","cancel":"キャンセル","newHeading":"新規テンプレート","namePlaceholder":"テンプレート名","contentPlaceholder":"テンプレート本文(レポート生成への指示)","create":"テンプレートを作成","creating":"作成中...","errors":{"fetch":"テンプレートの取得に失敗しました","nameAndContentRequired":"名前と本文は必須です","create":"テンプレートの作成に失敗しました","update":"テンプレートの更新に失敗しました","delete":"テンプレートの削除に失敗しました"}}}')}};
1
+ "use strict";exports.id=9328,exports.ids=[9328],exports.modules={49328:a=>{a.exports=JSON.parse('{"page":{"title":"レビュー","description":"対応が必要な worktree。"},"tabs":{"review":"レビュー","report":"レポート","template":"テンプレート"},"status":{"inReview":"レビュー中","approval":"承認待ち","stalled":"停滞"},"filters":{"ariaLabel":"レビューフィルター","loading":"レビューを読み込み中"},"empty":{"inReview":"レビュー中のワークツリーはありません。","approval":"承認待ちのワークツリーはありません。","stalled":"停滞しているワークツリーはありません。"},"datePicker":{"previousDay":"前日","nextDay":"翌日"},"report":{"regenerateConfirm":"この日付のレポートは既に存在します。再生成して上書きしますか?","toolLabel":"ツール:","modelPlaceholder":"モデル(任意)","generationMode":"生成モード","modes":{"none":"指示なし","template":"テンプレート","custom":"カスタム"},"selectTemplate":"テンプレートを選択","loadingTemplates":"テンプレートを読み込み中","noTemplates":"利用できるテンプレートがありません。Template タブで作成してください。","templatePlaceholderOption":"-- テンプレートを選択 --","instructionPlaceholderTemplate":"上でテンプレートを選択するとこの欄に反映されます","instructionPlaceholderCustom":"サマリー生成への追加指示","generate":"サマリーを生成","generating":"生成中...","noMessages":"この日付のメッセージはありません。","messagesFound":"この日付のメッセージが{count}件見つかりました。","generatingRemote":"レポートを生成中...(ツール: {tool})","generatingRemoteWithTime":"レポートを生成中...(ツール: {tool}、開始: {seconds}秒前)","generatingSummary":"サマリーを生成中...","generatedBy":"生成ツール: {tool}","copy":"コピー","copied":"コピーしました!","edit":"編集","save":"保存","saving":"保存中...","errors":{"fetch":"レポートの取得に失敗しました","rateLimited":"別のサマリーを生成中です。しばらくお待ちください。","generate":"サマリーの生成に失敗しました","emptyContent":"内容を入力してください","save":"レポートの保存に失敗しました"}},"template":{"deleteConfirm":"このテンプレートを削除しますか?","heading":"テンプレート({count}/{max})","loading":"テンプレートを読み込み中","empty":"テンプレートはまだありません。","edit":"編集","delete":"削除","save":"保存","saving":"保存中...","cancel":"キャンセル","newHeading":"新規テンプレート","namePlaceholder":"テンプレート名","contentPlaceholder":"テンプレート本文(レポート生成への指示)","create":"テンプレートを作成","creating":"作成中...","errors":{"fetch":"テンプレートの取得に失敗しました","nameAndContentRequired":"名前と本文は必須です","create":"テンプレートの作成に失敗しました","update":"テンプレートの更新に失敗しました","delete":"テンプレートの削除に失敗しました"}}}')}};
@@ -1,8 +1,9 @@
1
1
  "use strict";exports.id=9373,exports.ids=[9373],exports.modules={11501:(a,b,c)=>{c.d(b,{Ky:()=>j,RR:()=>l,cI:()=>k,ct:()=>m,fc:()=>i});var d=c(90384);let e=`${d.uz}(commit または未 commit の変更が存在すること)`,f=`${d.uz}(commit が存在すること。未 commit の変更は作業証跡として数えない)`,g=`${d.le}(変更ファイルが scope.allow の内側に収まっていること)`,h=`options.requireCommit (${d.aT})`;function i(a,b){let c=[];return b?.options.requireCommit&&c.push(h),a?.success.requireCommit&&c.push("success.requireCommit (task contract)"),{required:c.length>0,sources:c}}function j(a){let b=a.verify.gates;if(!b)return null;let c=[[d.uz,a.success.requireWorkEvidence],[d.le,a.success.requireScopeClean]];return[...c.filter(([a,c])=>c||b.includes(a)).map(([a])=>a),...b.filter(a=>!c.some(([b])=>b===a))]}function k(a){return a.verify.gateDefinitions??[]}function l(a,b){let c=a.verify.gates,e=k(a),f=[];if(!b)return e.length>0&&f.push(`verify.gateDefinitions: declared ${e.map(a=>a.id).join(", ")}, but ${d.aT} is missing or unreadable in this worktree, so no verification run can execute them`),c&&f.push(`verify.gates: declared ${c.join(", ")}, but ${d.aT} is missing or unreadable in this worktree, so the gate ids cannot be resolved`),f;let g=b.gates.map(a=>a.id),h=e.map(a=>a.id).filter(a=>g.includes(a));if(h.length>0&&f.push(`verify.gateDefinitions: gate id(s) ${h.join(", ")} are already declared in ${d.aT}. A contract may add gates, never redefine the repository's own — rename the contract gate.`),c){let a=new Set([d.uz,d.le,...g]),b=new Set(e.map(a=>a.id)),h=c.filter(c=>!a.has(c)&&!b.has(c));if(h.length>0){let c=[`Declared in ${d.aT}: ${[...a].join(", ")}`];b.size>0&&c.push(`in verify.gateDefinitions: ${[...b].join(", ")}`),f.push(`verify.gates: unknown gate id(s) ${h.join(", ")}. ${c.join("; ")}`)}}return f}function m(a,b){let c=["## 実行契約"];c.push(a.scope.allow.length>0?`- 変更してよいのは次のパスのみ: ${a.scope.allow.join(", ")}`:"- 変更パスの制限: なし(scope.allow が未宣言)"),a.scope.deny.length>0&&c.push(`- 変更してはならないパス: ${a.scope.deny.join(", ")}`),c.push(i(a,b).required?"- 作業完了後は必ず commit すること(未 commit の作業は未完了とみなされる)":"- 作業完了後は commit すること(ただし work-evidence は未 commit の変更も作業証跡として認めるため、commit の有無そのものは検査されない)");let h=function(a,b){if(!b)return[];let c=i(a,b).required?f:e,h=new Map([[d.uz,c],[d.le,g]]),l=[...b.gates,...k(a)],m=j(a);if(!m){let b=[c];return a.success.requireScopeClean&&b.push(g),[...b,...l.map(a=>a.command)]}let n=new Map(l.map(a=>[a.id,a.command]));return m.map(a=>h.get(a)??n.get(a))}(a,b);return c.push(h.length>0?`- 完了条件: 次の検証コマンドがすべて成功すること: ${h.join(" / ")}`:`- 完了条件: ${d.aT} に検証ゲートが宣言されていないため、検証コマンドは無い`),`${c.join("\n")}
2
2
 
3
3
  ## タスク
4
- ${a.goal}`}},74985:(a,b,c)=>{c.d(b,{Uq:()=>i,uT:()=>n});var d=c(33873),e=c(15194),f=c(77142),g=c(90384);let h=`options.requireEnvClean (${g.aT})`;function i(a,b){let c=[];return b?.options.requireEnvClean&&c.push(h),a&&!0===a.success.requireEnvClean&&c.push("success.requireEnvClean (task contract)"),{required:c.length>0,sources:c}}let j=[...e.XH].sort((a,b)=>b.length-a.length);function k(a,b,c){switch(a){case"tmux-sessions":return function(a,b){if(!a.startsWith(f.HL))return"unattributed";let c=a.slice(f.HL.length),d=j.find(a=>c.startsWith(`${a}-`));if(!d)return"unattributed";let e=c.slice(d.length+1);return e===b||e.startsWith(`${b}-`)?"self":"other"}(b.key,c.worktreeId);case"listeners":return function(a,b){if(!a)return"unattributed";let c=(0,d.resolve)(b),e=(0,d.resolve)(a);if(e===c||e.startsWith(c+d.sep))return"self";let f=(0,d.dirname)(c);return e!==f&&e.startsWith(f+d.sep)?"other":"unattributed"}(b.anchor,c.worktreePath);default:return"unattributed"}}function l(a,b){return{key:a.key,detail:a.detail,owner:b}}function m(a,b){let c=b.slice(0,25),d=b.length-c.length,e=c.map(b=>{let c=b.detail?` ${b.detail}`:"";return` ${a} ${b.key}${c} [${b.owner}]`});return d>0&&e.push(` ... and ${d} more`),e}async function n(a){let b,c=Date.now(),d=(a,b,d)=>({status:a,exitCode:d,startedAt:c,durationMs:Date.now()-c,logTail:b});if(!a.baseline)return d("error",function(a,b){let c=a?`task ${a}`:"this run",d=b.length>0?b.join(" and "):"nothing";return`${g.Q5}: UNKNOWN — no baseline snapshot exists for ${c}, so nothing can be compared. This is NOT "the environment is unchanged": no measurement was taken. A baseline is recorded when the task is created (\`send --contract\`) and only while the gate is switched on (currently: ${d}). Switch it on, then re-send the task.`}(a.taskId,a.sources),null);let e=a.capture??(()=>(0,f._8)({worktreeId:a.worktreeId}));try{b=await e()}catch(a){return d("error",`${g.Q5}: UNKNOWN — the current snapshot could not be taken: ${a instanceof Error?a.message:String(a)}`,null)}let h=function(a,b,c){let d=f.I1.map(d=>{let e=a.probes[d],f=b.probes[d];if(!e||"ok"!==e.status)return{probeId:d,status:"unknown",reason:`baseline probe unavailable: ${e?.reason??"not recorded"}`,added:[],ignoredAdded:[],removed:[]};if(!f||"ok"!==f.status)return{probeId:d,status:"unknown",reason:`current probe unavailable: ${f?.reason??"not recorded"}`,added:[],ignoredAdded:[],removed:[]};let g=new Set(e.entries.map(a=>a.key)),h=new Set(f.entries.map(a=>a.key)),i=[],j=[];for(let a of f.entries){if(g.has(a.key))continue;let b=k(d,a,c);("other"===b?j:i).push(l(a,b))}let m=e.entries.filter(a=>!h.has(a.key)).map(a=>l(a,k(d,a,c)));return{probeId:d,status:i.length+m.length>0?"violated":"clean",reason:null,added:i,ignoredAdded:j,removed:m}});return{status:d.some(a=>"violated"===a.status)?"violated":d.some(a=>"unknown"===a.status)?"unknown":"clean",probes:d}}(a.baseline,b,a),i=`${g.Q5}: baseline=${new Date(a.baseline.capturedAt).toISOString()} status=${h.status}`,j=`${i}
4
+ ${a.goal}`}},49987:(a,b,c)=>{c.d(b,{H:()=>l,Iq:()=>i,M:()=>k,xL:()=>n});var d=c(29021),e=c(21820),f=c(33873),g=c(55511);let h=(0,c(72626).h)("lib/verification/machine-lock"),i="locks",j="owner";function k(a,b){return(0,f.join)(b,`${a}.lock`)}function l(a=process.env){let b=a.CM_VERIFY_LOCK_ROOT;return b&&""!==b.trim()?b:(0,f.join)((0,e.homedir)(),".commandmate",i)}function m(a){try{let b=JSON.parse((0,d.readFileSync)((0,f.join)(a,j),"utf8"));if("number"!=typeof b.pid||"string"!=typeof b.token)return null;return{pid:b.pid,host:"string"==typeof b.host?b.host:"",token:b.token,acquiredAt:"number"==typeof b.acquiredAt?b.acquiredAt:0}}catch{return null}}async function n(a,b){let c=b.root??l(),i=b.pollIntervalMs??250,n=k(a,c),o=Date.now(),p=o+Math.max(0,b.timeoutMs),q=(0,g.randomUUID)();(0,d.mkdirSync)(c,{recursive:!0});let r=new Set;for(;;){if(function(a,b){try{(0,d.mkdirSync)(a)}catch(a){if("EEXIST"===a.code)return!1;throw a}return(0,d.writeFileSync)((0,f.join)(a,j),JSON.stringify(b),{encoding:"utf8"}),!0}(n,{pid:process.pid,host:(0,e.hostname)(),token:q,acquiredAt:Date.now()}))return{acquired:!0,waitedMs:Date.now()-o,handle:{name:a,path:n,release:()=>{let a=m(n);if(!a||a.token===q)try{(0,d.rmSync)(n,{recursive:!0,force:!0})}catch(a){h.warn("machine-lock-release-failed",{lockPath:n,error:a instanceof Error?a.message:String(a)})}}}};let b=m(n);if(b&&!r.has(b.token)&&function(a){if(a.host!==(0,e.hostname)())return!1;try{return process.kill(a.pid,0),!1}catch(a){return"ESRCH"===a.code}}(b)){r.add(b.token);let a=m(n);if(a&&a.token===b.token)try{(0,d.rmSync)(n,{recursive:!0,force:!0}),h.warn("machine-lock-broken-stale",{lockPath:n,pid:b.pid})}catch{}continue}let c=Date.now();if(c>=p)return{acquired:!1,waitedMs:c-o,heldBy:b?`pid ${b.pid} on ${b.host||"unknown host"}`:null};await function(a){return new Promise(b=>setTimeout(b,a))}(Math.min(i,p-c))}}},53604:(a,b,c)=>{c.d(b,{Cr:()=>k,L8:()=>i});var d=c(55511),e=c(29021),f=c(21820),g=c(33873);let h=(0,c(72626).h)("lib/verification/worktree-index"),i="worktree-index";function j(a,b){try{return(0,e.readFileSync)((0,g.join)(a,b),"utf8").trim()}catch{return null}}function k(a,b={}){let c=b.root??function(a=process.env){let b=a.CM_VERIFY_WORKTREE_INDEX_ROOT;return b&&""!==b.trim()?b:(0,g.join)((0,f.homedir)(),".commandmate",i)}();try{(0,e.mkdirSync)(c,{recursive:!0});let b=new Set;for(let d of(0,e.readdirSync)(c))if(/^\d+$/.test(d)){if(j(c,d)===a)return Number(d);b.add(Number(d))}for(let d=0;d<1024;d++)if(!b.has(d)&&function(a,b,c){try{return(0,e.writeFileSync)((0,g.join)(a,String(b)),`${c}
5
+ `,{encoding:"utf8",flag:"wx"}),!0}catch(d){if("EEXIST"!==d.code)throw d;return j(a,String(b))===c}}(c,d,a))return d;h.warn("worktree-index-exhausted",{worktreeId:a,root:c})}catch(b){h.warn("worktree-index-unavailable",{worktreeId:a,root:c,error:b instanceof Error?b.message:String(b)})}return Number.parseInt((0,d.createHash)("sha256").update(a).digest("hex").slice(0,8),16)%1024}},74985:(a,b,c)=>{c.d(b,{Uq:()=>i,uT:()=>n});var d=c(33873),e=c(15194),f=c(77142),g=c(90384);let h=`options.requireEnvClean (${g.aT})`;function i(a,b){let c=[];return b?.options.requireEnvClean&&c.push(h),a&&!0===a.success.requireEnvClean&&c.push("success.requireEnvClean (task contract)"),{required:c.length>0,sources:c}}let j=[...e.XH].sort((a,b)=>b.length-a.length);function k(a,b,c){switch(a){case"tmux-sessions":return function(a,b){if(!a.startsWith(f.HL))return"unattributed";let c=a.slice(f.HL.length),d=j.find(a=>c.startsWith(`${a}-`));if(!d)return"unattributed";let e=c.slice(d.length+1);return e===b||e.startsWith(`${b}-`)?"self":"other"}(b.key,c.worktreeId);case"listeners":return function(a,b){if(!a)return"unattributed";let c=(0,d.resolve)(b),e=(0,d.resolve)(a);if(e===c||e.startsWith(c+d.sep))return"self";let f=(0,d.dirname)(c);return e!==f&&e.startsWith(f+d.sep)?"other":"unattributed"}(b.anchor,c.worktreePath);default:return"unattributed"}}function l(a,b){return{key:a.key,detail:a.detail,owner:b}}function m(a,b){let c=b.slice(0,25),d=b.length-c.length,e=c.map(b=>{let c=b.detail?` ${b.detail}`:"";return` ${a} ${b.key}${c} [${b.owner}]`});return d>0&&e.push(` ... and ${d} more`),e}async function n(a){let b,c=Date.now(),d=(a,b,d)=>({status:a,exitCode:d,startedAt:c,durationMs:Date.now()-c,logTail:b});if(!a.baseline)return d("error",function(a,b){let c=a?`task ${a}`:"this run",d=b.length>0?b.join(" and "):"nothing";return`${g.Q5}: UNKNOWN — no baseline snapshot exists for ${c}, so nothing can be compared. This is NOT "the environment is unchanged": no measurement was taken. A baseline is recorded when the task is created (\`send --contract\`) and only while the gate is switched on (currently: ${d}). Switch it on, then re-send the task.`}(a.taskId,a.sources),null);let e=a.capture??(()=>(0,f._8)({worktreeId:a.worktreeId}));try{b=await e()}catch(a){return d("error",`${g.Q5}: UNKNOWN — the current snapshot could not be taken: ${a instanceof Error?a.message:String(a)}`,null)}let h=function(a,b,c){let d=f.I1.map(d=>{let e=a.probes[d],f=b.probes[d];if(!e||"ok"!==e.status)return{probeId:d,status:"unknown",reason:`baseline probe unavailable: ${e?.reason??"not recorded"}`,added:[],ignoredAdded:[],removed:[]};if(!f||"ok"!==f.status)return{probeId:d,status:"unknown",reason:`current probe unavailable: ${f?.reason??"not recorded"}`,added:[],ignoredAdded:[],removed:[]};let g=new Set(e.entries.map(a=>a.key)),h=new Set(f.entries.map(a=>a.key)),i=[],j=[];for(let a of f.entries){if(g.has(a.key))continue;let b=k(d,a,c);("other"===b?j:i).push(l(a,b))}let m=e.entries.filter(a=>!h.has(a.key)).map(a=>l(a,k(d,a,c)));return{probeId:d,status:i.length+m.length>0?"violated":"clean",reason:null,added:i,ignoredAdded:j,removed:m}});return{status:d.some(a=>"violated"===a.status)?"violated":d.some(a=>"unknown"===a.status)?"unknown":"clean",probes:d}}(a.baseline,b,a),i=`${g.Q5}: baseline=${new Date(a.baseline.capturedAt).toISOString()} status=${h.status}`,j=`${i}
5
6
  ${function(a){let b=[];for(let c of a.probes){let a=f.J6[c.probeId];if("unknown"===c.status){b.push(` ${c.probeId} UNKNOWN (${a}): ${c.reason??"no reason recorded"}`);continue}if("clean"===c.status){let d=c.ignoredAdded.length>0?` (${c.ignoredAdded.length} addition(s) attributed to another worktree)`:"";b.push(` ${c.probeId} clean (${a})${d}`);continue}for(let d of(b.push(` ${c.probeId} VIOLATED (${a}): +${c.added.length} -${c.removed.length}`),b.push(...m("+",c.added)),b.push(...m("-",c.removed)),c.ignoredAdded))b.push(` \xb7 ${d.key} (ignored: belongs to another worktree)`)}return b.join("\n")}(h)}`;return"clean"===h.status?d("passed",j,0):"unknown"===h.status?d("error",`${j}
6
7
  UNKNOWN is not a pass: at least one probe could not be compared, so the environment was not measured.`,null):d("failed",`${j}
7
- Anything listed under "+" was started or created during this task and left behind — stop it by PID and remove it. Anything under "-" existed when the task started and is now gone — it was killed or deleted; restart or restore it. Never stop a process by pattern (\`pkill -f\`): it takes every process whose command line matches, which is how the production server was stopped in #1739.`,1)}},77142:(a,b,c)=>{c.d(b,{HL:()=>r,I1:()=>j,J6:()=>k,_8:()=>w,dV:()=>A,g9:()=>B});var d=c(79646),e=c(29021),f=c(21820),g=c(33873),h=c(87447);let i=(0,c(72626).h)("lib/verification/env-snapshot"),j=["listeners","tmux-sessions","home-entries","commandmate-entries"],k={listeners:"CommandMate TCP listeners","tmux-sessions":"mcbd-* tmux sessions","home-entries":"$HOME entries","commandmate-entries":"~/.commandmate entries"},l={run:function(a,b){return new Promise(c=>{(0,d.execFile)(a,b,{timeout:5e3,maxBuffer:4194304,encoding:"utf8"},(b,d,e)=>b?"number"!=typeof b.code||b.killed?void c({code:null,stdout:d,stderr:e,failure:b.killed?`${a} exceeded 5000ms and was terminated`:`${a} could not be run: ${b.message}`}):void c({code:b.code,stdout:d,stderr:e,failure:null}):void c({code:0,stdout:d,stderr:e,failure:null}))})},readDir:a=>(0,e.readdirSync)(a),homeDir:()=>(0,f.homedir)()},m=/commandmate|dist\/server\/server\.js|next-server|next (dev|start)|server\.ts/i;function n(a){let b=[],c=null;for(let d of a.split("\n")){if(""===d)continue;let a=d[0],e=d.slice(1);if("p"===a){let a=Number(e);if(!Number.isInteger(a)){c=null;continue}c={pid:a,fields:new Map},b.push(c);continue}if(!c)continue;let f=c.fields.get(a);f?f.push(e):c.fields.set(a,[e])}return b}function o(a){return{status:"unavailable",entries:[],reason:a}}function p(a){let b=new Map;for(let c of a)b.has(c.key)||b.set(c.key,c);return{status:"ok",entries:[...b.values()].sort((a,b)=>a.key<b.key?-1:+(a.key>b.key)),reason:null}}async function q(a){let b=await a.run("lsof",["-nP","-iTCP","-sTCP:LISTEN","-F","pcn"]);if(null!==b.failure)return o(b.failure);if(0!==b.code&&1!==b.code)return o(`lsof exited ${b.code}: ${b.stderr.trim()||"no diagnostic output"}`);let c=n(b.stdout);if(0===c.length)return p([]);let d=await a.run("ps",["-A","-o","pid=,command="]);if(null!==d.failure||0!==d.code)return o(d.failure??`ps exited ${d.code}: ${d.stderr.trim()||"no diagnostic output"}`);let e=function(a){let b=new Map;for(let c of a.split("\n")){let a=/^\s*(\d+)\s+(.*)$/.exec(c);a&&b.set(Number(a[1]),a[2].trim())}return b}(d.stdout),f=c.filter(a=>{let b=e.get(a.pid);return void 0!==b&&m.test(b)});if(0===f.length)return p([]);let g=new Map,h=f.map(a=>String(a.pid)),i=await a.run("lsof",["-a","-d","cwd","-p",h.join(","),"-F","pn"]);if(null===i.failure&&(0===i.code||1===i.code))for(let a of n(i.stdout)){let[b]=a.fields.get("n")??[];b&&g.set(a.pid,b)}let j=[];for(let a of f){let b=a.fields.get("c")?.[0]??"unknown";for(let c of a.fields.get("n")??[]){let d=function(a){let b=a.lastIndexOf(":");if(b<0)return null;let c=a.slice(b+1);return/^\d+$/.test(c)?c:null}(c);d&&j.push({key:`tcp/${d}`,detail:`${b} pid=${a.pid}`,anchor:g.get(a.pid)??null})}}return p(j)}let r="mcbd-";async function s(a){let b=await a.run("tmux",["list-sessions","-F","#{session_name}"]);return null!==b.failure?o(b.failure):0!==b.code?/no server running|error connecting to|no sessions/i.test(b.stderr)?p([]):o(`tmux list-sessions exited ${b.code}: ${b.stderr.trim()||"no diagnostic output"}`):p(b.stdout.split("\n").map(a=>a.trim()).filter(a=>a.startsWith(r)).map(a=>({key:a,detail:null,anchor:null})))}let t=[/-wal$/,/-shm$/,/-journal$/,/^\.DS_Store$/],u="env-snapshots";function v(a,b,{missingIsEmpty:c}){let d;try{d=a.readDir(b)}catch(d){let a=d.code;if(c&&"ENOENT"===a)return p([]);return o(`could not list ${b}: ${d.message}`)}return p(d.filter(a=>!(a===u||t.some(b=>b.test(a)))).map(a=>({key:a,detail:null,anchor:null})))}async function w(a){let b=a.deps??l,[c,d]=await Promise.all([q(b).catch(a=>o(`listeners probe threw: ${a.message}`)),s(b).catch(a=>o(`tmux probe threw: ${a.message}`))]);return{version:1,capturedAt:a.now??Date.now(),worktreeId:a.worktreeId,probes:{listeners:c,"tmux-sessions":d,"home-entries":v(b,b.homeDir(),{missingIsEmpty:!1}),"commandmate-entries":v(b,(0,g.join)(b.homeDir(),".commandmate"),{missingIsEmpty:!0})}}}function x(){return(0,g.join)((0,g.dirname)((0,h._$)().CM_DB_PATH),u)}let y=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function z(a,b){return y.test(b)?(0,g.join)(a,`${b}.json`):null}function A(a,b,c=x()){let d=z(c,a);if(!d)return i.warn("env-snapshot-rejected-task-id",{taskId:a}),!1;try{return(0,e.mkdirSync)(c,{recursive:!0,mode:448}),(0,e.writeFileSync)(d,JSON.stringify(b),{encoding:"utf8",mode:384}),!function(a,b){let c;try{c=(0,e.readdirSync)(a)}catch{return}for(let d of c){if(!d.endsWith(".json"))continue;let c=(0,g.join)(a,d);try{b-(0,e.statSync)(c).mtimeMs>2592e6&&(0,e.rmSync)(c,{force:!0})}catch{}}}(c,b.capturedAt),!0}catch(b){return i.warn("env-snapshot-write-failed",{taskId:a,error:b instanceof Error?b.message:String(b)}),!1}}function B(a,b=x()){let c=z(b,a);if(!c)return null;try{let a=JSON.parse((0,e.readFileSync)(c,"utf8"));if(!function(a){if("object"!=typeof a||null===a||1!==a.version||"number"!=typeof a.capturedAt)return!1;let b=a.probes;return"object"==typeof b&&null!==b&&j.every(a=>{var c;return"object"==typeof(c=b[a])&&null!==c&&("ok"===c.status||"unavailable"===c.status)&&Array.isArray(c.entries)})}(a))return null;return a}catch{return null}}},90384:(a,b,c)=>{c.d(b,{D:()=>l,Q5:()=>i,UL:()=>v,Yp:()=>p,aT:()=>k,le:()=>h,uz:()=>g,yR:()=>w});var d=c(29021),e=c(33873),f=c(4689);let g="work-evidence",h="scope",i="env-clean",j=[g,h,i],k=".commandmate/verify.yaml",l=/^[a-z0-9][a-z0-9-]{0,31}$/,m=["version","gates","options"],n=["id","command","timeoutSec"],o=["baseRef","skipInPrimaryCheckout","maxLogTailBytes","requireCommit","requireEnvClean"];class p extends Error{constructor(a){super(`invalid verify config:
8
- ${a.map(a=>` - ${a}`).join("\n")}`),this.name="VerifyConfigError",this.issues=a}}function q(a){return"object"==typeof a&&null!==a&&!Array.isArray(a)}function r(a){return"number"==typeof a?Number.isInteger(a)?a:null:"string"==typeof a&&/^-?\d+$/.test(a)?Number(a):null}function s(a){return"boolean"==typeof a?a:"true"===a||"false"!==a&&null}function t(a){return void 0===a?"nothing":null===a?"null":"string"==typeof a?JSON.stringify(a):Array.isArray(a)?"a list":"object"==typeof a?"a mapping":String(a)}function u(a,b,c,d){for(let e of Object.keys(a))b.includes(e)||d.push(`${c}: unknown key "${e}" (v1 is a closed set)`)}function v(a,b,c){if(!Array.isArray(a))return c.push(`${b}: must be a list (got ${t(a)})`),[];let d=[],e=new Set;return a.forEach((a,f)=>{!function(a,b,c,d,e){let f=e.length;if(!q(a))return e.push(`${b}: must be a mapping (got ${t(a)})`);u(a,n,b,e),"string"!=typeof a.id||""===a.id?e.push(`${b}.id: required, must be a non-empty string (got ${t(a.id)})`):l.test(a.id)?j.includes(a.id)?e.push(`${b}.id: "${a.id}" is reserved for a built-in gate`):c.has(a.id)?e.push(`${b}.id: duplicate gate id "${a.id}"`):c.add(a.id):e.push(`${b}.id: "${a.id}" must match ${l.source}`),("string"!=typeof a.command||""===a.command.trim())&&e.push(`${b}.command: required, must be a non-empty string (got ${t(a.command)})`);let g=600;if(void 0!==a.timeoutSec){let c=r(a.timeoutSec);null===c?e.push(`${b}.timeoutSec: must be an integer (got ${t(a.timeoutSec)})`):c<1||c>7200?e.push(`${b}.timeoutSec: must be 1..7200 (got ${c})`):g=c}e.length===f&&d.push({id:a.id,command:a.command,timeoutSec:g})}(a,`${b}[${f}]`,e,d,c)}),d}function w(a){let b,c=(0,e.join)(a,k);try{b=(0,d.readFileSync)(c,"utf8")}catch(a){if("ENOENT"===a.code)return null;throw new p([`${c}: ${a.message}`])}return function(a,b){var c;let d;try{d=(0,f.qg)(a)}catch(a){throw new p([`${b}: YAML parse error: ${a.message}`])}if(!q(d))throw new p([`${b}: expected a YAML mapping at the top level (got ${t(d)})`]);let e=[];u(d,m,"top level",e),"version"in d?1!==r(d.version)&&e.push(`version: must be 1 (got ${t(d.version)})`):e.push('version: required, v1 configs must declare "version: 1"');let g=(c=d.gates,null==c?(e.push("gates: required, at least one gate must be defined"),[]):Array.isArray(c)&&0===c.length?(e.push("gates: at least one gate must be defined"),[]):v(c,"gates",e)),h=function(a,b){let c={baseRef:null,skipInPrimaryCheckout:!0,maxLogTailBytes:8192,requireCommit:!1,requireEnvClean:!1};if(null==a)return c;if(!q(a))return b.push(`options: must be a mapping (got ${t(a)})`),c;if(u(a,o,"options",b),void 0!==a.baseRef&&("string"!=typeof a.baseRef||""===a.baseRef.trim()?b.push(`options.baseRef: must be a non-empty string (got ${t(a.baseRef)})`):c.baseRef=a.baseRef),void 0!==a.skipInPrimaryCheckout){let d=s(a.skipInPrimaryCheckout);null===d?b.push(`options.skipInPrimaryCheckout: must be true or false (got ${t(a.skipInPrimaryCheckout)})`):c.skipInPrimaryCheckout=d}if(void 0!==a.requireCommit){let d=s(a.requireCommit);null===d?b.push(`options.requireCommit: must be true or false (got ${t(a.requireCommit)})`):c.requireCommit=d}if(void 0!==a.requireEnvClean){let d=s(a.requireEnvClean);null===d?b.push(`options.requireEnvClean: must be true or false (got ${t(a.requireEnvClean)})`):c.requireEnvClean=d}if(void 0!==a.maxLogTailBytes){let d=r(a.maxLogTailBytes);null===d?b.push(`options.maxLogTailBytes: must be an integer (got ${t(a.maxLogTailBytes)})`):d<0||d>1048576?b.push(`options.maxLogTailBytes: must be 0..1048576 (got ${d})`):c.maxLogTailBytes=d}return c}(d.options,e);if(e.length>0)throw new p(e);return{version:1,gates:g,options:h}}(b,c)}}};
8
+ Anything listed under "+" was started or created during this task and left behind — stop it by PID and remove it. Anything under "-" existed when the task started and is now gone — it was killed or deleted; restart or restore it. Never stop a process by pattern (\`pkill -f\`): it takes every process whose command line matches, which is how the production server was stopped in #1739.`,1)}},77142:(a,b,c)=>{c.d(b,{HL:()=>u,I1:()=>m,J6:()=>n,_8:()=>A,dV:()=>E,g9:()=>F});var d=c(79646),e=c(29021),f=c(21820),g=c(33873),h=c(87447),i=c(72626),j=c(49987),k=c(53604);let l=(0,i.h)("lib/verification/env-snapshot"),m=["listeners","tmux-sessions","home-entries","commandmate-entries"],n={listeners:"CommandMate TCP listeners","tmux-sessions":"mcbd-* tmux sessions","home-entries":"$HOME entries","commandmate-entries":"~/.commandmate entries"},o={run:function(a,b){return new Promise(c=>{(0,d.execFile)(a,b,{timeout:5e3,maxBuffer:4194304,encoding:"utf8"},(b,d,e)=>b?"number"!=typeof b.code||b.killed?void c({code:null,stdout:d,stderr:e,failure:b.killed?`${a} exceeded 5000ms and was terminated`:`${a} could not be run: ${b.message}`}):void c({code:b.code,stdout:d,stderr:e,failure:null}):void c({code:0,stdout:d,stderr:e,failure:null}))})},readDir:a=>(0,e.readdirSync)(a),homeDir:()=>(0,f.homedir)()},p=/commandmate|dist\/server\/server\.js|next-server|next (dev|start)|server\.ts/i;function q(a){let b=[],c=null;for(let d of a.split("\n")){if(""===d)continue;let a=d[0],e=d.slice(1);if("p"===a){let a=Number(e);if(!Number.isInteger(a)){c=null;continue}c={pid:a,fields:new Map},b.push(c);continue}if(!c)continue;let f=c.fields.get(a);f?f.push(e):c.fields.set(a,[e])}return b}function r(a){return{status:"unavailable",entries:[],reason:a}}function s(a){let b=new Map;for(let c of a)b.has(c.key)||b.set(c.key,c);return{status:"ok",entries:[...b.values()].sort((a,b)=>a.key<b.key?-1:+(a.key>b.key)),reason:null}}async function t(a){let b=await a.run("lsof",["-nP","-iTCP","-sTCP:LISTEN","-F","pcn"]);if(null!==b.failure)return r(b.failure);if(0!==b.code&&1!==b.code)return r(`lsof exited ${b.code}: ${b.stderr.trim()||"no diagnostic output"}`);let c=q(b.stdout);if(0===c.length)return s([]);let d=await a.run("ps",["-A","-o","pid=,command="]);if(null!==d.failure||0!==d.code)return r(d.failure??`ps exited ${d.code}: ${d.stderr.trim()||"no diagnostic output"}`);let e=function(a){let b=new Map;for(let c of a.split("\n")){let a=/^\s*(\d+)\s+(.*)$/.exec(c);a&&b.set(Number(a[1]),a[2].trim())}return b}(d.stdout),f=c.filter(a=>{let b=e.get(a.pid);return void 0!==b&&p.test(b)});if(0===f.length)return s([]);let g=new Map,h=f.map(a=>String(a.pid)),i=await a.run("lsof",["-a","-d","cwd","-p",h.join(","),"-F","pn"]);if(null===i.failure&&(0===i.code||1===i.code))for(let a of q(i.stdout)){let[b]=a.fields.get("n")??[];b&&g.set(a.pid,b)}let j=[];for(let a of f){let b=a.fields.get("c")?.[0]??"unknown";for(let c of a.fields.get("n")??[]){let d=function(a){let b=a.lastIndexOf(":");if(b<0)return null;let c=a.slice(b+1);return/^\d+$/.test(c)?c:null}(c);d&&j.push({key:`tcp/${d}`,detail:`${b} pid=${a.pid}`,anchor:g.get(a.pid)??null})}}return s(j)}let u="mcbd-";async function v(a){let b=await a.run("tmux",["list-sessions","-F","#{session_name}"]);return null!==b.failure?r(b.failure):0!==b.code?/no server running|error connecting to|no sessions/i.test(b.stderr)?s([]):r(`tmux list-sessions exited ${b.code}: ${b.stderr.trim()||"no diagnostic output"}`):s(b.stdout.split("\n").map(a=>a.trim()).filter(a=>a.startsWith(u)).map(a=>({key:a,detail:null,anchor:null})))}let w=[/-wal$/,/-shm$/,/-journal$/,/^\.DS_Store$/],x="env-snapshots",y=[j.Iq,k.L8];function z(a,b,{missingIsEmpty:c,alsoIgnored:d=[]}){let e;try{e=a.readDir(b)}catch(d){let a=d.code;if(c&&"ENOENT"===a)return s([]);return r(`could not list ${b}: ${d.message}`)}return s(e.filter(a=>!(a===x||w.some(b=>b.test(a)))&&!d.includes(a)).map(a=>({key:a,detail:null,anchor:null})))}async function A(a){let b=a.deps??o,[c,d]=await Promise.all([t(b).catch(a=>r(`listeners probe threw: ${a.message}`)),v(b).catch(a=>r(`tmux probe threw: ${a.message}`))]);return{version:1,capturedAt:a.now??Date.now(),worktreeId:a.worktreeId,probes:{listeners:c,"tmux-sessions":d,"home-entries":z(b,b.homeDir(),{missingIsEmpty:!1}),"commandmate-entries":z(b,(0,g.join)(b.homeDir(),".commandmate"),{missingIsEmpty:!0,alsoIgnored:y})}}}function B(){return(0,g.join)((0,g.dirname)((0,h._$)().CM_DB_PATH),x)}let C=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function D(a,b){return C.test(b)?(0,g.join)(a,`${b}.json`):null}function E(a,b,c=B()){let d=D(c,a);if(!d)return l.warn("env-snapshot-rejected-task-id",{taskId:a}),!1;try{return(0,e.mkdirSync)(c,{recursive:!0,mode:448}),(0,e.writeFileSync)(d,JSON.stringify(b),{encoding:"utf8",mode:384}),!function(a,b){let c;try{c=(0,e.readdirSync)(a)}catch{return}for(let d of c){if(!d.endsWith(".json"))continue;let c=(0,g.join)(a,d);try{b-(0,e.statSync)(c).mtimeMs>2592e6&&(0,e.rmSync)(c,{force:!0})}catch{}}}(c,b.capturedAt),!0}catch(b){return l.warn("env-snapshot-write-failed",{taskId:a,error:b instanceof Error?b.message:String(b)}),!1}}function F(a,b=B()){let c=D(b,a);if(!c)return null;try{let a=JSON.parse((0,e.readFileSync)(c,"utf8"));if(!function(a){if("object"!=typeof a||null===a||1!==a.version||"number"!=typeof a.capturedAt)return!1;let b=a.probes;return"object"==typeof b&&null!==b&&m.every(a=>{var c;return"object"==typeof(c=b[a])&&null!==c&&("ok"===c.status||"unavailable"===c.status)&&Array.isArray(c.entries)})}(a))return null;return a}catch{return null}}},90384:(a,b,c)=>{c.d(b,{D:()=>l,Q5:()=>i,UL:()=>w,Yp:()=>q,aT:()=>k,le:()=>h,uz:()=>g,yR:()=>x});var d=c(29021),e=c(33873),f=c(4689);let g="work-evidence",h="scope",i="env-clean",j=[g,h,i],k=".commandmate/verify.yaml",l=/^[a-z0-9][a-z0-9-]{0,31}$/,m=/^[A-Za-z0-9_.-]+$/,n=["version","gates","options"],o=["id","command","timeoutSec","mutex","retryOnFail","flakyIsPass"],p=["baseRef","skipInPrimaryCheckout","maxLogTailBytes","requireCommit","requireEnvClean"];class q extends Error{constructor(a){super(`invalid verify config:
9
+ ${a.map(a=>` - ${a}`).join("\n")}`),this.name="VerifyConfigError",this.issues=a}}function r(a){return"object"==typeof a&&null!==a&&!Array.isArray(a)}function s(a){return"number"==typeof a?Number.isInteger(a)?a:null:"string"==typeof a&&/^-?\d+$/.test(a)?Number(a):null}function t(a){return"boolean"==typeof a?a:"true"===a||"false"!==a&&null}function u(a){return void 0===a?"nothing":null===a?"null":"string"==typeof a?JSON.stringify(a):Array.isArray(a)?"a list":"object"==typeof a?"a mapping":String(a)}function v(a,b,c,d){for(let e of Object.keys(a))b.includes(e)||d.push(`${c}: unknown key "${e}" (v1 is a closed set)`)}function w(a,b,c){if(!Array.isArray(a))return c.push(`${b}: must be a list (got ${u(a)})`),[];let d=[],e=new Set;return a.forEach((a,f)=>{!function(a,b,c,d,e){let f,g,h,i=e.length;if(!r(a))return e.push(`${b}: must be a mapping (got ${u(a)})`);v(a,o,b,e),"string"!=typeof a.id||""===a.id?e.push(`${b}.id: required, must be a non-empty string (got ${u(a.id)})`):l.test(a.id)?j.includes(a.id)?e.push(`${b}.id: "${a.id}" is reserved for a built-in gate`):c.has(a.id)?e.push(`${b}.id: duplicate gate id "${a.id}"`):c.add(a.id):e.push(`${b}.id: "${a.id}" must match ${l.source}`),("string"!=typeof a.command||""===a.command.trim())&&e.push(`${b}.command: required, must be a non-empty string (got ${u(a.command)})`);let k=600;if(void 0!==a.timeoutSec){let c=s(a.timeoutSec);null===c?e.push(`${b}.timeoutSec: must be an integer (got ${u(a.timeoutSec)})`):c<1||c>7200?e.push(`${b}.timeoutSec: must be 1..7200 (got ${c})`):k=c}if(void 0!==a.mutex&&("string"!=typeof a.mutex||""===a.mutex?e.push(`${b}.mutex: must be a non-empty string (got ${u(a.mutex)})`):a.mutex.length>64?e.push(`${b}.mutex: must be at most 64 characters (got ${a.mutex.length})`):m.test(a.mutex)?f=a.mutex:e.push(`${b}.mutex: "${a.mutex}" must match ${m.source}`)),void 0!==a.retryOnFail){let c=s(a.retryOnFail);null===c?e.push(`${b}.retryOnFail: must be an integer (got ${u(a.retryOnFail)})`):c<0||c>1?e.push(`${b}.retryOnFail: must be 0 or 1 (got ${c})`):g=c}if(void 0!==a.flakyIsPass){let c=t(a.flakyIsPass);null===c?e.push(`${b}.flakyIsPass: must be true or false (got ${u(a.flakyIsPass)})`):c&&1!==g?e.push(`${b}.flakyIsPass: true requires retryOnFail: 1 (without a retry a gate can never be FLAKY)`):h=c}if(e.length===i){let b={id:a.id,command:a.command,timeoutSec:k};void 0!==f&&(b.mutex=f),void 0!==g&&(b.retryOnFail=g),void 0!==h&&(b.flakyIsPass=h),d.push(b)}}(a,`${b}[${f}]`,e,d,c)}),d}function x(a){let b,c=(0,e.join)(a,k);try{b=(0,d.readFileSync)(c,"utf8")}catch(a){if("ENOENT"===a.code)return null;throw new q([`${c}: ${a.message}`])}return function(a,b){var c;let d;try{d=(0,f.qg)(a)}catch(a){throw new q([`${b}: YAML parse error: ${a.message}`])}if(!r(d))throw new q([`${b}: expected a YAML mapping at the top level (got ${u(d)})`]);let e=[];v(d,n,"top level",e),"version"in d?1!==s(d.version)&&e.push(`version: must be 1 (got ${u(d.version)})`):e.push('version: required, v1 configs must declare "version: 1"');let g=(c=d.gates,null==c?(e.push("gates: required, at least one gate must be defined"),[]):Array.isArray(c)&&0===c.length?(e.push("gates: at least one gate must be defined"),[]):w(c,"gates",e)),h=function(a,b){let c={baseRef:null,skipInPrimaryCheckout:!0,maxLogTailBytes:8192,requireCommit:!1,requireEnvClean:!1};if(null==a)return c;if(!r(a))return b.push(`options: must be a mapping (got ${u(a)})`),c;if(v(a,p,"options",b),void 0!==a.baseRef&&("string"!=typeof a.baseRef||""===a.baseRef.trim()?b.push(`options.baseRef: must be a non-empty string (got ${u(a.baseRef)})`):c.baseRef=a.baseRef),void 0!==a.skipInPrimaryCheckout){let d=t(a.skipInPrimaryCheckout);null===d?b.push(`options.skipInPrimaryCheckout: must be true or false (got ${u(a.skipInPrimaryCheckout)})`):c.skipInPrimaryCheckout=d}if(void 0!==a.requireCommit){let d=t(a.requireCommit);null===d?b.push(`options.requireCommit: must be true or false (got ${u(a.requireCommit)})`):c.requireCommit=d}if(void 0!==a.requireEnvClean){let d=t(a.requireEnvClean);null===d?b.push(`options.requireEnvClean: must be true or false (got ${u(a.requireEnvClean)})`):c.requireEnvClean=d}if(void 0!==a.maxLogTailBytes){let d=s(a.maxLogTailBytes);null===d?b.push(`options.maxLogTailBytes: must be an integer (got ${u(a.maxLogTailBytes)})`):d<0||d>1048576?b.push(`options.maxLogTailBytes: must be 0..1048576 (got ${d})`):c.maxLogTailBytes=d}return c}(d.options,e);if(e.length>0)throw new q(e);return{version:1,gates:g,options:h}}(b,c)}}};
@@ -1 +1 @@
1
- globalThis.__BUILD_MANIFEST={polyfillFiles:["static/chunks/polyfills-42372ed130431b0a.js"],devFiles:[],ampDevFiles:[],lowPriorityFiles:[],rootMainFiles:["static/chunks/webpack-3534d858912a6c92.js","static/chunks/4bd1b696-100b9d70ed4e49c1.js","static/chunks/1255-8cb587d9170b45ed.js","static/chunks/main-app-5d631b93b1219836.js"],rootMainFilesTree:{},pages:{"/_app":["static/chunks/webpack-3534d858912a6c92.js","static/chunks/framework-eaf13c96191cb608.js","static/chunks/main-6092074a0dc78280.js","static/chunks/pages/_app-4b3fb5e477a0267f.js"],"/_error":["static/chunks/webpack-3534d858912a6c92.js","static/chunks/framework-eaf13c96191cb608.js","static/chunks/main-6092074a0dc78280.js","static/chunks/pages/_error-c970d8b55ace1b48.js"]},ampFirstPages:[]},globalThis.__BUILD_MANIFEST.lowPriorityFiles=["/static/"+process.env.__NEXT_BUILD_ID+"/_buildManifest.js",,"/static/"+process.env.__NEXT_BUILD_ID+"/_ssgManifest.js"];
1
+ globalThis.__BUILD_MANIFEST={polyfillFiles:["static/chunks/polyfills-42372ed130431b0a.js"],devFiles:[],ampDevFiles:[],lowPriorityFiles:[],rootMainFiles:["static/chunks/webpack-9d892a9ff07c289d.js","static/chunks/4bd1b696-100b9d70ed4e49c1.js","static/chunks/1255-8cb587d9170b45ed.js","static/chunks/main-app-5d631b93b1219836.js"],rootMainFilesTree:{},pages:{"/_app":["static/chunks/webpack-9d892a9ff07c289d.js","static/chunks/framework-eaf13c96191cb608.js","static/chunks/main-6092074a0dc78280.js","static/chunks/pages/_app-4b3fb5e477a0267f.js"],"/_error":["static/chunks/webpack-9d892a9ff07c289d.js","static/chunks/framework-eaf13c96191cb608.js","static/chunks/main-6092074a0dc78280.js","static/chunks/pages/_error-c970d8b55ace1b48.js"]},ampFirstPages:[]},globalThis.__BUILD_MANIFEST.lowPriorityFiles=["/static/"+process.env.__NEXT_BUILD_ID+"/_buildManifest.js",,"/static/"+process.env.__NEXT_BUILD_ID+"/_ssgManifest.js"];
@@ -17,11 +17,11 @@
17
17
  "wasm": [],
18
18
  "assets": [],
19
19
  "env": {
20
- "__NEXT_BUILD_ID": "smu4mnL7qMf8w38n9dQJE",
21
- "NEXT_SERVER_ACTIONS_ENCRYPTION_KEY": "s/DLzYZ0CzafrPWaxYYOm7t3VnjaPaxGSiZS/db7kos=",
22
- "__NEXT_PREVIEW_MODE_ID": "9af955072ea43b693018fe2bf05baabd",
23
- "__NEXT_PREVIEW_MODE_SIGNING_KEY": "7af936ab57a4b77eafe5c23e64affb4ef00b46d569bd7268f7723076de4e06a6",
24
- "__NEXT_PREVIEW_MODE_ENCRYPTION_KEY": "0e321766e60684c71cc2bcb6896e236b1726c523d24e684d479be7e921c8097e"
20
+ "__NEXT_BUILD_ID": "hNdNiFes2xLls68SWhAU9",
21
+ "NEXT_SERVER_ACTIONS_ENCRYPTION_KEY": "aOW5zI1Wz5isH4APFGUTyXptKRHpo0+ZG1nIwK+Ybd4=",
22
+ "__NEXT_PREVIEW_MODE_ID": "80eeecddce7230d0b23ed2ac35759ce9",
23
+ "__NEXT_PREVIEW_MODE_SIGNING_KEY": "ed91df4615bbbd28bbb7e35c9f88e7caf0f4f6f90287ea9893a63e5fd6f299f2",
24
+ "__NEXT_PREVIEW_MODE_ENCRYPTION_KEY": "49935e8cd611153aaa7f3ff5081de2933d9a68e59fa374c067a9453cae758afe"
25
25
  }
26
26
  }
27
27
  },