commandmate 0.49.1 → 0.49.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (456) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-build-manifest.json +128 -132
  3. package/.next/app-path-routes-manifest.json +22 -22
  4. package/.next/build-manifest.json +2 -2
  5. package/.next/prerender-manifest.json +12 -12
  6. package/.next/required-server-files.json +1 -1
  7. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  8. package/.next/server/app/api/agents/update/route_client-reference-manifest.js +1 -1
  9. package/.next/server/app/api/agents/versions/route_client-reference-manifest.js +1 -1
  10. package/.next/server/app/api/app/release-notes/route_client-reference-manifest.js +1 -1
  11. package/.next/server/app/api/app/update/route_client-reference-manifest.js +1 -1
  12. package/.next/server/app/api/app/update-check/route_client-reference-manifest.js +1 -1
  13. package/.next/server/app/api/auth/login/route_client-reference-manifest.js +1 -1
  14. package/.next/server/app/api/auth/logout/route_client-reference-manifest.js +1 -1
  15. package/.next/server/app/api/auth/status/route_client-reference-manifest.js +1 -1
  16. package/.next/server/app/api/capabilities/route.js +1 -1
  17. package/.next/server/app/api/capabilities/route_client-reference-manifest.js +1 -1
  18. package/.next/server/app/api/daily-summary/route_client-reference-manifest.js +1 -1
  19. package/.next/server/app/api/daily-summary/status/route_client-reference-manifest.js +1 -1
  20. package/.next/server/app/api/external-apps/[id]/health/route_client-reference-manifest.js +1 -1
  21. package/.next/server/app/api/external-apps/[id]/route_client-reference-manifest.js +1 -1
  22. package/.next/server/app/api/external-apps/route_client-reference-manifest.js +1 -1
  23. package/.next/server/app/api/fs/browse/route_client-reference-manifest.js +1 -1
  24. package/.next/server/app/api/fs/recent-paths/route_client-reference-manifest.js +1 -1
  25. package/.next/server/app/api/hooks/agent-event/route.js +2 -2
  26. package/.next/server/app/api/hooks/agent-event/route.js.nft.json +1 -1
  27. package/.next/server/app/api/hooks/agent-event/route_client-reference-manifest.js +1 -1
  28. package/.next/server/app/api/hooks/claude-done/route.js +2 -2
  29. package/.next/server/app/api/hooks/claude-done/route.js.nft.json +1 -1
  30. package/.next/server/app/api/hooks/claude-done/route_client-reference-manifest.js +1 -1
  31. package/.next/server/app/api/hooks/permission-request/route.js +1 -1
  32. package/.next/server/app/api/hooks/permission-request/route.js.nft.json +1 -1
  33. package/.next/server/app/api/hooks/permission-request/route_client-reference-manifest.js +1 -1
  34. package/.next/server/app/api/metrics/vibe/route_client-reference-manifest.js +1 -1
  35. package/.next/server/app/api/ollama/models/route_client-reference-manifest.js +1 -1
  36. package/.next/server/app/api/push/escalation/route_client-reference-manifest.js +1 -1
  37. package/.next/server/app/api/push/subscriptions/route.js +1 -1
  38. package/.next/server/app/api/push/subscriptions/route_client-reference-manifest.js +1 -1
  39. package/.next/server/app/api/push/vapid/route_client-reference-manifest.js +1 -1
  40. package/.next/server/app/api/relays/[relayId]/cancel/route.js +1 -1
  41. package/.next/server/app/api/relays/[relayId]/cancel/route.js.nft.json +1 -1
  42. package/.next/server/app/api/relays/[relayId]/cancel/route_client-reference-manifest.js +1 -1
  43. package/.next/server/app/api/relays/[relayId]/route_client-reference-manifest.js +1 -1
  44. package/.next/server/app/api/relays/route.js +1 -1
  45. package/.next/server/app/api/relays/route.js.nft.json +1 -1
  46. package/.next/server/app/api/relays/route_client-reference-manifest.js +1 -1
  47. package/.next/server/app/api/remote/pair/route_client-reference-manifest.js +1 -1
  48. package/.next/server/app/api/repositories/[id]/route_client-reference-manifest.js +1 -1
  49. package/.next/server/app/api/repositories/clone/[jobId]/route.js +1 -1
  50. package/.next/server/app/api/repositories/clone/[jobId]/route.js.nft.json +1 -1
  51. package/.next/server/app/api/repositories/clone/[jobId]/route_client-reference-manifest.js +1 -1
  52. package/.next/server/app/api/repositories/clone/route.js +1 -1
  53. package/.next/server/app/api/repositories/clone/route.js.nft.json +1 -1
  54. package/.next/server/app/api/repositories/clone/route_client-reference-manifest.js +1 -1
  55. package/.next/server/app/api/repositories/excluded/route_client-reference-manifest.js +1 -1
  56. package/.next/server/app/api/repositories/restore/route.js +1 -1
  57. package/.next/server/app/api/repositories/restore/route.js.nft.json +1 -1
  58. package/.next/server/app/api/repositories/restore/route_client-reference-manifest.js +1 -1
  59. package/.next/server/app/api/repositories/route.js +1 -1
  60. package/.next/server/app/api/repositories/route.js.nft.json +1 -1
  61. package/.next/server/app/api/repositories/route_client-reference-manifest.js +1 -1
  62. package/.next/server/app/api/repositories/scan/route.js +1 -1
  63. package/.next/server/app/api/repositories/scan/route.js.nft.json +1 -1
  64. package/.next/server/app/api/repositories/scan/route_client-reference-manifest.js +1 -1
  65. package/.next/server/app/api/repositories/sync/route.js +1 -1
  66. package/.next/server/app/api/repositories/sync/route.js.nft.json +1 -1
  67. package/.next/server/app/api/repositories/sync/route_client-reference-manifest.js +1 -1
  68. package/.next/server/app/api/repositories/validate-path/route_client-reference-manifest.js +1 -1
  69. package/.next/server/app/api/settings/default-agents/route.js +1 -1
  70. package/.next/server/app/api/settings/default-agents/route.js.nft.json +1 -1
  71. package/.next/server/app/api/settings/default-agents/route_client-reference-manifest.js +1 -1
  72. package/.next/server/app/api/settings/default-surface-mode/route_client-reference-manifest.js +1 -1
  73. package/.next/server/app/api/sidebar/group-order/route_client-reference-manifest.js +1 -1
  74. package/.next/server/app/api/skills/[id]/route_client-reference-manifest.js +1 -1
  75. package/.next/server/app/api/skills/installations/route_client-reference-manifest.js +1 -1
  76. package/.next/server/app/api/skills/operations/route_client-reference-manifest.js +1 -1
  77. package/.next/server/app/api/skills/reindex/route_client-reference-manifest.js +1 -1
  78. package/.next/server/app/api/skills/route_client-reference-manifest.js +1 -1
  79. package/.next/server/app/api/slash-commands/route_client-reference-manifest.js +1 -1
  80. package/.next/server/app/api/tasks/[taskId]/cancel/route_client-reference-manifest.js +1 -1
  81. package/.next/server/app/api/tasks/[taskId]/route.js +1 -1
  82. package/.next/server/app/api/tasks/[taskId]/route_client-reference-manifest.js +1 -1
  83. package/.next/server/app/api/templates/[id]/route_client-reference-manifest.js +1 -1
  84. package/.next/server/app/api/templates/route_client-reference-manifest.js +1 -1
  85. package/.next/server/app/api/verification/runs/[runId]/route.js +1 -1
  86. package/.next/server/app/api/verification/runs/[runId]/route_client-reference-manifest.js +1 -1
  87. package/.next/server/app/api/verification/runs/route.js +1 -1
  88. package/.next/server/app/api/verification/runs/route_client-reference-manifest.js +1 -1
  89. package/.next/server/app/api/worktrees/[id]/auto-yes/route.js +1 -1
  90. package/.next/server/app/api/worktrees/[id]/auto-yes/route.js.nft.json +1 -1
  91. package/.next/server/app/api/worktrees/[id]/auto-yes/route_client-reference-manifest.js +1 -1
  92. package/.next/server/app/api/worktrees/[id]/capture/route.js +1 -1
  93. package/.next/server/app/api/worktrees/[id]/capture/route.js.nft.json +1 -1
  94. package/.next/server/app/api/worktrees/[id]/capture/route_client-reference-manifest.js +1 -1
  95. package/.next/server/app/api/worktrees/[id]/clear-composer/route.js +1 -1
  96. package/.next/server/app/api/worktrees/[id]/clear-composer/route.js.nft.json +1 -1
  97. package/.next/server/app/api/worktrees/[id]/clear-composer/route_client-reference-manifest.js +1 -1
  98. package/.next/server/app/api/worktrees/[id]/cli-reference/route.js +1 -1
  99. package/.next/server/app/api/worktrees/[id]/cli-reference/route_client-reference-manifest.js +1 -1
  100. package/.next/server/app/api/worktrees/[id]/cli-tool/route.js +1 -1
  101. package/.next/server/app/api/worktrees/[id]/cli-tool/route_client-reference-manifest.js +1 -1
  102. package/.next/server/app/api/worktrees/[id]/cmate/schedules/route.js +1 -1
  103. package/.next/server/app/api/worktrees/[id]/cmate/schedules/route_client-reference-manifest.js +1 -1
  104. package/.next/server/app/api/worktrees/[id]/current-output/route.js +1 -1
  105. package/.next/server/app/api/worktrees/[id]/current-output/route.js.nft.json +1 -1
  106. package/.next/server/app/api/worktrees/[id]/current-output/route_client-reference-manifest.js +1 -1
  107. package/.next/server/app/api/worktrees/[id]/direct-input/route.js +1 -1
  108. package/.next/server/app/api/worktrees/[id]/direct-input/route.js.nft.json +1 -1
  109. package/.next/server/app/api/worktrees/[id]/direct-input/route_client-reference-manifest.js +1 -1
  110. package/.next/server/app/api/worktrees/[id]/env/route.js +1 -1
  111. package/.next/server/app/api/worktrees/[id]/env/route_client-reference-manifest.js +1 -1
  112. package/.next/server/app/api/worktrees/[id]/execution-logs/[logId]/route.js +1 -1
  113. package/.next/server/app/api/worktrees/[id]/execution-logs/[logId]/route_client-reference-manifest.js +1 -1
  114. package/.next/server/app/api/worktrees/[id]/execution-logs/route.js +1 -1
  115. package/.next/server/app/api/worktrees/[id]/execution-logs/route_client-reference-manifest.js +1 -1
  116. package/.next/server/app/api/worktrees/[id]/files/[...path]/route_client-reference-manifest.js +1 -1
  117. package/.next/server/app/api/worktrees/[id]/git/branch/create/route.js +1 -1
  118. package/.next/server/app/api/worktrees/[id]/git/branch/create/route_client-reference-manifest.js +1 -1
  119. package/.next/server/app/api/worktrees/[id]/git/branch/delete/route.js +1 -1
  120. package/.next/server/app/api/worktrees/[id]/git/branch/delete/route_client-reference-manifest.js +1 -1
  121. package/.next/server/app/api/worktrees/[id]/git/branches/route.js +1 -1
  122. package/.next/server/app/api/worktrees/[id]/git/branches/route_client-reference-manifest.js +1 -1
  123. package/.next/server/app/api/worktrees/[id]/git/checkout/route.js +1 -1
  124. package/.next/server/app/api/worktrees/[id]/git/checkout/route_client-reference-manifest.js +1 -1
  125. package/.next/server/app/api/worktrees/[id]/git/commit/route.js +1 -1
  126. package/.next/server/app/api/worktrees/[id]/git/commit/route_client-reference-manifest.js +1 -1
  127. package/.next/server/app/api/worktrees/[id]/git/diff/route.js +1 -1
  128. package/.next/server/app/api/worktrees/[id]/git/diff/route_client-reference-manifest.js +1 -1
  129. package/.next/server/app/api/worktrees/[id]/git/fetch/route.js +1 -1
  130. package/.next/server/app/api/worktrees/[id]/git/fetch/route_client-reference-manifest.js +1 -1
  131. package/.next/server/app/api/worktrees/[id]/git/log/route.js +1 -1
  132. package/.next/server/app/api/worktrees/[id]/git/log/route_client-reference-manifest.js +1 -1
  133. package/.next/server/app/api/worktrees/[id]/git/pull/route.js +1 -1
  134. package/.next/server/app/api/worktrees/[id]/git/pull/route_client-reference-manifest.js +1 -1
  135. package/.next/server/app/api/worktrees/[id]/git/push/route.js +1 -1
  136. package/.next/server/app/api/worktrees/[id]/git/push/route_client-reference-manifest.js +1 -1
  137. package/.next/server/app/api/worktrees/[id]/git/reset/route.js +1 -1
  138. package/.next/server/app/api/worktrees/[id]/git/reset/route_client-reference-manifest.js +1 -1
  139. package/.next/server/app/api/worktrees/[id]/git/revert/route.js +1 -1
  140. package/.next/server/app/api/worktrees/[id]/git/revert/route_client-reference-manifest.js +1 -1
  141. package/.next/server/app/api/worktrees/[id]/git/show/[commitHash]/route.js +1 -1
  142. package/.next/server/app/api/worktrees/[id]/git/show/[commitHash]/route_client-reference-manifest.js +1 -1
  143. package/.next/server/app/api/worktrees/[id]/git/stage/route.js +1 -1
  144. package/.next/server/app/api/worktrees/[id]/git/stage/route_client-reference-manifest.js +1 -1
  145. package/.next/server/app/api/worktrees/[id]/git/staged/route.js +1 -1
  146. package/.next/server/app/api/worktrees/[id]/git/staged/route_client-reference-manifest.js +1 -1
  147. package/.next/server/app/api/worktrees/[id]/git/stash/[index]/route.js +1 -1
  148. package/.next/server/app/api/worktrees/[id]/git/stash/[index]/route_client-reference-manifest.js +1 -1
  149. package/.next/server/app/api/worktrees/[id]/git/stash/apply/route.js +1 -1
  150. package/.next/server/app/api/worktrees/[id]/git/stash/apply/route_client-reference-manifest.js +1 -1
  151. package/.next/server/app/api/worktrees/[id]/git/stash/pop/route.js +1 -1
  152. package/.next/server/app/api/worktrees/[id]/git/stash/pop/route_client-reference-manifest.js +1 -1
  153. package/.next/server/app/api/worktrees/[id]/git/stash/push/route.js +1 -1
  154. package/.next/server/app/api/worktrees/[id]/git/stash/push/route_client-reference-manifest.js +1 -1
  155. package/.next/server/app/api/worktrees/[id]/git/stash/route.js +1 -1
  156. package/.next/server/app/api/worktrees/[id]/git/stash/route_client-reference-manifest.js +1 -1
  157. package/.next/server/app/api/worktrees/[id]/git/status/route.js +1 -1
  158. package/.next/server/app/api/worktrees/[id]/git/status/route_client-reference-manifest.js +1 -1
  159. package/.next/server/app/api/worktrees/[id]/git/unstage/route.js +1 -1
  160. package/.next/server/app/api/worktrees/[id]/git/unstage/route_client-reference-manifest.js +1 -1
  161. package/.next/server/app/api/worktrees/[id]/git/working-diff/route.js +1 -1
  162. package/.next/server/app/api/worktrees/[id]/git/working-diff/route_client-reference-manifest.js +1 -1
  163. package/.next/server/app/api/worktrees/[id]/instances/notes/route.js +1 -1
  164. package/.next/server/app/api/worktrees/[id]/instances/notes/route_client-reference-manifest.js +1 -1
  165. package/.next/server/app/api/worktrees/[id]/instances/opencode/route.js +1 -1
  166. package/.next/server/app/api/worktrees/[id]/instances/opencode/route.js.nft.json +1 -1
  167. package/.next/server/app/api/worktrees/[id]/instances/opencode/route_client-reference-manifest.js +1 -1
  168. package/.next/server/app/api/worktrees/[id]/interrupt/route.js +1 -1
  169. package/.next/server/app/api/worktrees/[id]/interrupt/route.js.nft.json +1 -1
  170. package/.next/server/app/api/worktrees/[id]/interrupt/route_client-reference-manifest.js +1 -1
  171. package/.next/server/app/api/worktrees/[id]/kill-session/route.js +2 -1
  172. package/.next/server/app/api/worktrees/[id]/kill-session/route.js.nft.json +1 -1
  173. package/.next/server/app/api/worktrees/[id]/kill-session/route_client-reference-manifest.js +1 -1
  174. package/.next/server/app/api/worktrees/[id]/logs/[filename]/route.js +1 -1
  175. package/.next/server/app/api/worktrees/[id]/logs/[filename]/route.js.nft.json +1 -1
  176. package/.next/server/app/api/worktrees/[id]/logs/[filename]/route_client-reference-manifest.js +1 -1
  177. package/.next/server/app/api/worktrees/[id]/logs/route.js +2 -2
  178. package/.next/server/app/api/worktrees/[id]/logs/route.js.nft.json +1 -1
  179. package/.next/server/app/api/worktrees/[id]/logs/route_client-reference-manifest.js +1 -1
  180. package/.next/server/app/api/worktrees/[id]/marp-render/route.js +1 -1
  181. package/.next/server/app/api/worktrees/[id]/marp-render/route_client-reference-manifest.js +1 -1
  182. package/.next/server/app/api/worktrees/[id]/memos/[memoId]/route.js +1 -1
  183. package/.next/server/app/api/worktrees/[id]/memos/[memoId]/route_client-reference-manifest.js +1 -1
  184. package/.next/server/app/api/worktrees/[id]/memos/route.js +1 -1
  185. package/.next/server/app/api/worktrees/[id]/memos/route_client-reference-manifest.js +1 -1
  186. package/.next/server/app/api/worktrees/[id]/messages/route.js +1 -1
  187. package/.next/server/app/api/worktrees/[id]/messages/route_client-reference-manifest.js +1 -1
  188. package/.next/server/app/api/worktrees/[id]/opencode/diff/route.js +1 -1
  189. package/.next/server/app/api/worktrees/[id]/opencode/diff/route.js.nft.json +1 -1
  190. package/.next/server/app/api/worktrees/[id]/opencode/diff/route_client-reference-manifest.js +1 -1
  191. package/.next/server/app/api/worktrees/[id]/opencode/session/route.js +1 -1
  192. package/.next/server/app/api/worktrees/[id]/opencode/session/route.js.nft.json +1 -1
  193. package/.next/server/app/api/worktrees/[id]/opencode/session/route_client-reference-manifest.js +1 -1
  194. package/.next/server/app/api/worktrees/[id]/opencode/share/route.js +1 -1
  195. package/.next/server/app/api/worktrees/[id]/opencode/share/route.js.nft.json +1 -1
  196. package/.next/server/app/api/worktrees/[id]/opencode/share/route_client-reference-manifest.js +1 -1
  197. package/.next/server/app/api/worktrees/[id]/prompt-response/route.js +1 -1
  198. package/.next/server/app/api/worktrees/[id]/prompt-response/route.js.nft.json +1 -1
  199. package/.next/server/app/api/worktrees/[id]/prompt-response/route_client-reference-manifest.js +1 -1
  200. package/.next/server/app/api/worktrees/[id]/prompt-response/strict/route.js +1 -1
  201. package/.next/server/app/api/worktrees/[id]/prompt-response/strict/route.js.nft.json +1 -1
  202. package/.next/server/app/api/worktrees/[id]/prompt-response/strict/route_client-reference-manifest.js +1 -1
  203. package/.next/server/app/api/worktrees/[id]/resolve-target/route.js +1 -1
  204. package/.next/server/app/api/worktrees/[id]/resolve-target/route_client-reference-manifest.js +1 -1
  205. package/.next/server/app/api/worktrees/[id]/respond/route.js +1 -1
  206. package/.next/server/app/api/worktrees/[id]/respond/route.js.nft.json +1 -1
  207. package/.next/server/app/api/worktrees/[id]/respond/route_client-reference-manifest.js +1 -1
  208. package/.next/server/app/api/worktrees/[id]/route.js +1 -1
  209. package/.next/server/app/api/worktrees/[id]/route.js.nft.json +1 -1
  210. package/.next/server/app/api/worktrees/[id]/route_client-reference-manifest.js +1 -1
  211. package/.next/server/app/api/worktrees/[id]/schedules/[scheduleId]/route.js +1 -1
  212. package/.next/server/app/api/worktrees/[id]/schedules/[scheduleId]/route_client-reference-manifest.js +1 -1
  213. package/.next/server/app/api/worktrees/[id]/schedules/active/route.js +1 -1
  214. package/.next/server/app/api/worktrees/[id]/schedules/active/route_client-reference-manifest.js +1 -1
  215. package/.next/server/app/api/worktrees/[id]/schedules/route.js +1 -1
  216. package/.next/server/app/api/worktrees/[id]/schedules/route_client-reference-manifest.js +1 -1
  217. package/.next/server/app/api/worktrees/[id]/search/route_client-reference-manifest.js +1 -1
  218. package/.next/server/app/api/worktrees/[id]/send/route.js +2 -2
  219. package/.next/server/app/api/worktrees/[id]/send/route.js.nft.json +1 -1
  220. package/.next/server/app/api/worktrees/[id]/send/route_client-reference-manifest.js +1 -1
  221. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route.js +3 -3
  222. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route.js.nft.json +1 -1
  223. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route_client-reference-manifest.js +1 -1
  224. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/install/route_client-reference-manifest.js +1 -1
  225. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/plan/route_client-reference-manifest.js +1 -1
  226. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall/route_client-reference-manifest.js +1 -1
  227. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall-plan/route_client-reference-manifest.js +1 -1
  228. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/update/route_client-reference-manifest.js +1 -1
  229. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/update-plan/route_client-reference-manifest.js +1 -1
  230. package/.next/server/app/api/worktrees/[id]/skills/route.js +1 -1
  231. package/.next/server/app/api/worktrees/[id]/skills/route_client-reference-manifest.js +1 -1
  232. package/.next/server/app/api/worktrees/[id]/slash-commands/route.js +1 -1
  233. package/.next/server/app/api/worktrees/[id]/slash-commands/route_client-reference-manifest.js +1 -1
  234. package/.next/server/app/api/worktrees/[id]/special-keys/route.js +1 -1
  235. package/.next/server/app/api/worktrees/[id]/special-keys/route.js.nft.json +1 -1
  236. package/.next/server/app/api/worktrees/[id]/special-keys/route_client-reference-manifest.js +1 -1
  237. package/.next/server/app/api/worktrees/[id]/tasks/route.js +1 -1
  238. package/.next/server/app/api/worktrees/[id]/tasks/route_client-reference-manifest.js +1 -1
  239. package/.next/server/app/api/worktrees/[id]/terminal/route.js +2 -2
  240. package/.next/server/app/api/worktrees/[id]/terminal/route.js.nft.json +1 -1
  241. package/.next/server/app/api/worktrees/[id]/terminal/route_client-reference-manifest.js +1 -1
  242. package/.next/server/app/api/worktrees/[id]/timers/history/route.js +1 -1
  243. package/.next/server/app/api/worktrees/[id]/timers/history/route_client-reference-manifest.js +1 -1
  244. package/.next/server/app/api/worktrees/[id]/timers/route.js +1 -1
  245. package/.next/server/app/api/worktrees/[id]/timers/route.js.nft.json +1 -1
  246. package/.next/server/app/api/worktrees/[id]/timers/route_client-reference-manifest.js +1 -1
  247. package/.next/server/app/api/worktrees/[id]/todos/[todoId]/route.js +1 -1
  248. package/.next/server/app/api/worktrees/[id]/todos/[todoId]/route.js.nft.json +1 -1
  249. package/.next/server/app/api/worktrees/[id]/todos/[todoId]/route_client-reference-manifest.js +1 -1
  250. package/.next/server/app/api/worktrees/[id]/todos/route.js +1 -1
  251. package/.next/server/app/api/worktrees/[id]/todos/route.js.nft.json +1 -1
  252. package/.next/server/app/api/worktrees/[id]/todos/route_client-reference-manifest.js +1 -1
  253. package/.next/server/app/api/worktrees/[id]/tree/[...path]/route_client-reference-manifest.js +1 -1
  254. package/.next/server/app/api/worktrees/[id]/tree/route_client-reference-manifest.js +1 -1
  255. package/.next/server/app/api/worktrees/[id]/upload/[...path]/route_client-reference-manifest.js +1 -1
  256. package/.next/server/app/api/worktrees/[id]/verify/config/route.js +1 -1
  257. package/.next/server/app/api/worktrees/[id]/verify/config/route_client-reference-manifest.js +1 -1
  258. package/.next/server/app/api/worktrees/[id]/verify/route.js +1 -1
  259. package/.next/server/app/api/worktrees/[id]/verify/route.js.nft.json +1 -1
  260. package/.next/server/app/api/worktrees/[id]/verify/route_client-reference-manifest.js +1 -1
  261. package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/cancel/route.js +1 -1
  262. package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/cancel/route.js.nft.json +1 -1
  263. package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/cancel/route_client-reference-manifest.js +1 -1
  264. package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/route.js +1 -1
  265. package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/route_client-reference-manifest.js +1 -1
  266. package/.next/server/app/api/worktrees/[id]/verify/runs/route.js +1 -1
  267. package/.next/server/app/api/worktrees/[id]/verify/runs/route_client-reference-manifest.js +1 -1
  268. package/.next/server/app/api/worktrees/[id]/viewed/route.js +1 -1
  269. package/.next/server/app/api/worktrees/[id]/viewed/route_client-reference-manifest.js +1 -1
  270. package/.next/server/app/api/worktrees/apply-default-agents/route_client-reference-manifest.js +1 -1
  271. package/.next/server/app/api/worktrees/route.js +1 -1
  272. package/.next/server/app/api/worktrees/route.js.nft.json +1 -1
  273. package/.next/server/app/api/worktrees/route_client-reference-manifest.js +1 -1
  274. package/.next/server/app/login/page_client-reference-manifest.js +1 -1
  275. package/.next/server/app/manifest.webmanifest/route_client-reference-manifest.js +1 -1
  276. package/.next/server/app/more/page_client-reference-manifest.js +1 -1
  277. package/.next/server/app/offline/page_client-reference-manifest.js +1 -1
  278. package/.next/server/app/page_client-reference-manifest.js +1 -1
  279. package/.next/server/app/proxy/[...path]/route_client-reference-manifest.js +1 -1
  280. package/.next/server/app/repositories/page_client-reference-manifest.js +1 -1
  281. package/.next/server/app/review/page.js +1 -1
  282. package/.next/server/app/review/page_client-reference-manifest.js +1 -1
  283. package/.next/server/app/sessions/page_client-reference-manifest.js +1 -1
  284. package/.next/server/app/skills/[skillId]/page_client-reference-manifest.js +1 -1
  285. package/.next/server/app/skills/installed/page_client-reference-manifest.js +1 -1
  286. package/.next/server/app/skills/page_client-reference-manifest.js +1 -1
  287. package/.next/server/app/worktrees/[id]/files/[...path]/page_client-reference-manifest.js +1 -1
  288. package/.next/server/app/worktrees/[id]/page.js +2 -2
  289. package/.next/server/app/worktrees/[id]/page_client-reference-manifest.js +1 -1
  290. package/.next/server/app/worktrees/[id]/terminal/page_client-reference-manifest.js +1 -1
  291. package/.next/server/app-paths-manifest.json +22 -22
  292. package/.next/server/chunks/1062.js +1 -0
  293. package/.next/server/chunks/110.js +1 -0
  294. package/.next/server/chunks/1501.js +5 -4
  295. package/.next/server/chunks/1656.js +2 -2
  296. package/.next/server/chunks/1957.js +2 -0
  297. package/.next/server/chunks/2119.js +1 -1
  298. package/.next/server/chunks/2445.js +1 -1
  299. package/.next/server/chunks/2897.js +1 -0
  300. package/.next/server/chunks/3417.js +1 -0
  301. package/.next/server/chunks/3505.js +1 -1
  302. package/.next/server/chunks/3756.js +1 -0
  303. package/.next/server/chunks/3801.js +3 -3
  304. package/.next/server/chunks/4911.js +1 -0
  305. package/.next/server/chunks/4936.js +1 -0
  306. package/.next/server/chunks/5209.js +2 -1
  307. package/.next/server/chunks/5354.js +1 -1
  308. package/.next/server/chunks/6130.js +1 -1
  309. package/.next/server/chunks/6401.js +1 -1
  310. package/.next/server/chunks/7023.js +2 -2
  311. package/.next/server/chunks/7905.js +1 -1
  312. package/.next/server/chunks/8581.js +15 -15
  313. package/.next/server/chunks/8728.js +2 -2
  314. package/.next/server/chunks/8782.js +1 -1
  315. package/.next/server/chunks/9390.js +1 -1
  316. package/.next/server/chunks/9584.js +1 -1
  317. package/.next/server/chunks/9731.js +2 -2
  318. package/.next/server/middleware-manifest.json +5 -5
  319. package/.next/server/pages/500.html +1 -1
  320. package/.next/server/server-reference-manifest.json +1 -1
  321. package/.next/static/chunks/{2407-675ba6b21844dc3b.js → 2407-07a237575e1ceb9e.js} +1 -1
  322. package/.next/static/chunks/3931-61ad1a4fc0208d0e.js +1 -0
  323. package/.next/static/chunks/5794-7975b8e51e731b19.js +1 -0
  324. package/.next/static/chunks/6966-d8dc6032410ffaba.js +1 -0
  325. package/.next/static/chunks/7197-ed3b3d99ac3bd450.js +1 -0
  326. package/.next/static/chunks/7636-a48cf0f7110250c5.js +1 -0
  327. package/.next/static/chunks/app/layout-4f64316957b0a8e5.js +1 -0
  328. package/.next/static/chunks/app/more/page-ff5af5ca48774c89.js +1 -0
  329. package/.next/static/chunks/app/page-b4863bfe0452e09d.js +1 -0
  330. package/.next/static/chunks/app/review/page-ff3efb96fdf9bb4b.js +1 -0
  331. package/.next/static/chunks/app/sessions/{page-890fd50ec9739973.js → page-c6eb7c02db2f4c80.js} +1 -1
  332. package/.next/static/chunks/app/worktrees/[id]/{page-f6d3ab8185d93aae.js → page-33afc6aa96289fb0.js} +1 -1
  333. package/.next/trace +13 -13
  334. package/dist/cli/commands/ask.d.ts.map +1 -1
  335. package/dist/cli/commands/ask.js +56 -5
  336. package/dist/cli/commands/attach.d.ts +4 -1
  337. package/dist/cli/commands/attach.d.ts.map +1 -1
  338. package/dist/cli/commands/attach.js +19 -7
  339. package/dist/cli/commands/command-target.d.ts +7 -0
  340. package/dist/cli/commands/command-target.d.ts.map +1 -1
  341. package/dist/cli/commands/command-target.js +10 -0
  342. package/dist/cli/commands/instances.d.ts.map +1 -1
  343. package/dist/cli/commands/instances.js +38 -2
  344. package/dist/cli/commands/message-dispatch.d.ts +17 -3
  345. package/dist/cli/commands/message-dispatch.d.ts.map +1 -1
  346. package/dist/cli/commands/message-dispatch.js +14 -8
  347. package/dist/cli/commands/relays.d.ts +2 -1
  348. package/dist/cli/commands/relays.d.ts.map +1 -1
  349. package/dist/cli/commands/relays.js +4 -3
  350. package/dist/cli/commands/respond-strict.d.ts.map +1 -1
  351. package/dist/cli/commands/respond-strict.js +22 -5
  352. package/dist/cli/commands/respond.d.ts +2 -2
  353. package/dist/cli/commands/respond.d.ts.map +1 -1
  354. package/dist/cli/commands/respond.js +40 -37
  355. package/dist/cli/commands/send.d.ts.map +1 -1
  356. package/dist/cli/commands/send.js +8 -4
  357. package/dist/cli/commands/wait-instance.d.ts +9 -1
  358. package/dist/cli/commands/wait-instance.d.ts.map +1 -1
  359. package/dist/cli/commands/wait-instance.js +15 -0
  360. package/dist/cli/commands/wait-poll-state.d.ts +18 -0
  361. package/dist/cli/commands/wait-poll-state.d.ts.map +1 -1
  362. package/dist/cli/commands/wait-verify.d.ts +2 -1
  363. package/dist/cli/commands/wait-verify.d.ts.map +1 -1
  364. package/dist/cli/commands/wait-verify.js +5 -1
  365. package/dist/cli/commands/wait.d.ts.map +1 -1
  366. package/dist/cli/commands/wait.js +37 -13
  367. package/dist/cli/commands/whoami.d.ts.map +1 -1
  368. package/dist/cli/commands/whoami.js +3 -1
  369. package/dist/cli/docs/agent-operations.d.ts +1 -1
  370. package/dist/cli/docs/agent-operations.d.ts.map +1 -1
  371. package/dist/cli/docs/agent-operations.js +1 -0
  372. package/dist/cli/types/api-responses.d.ts +3 -1
  373. package/dist/cli/types/api-responses.d.ts.map +1 -1
  374. package/dist/cli/utils/api-client.d.ts +55 -1
  375. package/dist/cli/utils/api-client.d.ts.map +1 -1
  376. package/dist/cli/utils/api-client.js +220 -18
  377. package/dist/cli/utils/follow-up-command.d.ts +38 -0
  378. package/dist/cli/utils/follow-up-command.d.ts.map +1 -0
  379. package/dist/cli/utils/follow-up-command.js +57 -0
  380. package/dist/cli/utils/reply-ledger.d.ts +1 -1
  381. package/dist/cli/utils/reply-ledger.d.ts.map +1 -1
  382. package/dist/cli/utils/reply-ledger.js +7 -2
  383. package/dist/cli/utils/server-capabilities.d.ts +18 -0
  384. package/dist/cli/utils/server-capabilities.d.ts.map +1 -1
  385. package/dist/cli/utils/server-capabilities.js +36 -3
  386. package/dist/cli/utils/session-target.d.ts +1 -1
  387. package/dist/cli/utils/session-target.d.ts.map +1 -1
  388. package/dist/cli/utils/session-target.js +3 -0
  389. package/dist/cli/utils/verify-runner.d.ts +7 -0
  390. package/dist/cli/utils/verify-runner.d.ts.map +1 -1
  391. package/dist/cli/utils/verify-runner.js +51 -15
  392. package/dist/lib/cli-tools/session-name.d.ts.map +1 -1
  393. package/dist/lib/cli-tools/session-name.js +11 -3
  394. package/dist/lib/session/send-attempt-types.d.ts +25 -0
  395. package/dist/lib/session/send-attempt-types.d.ts.map +1 -1
  396. package/dist/lib/session/send-attempt-types.js +10 -1
  397. package/dist/lib/verification/session-kill-ledger.d.ts +110 -0
  398. package/dist/lib/verification/session-kill-ledger.d.ts.map +1 -0
  399. package/dist/lib/verification/session-kill-ledger.js +174 -0
  400. package/dist/server/locales/en/worktree.json +2 -0
  401. package/dist/server/locales/ja/worktree.json +2 -0
  402. package/dist/server/src/config/cli-tool-timing-config.js +1 -7
  403. package/dist/server/src/lib/auto-yes-poller.js +5 -1
  404. package/dist/server/src/lib/cli-tools/antigravity.js +5 -2
  405. package/dist/server/src/lib/cli-tools/base.js +39 -0
  406. package/dist/server/src/lib/cli-tools/codex.js +7 -4
  407. package/dist/server/src/lib/cli-tools/command-code.js +7 -3
  408. package/dist/server/src/lib/cli-tools/copilot.js +5 -3
  409. package/dist/server/src/lib/cli-tools/gemini.js +10 -2
  410. package/dist/server/src/lib/cli-tools/launch-keys.js +39 -0
  411. package/dist/server/src/lib/cli-tools/opencode-v2.js +6 -2
  412. package/dist/server/src/lib/cli-tools/opencode.js +5 -2
  413. package/dist/server/src/lib/cli-tools/session-name.js +11 -3
  414. package/dist/server/src/lib/cli-tools/submit-composer-read.js +16 -6
  415. package/dist/server/src/lib/cli-tools/submit-verified-sender.js +164 -7
  416. package/dist/server/src/lib/cli-tools/vibe-local.js +4 -2
  417. package/dist/server/src/lib/db/db-migration-path.js +63 -2
  418. package/dist/server/src/lib/detection/prompt-detect-multiple-choice.js +5 -4
  419. package/dist/server/src/lib/hooks/sources/copilot/hook-settings.js +2 -3
  420. package/dist/server/src/lib/prompt-answer-errors.js +76 -2
  421. package/dist/server/src/lib/session/agent-event-state.js +4 -0
  422. package/dist/server/src/lib/session/agent-session-lifecycle.js +6 -1
  423. package/dist/server/src/lib/session/claude-session.js +22 -6
  424. package/dist/server/src/lib/session/current-output-builder.js +5 -3
  425. package/dist/server/src/lib/session/current-output-history-writers.js +1 -1
  426. package/dist/server/src/lib/session/prompt-submit-receipt.js +155 -0
  427. package/dist/server/src/lib/session/prompt-waiting-guard.js +10 -3
  428. package/dist/server/src/lib/session/send-attempt-state.js +48 -0
  429. package/dist/server/src/lib/session/send-attempt-types.js +10 -1
  430. package/dist/server/src/lib/session/send-user-message.js +5 -4
  431. package/dist/server/src/lib/session/session-launch-flight.js +243 -0
  432. package/dist/server/src/lib/session/session-starting-state.js +40 -4
  433. package/dist/server/src/lib/session/structured-prompt.js +12 -9
  434. package/dist/server/src/lib/session/waiting-episode-binding.js +4 -2
  435. package/dist/server/src/lib/session-cleanup.js +32 -0
  436. package/dist/server/src/lib/session-key-sender.js +0 -27
  437. package/dist/server/src/lib/verification/env-clean-gate.js +129 -0
  438. package/dist/server/src/lib/verification/env-snapshot.js +11 -2
  439. package/dist/server/src/lib/verification/session-kill-ledger.js +174 -0
  440. package/package.json +5 -1
  441. package/release-notes/0.49.2.json +49 -0
  442. package/.next/server/chunks/3773.js +0 -1
  443. package/.next/server/chunks/5775.js +0 -1
  444. package/.next/server/chunks/7604.js +0 -2
  445. package/.next/static/chunks/3931-1a1abab16248f14d.js +0 -1
  446. package/.next/static/chunks/4768-ad6f82f034f21eae.js +0 -1
  447. package/.next/static/chunks/5794-80ac3f06f098ea29.js +0 -1
  448. package/.next/static/chunks/6654-f3534f35f16644bc.js +0 -1
  449. package/.next/static/chunks/7665-e9ef6e0a85b9fa49.js +0 -1
  450. package/.next/static/chunks/8606-ce17ffa77f39608e.js +0 -1
  451. package/.next/static/chunks/app/layout-8bfac4724277b47f.js +0 -1
  452. package/.next/static/chunks/app/more/page-87c84987b2765213.js +0 -1
  453. package/.next/static/chunks/app/page-1b820c421db48c2c.js +0 -1
  454. package/.next/static/chunks/app/review/page-e2fd4a590646a2d8.js +0 -1
  455. /package/.next/static/{fqfSDqQMweROeHUzOt_m1 → yGatWDsS532awSs51kXyd}/_buildManifest.js +0 -0
  456. /package/.next/static/{fqfSDqQMweROeHUzOt_m1 → yGatWDsS532awSs51kXyd}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8898],{9219:(e,s,t)=>{"use strict";t.d(s,{k:()=>l});var n=t(95155),a=t(12115),i=t(48407),r=t(87531);function l(e){let{onRefresh:s,enabled:t=!0,className:l,children:o}=e,{containerRef:c,pullDistance:d,isRefreshing:u,isPulling:m}=function(e){let{onRefresh:s,enabled:t=!0,threshold:n=64,maxPull:i=96,resistance:r=.5}=e,l=(0,a.useRef)(null),[o,c]=(0,a.useState)(0),[d,u]=(0,a.useState)(!1),[m,h]=(0,a.useState)(!1),x=(0,a.useRef)(null),f=(0,a.useRef)(0),g=(0,a.useRef)(!1);g.current=d;let p=(0,a.useCallback)(()=>{x.current=null,f.current=0,c(0),h(!1)},[]),v=(0,a.useCallback)(e=>{if(!t||g.current)return;let s=l.current;s&&!(s.scrollTop>0)&&(x.current=e.touches[0].clientY,f.current=0)},[t]),b=(0,a.useCallback)(e=>{if(null===x.current)return;let s=l.current;if(!s)return;if(s.scrollTop>0)return void p();let t=e.touches[0].clientY-x.current;if(t<=0){0!==f.current&&(f.current=0,c(0),h(!1));return}e.cancelable&&e.preventDefault();let n=Math.min(t*r,i);f.current=n,c(n),h(!0)},[r,i,p]),y=(0,a.useCallback)(async()=>{u(!0),h(!1),c(n);try{await Promise.resolve(s())}finally{u(!1),c(0)}},[s,n]),w=(0,a.useCallback)(()=>{if(null===x.current)return;let e=f.current>=n&&!g.current;x.current=null,f.current=0,e?y():(c(0),h(!1))},[n,y]);return(0,a.useEffect)(()=>{let e=l.current;if(e)return e.addEventListener("touchstart",v,{passive:!0}),e.addEventListener("touchmove",b,{passive:!1}),e.addEventListener("touchend",w,{passive:!0}),e.addEventListener("touchcancel",w,{passive:!0}),()=>{e.removeEventListener("touchstart",v),e.removeEventListener("touchmove",b),e.removeEventListener("touchend",w),e.removeEventListener("touchcancel",w)}},[v,b,w]),{containerRef:l,pullDistance:o,isRefreshing:d,isPulling:m}}({onRefresh:s,enabled:t,threshold:64}),h=u||d>0,x=u?1:Math.min(d/64,1);return(0,n.jsxs)("div",{ref:c,className:(0,r.cn)("relative overflow-auto",l),style:{overscrollBehaviorY:"contain"},"data-testid":"pull-to-refresh",children:[(0,n.jsx)("div",{className:"pointer-events-none absolute inset-x-0 top-0 z-10 flex justify-center",style:{transform:"translateY(".concat(h?Math.max(d-24,8):-32,"px)"),opacity:x,transition:m?"none":"transform 0.2s ease-out, opacity 0.2s ease-out"},"data-testid":"pull-to-refresh-indicator",role:"status","aria-hidden":!u,children:(0,n.jsx)(i.y$,{size:"sm",variant:"accent"})}),(0,n.jsx)("div",{style:{transform:h?"translateY(".concat(d,"px)"):void 0,transition:m?"none":"transform 0.2s ease-out"},children:o})]})}},46617:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>eg});var n=t(95155),a=t(12115),i=t(52619),r=t.n(i),l=t(18955),o=t(20562),c=t(8803),d=t(9219),u=t(37586),m=t(22479),h=t(54485),x=t(58597),f=t(83051),g=t(14006),p=t(88155),v=t(92509),b=t(93493),y=t(639),w=t(2954),j=t(48407),k=t(76279),N=t(89599),A=t(308),M=t(80635),S=t(52407);function C(){let{signals:e}=(0,S.Fx)();return(0,a.useMemo)(()=>({offline:(0,S.sV)(e),reachable:(0,S._X)(e)}),[e])}var I=t(66966),L=t(34325),P=t(14524);let R=Object.freeze({enabled:!1,expiresAt:null}),T=Object.freeze({enabled:!1,expiresAt:null,stopReason:"server-restart"});function E(e){var s;return null!=(s=e.autoYesByInstance)?s:e}var _=t(81507),z=t(2317),D=t(75676),F=t(63881),B=t(8355),K=t(80344),U=t(38606),O=t(76471),Y=t(54014),H=t(55449),V=t(67149),q=t(68394);let W=[{mode:"chat",labelKey:"surfaceMode.showChat",icon:u.A},{mode:"terminal",labelKey:"surfaceMode.showTerminal",icon:m.A}];function J(e){return"flex h-7 w-7 shrink-0 items-center justify-center rounded transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-ring ".concat(e?"bg-accent-500/15 text-accent-600 dark:text-accent-400":"text-muted-foreground hover:bg-muted hover:text-foreground")}let Q=()=>{},G=(0,a.memo)(function(e){return e.connectivity?(0,n.jsx)(Z,{...e,connectivity:e.connectivity}):(0,n.jsx)(X,{...e})});function X(e){let s=C();return(0,n.jsx)(Z,{...e,connectivity:s})}function Z(e){var s,t,i,o,c,d,u;let{worktree:m,enabled:S,connectivity:C,className:G=""}=e,X=(0,l.c)("common"),Z=(0,l.c)("worktree"),$=(0,a.useMemo)(()=>{var e;return m.agentInstances&&m.agentInstances.length>0?m.agentInstances:(0,Y.lu)(null!=(e=m.selectedAgents)?e:(0,H.sA)())},[m]),[ee,es]=(0,a.useState)(null),et=null!=(t=$.find(e=>e.id===ee))?t:$[0],en=null==et?void 0:et.id,ea=null!=(i=null==et?void 0:et.cliTool)?i:"claude",ei=null!=en?en:ea,{surfaceMode:er,setSurfaceMode:el}=function(e){let{value:s,setValue:t}=(0,z.V)({key:"".concat("commandmate.sessions.tileSurfaceMode-").concat(e),defaultValue:"chat",validate:D.jg,serialize:e=>e,deserialize:e=>e});return{surfaceMode:s,setSurfaceMode:(0,a.useCallback)(e=>t(e),[t])}}(m.id),{visible:eo,toggle:ec}=(0,_.TG)(_.jt),ed="terminal"===er,eu=ed&&eo,[em,eh]=(0,a.useState)(null),[ex,ef]=(0,a.useState)(null),{terminal:eg,prompt:ep,refresh:ev,setAutoScroll:eb}=(0,k.NK)({worktreeId:m.id,cliToolId:ea,instanceId:en,enabled:S,cadence:V.sD}),{messages:ey,isLoading:ew,refresh:ej}=(0,A.Md)({worktreeId:m.id,cliToolId:ea,instanceId:en,enabled:S&&(!ed||eo),cadence:V.WT}),ek=(0,a.useCallback)((e,s)=>K.y.sendMessage(m.id,e,s),[m.id]),{messages:eN,sendOptimistic:eA,retry:eM,discard:eS}=(0,M.v4)({worktreeId:m.id,serverMessages:ey,sendFn:ek,onSent:ej,connectivity:C}),eC=(0,a.useMemo)(()=>(function(e,s){let t=e=>{var t;return void 0!==e.optimisticState&&(null!=(t=e.instanceId)?t:e.cliToolId)!==s};return e.some(t)?e.filter(e=>!t(e)):e})(eN,ei),[eN,ei]),[eI,eL]=(0,a.useState)(null),eP=(0,a.useCallback)(()=>eL(null),[]),eR=(0,a.useCallback)(e=>{let s=eS(e);s&&eL(s)},[eS]),eT=(0,a.useCallback)(()=>{ev()},[ev]),eE=function(e){var s;let{worktree:t,cliToolId:n,instanceId:i}=e,r=null==(s=(0,I.rC)())?void 0:s.refresh,l=t.id,o=(0,a.useMemo)(()=>(function(e,s){var t,n,a;let i=null==(t=e.autoYesByInstance)?void 0:t[s];if(!i||!0!==i.enabled)return(null==(a=e.autoYesStopReasonByInstance)?void 0:a[s])==="server-restart"?T:R;let r=null==(n=e.autoYesAnswerModeByInstance)?void 0:n[s];return{enabled:!0,expiresAt:"number"==typeof i.expiresAt?i.expiresAt:null,...(0,P.wn)(r)?{answerMode:r}:{}}})(t,i),[t,i]),[c,d]=(0,a.useState)(null),u=(0,a.useRef)(t);u.current=t;let m=null===c||c.instanceId!==i||function(e,s,t){let n=s.enabled===e.value.enabled&&(!s.enabled||s.expiresAt===e.value.expiresAt&&(void 0===e.value.answerMode||s.answerMode===e.value.answerMode)),a=null!==e.settledRow&&E(t)!==E(e.settledRow);return n||a}(c,o,t)?null:c;(0,a.useEffect)(()=>{null!==c&&null===m&&d(null)},[c,m]);let h=(0,a.useCallback)(async e=>{let s;try{var t;let a=await fetch("/api/worktrees/".concat(encodeURIComponent(l),"/auto-yes"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:e.enabled,cliToolId:n,instanceId:i,duration:e.duration,stopPattern:e.stopPattern,...e.enabled?{answerMode:null!=(t=e.answerMode)?t:P.Rb}:{}})});if(!a.ok)return;let r=await a.json(),o=!0===r.enabled;s={enabled:o,expiresAt:o&&"number"==typeof r.expiresAt?r.expiresAt:null,...o&&(0,P.wn)(r.answerMode)?{answerMode:r.answerMode}:{}}}catch(e){return}let a={instanceId:i,value:s,settledRow:null};d(a);try{await (null==r?void 0:r())}catch(e){}d(e=>e===a?{...a,settledRow:u.current}:e)},[l,n,i,r]),x=m?m.value:o;return{enabled:x.enabled,expiresAt:x.expiresAt,releasedByRestart:(0,L.S9)(x),...x.enabled&&x.answerMode?{answerMode:x.answerMode}:{},toggle:h}}({worktree:m,cliToolId:ea,instanceId:ei}),e_=(0,a.useMemo)(()=>({isRunning:eg.isRunning,attaching:eg.attaching,sessionStatus:eg.sessionStatus,isThinking:eg.isThinking,isPromptWaiting:ep.visible,promptData:ep.data,isSelectionListActive:eg.isSelectionListActive,isPagerActive:eg.isPagerActive,isDismissablePanelActive:eg.isDismissablePanelActive,isUnclassifiedActive:eg.isUnclassifiedActive,startingSince:eg.startingSince}),[eg.isRunning,eg.attaching,eg.sessionStatus,eg.isThinking,eg.isSelectionListActive,eg.isPagerActive,eg.isDismissablePanelActive,eg.isUnclassifiedActive,eg.startingSince,ep.visible,ep.data]),ez=(0,N.Bj)((0,N.qi)(m.id,ei),eg.startingSince),eD=S&&ed&&eg.isSelectionListActive&&!ez.starting,eF=eD?{className:"min-h-[18rem]",px:288}:{className:"min-h-[15rem]",px:240},eB=(0,a.useMemo)(()=>S&&!ez.starting&&(0,b.ro)({isSelectionListActive:eg.isSelectionListActive,isPagerActive:eg.isPagerActive,reading:(0,b.gO)(eg.isSelectionListActive?eg.output:null),cliToolId:ea}),[S,ez.starting,eg.isSelectionListActive,eg.isPagerActive,eg.output,ea]),eK=eD&&eB,eU=(0,F.b4)(em,ex,eF.px),eO=(0,a.useCallback)(e=>el(e),[el]),eY=(0,a.useMemo)(()=>({isLoading:ew,onRetryPending:eM,onDiscardPending:eR,onInsertToMessage:eL}),[ew,eM,eR]),{compactTuiLayoutPadding:eH,preservePaintedPanelRows:eV}=(0,a.useMemo)(()=>(0,q.EK)(ea),[ea]),eq="opencode"===ea||"copilot"===ea,eW=(u=m.id,"session-tile-history-".concat(u)),eJ=(0,a.useCallback)(e=>{es(e.target.value)},[]),eQ=null!=(o=m.branch)?o:m.name,eG=null!=(c=m.repositoryDisplayName)?c:m.repositoryName,eX=en?null==(s=m.sessionStatusByInstance)?void 0:s[en]:void 0,eZ=(0,U.kA)(eX),e$=(0,O.Mq)(eZ,(0,U.px)(eX));return(0,n.jsxs)("section",{className:"flex h-full min-w-0 flex-col overflow-hidden rounded-lg border border-border bg-surface shadow-sm ".concat(G),"data-testid":"session-tile-".concat(m.id),"data-enabled":S?"true":"false","aria-label":X("sessions.tileAriaLabel",{branch:eQ}),children:[(0,n.jsxs)("header",{className:"flex shrink-0 items-center gap-2 border-b border-border px-3 py-2",children:[(0,n.jsx)(j.md,{status:eZ,size:"sm",label:X(e$?O.rH:"status.".concat(eZ)),className:e$?O.Jd:void 0,"data-unclassified":e$?"true":void 0}),(0,n.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,n.jsx)("div",{className:"truncate text-xs text-muted-foreground",children:eG}),(0,n.jsx)(r(),{href:"/worktrees/".concat(m.id),className:"block truncate text-sm font-medium text-foreground underline-offset-2 hover:text-accent-600 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring dark:hover:text-accent-400","data-testid":"session-tile-branch-".concat(m.id),title:eQ,children:eQ})]}),$.length>1&&(0,n.jsx)("select",{value:null!=(d=null==et?void 0:et.id)?d:"",onChange:eJ,className:"max-w-[9rem] shrink-0 rounded-md border border-border bg-surface px-2 py-1 text-xs text-muted-foreground transition-colors hover:text-foreground focus:outline-none focus:ring-2 focus:ring-ring","data-testid":"session-tile-instance-".concat(m.id),"aria-label":X("sessions.tileInstanceAriaLabel"),children:$.map(e=>(0,n.jsx)("option",{value:e.id,children:(0,Y.sw)(e)},e.id))}),ed&&(0,n.jsx)("button",{type:"button",onClick:ec,"aria-pressed":eo,"aria-expanded":eo,"aria-controls":eW,"aria-label":eo?Z("terminal.hideHistory"):Z("terminal.showHistory"),title:eo?Z("terminal.hideHistory"):Z("terminal.showHistory"),className:J(eo),"data-testid":"session-tile-history-toggle-".concat(m.id),children:(0,n.jsx)(h.A,{size:14,"aria-hidden":"true"})}),(0,n.jsx)("div",{role:"group","aria-label":Z("surfaceMode.groupLabelMobile"),className:"flex shrink-0 items-center gap-0.5 rounded-md border border-border p-0.5","data-testid":"session-tile-surface-mode-".concat(m.id),children:W.map(e=>{let{mode:s,labelKey:t,icon:a}=e,i=er===s,r=Z(t);return(0,n.jsx)("button",{type:"button",onClick:()=>el(s),"aria-pressed":i,"aria-label":r,title:r,className:J(i),"data-testid":"session-tile-surface-".concat(s,"-").concat(m.id),children:(0,n.jsx)(a,{size:14,"aria-hidden":"true"})},s)})})]}),(0,n.jsx)("div",{ref:eh,className:"min-w-0 flex-1 overflow-hidden ".concat(eF.className),"data-testid":"session-tile-body-".concat(m.id),children:S&&ed?(0,n.jsxs)("div",{className:"flex h-full min-h-0 min-w-0 flex-col","data-testid":"session-tile-terminal-stack-".concat(m.id),children:[(0,n.jsx)("div",{className:"relative min-w-0 overflow-hidden ".concat(eu?eK?"flex-[3_3_0%] min-h-0":"flex-[3_3_0%] min-h-[8.5rem]":"min-h-0 flex-1"),"data-testid":"session-tile-terminal-".concat(m.id),children:ez.noticeVisible&&null!==ez.startingSince?(0,n.jsx)(p.TE,{cliToolId:ea,startingSince:ez.startingSince,onShowTerminal:ez.revealTerminal}):(0,n.jsx)(g.D,{output:eg.output,isActive:eg.isRunning,attaching:eg.attaching,isThinking:eg.isThinking,autoScroll:eg.autoScroll,onScrollChange:eb,disableAutoFollow:eq,compactTuiLayoutPadding:eH,preservePaintedPanelRows:eV,wrapMode:q.Wq.wrapMode,density:q.Wq.density})}),eD?(0,n.jsx)("div",{className:"min-w-0 border-t border-border p-2 ".concat(eK?"flex min-h-0 flex-col overflow-y-auto":"shrink overflow-y-auto ".concat("min-h-[3rem] max-h-[8rem]")),"data-testid":"session-tile-selection-keys-".concat(m.id),children:(0,n.jsx)(v.Z,{worktreeId:m.id,cliToolId:ea,instanceId:ei,onKeysSent:ev,frame:eg.output,surface:"terminal",showPagerKeys:eg.isPagerActive,compact:!0})}):null,eu&&(0,n.jsx)("div",{id:eW,className:"min-w-0 overflow-hidden border-t border-border ".concat(eK?"flex-[2_2_0%] min-h-0":"flex-[2_2_0%] min-h-[6.5rem]"),"data-testid":"session-tile-history-".concat(m.id),children:(0,n.jsx)(f.bl,{messages:eC,worktreeId:m.id,worktreePath:m.path,cliToolId:ea,isLoading:ew,onFilePathClick:Q,onInsertToMessage:eL,onRetryPending:eM,onDiscardPending:eR,className:"h-full"})})]}):S?(0,n.jsx)(x.wY,{messages:eC,worktreeId:m.id,worktreePath:m.path,cliToolId:ea,instanceId:en,live:e_,frame:eg.output,onKeysSent:ev,onSurfaceModeChange:eO,compact:!0,history:eY}):(0,n.jsx)("div",{className:"h-full","data-testid":"session-tile-placeholder-".concat(m.id),"aria-hidden":"true"})}),S&&(0,n.jsx)("div",{ref:ef,className:"shrink-0 border-t border-border p-2","data-testid":"session-tile-composer-".concat(m.id),children:(0,n.jsx)(y.E,{worktreeId:m.id,cliToolId:ea,instanceId:ei,isSessionRunning:eg.isRunning,isSessionStarting:ez.starting,onOptimisticSend:eA,onMessageSent:eT,pendingInsertText:eI,onInsertConsumed:eP,heightScope:B.CM,maxHeight:eU,planReviewActive:eB,autoYesSlot:(0,n.jsx)(w.T,{enabled:eE.enabled,expiresAt:eE.expiresAt,onToggle:eE.toggle,releasedByRestart:eE.releasedByRestart,answerMode:eE.answerMode,lastAutoResponse:null,cliToolName:ea,inline:!0})})})]})}let $=(0,a.memo)(function(e){let{worktree:s,connectivity:t}=e,{ref:i,inViewport:r}=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{rootMargin:s,threshold:t}=e,[n,i]=(0,a.useState)(!1),[r,l]=(0,a.useState)(null),o=(0,a.useCallback)(e=>{l(e)},[]);return(0,a.useEffect)(()=>{if("undefined"==typeof IntersectionObserver)return void i(!0);if(!r)return;let e=new IntersectionObserver(e=>{let s=e[e.length-1];s&&i(s.isIntersecting)},{rootMargin:s,threshold:t});return e.observe(r),()=>e.disconnect()},[r,s,t]),{ref:o,inViewport:n}}({rootMargin:"560px"});return(0,n.jsx)("div",{ref:i,className:"min-w-0 ".concat("h-[35rem]"),children:(0,n.jsx)(G,{worktree:s,enabled:r,connectivity:t})})}),ee=(0,a.memo)(function(e){let{worktrees:s}=e,t=C();return(0,n.jsx)("div",{className:"grid grid-cols-1 gap-4 xl:grid-cols-2","data-testid":"sessions-tile-grid",children:s.map(e=>(0,n.jsx)($,{worktree:e,connectivity:t},e.id))})});var es=t(80003),et=t(91456);let en=["list","tile"];function ea(e){return"string"==typeof e&&en.includes(e)}let ei=[{mode:"list",labelKey:"sessions.viewMode.list",icon:es.A},{mode:"tile",labelKey:"sessions.viewMode.tile",icon:et.A}],er=(0,a.memo)(function(e){let{value:s,onChange:t}=e,a=(0,l.c)("common");return(0,n.jsx)("div",{className:"flex shrink-0 items-center gap-1 rounded-md border border-input bg-surface p-0.5",role:"group","aria-label":a("sessions.viewMode.groupAriaLabel"),"data-testid":"sessions-view-mode",children:ei.map(e=>{let{mode:i,labelKey:r,icon:l}=e,o=s===i;return(0,n.jsx)("button",{type:"button",onClick:()=>t(i),"aria-pressed":o,"aria-label":a(r),title:a(r),"data-testid":"sessions-view-mode-".concat(i),className:"rounded p-1.5 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring ".concat(o?"bg-accent-100 text-accent-700 dark:bg-accent-900/30 dark:text-accent-400":"text-muted-foreground hover:text-foreground"),children:(0,n.jsx)(l,{size:16,"aria-hidden":"true"})},i)})})});var el=t(38218),eo=t(50857),ec=t(7636),ed=t(83012),eu=t(39970);let em=[{key:"repositoryName",labelKey:"sort.repositoryName"},{key:"status",labelKey:"sort.status"},{key:"lastSent",labelKey:"sort.lastSent"}],eh={lastSent:"desc",updatedAt:"desc"},ex={ready:0,in_progress:1,in_review:2,done:3};function ef(e){let{status:s,label:t,unclassified:a}=e,i=(0,l.c)("common"),r=(0,O.Mq)(s,a),o="".concat(t,": ").concat(i(r?O.rH:"status.".concat(s)));return(0,n.jsx)(j.md,{status:s,size:"md",label:o,className:r?O.Jd:void 0,"data-unclassified":r?"true":void 0})}function eg(){let e=(0,l.c)("common"),s=(0,l.c)("worktree"),t=(0,el.a)(),{worktrees:i,isLoading:u,error:m,refresh:h}=(0,I.Fn)(),x=i.length>0,[f,g]=(0,a.useState)(""),[p,v]=(0,a.useState)("lastSent"),[b,y]=(0,a.useState)("desc"),{viewMode:w,setViewMode:k}=function(){let{value:e,setValue:s}=(0,z.V)({key:"mcbd-sessions-view-mode",defaultValue:"list",validate:ea,serialize:e=>e,deserialize:e=>e});return{viewMode:e,setViewMode:(0,a.useCallback)(e=>s(e),[s])}}(),N="tile"===w;(0,a.useEffect)(()=>{(0,H.qD)()},[]);let A=(0,a.useMemo)(()=>{let e=i;if(f){let s=f.toLowerCase();e=e.filter(e=>{var t,n;return e.name.toLowerCase().includes(s)||e.repositoryName.toLowerCase().includes(s)||null!=(n=null==(t=e.repositoryDisplayName)?void 0:t.toLowerCase().includes(s))&&n})}let s=[...e];return s.sort((e,s)=>{var t,n,a,i,r,l,o,c;let d=0;switch(p){case"lastSent":{let t=(0,ec.nO)(e.lastUserMessageAt,s.lastUserMessageAt);if(!e.lastUserMessageAt&&!s.lastUserMessageAt)return 0;if(!e.lastUserMessageAt)return 1;if(!s.lastUserMessageAt)return -1;d=t;break}case"repositoryName":{let a=(null!=(t=e.repositoryDisplayName)?t:e.repositoryName).toLowerCase(),i=(null!=(n=s.repositoryDisplayName)?n:s.repositoryName).toLowerCase();0===(d=a.localeCompare(i))&&(d=e.name.toLowerCase().localeCompare(s.name.toLowerCase()));break}case"status":if(0==(d=(null!=(i=ex[null!=(a=e.status)?a:""])?i:4)-(null!=(l=ex[null!=(r=s.status)?r:""])?l:4))){let t=(null!=(o=e.repositoryDisplayName)?o:e.repositoryName).toLowerCase(),n=(null!=(c=s.repositoryDisplayName)?c:s.repositoryName).toLowerCase();d=t.localeCompare(n)}break;default:d=0}return("lastSent"===p?"desc"===b:"asc"===b)?d:-d}),s},[i,f,p,b]),M=(0,a.useCallback)(e=>{g(e.target.value)},[]),S=(0,a.useCallback)(e=>{var s;v(e),y(null!=(s=eh[e])?s:"asc")},[]),C=(0,a.useCallback)(()=>{y(e=>"asc"===e?"desc":"asc")},[]);return(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)(d.k,{onRefresh:h,enabled:t,className:"".concat(N?"w-full px-4 sm:px-6 lg:px-8":"container-custom"," py-8 h-full"),children:[(0,n.jsxs)("div",{className:"mb-6",children:[(0,n.jsx)("h1",{className:"text-2xl font-bold text-foreground mb-2",children:e("sessions.title")}),(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:e("sessions.description")})]}),(0,n.jsxs)("div",{className:"mb-6 flex items-center gap-3",children:[(0,n.jsx)(j.pd,{type:"text",placeholder:e("sessions.filterPlaceholder"),value:f,onChange:M,className:"max-w-md flex-1","data-testid":"sessions-filter","aria-label":e("sessions.filterAriaLabel"),inputMode:"search",enterKeyHint:"search"}),(0,n.jsxs)(j.l6,{value:p,onValueChange:S,children:[(0,n.jsx)(j.bq,{className:"w-40","data-testid":"sessions-sort-select","aria-label":e("sessions.sortByAriaLabel"),children:(0,n.jsx)(j.yv,{})}),(0,n.jsx)(j.gC,{children:em.map(s=>(0,n.jsx)(j.eb,{value:s.key,children:e(s.labelKey)},s.key))})]}),(0,n.jsx)("button",{type:"button",onClick:C,"data-testid":"sessions-sort-direction","aria-label":"asc"===b?e("sessions.sortAscending"):e("sessions.sortDescending"),className:"rounded-md border border-input bg-surface p-2 text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:"asc"===b?(0,n.jsx)(o.A,{size:16,"aria-hidden":"true"}):(0,n.jsx)(c.A,{size:16,"aria-hidden":"true"})}),(0,n.jsx)(er,{value:w,onChange:k})]}),x?(0,n.jsxs)(n.Fragment,{children:[m&&(0,n.jsx)("div",{className:"mb-4 rounded-md border border-danger-border bg-danger-subtle px-3 py-2 text-sm text-danger-foreground",role:"status","data-testid":"sessions-error-banner",children:e("sessions.refreshError",{message:m.message})}),N?0===A.length?(0,n.jsx)("div",{className:"text-muted-foreground py-8 text-center","data-testid":"sessions-empty",children:e("sessions.noMatching")}):(0,n.jsx)(ee,{worktrees:A}):(0,n.jsx)("div",{className:"space-y-2","data-testid":"sessions-list",children:0===A.length?(0,n.jsx)("div",{className:"text-muted-foreground py-8 text-center","data-testid":"sessions-empty",children:e("sessions.noMatching")}):A.map((t,a)=>{var i,l,o,c;let d=null!=(i=t.selectedAgents)?i:(0,H.sA)(),u=t.lastUserMessage?t.lastUserMessage.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x9F]/g,"").replace(/[\u200B-\u200F\u2028-\u202F\uFEFF\u061C]/g,"").replace(/[\r\n\t]/g," ").replace(/\s+/g," ").trim():null,m=t.lastUserMessageAt?(0,ed.Fx)(String(t.lastUserMessageAt)):null,h=d.map(e=>{var s;let n=null==(s=t.sessionStatusByCli)?void 0:s[e];return{agent:e,status:(0,U.kA)(n),unclassified:(0,U.px)(n)}}),x=h.filter(e=>(0,eo.Qo)(e.status)||e.unclassified),f=h.length-x.length,g=d.some(e=>{var s;let n=(0,U.kA)(null==(s=t.sessionStatusByCli)?void 0:s[e]);return"running"===n||"generating"===n});return(0,n.jsxs)(r(),{href:"/worktrees/".concat(t.id),style:{animationDelay:function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:40,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;if(Number.isFinite(e)&&!(e<=0)&&!(e>=t))return"".concat(e*s,"ms")}(a)},className:"block bg-surface rounded-lg p-4 border transition-colors ".concat(g?"border-accent-500/40 shadow-[0_0_16px_-4px_rgb(var(--accent-500)/0.45)] hover:border-accent-400":"border-border shadow-sm hover:border-accent-300 dark:hover:border-accent-700"," ").concat("animate-in fade-in-0 slide-in-from-bottom-2 fill-mode-backwards duration-300"),"data-testid":"session-item-".concat(t.id),children:[(0,n.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,n.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,n.jsx)("div",{className:"text-sm font-medium text-foreground truncate",children:null!=(l=t.repositoryDisplayName)?l:t.repositoryName}),(0,n.jsx)("div",{className:"text-xs text-muted-foreground truncate",children:t.name})]}),(0,n.jsxs)("div",{className:"flex items-center gap-2 ml-4 flex-shrink-0","data-testid":"session-agents-".concat(t.id),children:[x.map(e=>{let{agent:s,status:t,unclassified:a}=e;return(0,n.jsxs)("div",{className:"flex items-center gap-1","data-testid":"session-agent-".concat(s),children:[(0,n.jsx)(ef,{status:t,label:(0,Y.oo)(s),unclassified:a}),(0,n.jsx)("span",{className:"text-xs text-muted-foreground",children:(0,Y.oo)(s)})]},s)}),f>0&&(0,n.jsxs)("div",{className:"flex items-center gap-1","data-testid":"session-idle-cluster-".concat(t.id),"aria-label":e("sessions.idleAgents",{count:f}),children:[(0,n.jsx)(j.md,{status:"idle",size:"sm","aria-hidden":!0,title:void 0}),(0,n.jsxs)("span",{className:"text-xs text-muted-foreground tabular-nums",children:["+",f]})]})]})]}),t.description&&(0,n.jsx)("div",{className:"mt-2",children:(0,n.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-2 whitespace-pre-wrap",children:t.description})}),t.status&&(0,n.jsx)("div",{className:"mt-2",children:(0,n.jsx)("span",{className:"px-2 py-0.5 text-xs font-medium rounded ".concat(null!=(c=eu.SE[null!=(o=t.status)?o:""])?c:"bg-muted text-muted-foreground"),children:function(e,s){if(!e)return"";let t=eu.m9.find(s=>s.value===e);return t?s(t.labelKey):e}(t.status,s)})}),u&&(0,n.jsxs)("div",{className:"mt-2 flex items-center gap-2","data-testid":"session-message-".concat(t.id),children:[(0,n.jsx)("span",{className:"text-xs text-muted-foreground truncate min-w-0 flex-1","data-testid":"session-message-text-".concat(t.id),title:u,children:u}),m&&(0,n.jsx)("span",{className:"text-xs text-muted-foreground flex-shrink-0 whitespace-nowrap tabular-nums","data-testid":"session-time-".concat(t.id),children:m})]})]},t.id)})})]}):(0,n.jsxs)(n.Fragment,{children:[u&&(0,n.jsx)("div",{className:"space-y-2","data-testid":"sessions-loading",role:"status","aria-label":e("sessions.loadingAriaLabel"),children:[0,1,2].map(e=>(0,n.jsxs)("div",{className:"block bg-surface rounded-lg p-4 border border-border shadow-sm",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,n.jsxs)("div",{className:"min-w-0 flex-1 space-y-1.5",children:[(0,n.jsx)(j.EA,{className:"h-4 w-40 max-w-full"}),(0,n.jsx)(j.EA,{className:"h-3 w-56 max-w-full"})]}),(0,n.jsx)(j.EA,{className:"ml-4 h-3 w-16 flex-shrink-0"})]}),(0,n.jsxs)("div",{className:"mt-3 flex items-center gap-2",children:[(0,n.jsx)(j.EA,{className:"h-3 min-w-0 flex-1"}),(0,n.jsx)(j.EA,{className:"h-3 w-10 flex-shrink-0"})]})]},e))}),!u&&m&&(0,n.jsx)("div",{className:"text-danger-foreground","data-testid":"sessions-error",children:e("sessions.loadError",{message:m.message})}),!u&&!m&&(0,n.jsx)("div",{className:"text-muted-foreground py-8 text-center","data-testid":"sessions-empty",children:f?e("sessions.noMatching"):e("sessions.empty")})]})]})})}},75676:(e,s,t)=>{"use strict";t.d(s,{jg:()=>i,kQ:()=>r,mR:()=>c,mS:()=>o,wf:()=>n});let n="terminal",a=new Set(["terminal","chat"]);function i(e){return"string"==typeof e&&a.has(e)}let r={data:null,messageId:null,visible:!1,answering:!1},l={mode:"split",mobileActivePane:"terminal",leftPaneTab:"history",splitRatio:.5,leftPaneCollapsed:!1,activityBar:{active:"files"},historyPane:{visible:!0,width:25,collapsed:!1}},o={type:null,message:null,retryable:!1,retryCount:0};function c(){return{phase:"idle",prompt:{...r},layout:{...l},error:{...o},messages:[],wsConnected:!1}}},80003:(e,s,t)=>{"use strict";t.d(s,{A:()=>n});let n=(0,t(71847).A)("list",[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]])},87047:(e,s,t)=>{Promise.resolve().then(t.bind(t,46617))}},e=>{e.O(0,[6809,4909,2770,2619,3662,6606,934,9465,8407,2407,344,6654,8606,1128,4768,7665,3931,8441,1255,7358],()=>e(e.s=87047)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8898],{9219:(e,s,t)=>{"use strict";t.d(s,{k:()=>l});var n=t(95155),a=t(12115),i=t(48407),r=t(87531);function l(e){let{onRefresh:s,enabled:t=!0,className:l,children:o}=e,{containerRef:c,pullDistance:d,isRefreshing:u,isPulling:m}=function(e){let{onRefresh:s,enabled:t=!0,threshold:n=64,maxPull:i=96,resistance:r=.5}=e,l=(0,a.useRef)(null),[o,c]=(0,a.useState)(0),[d,u]=(0,a.useState)(!1),[m,h]=(0,a.useState)(!1),x=(0,a.useRef)(null),f=(0,a.useRef)(0),g=(0,a.useRef)(!1);g.current=d;let p=(0,a.useCallback)(()=>{x.current=null,f.current=0,c(0),h(!1)},[]),v=(0,a.useCallback)(e=>{if(!t||g.current)return;let s=l.current;s&&!(s.scrollTop>0)&&(x.current=e.touches[0].clientY,f.current=0)},[t]),b=(0,a.useCallback)(e=>{if(null===x.current)return;let s=l.current;if(!s)return;if(s.scrollTop>0)return void p();let t=e.touches[0].clientY-x.current;if(t<=0){0!==f.current&&(f.current=0,c(0),h(!1));return}e.cancelable&&e.preventDefault();let n=Math.min(t*r,i);f.current=n,c(n),h(!0)},[r,i,p]),y=(0,a.useCallback)(async()=>{u(!0),h(!1),c(n);try{await Promise.resolve(s())}finally{u(!1),c(0)}},[s,n]),w=(0,a.useCallback)(()=>{if(null===x.current)return;let e=f.current>=n&&!g.current;x.current=null,f.current=0,e?y():(c(0),h(!1))},[n,y]);return(0,a.useEffect)(()=>{let e=l.current;if(e)return e.addEventListener("touchstart",v,{passive:!0}),e.addEventListener("touchmove",b,{passive:!1}),e.addEventListener("touchend",w,{passive:!0}),e.addEventListener("touchcancel",w,{passive:!0}),()=>{e.removeEventListener("touchstart",v),e.removeEventListener("touchmove",b),e.removeEventListener("touchend",w),e.removeEventListener("touchcancel",w)}},[v,b,w]),{containerRef:l,pullDistance:o,isRefreshing:d,isPulling:m}}({onRefresh:s,enabled:t,threshold:64}),h=u||d>0,x=u?1:Math.min(d/64,1);return(0,n.jsxs)("div",{ref:c,className:(0,r.cn)("relative overflow-auto",l),style:{overscrollBehaviorY:"contain"},"data-testid":"pull-to-refresh",children:[(0,n.jsx)("div",{className:"pointer-events-none absolute inset-x-0 top-0 z-10 flex justify-center",style:{transform:"translateY(".concat(h?Math.max(d-24,8):-32,"px)"),opacity:x,transition:m?"none":"transform 0.2s ease-out, opacity 0.2s ease-out"},"data-testid":"pull-to-refresh-indicator",role:"status","aria-hidden":!u,children:(0,n.jsx)(i.y$,{size:"sm",variant:"accent"})}),(0,n.jsx)("div",{style:{transform:h?"translateY(".concat(d,"px)"):void 0,transition:m?"none":"transform 0.2s ease-out"},children:o})]})}},46617:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>eg});var n=t(95155),a=t(12115),i=t(52619),r=t.n(i),l=t(18955),o=t(20562),c=t(8803),d=t(9219),u=t(37586),m=t(22479),h=t(54485),x=t(58597),f=t(83051),g=t(14006),p=t(88155),v=t(92509),b=t(93493),y=t(639),w=t(2954),j=t(48407),k=t(76279),N=t(89599),A=t(308),M=t(80635),S=t(52407);function C(){let{signals:e}=(0,S.Fx)();return(0,a.useMemo)(()=>({offline:(0,S.sV)(e),reachable:(0,S._X)(e)}),[e])}var I=t(66966),L=t(34325),P=t(14524);let R=Object.freeze({enabled:!1,expiresAt:null}),T=Object.freeze({enabled:!1,expiresAt:null,stopReason:"server-restart"});function E(e){var s;return null!=(s=e.autoYesByInstance)?s:e}var _=t(81507),z=t(2317),D=t(75676),F=t(63881),B=t(8355),K=t(80344),U=t(38606),O=t(76471),Y=t(54014),H=t(55449),V=t(67149),q=t(68394);let W=[{mode:"chat",labelKey:"surfaceMode.showChat",icon:u.A},{mode:"terminal",labelKey:"surfaceMode.showTerminal",icon:m.A}];function J(e){return"flex h-7 w-7 shrink-0 items-center justify-center rounded transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-ring ".concat(e?"bg-accent-500/15 text-accent-600 dark:text-accent-400":"text-muted-foreground hover:bg-muted hover:text-foreground")}let Q=()=>{},G=(0,a.memo)(function(e){return e.connectivity?(0,n.jsx)(Z,{...e,connectivity:e.connectivity}):(0,n.jsx)(X,{...e})});function X(e){let s=C();return(0,n.jsx)(Z,{...e,connectivity:s})}function Z(e){var s,t,i,o,c,d,u;let{worktree:m,enabled:S,connectivity:C,className:G=""}=e,X=(0,l.c)("common"),Z=(0,l.c)("worktree"),$=(0,a.useMemo)(()=>{var e;return m.agentInstances&&m.agentInstances.length>0?m.agentInstances:(0,Y.lu)(null!=(e=m.selectedAgents)?e:(0,H.sA)())},[m]),[ee,es]=(0,a.useState)(null),et=null!=(t=$.find(e=>e.id===ee))?t:$[0],en=null==et?void 0:et.id,ea=null!=(i=null==et?void 0:et.cliTool)?i:"claude",ei=null!=en?en:ea,{surfaceMode:er,setSurfaceMode:el}=function(e){let{value:s,setValue:t}=(0,z.V)({key:"".concat("commandmate.sessions.tileSurfaceMode-").concat(e),defaultValue:"chat",validate:D.jg,serialize:e=>e,deserialize:e=>e});return{surfaceMode:s,setSurfaceMode:(0,a.useCallback)(e=>t(e),[t])}}(m.id),{visible:eo,toggle:ec}=(0,_.TG)(_.jt),ed="terminal"===er,eu=ed&&eo,[em,eh]=(0,a.useState)(null),[ex,ef]=(0,a.useState)(null),{terminal:eg,prompt:ep,refresh:ev,setAutoScroll:eb}=(0,k.NK)({worktreeId:m.id,cliToolId:ea,instanceId:en,enabled:S,cadence:V.sD}),{messages:ey,isLoading:ew,refresh:ej}=(0,A.Md)({worktreeId:m.id,cliToolId:ea,instanceId:en,enabled:S&&(!ed||eo),cadence:V.WT}),ek=(0,a.useCallback)((e,s)=>K.y.sendMessage(m.id,e,s),[m.id]),{messages:eN,sendOptimistic:eA,retry:eM,discard:eS}=(0,M.v4)({worktreeId:m.id,serverMessages:ey,sendFn:ek,onSent:ej,connectivity:C}),eC=(0,a.useMemo)(()=>(function(e,s){let t=e=>{var t;return void 0!==e.optimisticState&&(null!=(t=e.instanceId)?t:e.cliToolId)!==s};return e.some(t)?e.filter(e=>!t(e)):e})(eN,ei),[eN,ei]),[eI,eL]=(0,a.useState)(null),eP=(0,a.useCallback)(()=>eL(null),[]),eR=(0,a.useCallback)(e=>{let s=eS(e);s&&eL(s)},[eS]),eT=(0,a.useCallback)(()=>{ev()},[ev]),eE=function(e){var s;let{worktree:t,cliToolId:n,instanceId:i}=e,r=null==(s=(0,I.rC)())?void 0:s.refresh,l=t.id,o=(0,a.useMemo)(()=>(function(e,s){var t,n,a;let i=null==(t=e.autoYesByInstance)?void 0:t[s];if(!i||!0!==i.enabled)return(null==(a=e.autoYesStopReasonByInstance)?void 0:a[s])==="server-restart"?T:R;let r=null==(n=e.autoYesAnswerModeByInstance)?void 0:n[s];return{enabled:!0,expiresAt:"number"==typeof i.expiresAt?i.expiresAt:null,...(0,P.wn)(r)?{answerMode:r}:{}}})(t,i),[t,i]),[c,d]=(0,a.useState)(null),u=(0,a.useRef)(t);u.current=t;let m=null===c||c.instanceId!==i||function(e,s,t){let n=s.enabled===e.value.enabled&&(!s.enabled||s.expiresAt===e.value.expiresAt&&(void 0===e.value.answerMode||s.answerMode===e.value.answerMode)),a=null!==e.settledRow&&E(t)!==E(e.settledRow);return n||a}(c,o,t)?null:c;(0,a.useEffect)(()=>{null!==c&&null===m&&d(null)},[c,m]);let h=(0,a.useCallback)(async e=>{let s;try{var t;let a=await fetch("/api/worktrees/".concat(encodeURIComponent(l),"/auto-yes"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:e.enabled,cliToolId:n,instanceId:i,duration:e.duration,stopPattern:e.stopPattern,...e.enabled?{answerMode:null!=(t=e.answerMode)?t:P.Rb}:{}})});if(!a.ok)return;let r=await a.json(),o=!0===r.enabled;s={enabled:o,expiresAt:o&&"number"==typeof r.expiresAt?r.expiresAt:null,...o&&(0,P.wn)(r.answerMode)?{answerMode:r.answerMode}:{}}}catch(e){return}let a={instanceId:i,value:s,settledRow:null};d(a);try{await (null==r?void 0:r())}catch(e){}d(e=>e===a?{...a,settledRow:u.current}:e)},[l,n,i,r]),x=m?m.value:o;return{enabled:x.enabled,expiresAt:x.expiresAt,releasedByRestart:(0,L.S9)(x),...x.enabled&&x.answerMode?{answerMode:x.answerMode}:{},toggle:h}}({worktree:m,cliToolId:ea,instanceId:ei}),e_=(0,a.useMemo)(()=>({isRunning:eg.isRunning,attaching:eg.attaching,sessionStatus:eg.sessionStatus,isThinking:eg.isThinking,isPromptWaiting:ep.visible,promptData:ep.data,isSelectionListActive:eg.isSelectionListActive,isPagerActive:eg.isPagerActive,isDismissablePanelActive:eg.isDismissablePanelActive,isUnclassifiedActive:eg.isUnclassifiedActive,startingSince:eg.startingSince}),[eg.isRunning,eg.attaching,eg.sessionStatus,eg.isThinking,eg.isSelectionListActive,eg.isPagerActive,eg.isDismissablePanelActive,eg.isUnclassifiedActive,eg.startingSince,ep.visible,ep.data]),ez=(0,N.Bj)((0,N.qi)(m.id,ei),eg.startingSince),eD=S&&ed&&eg.isSelectionListActive&&!ez.starting,eF=eD?{className:"min-h-[18rem]",px:288}:{className:"min-h-[15rem]",px:240},eB=(0,a.useMemo)(()=>S&&!ez.starting&&(0,b.ro)({isSelectionListActive:eg.isSelectionListActive,isPagerActive:eg.isPagerActive,reading:(0,b.gO)(eg.isSelectionListActive?eg.output:null),cliToolId:ea}),[S,ez.starting,eg.isSelectionListActive,eg.isPagerActive,eg.output,ea]),eK=eD&&eB,eU=(0,F.b4)(em,ex,eF.px),eO=(0,a.useCallback)(e=>el(e),[el]),eY=(0,a.useMemo)(()=>({isLoading:ew,onRetryPending:eM,onDiscardPending:eR,onInsertToMessage:eL}),[ew,eM,eR]),{compactTuiLayoutPadding:eH,preservePaintedPanelRows:eV}=(0,a.useMemo)(()=>(0,q.EK)(ea),[ea]),eq="opencode"===ea||"copilot"===ea,eW=(u=m.id,"session-tile-history-".concat(u)),eJ=(0,a.useCallback)(e=>{es(e.target.value)},[]),eQ=null!=(o=m.branch)?o:m.name,eG=null!=(c=m.repositoryDisplayName)?c:m.repositoryName,eX=en?null==(s=m.sessionStatusByInstance)?void 0:s[en]:void 0,eZ=(0,U.kA)(eX),e$=(0,O.Mq)(eZ,(0,U.px)(eX));return(0,n.jsxs)("section",{className:"flex h-full min-w-0 flex-col overflow-hidden rounded-lg border border-border bg-surface shadow-sm ".concat(G),"data-testid":"session-tile-".concat(m.id),"data-enabled":S?"true":"false","aria-label":X("sessions.tileAriaLabel",{branch:eQ}),children:[(0,n.jsxs)("header",{className:"flex shrink-0 items-center gap-2 border-b border-border px-3 py-2",children:[(0,n.jsx)(j.md,{status:eZ,size:"sm",label:X(e$?O.rH:"status.".concat(eZ)),className:e$?O.Jd:void 0,"data-unclassified":e$?"true":void 0}),(0,n.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,n.jsx)("div",{className:"truncate text-xs text-muted-foreground",children:eG}),(0,n.jsx)(r(),{href:"/worktrees/".concat(m.id),className:"block truncate text-sm font-medium text-foreground underline-offset-2 hover:text-accent-600 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring dark:hover:text-accent-400","data-testid":"session-tile-branch-".concat(m.id),title:eQ,children:eQ})]}),$.length>1&&(0,n.jsx)("select",{value:null!=(d=null==et?void 0:et.id)?d:"",onChange:eJ,className:"max-w-[9rem] shrink-0 rounded-md border border-border bg-surface px-2 py-1 text-xs text-muted-foreground transition-colors hover:text-foreground focus:outline-none focus:ring-2 focus:ring-ring","data-testid":"session-tile-instance-".concat(m.id),"aria-label":X("sessions.tileInstanceAriaLabel"),children:$.map(e=>(0,n.jsx)("option",{value:e.id,children:(0,Y.sw)(e)},e.id))}),ed&&(0,n.jsx)("button",{type:"button",onClick:ec,"aria-pressed":eo,"aria-expanded":eo,"aria-controls":eW,"aria-label":eo?Z("terminal.hideHistory"):Z("terminal.showHistory"),title:eo?Z("terminal.hideHistory"):Z("terminal.showHistory"),className:J(eo),"data-testid":"session-tile-history-toggle-".concat(m.id),children:(0,n.jsx)(h.A,{size:14,"aria-hidden":"true"})}),(0,n.jsx)("div",{role:"group","aria-label":Z("surfaceMode.groupLabelMobile"),className:"flex shrink-0 items-center gap-0.5 rounded-md border border-border p-0.5","data-testid":"session-tile-surface-mode-".concat(m.id),children:W.map(e=>{let{mode:s,labelKey:t,icon:a}=e,i=er===s,r=Z(t);return(0,n.jsx)("button",{type:"button",onClick:()=>el(s),"aria-pressed":i,"aria-label":r,title:r,className:J(i),"data-testid":"session-tile-surface-".concat(s,"-").concat(m.id),children:(0,n.jsx)(a,{size:14,"aria-hidden":"true"})},s)})})]}),(0,n.jsx)("div",{ref:eh,className:"min-w-0 flex-1 overflow-hidden ".concat(eF.className),"data-testid":"session-tile-body-".concat(m.id),children:S&&ed?(0,n.jsxs)("div",{className:"flex h-full min-h-0 min-w-0 flex-col","data-testid":"session-tile-terminal-stack-".concat(m.id),children:[(0,n.jsx)("div",{className:"relative min-w-0 overflow-hidden ".concat(eu?eK?"flex-[3_3_0%] min-h-0":"flex-[3_3_0%] min-h-[8.5rem]":"min-h-0 flex-1"),"data-testid":"session-tile-terminal-".concat(m.id),children:ez.noticeVisible&&null!==ez.startingSince?(0,n.jsx)(p.TE,{cliToolId:ea,startingSince:ez.startingSince,onShowTerminal:ez.revealTerminal}):(0,n.jsx)(g.D,{output:eg.output,isActive:eg.isRunning,attaching:eg.attaching,isThinking:eg.isThinking,autoScroll:eg.autoScroll,onScrollChange:eb,disableAutoFollow:eq,compactTuiLayoutPadding:eH,preservePaintedPanelRows:eV,wrapMode:q.Wq.wrapMode,density:q.Wq.density})}),eD?(0,n.jsx)("div",{className:"min-w-0 border-t border-border p-2 ".concat(eK?"flex min-h-0 flex-col overflow-y-auto":"shrink overflow-y-auto ".concat("min-h-[3rem] max-h-[8rem]")),"data-testid":"session-tile-selection-keys-".concat(m.id),children:(0,n.jsx)(v.Z,{worktreeId:m.id,cliToolId:ea,instanceId:ei,onKeysSent:ev,frame:eg.output,surface:"terminal",showPagerKeys:eg.isPagerActive,compact:!0})}):null,eu&&(0,n.jsx)("div",{id:eW,className:"min-w-0 overflow-hidden border-t border-border ".concat(eK?"flex-[2_2_0%] min-h-0":"flex-[2_2_0%] min-h-[6.5rem]"),"data-testid":"session-tile-history-".concat(m.id),children:(0,n.jsx)(f.bl,{messages:eC,worktreeId:m.id,worktreePath:m.path,cliToolId:ea,isLoading:ew,onFilePathClick:Q,onInsertToMessage:eL,onRetryPending:eM,onDiscardPending:eR,className:"h-full"})})]}):S?(0,n.jsx)(x.wY,{messages:eC,worktreeId:m.id,worktreePath:m.path,cliToolId:ea,instanceId:en,live:e_,frame:eg.output,onKeysSent:ev,onSurfaceModeChange:eO,compact:!0,history:eY}):(0,n.jsx)("div",{className:"h-full","data-testid":"session-tile-placeholder-".concat(m.id),"aria-hidden":"true"})}),S&&(0,n.jsx)("div",{ref:ef,className:"shrink-0 border-t border-border p-2","data-testid":"session-tile-composer-".concat(m.id),children:(0,n.jsx)(y.E,{worktreeId:m.id,cliToolId:ea,instanceId:ei,isSessionRunning:eg.isRunning,isSessionStarting:ez.starting,onOptimisticSend:eA,onMessageSent:eT,pendingInsertText:eI,onInsertConsumed:eP,heightScope:B.CM,maxHeight:eU,planReviewActive:eB,autoYesSlot:(0,n.jsx)(w.T,{enabled:eE.enabled,expiresAt:eE.expiresAt,onToggle:eE.toggle,releasedByRestart:eE.releasedByRestart,answerMode:eE.answerMode,lastAutoResponse:null,cliToolName:ea,inline:!0})})})]})}let $=(0,a.memo)(function(e){let{worktree:s,connectivity:t}=e,{ref:i,inViewport:r}=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{rootMargin:s,threshold:t}=e,[n,i]=(0,a.useState)(!1),[r,l]=(0,a.useState)(null),o=(0,a.useCallback)(e=>{l(e)},[]);return(0,a.useEffect)(()=>{if("undefined"==typeof IntersectionObserver)return void i(!0);if(!r)return;let e=new IntersectionObserver(e=>{let s=e[e.length-1];s&&i(s.isIntersecting)},{rootMargin:s,threshold:t});return e.observe(r),()=>e.disconnect()},[r,s,t]),{ref:o,inViewport:n}}({rootMargin:"560px"});return(0,n.jsx)("div",{ref:i,className:"min-w-0 ".concat("h-[35rem]"),children:(0,n.jsx)(G,{worktree:s,enabled:r,connectivity:t})})}),ee=(0,a.memo)(function(e){let{worktrees:s}=e,t=C();return(0,n.jsx)("div",{className:"grid grid-cols-1 gap-4 xl:grid-cols-2","data-testid":"sessions-tile-grid",children:s.map(e=>(0,n.jsx)($,{worktree:e,connectivity:t},e.id))})});var es=t(80003),et=t(91456);let en=["list","tile"];function ea(e){return"string"==typeof e&&en.includes(e)}let ei=[{mode:"list",labelKey:"sessions.viewMode.list",icon:es.A},{mode:"tile",labelKey:"sessions.viewMode.tile",icon:et.A}],er=(0,a.memo)(function(e){let{value:s,onChange:t}=e,a=(0,l.c)("common");return(0,n.jsx)("div",{className:"flex shrink-0 items-center gap-1 rounded-md border border-input bg-surface p-0.5",role:"group","aria-label":a("sessions.viewMode.groupAriaLabel"),"data-testid":"sessions-view-mode",children:ei.map(e=>{let{mode:i,labelKey:r,icon:l}=e,o=s===i;return(0,n.jsx)("button",{type:"button",onClick:()=>t(i),"aria-pressed":o,"aria-label":a(r),title:a(r),"data-testid":"sessions-view-mode-".concat(i),className:"rounded p-1.5 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring ".concat(o?"bg-accent-100 text-accent-700 dark:bg-accent-900/30 dark:text-accent-400":"text-muted-foreground hover:text-foreground"),children:(0,n.jsx)(l,{size:16,"aria-hidden":"true"})},i)})})});var el=t(38218),eo=t(50857),ec=t(7636),ed=t(83012),eu=t(39970);let em=[{key:"repositoryName",labelKey:"sort.repositoryName"},{key:"status",labelKey:"sort.status"},{key:"lastSent",labelKey:"sort.lastSent"}],eh={lastSent:"desc",updatedAt:"desc"},ex={ready:0,in_progress:1,in_review:2,done:3};function ef(e){let{status:s,label:t,unclassified:a}=e,i=(0,l.c)("common"),r=(0,O.Mq)(s,a),o="".concat(t,": ").concat(i(r?O.rH:"status.".concat(s)));return(0,n.jsx)(j.md,{status:s,size:"md",label:o,className:r?O.Jd:void 0,"data-unclassified":r?"true":void 0})}function eg(){let e=(0,l.c)("common"),s=(0,l.c)("worktree"),t=(0,el.a)(),{worktrees:i,isLoading:u,error:m,refresh:h}=(0,I.Fn)(),x=i.length>0,[f,g]=(0,a.useState)(""),[p,v]=(0,a.useState)("lastSent"),[b,y]=(0,a.useState)("desc"),{viewMode:w,setViewMode:k}=function(){let{value:e,setValue:s}=(0,z.V)({key:"mcbd-sessions-view-mode",defaultValue:"list",validate:ea,serialize:e=>e,deserialize:e=>e});return{viewMode:e,setViewMode:(0,a.useCallback)(e=>s(e),[s])}}(),N="tile"===w;(0,a.useEffect)(()=>{(0,H.qD)()},[]);let A=(0,a.useMemo)(()=>{let e=i;if(f){let s=f.toLowerCase();e=e.filter(e=>{var t,n;return e.name.toLowerCase().includes(s)||e.repositoryName.toLowerCase().includes(s)||null!=(n=null==(t=e.repositoryDisplayName)?void 0:t.toLowerCase().includes(s))&&n})}let s=[...e];return s.sort((e,s)=>{var t,n,a,i,r,l,o,c;let d=0;switch(p){case"lastSent":{let t=(0,ec.nO)(e.lastUserMessageAt,s.lastUserMessageAt);if(!e.lastUserMessageAt&&!s.lastUserMessageAt)return 0;if(!e.lastUserMessageAt)return 1;if(!s.lastUserMessageAt)return -1;d=t;break}case"repositoryName":{let a=(null!=(t=e.repositoryDisplayName)?t:e.repositoryName).toLowerCase(),i=(null!=(n=s.repositoryDisplayName)?n:s.repositoryName).toLowerCase();0===(d=a.localeCompare(i))&&(d=e.name.toLowerCase().localeCompare(s.name.toLowerCase()));break}case"status":if(0==(d=(null!=(i=ex[null!=(a=e.status)?a:""])?i:4)-(null!=(l=ex[null!=(r=s.status)?r:""])?l:4))){let t=(null!=(o=e.repositoryDisplayName)?o:e.repositoryName).toLowerCase(),n=(null!=(c=s.repositoryDisplayName)?c:s.repositoryName).toLowerCase();d=t.localeCompare(n)}break;default:d=0}return("lastSent"===p?"desc"===b:"asc"===b)?d:-d}),s},[i,f,p,b]),M=(0,a.useCallback)(e=>{g(e.target.value)},[]),S=(0,a.useCallback)(e=>{var s;v(e),y(null!=(s=eh[e])?s:"asc")},[]),C=(0,a.useCallback)(()=>{y(e=>"asc"===e?"desc":"asc")},[]);return(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)(d.k,{onRefresh:h,enabled:t,className:"".concat(N?"w-full px-4 sm:px-6 lg:px-8":"container-custom"," py-8 h-full"),children:[(0,n.jsxs)("div",{className:"mb-6",children:[(0,n.jsx)("h1",{className:"text-2xl font-bold text-foreground mb-2",children:e("sessions.title")}),(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:e("sessions.description")})]}),(0,n.jsxs)("div",{className:"mb-6 flex items-center gap-3",children:[(0,n.jsx)(j.pd,{type:"text",placeholder:e("sessions.filterPlaceholder"),value:f,onChange:M,className:"max-w-md flex-1","data-testid":"sessions-filter","aria-label":e("sessions.filterAriaLabel"),inputMode:"search",enterKeyHint:"search"}),(0,n.jsxs)(j.l6,{value:p,onValueChange:S,children:[(0,n.jsx)(j.bq,{className:"w-40","data-testid":"sessions-sort-select","aria-label":e("sessions.sortByAriaLabel"),children:(0,n.jsx)(j.yv,{})}),(0,n.jsx)(j.gC,{children:em.map(s=>(0,n.jsx)(j.eb,{value:s.key,children:e(s.labelKey)},s.key))})]}),(0,n.jsx)("button",{type:"button",onClick:C,"data-testid":"sessions-sort-direction","aria-label":"asc"===b?e("sessions.sortAscending"):e("sessions.sortDescending"),className:"rounded-md border border-input bg-surface p-2 text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:"asc"===b?(0,n.jsx)(o.A,{size:16,"aria-hidden":"true"}):(0,n.jsx)(c.A,{size:16,"aria-hidden":"true"})}),(0,n.jsx)(er,{value:w,onChange:k})]}),x?(0,n.jsxs)(n.Fragment,{children:[m&&(0,n.jsx)("div",{className:"mb-4 rounded-md border border-danger-border bg-danger-subtle px-3 py-2 text-sm text-danger-foreground",role:"status","data-testid":"sessions-error-banner",children:e("sessions.refreshError",{message:m.message})}),N?0===A.length?(0,n.jsx)("div",{className:"text-muted-foreground py-8 text-center","data-testid":"sessions-empty",children:e("sessions.noMatching")}):(0,n.jsx)(ee,{worktrees:A}):(0,n.jsx)("div",{className:"space-y-2","data-testid":"sessions-list",children:0===A.length?(0,n.jsx)("div",{className:"text-muted-foreground py-8 text-center","data-testid":"sessions-empty",children:e("sessions.noMatching")}):A.map((t,a)=>{var i,l,o,c;let d=null!=(i=t.selectedAgents)?i:(0,H.sA)(),u=t.lastUserMessage?t.lastUserMessage.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x9F]/g,"").replace(/[\u200B-\u200F\u2028-\u202F\uFEFF\u061C]/g,"").replace(/[\r\n\t]/g," ").replace(/\s+/g," ").trim():null,m=t.lastUserMessageAt?(0,ed.Fx)(String(t.lastUserMessageAt)):null,h=d.map(e=>{var s;let n=null==(s=t.sessionStatusByCli)?void 0:s[e];return{agent:e,status:(0,U.kA)(n),unclassified:(0,U.px)(n)}}),x=h.filter(e=>(0,eo.Qo)(e.status)||e.unclassified),f=h.length-x.length,g=d.some(e=>{var s;let n=(0,U.kA)(null==(s=t.sessionStatusByCli)?void 0:s[e]);return"running"===n||"generating"===n});return(0,n.jsxs)(r(),{href:"/worktrees/".concat(t.id),style:{animationDelay:function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:40,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;if(Number.isFinite(e)&&!(e<=0)&&!(e>=t))return"".concat(e*s,"ms")}(a)},className:"block bg-surface rounded-lg p-4 border transition-colors ".concat(g?"border-accent-500/40 shadow-[0_0_16px_-4px_rgb(var(--accent-500)/0.45)] hover:border-accent-400":"border-border shadow-sm hover:border-accent-300 dark:hover:border-accent-700"," ").concat("animate-in fade-in-0 slide-in-from-bottom-2 fill-mode-backwards duration-300"),"data-testid":"session-item-".concat(t.id),children:[(0,n.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,n.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,n.jsx)("div",{className:"text-sm font-medium text-foreground truncate",children:null!=(l=t.repositoryDisplayName)?l:t.repositoryName}),(0,n.jsx)("div",{className:"text-xs text-muted-foreground truncate",children:t.name})]}),(0,n.jsxs)("div",{className:"flex items-center gap-2 ml-4 flex-shrink-0","data-testid":"session-agents-".concat(t.id),children:[x.map(e=>{let{agent:s,status:t,unclassified:a}=e;return(0,n.jsxs)("div",{className:"flex items-center gap-1","data-testid":"session-agent-".concat(s),children:[(0,n.jsx)(ef,{status:t,label:(0,Y.oo)(s),unclassified:a}),(0,n.jsx)("span",{className:"text-xs text-muted-foreground",children:(0,Y.oo)(s)})]},s)}),f>0&&(0,n.jsxs)("div",{className:"flex items-center gap-1","data-testid":"session-idle-cluster-".concat(t.id),"aria-label":e("sessions.idleAgents",{count:f}),children:[(0,n.jsx)(j.md,{status:"idle",size:"sm","aria-hidden":!0,title:void 0}),(0,n.jsxs)("span",{className:"text-xs text-muted-foreground tabular-nums",children:["+",f]})]})]})]}),t.description&&(0,n.jsx)("div",{className:"mt-2",children:(0,n.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-2 whitespace-pre-wrap",children:t.description})}),t.status&&(0,n.jsx)("div",{className:"mt-2",children:(0,n.jsx)("span",{className:"px-2 py-0.5 text-xs font-medium rounded ".concat(null!=(c=eu.SE[null!=(o=t.status)?o:""])?c:"bg-muted text-muted-foreground"),children:function(e,s){if(!e)return"";let t=eu.m9.find(s=>s.value===e);return t?s(t.labelKey):e}(t.status,s)})}),u&&(0,n.jsxs)("div",{className:"mt-2 flex items-center gap-2","data-testid":"session-message-".concat(t.id),children:[(0,n.jsx)("span",{className:"text-xs text-muted-foreground truncate min-w-0 flex-1","data-testid":"session-message-text-".concat(t.id),title:u,children:u}),m&&(0,n.jsx)("span",{className:"text-xs text-muted-foreground flex-shrink-0 whitespace-nowrap tabular-nums","data-testid":"session-time-".concat(t.id),children:m})]})]},t.id)})})]}):(0,n.jsxs)(n.Fragment,{children:[u&&(0,n.jsx)("div",{className:"space-y-2","data-testid":"sessions-loading",role:"status","aria-label":e("sessions.loadingAriaLabel"),children:[0,1,2].map(e=>(0,n.jsxs)("div",{className:"block bg-surface rounded-lg p-4 border border-border shadow-sm",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,n.jsxs)("div",{className:"min-w-0 flex-1 space-y-1.5",children:[(0,n.jsx)(j.EA,{className:"h-4 w-40 max-w-full"}),(0,n.jsx)(j.EA,{className:"h-3 w-56 max-w-full"})]}),(0,n.jsx)(j.EA,{className:"ml-4 h-3 w-16 flex-shrink-0"})]}),(0,n.jsxs)("div",{className:"mt-3 flex items-center gap-2",children:[(0,n.jsx)(j.EA,{className:"h-3 min-w-0 flex-1"}),(0,n.jsx)(j.EA,{className:"h-3 w-10 flex-shrink-0"})]})]},e))}),!u&&m&&(0,n.jsx)("div",{className:"text-danger-foreground","data-testid":"sessions-error",children:e("sessions.loadError",{message:m.message})}),!u&&!m&&(0,n.jsx)("div",{className:"text-muted-foreground py-8 text-center","data-testid":"sessions-empty",children:f?e("sessions.noMatching"):e("sessions.empty")})]})]})})}},75676:(e,s,t)=>{"use strict";t.d(s,{jg:()=>i,kQ:()=>r,mR:()=>c,mS:()=>o,wf:()=>n});let n="terminal",a=new Set(["terminal","chat"]);function i(e){return"string"==typeof e&&a.has(e)}let r={data:null,messageId:null,visible:!1,answering:!1},l={mode:"split",mobileActivePane:"terminal",leftPaneTab:"history",splitRatio:.5,leftPaneCollapsed:!1,activityBar:{active:"files"},historyPane:{visible:!0,width:25,collapsed:!1}},o={type:null,message:null,retryable:!1,retryCount:0};function c(){return{phase:"idle",prompt:{...r},layout:{...l},error:{...o},messages:[],wsConnected:!1}}},80003:(e,s,t)=>{"use strict";t.d(s,{A:()=>n});let n=(0,t(71847).A)("list",[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]])},87047:(e,s,t)=>{Promise.resolve().then(t.bind(t,46617))}},e=>{e.O(0,[6809,4909,2770,2619,3662,6606,934,9465,8407,2407,344,7636,6966,1128,7197,3931,8441,1255,7358],()=>e(e.s=87047)),_N_E=e.O()}]);