commandmate 0.38.0 → 0.39.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 (785) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-build-manifest.json +471 -576
  3. package/.next/app-path-routes-manifest.json +32 -42
  4. package/.next/build-manifest.json +5 -5
  5. package/.next/prerender-manifest.json +9 -9
  6. package/.next/react-loadable-manifest.json +2 -2
  7. package/.next/required-server-files.json +1 -1
  8. package/.next/routes-manifest.json +0 -23
  9. package/.next/server/app/_not-found/page.js +1 -1
  10. package/.next/server/app/_not-found/page.js.nft.json +1 -1
  11. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  12. package/.next/server/app/api/agents/update/route_client-reference-manifest.js +1 -1
  13. package/.next/server/app/api/agents/versions/route_client-reference-manifest.js +1 -1
  14. package/.next/server/app/api/app/release-notes/route.js +1 -0
  15. package/.next/server/app/api/app/release-notes/route.js.nft.json +1 -0
  16. package/.next/server/app/api/app/release-notes/route_client-reference-manifest.js +1 -0
  17. package/.next/server/app/api/app/update/route_client-reference-manifest.js +1 -1
  18. package/.next/server/app/api/app/update-check/route.js +1 -1
  19. package/.next/server/app/api/app/update-check/route_client-reference-manifest.js +1 -1
  20. package/.next/server/app/api/auth/login/route_client-reference-manifest.js +1 -1
  21. package/.next/server/app/api/auth/logout/route_client-reference-manifest.js +1 -1
  22. package/.next/server/app/api/auth/status/route_client-reference-manifest.js +1 -1
  23. package/.next/server/app/api/capabilities/route.js +1 -1
  24. package/.next/server/app/api/capabilities/route_client-reference-manifest.js +1 -1
  25. package/.next/server/app/api/daily-summary/route_client-reference-manifest.js +1 -1
  26. package/.next/server/app/api/daily-summary/status/route_client-reference-manifest.js +1 -1
  27. package/.next/server/app/api/external-apps/[id]/health/route_client-reference-manifest.js +1 -1
  28. package/.next/server/app/api/external-apps/[id]/route_client-reference-manifest.js +1 -1
  29. package/.next/server/app/api/external-apps/route_client-reference-manifest.js +1 -1
  30. package/.next/server/app/api/fs/browse/route_client-reference-manifest.js +1 -1
  31. package/.next/server/app/api/fs/recent-paths/route_client-reference-manifest.js +1 -1
  32. package/.next/server/app/api/hooks/agent-event/route.js +1 -1
  33. package/.next/server/app/api/hooks/agent-event/route.js.nft.json +1 -1
  34. package/.next/server/app/api/hooks/agent-event/route_client-reference-manifest.js +1 -1
  35. package/.next/server/app/api/hooks/claude-done/route.js +1 -1
  36. package/.next/server/app/api/hooks/claude-done/route.js.nft.json +1 -1
  37. package/.next/server/app/api/hooks/claude-done/route_client-reference-manifest.js +1 -1
  38. package/.next/server/app/api/hooks/permission-request/route.js +1 -1
  39. package/.next/server/app/api/hooks/permission-request/route.js.nft.json +1 -1
  40. package/.next/server/app/api/hooks/permission-request/route_client-reference-manifest.js +1 -1
  41. package/.next/server/app/api/metrics/vibe/route_client-reference-manifest.js +1 -1
  42. package/.next/server/app/api/ollama/models/route_client-reference-manifest.js +1 -1
  43. package/.next/server/app/api/push/escalation/route_client-reference-manifest.js +1 -1
  44. package/.next/server/app/api/push/subscriptions/route.js +1 -1
  45. package/.next/server/app/api/push/subscriptions/route_client-reference-manifest.js +1 -1
  46. package/.next/server/app/api/push/vapid/route_client-reference-manifest.js +1 -1
  47. package/.next/server/app/api/relays/[relayId]/cancel/route.js +1 -1
  48. package/.next/server/app/api/relays/[relayId]/cancel/route.js.nft.json +1 -1
  49. package/.next/server/app/api/relays/[relayId]/cancel/route_client-reference-manifest.js +1 -1
  50. package/.next/server/app/api/relays/route.js +1 -1
  51. package/.next/server/app/api/relays/route.js.nft.json +1 -1
  52. package/.next/server/app/api/relays/route_client-reference-manifest.js +1 -1
  53. package/.next/server/app/api/remote/pair/route_client-reference-manifest.js +1 -1
  54. package/.next/server/app/api/repositories/[id]/route_client-reference-manifest.js +1 -1
  55. package/.next/server/app/api/repositories/clone/[jobId]/route.js +1 -1
  56. package/.next/server/app/api/repositories/clone/[jobId]/route.js.nft.json +1 -1
  57. package/.next/server/app/api/repositories/clone/[jobId]/route_client-reference-manifest.js +1 -1
  58. package/.next/server/app/api/repositories/clone/route.js +1 -1
  59. package/.next/server/app/api/repositories/clone/route.js.nft.json +1 -1
  60. package/.next/server/app/api/repositories/clone/route_client-reference-manifest.js +1 -1
  61. package/.next/server/app/api/repositories/excluded/route_client-reference-manifest.js +1 -1
  62. package/.next/server/app/api/repositories/restore/route.js +1 -1
  63. package/.next/server/app/api/repositories/restore/route.js.nft.json +1 -1
  64. package/.next/server/app/api/repositories/restore/route_client-reference-manifest.js +1 -1
  65. package/.next/server/app/api/repositories/route.js +1 -1
  66. package/.next/server/app/api/repositories/route.js.nft.json +1 -1
  67. package/.next/server/app/api/repositories/route_client-reference-manifest.js +1 -1
  68. package/.next/server/app/api/repositories/scan/route.js +1 -1
  69. package/.next/server/app/api/repositories/scan/route.js.nft.json +1 -1
  70. package/.next/server/app/api/repositories/scan/route_client-reference-manifest.js +1 -1
  71. package/.next/server/app/api/repositories/sync/route.js +1 -1
  72. package/.next/server/app/api/repositories/sync/route.js.nft.json +1 -1
  73. package/.next/server/app/api/repositories/sync/route_client-reference-manifest.js +1 -1
  74. package/.next/server/app/api/repositories/validate-path/route_client-reference-manifest.js +1 -1
  75. package/.next/server/app/api/settings/default-agents/route.js +1 -1
  76. package/.next/server/app/api/settings/default-agents/route.js.nft.json +1 -1
  77. package/.next/server/app/api/settings/default-agents/route_client-reference-manifest.js +1 -1
  78. package/.next/server/app/api/settings/default-surface-mode/route_client-reference-manifest.js +1 -1
  79. package/.next/server/app/api/sidebar/group-order/route_client-reference-manifest.js +1 -1
  80. package/.next/server/app/api/skills/[id]/route_client-reference-manifest.js +1 -1
  81. package/.next/server/app/api/skills/installations/route_client-reference-manifest.js +1 -1
  82. package/.next/server/app/api/skills/operations/route_client-reference-manifest.js +1 -1
  83. package/.next/server/app/api/skills/reindex/route_client-reference-manifest.js +1 -1
  84. package/.next/server/app/api/skills/route_client-reference-manifest.js +1 -1
  85. package/.next/server/app/api/slash-commands/route_client-reference-manifest.js +1 -1
  86. package/.next/server/app/api/tasks/[taskId]/cancel/route_client-reference-manifest.js +1 -1
  87. package/.next/server/app/api/tasks/[taskId]/route.js +1 -1
  88. package/.next/server/app/api/tasks/[taskId]/route_client-reference-manifest.js +1 -1
  89. package/.next/server/app/api/templates/[id]/route_client-reference-manifest.js +1 -1
  90. package/.next/server/app/api/templates/route_client-reference-manifest.js +1 -1
  91. package/.next/server/app/api/verification/runs/[runId]/route.js +1 -1
  92. package/.next/server/app/api/verification/runs/[runId]/route_client-reference-manifest.js +1 -1
  93. package/.next/server/app/api/verification/runs/route.js +1 -1
  94. package/.next/server/app/api/verification/runs/route_client-reference-manifest.js +1 -1
  95. package/.next/server/app/api/worktrees/[id]/auto-yes/route.js +1 -1
  96. package/.next/server/app/api/worktrees/[id]/auto-yes/route.js.nft.json +1 -1
  97. package/.next/server/app/api/worktrees/[id]/auto-yes/route_client-reference-manifest.js +1 -1
  98. package/.next/server/app/api/worktrees/[id]/capture/route.js +1 -1
  99. package/.next/server/app/api/worktrees/[id]/capture/route.js.nft.json +1 -1
  100. package/.next/server/app/api/worktrees/[id]/capture/route_client-reference-manifest.js +1 -1
  101. package/.next/server/app/api/worktrees/[id]/clear-composer/route.js +1 -1
  102. package/.next/server/app/api/worktrees/[id]/clear-composer/route.js.nft.json +1 -1
  103. package/.next/server/app/api/worktrees/[id]/clear-composer/route_client-reference-manifest.js +1 -1
  104. package/.next/server/app/api/worktrees/[id]/cli-reference/route.js +1 -1
  105. package/.next/server/app/api/worktrees/[id]/cli-reference/route_client-reference-manifest.js +1 -1
  106. package/.next/server/app/api/worktrees/[id]/cli-tool/route.js +1 -1
  107. package/.next/server/app/api/worktrees/[id]/cli-tool/route_client-reference-manifest.js +1 -1
  108. package/.next/server/app/api/worktrees/[id]/cmate/schedules/route.js +1 -1
  109. package/.next/server/app/api/worktrees/[id]/cmate/schedules/route_client-reference-manifest.js +1 -1
  110. package/.next/server/app/api/worktrees/[id]/current-output/route.js +1 -1
  111. package/.next/server/app/api/worktrees/[id]/current-output/route.js.nft.json +1 -1
  112. package/.next/server/app/api/worktrees/[id]/current-output/route_client-reference-manifest.js +1 -1
  113. package/.next/server/app/api/worktrees/[id]/env/route.js +1 -1
  114. package/.next/server/app/api/worktrees/[id]/env/route_client-reference-manifest.js +1 -1
  115. package/.next/server/app/api/worktrees/[id]/execution-logs/[logId]/route.js +1 -1
  116. package/.next/server/app/api/worktrees/[id]/execution-logs/[logId]/route_client-reference-manifest.js +1 -1
  117. package/.next/server/app/api/worktrees/[id]/execution-logs/route.js +1 -1
  118. package/.next/server/app/api/worktrees/[id]/execution-logs/route_client-reference-manifest.js +1 -1
  119. package/.next/server/app/api/worktrees/[id]/files/[...path]/route_client-reference-manifest.js +1 -1
  120. package/.next/server/app/api/worktrees/[id]/git/branch/create/route.js +1 -1
  121. package/.next/server/app/api/worktrees/[id]/git/branch/create/route_client-reference-manifest.js +1 -1
  122. package/.next/server/app/api/worktrees/[id]/git/branch/delete/route.js +1 -1
  123. package/.next/server/app/api/worktrees/[id]/git/branch/delete/route_client-reference-manifest.js +1 -1
  124. package/.next/server/app/api/worktrees/[id]/git/branches/route.js +1 -1
  125. package/.next/server/app/api/worktrees/[id]/git/branches/route_client-reference-manifest.js +1 -1
  126. package/.next/server/app/api/worktrees/[id]/git/checkout/route.js +1 -1
  127. package/.next/server/app/api/worktrees/[id]/git/checkout/route_client-reference-manifest.js +1 -1
  128. package/.next/server/app/api/worktrees/[id]/git/commit/route.js +1 -1
  129. package/.next/server/app/api/worktrees/[id]/git/commit/route_client-reference-manifest.js +1 -1
  130. package/.next/server/app/api/worktrees/[id]/git/diff/route.js +1 -1
  131. package/.next/server/app/api/worktrees/[id]/git/diff/route_client-reference-manifest.js +1 -1
  132. package/.next/server/app/api/worktrees/[id]/git/fetch/route.js +1 -1
  133. package/.next/server/app/api/worktrees/[id]/git/fetch/route_client-reference-manifest.js +1 -1
  134. package/.next/server/app/api/worktrees/[id]/git/log/route.js +1 -1
  135. package/.next/server/app/api/worktrees/[id]/git/log/route_client-reference-manifest.js +1 -1
  136. package/.next/server/app/api/worktrees/[id]/git/pull/route.js +1 -1
  137. package/.next/server/app/api/worktrees/[id]/git/pull/route_client-reference-manifest.js +1 -1
  138. package/.next/server/app/api/worktrees/[id]/git/push/route.js +1 -1
  139. package/.next/server/app/api/worktrees/[id]/git/push/route_client-reference-manifest.js +1 -1
  140. package/.next/server/app/api/worktrees/[id]/git/reset/route.js +1 -1
  141. package/.next/server/app/api/worktrees/[id]/git/reset/route_client-reference-manifest.js +1 -1
  142. package/.next/server/app/api/worktrees/[id]/git/revert/route.js +1 -1
  143. package/.next/server/app/api/worktrees/[id]/git/revert/route_client-reference-manifest.js +1 -1
  144. package/.next/server/app/api/worktrees/[id]/git/show/[commitHash]/route.js +1 -1
  145. package/.next/server/app/api/worktrees/[id]/git/show/[commitHash]/route_client-reference-manifest.js +1 -1
  146. package/.next/server/app/api/worktrees/[id]/git/stage/route.js +1 -1
  147. package/.next/server/app/api/worktrees/[id]/git/stage/route_client-reference-manifest.js +1 -1
  148. package/.next/server/app/api/worktrees/[id]/git/staged/route.js +1 -1
  149. package/.next/server/app/api/worktrees/[id]/git/staged/route_client-reference-manifest.js +1 -1
  150. package/.next/server/app/api/worktrees/[id]/git/stash/[index]/route.js +1 -1
  151. package/.next/server/app/api/worktrees/[id]/git/stash/[index]/route_client-reference-manifest.js +1 -1
  152. package/.next/server/app/api/worktrees/[id]/git/stash/apply/route.js +1 -1
  153. package/.next/server/app/api/worktrees/[id]/git/stash/apply/route_client-reference-manifest.js +1 -1
  154. package/.next/server/app/api/worktrees/[id]/git/stash/pop/route.js +1 -1
  155. package/.next/server/app/api/worktrees/[id]/git/stash/pop/route_client-reference-manifest.js +1 -1
  156. package/.next/server/app/api/worktrees/[id]/git/stash/push/route.js +1 -1
  157. package/.next/server/app/api/worktrees/[id]/git/stash/push/route_client-reference-manifest.js +1 -1
  158. package/.next/server/app/api/worktrees/[id]/git/stash/route.js +1 -1
  159. package/.next/server/app/api/worktrees/[id]/git/stash/route_client-reference-manifest.js +1 -1
  160. package/.next/server/app/api/worktrees/[id]/git/status/route.js +1 -1
  161. package/.next/server/app/api/worktrees/[id]/git/status/route_client-reference-manifest.js +1 -1
  162. package/.next/server/app/api/worktrees/[id]/git/unstage/route.js +1 -1
  163. package/.next/server/app/api/worktrees/[id]/git/unstage/route_client-reference-manifest.js +1 -1
  164. package/.next/server/app/api/worktrees/[id]/git/working-diff/route.js +1 -1
  165. package/.next/server/app/api/worktrees/[id]/git/working-diff/route_client-reference-manifest.js +1 -1
  166. package/.next/server/app/api/worktrees/[id]/instances/notes/route.js +1 -1
  167. package/.next/server/app/api/worktrees/[id]/instances/notes/route_client-reference-manifest.js +1 -1
  168. package/.next/server/app/api/worktrees/[id]/instances/opencode/route.js.nft.json +1 -1
  169. package/.next/server/app/api/worktrees/[id]/instances/opencode/route_client-reference-manifest.js +1 -1
  170. package/.next/server/app/api/worktrees/[id]/interrupt/route.js +1 -1
  171. package/.next/server/app/api/worktrees/[id]/interrupt/route.js.nft.json +1 -1
  172. package/.next/server/app/api/worktrees/[id]/interrupt/route_client-reference-manifest.js +1 -1
  173. package/.next/server/app/api/worktrees/[id]/kill-session/route.js +1 -1
  174. package/.next/server/app/api/worktrees/[id]/kill-session/route.js.nft.json +1 -1
  175. package/.next/server/app/api/worktrees/[id]/kill-session/route_client-reference-manifest.js +1 -1
  176. package/.next/server/app/api/worktrees/[id]/logs/[filename]/route.js +1 -1
  177. package/.next/server/app/api/worktrees/[id]/logs/[filename]/route_client-reference-manifest.js +1 -1
  178. package/.next/server/app/api/worktrees/[id]/logs/route.js +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_client-reference-manifest.js +1 -1
  190. package/.next/server/app/api/worktrees/[id]/opencode/session/route_client-reference-manifest.js +1 -1
  191. package/.next/server/app/api/worktrees/[id]/opencode/share/route_client-reference-manifest.js +1 -1
  192. package/.next/server/app/api/worktrees/[id]/prompt-response/route.js +1 -1
  193. package/.next/server/app/api/worktrees/[id]/prompt-response/route.js.nft.json +1 -1
  194. package/.next/server/app/api/worktrees/[id]/prompt-response/route_client-reference-manifest.js +1 -1
  195. package/.next/server/app/api/worktrees/[id]/resolve-target/route.js +1 -1
  196. package/.next/server/app/api/worktrees/[id]/resolve-target/route_client-reference-manifest.js +1 -1
  197. package/.next/server/app/api/worktrees/[id]/respond/route.js +1 -1
  198. package/.next/server/app/api/worktrees/[id]/respond/route.js.nft.json +1 -1
  199. package/.next/server/app/api/worktrees/[id]/respond/route_client-reference-manifest.js +1 -1
  200. package/.next/server/app/api/worktrees/[id]/route.js +1 -1
  201. package/.next/server/app/api/worktrees/[id]/route.js.nft.json +1 -1
  202. package/.next/server/app/api/worktrees/[id]/route_client-reference-manifest.js +1 -1
  203. package/.next/server/app/api/worktrees/[id]/schedules/[scheduleId]/route.js +1 -1
  204. package/.next/server/app/api/worktrees/[id]/schedules/[scheduleId]/route_client-reference-manifest.js +1 -1
  205. package/.next/server/app/api/worktrees/[id]/schedules/active/route.js +1 -1
  206. package/.next/server/app/api/worktrees/[id]/schedules/active/route_client-reference-manifest.js +1 -1
  207. package/.next/server/app/api/worktrees/[id]/schedules/route.js +1 -1
  208. package/.next/server/app/api/worktrees/[id]/schedules/route_client-reference-manifest.js +1 -1
  209. package/.next/server/app/api/worktrees/[id]/search/route_client-reference-manifest.js +1 -1
  210. package/.next/server/app/api/worktrees/[id]/send/route.js +1 -1
  211. package/.next/server/app/api/worktrees/[id]/send/route.js.nft.json +1 -1
  212. package/.next/server/app/api/worktrees/[id]/send/route_client-reference-manifest.js +1 -1
  213. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route.js +1 -1
  214. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route.js.nft.json +1 -1
  215. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route_client-reference-manifest.js +1 -1
  216. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/install/route_client-reference-manifest.js +1 -1
  217. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/plan/route_client-reference-manifest.js +1 -1
  218. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall/route_client-reference-manifest.js +1 -1
  219. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall-plan/route_client-reference-manifest.js +1 -1
  220. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/update/route_client-reference-manifest.js +1 -1
  221. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/update-plan/route_client-reference-manifest.js +1 -1
  222. package/.next/server/app/api/worktrees/[id]/skills/route.js +1 -1
  223. package/.next/server/app/api/worktrees/[id]/skills/route_client-reference-manifest.js +1 -1
  224. package/.next/server/app/api/worktrees/[id]/slash-commands/route.js +1 -1
  225. package/.next/server/app/api/worktrees/[id]/slash-commands/route_client-reference-manifest.js +1 -1
  226. package/.next/server/app/api/worktrees/[id]/special-keys/route.js +1 -1
  227. package/.next/server/app/api/worktrees/[id]/special-keys/route.js.nft.json +1 -1
  228. package/.next/server/app/api/worktrees/[id]/special-keys/route_client-reference-manifest.js +1 -1
  229. package/.next/server/app/api/worktrees/[id]/tasks/route.js +1 -1
  230. package/.next/server/app/api/worktrees/[id]/tasks/route_client-reference-manifest.js +1 -1
  231. package/.next/server/app/api/worktrees/[id]/terminal/route.js +1 -1
  232. package/.next/server/app/api/worktrees/[id]/terminal/route.js.nft.json +1 -1
  233. package/.next/server/app/api/worktrees/[id]/terminal/route_client-reference-manifest.js +1 -1
  234. package/.next/server/app/api/worktrees/[id]/timers/history/route.js +1 -1
  235. package/.next/server/app/api/worktrees/[id]/timers/history/route_client-reference-manifest.js +1 -1
  236. package/.next/server/app/api/worktrees/[id]/timers/route.js +1 -1
  237. package/.next/server/app/api/worktrees/[id]/timers/route.js.nft.json +1 -1
  238. package/.next/server/app/api/worktrees/[id]/timers/route_client-reference-manifest.js +1 -1
  239. package/.next/server/app/api/worktrees/[id]/todos/[todoId]/route.js +1 -1
  240. package/.next/server/app/api/worktrees/[id]/todos/[todoId]/route_client-reference-manifest.js +1 -1
  241. package/.next/server/app/api/worktrees/[id]/todos/route.js +1 -1
  242. package/.next/server/app/api/worktrees/[id]/todos/route_client-reference-manifest.js +1 -1
  243. package/.next/server/app/api/worktrees/[id]/tree/[...path]/route_client-reference-manifest.js +1 -1
  244. package/.next/server/app/api/worktrees/[id]/tree/route_client-reference-manifest.js +1 -1
  245. package/.next/server/app/api/worktrees/[id]/upload/[...path]/route_client-reference-manifest.js +1 -1
  246. package/.next/server/app/api/worktrees/[id]/verify/config/route.js +1 -1
  247. package/.next/server/app/api/worktrees/[id]/verify/config/route_client-reference-manifest.js +1 -1
  248. package/.next/server/app/api/worktrees/[id]/verify/route.js +1 -1
  249. package/.next/server/app/api/worktrees/[id]/verify/route_client-reference-manifest.js +1 -1
  250. package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/cancel/route.js +1 -1
  251. package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/cancel/route_client-reference-manifest.js +1 -1
  252. package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/route.js +1 -1
  253. package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/route_client-reference-manifest.js +1 -1
  254. package/.next/server/app/api/worktrees/[id]/verify/runs/route.js +1 -1
  255. package/.next/server/app/api/worktrees/[id]/verify/runs/route_client-reference-manifest.js +1 -1
  256. package/.next/server/app/api/worktrees/[id]/viewed/route.js +1 -1
  257. package/.next/server/app/api/worktrees/[id]/viewed/route_client-reference-manifest.js +1 -1
  258. package/.next/server/app/api/worktrees/apply-default-agents/route_client-reference-manifest.js +1 -1
  259. package/.next/server/app/api/worktrees/route.js +1 -1
  260. package/.next/server/app/api/worktrees/route.js.nft.json +1 -1
  261. package/.next/server/app/api/worktrees/route_client-reference-manifest.js +1 -1
  262. package/.next/server/app/login/page.js +1 -1
  263. package/.next/server/app/login/page.js.nft.json +1 -1
  264. package/.next/server/app/login/page_client-reference-manifest.js +1 -1
  265. package/.next/server/app/manifest.webmanifest/route_client-reference-manifest.js +1 -1
  266. package/.next/server/app/more/page.js +2 -2
  267. package/.next/server/app/more/page.js.nft.json +1 -1
  268. package/.next/server/app/more/page_client-reference-manifest.js +1 -1
  269. package/.next/server/app/offline/page.js +1 -1
  270. package/.next/server/app/offline/page.js.nft.json +1 -1
  271. package/.next/server/app/offline/page_client-reference-manifest.js +1 -1
  272. package/.next/server/app/page.js +2 -2
  273. package/.next/server/app/page.js.nft.json +1 -1
  274. package/.next/server/app/page_client-reference-manifest.js +1 -1
  275. package/.next/server/app/proxy/[...path]/route_client-reference-manifest.js +1 -1
  276. package/.next/server/app/repositories/page.js +2 -2
  277. package/.next/server/app/repositories/page.js.nft.json +1 -1
  278. package/.next/server/app/repositories/page_client-reference-manifest.js +1 -1
  279. package/.next/server/app/review/page.js +1 -1
  280. package/.next/server/app/review/page.js.nft.json +1 -1
  281. package/.next/server/app/review/page_client-reference-manifest.js +1 -1
  282. package/.next/server/app/sessions/page.js +2 -2
  283. package/.next/server/app/sessions/page.js.nft.json +1 -1
  284. package/.next/server/app/sessions/page_client-reference-manifest.js +1 -1
  285. package/.next/server/app/skills/[skillId]/page.js +2 -2
  286. package/.next/server/app/skills/[skillId]/page.js.nft.json +1 -1
  287. package/.next/server/app/skills/[skillId]/page_client-reference-manifest.js +1 -1
  288. package/.next/server/app/skills/installed/page.js +2 -2
  289. package/.next/server/app/skills/installed/page.js.nft.json +1 -1
  290. package/.next/server/app/skills/installed/page_client-reference-manifest.js +1 -1
  291. package/.next/server/app/skills/page.js +1 -1
  292. package/.next/server/app/skills/page.js.nft.json +1 -1
  293. package/.next/server/app/skills/page_client-reference-manifest.js +1 -1
  294. package/.next/server/app/worktrees/[id]/files/[...path]/page.js +1 -1
  295. package/.next/server/app/worktrees/[id]/files/[...path]/page.js.nft.json +1 -1
  296. package/.next/server/app/worktrees/[id]/files/[...path]/page_client-reference-manifest.js +1 -1
  297. package/.next/server/app/worktrees/[id]/page.js +11 -11
  298. package/.next/server/app/worktrees/[id]/page.js.nft.json +1 -1
  299. package/.next/server/app/worktrees/[id]/page_client-reference-manifest.js +1 -1
  300. package/.next/server/app/worktrees/[id]/terminal/page.js +1 -1
  301. package/.next/server/app/worktrees/[id]/terminal/page.js.nft.json +1 -1
  302. package/.next/server/app/worktrees/[id]/terminal/page_client-reference-manifest.js +1 -1
  303. package/.next/server/app-paths-manifest.json +32 -42
  304. package/.next/server/chunks/1210.js +1 -1
  305. package/.next/server/chunks/1707.js +1 -1
  306. package/.next/server/chunks/1825.js +1 -1
  307. package/.next/server/chunks/2119.js +1 -1
  308. package/.next/server/chunks/2445.js +1 -1
  309. package/.next/server/chunks/3241.js +1 -1
  310. package/.next/server/chunks/3323.js +1 -1
  311. package/.next/server/chunks/3543.js +1 -1
  312. package/.next/server/chunks/366.js +1 -0
  313. package/.next/server/chunks/3945.js +1 -1
  314. package/.next/server/chunks/4443.js +1 -1
  315. package/.next/server/chunks/5164.js +1 -1
  316. package/.next/server/chunks/5354.js +1 -1
  317. package/.next/server/chunks/6130.js +1 -1
  318. package/.next/server/chunks/6159.js +1 -1
  319. package/.next/server/chunks/6401.js +1 -1
  320. package/.next/server/chunks/650.js +1 -1
  321. package/.next/server/chunks/6661.js +1 -1
  322. package/.next/server/chunks/7075.js +1 -1
  323. package/.next/server/chunks/7086.js +15 -0
  324. package/.next/server/chunks/8550.js +1 -0
  325. package/.next/server/chunks/8581.js +60 -0
  326. package/.next/server/chunks/8728.js +2 -2
  327. package/.next/server/chunks/8807.js +184 -323
  328. package/.next/server/chunks/8918.js +1 -1
  329. package/.next/server/chunks/9130.js +3 -3
  330. package/.next/server/chunks/9584.js +1 -1
  331. package/.next/server/chunks/9627.js +1 -1
  332. package/.next/server/chunks/{1886.js → 9731.js} +3 -3
  333. package/.next/server/chunks/{6677.js → 9882.js} +1 -1
  334. package/.next/server/middleware-build-manifest.js +1 -1
  335. package/.next/server/middleware-manifest.json +5 -5
  336. package/.next/server/middleware-react-loadable-manifest.js +1 -1
  337. package/.next/server/pages/500.html +1 -1
  338. package/.next/server/server-reference-manifest.json +1 -1
  339. package/.next/static/CqFH31RhKQbrRZXsMNosJ/_buildManifest.js +1 -0
  340. package/.next/static/chunks/1032-9e43405ac6bf6848.js +1 -0
  341. package/.next/static/chunks/2318-af00abceb9b8eab5.js +1 -0
  342. package/.next/static/chunks/{2407-6fd60b674e20ec06.js → 2407-8fe4e4d0bab1931a.js} +1 -1
  343. package/.next/static/chunks/2619-04bc32f026a0d946.js +1 -0
  344. package/.next/static/chunks/344-6f9fc1f38f01a839.js +1 -0
  345. package/.next/static/chunks/3504-0100ab50762f591b.js +1 -0
  346. package/.next/static/chunks/3778-56f41fc2cecb8c43.js +1 -0
  347. package/.next/static/chunks/4322-f54abdc5d16b7462.js +1 -0
  348. package/.next/static/chunks/4768-0ad5eb716bed5de9.js +1 -0
  349. package/.next/static/chunks/4949-a13ace141c0183d6.js +1 -0
  350. package/.next/static/chunks/5449-550bd273dccc3ae4.js +1 -0
  351. package/.next/static/chunks/5529-83e705fc4134a503.js +1 -0
  352. package/.next/static/chunks/{3313.53f7ff985c0c8852.js → 5694.dda65070757534df.js} +1 -1
  353. package/.next/static/chunks/6322-f1b30ed0ee43518f.js +1 -0
  354. package/.next/static/chunks/6966-bb854d1145783a64.js +1 -0
  355. package/.next/static/chunks/{7485.52361bc061cc663a.js → 7485.442b21101fca7257.js} +1 -1
  356. package/.next/static/chunks/8019-cc6ac1cc033fd5f0.js +1 -0
  357. package/.next/static/chunks/8283-26ad31a4670ea52d.js +1 -0
  358. package/.next/static/chunks/8606-e893c1dab6fb81bc.js +1 -0
  359. package/.next/static/chunks/9619-c3c4c623b0a4f681.js +1 -0
  360. package/.next/static/chunks/app/api/agents/update/route-70779af8b4c8259a.js +1 -0
  361. package/.next/static/chunks/app/api/agents/versions/route-70779af8b4c8259a.js +1 -0
  362. package/.next/static/chunks/app/api/app/release-notes/route-70779af8b4c8259a.js +1 -0
  363. package/.next/static/chunks/app/api/app/update/route-70779af8b4c8259a.js +1 -0
  364. package/.next/static/chunks/app/api/app/update-check/route-70779af8b4c8259a.js +1 -0
  365. package/.next/static/chunks/app/api/auth/login/route-70779af8b4c8259a.js +1 -0
  366. package/.next/static/chunks/app/api/auth/logout/route-70779af8b4c8259a.js +1 -0
  367. package/.next/static/chunks/app/api/auth/status/route-70779af8b4c8259a.js +1 -0
  368. package/.next/static/chunks/app/api/capabilities/route-70779af8b4c8259a.js +1 -0
  369. package/.next/static/chunks/app/api/daily-summary/route-70779af8b4c8259a.js +1 -0
  370. package/.next/static/chunks/app/api/daily-summary/status/route-70779af8b4c8259a.js +1 -0
  371. package/.next/static/chunks/app/api/external-apps/[id]/health/route-70779af8b4c8259a.js +1 -0
  372. package/.next/static/chunks/app/api/external-apps/[id]/route-70779af8b4c8259a.js +1 -0
  373. package/.next/static/chunks/app/api/external-apps/route-70779af8b4c8259a.js +1 -0
  374. package/.next/static/chunks/app/api/fs/browse/route-70779af8b4c8259a.js +1 -0
  375. package/.next/static/chunks/app/api/fs/recent-paths/route-70779af8b4c8259a.js +1 -0
  376. package/.next/static/chunks/app/api/hooks/agent-event/route-70779af8b4c8259a.js +1 -0
  377. package/.next/static/chunks/app/api/hooks/claude-done/route-70779af8b4c8259a.js +1 -0
  378. package/.next/static/chunks/app/api/hooks/permission-request/route-70779af8b4c8259a.js +1 -0
  379. package/.next/static/chunks/app/api/metrics/vibe/route-70779af8b4c8259a.js +1 -0
  380. package/.next/static/chunks/app/api/ollama/models/route-70779af8b4c8259a.js +1 -0
  381. package/.next/static/chunks/app/api/push/escalation/route-70779af8b4c8259a.js +1 -0
  382. package/.next/static/chunks/app/api/push/subscriptions/route-70779af8b4c8259a.js +1 -0
  383. package/.next/static/chunks/app/api/push/vapid/route-70779af8b4c8259a.js +1 -0
  384. package/.next/static/chunks/app/api/relays/[relayId]/cancel/route-70779af8b4c8259a.js +1 -0
  385. package/.next/static/chunks/app/api/relays/route-70779af8b4c8259a.js +1 -0
  386. package/.next/static/chunks/app/api/remote/pair/route-70779af8b4c8259a.js +1 -0
  387. package/.next/static/chunks/app/api/repositories/[id]/route-70779af8b4c8259a.js +1 -0
  388. package/.next/static/chunks/app/api/repositories/clone/[jobId]/route-70779af8b4c8259a.js +1 -0
  389. package/.next/static/chunks/app/api/repositories/clone/route-70779af8b4c8259a.js +1 -0
  390. package/.next/static/chunks/app/api/repositories/excluded/route-70779af8b4c8259a.js +1 -0
  391. package/.next/static/chunks/app/api/repositories/restore/route-70779af8b4c8259a.js +1 -0
  392. package/.next/static/chunks/app/api/repositories/route-70779af8b4c8259a.js +1 -0
  393. package/.next/static/chunks/app/api/repositories/scan/route-70779af8b4c8259a.js +1 -0
  394. package/.next/static/chunks/app/api/repositories/sync/route-70779af8b4c8259a.js +1 -0
  395. package/.next/static/chunks/app/api/repositories/validate-path/route-70779af8b4c8259a.js +1 -0
  396. package/.next/static/chunks/app/api/settings/default-agents/route-70779af8b4c8259a.js +1 -0
  397. package/.next/static/chunks/app/api/settings/default-surface-mode/route-70779af8b4c8259a.js +1 -0
  398. package/.next/static/chunks/app/api/sidebar/group-order/route-70779af8b4c8259a.js +1 -0
  399. package/.next/static/chunks/app/api/skills/[id]/route-70779af8b4c8259a.js +1 -0
  400. package/.next/static/chunks/app/api/skills/installations/route-70779af8b4c8259a.js +1 -0
  401. package/.next/static/chunks/app/api/skills/operations/route-70779af8b4c8259a.js +1 -0
  402. package/.next/static/chunks/app/api/skills/reindex/route-70779af8b4c8259a.js +1 -0
  403. package/.next/static/chunks/app/api/skills/route-70779af8b4c8259a.js +1 -0
  404. package/.next/static/chunks/app/api/slash-commands/route-70779af8b4c8259a.js +1 -0
  405. package/.next/static/chunks/app/api/tasks/[taskId]/cancel/route-70779af8b4c8259a.js +1 -0
  406. package/.next/static/chunks/app/api/tasks/[taskId]/route-70779af8b4c8259a.js +1 -0
  407. package/.next/static/chunks/app/api/templates/[id]/route-70779af8b4c8259a.js +1 -0
  408. package/.next/static/chunks/app/api/templates/route-70779af8b4c8259a.js +1 -0
  409. package/.next/static/chunks/app/api/verification/runs/[runId]/route-70779af8b4c8259a.js +1 -0
  410. package/.next/static/chunks/app/api/verification/runs/route-70779af8b4c8259a.js +1 -0
  411. package/.next/static/chunks/app/api/worktrees/[id]/auto-yes/route-70779af8b4c8259a.js +1 -0
  412. package/.next/static/chunks/app/api/worktrees/[id]/capture/route-70779af8b4c8259a.js +1 -0
  413. package/.next/static/chunks/app/api/worktrees/[id]/clear-composer/route-70779af8b4c8259a.js +1 -0
  414. package/.next/static/chunks/app/api/worktrees/[id]/cli-reference/route-70779af8b4c8259a.js +1 -0
  415. package/.next/static/chunks/app/api/worktrees/[id]/cli-tool/route-70779af8b4c8259a.js +1 -0
  416. package/.next/static/chunks/app/api/worktrees/[id]/cmate/schedules/route-70779af8b4c8259a.js +1 -0
  417. package/.next/static/chunks/app/api/worktrees/[id]/current-output/route-70779af8b4c8259a.js +1 -0
  418. package/.next/static/chunks/app/api/worktrees/[id]/env/route-70779af8b4c8259a.js +1 -0
  419. package/.next/static/chunks/app/api/worktrees/[id]/execution-logs/[logId]/route-70779af8b4c8259a.js +1 -0
  420. package/.next/static/chunks/app/api/worktrees/[id]/execution-logs/route-70779af8b4c8259a.js +1 -0
  421. package/.next/static/chunks/app/api/worktrees/[id]/files/[...path]/route-70779af8b4c8259a.js +1 -0
  422. package/.next/static/chunks/app/api/worktrees/[id]/git/branch/create/route-70779af8b4c8259a.js +1 -0
  423. package/.next/static/chunks/app/api/worktrees/[id]/git/branch/delete/route-70779af8b4c8259a.js +1 -0
  424. package/.next/static/chunks/app/api/worktrees/[id]/git/branches/route-70779af8b4c8259a.js +1 -0
  425. package/.next/static/chunks/app/api/worktrees/[id]/git/checkout/route-70779af8b4c8259a.js +1 -0
  426. package/.next/static/chunks/app/api/worktrees/[id]/git/commit/route-70779af8b4c8259a.js +1 -0
  427. package/.next/static/chunks/app/api/worktrees/[id]/git/diff/route-70779af8b4c8259a.js +1 -0
  428. package/.next/static/chunks/app/api/worktrees/[id]/git/fetch/route-70779af8b4c8259a.js +1 -0
  429. package/.next/static/chunks/app/api/worktrees/[id]/git/log/route-70779af8b4c8259a.js +1 -0
  430. package/.next/static/chunks/app/api/worktrees/[id]/git/pull/route-70779af8b4c8259a.js +1 -0
  431. package/.next/static/chunks/app/api/worktrees/[id]/git/push/route-70779af8b4c8259a.js +1 -0
  432. package/.next/static/chunks/app/api/worktrees/[id]/git/reset/route-70779af8b4c8259a.js +1 -0
  433. package/.next/static/chunks/app/api/worktrees/[id]/git/revert/route-70779af8b4c8259a.js +1 -0
  434. package/.next/static/chunks/app/api/worktrees/[id]/git/show/[commitHash]/route-70779af8b4c8259a.js +1 -0
  435. package/.next/static/chunks/app/api/worktrees/[id]/git/stage/route-70779af8b4c8259a.js +1 -0
  436. package/.next/static/chunks/app/api/worktrees/[id]/git/staged/route-70779af8b4c8259a.js +1 -0
  437. package/.next/static/chunks/app/api/worktrees/[id]/git/stash/[index]/route-70779af8b4c8259a.js +1 -0
  438. package/.next/static/chunks/app/api/worktrees/[id]/git/stash/apply/route-70779af8b4c8259a.js +1 -0
  439. package/.next/static/chunks/app/api/worktrees/[id]/git/stash/pop/route-70779af8b4c8259a.js +1 -0
  440. package/.next/static/chunks/app/api/worktrees/[id]/git/stash/push/route-70779af8b4c8259a.js +1 -0
  441. package/.next/static/chunks/app/api/worktrees/[id]/git/stash/route-70779af8b4c8259a.js +1 -0
  442. package/.next/static/chunks/app/api/worktrees/[id]/git/status/route-70779af8b4c8259a.js +1 -0
  443. package/.next/static/chunks/app/api/worktrees/[id]/git/unstage/route-70779af8b4c8259a.js +1 -0
  444. package/.next/static/chunks/app/api/worktrees/[id]/git/working-diff/route-70779af8b4c8259a.js +1 -0
  445. package/.next/static/chunks/app/api/worktrees/[id]/instances/notes/route-70779af8b4c8259a.js +1 -0
  446. package/.next/static/chunks/app/api/worktrees/[id]/instances/opencode/route-70779af8b4c8259a.js +1 -0
  447. package/.next/static/chunks/app/api/worktrees/[id]/interrupt/route-70779af8b4c8259a.js +1 -0
  448. package/.next/static/chunks/app/api/worktrees/[id]/kill-session/route-70779af8b4c8259a.js +1 -0
  449. package/.next/static/chunks/app/api/worktrees/[id]/logs/[filename]/route-70779af8b4c8259a.js +1 -0
  450. package/.next/static/chunks/app/api/worktrees/[id]/logs/route-70779af8b4c8259a.js +1 -0
  451. package/.next/static/chunks/app/api/worktrees/[id]/marp-render/route-70779af8b4c8259a.js +1 -0
  452. package/.next/static/chunks/app/api/worktrees/[id]/memos/[memoId]/route-70779af8b4c8259a.js +1 -0
  453. package/.next/static/chunks/app/api/worktrees/[id]/memos/route-70779af8b4c8259a.js +1 -0
  454. package/.next/static/chunks/app/api/worktrees/[id]/messages/route-70779af8b4c8259a.js +1 -0
  455. package/.next/static/chunks/app/api/worktrees/[id]/opencode/diff/route-70779af8b4c8259a.js +1 -0
  456. package/.next/static/chunks/app/api/worktrees/[id]/opencode/session/route-70779af8b4c8259a.js +1 -0
  457. package/.next/static/chunks/app/api/worktrees/[id]/opencode/share/route-70779af8b4c8259a.js +1 -0
  458. package/.next/static/chunks/app/api/worktrees/[id]/prompt-response/route-70779af8b4c8259a.js +1 -0
  459. package/.next/static/chunks/app/api/worktrees/[id]/resolve-target/route-70779af8b4c8259a.js +1 -0
  460. package/.next/static/chunks/app/api/worktrees/[id]/respond/route-70779af8b4c8259a.js +1 -0
  461. package/.next/static/chunks/app/api/worktrees/[id]/route-70779af8b4c8259a.js +1 -0
  462. package/.next/static/chunks/app/api/worktrees/[id]/schedules/[scheduleId]/route-70779af8b4c8259a.js +1 -0
  463. package/.next/static/chunks/app/api/worktrees/[id]/schedules/active/route-70779af8b4c8259a.js +1 -0
  464. package/.next/static/chunks/app/api/worktrees/[id]/schedules/route-70779af8b4c8259a.js +1 -0
  465. package/.next/static/chunks/app/api/worktrees/[id]/search/route-70779af8b4c8259a.js +1 -0
  466. package/.next/static/chunks/app/api/worktrees/[id]/send/route-70779af8b4c8259a.js +1 -0
  467. package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route-70779af8b4c8259a.js +1 -0
  468. package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/install/route-70779af8b4c8259a.js +1 -0
  469. package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/plan/route-70779af8b4c8259a.js +1 -0
  470. package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/uninstall/route-70779af8b4c8259a.js +1 -0
  471. package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/uninstall-plan/route-70779af8b4c8259a.js +1 -0
  472. package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/update/route-70779af8b4c8259a.js +1 -0
  473. package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/update-plan/route-70779af8b4c8259a.js +1 -0
  474. package/.next/static/chunks/app/api/worktrees/[id]/skills/route-70779af8b4c8259a.js +1 -0
  475. package/.next/static/chunks/app/api/worktrees/[id]/slash-commands/route-70779af8b4c8259a.js +1 -0
  476. package/.next/static/chunks/app/api/worktrees/[id]/special-keys/route-70779af8b4c8259a.js +1 -0
  477. package/.next/static/chunks/app/api/worktrees/[id]/tasks/route-70779af8b4c8259a.js +1 -0
  478. package/.next/static/chunks/app/api/worktrees/[id]/terminal/route-70779af8b4c8259a.js +1 -0
  479. package/.next/static/chunks/app/api/worktrees/[id]/timers/history/route-70779af8b4c8259a.js +1 -0
  480. package/.next/static/chunks/app/api/worktrees/[id]/timers/route-70779af8b4c8259a.js +1 -0
  481. package/.next/static/chunks/app/api/worktrees/[id]/todos/[todoId]/route-70779af8b4c8259a.js +1 -0
  482. package/.next/static/chunks/app/api/worktrees/[id]/todos/route-70779af8b4c8259a.js +1 -0
  483. package/.next/static/chunks/app/api/worktrees/[id]/tree/[...path]/route-70779af8b4c8259a.js +1 -0
  484. package/.next/static/chunks/app/api/worktrees/[id]/tree/route-70779af8b4c8259a.js +1 -0
  485. package/.next/static/chunks/app/api/worktrees/[id]/upload/[...path]/route-70779af8b4c8259a.js +1 -0
  486. package/.next/static/chunks/app/api/worktrees/[id]/verify/config/route-70779af8b4c8259a.js +1 -0
  487. package/.next/static/chunks/app/api/worktrees/[id]/verify/route-70779af8b4c8259a.js +1 -0
  488. package/.next/static/chunks/app/api/worktrees/[id]/verify/runs/[runId]/cancel/route-70779af8b4c8259a.js +1 -0
  489. package/.next/static/chunks/app/api/worktrees/[id]/verify/runs/[runId]/route-70779af8b4c8259a.js +1 -0
  490. package/.next/static/chunks/app/api/worktrees/[id]/verify/runs/route-70779af8b4c8259a.js +1 -0
  491. package/.next/static/chunks/app/api/worktrees/[id]/viewed/route-70779af8b4c8259a.js +1 -0
  492. package/.next/static/chunks/app/api/worktrees/apply-default-agents/route-70779af8b4c8259a.js +1 -0
  493. package/.next/static/chunks/app/api/worktrees/route-70779af8b4c8259a.js +1 -0
  494. package/.next/static/chunks/app/{error-c1dc1038d0a84a33.js → error-d9a7067074e7f460.js} +1 -1
  495. package/.next/static/chunks/app/layout-f43045c9edbc4d1f.js +1 -0
  496. package/.next/static/chunks/app/loading-db675c84e696591f.js +1 -0
  497. package/.next/static/chunks/app/login/{page-af7241bb4c4a8e59.js → page-269a9de3b91a45a2.js} +1 -1
  498. package/.next/static/chunks/app/manifest.webmanifest/route-70779af8b4c8259a.js +1 -0
  499. package/.next/static/chunks/app/more/loading-db675c84e696591f.js +1 -0
  500. package/.next/static/chunks/app/more/page-3963a5e56e550442.js +1 -0
  501. package/.next/static/chunks/app/page-0c1a29ff3609bd8b.js +1 -0
  502. package/.next/static/chunks/app/proxy/[...path]/route-70779af8b4c8259a.js +1 -0
  503. package/.next/static/chunks/app/repositories/loading-db675c84e696591f.js +1 -0
  504. package/.next/static/chunks/app/repositories/page-e9ceeefacf87d470.js +1 -0
  505. package/.next/static/chunks/app/review/loading-db675c84e696591f.js +1 -0
  506. package/.next/static/chunks/app/review/page-3028fe95de490236.js +1 -0
  507. package/.next/static/chunks/app/sessions/loading-db675c84e696591f.js +1 -0
  508. package/.next/static/chunks/app/sessions/page-3f39f99b878fdda0.js +1 -0
  509. package/.next/static/chunks/app/skills/[skillId]/page-6f62668eabb635f5.js +1 -0
  510. package/.next/static/chunks/app/skills/installed/page-c6c4ac5e26c4e73e.js +1 -0
  511. package/.next/static/chunks/app/skills/page-bec1d4924004d4de.js +1 -0
  512. package/.next/static/chunks/app/worktrees/[id]/files/[...path]/{page-f3361237420719b4.js → page-2e98f11956fe1aea.js} +1 -1
  513. package/.next/static/chunks/app/worktrees/[id]/layout-70779af8b4c8259a.js +1 -0
  514. package/.next/static/chunks/app/worktrees/[id]/loading-db675c84e696591f.js +1 -0
  515. package/.next/static/chunks/app/worktrees/[id]/page-0305d80c8ebda4cb.js +1 -0
  516. package/.next/static/chunks/app/worktrees/[id]/terminal/page-373ea37b16d930c7.js +1 -0
  517. package/.next/static/chunks/{webpack-0281b30457d46ebc.js → webpack-9f75198882fdaf08.js} +1 -1
  518. package/.next/static/css/2c63c5531f77719e.css +1 -0
  519. package/.next/trace +13 -14
  520. package/.next/types/app/api/{assistant/start → app/release-notes}/route.ts +3 -3
  521. package/.next/types/routes.d.ts +3 -13
  522. package/.next/types/validator.ts +9 -99
  523. package/dist/cli/commands/wait.d.ts +45 -0
  524. package/dist/cli/commands/wait.d.ts.map +1 -1
  525. package/dist/cli/commands/wait.js +172 -3
  526. package/dist/server/locales/en/worktree.json +22 -5
  527. package/dist/server/locales/ja/worktree.json +22 -5
  528. package/dist/server/src/config/activity-bar-config.js +3 -1
  529. package/dist/server/src/lib/cli-tools/copilot.js +244 -11
  530. package/dist/server/src/lib/db/db.js +3 -32
  531. package/dist/server/src/lib/db/worktree-todo-db.js +1 -2
  532. package/dist/server/src/lib/detection/cli-patterns.js +39 -2
  533. package/dist/server/src/lib/detection/tools/codex/prompt.js +15 -1
  534. package/dist/server/src/lib/hooks/agent-event-types.js +19 -1
  535. package/dist/server/src/lib/hooks/sources/antigravity/hooks-config.js +65 -4
  536. package/dist/server/src/lib/hooks/sources/antigravity/source.js +32 -3
  537. package/dist/server/src/lib/hooks/sources/claude/source.js +5 -0
  538. package/dist/server/src/lib/hooks/sources/codex/source.js +2 -0
  539. package/dist/server/src/lib/hooks/sources/command-code/source.js +2 -0
  540. package/dist/server/src/lib/hooks/sources/copilot/source.js +3 -0
  541. package/dist/server/src/lib/hooks/sources/gemini/source.js +2 -0
  542. package/dist/server/src/lib/hooks/sources/legacy-relay.js +2 -0
  543. package/dist/server/src/lib/hooks/sources/opencode/source.js +2 -0
  544. package/dist/server/src/lib/session/current-output-builder.js +3 -1
  545. package/dist/server/src/lib/session/send-user-message.js +112 -17
  546. package/dist/server/src/lib/verification/verification-reconciler.js +2 -2
  547. package/package.json +3 -2
  548. package/release-notes/0.39.0.json +94 -0
  549. package/.next/server/app/api/assistant/conversation/route.js +0 -1
  550. package/.next/server/app/api/assistant/conversation/route.js.nft.json +0 -1
  551. package/.next/server/app/api/assistant/conversation/route_client-reference-manifest.js +0 -1
  552. package/.next/server/app/api/assistant/current-output/route.js +0 -1
  553. package/.next/server/app/api/assistant/current-output/route.js.nft.json +0 -1
  554. package/.next/server/app/api/assistant/current-output/route_client-reference-manifest.js +0 -1
  555. package/.next/server/app/api/assistant/messages/route.js +0 -1
  556. package/.next/server/app/api/assistant/messages/route.js.nft.json +0 -1
  557. package/.next/server/app/api/assistant/messages/route_client-reference-manifest.js +0 -1
  558. package/.next/server/app/api/assistant/session/route.js +0 -1
  559. package/.next/server/app/api/assistant/session/route.js.nft.json +0 -1
  560. package/.next/server/app/api/assistant/session/route_client-reference-manifest.js +0 -1
  561. package/.next/server/app/api/assistant/start/route.js +0 -32
  562. package/.next/server/app/api/assistant/start/route.js.nft.json +0 -1
  563. package/.next/server/app/api/assistant/start/route_client-reference-manifest.js +0 -1
  564. package/.next/server/app/api/assistant/terminal/route.js +0 -34
  565. package/.next/server/app/api/assistant/terminal/route.js.nft.json +0 -1
  566. package/.next/server/app/api/assistant/terminal/route_client-reference-manifest.js +0 -1
  567. package/.next/server/app/api/assistant/tools/route.js +0 -1
  568. package/.next/server/app/api/assistant/tools/route.js.nft.json +0 -1
  569. package/.next/server/app/api/assistant/tools/route_client-reference-manifest.js +0 -1
  570. package/.next/server/app/api/repositories/[id]/todos/[todoId]/route.js +0 -1
  571. package/.next/server/app/api/repositories/[id]/todos/[todoId]/route.js.nft.json +0 -1
  572. package/.next/server/app/api/repositories/[id]/todos/[todoId]/route_client-reference-manifest.js +0 -1
  573. package/.next/server/app/api/repositories/[id]/todos/route.js +0 -1
  574. package/.next/server/app/api/repositories/[id]/todos/route.js.nft.json +0 -1
  575. package/.next/server/app/api/repositories/[id]/todos/route_client-reference-manifest.js +0 -1
  576. package/.next/server/app/api/todos/route.js +0 -1
  577. package/.next/server/app/api/todos/route.js.nft.json +0 -1
  578. package/.next/server/app/api/todos/route_client-reference-manifest.js +0 -1
  579. package/.next/server/app/chat/page.js +0 -2
  580. package/.next/server/app/chat/page.js.nft.json +0 -1
  581. package/.next/server/app/chat/page_client-reference-manifest.js +0 -1
  582. package/.next/server/chunks/1366.js +0 -15
  583. package/.next/server/chunks/1467.js +0 -48
  584. package/.next/server/chunks/180.js +0 -1
  585. package/.next/server/chunks/3123.js +0 -1
  586. package/.next/server/chunks/3708.js +0 -1
  587. package/.next/server/chunks/5364.js +0 -1
  588. package/.next/server/chunks/6015.js +0 -1
  589. package/.next/server/chunks/8118.js +0 -1
  590. package/.next/server/chunks/8554.js +0 -1
  591. package/.next/server/chunks/9123.js +0 -13
  592. package/.next/static/chunks/3160-79d24ca264a528b9.js +0 -1
  593. package/.next/static/chunks/4322-59a7dbd77a7763cc.js +0 -1
  594. package/.next/static/chunks/4388-a778968d9c4e9327.js +0 -1
  595. package/.next/static/chunks/4718-56ebb6e55073ed5e.js +0 -1
  596. package/.next/static/chunks/4949-7dbce1029c6bdbb9.js +0 -1
  597. package/.next/static/chunks/5520-8bde9501846ae660.js +0 -1
  598. package/.next/static/chunks/5694-498765336d0b8c2b.js +0 -1
  599. package/.next/static/chunks/6402-d91e099c3f2d78f4.js +0 -1
  600. package/.next/static/chunks/6983-3ed2099251793bdf.js +0 -1
  601. package/.next/static/chunks/790-d8e6acd26e03679c.js +0 -1
  602. package/.next/static/chunks/8019-cbf130d0e6334d2d.js +0 -1
  603. package/.next/static/chunks/934-a37509667baa86ee.js +0 -1
  604. package/.next/static/chunks/9948-d139e3e5dbecaf73.js +0 -1
  605. package/.next/static/chunks/app/api/agents/update/route-c4d2d5016c5f2a0a.js +0 -1
  606. package/.next/static/chunks/app/api/agents/versions/route-c4d2d5016c5f2a0a.js +0 -1
  607. package/.next/static/chunks/app/api/app/update/route-c4d2d5016c5f2a0a.js +0 -1
  608. package/.next/static/chunks/app/api/app/update-check/route-c4d2d5016c5f2a0a.js +0 -1
  609. package/.next/static/chunks/app/api/assistant/conversation/route-c4d2d5016c5f2a0a.js +0 -1
  610. package/.next/static/chunks/app/api/assistant/current-output/route-c4d2d5016c5f2a0a.js +0 -1
  611. package/.next/static/chunks/app/api/assistant/messages/route-c4d2d5016c5f2a0a.js +0 -1
  612. package/.next/static/chunks/app/api/assistant/session/route-c4d2d5016c5f2a0a.js +0 -1
  613. package/.next/static/chunks/app/api/assistant/start/route-c4d2d5016c5f2a0a.js +0 -1
  614. package/.next/static/chunks/app/api/assistant/terminal/route-c4d2d5016c5f2a0a.js +0 -1
  615. package/.next/static/chunks/app/api/assistant/tools/route-c4d2d5016c5f2a0a.js +0 -1
  616. package/.next/static/chunks/app/api/auth/login/route-c4d2d5016c5f2a0a.js +0 -1
  617. package/.next/static/chunks/app/api/auth/logout/route-c4d2d5016c5f2a0a.js +0 -1
  618. package/.next/static/chunks/app/api/auth/status/route-c4d2d5016c5f2a0a.js +0 -1
  619. package/.next/static/chunks/app/api/capabilities/route-c4d2d5016c5f2a0a.js +0 -1
  620. package/.next/static/chunks/app/api/daily-summary/route-c4d2d5016c5f2a0a.js +0 -1
  621. package/.next/static/chunks/app/api/daily-summary/status/route-c4d2d5016c5f2a0a.js +0 -1
  622. package/.next/static/chunks/app/api/external-apps/[id]/health/route-c4d2d5016c5f2a0a.js +0 -1
  623. package/.next/static/chunks/app/api/external-apps/[id]/route-c4d2d5016c5f2a0a.js +0 -1
  624. package/.next/static/chunks/app/api/external-apps/route-c4d2d5016c5f2a0a.js +0 -1
  625. package/.next/static/chunks/app/api/fs/browse/route-c4d2d5016c5f2a0a.js +0 -1
  626. package/.next/static/chunks/app/api/fs/recent-paths/route-c4d2d5016c5f2a0a.js +0 -1
  627. package/.next/static/chunks/app/api/hooks/agent-event/route-c4d2d5016c5f2a0a.js +0 -1
  628. package/.next/static/chunks/app/api/hooks/claude-done/route-c4d2d5016c5f2a0a.js +0 -1
  629. package/.next/static/chunks/app/api/hooks/permission-request/route-c4d2d5016c5f2a0a.js +0 -1
  630. package/.next/static/chunks/app/api/metrics/vibe/route-c4d2d5016c5f2a0a.js +0 -1
  631. package/.next/static/chunks/app/api/ollama/models/route-c4d2d5016c5f2a0a.js +0 -1
  632. package/.next/static/chunks/app/api/push/escalation/route-c4d2d5016c5f2a0a.js +0 -1
  633. package/.next/static/chunks/app/api/push/subscriptions/route-c4d2d5016c5f2a0a.js +0 -1
  634. package/.next/static/chunks/app/api/push/vapid/route-c4d2d5016c5f2a0a.js +0 -1
  635. package/.next/static/chunks/app/api/relays/[relayId]/cancel/route-c4d2d5016c5f2a0a.js +0 -1
  636. package/.next/static/chunks/app/api/relays/route-c4d2d5016c5f2a0a.js +0 -1
  637. package/.next/static/chunks/app/api/remote/pair/route-c4d2d5016c5f2a0a.js +0 -1
  638. package/.next/static/chunks/app/api/repositories/[id]/route-c4d2d5016c5f2a0a.js +0 -1
  639. package/.next/static/chunks/app/api/repositories/[id]/todos/[todoId]/route-c4d2d5016c5f2a0a.js +0 -1
  640. package/.next/static/chunks/app/api/repositories/[id]/todos/route-c4d2d5016c5f2a0a.js +0 -1
  641. package/.next/static/chunks/app/api/repositories/clone/[jobId]/route-c4d2d5016c5f2a0a.js +0 -1
  642. package/.next/static/chunks/app/api/repositories/clone/route-c4d2d5016c5f2a0a.js +0 -1
  643. package/.next/static/chunks/app/api/repositories/excluded/route-c4d2d5016c5f2a0a.js +0 -1
  644. package/.next/static/chunks/app/api/repositories/restore/route-c4d2d5016c5f2a0a.js +0 -1
  645. package/.next/static/chunks/app/api/repositories/route-c4d2d5016c5f2a0a.js +0 -1
  646. package/.next/static/chunks/app/api/repositories/scan/route-c4d2d5016c5f2a0a.js +0 -1
  647. package/.next/static/chunks/app/api/repositories/sync/route-c4d2d5016c5f2a0a.js +0 -1
  648. package/.next/static/chunks/app/api/repositories/validate-path/route-c4d2d5016c5f2a0a.js +0 -1
  649. package/.next/static/chunks/app/api/settings/default-agents/route-c4d2d5016c5f2a0a.js +0 -1
  650. package/.next/static/chunks/app/api/settings/default-surface-mode/route-c4d2d5016c5f2a0a.js +0 -1
  651. package/.next/static/chunks/app/api/sidebar/group-order/route-c4d2d5016c5f2a0a.js +0 -1
  652. package/.next/static/chunks/app/api/skills/[id]/route-c4d2d5016c5f2a0a.js +0 -1
  653. package/.next/static/chunks/app/api/skills/installations/route-c4d2d5016c5f2a0a.js +0 -1
  654. package/.next/static/chunks/app/api/skills/operations/route-c4d2d5016c5f2a0a.js +0 -1
  655. package/.next/static/chunks/app/api/skills/reindex/route-c4d2d5016c5f2a0a.js +0 -1
  656. package/.next/static/chunks/app/api/skills/route-c4d2d5016c5f2a0a.js +0 -1
  657. package/.next/static/chunks/app/api/slash-commands/route-c4d2d5016c5f2a0a.js +0 -1
  658. package/.next/static/chunks/app/api/tasks/[taskId]/cancel/route-c4d2d5016c5f2a0a.js +0 -1
  659. package/.next/static/chunks/app/api/tasks/[taskId]/route-c4d2d5016c5f2a0a.js +0 -1
  660. package/.next/static/chunks/app/api/templates/[id]/route-c4d2d5016c5f2a0a.js +0 -1
  661. package/.next/static/chunks/app/api/templates/route-c4d2d5016c5f2a0a.js +0 -1
  662. package/.next/static/chunks/app/api/todos/route-c4d2d5016c5f2a0a.js +0 -1
  663. package/.next/static/chunks/app/api/verification/runs/[runId]/route-c4d2d5016c5f2a0a.js +0 -1
  664. package/.next/static/chunks/app/api/verification/runs/route-c4d2d5016c5f2a0a.js +0 -1
  665. package/.next/static/chunks/app/api/worktrees/[id]/auto-yes/route-c4d2d5016c5f2a0a.js +0 -1
  666. package/.next/static/chunks/app/api/worktrees/[id]/capture/route-c4d2d5016c5f2a0a.js +0 -1
  667. package/.next/static/chunks/app/api/worktrees/[id]/clear-composer/route-c4d2d5016c5f2a0a.js +0 -1
  668. package/.next/static/chunks/app/api/worktrees/[id]/cli-reference/route-c4d2d5016c5f2a0a.js +0 -1
  669. package/.next/static/chunks/app/api/worktrees/[id]/cli-tool/route-c4d2d5016c5f2a0a.js +0 -1
  670. package/.next/static/chunks/app/api/worktrees/[id]/cmate/schedules/route-c4d2d5016c5f2a0a.js +0 -1
  671. package/.next/static/chunks/app/api/worktrees/[id]/current-output/route-c4d2d5016c5f2a0a.js +0 -1
  672. package/.next/static/chunks/app/api/worktrees/[id]/env/route-c4d2d5016c5f2a0a.js +0 -1
  673. package/.next/static/chunks/app/api/worktrees/[id]/execution-logs/[logId]/route-c4d2d5016c5f2a0a.js +0 -1
  674. package/.next/static/chunks/app/api/worktrees/[id]/execution-logs/route-c4d2d5016c5f2a0a.js +0 -1
  675. package/.next/static/chunks/app/api/worktrees/[id]/files/[...path]/route-c4d2d5016c5f2a0a.js +0 -1
  676. package/.next/static/chunks/app/api/worktrees/[id]/git/branch/create/route-c4d2d5016c5f2a0a.js +0 -1
  677. package/.next/static/chunks/app/api/worktrees/[id]/git/branch/delete/route-c4d2d5016c5f2a0a.js +0 -1
  678. package/.next/static/chunks/app/api/worktrees/[id]/git/branches/route-c4d2d5016c5f2a0a.js +0 -1
  679. package/.next/static/chunks/app/api/worktrees/[id]/git/checkout/route-c4d2d5016c5f2a0a.js +0 -1
  680. package/.next/static/chunks/app/api/worktrees/[id]/git/commit/route-c4d2d5016c5f2a0a.js +0 -1
  681. package/.next/static/chunks/app/api/worktrees/[id]/git/diff/route-c4d2d5016c5f2a0a.js +0 -1
  682. package/.next/static/chunks/app/api/worktrees/[id]/git/fetch/route-c4d2d5016c5f2a0a.js +0 -1
  683. package/.next/static/chunks/app/api/worktrees/[id]/git/log/route-c4d2d5016c5f2a0a.js +0 -1
  684. package/.next/static/chunks/app/api/worktrees/[id]/git/pull/route-c4d2d5016c5f2a0a.js +0 -1
  685. package/.next/static/chunks/app/api/worktrees/[id]/git/push/route-c4d2d5016c5f2a0a.js +0 -1
  686. package/.next/static/chunks/app/api/worktrees/[id]/git/reset/route-c4d2d5016c5f2a0a.js +0 -1
  687. package/.next/static/chunks/app/api/worktrees/[id]/git/revert/route-c4d2d5016c5f2a0a.js +0 -1
  688. package/.next/static/chunks/app/api/worktrees/[id]/git/show/[commitHash]/route-c4d2d5016c5f2a0a.js +0 -1
  689. package/.next/static/chunks/app/api/worktrees/[id]/git/stage/route-c4d2d5016c5f2a0a.js +0 -1
  690. package/.next/static/chunks/app/api/worktrees/[id]/git/staged/route-c4d2d5016c5f2a0a.js +0 -1
  691. package/.next/static/chunks/app/api/worktrees/[id]/git/stash/[index]/route-c4d2d5016c5f2a0a.js +0 -1
  692. package/.next/static/chunks/app/api/worktrees/[id]/git/stash/apply/route-c4d2d5016c5f2a0a.js +0 -1
  693. package/.next/static/chunks/app/api/worktrees/[id]/git/stash/pop/route-c4d2d5016c5f2a0a.js +0 -1
  694. package/.next/static/chunks/app/api/worktrees/[id]/git/stash/push/route-c4d2d5016c5f2a0a.js +0 -1
  695. package/.next/static/chunks/app/api/worktrees/[id]/git/stash/route-c4d2d5016c5f2a0a.js +0 -1
  696. package/.next/static/chunks/app/api/worktrees/[id]/git/status/route-c4d2d5016c5f2a0a.js +0 -1
  697. package/.next/static/chunks/app/api/worktrees/[id]/git/unstage/route-c4d2d5016c5f2a0a.js +0 -1
  698. package/.next/static/chunks/app/api/worktrees/[id]/git/working-diff/route-c4d2d5016c5f2a0a.js +0 -1
  699. package/.next/static/chunks/app/api/worktrees/[id]/instances/notes/route-c4d2d5016c5f2a0a.js +0 -1
  700. package/.next/static/chunks/app/api/worktrees/[id]/instances/opencode/route-c4d2d5016c5f2a0a.js +0 -1
  701. package/.next/static/chunks/app/api/worktrees/[id]/interrupt/route-c4d2d5016c5f2a0a.js +0 -1
  702. package/.next/static/chunks/app/api/worktrees/[id]/kill-session/route-c4d2d5016c5f2a0a.js +0 -1
  703. package/.next/static/chunks/app/api/worktrees/[id]/logs/[filename]/route-c4d2d5016c5f2a0a.js +0 -1
  704. package/.next/static/chunks/app/api/worktrees/[id]/logs/route-c4d2d5016c5f2a0a.js +0 -1
  705. package/.next/static/chunks/app/api/worktrees/[id]/marp-render/route-c4d2d5016c5f2a0a.js +0 -1
  706. package/.next/static/chunks/app/api/worktrees/[id]/memos/[memoId]/route-c4d2d5016c5f2a0a.js +0 -1
  707. package/.next/static/chunks/app/api/worktrees/[id]/memos/route-c4d2d5016c5f2a0a.js +0 -1
  708. package/.next/static/chunks/app/api/worktrees/[id]/messages/route-c4d2d5016c5f2a0a.js +0 -1
  709. package/.next/static/chunks/app/api/worktrees/[id]/opencode/diff/route-c4d2d5016c5f2a0a.js +0 -1
  710. package/.next/static/chunks/app/api/worktrees/[id]/opencode/session/route-c4d2d5016c5f2a0a.js +0 -1
  711. package/.next/static/chunks/app/api/worktrees/[id]/opencode/share/route-c4d2d5016c5f2a0a.js +0 -1
  712. package/.next/static/chunks/app/api/worktrees/[id]/prompt-response/route-c4d2d5016c5f2a0a.js +0 -1
  713. package/.next/static/chunks/app/api/worktrees/[id]/resolve-target/route-c4d2d5016c5f2a0a.js +0 -1
  714. package/.next/static/chunks/app/api/worktrees/[id]/respond/route-c4d2d5016c5f2a0a.js +0 -1
  715. package/.next/static/chunks/app/api/worktrees/[id]/route-c4d2d5016c5f2a0a.js +0 -1
  716. package/.next/static/chunks/app/api/worktrees/[id]/schedules/[scheduleId]/route-c4d2d5016c5f2a0a.js +0 -1
  717. package/.next/static/chunks/app/api/worktrees/[id]/schedules/active/route-c4d2d5016c5f2a0a.js +0 -1
  718. package/.next/static/chunks/app/api/worktrees/[id]/schedules/route-c4d2d5016c5f2a0a.js +0 -1
  719. package/.next/static/chunks/app/api/worktrees/[id]/search/route-c4d2d5016c5f2a0a.js +0 -1
  720. package/.next/static/chunks/app/api/worktrees/[id]/send/route-c4d2d5016c5f2a0a.js +0 -1
  721. package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route-c4d2d5016c5f2a0a.js +0 -1
  722. package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/install/route-c4d2d5016c5f2a0a.js +0 -1
  723. package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/plan/route-c4d2d5016c5f2a0a.js +0 -1
  724. package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/uninstall/route-c4d2d5016c5f2a0a.js +0 -1
  725. package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/uninstall-plan/route-c4d2d5016c5f2a0a.js +0 -1
  726. package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/update/route-c4d2d5016c5f2a0a.js +0 -1
  727. package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/update-plan/route-c4d2d5016c5f2a0a.js +0 -1
  728. package/.next/static/chunks/app/api/worktrees/[id]/skills/route-c4d2d5016c5f2a0a.js +0 -1
  729. package/.next/static/chunks/app/api/worktrees/[id]/slash-commands/route-c4d2d5016c5f2a0a.js +0 -1
  730. package/.next/static/chunks/app/api/worktrees/[id]/special-keys/route-c4d2d5016c5f2a0a.js +0 -1
  731. package/.next/static/chunks/app/api/worktrees/[id]/tasks/route-c4d2d5016c5f2a0a.js +0 -1
  732. package/.next/static/chunks/app/api/worktrees/[id]/terminal/route-c4d2d5016c5f2a0a.js +0 -1
  733. package/.next/static/chunks/app/api/worktrees/[id]/timers/history/route-c4d2d5016c5f2a0a.js +0 -1
  734. package/.next/static/chunks/app/api/worktrees/[id]/timers/route-c4d2d5016c5f2a0a.js +0 -1
  735. package/.next/static/chunks/app/api/worktrees/[id]/todos/[todoId]/route-c4d2d5016c5f2a0a.js +0 -1
  736. package/.next/static/chunks/app/api/worktrees/[id]/todos/route-c4d2d5016c5f2a0a.js +0 -1
  737. package/.next/static/chunks/app/api/worktrees/[id]/tree/[...path]/route-c4d2d5016c5f2a0a.js +0 -1
  738. package/.next/static/chunks/app/api/worktrees/[id]/tree/route-c4d2d5016c5f2a0a.js +0 -1
  739. package/.next/static/chunks/app/api/worktrees/[id]/upload/[...path]/route-c4d2d5016c5f2a0a.js +0 -1
  740. package/.next/static/chunks/app/api/worktrees/[id]/verify/config/route-c4d2d5016c5f2a0a.js +0 -1
  741. package/.next/static/chunks/app/api/worktrees/[id]/verify/route-c4d2d5016c5f2a0a.js +0 -1
  742. package/.next/static/chunks/app/api/worktrees/[id]/verify/runs/[runId]/cancel/route-c4d2d5016c5f2a0a.js +0 -1
  743. package/.next/static/chunks/app/api/worktrees/[id]/verify/runs/[runId]/route-c4d2d5016c5f2a0a.js +0 -1
  744. package/.next/static/chunks/app/api/worktrees/[id]/verify/runs/route-c4d2d5016c5f2a0a.js +0 -1
  745. package/.next/static/chunks/app/api/worktrees/[id]/viewed/route-c4d2d5016c5f2a0a.js +0 -1
  746. package/.next/static/chunks/app/api/worktrees/apply-default-agents/route-c4d2d5016c5f2a0a.js +0 -1
  747. package/.next/static/chunks/app/api/worktrees/route-c4d2d5016c5f2a0a.js +0 -1
  748. package/.next/static/chunks/app/chat/loading-c58ba2c3f4363277.js +0 -1
  749. package/.next/static/chunks/app/chat/page-bfc1f5bb17bd771d.js +0 -1
  750. package/.next/static/chunks/app/layout-114dc6e93e332392.js +0 -1
  751. package/.next/static/chunks/app/loading-c58ba2c3f4363277.js +0 -1
  752. package/.next/static/chunks/app/manifest.webmanifest/route-c4d2d5016c5f2a0a.js +0 -1
  753. package/.next/static/chunks/app/more/loading-c58ba2c3f4363277.js +0 -1
  754. package/.next/static/chunks/app/more/page-400ffa825f8f150e.js +0 -1
  755. package/.next/static/chunks/app/page-a4f03c188610c6c8.js +0 -1
  756. package/.next/static/chunks/app/proxy/[...path]/route-c4d2d5016c5f2a0a.js +0 -1
  757. package/.next/static/chunks/app/repositories/loading-c58ba2c3f4363277.js +0 -1
  758. package/.next/static/chunks/app/repositories/page-a15efb4ce1d1721e.js +0 -1
  759. package/.next/static/chunks/app/review/loading-c58ba2c3f4363277.js +0 -1
  760. package/.next/static/chunks/app/review/page-90ac618489676cbc.js +0 -1
  761. package/.next/static/chunks/app/sessions/loading-c58ba2c3f4363277.js +0 -1
  762. package/.next/static/chunks/app/sessions/page-b8651c3f17c36800.js +0 -1
  763. package/.next/static/chunks/app/skills/[skillId]/page-ce8f6fd9e4356580.js +0 -1
  764. package/.next/static/chunks/app/skills/installed/page-566dfde26d7e63ba.js +0 -1
  765. package/.next/static/chunks/app/skills/page-7859540e8092aace.js +0 -1
  766. package/.next/static/chunks/app/worktrees/[id]/layout-c4d2d5016c5f2a0a.js +0 -1
  767. package/.next/static/chunks/app/worktrees/[id]/loading-c58ba2c3f4363277.js +0 -1
  768. package/.next/static/chunks/app/worktrees/[id]/page-86ef4510c70adefc.js +0 -1
  769. package/.next/static/chunks/app/worktrees/[id]/terminal/page-2631bc5c4b0a9fb8.js +0 -1
  770. package/.next/static/css/c511ecdf1e7f18a0.css +0 -1
  771. package/.next/static/rM1BO5QIz3tynGdyJy0T-/_buildManifest.js +0 -1
  772. package/.next/types/app/api/assistant/conversation/route.ts +0 -347
  773. package/.next/types/app/api/assistant/current-output/route.ts +0 -347
  774. package/.next/types/app/api/assistant/messages/route.ts +0 -347
  775. package/.next/types/app/api/assistant/session/route.ts +0 -347
  776. package/.next/types/app/api/assistant/terminal/route.ts +0 -347
  777. package/.next/types/app/api/assistant/tools/route.ts +0 -347
  778. package/.next/types/app/api/repositories/[id]/todos/[todoId]/route.ts +0 -347
  779. package/.next/types/app/api/repositories/[id]/todos/route.ts +0 -347
  780. package/.next/types/app/api/todos/route.ts +0 -347
  781. package/.next/types/app/chat/page.ts +0 -84
  782. package/dist/server/src/lib/db/assistant-conversation-db.js +0 -428
  783. package/dist/server/src/lib/db/todo-db.js +0 -150
  784. package/dist/server/src/types/assistant.js +0 -5
  785. /package/.next/static/{rM1BO5QIz3tynGdyJy0T- → CqFH31RhKQbrRZXsMNosJ}/_ssgManifest.js +0 -0
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4949],{308:(e,t,n)=>{n.d(t,{Md:()=>c});var r=n(12115),a=n(60199),s=n(52703),l=n(67149);l.tC.pollMs,l.tC.wsFallbackMs;let i="claude";function o(e,t,n){let r=e.findIndex(e=>e.id===t.id),a=[...e];r>=0?a[r]=t:a.push(t);var s=[...a].sort((e,t)=>e.timestamp.getTime()-t.timestamp.getTime());if(void 0===n||n<1)return s;let l=s.filter(e=>"user"===e.role).map(e=>e.timestamp.getTime()).sort((e,t)=>t-e);if(l.length<=n)return s;let i=l[n-1];return s.filter(e=>e.timestamp.getTime()>=i)}function c(e){let{worktreeId:t,cliToolId:n,instanceId:c,limit:u,includeArchived:d=!1,enabled:m=!0,cadence:f=l.tC}=e,[p,h]=(0,r.useState)([]),[g,x]=(0,r.useState)(!0),{connected:b,subscribe:v,unsubscribe:y,addListener:k}=(0,a.xM)(),w=null!=c?c:n,j=(0,r.useRef)(0),N=(0,r.useRef)(n);N.current=n;let C=(0,r.useRef)(w);C.current=w;let S=(0,r.useRef)(u);S.current=u;let T=(0,r.useRef)(d);T.current=d;let I=(0,r.useRef)(new Map),M=(0,r.useRef)(!1);(0,r.useEffect)(()=>(M.current=!0,()=>{M.current=!1}),[]);let E=(0,r.useCallback)(async()=>{let e=++j.current,r=new Map;I.current=r;let a=()=>!M.current||j.current!==e||N.current!==n||C.current!==w;try{let e=new URLSearchParams({cliTool:n,instance:w,unit:"pairs"});void 0!==u&&e.set("limit",String(u)),d&&e.set("includeArchived","true");let s=await fetch("/api/worktrees/".concat(t,"/messages?").concat(e.toString()));if(!s.ok)return;let l=await s.json();if(a())return;let i=l.map(e=>({...e,timestamp:new Date(e.timestamp)}));for(let e of r.values())i=o(i,e,u);I.current===r&&(I.current=new Map),h(i),x(!1)}catch(e){if(a())return;console.error("[useSplitMessages] fetch error:",e),x(!1)}},[t,n,w,u,d]),A="".concat(t,"::").concat(n,"::").concat(w),L=(0,r.useRef)(A);return(0,r.useEffect)(()=>{L.current!==A&&(L.current=A,j.current+=1,I.current=new Map,h([]),x(!0))},[A]),(0,r.useEffect)(()=>{if(!m)return;let e=!1,t=setInterval(()=>{"hidden"!==document.visibilityState&&E()},(0,l.z1)(f,{connected:b}));"undefined"!=typeof document&&"hidden"!==document.visibilityState&&E();let n=()=>{"visible"!==document.visibilityState||e||E()};return document.addEventListener("visibilitychange",n),()=>{e=!0,clearInterval(t),document.removeEventListener("visibilitychange",n)}},[m,f,b,E]),(0,r.useEffect)(()=>{if(m)return v(t),()=>y(t)},[m,t,v,y]),(0,r.useEffect)(()=>{if(m)return k(e=>{var n,r,a,l;if("message"===e.type||"message_updated"===e.type){if(e.worktreeId!==t)return;let a=e.message;if(!a||"string"!=typeof a.id)return;let s=null!=(n=a.cliToolId)?n:i,l=null!=(r=a.instanceId)?r:s;if(s!==N.current||l!==C.current||!a.content||""===a.content.trim()||a.archived&&!T.current)return;let c={...a,timestamp:new Date(a.timestamp),cliToolId:s,instanceId:l};I.current.set(c.id,c),h(e=>o(e,c,S.current));return}if(e.type===s.dz){if(e.worktreeId!==t)return;let n=null!=(a=e.cliToolId)?a:i,r=null!=(l=e.instanceId)?l:n;if(n!==N.current||r!==C.current)return;E();return}if("session_status_changed"===e.type)e.worktreeId===t&&!1===e.isRunning&&(null==e.instance||e.instance===C.current)&&(null==e.cliTool||e.cliTool===N.current)&&E()})},[m,t,k,E]),{messages:p,isLoading:g,refresh:(0,r.useCallback)(()=>E(),[E])}}},813:(e,t,n)=>{n.d(t,{D:()=>r});function r(e,t,n){let r=new TextEncoder;if(r.encode(e).length<=t)return e;let a=t-r.encode(n).length,s=0,l="";for(let t of e){let e=r.encode(t).length;if(s+e>a)break;s+=e,l+=t}return"".concat(l).concat(n)}},2954:(e,t,n)=>{n.d(t,{T:()=>m});var r=n(95155),a=n(12115),s=n(18955),l=n(91758),i=n(94465),o=n(76351);function c(e){let{isOpen:t,onConfirm:n,onCancel:l,cliToolName:c}=e,u=(0,s.c)("autoYes"),d=(0,s.c)("common"),[m,f]=(0,a.useState)(o.t6),[p,h]=(0,a.useState)(""),[g,x]=(0,a.useState)(null),[b,v]=(0,a.useState)(!1),y=(0,a.useRef)(null),k=e=>u(o.Ni[e].replace("autoYes.",""));return(0,a.useEffect)(()=>{t&&(h(""),x(null),v(!1))},[t]),(0,a.useEffect)(()=>{if(!b)return;let e=e=>{y.current&&!y.current.contains(e.target)&&v(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[b]),(0,a.useEffect)(()=>{if(!p.trim())return void x(null);let e=(0,o.P0)(p.trim());if(e.valid)x(null);else{var t;x(null!=(t=e.error)?t:u("invalidRegexPattern"))}},[p,u]),(0,r.jsx)(i.a,{isOpen:t,onClose:l,title:c?u("enableTitleWithTool",{toolName:c}):u("enableTitle"),size:"sm",showCloseButton:!0,children:(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)("div",{className:"text-sm text-foreground",children:[(0,r.jsx)("p",{className:"font-medium mb-2",children:u("featureDescription")}),(0,r.jsxs)("ul",{className:"list-disc list-inside space-y-1",children:[(0,r.jsx)("li",{children:u("yesNoAutoResponse")}),(0,r.jsx)("li",{children:u("multipleChoiceAutoSelect")})]}),(0,r.jsx)("p",{className:"mt-1",children:u("autoDisableAfter",{duration:k(m)})}),c&&(0,r.jsx)("p",{className:"mt-2 text-muted-foreground",children:u("appliesOnlyToCurrent",{toolName:c})})]}),(0,r.jsxs)("div",{className:"text-sm text-foreground",children:[(0,r.jsx)("p",{className:"font-medium mb-2",children:u("duration")}),(0,r.jsx)("div",{className:"flex gap-2",children:o.z9.map(e=>(0,r.jsx)("button",{type:"button",onClick:()=>f(e),className:"flex-1 py-2 px-3 text-sm font-medium rounded-md border-2 transition-colors ".concat(m===e?"border-accent-600 bg-accent-50 dark:bg-accent-900/30 text-accent-700 dark:text-accent-400":"border-border bg-surface dark:bg-surface-2 text-foreground hover:border-muted-foreground"),style:{minHeight:"44px"},children:k(e)},e))})]}),(0,r.jsxs)("div",{className:"text-sm text-foreground",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5 mb-1",children:[(0,r.jsx)("label",{htmlFor:"stop-pattern-input",className:"font-medium",children:u("stopPatternLabel")}),(0,r.jsxs)("div",{className:"relative",ref:y,children:[(0,r.jsx)("button",{type:"button",onClick:()=>v(!b),className:"inline-flex items-center justify-center w-4 h-4 rounded-full bg-muted text-muted-foreground text-[10px] font-bold hover:bg-muted/80 focus:outline-none","aria-label":u("regexTipsLabel"),"data-testid":"regex-tips-button",children:"?"}),b&&(0,r.jsxs)("div",{className:"absolute left-0 top-6 z-50 w-72 rounded-md border border-border bg-surface p-3 shadow-lg text-xs text-foreground","data-testid":"regex-tips-tooltip",children:[(0,r.jsx)("p",{className:"font-medium mb-1.5",children:u("regexTipsTitle")}),(0,r.jsxs)("ul",{className:"space-y-1",children:[(0,r.jsxs)("li",{children:[(0,r.jsx)("code",{className:"bg-muted px-1 rounded",children:"\\bcat\\b"})," ",u("regexTipWordBoundary")]}),(0,r.jsxs)("li",{children:[(0,r.jsx)("code",{className:"bg-muted px-1 rounded",children:"error|fatal"})," ",u("regexTipOr")]}),(0,r.jsxs)("li",{children:[(0,r.jsx)("code",{className:"bg-muted px-1 rounded",children:"(?i)error"})," ",u("regexTipCaseNote")]})]})]})]})]}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground mb-2",children:u("stopPatternDescription")}),(0,r.jsx)("input",{id:"stop-pattern-input",type:"text",value:p,onChange:e=>h(e.target.value),placeholder:u("stopPatternPlaceholder"),className:"w-full px-3 py-2 border rounded-md text-sm font-mono bg-surface dark:bg-surface-2 text-foreground ".concat(g?"border-danger focus:ring-danger focus:border-danger":"border-input focus:ring-ring focus:border-accent-500"," focus:outline-none focus:ring-1"),"data-testid":"stop-pattern-input"}),g&&(0,r.jsx)("p",{className:"mt-1 text-xs text-danger","data-testid":"stop-pattern-error",children:g})]}),(0,r.jsxs)("div",{className:"text-sm text-foreground",children:[(0,r.jsx)("p",{className:"font-medium mb-2",children:u("aboutRisks")}),(0,r.jsx)("p",{children:u("riskWarning")})]}),(0,r.jsx)("div",{className:"bg-warning-subtle border-l-4 border-warning p-3",children:(0,r.jsxs)("p",{className:"text-sm text-warning-foreground",children:[(0,r.jsx)("span",{className:"font-medium",children:u("disclaimer")}),u("disclaimerText")]})}),(0,r.jsxs)("div",{className:"flex justify-end gap-3 pt-2",children:[(0,r.jsx)("button",{type:"button",onClick:l,className:"px-4 py-2 text-sm font-medium rounded-md bg-muted hover:bg-muted/80 text-foreground",children:d("cancel")}),(0,r.jsx)("button",{type:"button",onClick:()=>{n(m,p.trim()||void 0)},disabled:!!g,className:"px-4 py-2 text-sm font-medium rounded-md text-white ".concat(g?"bg-muted-foreground cursor-not-allowed":"bg-warning hover:bg-warning/90"),"data-testid":"confirm-button",children:u("agreeAndEnable")})]})]})})}var u=n(9900),d=n(54014);let m=(0,a.memo)(function(e){let{enabled:t,expiresAt:n,onToggle:i,lastAutoResponse:m,cliToolName:f,inline:p=!1,showToolName:h=!0,onExpire:g}=e,x=(0,s.c)("autoYes"),[b,v]=(0,a.useState)(""),[y,k]=(0,a.useState)(null),[w,j]=(0,a.useState)(!1),[N,C]=(0,a.useState)(!1),[S,T]=(0,a.useState)(!1);(0,a.useEffect)(()=>{if(!t||!n){v(""),T(!1);return}T(!1);let e=!1,r=()=>(v((0,o.$B)(n)),n-Date.now()<=0&&!e&&(e=!0,T(!0),null==g||g(),!0));if(r())return;let a=setInterval(()=>{r()&&clearInterval(a)},o.$s);return()=>clearInterval(a)},[t,n,g]),(0,a.useEffect)(()=>{if(!m)return;k('Auto responded: "'.concat(m,'"'));let e=setTimeout(()=>k(null),u.I2);return()=>clearTimeout(e)},[m]);let I=t&&!S,M=(0,a.useCallback)(()=>{I?(j(!0),i({enabled:!1}).finally(()=>j(!1))):C(!0)},[I,i]),E=(0,a.useCallback)((e,t)=>{C(!1),j(!0),i({enabled:!0,duration:e,stopPattern:t}).finally(()=>j(!1))},[i]),A=(0,a.useCallback)(()=>{C(!1)},[]);return(0,r.jsxs)("div",{className:p?"flex items-center gap-2":"flex items-center gap-3 px-4 py-2 bg-surface-2 border-b border-border",children:[(0,r.jsx)(l.d,{checked:I,onCheckedChange:M,disabled:w,"aria-label":x("toggleLabel")}),(0,r.jsx)("span",{className:"text-sm font-medium text-foreground",children:x("label")}),h&&f&&(0,r.jsxs)("span",{className:"text-xs text-accent-600 dark:text-accent-400 font-medium","aria-label":x("targetLabel"),children:["(",(0,d.f_)(f,""),")"]}),I&&b&&(0,r.jsx)("span",{className:"text-sm text-muted-foreground","aria-label":x("timeRemaining"),children:b}),y&&(0,r.jsx)("span",{className:"text-sm text-success animate-pulse",children:y}),(0,r.jsx)(c,{isOpen:N,onConfirm:E,onCancel:A,cliToolName:(0,d.f_)(f,"")})]})})},4300:(e,t,n)=>{n.d(t,{QN:()=>u,Qu:()=>c,bx:()=>i});let r="claude-turn:",a="antigravity-turn:",s="command-code-turn:",l=["oc-turn:",r,"codex-turn:",a,s];function i(e){return"string"==typeof e&&l.some(t=>e.startsWith(t))}let o=[[r,"claude-prompt:"],[a,"antigravity-prompt:"],[s,"command-code-prompt:"]];function c(e){if("string"!=typeof e)return null;for(let t of l)if(e.startsWith(t))return 0===e.slice(t.length).trim().length?null:e;return null}function u(e){for(let[t,n]of o){if(!e.startsWith(t))continue;let r=e.slice(t.length);return 0===r.trim().length?null:"".concat(n).concat(r)}return null}},9708:(e,t,n)=>{n.d(t,{O:()=>i,k:()=>l});var r=n(12115);let a=Object.freeze({}),s=(0,r.createContext)(a),l=s.Provider;function i(){return(0,r.useContext)(s)}},14006:(e,t,n)=>{n.d(t,{D:()=>b});var r=n(95155),a=n(12115),s=n(18955),l=n(20562),i=n(8803),o=n(78596),c=n(68872);let u=/\x1b(?:\[[0-9;?]*)?$/;var d=n(51515);function m(e){return""===(0,d.aJ)(e).trim()}var f=n(18341),p=n(78660);function h(e){let{query:t,onQueryChange:n,matchCount:s,currentIndex:l,onNext:i,onPrev:o,onClose:c,isAtMaxMatches:u=!1}=e,d=(0,a.useRef)(null);(0,a.useEffect)(()=>{var e;null==(e=d.current)||e.focus()},[]);let m=(0,a.useCallback)(e=>{"Escape"===e.key&&c()},[c]),f=(0,a.useCallback)(e=>{n(e.target.value)},[n]),h=0===s?"0/0":u?"".concat(l+1,"/").concat(p.F0,"以上"):"".concat(l+1,"/").concat(s);return(0,r.jsxs)("div",{className:"flex items-center gap-1 px-2 py-1 bg-gray-800 border border-gray-600 rounded shadow-lg",role:"search","aria-label":"ターミナル内テキスト検索",children:[(0,r.jsx)("input",{ref:d,type:"text",value:t,onChange:f,onKeyDown:m,placeholder:"検索...",className:"bg-transparent text-gray-200 text-sm outline-none w-32 sm:w-40 placeholder-gray-500","aria-label":"検索キーワード",autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1}),(0,r.jsx)("span",{role:"status","aria-live":"polite","aria-atomic":"true",className:"text-gray-400 text-xs min-w-[3rem] text-right",children:h}),(0,r.jsx)("button",{onClick:o,disabled:0===s,"aria-label":"前の結果",className:"text-gray-300 hover:text-white disabled:text-gray-600 min-w-[36px] min-h-[36px] flex items-center justify-center text-base",children:"▲"}),(0,r.jsx)("button",{onClick:i,disabled:0===s,"aria-label":"次の結果",className:"text-gray-300 hover:text-white disabled:text-gray-600 min-w-[36px] min-h-[36px] flex items-center justify-center text-base",children:"▼"}),(0,r.jsx)("button",{onClick:c,"aria-label":"検索を閉じる",className:"text-gray-400 hover:text-white min-w-[36px] min-h-[36px] flex items-center justify-center text-base ml-1",children:"✕"})]})}var g=n(68394);function x(){return(0,r.jsxs)("div",{"data-testid":"thinking-indicator",className:"flex items-center gap-2 py-2 px-1 text-gray-400",children:[(0,r.jsxs)("span",{className:"flex gap-1",children:[(0,r.jsx)("span",{className:"animate-pulse delay-0",children:"."}),(0,r.jsx)("span",{className:"animate-pulse delay-150",children:"."}),(0,r.jsx)("span",{className:"animate-pulse delay-300",children:"."})]}),(0,r.jsx)("span",{className:"text-sm",children:"Thinking"})]})}let b=(0,a.memo)(function(e){let{output:t,isActive:n,attaching:b=!1,isThinking:v=!1,autoScroll:y=!0,onScrollChange:k,disableAutoFollow:w=!1,compactTuiLayoutPadding:j=!1,preservePaintedPanelRows:N=!1,wrapMode:C="viewport",density:S="regular",className:T=""}=e,I=(0,s.c)("worktree"),{scrollRef:M,autoScroll:E,handleScroll:A,scrollToBottom:L,scrollToTop:R}=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{initialAutoScroll:t=!0,onAutoScrollChange:n}=e,r=(0,a.useRef)(null),[s,l]=(0,a.useState)(t),i=(0,a.useRef)(!1),o=(0,a.useRef)(null);(0,a.useEffect)(()=>()=>{o.current&&clearTimeout(o.current)},[]);let c=(0,a.useCallback)(e=>{l(e),null==n||n(e)},[n]),u=(0,a.useCallback)(()=>{let e=r.current;if(!e)return!0;let{scrollTop:t,scrollHeight:n,clientHeight:a}=e;return n-a-t<=50},[]),d=(0,a.useCallback)(()=>{if(i.current)return;let e=u();e&&!s?c(!0):!e&&s&&c(!1)},[s,u,c]),m=(0,a.useCallback)(()=>{let e=r.current;e&&(i.current=!0,e.scrollTo({top:e.scrollHeight,behavior:"smooth"}),s||c(!0),o.current=setTimeout(()=>{i.current=!1,o.current=null},500))},[s,c]),f=(0,a.useCallback)(()=>{let e=r.current;e&&(i.current=!0,e.scrollTo({top:0,behavior:"smooth"}),s&&c(!1),o.current=setTimeout(()=>{i.current=!1,o.current=null},500))},[s,c]);return{scrollRef:r,autoScroll:s,setAutoScroll:c,scrollToBottom:m,scrollToTop:f,handleScroll:d}}({initialAutoScroll:y,onAutoScrollChange:k}),P=null!=t?t:"",D=(0,a.useMemo)(()=>j?N?(0,f.Dk)(P):function(e){if(""===e)return"";let t=e.split("\n"),n=[],r=!1,a=0;for(;a<t.length;){if(!m(t[a])){n.push(t[a]),r=!0,a++;continue}let e=a;for(;e<t.length&&m(t[e]);)e++;let s=e-a,l=!r,i=e>=t.length;if(!l&&!i)if(s<=2)for(let r=a;r<e;r++)n.push(t[r]);else n.push((0,d.x6)(t.slice(a,e).join("")));a=e}return n.join("\n")}(P):P,[j,N,P]),z=(0,a.useMemo)(()=>{if("frame"===C)return{minWidth:"".concat((0,g.pN)(D),"ch")}},[C,D]),{isOpen:O,query:F,matchCount:H,currentIndex:K,isAtMaxMatches:q,openSearch:B,closeSearch:U,setQuery:W,nextMatch:$,prevMatch:_}=(0,p.Yr)({output:D,containerRef:M}),J=(0,a.useCallback)(e=>{(e.ctrlKey||e.metaKey)&&"f"===e.key&&(e.preventDefault(),B())},[B]);(0,a.useEffect)(()=>{let e=()=>B();return window.addEventListener("terminal-search-open",e),()=>window.removeEventListener("terminal-search-open",e)},[B]);let[Q,Y]=(0,a.useState)(()=>D?[{key:0,html:(0,o.l5)(D)}]:[]),G=(0,a.useRef)(D),V=(0,a.useRef)(0);(0,a.useEffect)(()=>{let e=function(e,t){if(e===t)return{mode:"noop",text:t,appended:"",retainedLength:e.length};if(0===e.length||t.length<=e.length||!t.startsWith(e))return{mode:"replace",text:t,appended:"",retainedLength:0};let n=e.match(u),r=n?e.length-n[0].length:e.length;return{mode:"append",text:t,appended:t.slice(r),retainedLength:r}}(G.current,D);if(G.current=D,"noop"===e.mode)return;let t="append"===e.mode&&e.appended.length>c.ZJ;if("append"===e.mode&&!t)return void Y(t=>(V.current+=1,t.length>=400)?[{key:V.current,html:(0,o.l5)(D)}]:[...t,{key:V.current,html:(0,o.l5)(e.appended)}]);V.current+=1,Y(D?[{key:V.current,html:(0,o.l5)(D)}]:[])},[D]);let[Z,X]=(0,a.useState)(!1);(0,a.useEffect)(()=>{b?X(!1):n&&X(!0)},[b,n]);let ee=!t,et=ee&&b,en=ee&&!b&&!n&&Z,er=(0,a.useRef)(!1);(0,a.useEffect)(()=>{w&&(er.current=!0)},[w]),(0,a.useEffect)(()=>{if(M.current){if(er.current&&w&&D){M.current.scrollTo({top:0,behavior:"instant"}),er.current=!1;return}!w&&E&&M.current.scrollTo({top:M.current.scrollHeight,behavior:"instant"})}},[Q,D,E,w,M]);let ea=(0,a.useMemo)(()=>["terminal","font-mono","compact"===S?"text-xs":"text-sm","compact"===S?"p-2":"p-4","rounded-lg","overflow-y-auto","frame"===C?"overflow-x-auto":"overflow-x-hidden","bg-gray-900","text-gray-300","border","border-gray-700","h-full",n?"active":"",T].filter(Boolean).join(" "),[n,T,C,S]),[es,el]=(0,a.useState)(!1),ei=(0,a.useRef)(null),eo=(0,a.useCallback)(()=>{el(!0),ei.current&&clearTimeout(ei.current),ei.current=setTimeout(()=>el(!1),1500)},[]);(0,a.useEffect)(()=>()=>{ei.current&&clearTimeout(ei.current)},[]);let ec=(0,a.useCallback)(()=>{A(),eo()},[A,eo]),eu=["absolute bottom-4 right-4 flex items-center justify-center h-9 w-9 rounded-full bg-surface/80 backdrop-blur border border-border text-muted-foreground shadow-lg transition-opacity hover:text-surface-foreground hover:opacity-100 focus-visible:opacity-100 focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",es?"opacity-100":"opacity-60"].join(" ");return(0,r.jsxs)("div",{className:"relative h-full flex flex-col",children:[O&&(0,r.jsx)("div",{className:"absolute top-2 right-2 z-10",children:(0,r.jsx)(h,{query:F,onQueryChange:W,matchCount:H,currentIndex:K,onNext:$,onPrev:_,onClose:U,isAtMaxMatches:q})}),(0,r.jsxs)("div",{ref:M,role:"log","aria-live":"polite","aria-label":"Terminal output",className:ea,onScroll:ec,onKeyDown:J,tabIndex:0,children:[(0,r.jsx)("div",{className:"frame"===C?"whitespace-pre w-max":"whitespace-pre-wrap break-words",style:z,children:Q.map(e=>(0,r.jsx)("span",{dangerouslySetInnerHTML:{__html:e.html}},e.key))}),et&&(0,r.jsx)("div",{"data-testid":"terminal-loading-placeholder",className:"flex h-full items-center justify-center px-4 text-center text-sm text-gray-500 select-none",children:I("terminal.loading")}),en&&(0,r.jsx)("div",{"data-testid":"terminal-ended-placeholder",className:"flex h-full items-center justify-center px-4 text-center text-sm text-gray-500 select-none",children:I("terminal.sessionEnded")}),n&&v&&(0,r.jsx)(x,{})]}),E?(0,r.jsx)("button",{type:"button",onClick:R,className:eu,"aria-label":"Scroll to top",children:(0,r.jsx)(l.A,{size:16,"aria-hidden":"true"})}):(0,r.jsx)("button",{type:"button",onClick:L,className:eu,"aria-label":"Scroll to bottom",children:(0,r.jsx)(i.A,{size:16,"aria-hidden":"true"})})]})})},16342:(e,t,n)=>{n.d(t,{LQ:()=>l,Ml:()=>s,sh:()=>a});let r=RegExp("^\\p{M}$","u");function a(e,t){if(e.length<=t)return e.length;let n=0,a=0;for(let s of e){let e=+!r.test(s);if(1===e&&n>=t)break;n+=e,a+=s.length}return a}function s(e,t,n){return e.slice(a(e,t),a(e,n))}function l(e){let t=0;for(let n of e)r.test(n)||(t+=1);return t}},18341:(e,t,n)=>{n.d(t,{CG:()=>l,Dk:()=>o,Uw:()=>i});var r=n(51515);let a=/\x1b\[([0-9;]*)m/g;function s(e){return""===(0,r.aJ)(e).trim()}function l(e){return s(e)&&""!==(0,r.aJ)(e)&&function(e){let t;for(a.lastIndex=0;null!==(t=a.exec(e));)if(function(e){let t=0;for(;t<e.length;){let n=e[t];if(38===n||48===n||58===n){if(48===n)return!0;let r=e[t+1];t+=5===r?3:2===r?5:2;continue}if(n>=40&&n<=47||n>=100&&n<=107)return!0;t+=1}return!1}(t[1].split(";").filter(e=>""!==e).map(e=>Number(e)).filter(e=>Number.isInteger(e))))return!0;return!1}(e)}function i(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(""===e)return"";let{isStructuralRow:n}=t,a=e.split("\n"),l=[],i=!1,o=0,c=e=>{var t;return s(e)&&!(null!=(t=null==n?void 0:n(e))&&t)};for(;o<a.length;){if(!c(a[o])){l.push(a[o]),i=!0,o++;continue}let e=o;for(;e<a.length&&c(a[e]);)e++;let t=e-o,n=!i,s=e>=a.length;if(!n&&!s)if(t<=2)for(let t=o;t<e;t++)l.push(a[t]);else l.push((0,r.x6)(a.slice(o,e).join("")));o=e}return l.join("\n")}function o(e){return i(e,{isStructuralRow:l})}},19985:(e,t,n)=>{n.d(t,{F5:()=>i,Fg:()=>r,HB:()=>s,Hv:()=>l});let r=0x1400000,a=[{extension:".png",mimeType:"image/png",magicBytes:[137,80,78,71]},{extension:".jpg",mimeType:"image/jpeg",magicBytes:[255,216,255]},{extension:".jpeg",mimeType:"image/jpeg",magicBytes:[255,216,255]},{extension:".gif",mimeType:"image/gif",magicBytes:[71,73,70,56]},{extension:".webp",mimeType:"image/webp",magicBytes:[82,73,70,70]},{extension:".svg",mimeType:"image/svg+xml"}];function s(e){return e?e.startsWith(".")?e.toLowerCase():"."+e.toLowerCase():""}let l=[".png",".jpg",".jpeg",".gif",".webp",".svg"].filter(e=>".svg"!==e),i=l.map(e=>(function(e){let t=s(e),n=a.find(e=>e.extension===t);return(null==n?void 0:n.mimeType)||"application/octet-stream"})(e)).filter(e=>"application/octet-stream"!==e).join(",")},20877:(e,t,n)=>{n.d(t,{Gg:()=>f,Gw:()=>a,HI:()=>u,aX:()=>d,eu:()=>s,fq:()=>m});let r={highlightName:"terminal-search",currentHighlightName:"terminal-search-current",fallbackOverlayId:"terminal-search-fallback-overlay",fallbackOverlayBgColor:"rgba(255, 165, 0, 0.6)"},a={highlightName:"history-search",currentHighlightName:"history-search-current",fallbackOverlayId:"history-search-fallback-overlay",fallbackOverlayBgColor:"rgba(59, 130, 246, 0.6)"};function s(e){return{highlightName:"history-search-".concat(e),currentHighlightName:"history-search-current-".concat(e),fallbackOverlayId:"history-search-fallback-overlay-".concat(e),fallbackOverlayBgColor:a.fallbackOverlayBgColor}}function l(){return"undefined"!=typeof CSS&&null!==CSS&&"highlights"in CSS}function i(e,t,n){let r=document.createRange(),a=!1;for(let{node:s,start:l,end:i}of e)if(!a&&t<i&&t>=l&&(r.setStart(s,t-l),a=!0),a&&n<=i)return r.setEnd(s,n-l),r;return a?r:null}function o(e){var t;l()&&(CSS.highlights.delete(e.highlightName),CSS.highlights.delete(e.currentHighlightName)),null==(t=document.getElementById(e.fallbackOverlayId))||t.remove()}function c(e,t,n,r){if(0===t.length)return void o(r);let a=function(e){let t,n=[],r=0,a=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;t=a.nextNode();){var s,l;let e=null!=(l=null==(s=t.nodeValue)?void 0:s.length)?l:0;n.push({node:t,start:r,end:r+e}),r+=e}return n}(e),s=t[n],c=s?i(a,s.start,s.end):null;if(l()){let e=[];t.forEach((t,r)=>{if(r===n)return;let s=i(a,t.start,t.end);s&&e.push(s)}),CSS.highlights.set(r.highlightName,new Highlight(...e)),CSS.highlights.delete(r.currentHighlightName)}if(function(e,t,n){let r=document.getElementById(n.fallbackOverlayId);if(!t||"function"!=typeof t.getBoundingClientRect){null==r||r.remove();return}let a=t.getBoundingClientRect(),s=e.getBoundingClientRect();r?r.style.backgroundColor=n.fallbackOverlayBgColor:((r=document.createElement("div")).id=n.fallbackOverlayId,r.style.position="absolute",r.style.backgroundColor=n.fallbackOverlayBgColor,r.style.borderRadius="2px",r.style.pointerEvents="none",r.style.zIndex="5",e instanceof HTMLElement&&(e.style.position="relative"),e.appendChild(r)),r.style.top="".concat(a.top-s.top+e.scrollTop,"px"),r.style.left="".concat(a.left-s.left+e.scrollLeft,"px"),r.style.width="".concat(a.width,"px"),r.style.height="".concat(a.height,"px")}(e,c,r),c){let e=c.startContainer,t=e.nodeType===Node.TEXT_NODE?e.parentElement:e;t&&"function"==typeof t.scrollIntoView&&t.scrollIntoView({block:"center",behavior:"smooth"})}}function u(){o(r)}function d(e,t,n){c(e,t,n,r)}function m(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a;o(e)}function f(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:a;c(e,t,n,r)}},23570:(e,t,n)=>{n.d(t,{cV:()=>c,g6:()=>o});var r=n(95155),a=n(12115),s=n(87364),l=n(81507),i=n(72115);let o="worktree-history-pane",c=(0,a.memo)(function(e){let{history:t,terminal:n}=e,{visible:c,width:u,setWidth:d}=(0,l.TG)(),m=(0,a.useRef)(null),f=(0,a.useCallback)(e=>{let t=m.current;if(!t)return;let n=t.offsetWidth;0!==n&&d(u+e/n*100)},[u,d]);return(0,r.jsxs)("div",{ref:m,className:"flex h-full min-h-0 w-full",children:[null!=t&&(c?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{id:o,"data-testid":"terminal-container-history-slot","aria-label":"History pane",style:{width:"".concat(u,"%")},className:"flex-shrink-0 overflow-hidden transition-[width] duration-200 ease-in-out",children:(0,r.jsx)(s.t,{componentName:"HistoryPane",children:t})}),(0,r.jsx)(i.f,{onResize:f,orientation:"horizontal",ariaValueNow:u})]}):null),(0,r.jsx)("div",{"data-testid":"terminal-container-terminal-slot","aria-label":"Terminal pane",className:"flex-grow overflow-hidden min-w-0",children:(0,r.jsx)(s.t,{componentName:"TerminalAndFilePanel",children:n})})]})})},35252:(e,t,n)=>{n.d(t,{w:()=>l});var r=n(12115),a=n(78660);function s(e){if(0===e.length)return"0";let t=e[e.length-1],n=t.timestamp instanceof Date?t.timestamp.getTime():String(t.timestamp);return"".concat(e.length,"|").concat(t.id,"|").concat(n)}function l(e){let{messages:t}=e,[n,l]=(0,r.useState)(!1),[i,o]=(0,r.useState)(""),[c,u]=(0,r.useState)([]),[d,m]=(0,r.useState)(0),[f,p]=(0,r.useState)(!1),h=(0,r.useRef)(null),g=(0,r.useRef)(""),x=(0,r.useRef)(!1),b=(0,r.useRef)(s(t)),v=(0,r.useRef)(t);v.current=t;let y=c.reduce((e,t)=>e+t.ranges.length,0),k=(0,r.useMemo)(()=>(function(e,t){if(0===e.length||t<0)return null;let n=0;for(let r of e){if(t<n+r.ranges.length)return{messageId:r.messageId,localIndex:t-n};n+=r.ranges.length}return null})(c,d),[c,d]),w=(0,r.useCallback)(()=>{h.current&&(clearTimeout(h.current),h.current=null)},[]),j=(0,r.useCallback)(e=>{let{positions:t,capped:n}=function(e,t){if(t.length<a.E2||0===e.length)return{positions:[],capped:!1};let n=t.toLowerCase(),r=t.length,s=[],l=0,i=!1;for(let t of e){if(i)break;let o=t.content;if(!o)continue;let c=o.toLowerCase(),u=[],d=0;for(;;){let s=c.indexOf(n,d);if(-1===s)break;if(u.push({start:s,end:s+r}),d=s+1,(l+=1)>=a.F0){if(-1!==c.indexOf(n,d))i=!0;else{let r=e.indexOf(t)+1;for(let t=r;t<e.length;t++){let r=e[t].content;if(r&&-1!==r.toLowerCase().indexOf(n)){i=!0;break}}}break}}u.length>0&&s.push({messageId:t.id,ranges:u})}return{positions:s,capped:i}}(v.current,e);u(t),m(0),p(n)},[]),N=(0,r.useCallback)(e=>{w(),g.current=e,x.current||(h.current=setTimeout(()=>{j(e)},a.e1))},[w,j]),C=(0,r.useCallback)(e=>{o(e),N(e)},[N]),S=(0,r.useCallback)(()=>{l(!0)},[]),T=(0,r.useCallback)(()=>{l(!1),o(""),g.current="",u([]),m(0),p(!1),w()},[w]),I=(0,r.useCallback)(()=>{m(e=>0===y?0:(e+1)%y)},[y]),M=(0,r.useCallback)(()=>{m(e=>0===y?0:(e-1+y)%y)},[y]),E=(0,r.useCallback)(()=>{x.current=!0,w()},[w]),A=(0,r.useCallback)(()=>{x.current=!1;let e=g.current;e.length>=a.E2&&(w(),h.current=setTimeout(()=>{j(e)},a.e1))},[w,j]);return(0,r.useEffect)(()=>{let e=s(t);if(e===b.current)return;b.current=e;let n=g.current;n.length>=a.E2&&j(n)},[t,j]),(0,r.useEffect)(()=>()=>{w(),g.current=""},[w]),{isOpen:n,query:i,matchCount:y,currentIndex:d,isAtMaxMatches:f,matchPositions:c,currentMatch:k,openSearch:S,closeSearch:T,setQuery:C,onCompositionStart:E,onCompositionEnd:A,nextMatch:I,prevMatch:M}}},40240:(e,t,n)=>{n.d(t,{tY:()=>y,XU:()=>b});var r=n(95155),a=n(12115),s=n(18955),l=n(24033),i=n(51021),o=n(56827),c=n(49509),u=n(2317);let d={mobile:{storageKey:"commandmate:mobile:opencodeQuickKeysOpen",defaultOpen:!1},desktop:{storageKey:"commandmate:desktop:opencodeQuickKeysOpen",defaultOpen:!0}},m=e=>"boolean"==typeof e;function f(e){return[i.Mx,e]}let p=[{id:"agentNext",keys:["Tab"],notation:"tab"},{id:"agentPrev",keys:["BTab"],notation:"shift+tab"},{id:"commands",keys:["C-p"],notation:"ctrl+p"},{id:"variant",keys:["C-t"],notation:"ctrl+t"}],h=[{id:"agents",keys:f("a"),notation:"ctrl+x a"},{id:"sessions",keys:f("l"),notation:"ctrl+x l"},{id:"newSession",keys:f("n"),notation:"ctrl+x n"},{id:"models",keys:f("m"),notation:"ctrl+x m"},{id:"themes",keys:f("t"),notation:"ctrl+x t"}],g=[p,h,[{id:"timeline",keys:f("g"),notation:"ctrl+x g",sessionScoped:!0},{id:"undo",keys:f("u"),notation:"ctrl+x u",sessionScoped:!0},{id:"redo",keys:f("r"),notation:"ctrl+x r",sessionScoped:!0},{id:"compact",keys:f("c"),notation:"ctrl+x c",sessionScoped:!0}],[{id:"pageUp",keys:["PageUp"],notation:"pgup"},{id:"pageDown",keys:["PageDown"],notation:"pgdn"},{id:"first",keys:["Home"],notation:"home"},{id:"last",keys:["End"],notation:"end"}]],x=g.reduce((e,t)=>e+t.length,0),b=(0,a.memo)(function(e){let{worktreeId:t,cliToolId:n,instanceId:i,hasAgentSession:f,onKeysSent:p,compact:h=!1,collapsible:b=!1,layout:v="mobile"}=e,y=(0,s.c)("worktree"),{activeKey:k,markPressed:w}=(0,c.t)(),j=(0,o.B)(t,n,i,p),{open:N,toggle:C}=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"mobile",{storageKey:t,defaultOpen:n}=d[e],{value:r,setValue:s,isAvailable:l}=(0,u.V)({key:t,defaultValue:n,validate:m});return{open:r,toggle:(0,a.useCallback)(()=>s(e=>!e),[s]),isPersistent:l}}(v),S=(0,a.useId)(),T=(0,a.useCallback)(e=>{w(e.id),j([...e.keys])},[w,j]);if("opencode"!==n)return null;let I=(0,r.jsxs)("div",{className:"@container flex flex-wrap items-center gap-1.5 ".concat(b?"px-1.5 pb-1.5":"py-1.5 bg-muted rounded-lg"),id:b?S:void 0,role:"toolbar","aria-label":y("opencodeQuickKeys.toolbarLabel"),"data-testid":"opencode-quick-keys",children:[b?null:(0,r.jsx)("span",{className:"text-xs text-muted-foreground mx-2",children:y("opencodeQuickKeys.caption")}),g.map((e,t)=>(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[t>0?(0,r.jsx)("span",{className:"w-px h-6 bg-border mx-0.5","aria-hidden":"true"}):null,e.map(e=>{let t=y("opencodeQuickKeys.keys.".concat(e.id)),n=!0===e.sessionScoped&&!f;return(0,r.jsxs)("button",{type:"button",disabled:n,className:"min-h-[44px] px-3 py-2 text-sm font-medium rounded-md\n border border-border\n focus:outline-none focus:ring-2 focus:ring-ring\n transition-colors duration-75\n disabled:opacity-50 disabled:cursor-not-allowed\n ".concat(k===e.id?"bg-accent-500 text-white border-accent-500 scale-95":"bg-surface dark:bg-surface-2 hover:bg-muted active:bg-muted disabled:hover:bg-surface"),"aria-label":"".concat(t," (").concat(e.notation,")"),title:n?y("opencodeQuickKeys.needsSession",{notation:e.notation}):"".concat(t," — ").concat(e.notation),"data-testid":"opencode-quick-key-".concat(e.id),onClick:()=>T(e),children:[t,h?null:(0,r.jsx)("span",{className:"ml-1.5 text-xs text-muted-foreground hidden @min-[640px]:inline",children:e.notation})]},e.id)})]},e[0].id))]});return b?(0,r.jsxs)("div",{className:"bg-muted rounded-lg","data-testid":"opencode-quick-keys-disclosure",children:[(0,r.jsxs)("button",{type:"button",className:"w-full min-h-[44px] flex items-center gap-2 px-3 py-2 text-sm font-medium rounded-lg touch-manipulation transition-colors hover:bg-surface-2 active:bg-surface-2 focus:outline-none focus:ring-2 focus:ring-ring","aria-expanded":N,"aria-controls":S,"aria-label":N?y("opencodeQuickKeys.hideKeys"):y("opencodeQuickKeys.showKeys"),"data-testid":"opencode-quick-keys-toggle",onClick:C,children:[(0,r.jsx)(l.A,{className:"w-4 h-4 shrink-0 transition-transform duration-150 ".concat(N?"":"-rotate-90"),"aria-hidden":"true"}),(0,r.jsx)("span",{children:y("opencodeQuickKeys.toolbarLabel")}),(0,r.jsx)("span",{className:"ml-auto text-xs text-muted-foreground",children:x})]}),N?I:null]}):I}),v=["variant","models","commands"].map(e=>{let t=[...p,...h].find(t=>t.id===e);if(!t)throw Error("OpencodeQuickKeys: unknown model key id ".concat(e));return t}),y=(0,a.memo)(function(e){let{worktreeId:t,cliToolId:n,instanceId:l,onKeysSent:i}=e,u=(0,s.c)("worktree"),{activeKey:d,markPressed:m}=(0,c.t)(),f=(0,o.B)(t,n,l,i),p=(0,a.useCallback)(e=>{m(e.id),f([...e.keys])},[m,f]);return"opencode"!==n?null:(0,r.jsxs)("div",{"data-testid":"opencode-model-keys",role:"toolbar","aria-label":u("selectionKeys.opencodeToolbarLabel"),className:"flex flex-wrap items-center gap-1.5 rounded-lg bg-muted px-2 py-1.5",children:[(0,r.jsx)("span",{className:"text-xs text-muted-foreground",children:u("selectionKeys.opencodeCaption")}),v.map(e=>{let t=u("opencodeQuickKeys.keys.".concat(e.id));return(0,r.jsxs)("button",{type:"button","data-testid":"opencode-model-key-".concat(e.id),"aria-label":"".concat(t," (").concat(e.notation,")"),title:"".concat(t," — ").concat(e.notation),onClick:()=>p(e),className:"min-h-[44px] rounded-md border border-border px-3 py-2 text-sm font-medium transition-colors duration-75 touch-manipulation focus:outline-none focus:ring-2 focus:ring-ring ".concat(d===e.id?"border-accent-500 bg-accent-500 text-white scale-95":"bg-surface hover:bg-muted active:bg-muted dark:bg-surface-2"),children:[t,(0,r.jsx)("span",{className:"ml-1.5 text-xs text-muted-foreground",children:e.notation})]},e.id)})]})})},41108:(e,t,n)=>{n.d(t,{UI:()=>c});var r=n(12115);function a(){return{pending:0,delivered:0,prompt:0,expired:0,cancelled:0}}let s=[],l=new Map;function i(){return{open:s,counts:a()}}async function o(e,t){try{var n;let r=await fetch("/api/relays?worktree=".concat(encodeURIComponent(e)));if(!r.ok)return;let i=await r.json();if(l.get(e)!==t)return;for(let e of(t.snapshot={open:Array.isArray(i.open)?i.open:s,counts:null!=(n=i.counts)?n:a()},t.listeners))e()}catch(e){}}function c(e){let[t]=(0,r.useState)(i),n=(0,r.useCallback)(t=>{let n;if(!e)return()=>{};let r=((n=l.get(e))||(n={snapshot:i(),listeners:new Set,timer:null,refs:0},l.set(e,n)),n.refs+=1,null===n.timer&&(o(e,n),n.timer=setInterval(()=>void o(e,n),2e4)),n);return r.listeners.add(t),()=>{r.listeners.delete(t),function(e){let t=l.get(e);t&&(t.refs-=1,t.refs>0||(t.timer&&clearInterval(t.timer),l.delete(e)))}(e)}},[e]),a=(0,r.useCallback)(()=>{var n,r;return e&&null!=(r=null==(n=l.get(e))?void 0:n.snapshot)?r:t},[e,t]),{open:s,counts:c}=(0,r.useSyncExternalStore)(n,a,a),u=(0,r.useCallback)(()=>{let t=e?l.get(e):void 0;e&&t&&o(e,t)},[e]);return(0,r.useMemo)(()=>({open:s,counts:c,owedBy:t=>s.filter(n=>n.to.worktreeId===e&&n.to.instanceId===t),awaitedBy:t=>s.filter(n=>n.from.worktreeId===e&&n.from.instanceId===t),refresh:u}),[s,c,e,u])}},49509:(e,t,n)=>{n.d(t,{t:()=>s});var r=n(12115),a=n(9900);function s(){let[e,t]=(0,r.useState)(null),n=(0,r.useRef)(null);return(0,r.useEffect)(()=>()=>{null!==n.current&&(clearTimeout(n.current),n.current=null)},[]),{activeKey:e,markPressed:(0,r.useCallback)(e=>{t(e),null!==n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{n.current=null,t(null)},a.tX)},[])}}},50857:(e,t,n)=>{function r(e){return"running"===e||"generating"===e||"waiting"===e}function a(e){return e.isActive||r(e.status)}function s(e,t){let n=e.map((e,t)=>({it:e,index:t})).filter(e=>{let{it:t}=e;return a(t)}),r=new Set;return t>0&&n.length>0&&[...n].sort((e,t)=>Number(t.it.isActive)-Number(e.it.isActive)||e.index-t.index).slice(0,t).forEach(e=>{let{index:t}=e;return r.add(t)}),e.map((e,t)=>a(e)?{...e,slot:r.has(t)?"pill":"overflow"}:{...e,slot:"dot"})}n.d(t,{Lm:()=>a,Qo:()=>r,Uw:()=>s})},51021:(e,t,n)=>{n.d(t,{Mx:()=>l,mE:()=>r,qL:()=>s});let r="s",a=["Up","Down","Left","Right","Enter","Escape","Tab","BTab","PageUp","PageDown","Home","End","q","1","2","3","4","5","6","7","8","9","y","n"];[...a];let s=["claude","command-code"],l="C-x",i=["C-p","C-t"],o=["a","l","t","m","g","u","r","c"];[...a,...i,...o],[...a,...i,...o]},51515:(e,t,n)=>{n.d(t,{aJ:()=>l,wJ:()=>i,x6:()=>o});let r="\\x1b\\][^\\x07\\x1b]*(?:\\x07|\\x1b\\\\)",a=RegExp(r,"g"),s=RegExp("\\x1b\\[[0-9;]*[a-zA-Z]|".concat(r,"|\\[[0-9;]*m"),"g");function l(e){return e.replace(s,"")}function i(e){return e.replace(a,"")}function o(e){let t=e.match(s);return t?t.join(""):""}},52771:(e,t,n)=>{n.d(t,{AO:()=>a.A,OS:()=>l,PD:()=>i});var r=n(68955),a=n(88894),s=n(51515);function l(e,t){let n=(0,a.h)(e);if(null===n)return r.J_;var l=null!=t?t:"";if(""===l)return r.J_;let i=function(e,t){let n=e.split("\n"),r=[];for(let e=n.length-1;e>=0&&r.length<t;e--){var a;let t=(0,s.aJ)(null!=(a=n[e])?a:"");""!==t.trim()&&r.push(t)}return r.reverse()}(l,n.tailRows);if(0===i.length)return r.J_;for(let e of n.indicators)if(i.some(t=>e.pattern.test(t)))return e.mode;return r.J_}function i(e){return"string"==typeof e&&(0,r.WK)(e)}},55813:(e,t,n)=>{n.d(t,{M:()=>l});var r=n(55041),a=n(8574);let s={en:a.c,ja:r.ja};function l(e){var t;return null!=(t=s[e])?t:a.c}},56827:(e,t,n)=>{n.d(t,{B:()=>s});var r=n(12115),a=n(9900);function s(e,t,n,s){return(0,r.useCallback)(r=>{let l=n&&n!==t?{cliToolId:t,keys:r,instanceId:n}:{cliToolId:t,keys:r};fetch("/api/worktrees/".concat(encodeURIComponent(e),"/special-keys"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)}).then(()=>{s&&setTimeout(s,a.LK)}).catch(e=>{console.error("Failed to send special keys:",e)})},[e,t,n,s])}},60734:(e,t,n)=>{n.d(t,{y:()=>u});var r=n(95155),a=n(12115),s=n(18955),l=n(56827),i=n(49509);let o=[{key:"Left",label:"◀",ariaLabel:"Left"},{key:"Up",label:"▲",ariaLabel:"Up"},{key:"Down",label:"▼",ariaLabel:"Down"},{key:"Right",label:"▶",ariaLabel:"Right"},{key:"Enter",label:"↵",ariaLabel:"Enter"},{key:"Escape",label:"Esc",ariaLabel:"Escape"}],c=[{key:"PageUp",label:"PgUp",ariaLabel:"Page Up"},{key:"PageDown",label:"PgDn",ariaLabel:"Page Down"},{key:"Home",label:"Home",ariaLabel:"Home"},{key:"End",label:"End",ariaLabel:"End"},{key:"q",label:"q",ariaLabelKey:"navigation.quitPager"}];function u(e){let{worktreeId:t,cliToolId:n,instanceId:u,onKeysSent:d,showPagerKeys:m=!1}=e,f=(0,s.c)("worktree"),{activeKey:p,markPressed:h}=(0,i.t)(),g=(0,l.B)(t,n,u,d),x=(0,a.useCallback)(e=>{h(e[0]),g(e)},[h,g]),b=(0,a.useMemo)(()=>m?[...o,...c]:o,[m]),v=(0,a.useCallback)(e=>{let t={ArrowLeft:"Left",ArrowUp:"Up",ArrowDown:"Down",ArrowRight:"Right",Enter:"Enter",Escape:"Escape"}[e.key];t&&(e.preventDefault(),x([t]))},[x]);return(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5 py-1.5 bg-muted rounded-lg",onKeyDown:v,role:"toolbar","aria-label":f("navigation.toolbarLabel"),children:[(0,r.jsx)("span",{className:"text-xs text-muted-foreground mx-2",children:f("navigation.caption")}),b.map(e=>{let{key:t,label:n,ariaLabel:a,ariaLabelKey:s}=e;return(0,r.jsx)("button",{type:"button",className:"min-w-[44px] min-h-[44px] px-3 py-2 text-sm font-medium rounded-md\n border border-border\n focus:outline-none focus:ring-2 focus:ring-ring\n transition-colors duration-75\n ".concat(p===t?"bg-accent-500 text-white border-accent-500 scale-95":"bg-surface dark:bg-surface-2 hover:bg-muted active:bg-muted"),"aria-label":s?f(s):a,onClick:()=>x([t]),children:n},t)})]})}},62560:(e,t,n)=>{n.d(t,{NK:()=>b});var r=n(12115),a=n(60199),s=n(51515);let l=/^[>❯]/,i=/^\u203A/;function o(e){return void 0===e||""===(0,s.aJ)(e).trim()}function c(e){let t=[],n={dim:!1,bold:!1},r=0;for(;r<e.length;){let a=e[r];if("\x1b"!==a){t.push({ch:a,dim:n.dim,bold:n.bold}),r++;continue}let s=e[r+1];if("["===s){let t=r+2;for(;t<e.length&&!/[A-Za-z]/.test(e[t]);)t++;if(t>=e.length)break;"m"===e[t]&&(n=function(e,t){let n=""===e?["0"]:e.split(";"),{dim:r,bold:a}=t;for(let e=0;e<n.length;e++){let t=""===n[e]?0:Number(n[e]);if(!Number.isNaN(t)){if(38===t||48===t||58===t){let t=""===n[e+1]||void 0===n[e+1]?-1:Number(n[e+1]);5===t?e+=2:2===t?e+=4:e+=1;continue}0===t||22===t?(r=!1,a=!1):1===t?a=!0:2===t&&(r=!0)}}return{dim:r,bold:a}}(e.slice(r+2,t),n)),r=t+1;continue}if("]"===s){let t=r+2;for(;t<e.length;){if("\x07"===e[t]){t++;break}if("\x1b"===e[t]&&"\\"===e[t+1]){t+=2;break}t++}r=t;continue}r+=2}return t}let u=new Set(["claude","codex"]);function d(e){let t=e.length;for(;t>0&&""===e[t-1].trim();)t--;return e.slice(0,t)}var m=n(52771),f=n(68955),p=n(67149);p.$C.activeMs,p.$C.idleMs,p.$C.wsFallbackMs;let h={session:null,context:null,diff:null};function g(e){var t,n,r,a,s,l,i,o,c,u,d,m;let f=e.session,p=e.context,h=e.diff;return JSON.stringify([null!=(t=null==f?void 0:f.title)?t:null,null!=(n=null==f?void 0:f.agent)?n:null,null!=(r=null==f?void 0:f.model)?r:null,null!=(a=null==f?void 0:f.cost)?a:null,null!=(s=null==f?void 0:f.tokens)?s:null,null!=(l=null==p?void 0:p.tokens)?l:null,null!=(i=null==p?void 0:p.limit)?i:null,null!=(o=null==p?void 0:p.percent)?o:null,null!=(c=null==h?void 0:h.turnMessageId)?c:null,null!=(u=null==h?void 0:h.revertedMessageId)?u:null,null!=(d=null==h?void 0:h.files.map(x))?d:null,null!=(m=null==h?void 0:h.revertedFiles.map(x))?m:null])}function x(e){var t,n;return"".concat(null!=(t=e.file)?t:"",":").concat(null!=(n=e.status)?n:"",":").concat(e.additions,":").concat(e.deletions)}function b(e){let{worktreeId:t,cliToolId:n,instanceId:x,enabled:b=!0,cadence:v=p.$C}=e,y=null!=x?x:n,[k,w]=(0,r.useState)(()=>({output:"",realtimeSnippet:"",isRunning:!1,isThinking:!1,sessionStatus:"",isSelectionListActive:!1,isPagerActive:!1,isDismissablePanelActive:!1,isUnclassifiedActive:!1,composerText:"",agentMode:f.J_,attaching:!0,autoScroll:!0})),[j,N]=(0,r.useState)(()=>({visible:!1,data:null,messageId:null,answering:!1})),[C,S]=(0,r.useState)(h),T=(0,r.useRef)(0),I=(0,r.useRef)(n);I.current=n;let M=(0,r.useRef)(y);M.current=y;let E=(0,r.useRef)(!1);(0,r.useEffect)(()=>(E.current=!0,()=>{E.current=!1}),[]);let A=(0,r.useRef)(j.visible);A.current=j.visible;let{connected:L,subscribe:R,unsubscribe:P,addListener:D}=(0,a.xM)(),z=(0,r.useRef)(0),O=(0,r.useRef)(0),F=(0,r.useRef)(null),H=(0,r.useRef)(null),[K,q]=(0,r.useState)(!1),B=(0,r.useCallback)(()=>{q(!0),null!==H.current&&clearTimeout(H.current),H.current=setTimeout(()=>{H.current=null,q(!1)},5e3)},[]),U=(0,r.useCallback)(e=>{var t,n;let r=null!=(n=null!=(t=e.fullOutput)?t:e.realtimeSnippet)?n:"";!0===e.isUnclassifiedActive&&!0!==e.isPromptWaiting&&!0!==e.isSelectionListActive&&!0!==e.isPagerActive&&!0!==e.isDismissablePanelActive?(O.current+=1,null!=F.current||(F.current=Date.now())):(O.current=0,F.current=null);let a=O.current>=2&&null!==F.current&&Date.now()-F.current>=500,p=e.isRunning?function(e,t){if(!u.has(t))return{text:"",state:"unsupported_tool"};let n=e.split("\n"),r=function(e,t){if("claude"===t){let t=function(e){var t;let n=e=>/^─{10,}$/.test((0,s.aJ)(e).trimEnd()),r=e.length-1;for(;r>=0&&""===e[r].trim();)r--;if(r<0)return null;let a=-1;for(let t=r;t>=Math.max(0,r-4);t--)if(n(e[t])){a=t;break}if(a<0)return null;let i=-1;for(let t=a-1;t>=Math.max(0,a-40);t--)if(n(e[t])){i=t;break}return i<0||!l.test((0,s.aJ)(null!=(t=e[i+1])?t:""))?null:{openingSeparator:i,closingSeparator:a}}(e);return null===t?null:{firstRow:t.openingSeparator+1,lastRow:t.closingSeparator-1,glyph:l}}let n=function(e){let t=e.length-1;for(;t>=0&&o(e[t]);)t--;if(t<0)return null;for(let n=0;n<4&&t>=0;n++){let n=t,r=t;for(;r>0&&!o(e[r-1]);)r--;if(function(e){if(void 0===e)return!1;let t=c(e);if(0===t.length||"›"!==t[0].ch||t[0].dim||t.length>1&&" "!==t[1].ch)return!1;let n=t.slice(2).find(e=>" "!==e.ch);return void 0===n||!n.bold}(e[r]))return{firstRow:r,lastRow:Math.min(n,r+40-1)};for(t=r-1;t>=0&&o(e[t]);)t--}return null}(e);return null===n?null:{firstRow:n.firstRow,lastRow:n.lastRow,glyph:i}}(n,t);if(null===r)return{text:"",state:"no_composer"};let a=[],m=[];for(let e=r.firstRow;e<=r.lastRow;e++){var f;let t=function(e,t,n){if(t){let t=e.findIndex(e=>n.test(e.ch));if(t<0)return e;let r=t+1;return r<e.length&&/\s/.test(e[r].ch)&&r++,e.slice(r)}let r=0;for(;r<2&&r<e.length&&" "===e[r].ch;)r++;return e.slice(r)}(c(null!=(f=n[e])?f:""),e===r.firstRow,r.glyph);a.push(t.filter(e=>!e.dim).map(e=>e.ch).join("").trimEnd()),m.push(t.map(e=>e.ch).join("").trimEnd())}let p=d(a).join("\n");return""!==p.trim()?{text:p.slice(0,2e3),state:"content"}:{text:"",state:""===d(m).join("\n").trim()?"empty":"ghost"}}(r,I.current).text:"",h=e.isRunning?(0,m.OS)(I.current,r):f.J_;w(t=>{var n,s,l,i,o,c,u;let d=!1===e.isRunning,m=!!r||!!e.isRunning||d;return{...t,output:m?r:t.output,realtimeSnippet:null!=(n=e.realtimeSnippet)?n:"",isRunning:null!=(s=e.isRunning)&&s,isThinking:null!=(l=e.thinking)&&l,sessionStatus:null!=(i=e.sessionStatus)?i:t.sessionStatus,isSelectionListActive:null!=(o=e.isSelectionListActive)&&o,isPagerActive:null!=(c=e.isPagerActive)&&c,isDismissablePanelActive:null!=(u=e.isDismissablePanelActive)&&u,isUnclassifiedActive:a,composerText:p,agentMode:h,attaching:!1}}),e.isPromptWaiting&&e.promptData?N(t=>{var n,r;return{...t,visible:!0,data:null!=(n=e.promptData)?n:t.data,messageId:null!=(r=t.messageId)?r:"prompt-".concat(Date.now())}}):!e.isPromptWaiting&&A.current&&N({visible:!1,data:null,messageId:null,answering:!1})},[]),W=(0,r.useCallback)(async()=>{let e=++T.current,r=()=>!E.current||T.current!==e||I.current!==n||M.current!==y;try{var a,s,l,i,o,c;let e=await fetch("/api/worktrees/".concat(t,"/current-output?cliTool=").concat(n,"&instance=").concat(encodeURIComponent(y)));if(!e.ok)return;let u=await e.json();if(r()||u.cliToolId&&u.cliToolId!==n)return;U(u);let d={session:null!=(i=null==(a=u.structuredEvents)?void 0:a.session)?i:null,context:null!=(o=null==(s=u.structuredEvents)?void 0:s.sessionContext)?o:null,diff:null!=(c=null==(l=u.structuredEvents)?void 0:l.sessionDiff)?c:null};S(e=>g(e)===g(d)?e:d)}catch(e){if(r())return;console.error("[useTerminalPanePolling] fetch error:",e)}},[t,n,y,U]),$="".concat(t,"::").concat(n,"::").concat(y),_=(0,r.useRef)($);(0,r.useEffect)(()=>{_.current!==$&&(_.current=$,T.current+=1,z.current=0,O.current=0,F.current=null,q(!1),null!==H.current&&(clearTimeout(H.current),H.current=null),w(e=>({...e,output:"",realtimeSnippet:"",isRunning:!1,isThinking:!1,sessionStatus:"",isSelectionListActive:!1,isPagerActive:!1,isDismissablePanelActive:!1,isUnclassifiedActive:!1,composerText:"",agentMode:f.J_,attaching:!0})),N({visible:!1,data:null,messageId:null,answering:!1}),S(h))},[$]),(0,r.useEffect)(()=>{if(b)return R(t),()=>P(t)},[b,t,R,P]),(0,r.useEffect)(()=>{z.current=0,q(!1),null!==H.current&&(clearTimeout(H.current),H.current=null)},[L]),(0,r.useEffect)(()=>()=>{null!==H.current&&clearTimeout(H.current)},[]),(0,r.useEffect)(()=>{if(b)return D(e=>{var n;if("terminal_snapshot"!==e.type||e.worktreeId!==t||e.cliToolId!==I.current||e.instanceId!==M.current||e.version<=z.current)return;z.current=e.version,B();let r=e.output.split("\n").slice(-100).join("\n");U({fullOutput:e.output,realtimeSnippet:r,isRunning:e.isRunning,sessionStatus:e.sessionStatus,thinking:e.thinking,isSelectionListActive:e.isSelectionListActive,isPagerActive:e.isPagerActive,isDismissablePanelActive:e.isDismissablePanelActive,isUnclassifiedActive:e.isUnclassifiedActive,isPromptWaiting:e.isPromptWaiting,promptData:null!=(n=e.promptData)?n:null})})},[b,t,D,U,B]),(0,r.useEffect)(()=>{if(b)return D(e=>{if("session_status_changed"===e.type)e.worktreeId===t&&!1===e.isRunning&&(null==e.instance||e.instance===M.current)&&(null==e.cliTool||e.cliTool===I.current)&&(z.current=0,U({fullOutput:"",realtimeSnippet:"",isRunning:!1,sessionStatus:"idle",thinking:!1,isSelectionListActive:!1,isPagerActive:!1,isDismissablePanelActive:!1,isUnclassifiedActive:!1,isPromptWaiting:!1,promptData:null}))})},[b,t,D,U]),(0,r.useEffect)(()=>{if(!b)return;let e=!1,t=j.visible||k.isSelectionListActive||k.isPagerActive||k.isDismissablePanelActive||k.isUnclassifiedActive,n=setInterval(()=>{"hidden"!==document.visibilityState&&W()},(0,p.lN)(v,{connected:L,pushHealthy:K,interactionActive:t,sessionAlive:k.isRunning,generating:(0,p.f8)(k.sessionStatus)}));"undefined"!=typeof document&&"hidden"!==document.visibilityState&&W();let r=()=>{"visible"!==document.visibilityState||e||W()};return document.addEventListener("visibilitychange",r),()=>{e=!0,null!==n&&(clearInterval(n),n=null),document.removeEventListener("visibilitychange",r)}},[b,v,L,K,k.isRunning,k.sessionStatus,k.isSelectionListActive,k.isPagerActive,k.isDismissablePanelActive,k.isUnclassifiedActive,j.visible,W]);let J=(0,r.useCallback)(e=>{w(t=>t.autoScroll===e?t:{...t,autoScroll:e})},[]),Q=(0,r.useCallback)(e=>{N(t=>({...t,answering:e}))},[]);return{terminal:k,prompt:j,agentSession:C,setAutoScroll:J,setPromptAnswering:Q,clearPrompt:(0,r.useCallback)(()=>{N({visible:!1,data:null,messageId:null,answering:!1})},[]),refresh:(0,r.useCallback)(()=>W(),[W])}}},64653:(e,t,n)=>{n.d(t,{o4:()=>l});var r=n(76246);let a={method:"HEAD",cache:"no-store"},s=(e,t)=>fetch(e,t);async function l(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s;try{var l;return(l=await n("/api/worktrees/".concat(encodeURIComponent(e),"/files/").concat((0,r.o)(t)),a)).ok?"present":404===l.status||400===l.status||403===l.status?"missing":"unknown"}catch(e){return"unknown"}}},67149:(e,t,n)=>{n.d(t,{$C:()=>r,WT:()=>l,f8:()=>o,lN:()=>c,sD:()=>a,tC:()=>s,z1:()=>u});let r={activeMs:2e3,idleMs:5e3,wsFallbackMs:15e3,activeRequiresGenerating:!1,idleTrustsConnection:!1},a={activeMs:4e3,idleMs:1e4,wsFallbackMs:15e3,activeRequiresGenerating:!0,idleTrustsConnection:!0},s={pollMs:5e3,wsFallbackMs:15e3},l={pollMs:15e3,wsFallbackMs:3e4},i=new Set(["running","waiting"]);function o(e){return i.has(e)}function c(e,t){if(t.interactionActive)return e.activeMs;let n=e.activeRequiresGenerating?t.generating:t.sessionAlive;return t.connected&&t.pushHealthy||t.connected&&!n&&e.idleTrustsConnection?e.wsFallbackMs:n?e.activeMs:e.idleMs}function u(e,t){return t.connected?e.wsFallbackMs:e.pollMs}},68276:(e,t,n)=>{n.d(t,{LT:()=>r,XF:()=>a});let r="unclassified";function a(e){return null!=e&&e.type!==r}},68394:(e,t,n)=>{n.d(t,{EK:()=>c,Wq:()=>i,pN:()=>u});var r=n(51515);let a=new Set(["claude","codex","opencode"]),s=new Set(["opencode"]),l=new Set(["opencode"]),i={wrapMode:"frame",density:"compact"},o=/\x1b\[[0-9;]*m/g;function c(e){return{compactTuiLayoutPadding:a.has(e),preservePaintedPanelRows:s.has(e),mobileWrapMode:l.has(e)?"frame":"viewport"}}function u(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:400,n=1;for(let a of e.split("\n")){let e=(0,r.wJ)(a).replace(o,"").trimEnd().length;if(e>n&&(n=e),n>=t)return t}return n}},68872:(e,t,n)=>{n.d(t,{ED:()=>a,ZJ:()=>r,yi:()=>s});let r=1048576,a="[... 古い出力を省略しました / older output truncated ...]",s=65536},68955:(e,t,n)=>{n.d(t,{J_:()=>a,WK:()=>s});let r=["default","manual","accept-edits","plan","auto","autopilot","bypass","dont-ask"],a="unknown";function s(e){return r.includes(e)}},70738:(e,t,n)=>{n.d(t,{h:()=>u,z:()=>o});var r=n(69352);let a=/^(https?|mailto|tel|file):/i,s=/^[a-zA-Z][a-zA-Z0-9+.-]*:/,l=/^file:\/\/(localhost)?/i,i=/:\d+(?::\d+)?$/;function o(e){let t=(0,r.d3)(e.trim());return t?t.startsWith("#")?"anchor":l.test(t)?"file":s.test(t)&&!a.test(t)?null:"external"===(0,r.dj)(t)?"external":"file":null}function c(e){let t=[];for(let n of e.split("/"))if(""!==n&&"."!==n){if(".."===n){t.pop();continue}t.push(n)}return t.join("/")}function u(e,t){var n;if("file"!==o(e))return null;let r=(function(e){try{return decodeURIComponent(e)}catch(t){return e}})((function(e){let t=e.indexOf("#");return -1===t?e:e.slice(0,t)})(e.trim().replace(l,"")).replace(i,"")).trim();if(!r)return null;if(!r.startsWith("/"))return c(r)||null;let a=t?(n=t.trim()).length>1&&n.endsWith("/")?n.replace(/\/+$/,""):n:"";return a&&a.startsWith("/")?r===a?null:r.startsWith("".concat(a,"/"))?c(r.slice(a.length+1))||null:r:r}},72115:(e,t,n)=>{n.d(t,{f:()=>u});var r=n(95155),a=n(12115),s=n(18955);let l=["relative","flex-shrink-0","bg-border","transition-colors","duration-150","hover:bg-accent-500","dark:hover:bg-accent-500","focus:outline-none","focus:ring-2","focus:ring-ring","focus:ring-offset-2","focus:ring-offset-background"],i=["w-1","h-full","cursor-col-resize","before:content-['']","before:absolute","before:inset-y-0","before:-inset-x-1"],o=["h-1","w-full","cursor-row-resize","before:content-['']","before:absolute","before:inset-x-0","before:-inset-y-1"];function c(e,t){return"touches"in e&&e.touches.length>0?t?e.touches[0].clientX:e.touches[0].clientY:"clientX"in e?t?e.clientX:e.clientY:0}let u=(0,a.memo)(function(e){let{onResize:t,orientation:n="horizontal",ariaValueNow:u=50,onDoubleClick:d,minRatio:m=.1}=e,f=(0,s.c)("worktree"),[p,h]=(0,a.useState)(!1),g=(0,a.useRef)(0),x=(0,a.useRef)(null),b="horizontal"===n,v=(0,a.useCallback)(e=>{e.preventDefault(),h(!0),g.current=c(e,b)},[b]),y=(0,a.useCallback)(e=>{1===e.touches.length&&(h(!0),g.current=c(e,b))},[b]),k=(0,a.useCallback)(e=>{if(!p)return;let n=c(e,b);t(n-g.current),g.current=n},[p,b,t]),w=(0,a.useCallback)(e=>{if(!p||1!==e.touches.length)return;let n=c(e,b);t(n-g.current),g.current=n},[p,b,t]),j=(0,a.useCallback)(()=>{h(!1)},[]),N=(0,a.useCallback)(()=>{d&&d()},[d]),C=(0,a.useCallback)(e=>{let n=0;b?"ArrowRight"===e.key?n=10:"ArrowLeft"===e.key&&(n=-10):"ArrowDown"===e.key?n=10:"ArrowUp"===e.key&&(n=-10),0!==n&&(e.preventDefault(),t(n))},[b,t]);(0,a.useEffect)(()=>(p&&(document.addEventListener("mousemove",k),document.addEventListener("mouseup",j),document.addEventListener("touchmove",w),document.addEventListener("touchend",j),document.body.style.userSelect="none",document.body.style.cursor=b?"col-resize":"row-resize"),()=>{document.removeEventListener("mousemove",k),document.removeEventListener("mouseup",j),document.removeEventListener("touchmove",w),document.removeEventListener("touchend",j),document.body.style.userSelect="",document.body.style.cursor=""}),[p,k,j,w,b]);let S=(0,a.useMemo)(()=>[...l,...b?i:o,...p?["bg-accent-500","dark:bg-accent-500","dragging",b?"w-2":"h-2"]:[]].join(" "),[b,p]);return(0,r.jsx)("div",{ref:x,role:"separator","aria-orientation":n,"aria-valuenow":u,"aria-valuemin":0,"aria-valuemax":100,"aria-label":f("paneResizer.label",{arrows:f(b?"paneResizer.arrowsHorizontal":"paneResizer.arrowsVertical")}),tabIndex:0,className:S,onMouseDown:v,onTouchStart:y,onKeyDown:C,onDoubleClick:N})})},73190:(e,t,n)=>{n.d(t,{U:()=>u});var r=n(95155),a=n(12115),s=n(56827),l=n(49509);let i=[{key:"Left",label:"◀",ariaLabel:"Send Left"},{key:"Up",label:"▲",ariaLabel:"Send Up"},{key:"Down",label:"▼",ariaLabel:"Send Down"},{key:"Right",label:"▶",ariaLabel:"Send Right"},{key:"Enter",label:"↵",ariaLabel:"Send Enter"}],o={key:"Escape",label:"Esc",ariaLabel:"Send Escape"},c={key:"q",label:"q",ariaLabel:"Send q (quit)"};function u(e){let{worktreeId:t,cliToolId:n,instanceId:u,onKeysSent:d}=e,{activeKey:m,markPressed:f}=(0,l.t)(),p=(0,s.B)(t,n,u,d),h="codex"===n?[...i,o,c]:[...i,o],g=(0,a.useCallback)(e=>{f(e),p([e])},[f,p]);return(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5 py-1.5 bg-amber-50 dark:bg-amber-900/20 border border-amber-200 dark:border-amber-800/50 rounded-lg",role:"toolbar","aria-label":"Terminal navigation keys",children:[(0,r.jsx)("span",{className:"text-xs text-amber-700 dark:text-amber-400 mx-2",title:"Send navigation / escape keys when the terminal is stuck in a TUI overlay",children:"Navigate"}),h.map(e=>{let{key:t,label:n,ariaLabel:a}=e;return(0,r.jsx)("button",{type:"button",className:"min-w-[44px] min-h-[44px] px-3 py-2 text-sm font-medium rounded-md\n border border-amber-300 dark:border-amber-700\n focus:outline-none focus:ring-2 focus:ring-amber-500\n transition-colors duration-75\n ".concat(m===t?"bg-amber-500 text-white border-amber-500 scale-95":"bg-white dark:bg-gray-700 hover:bg-amber-50 dark:hover:bg-gray-600 active:bg-amber-100 dark:active:bg-gray-500"),"aria-label":a,onClick:()=>g(t),children:n},t)})]})}},73333:(e,t,n)=>{n.d(t,{E:()=>L});var r=n(95155),a=n(12115),s=n(18955),l=n(80344),i=n(79651),o=n(28019);function c(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e=>{var t;return null!=(t=e.description)?t:""};if(!t.trim())return e;let r=t.toLowerCase();return e.map(e=>({...e,commands:e.commands.filter(e=>{let t=e.name.toLowerCase().includes(r),a=n(e).toLowerCase().includes(r);return t||a})})).filter(e=>e.commands.length>0)}function u(e,t){return"codex-skill"===e.source?"antigravity"===t?"/".concat(e.name):"$".concat(e.name):"/".concat(e.name)}function d(e,t){var n;return e.descriptionKey?t(e.descriptionKey):null!=(n=e.description)?n:""}function m(e){let{groups:t,onSelect:n,highlightedIndex:a=-1,className:l="",cliToolId:i}=e,o=(0,s.c)("worktree"),c=0;return 0===t.length?(0,r.jsx)("div",{className:"text-sm text-muted-foreground p-4 text-center ".concat(l),children:o("slashCommands.empty")}):(0,r.jsx)("div",{className:"overflow-y-auto ".concat(l),children:t.map(e=>(0,r.jsxs)("div",{className:"mb-2",children:[(0,r.jsx)("div",{className:"px-3 py-1.5 text-xs font-semibold text-muted-foreground uppercase tracking-wider bg-muted",children:e.label}),(0,r.jsx)("div",{children:e.commands.map(e=>{var t;let s=c;c++;let l=s===a;return(0,r.jsxs)("button",{type:"button","data-command-item":!0,"data-highlighted":l,onClick:()=>n(e),className:"w-full px-3 py-2 text-left flex items-start gap-2 hover:bg-accent-50 dark:hover:bg-accent-900/30 transition-colors ".concat(l?"bg-accent-100 dark:bg-accent-900/40":""),children:[(0,r.jsx)("span",{className:"text-accent-600 dark:text-accent-400 font-mono text-sm flex-shrink-0",children:u(e,i)}),(null==(t=e.cliTools)?void 0:t.length)===1&&"codex"===e.cliTools[0]&&(0,r.jsx)("span",{className:"mt-0.5 rounded border border-accent-200 bg-accent-50 px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-accent-700 dark:border-accent-800 dark:bg-accent-950/40 dark:text-accent-300",children:"Codex"}),"user-catalog"===e.source&&(0,r.jsx)("span",{"data-testid":"user-catalog-badge",className:"mt-0.5 rounded border border-border bg-muted px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:o("slashCommands.sourceBadge.userCatalog")}),(0,r.jsx)("span",{className:"text-muted-foreground text-sm truncate",children:d(e,o)})]},e.name)})})]},e.category))})}function f(e,t,n){if(t<=0||n<=0)return 0;let r=e+t+8-n;return r>0?-Math.min(r,Math.max(0,e-8)):e<8?8-e:0}let p=(0,a.memo)(function(e){let{isOpen:t,groups:n,onSelect:l,onClose:i,isMobile:o=!1,position:u,onFreeInput:p,isCatalogStale:h=!1,cliToolId:g}=e,[x,b]=(0,a.useState)(""),[v,y]=(0,a.useState)(0),k=(0,a.useRef)(null),w=(0,a.useRef)(null),j=(0,a.useRef)({x:0,y:0}),[N,C]=(0,a.useState)({x:0,y:0}),S=(0,s.c)("worktree"),T=(0,s.c)("common"),I=(0,a.useMemo)(()=>c(n,x,e=>d(e,S)),[n,x,S]),M=(0,a.useMemo)(()=>I.flatMap(e=>e.commands),[I]);(0,a.useEffect)(()=>{t&&(b(""),y(0),setTimeout(()=>{var e;null==(e=k.current)||e.focus()},50))},[t]);let E=(0,a.useCallback)(e=>{l(e),i()},[l,i]),A=(0,a.useCallback)(e=>{if(t)switch(e.key){case"Escape":e.preventDefault(),i();break;case"ArrowDown":e.preventDefault(),y(e=>Math.min(e+1,M.length-1));break;case"ArrowUp":e.preventDefault(),y(e=>Math.max(e-1,0));break;case"Enter":e.preventDefault(),M[v]&&E(M[v])}},[t,M,v,i,E]);if((0,a.useEffect)(()=>{if(t)return document.addEventListener("keydown",A),()=>{document.removeEventListener("keydown",A)}},[t,A]),(0,a.useLayoutEffect)(()=>{let e=e=>{j.current=e,C(t=>t.x===e.x&&t.y===e.y?t:e)};if(!t||o)return void e({x:0,y:0});let n=w.current;if(!n)return;let r=n.getBoundingClientRect();e({x:f(r.left-j.current.x,r.width,window.innerWidth),y:f(r.top-j.current.y,r.height,window.innerHeight)})},[t,o,I,null==u?void 0:u.top,null==u?void 0:u.left]),!t)return null;let L=h?(0,r.jsx)("div",{"data-testid":"slash-command-stale-note",className:"px-3 py-2 border-t border-border text-xs text-muted-foreground",children:S("slashCommands.catalogStale.hint")}):null;if(o)return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"fixed inset-0 bg-black/50 z-40",onClick:i,"aria-hidden":"true"}),(0,r.jsxs)("div",{"data-testid":"slash-command-bottom-sheet",className:"fixed bottom-0 left-0 right-0 bg-surface rounded-t-xl z-50 max-h-[70vh] flex flex-col shadow-xl",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border",children:[(0,r.jsx)("h2",{className:"text-lg font-semibold text-foreground",children:S("slashCommands.title")}),(0,r.jsx)("button",{type:"button",onClick:i,"aria-label":T("close"),className:"p-2 rounded-full hover:bg-muted",children:(0,r.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,r.jsx)("div",{className:"px-4 py-2 border-b border-border",children:(0,r.jsx)("input",{ref:k,type:"text",value:x,onChange:e=>b(e.target.value),placeholder:S("slashCommands.searchPlaceholder"),className:"w-full px-3 py-2 border border-input bg-surface dark:bg-surface-2 text-foreground rounded-lg focus:outline-none focus:ring-2 focus:ring-ring"})}),p&&(0,r.jsxs)("button",{type:"button","data-testid":"free-input-button",onClick:()=>p(x),className:"w-full px-4 py-3 text-left border-b border-border flex items-center gap-2 hover:bg-accent-50 dark:hover:bg-accent-900/30 transition-colors",children:[(0,r.jsx)("span",{className:"text-accent-600 dark:text-accent-400",children:(0,r.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})})}),(0,r.jsx)("span",{className:"text-muted-foreground",children:S("slashCommands.enterCustomCommand")})]}),(0,r.jsx)(m,{groups:I,onSelect:E,highlightedIndex:v,className:"flex-1 overflow-y-auto pb-20",cliToolId:g}),L]})]});let R=u?{top:u.top,left:u.left}:{bottom:"100%",left:0,marginBottom:"4px"};return(0,r.jsxs)("div",{ref:w,role:"listbox","data-testid":"slash-command-dropdown",className:"absolute bg-surface border border-border rounded-lg shadow-lg z-50 w-80 max-h-96 flex flex-col",style:0!==N.x||0!==N.y?{...R,transform:"translate(".concat(N.x,"px, ").concat(N.y,"px)")}:R,children:[(0,r.jsx)("div",{className:"px-3 py-2 border-b border-border",children:(0,r.jsx)("input",{ref:k,type:"text",value:x,onChange:e=>b(e.target.value),placeholder:S("slashCommands.searchPlaceholder"),className:"w-full px-3 py-1.5 text-sm border border-input bg-surface dark:bg-surface-2 text-foreground rounded focus:outline-none focus:ring-1 focus:ring-ring"})}),p&&(0,r.jsxs)("button",{type:"button","data-testid":"free-input-button",onClick:()=>p(x),className:"w-full px-3 py-2 text-left border-b border-border flex items-center gap-2 hover:bg-accent-50 dark:hover:bg-accent-900/30 transition-colors text-sm",children:[(0,r.jsx)("span",{className:"text-accent-600 dark:text-accent-400",children:(0,r.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})})}),(0,r.jsx)("span",{className:"text-muted-foreground",children:S("slashCommands.enterCustomCommand")})]}),(0,r.jsx)(m,{groups:I,onSelect:E,highlightedIndex:v,className:"flex-1 overflow-y-auto",cliToolId:g}),L,(0,r.jsxs)("div",{className:"px-3 py-1.5 border-t border-border text-xs text-muted-foreground flex gap-3",children:[(0,r.jsxs)("span",{children:[(0,r.jsx)("kbd",{className:"px-1 py-0.5 bg-muted rounded",children:"Enter"})," ",S("slashCommands.selectHint")]}),(0,r.jsxs)("span",{children:[(0,r.jsx)("kbd",{className:"px-1 py-0.5 bg-muted rounded",children:"Esc"})," ",S("slashCommands.closeHint")]})]})]})});var h=n(3005);let g=(0,a.memo)(function(e){let{worktreeId:t,cliToolId:n,instanceId:l,disabled:i=!1,onInterrupt:o}=e,c=(0,s.c)("worktree"),[u,d]=(0,a.useState)(!1),m=(0,a.useRef)(0),f=(0,a.useCallback)(async()=>{let e=Date.now();if(!(e-m.current<1e3)){m.current=e,d(!0);try{let e=l&&l!==n?{cliToolId:n,instanceId:l}:{cliToolId:n},r=await fetch("/api/worktrees/".concat(t,"/interrupt"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(r.ok)null==o||o();else{let e=await r.json().catch(()=>({}));console.error("[InterruptButton] Failed to send interrupt:",e.error||r.statusText)}}catch(e){console.error("[InterruptButton] Error sending interrupt:",e)}finally{d(!1)}}},[t,n,l,o]);return(0,r.jsx)("button",{type:"button",onClick:f,disabled:i||u,className:"flex-shrink-0 p-2 text-danger hover:bg-danger/10 rounded-full transition-colors disabled:text-muted-foreground/40 disabled:hover:bg-transparent","aria-label":c("interrupt.stopProcessing"),"data-testid":"interrupt-button",children:u?(0,r.jsx)(h.y,{size:"md"}):(0,r.jsx)(x,{})})});function x(){return(0,r.jsx)("svg",{className:"h-5 w-5",fill:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})})}var b=n(44309),v=n(50386),y=n(62512),k=n(4788),w=n(5917),j=n(75426),N=n(77588);let C=(0,a.memo)(function(e){let{worktreeId:t,cliToolId:n,instanceId:l,disabled:i=!1,onActionComplete:c,showToast:u}=e,d=(0,s.c)("worktree.opencodeSession"),m=(0,o.SC)(),[f,p]=(0,a.useState)(null),[h,g]=(0,a.useState)(null),[x,C]=(0,a.useState)(null),[S,T]=(0,a.useState)(!1),[I,M]=(0,a.useState)(null),E="opencode"===n,A=null!=l?l:n,L=(0,a.useCallback)(e=>{if(u){M(null),u(e,"error");return}M(e)},[u]),R=(0,a.useCallback)((e,t,n)=>"NO_OPENCODE_PORT"===e.code?d("errorNoPort"):"NO_OPENCODE_SESSION"===e.code?d(n):e.error||t||d("errorUnknown"),[d]),P=(0,a.useCallback)(async()=>{if(E)try{let e=await fetch("/api/worktrees/".concat(t,"/opencode/share?instance=").concat(encodeURIComponent(A)));if(!e.ok)return void g(null);g(await e.json())}catch(e){g(null)}},[E,t,A]);(0,a.useEffect)(()=>{P()},[P]);let D=(0,a.useCallback)(async e=>{p(e),M(null);try{let n=await fetch("/api/worktrees/".concat(t,"/opencode/session"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:e,instanceId:A})});if(!n.ok){let t=await n.json().catch(()=>({}));console.error("[OpencodeSessionControls] action failed:",e,t.error||n.statusText),L(R(t,n.statusText,"errorNoSessionFork"));return}null==c||c(e),"list"!==e&&(C(null),P())}catch(e){console.error("[OpencodeSessionControls] request error:",e),L(d("errorRequestFailed"))}finally{p(null)}},[t,A,c,P,L,R,d]),z=(0,a.useCallback)(async()=>{if(await m({title:d("shareConfirmTitle"),description:d("shareConfirmBody"),confirmLabel:d("shareConfirmLabel"),variant:"danger"})){p("share"),M(null);try{let e=await fetch("/api/worktrees/".concat(t,"/opencode/share"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({instanceId:A})}),n=await e.json().catch(()=>({}));if(!e.ok||"string"!=typeof n.url){console.error("[OpencodeSessionControls] share failed:",n.error||e.statusText),L(R(n,e.statusText,"errorNoSessionShare")),P();return}C(n.url),T(!1),P()}catch(e){console.error("[OpencodeSessionControls] share request error:",e),L(d("errorRequestFailed"))}finally{p(null)}}},[m,d,t,A,P,L,R]),O=(0,a.useCallback)(async()=>{p("unshare"),M(null);try{let e=await fetch("/api/worktrees/".concat(t,"/opencode/share?instance=").concat(encodeURIComponent(A)),{method:"DELETE"});if(!e.ok){let t=await e.json().catch(()=>({}));console.error("[OpencodeSessionControls] unshare failed:",t.error||e.statusText),L(R(t,e.statusText,"errorNoSessionShare"));return}C(null),T(!1),P()}catch(e){console.error("[OpencodeSessionControls] unshare request error:",e),L(d("errorRequestFailed"))}finally{p(null)}},[t,A,P,L,R,d]),F=(0,a.useCallback)(async()=>{if(null!==x)try{await navigator.clipboard.writeText(x),T(!0),M(null)}catch(e){console.error("[OpencodeSessionControls] clipboard write failed:",e),L(d("errorCopyFailed"))}},[x,L,d]);if(!E)return null;let H=[{action:"new",icon:(0,r.jsx)(b.A,{className:"h-5 w-5","aria-hidden":"true"})},{action:"list",icon:(0,r.jsx)(v.A,{className:"h-5 w-5","aria-hidden":"true"})},{action:"fork",icon:(0,r.jsx)(y.A,{className:"h-5 w-5","aria-hidden":"true"})}],K="flex-shrink-0 p-2 text-muted-foreground hover:text-accent-600 hover:bg-accent-50 dark:hover:text-accent-400 dark:hover:bg-accent-900/30 rounded-full transition-colors disabled:text-muted-foreground/50 disabled:hover:bg-transparent";return(0,r.jsxs)("div",{className:"flex items-center gap-1","data-testid":"opencode-session-controls",children:[H.map(e=>{let{action:t,icon:n}=e;return(0,r.jsx)(o.$n,{variant:"ghost",type:"button",onClick:()=>void D(t),disabled:i||null!==f,className:K,"aria-label":d(t),title:d(t),"data-testid":"opencode-session-".concat(t),children:f===t?(0,r.jsx)(o.y$,{size:"md"}):n},t)}),(null==h?void 0:h.canShare)?(0,r.jsx)(o.$n,{variant:"ghost",type:"button",onClick:()=>void z(),disabled:i||null!==f,className:K,"aria-label":d("share"),title:d("share"),"data-testid":"opencode-session-share",children:"share"===f?(0,r.jsx)(o.y$,{size:"md"}):(0,r.jsx)(k.A,{className:"h-5 w-5","aria-hidden":"true"})}):null,null!==x?(0,r.jsxs)("span",{className:"flex min-w-0 items-center gap-1 rounded-full border border-warning-border bg-warning-subtle px-2 py-0.5 text-xs text-warning-foreground","data-testid":"opencode-share-result",children:[(0,r.jsx)("span",{className:"sr-only",children:d("sharePublicNotice")}),(0,r.jsx)("a",{href:x,target:"_blank",rel:"noopener noreferrer",className:"truncate text-accent-600 underline dark:text-accent-400",title:x,"data-testid":"opencode-share-url",children:x}),(0,r.jsx)(o.$n,{variant:"ghost",type:"button",onClick:()=>void F(),className:"flex-shrink-0 rounded-full p-1 text-muted-foreground hover:text-accent-600","aria-label":d("shareCopy"),title:d("shareCopy"),"data-testid":"opencode-share-copy",children:S?(0,r.jsx)(w.A,{className:"h-3.5 w-3.5","aria-hidden":"true"}):(0,r.jsx)(j.A,{className:"h-3.5 w-3.5","aria-hidden":"true"})}),(0,r.jsx)(o.$n,{variant:"ghost",type:"button",onClick:()=>void O(),disabled:null!==f,className:"flex-shrink-0 rounded-full p-1 text-muted-foreground hover:text-danger-foreground","aria-label":d("unshare"),title:d("unshare"),"data-testid":"opencode-session-unshare",children:"unshare"===f?(0,r.jsx)(o.y$,{size:"sm"}):(0,r.jsx)(N.A,{className:"h-3.5 w-3.5","aria-hidden":"true"})})]}):null,null!==I?(0,r.jsx)("span",{role:"alert",className:"flex min-w-0 items-center rounded-full border border-danger-border bg-danger-subtle px-2 py-0.5 text-xs text-danger-foreground",title:I,"data-testid":"opencode-session-error",children:(0,r.jsx)("span",{className:"truncate",children:I})}):null]})});var S=n(74385),T=n(38218),I=n(19985);let M="commandmate:draft-message:",E="Queued (session busy) — your message will run after the current task finishes.";function A(e,t){return"".concat(M).concat(e,":").concat(t)}let L=(0,a.memo)(function(e){let{worktreeId:t,onMessageSent:n,cliToolId:d,instanceId:m,isSessionRunning:f=!1,pendingInsertText:h,onInsertConsumed:x,splitIndex:b=0,onFocus:v,isProcessing:y=!1,showToast:k,autoYesSlot:w,agentModeSlot:j,onOptimisticSend:N}=e,L=(0,s.c)("worktree"),[R,P]=(0,a.useState)(""),[D,z]=(0,a.useState)(!1),[O,F]=(0,a.useState)(null),[H,K]=(0,a.useState)(!1),[q,B]=(0,a.useState)(!1),[U,W]=(0,a.useState)(!1),$=(0,a.useRef)(null),_=(0,a.useRef)(null),J=(0,a.useRef)(!1),Q=(0,a.useRef)(null),Y=(0,a.useRef)(null),G=(0,T.a)(),{groups:V,isCatalogStale:Z}=function(e,t){let[n,r]=(0,a.useState)([]),[s,i]=(0,a.useState)(!0),[o,u]=(0,a.useState)(null),[d,m]=(0,a.useState)(""),[f,p]=(0,a.useState)(t||"claude"),[h,g]=(0,a.useState)({}),x=(0,a.useCallback)(async()=>{try{var n;i(!0),u(null);let a=e?"/api/worktrees/".concat(e,"/slash-commands"):"/api/slash-commands";t&&(a+="?cliTool=".concat(t));let s=await fetch(a,{cache:"no-store"});if(!s.ok)throw Error("HTTP error ".concat(s.status));let l=await s.json();r(l.groups),p(l.cliTool||t||"claude"),g(null!=(n=l.catalogStaleness)?n:{})}catch(e){u((0,l.hS)(e)),r([]),g({})}finally{i(!1)}},[e,t]);(0,a.useEffect)(()=>{x()},[x]),(0,a.useEffect)(()=>{if(!e)return;let t=t=>{let n=t.detail;(null==n?void 0:n.worktreeId)===e&&x()};return window.addEventListener(S.I,t),()=>window.removeEventListener(S.I,t)},[e,x]);let b=(0,a.useMemo)(()=>n.flatMap(e=>e.commands),[n]),v=(0,a.useMemo)(()=>c(n,d),[n,d]),y=(0,a.useMemo)(()=>Object.values(h).some(e=>e.stale),[h]);return{groups:n,filteredGroups:v,allCommands:b,loading:s,error:o,filter:d,setFilter:m,refresh:(0,a.useCallback)(()=>{x()},[x]),cliTool:f,isCatalogStale:y}}(t,d),{attachedImage:X,fileInputRef:ee,isUploading:et,error:en,acceptAttribute:er,openFileDialog:ea,handleFileSelect:es,removeAttachment:el,resetAfterSend:ei}=function(e,t){let[n,r]=(0,a.useState)(null),[s,l]=(0,a.useState)(!1),[i,o]=(0,a.useState)(null),c=(0,a.useRef)(null),u=(0,a.useCallback)(()=>{var e;null==(e=c.current)||e.click()},[]),d=(0,a.useCallback)(async n=>{var a;let s=null==(a=n.target.files)?void 0:a[0];if(!s)return;o(null);let i=function(e){let t=e.name.lastIndexOf(".");if(-1===t)return"Unsupported file format";let n=(0,I.HB)(e.name.substring(t));if(!I.Hv.includes(n))return"Unsupported file format: ".concat(n);if(e.size>I.Fg){let e=I.Fg/1024/1024;return"File size exceeds ".concat(e,"MB limit")}return null}(s);if(i){o(i),c.current&&(c.current.value="");return}l(!0);try{let n=await t(e,s);r({file:s,path:n.path})}catch(e){o(e instanceof Error?e.message:"Upload failed")}finally{l(!1),c.current&&(c.current.value="")}},[e,t]),m=(0,a.useCallback)(()=>{r(null),o(null)},[]),f=(0,a.useCallback)(()=>{r(null)},[]);return{attachedImage:n,fileInputRef:c,isUploading:s,error:i,acceptAttribute:I.F5,openFileDialog:u,handleFileSelect:d,removeAttachment:m,resetAfterSend:f}}(t,(0,a.useCallback)((e,t)=>l.y.uploadImageFile(e,t),[]));(0,a.useEffect)(()=>{try{0===b&&function(e){try{let t="".concat(M).concat(e),n=window.localStorage.getItem(t);if(null===n)return;let r=A(e,0);null===window.localStorage.getItem(r)&&window.localStorage.setItem(r,n),window.localStorage.removeItem(t)}catch(e){}}(t);let e=window.localStorage.getItem(A(t,b));e?P(e):P("")}catch(e){}return()=>{Y.current&&clearTimeout(Y.current)}},[t,b]),(0,a.useEffect)(()=>{Y.current&&clearTimeout(Y.current),Y.current=setTimeout(()=>{try{let e=A(t,b);R?window.localStorage.setItem(e,R):window.localStorage.removeItem(e)}catch(e){}},500)},[R,t,b]),(0,a.useEffect)(()=>{let e=$.current;e&&(R?(e.style.height="auto",e.style.height="".concat(Math.min(e.scrollHeight,160),"px")):e.style.height="24px")},[R]),(0,a.useEffect)(()=>{h&&(P(e=>""===e.trim()?h:e+"\n\n"+h),null==x||x())},[h,x]);let eo=(0,a.useCallback)(async()=>{if(H||!R.trim()&&!X||D)return;let e=R.trim(),r=d||"claude",a={cliToolId:r};if(m&&m!==r&&(a.instanceId=m),X&&(a.imagePath=X.path),N){F(null),N(e,a),P(""),W(!1),ei();try{window.localStorage.removeItem(A(t,b))}catch(e){}y&&(null==k||k(E,"warning")),null==n||n(r);return}try{z(!0),F(null);let s=await l.y.sendMessage(t,e,a);P(""),W(!1),ei();try{window.localStorage.removeItem(A(t,b))}catch(e){}y&&(null==k||k(E,"warning")),null==n||n(r,s)}catch(e){F((0,l.hS)(e))}finally{z(!1)}},[H,R,X,D,t,d,m,n,ei,b,y,k,N]),ec=(0,a.useCallback)(async e=>{e.preventDefault(),await eo()},[eo]),eu=(0,a.useCallback)(()=>{K(!0),J.current=!1,_.current&&clearTimeout(_.current)},[]),ed=(0,a.useCallback)(()=>{K(!1),J.current=!0,_.current&&clearTimeout(_.current),_.current=setTimeout(()=>{J.current=!1},300)},[]),em=(0,a.useCallback)(e=>{var t;P("".concat(u(e,d)," ")),B(!1),null==(t=$.current)||t.focus()},[d]),ef=(0,a.useCallback)(()=>{var e;B(!1),W(!1),null==(e=$.current)||e.focus()},[]),ep=(0,a.useCallback)(e=>{B(!1),W(!0),P(e?"/".concat(e):"/"),setTimeout(()=>{var e;null==(e=$.current)||e.focus()},50)},[]),eh=(0,a.useCallback)(e=>{let t=e.target.value;if(P(t),""===t){W(!1),B(!1);return}if(U)return;let n="/"===t||t.startsWith("/")&&!t.includes(" "),r="codex"===d&&("$"===t||t.startsWith("$")&&!t.includes(" "));n||r?B(!0):B(!1)},[U,d]),eg=(0,a.useCallback)(e=>{let{keyCode:t}=e.nativeEvent;if(229!==t){if("Escape"===e.key&&q){e.preventDefault(),ef();return}if(J.current&&"Enter"===e.key){J.current=!1;return}if("Enter"===e.key&&!H&&(!q||U)){if(G)return;e.shiftKey||(e.preventDefault(),eo())}}},[q,U,H,G,eo,ef]);return(0,r.jsxs)("div",{ref:Q,className:"space-y-2 relative","data-testid":"message-input-container",children:[(O||en)&&(0,r.jsx)("div",{className:"p-2 bg-danger-subtle border border-danger-border rounded text-sm text-danger-foreground",children:O||en}),X&&(0,r.jsxs)("div",{className:"flex items-center gap-2 px-4 py-1.5 bg-accent-50 dark:bg-accent-900/20 border border-accent-200 dark:border-accent-800 rounded-lg text-sm","data-testid":"image-attachment-preview",children:[(0,r.jsx)("svg",{className:"h-4 w-4 flex-shrink-0 text-accent-600 dark:text-accent-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})}),(0,r.jsx)("span",{className:"truncate text-accent-800 dark:text-accent-300",children:X.file.name}),(0,r.jsx)("button",{type:"button",onClick:el,className:"flex-shrink-0 p-0.5 text-accent-600 hover:text-danger-foreground dark:text-accent-400 rounded transition-colors","aria-label":L("composer.removeAttachment"),"data-testid":"remove-attachment-button",children:(0,r.jsx)("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,r.jsx)("input",{ref:ee,type:"file",accept:er,onChange:es,className:"hidden","data-testid":"image-file-input"}),(0,r.jsxs)("form",{onSubmit:ec,className:"rounded-xl bg-surface border border-border shadow-sm px-3 py-2 focus-within:ring-2 focus-within:ring-accent-500/40 transition-shadow flex flex-col gap-1.5",children:[(0,r.jsxs)("div",{className:G?"flex flex-col gap-1":"flex items-center gap-2",children:[G&&(0,r.jsxs)("div",{className:"flex items-center gap-1",children:[(0,r.jsx)(o.$n,{variant:"ghost",type:"button",onClick:()=>{U&&W(!1),B(!0)},className:"flex-shrink-0 p-2 text-muted-foreground hover:text-accent-600 hover:bg-accent-50 dark:hover:text-accent-400 dark:hover:bg-accent-900/30 rounded-full transition-colors","aria-label":L("composer.showSlashCommands"),"data-testid":"mobile-command-button",children:(0,r.jsx)("svg",{className:"h-5 w-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7 20l4-16m2 16l4-16M6 9h14M4 15h14"})})}),(0,r.jsx)(o.$n,{variant:"ghost",type:"button",onClick:ea,disabled:et||D,className:"flex-shrink-0 p-2 text-muted-foreground hover:text-accent-600 hover:bg-accent-50 dark:hover:text-accent-400 dark:hover:bg-accent-900/30 rounded-full transition-colors disabled:text-muted-foreground/50 disabled:hover:bg-transparent","aria-label":L("composer.attachImage"),"data-testid":"attach-image-button",children:et?(0,r.jsx)(o.y$,{size:"md"}):(0,r.jsx)("svg",{className:"h-5 w-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15.172 7l-6.586 6.586a2 2 0 102.828 2.828l6.414-6.586a4 4 0 00-5.656-5.656l-6.415 6.585a6 6 0 108.486 8.486L20.5 13"})})}),(0,r.jsx)(C,{worktreeId:t,cliToolId:d||"claude",instanceId:m,disabled:!f,showToast:k}),j,(0,r.jsx)(g,{worktreeId:t,cliToolId:d||"claude",instanceId:m,disabled:!f})]}),!G&&(0,r.jsx)(o.$n,{variant:"ghost",type:"button",onClick:ea,disabled:et||D,className:"flex-shrink-0 p-2 text-muted-foreground hover:text-accent-600 hover:bg-accent-50 dark:hover:text-accent-400 dark:hover:bg-accent-900/30 rounded-full transition-colors disabled:text-muted-foreground/50 disabled:hover:bg-transparent","aria-label":L("composer.attachImage"),"data-testid":"attach-image-button",children:et?(0,r.jsx)(o.y$,{size:"md"}):(0,r.jsx)("svg",{className:"h-5 w-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15.172 7l-6.586 6.586a2 2 0 102.828 2.828l6.414-6.586a4 4 0 00-5.656-5.656l-6.415 6.585a6 6 0 108.486 8.486L20.5 13"})})}),(0,r.jsxs)("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[(0,r.jsx)("textarea",{ref:$,"data-testid":"message-input-textarea",value:R,onChange:eh,onKeyDown:eg,onCompositionStart:eu,onCompositionEnd:ed,onFocus:v,placeholder:L("composer.placeholder"),disabled:D,rows:1,inputMode:"text",enterKeyHint:"send",className:"flex-1 outline-none bg-transparent resize-none overflow-y-auto scrollbar-thin",style:{minHeight:"36px",maxHeight:"160px",paddingTop:"8px",paddingBottom:"8px",lineHeight:"20px"}}),!G&&(0,r.jsx)(C,{worktreeId:t,cliToolId:d||"claude",instanceId:m,disabled:!f,showToast:k}),!G&&j,!G&&(0,r.jsx)(g,{worktreeId:t,cliToolId:d||"claude",instanceId:m,disabled:!f}),(0,r.jsx)(o.$n,{variant:"ghost",type:"submit","data-testid":"send-message-button","data-can-send":String((!!R.trim()||!!X)&&!D),disabled:!R.trim()&&!X||D,className:"flex-shrink-0 p-2 rounded-full transition-colors disabled:hover:bg-transparent ".concat((R.trim()||X)&&!D?"bg-accent-600 text-white hover:bg-accent-700 shadow-sm":"text-muted-foreground/50"),"aria-label":L("composer.sendMessage"),children:D?(0,r.jsx)(o.y$,{size:"md"}):(0,r.jsx)("svg",{className:"h-5 w-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 19l9 2-9-18-9 18 9-2zm0 0v-8"})})})]})]}),(w||!G)&&(0,r.jsxs)("div",{className:"flex items-center justify-between gap-2 min-w-0","data-testid":"composer-meta-row",children:[(0,r.jsx)("div",{className:"flex items-center gap-2 min-w-0 overflow-x-auto scrollbar-hide",children:w}),!G&&(0,r.jsxs)("div",{className:"flex flex-shrink-0 items-center gap-1.5 text-[11px] text-muted-foreground select-none",children:[(0,r.jsx)(i.u,{children:"/"}),(0,r.jsx)("span",{children:L("composer.commandsHint")}),(0,r.jsx)("span",{"aria-hidden":"true",className:"opacity-50",children:"\xb7"}),(0,r.jsx)(i.u,{children:"⇧"}),(0,r.jsx)(i.u,{children:"↵"}),(0,r.jsx)("span",{children:L("composer.newlineHint")})]})]})]}),(0,r.jsx)(p,{isOpen:q,groups:V,onSelect:em,onClose:ef,isMobile:G,onFreeInput:ep,isCatalogStale:Z,cliToolId:d})]})})},75676:(e,t,n)=>{n.d(t,{jg:()=>s,kQ:()=>l,mR:()=>c,mS:()=>o,wf:()=>r});let r="terminal",a=new Set(["terminal","chat"]);function s(e){return"string"==typeof e&&a.has(e)}let l={data:null,messageId:null,visible:!1,answering:!1},i={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:{...l},layout:{...i},error:{...o},messages:[],wsConnected:!1}}},76351:(e,t,n)=>{n.d(t,{z9:()=>s,$s:()=>o,t6:()=>l,Ni:()=>i,eJ:()=>u,$B:()=>d,P0:()=>c});var r=n(82912),a=n.n(r);n(95704);let s=[36e5,108e5,288e5],l=36e5,i={36e5:"autoYes.durations.1h",108e5:"autoYes.durations.3h",288e5:"autoYes.durations.8h"},o=1e3;function c(e){if(e.length>500)return{valid:!1,error:"Pattern must be ".concat(500," characters or less")};if(!a()(e))return{valid:!1,error:"Pattern may cause performance issues (catastrophic backtracking detected)"};try{return new RegExp(e),{valid:!0}}catch(e){return{valid:!1,error:"Invalid regular expression syntax"}}}function u(e,t){arguments.length>2&&void 0!==arguments[2]&&arguments[2];try{return e.test(t)}catch(e){return null}}function d(e){let t=Math.max(0,e-Date.now()),n=Math.floor(t/36e5),r=Math.floor(t%36e5/6e4),a=Math.floor(t%6e4/1e3);return n>0?"".concat(n,":").concat(r.toString().padStart(2,"0"),":").concat(a.toString().padStart(2,"0")):"".concat(r.toString().padStart(2,"0"),":").concat(a.toString().padStart(2,"0"))}},78596:(e,t,n)=>{n.d(t,{l5:()=>d});var r=n(46980),a=n.n(r),s=n(62459),l=n.n(s),i=n(68872),o=n(51515);let c=new(l())({fg:"#d1d5db",bg:"#1f2937",newline:!0,escapeXML:!0}),u=/[\x40-\x7e]/;function d(e){let t=function(e){if(e.length<=i.ZJ)return e;let t=i.ED+"\n",n=i.ZJ-t.length;if(n<=0)return i.ED.slice(0,i.ZJ);let r=e.length-n,a=e.indexOf("\n",r);if(-1!==a&&a-r<=i.yi)return t+e.slice(a+1);let s=function(e,t){let n=e.lastIndexOf("\x1b",t-1);if(-1===n)return t;let r=e.slice(n+1,t);if(u.test(r.slice(1)))return t;for(let n=t;n<e.length;n++)if(u.test(e[n]))return n+1;return e.length}(e,r),l=e.charCodeAt(s);return l>=56320&&l<=57343&&(s+=1),t+e.slice(s)}(e.replace(/\0/g,"")),n=(0,o.wJ)(t),r=c.toHtml(n);return a().sanitize(r,{ALLOWED_TAGS:["span","br"],ALLOWED_ATTR:["style"],ALLOW_DATA_ATTR:!1})}},78660:(e,t,n)=>{n.d(t,{E2:()=>i,F0:()=>s,Yr:()=>o,e1:()=>l});var r=n(12115),a=n(20877);let s=500,l=300,i=2;function o(e){let{output:t,containerRef:n}=e,[o,c]=(0,r.useState)(!1),[u,d]=(0,r.useState)(""),[m,f]=(0,r.useState)([]),[p,h]=(0,r.useState)(0),[g,x]=(0,r.useState)(!1),b=(0,r.useRef)(null),v=(0,r.useRef)(""),y=m.length,k=(0,r.useCallback)(e=>{var t;if(e.length<i||!n.current)return{positions:[],capped:!1};let r=(null!=(t=n.current.textContent)?t:"").toLowerCase(),a=e.toLowerCase(),l=[],o=0;for(;l.length<s;){let t=r.indexOf(a,o);if(-1===t)break;l.push({start:t,end:t+e.length}),o=t+1}let c=l.length>=s&&-1!==r.indexOf(a,o);return{positions:l,capped:c}},[n]),w=(0,r.useCallback)(e=>{let{positions:t,capped:r}=k(e);f(t),h(0),x(r),n.current&&(t.length>0?(0,a.aX)(n.current,t,0):(0,a.HI)())},[k,n]),j=(0,r.useCallback)(e=>{d(e),b.current&&clearTimeout(b.current),v.current=e,b.current=setTimeout(()=>{w(e)},l)},[w]),N=(0,r.useCallback)(()=>{c(!0)},[]),C=(0,r.useCallback)(()=>{c(!1),d(""),v.current="",f([]),h(0),x(!1),b.current&&clearTimeout(b.current),(0,a.HI)()},[]),S=(0,r.useCallback)(()=>{0!==y&&h(e=>{let t=(e+1)%y;return n.current&&m.length>0&&(0,a.aX)(n.current,m,t),t})},[y,m,n]),T=(0,r.useCallback)(()=>{0!==y&&h(e=>{let t=(e-1+y)%y;return n.current&&m.length>0&&(0,a.aX)(n.current,m,t),t})},[y,m,n]);return(0,r.useEffect)(()=>{v.current.length<i||w(v.current)},[t,w]),(0,r.useEffect)(()=>()=>{b.current&&clearTimeout(b.current),(0,a.HI)()},[]),{isOpen:o,query:u,matchCount:y,currentIndex:p,isAtMaxMatches:g,openSearch:N,closeSearch:C,setQuery:j,nextMatch:S,prevMatch:T}}},79321:(e,t,n)=>{n.d(t,{CL:()=>z,Et:()=>B,UI:()=>K,a3:()=>O,vY:()=>$,ZS:()=>Z,Gn:()=>ee,qI:()=>ea,PZ:()=>W,ZK:()=>er});var r=n(95155),a=n(12115),s=n(18955),l=n(24033),i=n(27937),o=n(1473),c=n(53842),u=n(22479),d=n(76907),m=n(49502),f=n(35299),p=n(6132),h=n(48314),g=n(65229),x=n(75426),b=n(82437),v=n(54916),y=n(51238),k=n(10934),w=n(5225),j=n(4300),N=n(83012),C=n(51515),S=n(89568),T=n(99112),I=n(70738);let M=/^>[ \t]*\*\*Thinking(?:[ \t]*\((\d+)\))?\*\*[ \t]*$/,E="Tool calls",A=new RegExp("^>[ \\t]*\\*\\*".concat(E,"(?:[ \\t]*\\((\\d+)\\))?\\*\\*[ \\t]*$")),L=/^- `[^`\n]+`(?: — .*)?$/;function R(e){return{prose:e,toolLog:"",toolCalls:0}}function P(e){let t=function(e){if("string"!=typeof e||0===e.length)return R(null!=e?e:"");if(!e.includes(E)&&!e.startsWith("- `"))return R(e);let t=e.split("\n"),n=t.length;for(;n>0&&0===t[n-1].trim().length;)n-=1;for(let e=n-1;e>=0;e-=1){let r=A.exec(t[e]);if(!r){if(!t[e].startsWith(">"))break;continue}if(e>0&&t[e-1].startsWith(">"))break;let a=t.slice(e+1,n).map(e=>e.replace(/^>[ \t]?/,"")).join("\n").replace(/^\n+/,"").replace(/\n+$/,""),s=r[1]?Number.parseInt(r[1],10):0;return{prose:t.slice(0,e).join("\n").replace(/\n+$/,""),toolLog:a,toolCalls:Number.isFinite(s)&&s>0?s:a.split("\n").filter(e=>e.trim().length>0).length}}let r=0;for(;r<t.length&&L.test(t[r]);)r+=1;return 0===r?R(e):{prose:t.slice(r).join("\n").replace(/^\n+/,""),toolLog:t.slice(0,r).join("\n"),toolCalls:r}}(e),n=function(e){if(!e.includes("Thinking"))return{body:e,reasoning:null,blocks:0};let t=e.split("\n"),n=[],r=[],a=0,s=0;for(;s<t.length;){let e=M.exec(t[s]),l=0===s||!t[s-1].startsWith(">");if(!e||!l){n.push(t[s]),s+=1;continue}let i=s+1;for(;i<t.length&&t[i].startsWith(">");)i+=1;let o=e[1]?Number.parseInt(e[1],10):1;a+=Number.isFinite(o)&&o>0?o:1,r.push(t.slice(s+1,i).map(e=>e.replace(/^>[ \t]?/,"")).join("\n").replace(/^\n+/,"").replace(/\n+$/,"")),s=i}return 0===a?{body:e,reasoning:null,blocks:0}:{body:n.join("\n").replace(/\n{3,}/g,"\n\n").trim(),reasoning:r.join("\n\n").replace(/^\n+/,"").replace(/\n+$/,""),blocks:a}}(t.prose);return{body:n.body,reasoning:n.reasoning,reasoningBlocks:n.blocks,toolLog:t.toolLog,toolCalls:t.toolCalls,folded:t.prose!==e||null!==n.reasoning}}var D=n(92147);let z="mr-auto w-full max-w-full px-1 text-sm text-foreground",O="chat-bubble",F="chat-turn-header",H="chat-turn-time",K="flex w-full flex-col gap-1 pb-3",q="max-w-full overflow-x-hidden break-words [word-break:break-word]",B="".concat(q," chat-md"),U=a.createContext({showAll:!1}),W=U.Provider,$={showAll:!0},_="mr-auto flex w-fit max-w-full items-center gap-1.5 rounded-full border border-border bg-surface-2 px-2.5 py-1 text-xs text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-ring";function J(){let{showAll:e}=a.useContext(U),[t,n]=(0,a.useState)(null),r=null!==t&&t.against===e?t.isOpen:e,s=(0,a.useCallback)(()=>n({against:e,isOpen:!r}),[e,r]);return{isOpen:r,toggle:s}}let Q=(0,a.memo)(function(e){let{blocks:t,children:n}=e,a=(0,s.c)("worktree"),{isOpen:c,toggle:u}=J(),d=c?l.A:i.A;return(0,r.jsxs)("div",{"data-testid":"chat-thinking-group","data-thinking-blocks":t,className:"mt-2 flex w-full flex-col gap-1",children:[(0,r.jsxs)("button",{type:"button","data-testid":"chat-thinking-toggle",onClick:u,"aria-expanded":c,"aria-label":a(c?"chatTranscript.thinking.collapse":"chatTranscript.thinking.expand"),className:_,children:[(0,r.jsx)(o.A,{size:12,"aria-hidden":"true"}),(0,r.jsx)("span",{children:a("chatTranscript.thinking.summary",{count:t})}),(0,r.jsx)(d,{size:12,"aria-hidden":"true"})]}),c&&(0,r.jsx)("div",{"data-testid":"chat-thinking-body",className:"max-w-full border-l-2 border-border pl-2 text-muted-foreground",children:n})]})}),Y=(0,a.memo)(function(e){let{toolCalls:t,children:n}=e,a=(0,s.c)("worktree"),{isOpen:o,toggle:u}=J(),d=o?l.A:i.A;return(0,r.jsxs)("div",{"data-testid":"chat-tool-log-group","data-tool-calls":t,className:"mt-2 flex w-full flex-col gap-1",children:[(0,r.jsxs)("button",{type:"button","data-testid":"chat-tool-log-toggle",onClick:u,"aria-expanded":o,"aria-label":a(o?"chatTranscript.toolLog.collapse":"chatTranscript.toolLog.expand"),className:_,children:[(0,r.jsx)(c.A,{size:12,"aria-hidden":"true"}),(0,r.jsx)("span",{children:a("chatTranscript.toolLog.summary",{count:t})}),(0,r.jsx)(d,{size:12,"aria-hidden":"true"})]}),o&&(0,r.jsx)("div",{"data-testid":"chat-tool-log-body",className:"max-w-full border-l-2 border-border pl-2 text-muted-foreground",children:n})]})}),G={claude:!0,codex:!0,antigravity:!0,"command-code":!0,opencode:!0,copilot:!1,gemini:!1,"vibe-local":!1},V=(0,a.memo)(function(e){let{children:t}=e,n=(0,s.c)("worktree"),{isOpen:a,toggle:o}=J(),c=a?l.A:i.A;return(0,r.jsxs)("div",{"data-testid":"chat-pane-scrape-group",className:"flex w-full flex-col gap-1",children:[(0,r.jsxs)("button",{type:"button","data-testid":"chat-pane-scrape-toggle",onClick:o,"aria-expanded":a,className:_,children:[(0,r.jsx)(u.A,{size:12,"aria-hidden":"true"}),(0,r.jsx)("span",{children:n("agentSource.kindScraper")}),(0,r.jsx)(c,{size:12,"aria-hidden":"true"})]}),a&&(0,r.jsx)("div",{"data-testid":"chat-pane-scrape-body",className:"max-w-full border-l-2 border-border pl-2 text-muted-foreground",children:t})]})}),Z=(0,a.memo)(function(e){var t;let{href:n,children:l,onFilePathClick:i,...o}=e,c=(0,s.c)("worktree"),u=n?(0,I.z)(n):null,d=(0,a.useCallback)(e=>{n&&(e.preventDefault(),i(n))},[n,i]);return n&&null!==u&&"anchor"!==u?"external"===u?(0,r.jsx)("a",{...o,href:n,target:"_blank",rel:"noopener noreferrer",children:l}):(0,r.jsx)("a",{...o,href:n,"data-testid":"chat-file-link",onClick:d,className:"cursor-pointer font-mono text-sm text-accent-700 underline-offset-2 hover:underline dark:text-accent-400","aria-label":c("conversation.openFile",{path:null!=(t=(0,I.h)(n))?t:n}),children:l}):(0,r.jsx)("a",{...o,href:n,children:l})}),X=(0,a.memo)(function(e){let{content:t,onFilePathClick:n}=e,l=(0,s.c)("worktree"),i=(0,a.useMemo)(()=>(0,S.ML)(t),[t]),o=(0,a.useCallback)(e=>()=>n(e),[n]);return(0,r.jsx)("span",{children:i.map((e,t)=>"path"===e.type?(0,r.jsx)("button",{type:"button",onClick:o(e.content),className:"cursor-pointer font-mono text-sm text-accent-700 underline-offset-2 hover:underline dark:text-accent-400","aria-label":l("conversation.openFile",{path:e.content}),children:e.content},t):(0,r.jsx)("span",{children:e.content},t))})}),ee=(0,a.memo)(function(e){let{content:t,onFilePathClick:n}=e,s=(0,a.useMemo)(()=>{let e=e=>a.Children.map(e,e=>"string"==typeof e?(0,r.jsx)(X,{content:e,onFilePathClick:n}):e);return{p:t=>{let{children:n}=t;return(0,r.jsx)("p",{children:e(n)})},li:t=>{let{children:n}=t;return(0,r.jsx)("li",{children:e(n)})},td:t=>{let{children:n}=t;return(0,r.jsx)("td",{children:e(n)})},th:t=>{let{children:n}=t;return(0,r.jsx)("th",{children:e(n)})},strong:t=>{let{children:n}=t;return(0,r.jsx)("strong",{children:e(n)})},em:t=>{let{children:n}=t;return(0,r.jsx)("em",{children:e(n)})},a:e=>{let{href:t,children:a,node:s,...l}=e;return(0,r.jsx)(Z,{...l,href:t,onFilePathClick:n,children:a})}}},[n]),l=(0,a.useMemo)(()=>[k.A,w.A],[]),i=(0,a.useMemo)(()=>P(t),[t]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(y.oz,{remarkPlugins:T.eT,rehypePlugins:l,components:s,children:i.body}),null!==i.reasoning&&(0,r.jsx)(Q,{blocks:i.reasoningBlocks,children:(0,r.jsx)(y.oz,{remarkPlugins:T.eT,rehypePlugins:l,components:s,children:i.reasoning})}),i.toolCalls>0&&(0,r.jsx)(Y,{toolCalls:i.toolCalls,children:(0,r.jsx)(y.oz,{remarkPlugins:T.eT,rehypePlugins:l,components:s,children:i.toolLog})})]})}),et={human:"chatTranscript.toolApproval.answeredByHuman",auto:"chatTranscript.toolApproval.autoApproved",terminal:"chatTranscript.toolApproval.answeredInTerminal",pending:"chatTranscript.toolApproval.awaitingAnswer",unclassified:"chatTranscript.toolApproval.unclassified",unknown:"chatTranscript.toolApproval.resolved"},en={...et,auto:"chatTranscript.toolApproval.autoAnswered"},er=(0,a.memo)(function(e){let{entries:t}=e,n=(0,s.c)("worktree"),{isOpen:a,toggle:o}=J();if(0===t.length)return null;let c=a?l.A:i.A,u=(0,D.rS)(t),f=u.questions+u.confirmations>0,p=u.approvals>0,h=[];p&&h.push(n("chatTranscript.toolApproval.summary",{count:u.approvals})),u.questions>0&&h.push(n("chatTranscript.toolApproval.summaryQuestions",{count:u.questions})),u.confirmations>0&&h.push(n(p||u.questions>0?"chatTranscript.toolApproval.summaryConfirmations":"chatTranscript.toolApproval.summaryConfirmationsOnly",{count:u.confirmations}));let g=p?d.A:m.A;return(0,r.jsxs)("div",{"data-testid":"chat-tool-approval-group","data-approval-count":t.length,"data-approvals":u.approvals,"data-questions":u.questions,"data-confirmations":u.confirmations,className:"".concat(K," items-start"),children:[(0,r.jsxs)("button",{type:"button","data-testid":"chat-tool-approval-toggle",onClick:o,"aria-expanded":a,"aria-label":n("chatTranscript.toolApproval.".concat(a?"collapse":"expand").concat(f&&p?"Mixed":f?"Questions":"")),className:_,children:[(0,r.jsx)(g,{size:12,"aria-hidden":"true"}),(0,r.jsx)("span",{children:h.join(n("chatTranscript.toolApproval.summarySeparator"))}),(0,r.jsx)(c,{size:12,"aria-hidden":"true"})]}),a&&(0,r.jsx)("ul",{"data-testid":"chat-tool-approval-list",className:"mr-auto flex w-full max-w-full flex-col gap-1 pl-1",children:t.map(e=>{let t="question"===e.kind,a=t?en:et,s=t?"confirmation"===e.phase?"chatTranscript.toolApproval.submitConfirmation":"chatTranscript.toolApproval.unlabeledQuestion":"chatTranscript.toolApproval.unlabeled";return(0,r.jsxs)("li",{"data-testid":"chat-tool-approval-entry","data-approval-outcome":e.outcome,"data-approval-kind":e.kind,"data-approval-phase":e.phase,"data-approval-confirmation":e.confirmationOutcome,"data-approval-audit":e.isPermissionAudit?"true":void 0,"data-approval-merged":e.messageIds.length,className:"flex max-w-full flex-wrap items-baseline gap-x-2 gap-y-0.5 text-xs text-muted-foreground",children:["confirmation"===e.phase&&e.label&&(0,r.jsx)("span",{"data-testid":"chat-tool-approval-phase",children:n("chatTranscript.toolApproval.submitConfirmation")}),(0,r.jsx)("span",{className:"min-w-0 break-words [word-break:break-word] font-mono text-foreground",children:e.label||n(s)}),(0,r.jsx)("span",{"data-testid":"chat-tool-approval-outcome",children:n(a[e.outcome])}),e.confirmationOutcome&&(0,r.jsx)("span",{"data-testid":"chat-tool-approval-confirmation",children:n("chatTranscript.toolApproval.confirmation",{outcome:n(en[e.confirmationOutcome])})})]},e.id)})})]})}),ea=(0,a.memo)(function(e){var t,n;let{message:l,showHeader:i,header:o,onFilePathClick:c,onCopy:u,onInsertToMessage:d,onRetryPending:m,onDiscardPending:y}=e,k=(0,s.c)("worktree"),w=(0,s.c)("common"),S="user"===l.role,T=l.optimisticState,I=(0,j.bx)(l.requestId),M="assistant"===l.role&&"normal"===l.messageType&&("string"!=typeof l.requestId||!(l.requestId.length>0))&&!0===G[null!=(t=l.cliToolId)?t:"claude"],E=(0,a.useMemo)(()=>"number"==typeof(null==o?void 0:o.startedAtMs)?new Date(o.startedAtMs):null,[null==o?void 0:o.startedAtMs]),A=(0,N.g8)(l.timestamp,E),L=i?"role":(null==o?void 0:o.variant)==="time"?"time":"none",R=(0,a.useMemo)(()=>{var e;return"string"==typeof(e=l.content)?(0,C.aJ)(e):""},[l.content]),D=I?l.content:R,U=(0,a.useMemo)(()=>I?P(l.content):null,[I,l.content]),W=U?U.body.trim().length>0?U.body:null:R,$=U?(n=l.content,U.folded?n:null):null,_=[S?"".concat("w-fit rounded-2xl border px-3 py-2 text-sm text-foreground"," ").concat("ml-auto"," ").concat("max-w-[85%] sm:max-w-[75%]"," rounded-br-md"):z,S&&"error"===T?"border-danger-border bg-danger-subtle":"",S&&"error"!==T?"border-accent-500/30 bg-accent-500/10":"","sending"===T?"opacity-70":""].filter(Boolean).join(" "),J=I?B:"".concat(q," whitespace-pre-wrap");return(0,r.jsxs)("div",{"data-testid":"chat-message-row","data-role":l.role,"data-row-message-id":l.id,className:[K,l.archived?"opacity-60":""].filter(Boolean).join(" "),children:["role"===L&&(0,r.jsxs)("div",{"data-testid":F,"data-header-variant":"role",className:["flex flex-wrap items-center gap-x-2 px-1 text-xs text-muted-foreground",S?"justify-end":""].filter(Boolean).join(" "),children:[(0,r.jsx)("span",{className:S?"font-medium text-accent-700 dark:text-accent-400":"font-medium",children:k(S?"conversation.you":"conversation.assistant")}),A&&(0,r.jsx)("span",{"data-testid":H,children:A})]}),"time"===L&&A&&(0,r.jsxs)("div",{"data-testid":F,"data-header-variant":"time",role:"separator","aria-label":k("chatTranscript.turnBoundary"),className:"flex w-full items-center gap-2 px-1 pt-2 text-xs text-muted-foreground",children:[(0,r.jsx)("span",{className:"h-px min-w-[1rem] flex-1 bg-border","aria-hidden":"true"}),(0,r.jsx)("span",{"data-testid":H,className:"shrink-0 whitespace-nowrap",children:A}),(0,r.jsx)("span",{className:"h-px min-w-[1rem] flex-1 bg-border","aria-hidden":"true"})]}),(0,r.jsx)("div",{"data-testid":O,className:_,children:M?(0,r.jsx)(V,{children:(0,r.jsx)("div",{"data-message-id":l.id,className:J,children:(0,r.jsx)(X,{content:R,onFilePathClick:c})})}):(0,r.jsx)("div",{"data-message-id":l.id,"data-markdown":I?"true":void 0,className:J,children:I?(0,r.jsx)(ee,{content:l.content,onFilePathClick:c}):(0,r.jsx)(X,{content:R,onFilePathClick:c})})}),(0,r.jsxs)("div",{"data-testid":"chat-message-actions",className:["flex items-center gap-1 px-1",S?"justify-end":""].filter(Boolean).join(" "),children:["sending"===T&&(0,r.jsxs)("span",{"data-testid":"chat-optimistic-sending",className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,r.jsx)(f.A,{size:12,className:"animate-spin","aria-hidden":"true"}),(0,r.jsx)("span",{children:k("conversation.sending")})]}),"error"===T&&(0,r.jsxs)("span",{"data-testid":"chat-optimistic-error",className:"flex items-center gap-1 text-xs text-danger-foreground",children:[(0,r.jsx)(p.A,{size:12,"aria-hidden":"true"}),(0,r.jsx)("span",{children:k("conversation.failedToSend")})]}),"error"===T?(0,r.jsxs)(r.Fragment,{children:[m&&(0,r.jsxs)("button",{type:"button","data-testid":"chat-pending-retry",onClick:()=>m(l.id),className:"flex items-center gap-1 rounded px-1.5 py-0.5 text-xs text-accent-700 transition-colors hover:bg-muted dark:text-accent-400","aria-label":k("conversation.retrySending"),title:w("retry"),children:[(0,r.jsx)(h.A,{size:12,"aria-hidden":"true"}),w("retry")]}),y&&(0,r.jsxs)("button",{type:"button","data-testid":"chat-pending-discard",onClick:()=>y(l.id),className:"flex items-center gap-1 rounded px-1.5 py-0.5 text-xs text-muted-foreground transition-colors hover:bg-muted hover:text-danger-foreground","aria-label":k("conversation.discardMessage"),title:k("conversation.discard"),children:[(0,r.jsx)(g.A,{size:12,"aria-hidden":"true"}),k("conversation.discard")]})]}):(0,r.jsxs)(r.Fragment,{children:[u&&null!==W&&(0,r.jsx)("button",{type:"button","data-testid":"chat-copy-message",onClick:()=>u(W),className:"rounded p-1 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground","aria-label":k("conversation.copyMessage"),title:k("conversation.copy"),children:(0,r.jsx)(x.A,{size:14,"aria-hidden":"true"})}),u&&null!==$&&(0,r.jsxs)("button",{type:"button","data-testid":"chat-copy-full-message",onClick:()=>u($),className:"flex items-center gap-1 rounded px-1.5 py-1 text-xs leading-none text-muted-foreground transition-colors hover:bg-muted hover:text-foreground","aria-label":k("chatTranscript.copyFull.action"),title:k("chatTranscript.copyFull.title"),children:[(0,r.jsx)(b.A,{size:14,"aria-hidden":"true"}),(0,r.jsx)("span",{children:k("chatTranscript.copyFull.label")})]}),S&&d&&(0,r.jsx)("button",{type:"button","data-testid":"chat-insert-user-message",onClick:()=>d(D),className:"rounded p-1 text-muted-foreground transition-colors hover:bg-muted hover:text-accent-600 dark:hover:text-accent-400","aria-label":k("conversation.insertToMessage"),title:k("conversation.insertToMessage"),children:(0,r.jsx)(v.A,{size:14,"aria-hidden":"true"})})]})]})]})})},80635:(e,t,n)=>{n.d(t,{v4:()=>l});var r=n(12115);function a(e){let t=new Set;for(let n of e)"user"===n.role&&t.add(n.id);return t}function s(e,t,n){let r=new Set,a=new Set,s=e.filter(e=>"sending"===e.status);if(0===s.length)return{reconciledTempIds:r,consumedServerIds:a};let l=t.filter(e=>"user"===e.role&&!n.has(e.id)).sort((e,t)=>e.timestamp.getTime()-t.timestamp.getTime()),i=new Set;for(let e of[...s].sort((e,t)=>e.timestamp.getTime()-t.timestamp.getTime())){let t=l.find(t=>!i.has(t.id)&&!e.baselineUserIds.has(t.id)&&t.content===e.content);t&&(i.add(t.id),r.add(e.tempId),a.add(t.id))}return{reconciledTempIds:r,consumedServerIds:a}}function l(e){var t,n;let{worktreeId:l,serverMessages:i,sendFn:o,onSent:c,timeoutMs:u=3e4,connectivity:d,resendGraceMs:m=250}=e,[f,p]=(0,r.useState)([]),h=null!=(t=null==d?void 0:d.offline)&&t,g=null==(n=null==d?void 0:d.reachable)||n,x=(0,r.useRef)(i);x.current=i;let b=(0,r.useRef)(f);b.current=f;let v=(0,r.useRef)(c);v.current=c;let y=(0,r.useRef)(o);y.current=o;let k=(0,r.useRef)(h);k.current=h;let w=(0,r.useRef)(0),j=(0,r.useRef)(new Map),N=(0,r.useRef)(new Set),C=(0,r.useRef)(new Set),S=(0,r.useRef)(new Set),T=(0,r.useCallback)(e=>{let t=j.current.get(e);void 0!==t&&(clearTimeout(t),j.current.delete(e))},[]),I=(0,r.useCallback)(e=>{T(e),p(t=>t.map(t=>t.tempId!==e||"sending"!==t.status?t:k.current&&!t.autoResendAttempted?t.queued?t:{...t,queued:!0}:{...t,status:"error",queued:!1}))},[T]),M=(0,r.useCallback)(e=>{T(e);let t=setTimeout(()=>{j.current.delete(e),I(e)},u);j.current.set(e,t)},[T,I,u]),E=(0,r.useCallback)(async e=>{M(e.tempId),N.current.add(e.tempId);try{var t;await y.current(e.content,e.options),p(t=>t.map(t=>t.tempId!==e.tempId||t.accepted?t:{...t,accepted:!0})),null==(t=v.current)||t.call(v)}catch(t){I(e.tempId)}finally{N.current.delete(e.tempId)}},[M,I]),A=(0,r.useCallback)((e,t)=>{let n={tempId:"pending-".concat(w.current++),content:e,options:t,timestamp:new Date,status:"sending",baselineUserIds:a(x.current),queued:!1,accepted:!1,autoResendAttempted:!1};p(e=>[...e,n]),E(n)},[E]),L=(0,r.useCallback)(e=>{let t=b.current.find(t=>t.tempId===e);if(!t)return;let n={...t,status:"sending",timestamp:new Date,baselineUserIds:a(x.current),queued:!1,accepted:!1,autoResendAttempted:!1};p(t=>t.map(t=>t.tempId===e?n:t)),E(n)},[E]),R=(0,r.useCallback)(e=>{let t=b.current.find(t=>t.tempId===e);return T(e),N.current.delete(e),p(t=>t.filter(t=>t.tempId!==e)),null==t?void 0:t.content},[T]);(0,r.useEffect)(()=>{let{reconciledTempIds:e,consumedServerIds:t}=s(b.current,i,C.current),n=new Set(i.map(e=>e.id)),r=new Set;C.current.forEach(e=>{n.has(e)&&r.add(e)}),t.forEach(e=>r.add(e)),C.current=r,0!==e.size&&(e.forEach(e=>S.current.add(e)),e.forEach(T),p(t=>t.filter(t=>!e.has(t.tempId))))},[i,T]),(0,r.useEffect)(()=>{if(!h)return;let e=f.filter(e=>"sending"===e.status&&!e.queued&&!e.autoResendAttempted);if(0===e.length)return;let t=new Set(e.map(e=>e.tempId));t.forEach(T),p(e=>e.map(e=>t.has(e.tempId)?{...e,queued:!0}:e))},[h,f,T]);let P=(0,r.useRef)(!1),[D,z]=(0,r.useState)(0),[O,F]=(0,r.useState)(0),H=(0,r.useRef)(m);H.current=m;let K=f.reduce((e,t)=>t.queued&&"sending"===t.status?e+1:e,0);return(0,r.useEffect)(()=>{(!g||K>0)&&(P.current=!0),g&&P.current&&(P.current=!1,b.current.some(e=>"sending"===e.status)&&z(e=>e+1))},[g,K]),(0,r.useEffect)(()=>{let e;if(0===D)return;let t=!1;return(async()=>{try{var n;await (null==(n=v.current)?void 0:n.call(v))}catch(e){}t||(e=setTimeout(()=>F(e=>e+1),H.current))})(),()=>{t=!0,void 0!==e&&clearTimeout(e)}},[D]),(0,r.useEffect)(()=>{if(0===O)return;let e=b.current,t=e.filter(e=>"sending"===e.status);if(0===t.length)return;let{reconciledTempIds:n}=s(e,x.current,C.current),r=[],a=[];for(let e of t)!(n.has(e.tempId)||S.current.has(e.tempId))&&(e.accepted||N.current.has(e.tempId)?a.push(e.tempId):e.queued?r.push(e):j.current.has(e.tempId)||a.push(e.tempId));if(a.forEach(M),0===r.length)return;let l=new Set(r.map(e=>e.tempId));p(e=>e.map(e=>l.has(e.tempId)?{...e,queued:!1,autoResendAttempted:!0}:e)),r.forEach(e=>{E({...e,queued:!1,autoResendAttempted:!0})})},[O,M,E]),(0,r.useEffect)(()=>{let e=j.current;return()=>{e.forEach(e=>clearTimeout(e)),e.clear()}},[]),{messages:(0,r.useMemo)(()=>{if(0===f.length)return i;let{reconciledTempIds:e}=s(f,i,C.current),t=f.filter(t=>!e.has(t.tempId)).map(e=>({id:e.tempId,worktreeId:l,role:"user",content:e.content,timestamp:e.timestamp,messageType:"normal",archived:!1,cliToolId:e.options.cliToolId,instanceId:e.options.instanceId,optimisticState:e.status}));return 0===t.length?i:[...i,...t]},[i,f,l]),pending:f,sendOptimistic:A,retry:L,discard:R}}},81507:(e,t,n)=>{n.d(t,{Ce:()=>d,TG:()=>u,jt:()=>s,sg:()=>l});var r=n(12115);let a={visible:"commandmate.worktree.historyVisible",width:"commandmate.worktree.historyWidth"},s={visible:"commandmate.sessions.tileHistoryVisible",width:"commandmate.sessions.tileHistoryWidth"},l=40;function i(e){return Number.isFinite(e)?Math.min(60,Math.max(10,e)):l}let o="commandmate:historyPaneStateChange";function c(e){try{window.dispatchEvent(new CustomEvent(o,{detail:e}))}catch(e){}}function u(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a,{visible:t,width:n}=e,[s,u]=(0,r.useState)(!0),[d,m]=(0,r.useState)(l),f=(0,r.useRef)(s);f.current=s;let p=(0,r.useRef)(d);return p.current=d,(0,r.useEffect)(()=>{let e=function(e){try{let t=window.localStorage.getItem(e);if("true"===t)return!0;if("false"===t)return!1}catch(e){}return!0}(t),r=function(e){try{let t=window.localStorage.getItem(e);if(null===t)return l;let n=Number(t);if(Number.isFinite(n))return i(n)}catch(e){}return l}(n);u(e),m(r)},[t,n]),(0,r.useEffect)(()=>{let e=e=>{e.detail&&e.detail.scope===t&&(e.detail.visible!==f.current&&u(e.detail.visible),e.detail.width!==p.current&&m(e.detail.width))};return window.addEventListener(o,e),()=>window.removeEventListener(o,e)},[t]),{visible:s,width:d,toggle:(0,r.useCallback)(()=>{let e=!f.current;u(e);try{window.localStorage.setItem(t,String(e))}catch(e){}c({scope:t,visible:e,width:p.current})},[t]),setWidth:(0,r.useCallback)(e=>{let r=i(e);m(r);try{window.localStorage.setItem(n,String(r))}catch(e){}c({scope:t,visible:f.current,width:r})},[t,n])}}function d(e){return"split-history-slot-".concat(e)}},83012:(e,t,n)=>{n.d(t,{Fx:()=>l,Uq:()=>o,bg:()=>i,fw:()=>s,g8:()=>c});var r=n(53298),a=n(73683);function s(e,t){let n=new Date(e);return isNaN(n.getTime())?"":(0,r.m)(n,{addSuffix:!0,...t?{locale:t}:{}})}function l(e){let t=new Date(e);if(isNaN(t.getTime()))return"";let n=Math.round((Date.now()-t.getTime())/1e3);if(n<45)return"now";let r=Math.round(n/60);if(r<60)return"".concat(r,"m ago");let a=Math.round(r/60);if(a<24)return"".concat(a,"h ago");let s=Math.round(a/24);return s<7?"".concat(s,"d ago"):s<30?"".concat(Math.round(s/7),"w ago"):s<365?"".concat(Math.round(s/30),"mo ago"):"".concat(Math.round(s/365),"y ago")}function i(e,t){return!(e instanceof Date)||isNaN(e.getTime())?"":(0,a.GP)(e,"PPp",t?{locale:t}:void 0)}function o(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Date;if(!(e instanceof Date)||isNaN(e.getTime()))return"";let n=t instanceof Date&&!isNaN(t.getTime())?t:new Date,r=e.getFullYear()===n.getFullYear()&&e.getMonth()===n.getMonth()&&e.getDate()===n.getDate();return(0,a.GP)(e,r?"HH:mm":"M/d HH:mm")}function c(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Date;if(!d(e))return"";let r=d(n)?n:new Date,s=d(t)?t:null,l=m(e,r)&&(null===s||m(s,r)&&m(s,e))?"HH:mm":"M/d HH:mm",i=(0,a.GP)(e,l);if(null===s)return i;let o=(0,a.GP)(s,l);return o===i?i:"".concat(o).concat(u).concat(i)}let u=" → ";function d(e){return e instanceof Date&&!isNaN(e.getTime())}function m(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}},83051:(e,t,n)=>{n.d(t,{bl:()=>X,Ce:()=>f.Ce});var r=n(95155),a=n(12115),s=n(18955),l=n(96195),i=n(7620),o=n(12181),c=n(20508),u=n(86651),d=n(90368),m=n(28019),f=n(81507),p=n(35252),h=n(35299),g=n(6132),x=n(48314),b=n(65229),v=n(54916),y=n(75426),k=n(24033),w=n(36809),j=n(51238),N=n(10934),C=n(5225),S=n(4300),T=n(55813),I=n(83012),M=n(89568),E=n(99112),A=n(79321);function L(e){let t=e.split("\n");if(t.length<=2&&e.length<=100)return{text:e,isTruncated:!1};let n=t.slice(0,2).join("\n");return n.length>100&&(n=n.slice(0,100)),{text:n,isTruncated:!0}}let R=(0,a.memo)(function(e){let{content:t,onFilePathClick:n}=e,l=(0,s.c)("worktree"),i=(0,a.useMemo)(()=>(0,M.ML)(t),[t]),o=(0,a.useCallback)(e=>()=>n(e),[n]);return(0,r.jsx)("span",{children:i.map((e,t)=>"path"===e.type?(0,r.jsx)("button",{type:"button",onClick:o(e.content),className:"text-accent-700 dark:text-accent-400 hover:text-accent-600 dark:hover:text-accent-300 hover:underline cursor-pointer font-mono text-sm","aria-label":l("conversation.openFile",{path:e.content}),children:e.content},t):(0,r.jsx)("span",{children:e.content},t))})}),P=(0,a.memo)(function(e){let{content:t,onFilePathClick:n}=e,s=(0,a.useMemo)(()=>{let e=e=>a.Children.map(e,e=>"string"==typeof e?(0,r.jsx)(R,{content:e,onFilePathClick:n}):e);return{p:t=>{let{children:n}=t;return(0,r.jsx)("p",{children:e(n)})},li:t=>{let{children:n}=t;return(0,r.jsx)("li",{children:e(n)})},td:t=>{let{children:n}=t;return(0,r.jsx)("td",{children:e(n)})},th:t=>{let{children:n}=t;return(0,r.jsx)("th",{children:e(n)})},strong:t=>{let{children:n}=t;return(0,r.jsx)("strong",{children:e(n)})},em:t=>{let{children:n}=t;return(0,r.jsx)("em",{children:e(n)})},a:e=>{let{href:t,children:a,node:s,...l}=e;return(0,r.jsx)(A.ZS,{...l,href:t,onFilePathClick:n,children:a})}}},[n]),l=(0,a.useMemo)(()=>[N.A,C.A],[]);return(0,r.jsx)(j.oz,{remarkPlugins:E.eT,rehypePlugins:l,components:s,children:t})});function D(){let e=(0,s.c)("worktree");return(0,r.jsxs)("div",{"data-testid":"pending-indicator",className:"flex items-center gap-2 text-muted-foreground py-2",children:[(0,r.jsxs)("div",{className:"flex gap-1","aria-hidden":"true",children:[(0,r.jsx)("span",{className:"w-2 h-2 bg-muted-foreground rounded-full animate-pulse"}),(0,r.jsx)("span",{className:"w-2 h-2 bg-muted-foreground rounded-full animate-pulse",style:{animationDelay:"150ms"}}),(0,r.jsx)("span",{className:"w-2 h-2 bg-muted-foreground rounded-full animate-pulse",style:{animationDelay:"300ms"}})]}),(0,r.jsx)("span",{className:"text-sm",children:e("conversation.waitingForResponse")})]})}let z=(0,a.memo)(function(e){let{message:t,onFilePathClick:n,onCopy:a,onInsertToMessage:l,onRetryPending:i,onDiscardPending:o}=e,c=(0,w.Ym)(),u=(0,s.c)("worktree"),d=(0,s.c)("common"),m=(0,T.M)(c),f=(0,I.bg)(t.timestamp,m),p=t.optimisticState,k=["group relative border-l-2 p-3 transition-opacity","error"===p?"border-danger-border bg-danger-subtle":"border-accent-500 bg-accent-500/10","sending"===p?"opacity-70":""].filter(Boolean).join(" ");return(0,r.jsxs)("div",{className:k,children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,r.jsx)("span",{className:"text-xs font-medium text-accent-700 dark:text-accent-400",children:u("conversation.you")}),(0,r.jsx)("span",{className:"text-xs text-muted-foreground",children:f}),"sending"===p&&(0,r.jsxs)("span",{"data-testid":"optimistic-sending",className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,r.jsx)(h.A,{size:12,className:"animate-spin","aria-hidden":"true"}),(0,r.jsx)("span",{children:u("conversation.sending")})]}),"error"===p&&(0,r.jsxs)("span",{"data-testid":"optimistic-error",className:"flex items-center gap-1 text-xs text-danger-foreground",children:[(0,r.jsx)(g.A,{size:12,"aria-hidden":"true"}),(0,r.jsx)("span",{children:u("conversation.failedToSend")})]}),"error"===p?(0,r.jsxs)("div",{className:"ml-auto flex items-center gap-1",children:[i&&(0,r.jsxs)("button",{type:"button","data-testid":"pending-retry",onClick:()=>i(t.id),className:"flex items-center gap-1 rounded px-1.5 py-0.5 text-xs text-accent-700 dark:text-accent-400 hover:bg-muted transition-colors","aria-label":u("conversation.retrySending"),title:d("retry"),children:[(0,r.jsx)(x.A,{size:12,"aria-hidden":"true"}),d("retry")]}),o&&(0,r.jsxs)("button",{type:"button","data-testid":"pending-discard",onClick:()=>o(t.id),className:"flex items-center gap-1 rounded px-1.5 py-0.5 text-xs text-muted-foreground hover:text-danger-foreground hover:bg-muted transition-colors","aria-label":u("conversation.discardMessage"),title:u("conversation.discard"),children:[(0,r.jsx)(b.A,{size:12,"aria-hidden":"true"}),u("conversation.discard")]})]}):(0,r.jsxs)("div",{className:"ml-auto flex items-center gap-0.5 opacity-0 transition-opacity group-hover:opacity-100 focus-within:opacity-100 [@media(hover:none)]:opacity-100",children:[l&&(0,r.jsx)("button",{type:"button","data-testid":"insert-user-message",onClick:()=>l(t.content),className:"p-1 text-muted-foreground hover:text-accent-600 dark:hover:text-accent-400 hover:bg-muted rounded transition-colors","aria-label":u("conversation.insertToMessage"),title:u("conversation.insertToMessage"),children:(0,r.jsx)(v.A,{size:14,"aria-hidden":"true"})}),a&&(0,r.jsx)("button",{type:"button","data-testid":"copy-user-message",onClick:()=>a(t.content),className:"p-1 text-muted-foreground hover:text-foreground hover:bg-muted rounded transition-colors","aria-label":u("conversation.copyMessage"),title:u("conversation.copy"),children:(0,r.jsx)(y.A,{size:14,"aria-hidden":"true"})})]})]}),(0,r.jsx)("div",{"data-message-id":t.id,className:"text-sm text-foreground whitespace-pre-wrap break-words [word-break:break-word] max-w-full overflow-x-hidden",children:(0,r.jsx)(R,{content:t.content,onFilePathClick:n})})]})}),O=(0,a.memo)(function(e){let{message:t,index:n,total:l,isExpanded:i,onFilePathClick:o,onCopy:c,hasLongContent:u=!1,onToggleExpand:d}=e,m=(0,w.Ym)(),f=(0,s.c)("worktree"),p=(0,T.M)(m),h=(0,I.bg)(t.timestamp,p),{text:g,isTruncated:x}=(0,a.useMemo)(()=>L(t.content),[t.content]),b=i||!x?t.content:g,v=(0,S.bx)(t.requestId),j=v&&x&&!i;return(0,r.jsxs)("div",{className:"assistant-message-item group relative",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,r.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:f("conversation.assistant")}),(0,r.jsx)("span",{className:"text-xs text-muted-foreground",children:h}),l>1&&(0,r.jsxs)("span",{className:"text-xs text-muted-foreground",children:["(",n+1,"/",l,")"]}),(0,r.jsxs)("div",{className:"ml-auto flex items-center gap-0.5 opacity-0 transition-opacity group-hover:opacity-100 focus-within:opacity-100 [@media(hover:none)]:opacity-100",children:[0===n&&u&&!!d&&(0,r.jsxs)("button",{type:"button",onClick:d,className:"flex items-center gap-1 rounded px-1.5 py-0.5 text-xs text-accent-700 dark:text-accent-400 hover:text-accent-600 dark:hover:text-accent-300 hover:bg-muted transition-colors","aria-expanded":i,"aria-label":f(i?"conversation.collapseMessage":"conversation.expandMessage"),children:[(0,r.jsx)(k.A,{size:12,className:"transition-transform ".concat(i?"rotate-180":""),"aria-hidden":"true"}),f(i?"conversation.collapse":"conversation.expand")]}),c&&(0,r.jsx)("button",{type:"button","data-testid":"copy-assistant-message",onClick:()=>c(t.content),className:"p-1 text-muted-foreground hover:text-foreground hover:bg-muted rounded transition-colors","aria-label":f("conversation.copyMessage"),title:f("conversation.copy"),children:(0,r.jsx)(y.A,{size:14,"aria-hidden":"true"})})]})]}),v?(0,r.jsx)("div",{"data-message-id":t.id,"data-markdown":"true",className:["assistant-md text-xs text-foreground break-words [word-break:break-word] max-w-full overflow-x-hidden",j?"".concat("max-h-[3.25rem]"," overflow-y-hidden"):""].filter(Boolean).join(" "),children:(0,r.jsx)(P,{content:t.content,onFilePathClick:o})}):(0,r.jsxs)("div",{"data-message-id":t.id,className:"text-xs text-foreground whitespace-pre-wrap break-words [word-break:break-word] max-w-full overflow-x-hidden",children:[(0,r.jsx)(R,{content:b,onFilePathClick:o}),!i&&x&&(0,r.jsx)("span",{className:"text-muted-foreground",children:"..."})]})]})}),F=(0,a.memo)(function(e){let{messages:t,isExpanded:n,onFilePathClick:s,onCopy:l,hasLongContent:i=!1,onToggleExpand:o}=e;return(0,r.jsx)("div",{className:"bg-surface-2/50 border-l-2 border-border p-2 border-t border-border space-y-2",children:t.map((e,c)=>(0,r.jsxs)(a.Fragment,{children:[c>0&&(0,r.jsx)("div",{"data-testid":"assistant-message-divider",className:"border-t border-dashed border-border"}),(0,r.jsx)(O,{message:e,index:c,total:t.length,isExpanded:n,onFilePathClick:s,onCopy:l,hasLongContent:i,onToggleExpand:o})]},e.id))})});function H(){let e=(0,s.c)("worktree");return(0,r.jsxs)("div",{"data-testid":"orphan-indicator",className:"bg-warning/10 text-warning-foreground text-xs px-3 py-1 flex items-center gap-2",children:[(0,r.jsx)("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),(0,r.jsx)("span",{children:e("conversation.systemMessage")})]})}let K=(0,a.memo)(function(e){var t;let{pair:n,onFilePathClick:l,isExpanded:i=!1,onToggleExpand:o,onCopy:c,onInsertToMessage:u,showAssistant:d=!0,onRetryPending:m,onDiscardPending:f}=e,p=(0,s.c)("worktree"),h=(null==(t=n.userMessage)?void 0:t.optimisticState)!==void 0,g=(0,a.useMemo)(()=>n.assistantMessages.some(e=>{let{isTruncated:t}=L(e.content);return t}),[n.assistantMessages]),x=(0,a.useCallback)(()=>{o&&o()},[o]),b=(0,a.useMemo)(()=>{let e="pending"===n.status?"pending":"orphan"===n.status?"orphan border-l-4 border-warning":"";return"".concat("border border-border rounded-lg overflow-hidden mb-4 transition-colors"," ").concat(e).trim()},[n.status]),v=n.userMessage?p("conversation.conversationLabel",{preview:"".concat(n.userMessage.content.substring(0,50)).concat(n.userMessage.content.length>50?"...":"")}):p("conversation.systemMessageLabel");return(0,r.jsxs)("div",{"data-testid":"conversation-pair-card",role:"article","aria-label":v,className:b,children:["orphan"===n.status&&(0,r.jsx)(H,{}),n.userMessage&&(0,r.jsx)(z,{message:n.userMessage,onFilePathClick:l,onCopy:c,onInsertToMessage:u,onRetryPending:m,onDiscardPending:f}),"pending"!==n.status||h?d&&n.assistantMessages.length>0?(0,r.jsx)(F,{messages:n.assistantMessages,isExpanded:i,onFilePathClick:l,onCopy:c,hasLongContent:g,onToggleExpand:x}):null:(0,r.jsx)("div",{className:"bg-muted/40 border-l-2 border-border p-3 border-t border-border",children:(0,r.jsx)(D,{})})]})});var q=n(92710),B=n(23570),U=n(60322),W=n(70738),$=n(64653),_=n(9708),J=n(20877),Q=n(88731),Y=n(96802);function G(){let e=(0,s.c)("worktree");return(0,r.jsx)("div",{"data-testid":"loading-indicator",role:"status","aria-label":e("history.loading"),children:[0,1,2].map(e=>(0,r.jsxs)("div",{className:"mb-4 overflow-hidden rounded-lg border border-border",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 p-3",children:[(0,r.jsx)(m.EA,{className:"h-4 w-4 rounded-full"}),(0,r.jsx)(m.EA,{className:"h-4 w-1/3"})]}),(0,r.jsxs)("div",{className:"space-y-2 px-3 pb-3",children:[(0,r.jsx)(m.EA,{className:"h-3 w-full"}),(0,r.jsx)(m.EA,{className:"h-3 w-5/6"}),(0,r.jsx)(m.EA,{className:"h-3 w-2/3"})]})]},e))})}function V(){let e=(0,s.c)("worktree");return(0,r.jsxs)("div",{className:"flex flex-col items-center justify-center py-8 text-muted-foreground",children:[(0,r.jsx)("svg",{className:"w-12 h-12 mb-2 opacity-50",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})}),(0,r.jsx)("p",{className:"text-sm",children:e("history.empty")})]})}let Z=["h-full","flex","flex-col","overflow-hidden","bg-surface-2","rounded-lg","border","border-border"],X=(0,a.memo)(function(e){let{messages:t,worktreeId:n,worktreePath:h,onFilePathClick:g,isLoading:x=!1,className:b="",showToast:v,onInsertToMessage:y,onRetryPending:k,onDiscardPending:w,showArchived:j=!1,onShowArchivedChange:N,historyDisplayLimit:C,onHistoryDisplayLimitChange:S,historyUserOnly:T=!1,onHistoryUserOnlyChange:I,onCollapse:M,splitIndex:E,cliToolId:A}=e,L=(0,s.c)("worktree"),R=(0,a.useRef)(null),P=(0,_.O)(),D=null!=h?h:P.worktreePath,z=(0,a.useMemo)(()=>void 0===E?J.Gw:(0,J.eu)(E),[E]),O=void 0===E?"history-pane-collapse-button":"history-pane-collapse-button-".concat(E),F=void 0===E?B.g6:(0,f.Ce)(E),H=(0,a.useRef)(!0),X=(0,a.useRef)(-1),ee=(0,a.useRef)(null),{pairs:et,isExpanded:en,toggleExpand:er}=function(e){let t=(0,a.useMemo)(()=>(function(e){if(0===e.length)return[];let t=[...e].sort((e,t)=>e.timestamp.getTime()-t.timestamp.getTime()),n=[],r=null;for(let e of t)if("user"===e.role)r={id:e.id,userMessage:e,assistantMessages:[],status:"pending"},n.push(r);else if("assistant"===e.role)if(r&&null!==r.userMessage)r.assistantMessages.push(e),r.status="completed";else if(r&&null===r.userMessage)r.assistantMessages.push(e);else{let t={id:"orphan-".concat(e.id),userMessage:null,assistantMessages:[e],status:"orphan"};n.push(t),r=t}return n})(e),[e]),[n,r]=(0,a.useState)(new Set),s=(0,a.useCallback)(e=>{r(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),l=(0,a.useCallback)(e=>n.has(e),[n]),i=(0,a.useCallback)(()=>{r(new Set(t.map(e=>e.id)))},[t]);return{pairs:t,expandedPairs:n,toggleExpand:s,isExpanded:l,expandAll:i,collapseAll:(0,a.useCallback)(()=>{r(new Set)},[])}}(t),ea=(0,a.useMemo)(()=>t.filter(e=>!e.archived&&"string"==typeof e.content&&e.content.length>0&&(!T||"user"===e.role)),[t,T]),{isOpen:es,query:el,matchCount:ei,currentIndex:eo,isAtMaxMatches:ec,matchPositions:eu,currentMatch:ed,openSearch:em,closeSearch:ef,setQuery:ep,onCompositionStart:eh,onCompositionEnd:eg,nextMatch:ex,prevMatch:eb}=(0,p.w)({messages:ea}),ev=es&&eu.length>0,ey=(0,a.useMemo)(()=>t.filter(e=>"relay"===e.messageType).length,[t]),[ek,ew]=(0,a.useState)(new Set);(0,a.useEffect)(()=>{ef()},[n]);let ej=(0,a.useMemo)(()=>T?et.filter(e=>e.userMessage):et,[et,T]),eN=(0,a.useMemo)(()=>{let e=new Map;for(let t of ej)for(let n of(t.userMessage&&e.set(t.userMessage.id,t.id),t.assistantMessages))e.set(n.id,t.id);return e},[ej]),eC=(0,a.useMemo)(()=>{let e=new Map;return ej.forEach((t,n)=>e.set(t.id,n)),e},[ej]),eS=(0,l.Te)({count:ej.length,getScrollElement:()=>R.current,estimateSize:()=>Y.__,overscan:Y.b,getItemKey:e=>{var t,n;return null!=(n=null==(t=ej[e])?void 0:t.id)?n:e}}),eT=eS.getVirtualItems(),eI=eT.length>0?"".concat(eT[0].index,"-").concat(eT[eT.length-1].index):"",eM=(0,a.useCallback)(()=>{let e=R.current;e&&(H.current=(0,Y.Mp)({scrollTop:e.scrollTop,scrollHeight:e.scrollHeight,clientHeight:e.clientHeight}))},[]);(0,a.useLayoutEffect)(()=>{let e=X.current,t=ej.length;X.current=t,-1!==e&&t>e&&t>0&&H.current&&!ev&&eS.scrollToIndex(t-1,{align:"end"})},[ej.length,ev,eS]),(0,a.useLayoutEffect)(()=>{if(!es||0===eu.length)return void ew(e=>0===e.size?e:new Set);ew(function(e,t){let n=new Map;for(let e of t)for(let t of(e.userMessage&&n.set(e.userMessage.id,e.id),e.assistantMessages))n.set(t.id,e.id);let r=new Set;for(let t of e){let e=n.get(t.messageId);e&&r.add(e)}return r}(eu,et))},[es,eu,et]),(0,a.useEffect)(()=>{if(!es||!ed)return;let e=eN.get(ed.messageId);if(void 0===e)return;let t=eC.get(e);void 0!==t&&eS.scrollToIndex(t,{align:"center"})},[es,ed,eN,eC,eS]),(0,a.useLayoutEffect)(()=>{let e=R.current;if(!e)return;if(!es||0===eu.length)return void(0,J.fq)(z);let t=null;for(let r of eu){var n;let a=(n=r.messageId,e.querySelector('[data-message-id="'.concat(CSS.escape(n),'"]')));if(!a)continue;let s=(null==ed?void 0:ed.messageId)===r.messageId,l=s?ed.localIndex:-1;(0,J.Gg)(a,r.ranges,l,z),s&&a instanceof HTMLElement&&(t=a)}return t&&"function"==typeof t.scrollIntoView&&t.scrollIntoView({block:"center",behavior:"smooth"}),()=>{(0,J.fq)(z)}},[es,eu,ed,ek,z,eI]),(0,a.useEffect)(()=>{let e=R.current;if(es)null===ee.current&&e&&(ee.current=e.scrollTop);else{if(null!==ee.current&&e){let t=ee.current;requestAnimationFrame(()=>{e.scrollTop=t})}ee.current=null}},[es]);let eE=(0,a.useMemo)(()=>[...Z,b].filter(Boolean).join(" "),[b]),eA=(0,a.useRef)(L);eA.current=L;let eL=(0,a.useCallback)(e=>{let t=(0,W.h)(e,D);null!==t&&(async()=>{if("missing"===await (0,$.o4)(n,t)){null==v||v(eA.current("conversation.filePathMissing"),"error");return}g(t)})()},[g,n,D,v]),eR=(0,a.useCallback)(e=>()=>er(e),[er]),eP=(0,a.useCallback)(async e=>{try{await (0,U.l)(e),null==v||v(eA.current("history.copied"),"success")}catch(e){console.error("[HistoryPane] Failed to copy to clipboard"),null==v||v(eA.current("history.copyFailed"),"error")}},[v]),eD=e=>{var t,n;let a=(null==(t=e.userMessage)?void 0:t.archived)===!0||(null==(n=e.assistantMessages)?void 0:n.some(e=>!0===e.archived)),s=en(e.id)||ek.has(e.id);return(0,r.jsx)("div",{className:a?"opacity-60":"",children:(0,r.jsx)(K,{pair:e,onFilePathClick:eL,isExpanded:s,onToggleExpand:eR(e.id),onCopy:eP,onInsertToMessage:y,onRetryPending:k,onDiscardPending:w,showAssistant:!T})})},ez=(0,a.useCallback)(e=>{let t=parseInt(e.target.value,10);(0,Q.UK)(t)&&(null==S||S(t))},[S]),eO=(0,a.useCallback)(()=>{es?ef():em()},[es,em,ef]);return(0,r.jsxs)("div",{role:"region","aria-label":L("history.regionLabel"),className:eE,children:[(0,r.jsxs)("div",{className:"flex-shrink-0 bg-surface-2 border-b border-border px-4 py-2 flex items-center justify-between flex-wrap gap-1",children:[(0,r.jsx)("h3",{className:"text-sm font-medium text-foreground",children:L("history.title")}),ey>0&&(0,r.jsxs)("span",{"data-testid":"history-relay-count",title:L("relay.historyBadgeTitle"),className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,r.jsx)(i.A,{size:12,className:"shrink-0","aria-hidden":"true"}),L("relay.historyCount",{count:ey})]}),(0,r.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[S&&void 0!==C&&(0,r.jsxs)("label",{className:"flex items-center gap-1.5 text-xs text-muted-foreground cursor-pointer",children:[(0,r.jsx)("span",{children:L("history.show")}),(0,r.jsx)("select",{value:C,onChange:ez,"aria-label":L("history.displayLimit"),className:"rounded border border-input bg-surface text-foreground text-xs px-1.5 py-0.5 focus:outline-none focus:ring-1 focus:ring-ring",children:Q.dl.map(e=>(0,r.jsx)("option",{value:e,children:e},e))})]}),N&&(0,r.jsxs)("label",{className:"flex items-center gap-1.5 text-xs text-muted-foreground cursor-pointer",children:[(0,r.jsx)(m.Sc,{checked:j,onCheckedChange:e=>N(!0===e),className:"h-3.5 w-3.5"}),L("history.showArchived")]}),I&&(0,r.jsx)("button",{type:"button",onClick:()=>I(!T),"aria-label":L("history.showUserOnly"),"aria-pressed":T,className:"p-1 rounded transition-colors ".concat(T?"bg-accent-500/15 text-accent-700 dark:text-accent-300":"text-muted-foreground hover:text-foreground"),title:L(T?"history.showAllMessages":"history.showUserOnly"),children:T?(0,r.jsx)(o.A,{size:14,"aria-hidden":"true"}):(0,r.jsx)(c.A,{size:14,"aria-hidden":"true"})}),(0,r.jsx)("button",{type:"button",onClick:eO,"aria-label":L(es?"history.closeSearch":"history.openSearch"),"aria-pressed":es,className:"p-1 text-muted-foreground hover:text-foreground rounded transition-colors",title:L(es?"history.closeSearch":"history.openSearch"),children:(0,r.jsx)(u.A,{size:14,"aria-hidden":"true"})}),M&&(0,r.jsx)("button",{type:"button",onClick:M,"aria-label":L("terminal.hideHistory"),"aria-expanded":"true","aria-controls":F,className:"p-1 text-muted-foreground hover:text-foreground rounded transition-colors",title:L("terminal.hideHistory"),"data-testid":O,children:(0,r.jsx)(d.A,{size:14,"aria-hidden":"true"})})]})]}),es&&(0,r.jsx)("div",{className:"flex-shrink-0 px-3 py-2 bg-surface-2 border-b border-border",children:(0,r.jsx)(q.Y,{query:el,onQueryChange:ep,matchCount:ei,currentIndex:eo,onNext:ex,onPrev:eb,onClose:ef,isAtMaxMatches:ec,onCompositionStart:eh,onCompositionEnd:eg})}),(0,r.jsx)("div",{ref:R,"data-testid":"history-scroll-container",onScroll:eM,className:"flex-1 min-h-0 overflow-y-auto overflow-x-hidden p-4",children:x?(0,r.jsx)(G,{}):0===ej.length?(0,r.jsx)(V,{}):0===eT.length?(0,r.jsx)("div",{"data-testid":"history-fallback-list",children:ej.slice(0,Y.vC).map(e=>(0,r.jsx)("div",{children:eD(e)},e.id))}):(0,r.jsx)("div",{style:{height:eS.getTotalSize(),width:"100%",position:"relative"},children:eT.map(e=>{let t=ej[e.index];return t?(0,r.jsx)("div",{"data-index":e.index,ref:eS.measureElement,className:"absolute left-0 top-0 w-full",style:{transform:"translateY(".concat(e.start,"px)")},children:eD(t)},e.key):null})})})]})})},84228:(e,t,n)=>{n.d(t,{wY:()=>eq});var r=n(95155),a=n(12115),s=n(18955),l=n(7620),i=n(35299),o=n(8803),c=n(22479),u=n(41108),d=n(95342),m=n(96195),f=n(24033),p=n(27937),h=n(54485),g=n(37586),x=n(20562),b=n(53842),v=n(86651),y=n(28019),k=n(35252),w=n(60322),j=n(70738),N=n(64653),C=n(9708),S=n(20877),T=n(96802),I=n(89568),M=n(92147);let E={highlightName:"chat-search",currentHighlightName:"chat-search-current",fallbackOverlayId:"chat-search-fallback-overlay",fallbackOverlayBgColor:"rgba(59, 130, 246, 0.6)"},A="commandmate:chatShowToolActivity";function L(){try{return"true"===window.localStorage.getItem(A)}catch(e){return!1}}var R=n(79321);let P="chat-live-turn",D=(0,a.memo)(function(e){let{turnKey:t,version:n,body:a,partial:l=!1,isThinking:o=!1,showHeader:c=!1,onFilePathClick:u}=e,d=(0,s.c)("worktree"),m="string"==typeof a&&a.length>0;return(0,r.jsxs)("div",{"data-testid":P,"data-role":"assistant","data-turn-key":t,"data-version":void 0===n?void 0:String(n),"data-has-body":m?"true":"false",role:"group","aria-label":d("chatSurface.progressLabel"),className:R.UI,children:[c&&(0,r.jsx)("div",{className:"flex items-center gap-2 px-1 text-xs text-muted-foreground",children:(0,r.jsx)("span",{className:"font-medium",children:d("conversation.assistant")})}),(0,r.jsxs)("div",{"data-testid":R.a3,className:R.CL,children:[m&&(0,r.jsx)("div",{"data-testid":"chat-live-turn-body","data-markdown":"true",className:R.Et,children:(0,r.jsx)(R.Gn,{content:a,onFilePathClick:u})}),(0,r.jsxs)("div",{"data-testid":"chat-live-turn-indicator",role:"status","aria-live":"polite",className:["flex flex-wrap items-center gap-2 text-xs text-muted-foreground",m?"mt-1.5":""].filter(Boolean).join(" "),children:[(0,r.jsx)(i.A,{size:14,className:"animate-spin","aria-hidden":"true"}),(0,r.jsx)("span",{children:d(o?"chatSurface.thinking":"chatSurface.generating")}),l&&(0,r.jsx)("span",{"data-testid":"chat-live-turn-partial",className:"rounded border border-warning-border bg-warning-subtle px-1 py-0.5 text-warning-foreground",children:d("chatSurface.progressPartial")})]})]})]})});var z=n(92710);let O="chat-transcript-scroll-container",F="chat-transcript-jump-fab",H="absolute bottom-3 right-3 z-10 flex h-9 w-9 items-center justify-center rounded-full border border-border bg-surface-2/80 text-muted-foreground shadow-lg backdrop-blur transition-colors hover:bg-muted hover:text-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-ring touch-manipulation";function K(){let e=(0,s.c)("worktree");return(0,r.jsx)("div",{"data-testid":"chat-transcript-loading",role:"status","aria-label":e("chatTranscript.loading"),children:[0,1,2].map(e=>(0,r.jsxs)("div",{className:"mb-4 flex flex-col gap-1 ".concat(e%2==0?"items-end":"items-start"),children:[(0,r.jsx)(y.EA,{className:"h-3 w-24"}),(0,r.jsx)(y.EA,{className:"h-14 rounded-2xl ".concat(e%2==0?"w-2/3":"w-11/12")})]},e))})}function q(e){let{turnKey:t,version:n,body:a,partial:l=!1,showHeader:i=!1,onFilePathClick:o}=e,c=(0,s.c)("worktree"),u="string"==typeof a&&a.length>0;return(0,r.jsxs)("div",{"data-testid":P,"data-role":"assistant","data-settling":"true","data-turn-key":t,"data-version":void 0===n?void 0:String(n),"data-has-body":u?"true":"false",role:"group","aria-label":c("chatSurface.settlingLabel"),className:R.UI,children:[i&&(0,r.jsx)("div",{className:"flex items-center gap-2 px-1 text-xs text-muted-foreground",children:(0,r.jsx)("span",{className:"font-medium",children:c("conversation.assistant")})}),(0,r.jsxs)("div",{"data-testid":R.a3,className:R.CL,children:[u&&(0,r.jsx)("div",{"data-testid":"chat-live-turn-body","data-markdown":"true",className:R.Et,children:(0,r.jsx)(R.Gn,{content:a,onFilePathClick:o})}),(0,r.jsxs)("div",{"data-testid":"chat-settling-turn-note",className:["flex flex-wrap items-center gap-2 text-xs text-muted-foreground",u?"mt-1.5":""].filter(Boolean).join(" "),children:[(0,r.jsx)("span",{children:c("chatSurface.settling")}),l&&(0,r.jsx)("span",{"data-testid":"chat-live-turn-partial",className:"rounded border border-warning-border bg-warning-subtle px-1 py-0.5 text-warning-foreground",children:c("chatSurface.progressPartial")})]})]})]})}function B(e){let{count:t,isOpen:n,regionId:a,onToggle:l}=e,i=(0,s.c)("worktree"),o=n?f.A:p.A;return(0,r.jsx)("div",{className:"mb-2 flex w-full items-center",children:(0,r.jsxs)("button",{type:"button","data-testid":"chat-previous-session-toggle","data-count":String(t),onClick:l,"aria-expanded":n,"aria-controls":a,"aria-label":i(n?"chatTranscript.previousSession.collapse":"chatTranscript.previousSession.expand"),className:"flex min-h-[32px] items-center gap-1.5 rounded-full border border-border bg-surface-2 px-3 py-1 text-xs font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-ring touch-manipulation",children:[(0,r.jsx)(h.A,{size:12,"aria-hidden":"true"}),(0,r.jsx)("span",{children:i("chatTranscript.previousSession.summary",{count:t})}),(0,r.jsx)(o,{size:12,"aria-hidden":"true"})]})})}function U(){let e=(0,s.c)("worktree");return(0,r.jsxs)("div",{"data-testid":"chat-session-ended-banner",role:"status",className:"mt-2 flex flex-col gap-0.5 rounded-lg border border-border bg-surface-2 px-3 py-2 text-xs text-muted-foreground",children:[(0,r.jsx)("span",{children:e("terminal.sessionEnded")}),(0,r.jsx)("span",{children:e("chatTranscript.previousSession.hint")})]})}function W(){let e=(0,s.c)("worktree");return(0,r.jsxs)("div",{"data-testid":"chat-transcript-empty",className:"flex flex-col items-center justify-center gap-1 py-10 text-center text-muted-foreground",children:[(0,r.jsx)(g.A,{className:"mb-1 h-10 w-10 opacity-50","aria-hidden":"true"}),(0,r.jsx)("p",{className:"text-sm",children:e("chatTranscript.empty")}),(0,r.jsx)("p",{className:"text-xs",children:e("chatTranscript.emptyHint")})]})}let $=(0,a.memo)(function(e){let{messages:t,worktreeId:n,worktreePath:l,cliToolId:c,instanceId:u,isLoading:d=!1,className:f="",onFilePathClick:p,showToast:h,onInsertToMessage:g,onRetryPending:y,onDiscardPending:P,splitIndex:$,liveTurn:_=null,sessionEnded:J=!1,onScrollControlsChange:Q}=e,Y=(0,s.c)("worktree"),G=(0,a.useRef)(null),V=(0,a.useMemo)(()=>void 0===$?E:{highlightName:"chat-search-".concat($),currentHighlightName:"chat-search-current-".concat($),fallbackOverlayId:"chat-search-fallback-overlay-".concat($),fallbackOverlayBgColor:E.fallbackOverlayBgColor},[$]),Z=(0,a.useMemo)(()=>{let e=t.filter(e=>!e.archived);return e.length===t.length?t:e},[t]),X=J&&!d,ee="".concat(n,"|").concat(null!=c?c:"","|").concat(null!=u?u:""),et=(0,a.useRef)(null),en=(0,a.useRef)(ee);en.current!==ee&&(en.current=ee,et.current=null),X?null===et.current&&(et.current=new Set(Z.filter(e=>!e.optimisticState).map(e=>e.id))):et.current=null;let er=et.current,{previousMessages:ea,currentMessages:es}=(0,a.useMemo)(()=>{if(null===er||0===er.size)return{previousMessages:[],currentMessages:Z};let e=[],t=[];for(let n of Z)!n.optimisticState&&er.has(n.id)?e.push(n):t.push(n);return{previousMessages:e,currentMessages:t}},[er,Z]),el=ea.length,ei=X&&el>0,[eo,ec]=(0,a.useState)(!1),eu=(0,a.useCallback)(()=>{ec(e=>!e)},[]);(0,a.useEffect)(()=>{ei||ec(!1)},[ei]),(0,a.useEffect)(()=>{ec(!1)},[ee]);let ed=(0,a.useMemo)(()=>void 0===$?"chat-previous-session-region":"chat-previous-session-region-".concat($),[$]),em=(0,a.useRef)(!0),ef=(0,a.useRef)(-1),ep=(0,a.useRef)(d),eh=(0,a.useRef)(0),[eg,ex]=(0,a.useState)(!0),eb=(0,a.useMemo)(()=>(eo?Z:es).filter(e=>!e.archived&&!(0,M.nY)(e)&&"string"==typeof e.content&&e.content.length>0),[Z,es,eo]),{isOpen:ev,query:ey,matchCount:ek,currentIndex:ew,isAtMaxMatches:ej,matchPositions:eN,currentMatch:eC,openSearch:eS,closeSearch:eT,setQuery:eI,onCompositionStart:eM,onCompositionEnd:eE,nextMatch:eA,prevMatch:eL}=(0,k.w)({messages:eb}),eR=ev&&eN.length>0,[eP,eD]=(0,a.useState)(L),ez=(0,a.useCallback)(()=>{let e=!eP;eD(e);try{window.localStorage.setItem(A,String(e))}catch(e){}},[eP]),eO=(0,a.useMemo)(()=>({showAll:eP}),[eP]),eF=(0,a.useMemo)(()=>ev&&0!==eN.length?new Set(eN.map(e=>e.messageId)):null,[ev,eN]);(0,a.useEffect)(()=>{eT()},[n]);let eH=(0,a.useMemo)(()=>ei?[{kind:"previousSessionHeader",key:"previous-session-header",count:el},...eo?(0,I.UY)(ea).map(e=>({...e,previousSession:!0})):[],...(0,I.UY)(es)]:(0,I.UY)(Z),[ei,eo,Z,ea,es,el]);eh.current=eH.length;let eK=(0,m.Te)({count:eH.length,getScrollElement:()=>G.current,estimateSize:()=>I.hM,overscan:I.B7,getItemKey:e=>{var t,n;return null!=(n=null==(t=eH[e])?void 0:t.key)?n:e}}),eq=eK.getVirtualItems(),eB=eq.length>0?"".concat(eq[0].index,"-").concat(eq[eq.length-1].index):"",eU=(0,a.useMemo)(()=>{let e=new Map;return eH.forEach((t,n)=>{if("previousSessionHeader"!==t.kind)if("message"===t.kind)e.set(t.message.id,n);else for(let r of t.entries)for(let t of r.messageIds)e.set(t,n)}),e},[eH]),eW=(0,a.useRef)(null),e$=(0,a.useCallback)(()=>{let e=eW.current;eW.current=null,e&&null!==e.frame&&cancelAnimationFrame(e.frame)},[]),e_=(0,a.useCallback)(()=>{e$();let e=eh.current-1;if(e<0||(eK.scrollToIndex(e,{align:"end"}),"function"!=typeof requestAnimationFrame))return;let t={frame:null,frames:0,stableFrames:0,totalSize:eK.getTotalSize(),deadline:Date.now()+600},n=()=>{if(t.frame=null,eW.current!==t)return;t.frames+=1;let e=eh.current-1;if(e<0||!em.current||t.frames>12||Date.now()>t.deadline){eW.current=null;return}let r=eK.getTotalSize();if(r===t.totalSize){if(t.stableFrames+=1,t.stableFrames>=3){eW.current=null;return}}else t.stableFrames=0,t.totalSize=r,eK.scrollToIndex(e,{align:"end"});t.frame=requestAnimationFrame(n)};eW.current=t,t.frame=requestAnimationFrame(n)},[eK,e$]);(0,a.useEffect)(()=>e$,[e$]);let eJ=(0,a.useCallback)(()=>{em.current=!0,ex(!0),e_()},[e_]),eQ=(0,a.useCallback)(()=>{e$(),em.current=!1,ex(!1),eh.current>0&&eK.scrollToIndex(0,{align:"start"})},[eK,e$]),eY=(0,a.useCallback)(()=>{let e=G.current;if(!e)return;let t=(0,T.Mp)({scrollTop:e.scrollTop,scrollHeight:e.scrollHeight,clientHeight:e.clientHeight});(t||null===eW.current)&&(em.current=t,ex(t))},[]);(0,a.useLayoutEffect)(()=>{let e=ef.current,t=ep.current,n=Z.length;ef.current=n,ep.current=d,d||eR||0===eH.length||!em.current||(-1===e||t||!(n<=e))&&e_()},[Z.length,eH.length,d,eR,e_]),(0,a.useEffect)(()=>{if(Q)return Q({scrollToLatest:eJ,scrollToTop:eQ}),()=>Q(null)},[Q,eJ,eQ]);let eG=(0,a.useCallback)(e=>{if("Home"!==e.key&&"End"!==e.key)return;let t=e.target;t&&("INPUT"===t.tagName||"TEXTAREA"===t.tagName||t.isContentEditable)||0!==eh.current&&(e.preventDefault(),"End"===e.key?eJ():eQ())},[eJ,eQ]);(0,a.useEffect)(()=>{if(!ev||!eC)return;let e=eU.get(eC.messageId);void 0!==e&&eK.scrollToIndex(e,{align:"center"})},[ev,eC,eU,eK]),(0,a.useLayoutEffect)(()=>{let e=G.current;if(!e)return;if(!ev||0===eN.length)return void(0,S.fq)(V);let t=null;for(let n of eN){let r=e.querySelector('[data-message-id="'.concat(CSS.escape(n.messageId),'"]'));if(!r)continue;let a=(null==eC?void 0:eC.messageId)===n.messageId;(0,S.Gg)(r,n.ranges,a?eC.localIndex:-1,V),a&&r instanceof HTMLElement&&(t=r)}return t&&"function"==typeof t.scrollIntoView&&t.scrollIntoView({block:"center",behavior:"smooth"}),()=>{(0,S.fq)(V)}},[ev,eN,eC,V,eB]);let eV=(0,a.useRef)(Y);eV.current=Y;let eZ=(0,C.O)(),eX=null!=l?l:eZ.worktreePath,e0=(0,a.useCallback)(e=>{if(!p)return;let t=(0,j.h)(e,eX);null!==t&&(async()=>{if("missing"===await (0,N.o4)(n,t)){null==h||h(eV.current("conversation.filePathMissing"),"error");return}p(t)})()},[p,n,eX,h]),e1=(0,a.useCallback)(async e=>{try{await (0,w.l)(e),null==h||h(eV.current("history.copied"),"success")}catch(e){null==h||h(eV.current("history.copyFailed"),"error")}},[h]),e2=(0,a.useCallback)(e=>{let t=eH[e];if(!t)return null;if("previousSessionHeader"===t.kind)return(0,r.jsx)(B,{count:t.count,isOpen:eo,regionId:ed,onToggle:eu});let n=e=>t.previousSession?(0,r.jsx)("div",{"data-previous-session":"true",className:"opacity-60",children:e}):e;if("approvals"===t.kind)return n((0,r.jsx)(R.ZK,{entries:t.entries}));let a=(0,r.jsx)(R.qI,{message:t.message,showHeader:t.showHeader,header:t.header,onFilePathClick:e0,onCopy:e1,onInsertToMessage:g,onRetryPending:y,onDiscardPending:P});return n((null==eF?void 0:eF.has(t.message.id))?(0,r.jsx)(R.PZ,{value:R.vY,children:a}):a)},[eH,e0,e1,g,y,P,eF,eo,ed,eu]),e5=null!==_&&!0!==_.settling;return(0,r.jsxs)("div",{"data-testid":"chat-transcript","data-tool-activity":eP?"shown":"folded",role:"log","aria-label":Y("chatTranscript.regionLabel"),className:["relative flex h-full min-h-0 w-full flex-col overflow-hidden bg-surface",f].filter(Boolean).join(" "),children:[(0,r.jsx)("div",{ref:G,"data-testid":O,onScroll:eY,onKeyDown:eG,tabIndex:0,className:"min-h-0 flex-1 overflow-y-auto overflow-x-hidden px-3 py-3",children:(0,r.jsxs)(R.PZ,{value:eO,children:[d?(0,r.jsx)(K,{}):0===eH.length?_?null:(0,r.jsx)(W,{}):0===eq.length?(0,r.jsx)("div",{"data-testid":"chat-transcript-fallback-list",id:ei?ed:void 0,children:eH.slice(0,I.JD).map((e,t)=>(0,r.jsx)("div",{children:e2(t)},e.key))}):(0,r.jsx)("div",{id:ei?ed:void 0,style:{height:eK.getTotalSize(),width:"100%",position:"relative"},children:eq.map(e=>(0,r.jsx)("div",{"data-index":e.index,ref:eK.measureElement,className:"absolute left-0 top-0 w-full",style:{transform:"translateY(".concat(e.start,"px)")},children:e2(e.index)},e.key))}),_&&(_.settling?(0,r.jsx)(q,{turnKey:_.turnKey,version:_.version,body:_.body,partial:_.partial,showHeader:(0,I.CK)(Z[Z.length-1]),onFilePathClick:e0}):(0,r.jsx)(D,{turnKey:_.turnKey,version:_.version,body:_.body,partial:_.partial,isThinking:_.isThinking,showHeader:(0,I.CK)(Z[Z.length-1]),onFilePathClick:e0})),ei&&(0,r.jsx)(U,{})]})}),eH.length>0&&(eg?(0,r.jsx)("button",{type:"button","data-testid":F,"data-direction":"top",onClick:eQ,"aria-label":Y("chatTranscript.jumpToTop"),title:Y("chatTranscript.jumpToTop"),className:H,children:(0,r.jsx)(x.A,{size:16,"aria-hidden":"true"})}):(0,r.jsx)("button",{type:"button","data-testid":F,"data-direction":"latest","data-generating":e5?"true":void 0,onClick:eJ,"aria-label":Y(e5?"chatSurface.jumpToLatestGenerating":"chatSurface.jumpToLatest"),title:Y(e5?"chatSurface.jumpToLatestGenerating":"chatSurface.jumpToLatest"),className:H,children:e5?(0,r.jsx)(i.A,{size:16,className:"animate-spin","aria-hidden":"true"}):(0,r.jsx)(o.A,{size:16,"aria-hidden":"true"})})),(0,r.jsxs)("div",{className:"pointer-events-none absolute right-2 top-2 z-10 flex items-start justify-end gap-1",children:[!ev&&(0,r.jsx)("div",{className:"pointer-events-auto",children:(0,r.jsx)("button",{type:"button","data-testid":"chat-transcript-tool-activity-toggle",onClick:ez,"aria-pressed":eP,"aria-label":Y(eP?"chatTranscript.toolActivity.hide":"chatTranscript.toolActivity.show"),title:Y(eP?"chatTranscript.toolActivity.hide":"chatTranscript.toolActivity.show"),className:["rounded-full border border-border p-1.5 shadow-sm backdrop-blur transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-ring touch-manipulation",eP?"bg-accent-500/15 text-accent-700 hover:bg-accent-500/25 dark:text-accent-400":"bg-surface-2/80 text-muted-foreground hover:bg-muted hover:text-foreground"].join(" "),children:(0,r.jsx)(b.A,{size:14,"aria-hidden":"true"})})}),(0,r.jsx)("div",{className:"pointer-events-auto",children:ev?(0,r.jsx)(z.Y,{query:ey,onQueryChange:eI,matchCount:ek,currentIndex:ew,onNext:eA,onPrev:eL,onClose:eT,isAtMaxMatches:ej,onCompositionStart:eM,onCompositionEnd:eE}):(0,r.jsx)("button",{type:"button","data-testid":"chat-transcript-search-toggle",onClick:eS,"aria-label":Y("chatTranscript.openSearch"),title:Y("chatTranscript.openSearch"),className:"rounded-full border border-border bg-surface-2/80 p-1.5 text-muted-foreground shadow-sm backdrop-blur transition-colors hover:bg-muted hover:text-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-ring touch-manipulation",children:(0,r.jsx)(v.A,{size:14,"aria-hidden":"true"})})})]})]})});var _=n(78596),J=n(51515),Q=n(16342);let Y=/\x1b\[[0-9;]*[a-zA-Z]|\x1b\][^\x07\x1b]*(?:\x07|\x1b\\)|\[[0-9;]*m/g,G=/^(?:\x1b\[|\[)([0-9;]*)m$/,V=new Set([38,48,58]);function Z(e){let t;Y.lastIndex=0;let n=[],r="",a=null,s=0,l=0,i=0;for(;null!==(t=Y.exec(e));){let o=e.slice(i,t.index);r+=o,s+=(0,Q.LQ)(o),i=t.index+t[0].length;let c=G.exec(t[0]);if(null===c)continue;let u=function(e,t){let n=(""===t?"0":t).split(";"),r=e;for(let e=0;e<n.length;e++){let t=Number(""===n[e]?"0":n[e]);if(Number.isFinite(t)){if(V.has(t)){let a="2"===n[e+1]?4:2*("5"===n[e+1]);a>0&&48===t&&(r=n.slice(e,e+1+a).join(";")),e+=a;continue}0===t||49===t?r=null:(t>=40&&t<=47||t>=100&&t<=107)&&(r=n[e])}}return r}(a,c[1]);u!==a&&(s>l&&n.push({bg:a,start:l,end:s}),a=u,l=s)}let o=e.slice(i);r+=o,(s+=(0,Q.LQ)(o))>l&&n.push({bg:a,start:l,end:s});let c=new Set(n.map(e=>e.start));return n.length>0&&c.add(n[n.length-1].end),{text:r,segments:n,edges:c,width:s}}function X(e,t){for(let n of e.segments)if(n.start<=t&&t<n.end)return n.bg;return null}function ee(e){let t=new Set;for(let n of e.segments)null!==n.bg&&t.add(n.bg);return t}function et(e){let t=new Map;for(let r of e.segments){var n;null!==r.bg&&t.set(r.bg,(null!=(n=t.get(r.bg))?n:0)+(r.end-r.start))}let r=null,a=0;for(let[e,n]of t)n>a&&(r=e,a=n);return{bg:r,columns:a}}var en=n(18341),er=n(813);let ea=/\S[^\S\n]{2,}esc[^\S\n]*$/,es=/^[│┃╹]/;function el(e,t,n){if(!e.edges.has(t)||!e.edges.has(n))return!1;for(let r of e.segments)if(!(r.end<=t)&&!(r.start>=n)&&null===r.bg)return!1;return!(X(e,t-1)===X(e,t)||n<e.width&&X(e,n)===X(e,n-1)||es.test((0,Q.Ml)(e.text,t-1,t)))&&!es.test((0,Q.Ml)(e.text,t,n))}let ei=/^[^0-9A-Za-z]*([1-9])[.)]\s+\S/,eo=/\bs\s+to\s+use\s+this\s+session\s+only\b/i,ec=/\bEnter\s+to\s+set\s+as\s+default\b/i,eu=/\btype\s+to\s+search\b|\bsearch\s+\w+\s*(?:…|\.\.\.)|(?:^|·)\s*\/\s+search\b/im,ed=/\benter\s+to\s+select\b\s*[·•]\s*esc\s+to\s+cancel\b/i,em=/^\s*(?:press|hit|type)?\s*(?:<)?esc(?:ape)?(?:>)?\s+to\s+(?:close|dismiss|exit)\b[\s.·•]*$/im,ef=/^\u2500+$/,ep="●◉⦿",eh=new RegExp("^\\s*([".concat(ep).concat("◯○◌⚪","])\\s+\\S")),eg=/\besc\s+to\s+interrupt\b|^[^\S\n]*✻[^\S\n]+\S/im;function ex(e){let t=function(e){if(!e)return null;let t=e.replace(/\r\n/g,"\n").split("\n").map(J.aJ),n=t.length-1;for(;n>=0&&""===t[n].trim();)n-=1;if(n<1)return null;let r=-1;for(let e=n-1;e>=0;e-=1){let n=t[e].trim();if(!(n.length<40)&&ef.test(n)){r=e;break}}if(r<0)return null;let a=t.slice(r+1,n+1),s=a.join("\n");if(eu.test(s)||ed.test(s)||em.test(s)||eg.test(s))return null;let l=a.findIndex(e=>""!==e.trim());if(l<0||!function(e){let t=e.split("|");if(t.length<2)return!1;let n=0,r=0;for(let e of t){let t=eh.exec(e);if(null===t)return!1;ep.includes(t[1])?n+=1:r+=1}return n>0&&r>0}(a[l]))return null;let i=[],o=-1;for(let e=l+1;e<a.length;e+=1){let t=ei.exec(a[e]);null!==t&&(o<0&&(o=e),i.push(Number(t[1])))}if(i.length<2||!a.slice(l+1,o).some(e=>""!==e.trim()))return null;let c=0,u=-1;for(let e=0;e<a.length;e+=1){let t=a[e].split("❯").length-1;0!==t&&(c+=t,ei.test(a[e])&&(u=e))}return 0===c||u<0?null:{ruleLineIndex:r,firstLineIndex:r+1,lastLineIndex:n,tabLineIndex:r+1+l,numbers:i,cursorCount:c,cursorLineIndex:r+1+u}}(e);return null!==t&&t.numbers.every((e,t)=>e===t+1)&&1===t.cursorCount?{ruleLineIndex:t.ruleLineIndex,firstLineIndex:t.firstLineIndex,lastLineIndex:t.lastLineIndex,tabLineIndex:t.tabLineIndex,cursorLineIndex:t.cursorLineIndex,optionCount:t.numbers.length}:null}let eb={optionCount:0,offersSessionScope:!1,commitsDefaultOnEnter:!1,hasFilterInput:!1},ev=[function(e){let t=function(e){let t=e.split("\n").map(Z),n=new Set,r=null;for(let e of t){if(!e.text.includes("esc"))continue;let a=[...e.edges].sort((e,t)=>e-t);for(let s of a)if(!(s<1))for(let l of a){if(l-s<16)continue;let a="".concat(s,":").concat(l);if(n.has(a)||!el(e,s,l))continue;let i=(0,Q.Ml)(e.text,s,l);if(!ea.test(i))continue;n.add(a);let o=t.filter(e=>el(e,s,l));if(o.length<3)continue;let c=o.indexOf(e);c<0||c>=3||(null===r||o.length>r.rows)&&(r={id:"opencode_modal_overlay",headerText:(0,er.D)(i.trim(),200,"…[truncated]"),left:s,right:l,rows:o.length,headerRow:c,frameRowStart:t.indexOf(o[0]),frameRowEnd:t.indexOf(o[o.length-1])})}}return r}(e);return null===t?null:e.split("\n").slice(t.frameRowStart,t.frameRowEnd+1).join("\n")},function(e){let t=e.replace(/\r\n/g,"\n").split("\n"),n=-1;for(let e=t.length-1;e>=0;e-=1)if(ed.test((0,J.aJ)(t[e]))){n=e;break}if(n<0){let n=ex(e);return null===n?null:t.slice(n.firstLineIndex,n.lastLineIndex+1).join("\n")}for(let e=n-1;e>=0;e-=1){let r=(0,J.aJ)(t[e]).trim();if(!(r.length<40)&&ef.test(r))return t.slice(e+1,n+1).join("\n")}return null}];function ey(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e)return"";let n=e.replace(/\r\n/g,"\n");if(t.selectionList)for(let e of ev){let t=e(n);if(null===t)continue;let r=(0,en.Uw)(t,{isStructuralRow:en.CG});if(""!==r)return r}let r=(0,en.Uw)(n,{isStructuralRow:en.CG});if(""===r)return"";if(t.selectionList)return r;let a=r.split("\n"),s=function(e){if(void 0===e||!Number.isFinite(e))return 16;let t=Math.trunc(e);return t<12?12:t>20?20:t}(t.maxLines);return a.slice(-s).join("\n")}let ek=/^[^\S\n]*[❯›●][^\S\n]/;function ew(e){let{frame:t,maxLines:n=16,maxHeightClassName:l="max-h-64",actions:i,reason:o,className:c=""}=e,u=(0,s.c)("worktree"),d="selectionList"===o,m=(0,a.useMemo)(()=>ey(t,{maxLines:n,selectionList:d}),[t,n,d]),f=(0,a.useMemo)(()=>m?(0,_.l5)(m):"",[m]),p=(0,a.useRef)(null),h=(0,a.useMemo)(()=>d&&m?function(e){let t=e.split("\n"),n=-1;for(let e=t.length-1;e>=0;e-=1)if(ek.test((0,J.aJ)(t[e]))){n=e;break}return Math.max(n,function(e){let t=e.map(Z),n=t.map(et),r=t.map(ee);for(let e=t.length-1;e>=0;e-=1){let{bg:a,columns:s}=n[e];if(!(null===a||s<8||e>0&&r[e-1].has(a))&&!(e+1<t.length&&r[e+1].has(a)))return e}return -1}(t))}(m):-1,[d,m]);return((0,a.useLayoutEffect)(()=>{if(h<0)return;let e=p.current;if(!e)return;let t=(0,J.aJ)(m).split("\n").length;if(t<=1)return;let n=e.scrollHeight-e.clientHeight;if(n<=0)return;let r=window.getComputedStyle(e),a=Number.parseFloat(r.paddingTop)||0,s=Number.parseFloat(r.paddingBottom)||0,l=Math.max(0,e.scrollHeight-a-s)/t,i=a+h*l-(e.clientHeight-l)/2;e.scrollTop=Math.min(n,Math.max(0,i))},[h,m]),m)?(0,r.jsxs)("div",{"data-testid":"chat-dialog-card","data-reason":o,role:"group","aria-label":u("chatSurface.dialogCardLabel"),className:["flex min-w-0 flex-col gap-2",c].filter(Boolean).join(" "),children:[(0,r.jsx)("div",{ref:p,"data-testid":"chat-dialog-card-frame",className:"overflow-auto rounded-lg border border-border bg-terminal-surface p-2 font-mono text-[11px] leading-snug text-terminal-foreground ".concat(l),children:(0,r.jsx)("div",{className:"whitespace-pre w-max",dangerouslySetInnerHTML:{__html:f}})}),i?(0,r.jsx)("div",{"data-testid":"chat-dialog-card-actions",className:"min-w-0",children:i}):null]}):null}var ej=n(60734),eN=n(73190),eC=n(51021),eS=n(56827),eT=n(49509);let eI=[{key:"1",label:"1",ariaLabel:"Send 1"},{key:"2",label:"2",ariaLabel:"Send 2"},{key:"3",label:"3",ariaLabel:"Send 3"},{key:"4",label:"4",ariaLabel:"Send 4"},{key:"5",label:"5",ariaLabel:"Send 5"},{key:"6",label:"6",ariaLabel:"Send 6"},{key:"7",label:"7",ariaLabel:"Send 7"},{key:"8",label:"8",ariaLabel:"Send 8"},{key:"9",label:"9",ariaLabel:"Send 9"}],eM=[{key:"y",label:"y",ariaLabel:"Send y"},{key:"n",label:"n",ariaLabel:"Send n"},{key:"Enter",label:"↵",ariaLabel:"Send Enter"}],eE="Escape";function eA(e){let{worktreeId:t,cliToolId:n,instanceId:l,onKeysSent:i}=e,o=(0,s.c)("worktree"),{activeKey:c,markPressed:u}=(0,eT.t)(),d=(0,eS.B)(t,n,l,i),m=(0,a.useCallback)(e=>{u(e),d([e])},[u,d]);return(0,r.jsxs)("div",{"data-testid":"prompt-answer-keys",role:"toolbar","aria-label":o("promptAnswerKeys.toolbarLabel"),className:"flex flex-wrap items-center gap-1.5 rounded-lg bg-muted px-2 py-1.5",children:[(0,r.jsx)("span",{className:"text-xs text-muted-foreground",children:o("promptAnswerKeys.caption")}),[...eI,...eM].map(e=>{let{key:t,label:n,ariaLabel:a}=e;return(0,r.jsx)("button",{type:"button","data-testid":"prompt-answer-key-".concat(t),"aria-label":a,onClick:()=>m(t),className:"min-h-[44px] min-w-[44px] rounded-md border border-border px-3 py-2 text-sm font-medium transition-colors duration-75 touch-manipulation focus:outline-none focus:ring-2 focus:ring-ring ".concat(c===t?"border-accent-500 bg-accent-500 text-white scale-95":"bg-surface hover:bg-muted active:bg-muted dark:bg-surface-2"),children:n},t)})]})}function eL(e){let{worktreeId:t,cliToolId:n,instanceId:l,onKeysSent:i,optionCount:o}=e,c=(0,s.c)("worktree"),{activeKey:u,markPressed:d}=(0,eT.t)(),m=(0,eS.B)(t,n,l,i),f=(0,a.useMemo)(()=>{let e=Math.min(Math.trunc(o),9);return!Number.isFinite(e)||e<1?[]:eI.slice(0,e)},[o]),p=(0,a.useCallback)(e=>{d(e),m([e])},[d,m]);return 0===f.length?null:(0,r.jsxs)("div",{"data-testid":"selection-number-keys","data-option-count":String(f.length),role:"toolbar","aria-label":c("selectionKeys.numbersToolbarLabel"),className:"flex flex-wrap items-center gap-1.5 rounded-lg bg-muted px-2 py-1.5",children:[(0,r.jsx)("span",{className:"text-xs text-muted-foreground",children:c("selectionKeys.numbersCaption")}),f.map(e=>{let{key:t,label:n,ariaLabel:a}=e;return(0,r.jsx)("button",{type:"button","data-testid":"selection-number-key-".concat(t),"aria-label":a,onClick:()=>p(t),className:"min-h-[44px] min-w-[44px] rounded-md border border-border px-3 py-2 text-sm font-medium transition-colors duration-75 touch-manipulation focus:outline-none focus:ring-2 focus:ring-ring ".concat(u===t?"border-accent-500 bg-accent-500 text-white scale-95":"bg-surface hover:bg-muted active:bg-muted dark:bg-surface-2"),children:n},t)})]})}function eR(e){let{worktreeId:t,cliToolId:n,instanceId:l,onKeysSent:i,commitsDefaultOnEnter:o}=e,c=(0,s.c)("worktree"),{activeKey:u,markPressed:d}=(0,eT.t)(),m=(0,eS.B)(t,n,l,i),f=(0,a.useCallback)(e=>{d(e),m([e])},[d,m]);return(0,r.jsxs)("div",{"data-testid":"selection-commit-keys",role:"toolbar","aria-label":c("selectionKeys.commitToolbarLabel"),className:"flex flex-wrap items-center gap-1.5 rounded-lg bg-muted px-2 py-1.5",children:[(0,r.jsx)("button",{type:"button","data-testid":"selection-commit-session","aria-label":c("selectionKeys.sessionOnlyAria"),title:c("selectionKeys.sessionOnlyAria"),onClick:()=>f(eC.mE),className:"min-h-[44px] rounded-md border px-3 py-2 text-sm font-medium transition-colors duration-75 touch-manipulation focus:outline-none focus:ring-2 focus:ring-ring ".concat(u===eC.mE?"border-accent-500 bg-accent-500 text-white scale-95":"border-accent-500 bg-surface text-accent-600 hover:bg-muted active:bg-muted dark:bg-surface-2 dark:text-accent-400"),children:c("selectionKeys.sessionOnly")}),(0,r.jsx)("button",{type:"button","data-testid":"selection-commit-default","aria-label":c("selectionKeys.setDefaultAria"),title:c("selectionKeys.setDefaultAria"),onClick:()=>f("Enter"),className:"min-h-[44px] rounded-md border border-border px-3 py-2 text-sm font-medium transition-colors duration-75 touch-manipulation focus:outline-none focus:ring-2 focus:ring-ring ".concat("Enter"===u?"border-accent-500 bg-accent-500 text-white scale-95":"bg-surface hover:bg-muted active:bg-muted dark:bg-surface-2"),children:c("selectionKeys.setDefault")}),o?(0,r.jsx)("p",{"data-testid":"selection-commit-warning",className:"w-full text-xs text-muted-foreground",children:c("selectionKeys.defaultWarning")}):null]})}function eP(e){let{worktreeId:t,cliToolId:n,instanceId:l,onKeysSent:i}=e,o=(0,s.c)("worktree"),{activeKey:c,markPressed:u}=(0,eT.t)(),d=(0,eS.B)(t,n,l,i),m=(0,a.useCallback)(()=>{u(eE),d([eE])},[u,d]);return(0,r.jsx)("div",{"data-testid":"dismiss-panel-keys",role:"toolbar","aria-label":o("dismissPanelKeys.toolbarLabel"),className:"flex flex-wrap items-center gap-1.5 rounded-lg bg-muted px-2 py-1.5",children:(0,r.jsx)("button",{type:"button","data-testid":"dismiss-panel-key-Escape","aria-label":o("dismissPanelKeys.closeAria"),title:o("dismissPanelKeys.closeAria"),onClick:m,className:"min-h-[44px] rounded-md border px-3 py-2 text-sm font-medium transition-colors duration-75 touch-manipulation focus:outline-none focus:ring-2 focus:ring-ring ".concat(c===eE?"border-accent-500 bg-accent-500 text-white scale-95":"border-accent-500 bg-surface text-accent-600 hover:bg-muted active:bg-muted dark:bg-surface-2 dark:text-accent-400"),children:o("dismissPanelKeys.close")})})}[...eI.map(e=>e.key),...eM.map(e=>e.key)];var eD=n(40240),ez=n(68276),eO=n(60199),eF=n(52703);let eH='[data-testid="'.concat(O,'"]'),eK={pager:"chatSurface.reasonPager",selectionList:"chatSurface.reasonSelectionList",dismissablePanel:"chatSurface.reasonDismissablePanel",unclassified:"chatSurface.reasonUnclassified",promptUnreadable:"chatSurface.reasonPromptUnreadable"},eq=(0,a.memo)(function(e){var t,n;let{messages:m,worktreeId:f,worktreePath:p,cliToolId:h,instanceId:g,live:x,onSurfaceModeChange:b,frame:v,onKeysSent:y,compact:k=!1,history:w,className:j=""}=e,N=(0,s.c)("worktree"),C=(0,a.useRef)(null),S=(0,a.useMemo)(()=>(function(e){let t=new Map;for(let n of e)t.set(n.id,n);return t.size===e.length?e:Array.from(t.values())})(m),[m]),I=!1===x.attaching&&!1===x.isRunning,M=(0,a.useRef)(!0),E=(0,a.useRef)(-1),[A,L]=(0,a.useState)(!1),[R,P]=(0,a.useState)(!0),D=(0,a.useCallback)(()=>{var e,t;return null!=(t=null==(e=C.current)?void 0:e.querySelector(eH))?t:null},[]),[z,O]=(0,a.useState)(!1),F=(0,a.useCallback)(e=>{O(null!==e)},[]),H=(0,a.useCallback)(()=>{let e=D();e&&(e.scrollTop=e.scrollHeight),M.current=!0,P(!0),L(!1)},[D]);(0,a.useEffect)(()=>{let e=D();if(!e)return;let t=()=>{let t=(0,T.Mp)({scrollTop:e.scrollTop,scrollHeight:e.scrollHeight,clientHeight:e.clientHeight});M.current=t,P(t),t&&L(!1)};return e.addEventListener("scroll",t),()=>e.removeEventListener("scroll",t)},[D,null==w?void 0:w.isLoading]),(0,a.useLayoutEffect)(()=>{let e=E.current,t=S.length;if(E.current=t,-1!==e&&!(t<=e)){if(M.current){let e=D();e&&(e.scrollTop=e.scrollHeight);return}L(!0)}},[S.length,D]);let K="running"===x.sessionStatus,q=function(e){let{worktreeId:t,cliToolId:n,instanceId:r,enabled:s=!0}=e,{addListener:l,connected:i}=(0,eO.xM)(),[o,c]=(0,a.useState)(null),u=(0,a.useRef)(0),d=null!=r?r:n;(0,a.useEffect)(()=>{u.current=0,c(null)},[t,n,d]),(0,a.useEffect)(()=>{s&&(u.current=0,c(null))},[s]),(0,a.useEffect)(()=>{!i&&s&&(u.current=0,c(null))},[i,s]),(0,a.useEffect)(()=>{if(s||null===o)return;let e=setTimeout(()=>c(null),6e5);return()=>clearTimeout(e)},[s,o]),(0,a.useEffect)(()=>{if(s&&void 0!==n)return l(e=>{e.type===eF.rz&&void 0!==n&&void 0!==d&&e.worktreeId===t&&e.cliToolId===n&&e.instanceId===d&&"string"==typeof e.turnKey&&0!==e.turnKey.length&&"string"==typeof e.body&&"number"==typeof e.version&&Number.isFinite(e.version)&&(e.version<=u.current||(u.current=e.version,c({turnKey:e.turnKey,body:e.body,partial:!0===e.partial,version:e.version,settling:!1})))})},[l,s,t,n,d]);let m=(0,a.useMemo)(()=>null===o?null:{...o,settling:!0},[o]);return s?i?o:null:m}({worktreeId:f,cliToolId:h,instanceId:g,enabled:K}),B=S.length?S[S.length-1].id:null,U=(null==q?void 0:q.settling)===!0,W=(0,a.useRef)(null),[_,Q]=(0,a.useState)(!1);(0,a.useEffect)(()=>{if(!U){W.current=null,Q(!1);return}if(null===W.current){W.current={id:B};return}W.current.id!==B&&Q(!0)},[U,B]);let[Y,G]=(0,a.useState)(null);(0,a.useEffect)(()=>{I&&null!==q&&G(q.turnKey)},[I,q]);let V=null===q||q.turnKey===Y||function(e,t){for(let n=e.length-1;n>=0;n-=1)if(e[n].requestId===t)return!0;return!1}(S,q.turnKey)||q.settling&&_?null:q,Z=(0,a.useMemo)(()=>I?null:null!==V?{turnKey:V.turnKey,version:V.version,body:V.body,partial:V.partial,isThinking:!V.settling&&!0===x.isThinking,settling:V.settling}:K?{isThinking:!0===x.isThinking}:null,[V,K,x.isThinking,I]),X=null!==Z,ee=X&&!0!==Z.settling,et=(0,a.useRef)(!1);(0,a.useLayoutEffect)(()=>{if(!et.current){et.current=!0;return}if(!M.current)return;let e=D();e&&(e.scrollTop=e.scrollHeight)},[null==V?void 0:V.body,X,D]);let en=x.isPagerActive?"pager":x.isSelectionListActive?"selectionList":(null!=(n=x.isDismissablePanelActive)?n:function(e){if(!e)return!1;let t=(0,J.aJ)(e.replace(/\r\n/g,"\n")).split("\n"),n=t.length-1;for(;n>=0&&""===t[n].trim();)n-=1;return!(n<0)&&t.slice(Math.max(0,n+1-15),n+1).some(e=>em.test(e))}(v))?"dismissablePanel":x.isUnclassifiedActive?"unclassified":x.isPromptWaiting&&!(0,ez.XF)(x.promptData)?"promptUnreadable":null,er=(0,a.useCallback)(()=>{b("terminal")},[b]),ea=(0,a.useRef)(null);(0,a.useEffect)(()=>()=>{null!==ea.current&&clearTimeout(ea.current)},[]);let es=(0,a.useCallback)(()=>{null==y||y(),null!==ea.current&&clearTimeout(ea.current),ea.current=setTimeout(()=>{ea.current=null,null==y||y()},400)},[y]),el=(0,a.useMemo)(()=>"selectionList"===en?function(e){if(!e)return eb;let t=function(e){let t=(0,J.aJ)(e.replace(/\r\n/g,"\n")).split("\n"),n=t.length-1;for(;n>=0&&""===t[n].trim();)n-=1;return n<0?[]:t.slice(Math.max(0,n+1-40),n+1)}(e);if(0===t.length)return eb;let n=t.join("\n");return{optionCount:function(e){let t=0,n=0;for(let r of e){let e=ei.exec(r);if(null===e)continue;let a=Number(e[1]);a===n+1?(n=a,t=a):1===a?(n=1,t=1):n=0}return Math.min(t,9)}(t),offersSessionScope:eo.test(n),commitsDefaultOnEnter:ec.test(n),hasFilterInput:eu.test(n)}}(v):null,[en,v]),ed=(0,a.useMemo)(()=>"selectionList"===en&&null!==ex(v),[en,v]),ef=(0,a.useMemo)(()=>"selectionList"===en&&v?ey(v,{selectionList:!0}).split("\n").length:0,[en,v]),ep=(0,a.useMemo)(()=>{if(null===en||!h)return null;let e={worktreeId:f,cliToolId:h,instanceId:g,onKeysSent:es};switch(en){case"pager":return(0,r.jsx)(ej.y,{...e,showPagerKeys:!0});case"selectionList":{var t;let n=(null==el?void 0:el.offersSessionScope)===!0&&eC.qL.includes(h);return(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(ej.y,{...e}),!el||ed||!((t=el).optionCount>0)||t.offersSessionScope||t.hasFilterInput?null:(0,r.jsx)(eL,{...e,optionCount:el.optionCount}),n&&el?(0,r.jsx)(eR,{...e,commitsDefaultOnEnter:el.commitsDefaultOnEnter}):null,(0,r.jsx)(eD.tY,{worktreeId:f,cliToolId:h,instanceId:g,onKeysSent:es})]})}case"dismissablePanel":return(0,r.jsx)(eP,{...e});case"unclassified":return(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(eN.U,{...e}),(0,r.jsx)(eA,{...e})]});case"promptUnreadable":return(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)("p",{"data-testid":"chat-surface-unreadable-hint",className:"text-xs text-muted-foreground",children:N("chatSurface.unreadableHint")}),(0,r.jsx)(eA,{...e})]})}},[en,h,f,g,es,el,ed,N]),eh=null!=w?w:{},eg=(0,u.UI)(f),ev=null!=(t=null!=g?g:h)?t:null,ek=(0,a.useMemo)(()=>ev?(0,d.y)((0,d.g)({owed:eg.owedBy(ev),awaiting:eg.awaitedBy(ev),aliasOf:e=>e.worktreeId===f?e.instanceId:"".concat(e.instanceId," @ ").concat(e.worktreeId)})):null,[eg,ev,f]);return(0,r.jsxs)("div",{ref:C,"data-testid":"chat-surface","data-instance-id":null!=g?g:h,className:["flex h-full min-h-0 w-full flex-col overflow-hidden bg-surface text-surface-foreground",j].filter(Boolean).join(" "),children:[ek&&(0,r.jsxs)("div",{"data-testid":"chat-surface-relay","data-relay-tone":ek.tone,role:"status",className:"flex shrink-0 items-center gap-1.5 border-b border-border px-3 py-1 text-xs ".concat("prompt"===ek.tone?"bg-warning-subtle text-warning-foreground":"bg-surface-2 text-muted-foreground"),children:[(0,r.jsx)(l.A,{size:12,className:"shrink-0","aria-hidden":"true"}),(0,r.jsx)("span",{className:"min-w-0 flex-1 truncate",children:N("relay.".concat(ek.key),ek.params)})]}),(0,r.jsxs)("div",{className:"relative min-h-0 flex-1 overflow-hidden",children:[(0,r.jsx)($,{...eh,messages:S,worktreeId:f,worktreePath:p,cliToolId:h,liveTurn:Z,instanceId:g,sessionEnded:I,onScrollControlsChange:F,className:"h-full"}),!z&&(A||X&&!R)&&(0,r.jsxs)("button",{type:"button","data-testid":"chat-surface-new-messages","data-generating":ee?"true":void 0,onClick:H,"aria-label":ee?N("chatSurface.jumpToLatestGenerating"):void 0,className:"absolute bottom-3 left-1/2 z-10 flex min-h-[36px] -translate-x-1/2 items-center gap-1.5 rounded-full border border-border bg-surface-2 px-3 py-1.5 text-xs font-medium text-foreground shadow-lg transition-colors hover:bg-muted focus:outline-none focus-visible:ring-2 focus-visible:ring-ring touch-manipulation",children:[ee?(0,r.jsx)(i.A,{size:14,className:"animate-spin","aria-hidden":"true"}):(0,r.jsx)(o.A,{size:14,"aria-hidden":"true"}),N("chatSurface.jumpToLatest")]})]}),null!==en&&(0,r.jsxs)("div",{"data-testid":"chat-surface-live",role:"group","aria-label":N("chatSurface.liveRegionLabel"),className:"flex shrink-0 flex-col gap-2 border-t border-border bg-surface px-3 py-2",children:[(0,r.jsxs)("div",{"data-testid":"chat-surface-terminal-banner","data-reason":en,role:"status","aria-label":N("chatSurface.bannerLabel"),className:"flex flex-wrap items-center gap-2 rounded-lg border border-warning-border bg-warning-subtle px-2 py-1.5",children:[(0,r.jsx)("span",{className:"min-w-0 flex-1 text-xs text-foreground",children:N(eK[en])}),(0,r.jsxs)("button",{type:"button","data-testid":"chat-surface-open-terminal",onClick:er,className:"flex min-h-[32px] shrink-0 items-center gap-1 rounded-md border border-warning-border bg-surface px-2 py-1 text-xs font-medium text-warning-foreground transition-colors hover:bg-muted focus:outline-none focus-visible:ring-2 focus-visible:ring-ring touch-manipulation",children:[(0,r.jsx)(c.A,{size:14,"aria-hidden":"true"}),N("chatSurface.openTerminal")]})]}),v?(0,r.jsx)(ew,{frame:v,reason:en,maxLines:k?12:void 0,maxHeightClassName:ef>24?"max-h-[35vh]":k?"max-h-32":"max-h-64",actions:ep}):null]})]})})},87364:(e,t,n)=>{n.d(t,{t:()=>l});var r=n(95155),a=n(12115),s=n(18955);class l extends a.Component{static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){var n,r;console.error("[ErrorBoundary:".concat(this.props.componentName||"unknown","]"),e,t),null==(n=(r=this.props).onError)||n.call(r,e,t)}render(){return this.state.hasError?this.props.fallback?this.props.fallback:(0,r.jsx)(i,{componentName:this.props.componentName,error:this.state.error,onRetry:this.handleRetry}):this.props.children}constructor(e){super(e),this.handleRetry=()=>{this.setState({hasError:!1,error:null})},this.state={hasError:!1,error:null}}}function i(e){let{componentName:t,error:n,onRetry:a}=e,l=(0,s.c)("error"),i=(0,s.c)("common");return(0,r.jsxs)("div",{className:"p-4 bg-danger-subtle border border-danger-border rounded-lg",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 text-danger-foreground mb-2",children:[(0,r.jsx)("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20",children:(0,r.jsx)("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z",clipRule:"evenodd"})}),(0,r.jsx)("span",{className:"font-medium",children:t?l("boundary.errorOccurredIn",{componentName:t}):l("boundary.errorOccurred")})]}),n&&(0,r.jsx)("p",{className:"text-sm text-danger-foreground/80 mb-3",children:n.message}),a&&(0,r.jsx)("button",{onClick:a,className:"px-4 py-2 bg-danger-foreground text-danger-subtle rounded hover:opacity-90 transition-opacity text-sm",children:i("retry")})]})}},88731:(e,t,n)=>{n.d(t,{UK:()=>l,dl:()=>r,gP:()=>i,v8:()=>a,wP:()=>s});let r=[50,100,150,200,250,500,1e3],a=50,s="commandmate:historyDisplayLimit";function l(e){return r.includes(e)}let i="commandmate:historyUserOnly"},88894:(e,t,n)=>{function r(e){let t="[^\\S\\n]";return RegExp("(?:^".concat(t,"*|\xb7").concat(t,"*|").concat(t,"{2})").concat(e)+"(?:".concat(t,"\\([^()\\n]{1,32}\\))?")+"(?:".concat(t,"*\xb7|").concat(t,"{2}|").concat(t,"*$)"),"i")}n.d(t,{A:()=>l,h:()=>s});let a={claude:{key:"BTab",cycle:["auto","manual","accept-edits","plan"],indicators:[{mode:"accept-edits",pattern:/⏵⏵\s*accept edits on\b/},{mode:"auto",pattern:/⏵⏵\s*auto mode on\b/},{mode:"plan",pattern:/⏸\s*plan mode on\b/},{mode:"manual",pattern:/⏸\s*manual mode on\b/}],tailRows:3,noteId:null},"command-code":{key:"BTab",cycle:["default","accept-edits","plan"],indicators:[{mode:"accept-edits",pattern:/»\s*accept edits on\b/},{mode:"bypass",pattern:/»\s*permission bypass on\b/},{mode:"dont-ask",pattern:/»\s*don't-ask on\b/},{mode:"plan",pattern:/^[^\S\n]*plan mode\b/},{mode:"default",pattern:/\?\s+for\s+shortcuts\b/}],tailRows:4,noteId:null},codex:{key:"BTab",cycle:["default","plan"],indicators:[{mode:"plan",pattern:/\bPlan mode\s*\(shift\+tab to cycle\)/i}],tailRows:3,noteId:"codexModelCoupled"},copilot:{key:"BTab",cycle:["default","plan","autopilot"],indicators:[{mode:"autopilot",pattern:r("autopilot")},{mode:"plan",pattern:r("plan(?:[^\\S\\n]mode)?")}],tailRows:2,noteId:null},antigravity:{key:"BTab",cycle:["default","accept-edits","plan"],indicators:[{mode:"accept-edits",pattern:r("accept-edits")},{mode:"plan",pattern:r("plan(?:[^\\S\\n]mode)?")}],tailRows:2,noteId:null}};function s(e){var t;return null!=(t=a[e])?t:null}let l=Object.keys(a)},89568:(e,t,n)=>{n.d(t,{B7:()=>s,CK:()=>f,JD:()=>i,ML:()=>m,UY:()=>u,hM:()=>l});var r=n(4300),a=n(92147);let s=8,l=120,i=40,o={variant:"none",startedAtMs:null};function c(e){var t,n;return"".concat(null!=(t=e.cliToolId)?t:"","|").concat(null!=(n=e.instanceId)?n:"")}function u(e){let t,n=function(e){let t=[],n=[],r=[],s=!1,l=()=>{t.push(...n,...r),n=[],r=[]};for(let i of e){if("user"===i.role&&!(0,a.nY)(i)){l(),t.push(i);continue}if(!(0,a.nY)(i)){r.push(i);continue}r.length>0&&(s=!0),n.push(i)}return l(),s?t:e}(e),s=function(e){let t=new Map;for(let n of e){if("user"!==n.role||(0,a.nY)(n)||n.optimisticState||n.archived)continue;let e=n.requestId;if("string"!=typeof e||0===e.length)continue;if(t.has(e)){t.set(e,null);continue}let r=n.timestamp instanceof Date?n.timestamp.getTime():NaN;t.set(e,Number.isFinite(r)?{atMs:r,scope:c(n)}:null)}return t}(n),l=[],i=function(e){let t=new Map,n=0,r=!1;for(let s of e){if(!(0,a.nY)(s)){r=!1;continue}r||(n+=1,r=!0),t.has(s.id)||t.set(s.id,n)}return t}(e),u=[],d=null,m=null,f=()=>{0!==u.length&&(l.push({kind:"approvals",key:"approvals:".concat(u[0].id),entries:(0,a.GV)(u,{runIds:i})}),u=[])};for(let e of n){var p;if((0,a.nY)(e)){u.push(e);continue}f();let n=!(p=t)||p.role!==e.role,i=o;if("assistant"!==e.role)d=null,m=null,n&&(i={variant:"role",startedAtMs:null});else{let t=c(e);(n||m!==t)&&(d=null),m=t;let a=(0,r.Qu)(e.requestId),l=function(e,t,n){if(null===t)return null;let a=(0,r.QN)(t);if(null===a)return null;let s=n.get(a);if(!s||s.scope!==c(e))return null;let l=e.timestamp instanceof Date?e.timestamp.getTime():NaN;return!Number.isFinite(l)||s.atMs>l?null:s.atMs}(e,a,s);n?i={variant:"role",startedAtMs:l}:null!==a&&null!==d&&a!==d&&(i={variant:"time",startedAtMs:l}),null!==a&&(d=a)}l.push({kind:"message",key:e.id,message:e,showHeader:n,header:i}),t=e}return f(),l}let d=/(^|[\s`"'(\[<(「『【])(\/[^\s\n<>"']+\.[a-zA-Z0-9]+)/g;function m(e){if("string"!=typeof e||0===e.length)return[{type:"text",content:""}];let t=[],n=0;for(let s of e.matchAll(d)){var r,a;let l=null!=(r=s[1])?r:"",i=s[2];if(!i)continue;let o=(null!=(a=s.index)?a:0)+l.length;o>n&&t.push({type:"text",content:e.slice(n,o)}),t.push({type:"path",content:i}),n=o+i.length}return 0===t.length?[{type:"text",content:e}]:(n<e.length&&t.push({type:"text",content:e.slice(n)}),t)}function f(e){return!e||"assistant"!==e.role}},92147:(e,t,n)=>{n.d(t,{GV:()=>N,rS:()=>C,nY:()=>y});var r=n(68276),a=n(3648);function s(){let e=(0,a._)(["←s*(?:[☐☒☑][^←→☐☒☑✔]*)+✔s*Submits*→"],["←\\s*(?:[☐☒☑][^←→☐☒☑✔]*)+✔\\s*Submit\\s*→"]);return s=function(){return e},e}let l=String.raw(s()),i=new RegExp("^".concat(l,"\\s*"));new RegExp("^\\s?".concat(l,"$"));let o=/\s*Ready to submit your answers\?\s*$/,c=/^Review your answers\s*/,u=/●\s*([^●→]+)/g,d=/^submit answers$/i,m=/^cancel$/i,f={human:5,auto:4,terminal:3,pending:2,unclassified:1,unknown:0};function p(e){return"object"==typeof e&&null!==e?e:null}function h(e,t){let n=null==e?void 0:e[t];return"string"==typeof n?n:""}function g(e){if(!Array.isArray(e))return[];let t=[];for(let n of e){if("string"==typeof n){t.push(n);continue}let e=h(p(n),"label");e&&t.push(e)}return t}function x(e){return e.replace(/\s+/g," ").trim()}function b(e){return e.length<=160?e:"".concat(e.slice(0,159).trimEnd(),"…")}function v(e){return x(e).replace(i,"").trim()}function y(e){return(null==e?void 0:e.messageType)==="prompt"}function k(e){let t=null==e?void 0:e.summary;return"string"==typeof t&&t.startsWith("PermissionRequest allow")}function w(e){return{...e,messageIds:[...e.messageIds],reviewQuestions:[...e.reviewQuestions]}}function j(e,t,n){if(e<=0||t<=0)return!1;let r=t-e;return r>=0&&r<=n}function N(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{windowMs:n=5e3,runIds:a}=t;return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5e3,n=[];for(let r of e){if("question"===r.kind){let e=n[n.length-1];if("confirmation"===r.phase){if(e&&"question"===e.kind&&"question"===e.phase&&e.scopeKey===r.scopeKey&&e.runId===r.runId&&""!==e.questionText&&r.reviewQuestions.includes(e.questionText)&&j(e.timestampMs,r.timestampMs,t)){e.messageIds.push(...r.messageIds),e.confirmationOutcome=r.outcome;continue}n.push(w(r));continue}if(e&&"question"===e.kind&&"question"===e.phase&&""!==r.mergeKey&&e.mergeKey===r.mergeKey&&e.runId===r.runId&&j(e.timestampMs,r.timestampMs,t)){e.messageIds.push(...r.messageIds),e.label||(e.label=r.label),f[r.outcome]>f[e.outcome]&&(e.outcome=r.outcome);continue}n.push(w(r));continue}let e=r.mergeKey?n.find(e=>"approval"===e.kind&&e.mergeKey===r.mergeKey&&Math.abs(r.timestampMs-e.timestampMs)<=t):void 0;if(!e){n.push(w(r));continue}e.messageIds.push(...r.messageIds),e.isPermissionAudit=e.isPermissionAudit||r.isPermissionAudit,e.label||(e.label=r.label),f[r.outcome]>f[e.outcome]&&(e.outcome=r.outcome)}return n}(e.map(e=>{var t;return function(e){let t,n,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,s=p(e.promptData),l=k(e),i=h(s,"question"),f=h(s,"approvalTarget"),y=h(s,"answeredBy"),w=h(s,"status"),j=h(s,"type"),N="string"==typeof e.summary?e.summary:"",C=function(e,t){let n=v(e),r=o.test(n),a=g(t),s=n.replace(o,"").replace(c,"").trim();return{hasTail:r,hasSubmitOptions:a.some(e=>d.test(e.trim()))&&a.some(e=>m.test(e.trim())),reviewQuestions:[...s.matchAll(u)].map(e=>{var t;return(null!=(t=e[1])?t:"").trim()}).filter(e=>e.length>0)}}(i,null==s?void 0:s.options),{kind:S,phase:T}=k(e)?{kind:"approval"}:(null==s?void 0:s.isAskUserQuestion)===!0?{kind:"question",phase:C.hasTail||C.hasSubmitOptions?"confirmation":"question"}:C.hasTail&&(C.hasSubmitOptions||C.reviewQuestions.length>0)?{kind:"question",phase:"confirmation"}:{kind:"approval"};t=l?"auto":"auto"===y||"human"===y||"terminal"===y?y:j===r.LT||"unclassified"===w?"unclassified":"pending"===w?"pending":"unknown";let I=function(e){let t="string"==typeof e.cliToolId&&e.cliToolId?e.cliToolId:"claude",n="string"==typeof e.instanceId&&e.instanceId?e.instanceId:t;return JSON.stringify(["string"==typeof e.worktreeId?e.worktreeId:"",t,n])}(e),M="question"===S&&"question"===T,E=M?v(i):"",A="question"===S&&"confirmation"===T&&1===C.reviewQuestions.length?C.reviewQuestions[0]:"";n="question"===S?b(M?E:A):b(x(i||N));let L="";if(M){let e=p(null==s?void 0:s.askUserQuestion),t="number"==typeof(null==e?void 0:e.questionIndex)?e.questionIndex:null;L=E?JSON.stringify(["question",I,E,t,g(null==s?void 0:s.options)]):""}else"approval"===S&&(L=i?JSON.stringify([i,f]):"");return{id:e.id,messageIds:[e.id],label:n,outcome:t,isPermissionAudit:l,timestampMs:function(e){if(e instanceof Date){let t=e.getTime();return Number.isFinite(t)?t:0}if("string"==typeof e||"number"==typeof e){let t=new Date(e).getTime();return Number.isFinite(t)?t:0}return 0}(e.timestamp),mergeKey:L,kind:S,...T?{phase:T}:{},questionText:E,reviewQuestions:C.reviewQuestions,scopeKey:I,runId:a}}(e,null!=(t=null==a?void 0:a.get(e.id))?t:0)}),n)}function C(e){let t=0,n=0,r=0;for(let a of e)"question"!==a.kind?t+=1:"confirmation"===a.phase?r+=1:n+=1;return{approvals:t,questions:n,confirmations:r,total:e.length}}},92710:(e,t,n)=>{n.d(t,{Y:()=>i});var r=n(95155),a=n(12115),s=n(18955),l=n(78660);function i(e){let{query:t,onQueryChange:n,matchCount:i,currentIndex:o,onNext:c,onPrev:u,onClose:d,isAtMaxMatches:m,onCompositionStart:f,onCompositionEnd:p}=e,h=(0,a.useRef)(null),g=(0,s.c)("worktree");(0,a.useEffect)(()=>{var e;null==(e=h.current)||e.focus()},[]);let x=(0,a.useCallback)(e=>{"Escape"===e.key&&d()},[d]),b=(0,a.useCallback)(e=>{n(e.target.value)},[n]),v=0===i?"0/0":m?g("history.search.countAtMax",{current:o+1,max:l.F0}):"".concat(o+1,"/").concat(i);return(0,r.jsxs)("div",{className:"flex items-center gap-1 px-2 py-1 bg-surface border border-border rounded shadow-lg",role:"search","aria-label":g("history.search.regionLabel"),children:[(0,r.jsx)("input",{ref:h,type:"text",value:t,onChange:b,onKeyDown:x,onCompositionStart:f,onCompositionEnd:p,placeholder:g("history.search.placeholder"),className:"bg-transparent text-foreground text-sm outline-none w-32 sm:w-40 placeholder-muted-foreground","aria-label":g("history.search.keywordLabel"),autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1}),(0,r.jsx)("span",{role:"status","aria-live":"polite","aria-atomic":"true",className:"text-muted-foreground text-xs min-w-[3rem] text-right",children:v}),(0,r.jsx)("button",{type:"button",onClick:u,disabled:0===i,"aria-label":g("history.search.prev"),className:"text-muted-foreground hover:text-foreground disabled:opacity-40 min-w-[36px] min-h-[36px] flex items-center justify-center text-base",children:"▲"}),(0,r.jsx)("button",{type:"button",onClick:c,disabled:0===i,"aria-label":g("history.search.next"),className:"text-muted-foreground hover:text-foreground disabled:opacity-40 min-w-[36px] min-h-[36px] flex items-center justify-center text-base",children:"▼"}),(0,r.jsx)("button",{type:"button",onClick:d,"aria-label":g("history.search.close"),className:"text-muted-foreground hover:text-foreground min-w-[36px] min-h-[36px] flex items-center justify-center text-base ml-1",children:"✕"})]})}},95342:(e,t,n)=>{function r(e){let t=[],n=e.awaiting.filter(e=>"prompt"===e.state);n.length>0&&t.push({tone:"prompt",key:"badgePrompt",params:{count:n.length,alias:e.aliasOf(n[0].to)},titleKey:"promptTitle",count:n.length});let r=e.awaiting.filter(e=>"prompt"!==e.state);return 1===r.length?t.push({tone:"awaiting",key:"badgeAwaiting",params:{alias:e.aliasOf(r[0].to)},titleKey:"awaitingTitle",count:1}):r.length>1&&t.push({tone:"awaiting",key:"badgeAwaitingMany",params:{count:r.length},titleKey:"awaitingTitle",count:r.length}),1===e.owed.length?t.push({tone:"owed",key:"badgeOwed",params:{alias:e.aliasOf(e.owed[0].from)},titleKey:"owedTitle",count:1}):e.owed.length>1&&t.push({tone:"owed",key:"badgeOwedMany",params:{count:e.owed.length},titleKey:"owedTitle",count:e.owed.length}),t}function a(e){if(0===e.length)return null;let[t]=e,n="prompt"===t.tone?"stripPrompt":"owed"===t.tone?"stripOwed":t.count>1?"stripAwaitingMany":"stripAwaiting";return{...t,key:n}}n.d(t,{g:()=>r,y:()=>a})},96802:(e,t,n)=>{n.d(t,{Mp:()=>l,__:()=>a,b:()=>r,vC:()=>s});let r=6,a=160,s=30;function l(e){let{scrollTop:t,scrollHeight:n,clientHeight:r}=e,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:80,s=n-t-r;return!!Number.isFinite(s)&&s<=a}}}]);