commandmate 0.18.0 → 0.20.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 (793) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-build-manifest.json +230 -223
  3. package/.next/app-path-routes-manifest.json +32 -32
  4. package/.next/build-manifest.json +2 -2
  5. package/.next/prerender-manifest.json +9 -9
  6. package/.next/required-server-files.json +1 -1
  7. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  8. package/.next/server/app/api/app/update/route.js +5 -3
  9. package/.next/server/app/api/app/update/route.js.nft.json +1 -1
  10. package/.next/server/app/api/app/update/route_client-reference-manifest.js +1 -1
  11. package/.next/server/app/api/app/update-check/route.js +1 -1
  12. package/.next/server/app/api/app/update-check/route.js.nft.json +1 -1
  13. package/.next/server/app/api/app/update-check/route_client-reference-manifest.js +1 -1
  14. package/.next/server/app/api/assistant/conversation/route.js +1 -1
  15. package/.next/server/app/api/assistant/conversation/route.js.nft.json +1 -1
  16. package/.next/server/app/api/assistant/conversation/route_client-reference-manifest.js +1 -1
  17. package/.next/server/app/api/assistant/current-output/route.js +1 -1
  18. package/.next/server/app/api/assistant/current-output/route.js.nft.json +1 -1
  19. package/.next/server/app/api/assistant/current-output/route_client-reference-manifest.js +1 -1
  20. package/.next/server/app/api/assistant/messages/route.js +1 -1
  21. package/.next/server/app/api/assistant/messages/route.js.nft.json +1 -1
  22. package/.next/server/app/api/assistant/messages/route_client-reference-manifest.js +1 -1
  23. package/.next/server/app/api/assistant/session/route.js +1 -1
  24. package/.next/server/app/api/assistant/session/route.js.nft.json +1 -1
  25. package/.next/server/app/api/assistant/session/route_client-reference-manifest.js +1 -1
  26. package/.next/server/app/api/assistant/start/route.js +1 -1
  27. package/.next/server/app/api/assistant/start/route.js.nft.json +1 -1
  28. package/.next/server/app/api/assistant/start/route_client-reference-manifest.js +1 -1
  29. package/.next/server/app/api/assistant/terminal/route.js +1 -1
  30. package/.next/server/app/api/assistant/terminal/route.js.nft.json +1 -1
  31. package/.next/server/app/api/assistant/terminal/route_client-reference-manifest.js +1 -1
  32. package/.next/server/app/api/assistant/tools/route.js +1 -1
  33. package/.next/server/app/api/assistant/tools/route.js.nft.json +1 -1
  34. package/.next/server/app/api/assistant/tools/route_client-reference-manifest.js +1 -1
  35. package/.next/server/app/api/auth/login/route.js +1 -1
  36. package/.next/server/app/api/auth/login/route.js.nft.json +1 -1
  37. package/.next/server/app/api/auth/login/route_client-reference-manifest.js +1 -1
  38. package/.next/server/app/api/auth/logout/route.js +1 -1
  39. package/.next/server/app/api/auth/logout/route.js.nft.json +1 -1
  40. package/.next/server/app/api/auth/logout/route_client-reference-manifest.js +1 -1
  41. package/.next/server/app/api/auth/status/route.js +1 -1
  42. package/.next/server/app/api/auth/status/route.js.nft.json +1 -1
  43. package/.next/server/app/api/auth/status/route_client-reference-manifest.js +1 -1
  44. package/.next/server/app/api/daily-summary/route.js +1 -1
  45. package/.next/server/app/api/daily-summary/route.js.nft.json +1 -1
  46. package/.next/server/app/api/daily-summary/route_client-reference-manifest.js +1 -1
  47. package/.next/server/app/api/daily-summary/status/route.js +1 -1
  48. package/.next/server/app/api/daily-summary/status/route.js.nft.json +1 -1
  49. package/.next/server/app/api/daily-summary/status/route_client-reference-manifest.js +1 -1
  50. package/.next/server/app/api/external-apps/[id]/health/route.js +1 -1
  51. package/.next/server/app/api/external-apps/[id]/health/route.js.nft.json +1 -1
  52. package/.next/server/app/api/external-apps/[id]/health/route_client-reference-manifest.js +1 -1
  53. package/.next/server/app/api/external-apps/[id]/route.js +1 -1
  54. package/.next/server/app/api/external-apps/[id]/route.js.nft.json +1 -1
  55. package/.next/server/app/api/external-apps/[id]/route_client-reference-manifest.js +1 -1
  56. package/.next/server/app/api/external-apps/route.js +1 -1
  57. package/.next/server/app/api/external-apps/route.js.nft.json +1 -1
  58. package/.next/server/app/api/external-apps/route_client-reference-manifest.js +1 -1
  59. package/.next/server/app/api/fs/browse/route.js +2 -2
  60. package/.next/server/app/api/fs/browse/route.js.nft.json +1 -1
  61. package/.next/server/app/api/fs/browse/route_client-reference-manifest.js +1 -1
  62. package/.next/server/app/api/fs/recent-paths/route.js +2 -2
  63. package/.next/server/app/api/fs/recent-paths/route.js.nft.json +1 -1
  64. package/.next/server/app/api/fs/recent-paths/route_client-reference-manifest.js +1 -1
  65. package/.next/server/app/api/hooks/agent-event/route.js +1 -1
  66. package/.next/server/app/api/hooks/agent-event/route.js.nft.json +1 -1
  67. package/.next/server/app/api/hooks/agent-event/route_client-reference-manifest.js +1 -1
  68. package/.next/server/app/api/hooks/claude-done/route.js +1 -1
  69. package/.next/server/app/api/hooks/claude-done/route.js.nft.json +1 -1
  70. package/.next/server/app/api/hooks/claude-done/route_client-reference-manifest.js +1 -1
  71. package/.next/server/app/api/metrics/vibe/route.js +2 -2
  72. package/.next/server/app/api/metrics/vibe/route.js.nft.json +1 -1
  73. package/.next/server/app/api/metrics/vibe/route_client-reference-manifest.js +1 -1
  74. package/.next/server/app/api/ollama/models/route.js +1 -1
  75. package/.next/server/app/api/ollama/models/route.js.nft.json +1 -1
  76. package/.next/server/app/api/ollama/models/route_client-reference-manifest.js +1 -1
  77. package/.next/server/app/api/push/subscriptions/route.js +1 -1
  78. package/.next/server/app/api/push/subscriptions/route.js.nft.json +1 -1
  79. package/.next/server/app/api/push/subscriptions/route_client-reference-manifest.js +1 -1
  80. package/.next/server/app/api/push/vapid/route.js +1 -1
  81. package/.next/server/app/api/push/vapid/route.js.nft.json +1 -1
  82. package/.next/server/app/api/push/vapid/route_client-reference-manifest.js +1 -1
  83. package/.next/server/app/api/repositories/[id]/route.js +1 -1
  84. package/.next/server/app/api/repositories/[id]/route.js.nft.json +1 -1
  85. package/.next/server/app/api/repositories/[id]/route_client-reference-manifest.js +1 -1
  86. package/.next/server/app/api/repositories/[id]/todos/[todoId]/route.js +1 -1
  87. package/.next/server/app/api/repositories/[id]/todos/[todoId]/route.js.nft.json +1 -1
  88. package/.next/server/app/api/repositories/[id]/todos/[todoId]/route_client-reference-manifest.js +1 -1
  89. package/.next/server/app/api/repositories/[id]/todos/route.js +1 -1
  90. package/.next/server/app/api/repositories/[id]/todos/route.js.nft.json +1 -1
  91. package/.next/server/app/api/repositories/[id]/todos/route_client-reference-manifest.js +1 -1
  92. package/.next/server/app/api/repositories/clone/[jobId]/route.js +1 -1
  93. package/.next/server/app/api/repositories/clone/[jobId]/route.js.nft.json +1 -1
  94. package/.next/server/app/api/repositories/clone/[jobId]/route_client-reference-manifest.js +1 -1
  95. package/.next/server/app/api/repositories/clone/route.js +1 -1
  96. package/.next/server/app/api/repositories/clone/route.js.nft.json +1 -1
  97. package/.next/server/app/api/repositories/clone/route_client-reference-manifest.js +1 -1
  98. package/.next/server/app/api/repositories/excluded/route.js +1 -1
  99. package/.next/server/app/api/repositories/excluded/route.js.nft.json +1 -1
  100. package/.next/server/app/api/repositories/excluded/route_client-reference-manifest.js +1 -1
  101. package/.next/server/app/api/repositories/restore/route.js +1 -1
  102. package/.next/server/app/api/repositories/restore/route.js.nft.json +1 -1
  103. package/.next/server/app/api/repositories/restore/route_client-reference-manifest.js +1 -1
  104. package/.next/server/app/api/repositories/route.js +1 -1
  105. package/.next/server/app/api/repositories/route.js.nft.json +1 -1
  106. package/.next/server/app/api/repositories/route_client-reference-manifest.js +1 -1
  107. package/.next/server/app/api/repositories/scan/route.js +1 -1
  108. package/.next/server/app/api/repositories/scan/route.js.nft.json +1 -1
  109. package/.next/server/app/api/repositories/scan/route_client-reference-manifest.js +1 -1
  110. package/.next/server/app/api/repositories/sync/route.js +1 -1
  111. package/.next/server/app/api/repositories/sync/route.js.nft.json +1 -1
  112. package/.next/server/app/api/repositories/sync/route_client-reference-manifest.js +1 -1
  113. package/.next/server/app/api/repositories/validate-path/route.js +1 -1
  114. package/.next/server/app/api/repositories/validate-path/route.js.nft.json +1 -1
  115. package/.next/server/app/api/repositories/validate-path/route_client-reference-manifest.js +1 -1
  116. package/.next/server/app/api/sidebar/group-order/route.js +2 -2
  117. package/.next/server/app/api/sidebar/group-order/route.js.nft.json +1 -1
  118. package/.next/server/app/api/sidebar/group-order/route_client-reference-manifest.js +1 -1
  119. package/.next/server/app/api/skills/[id]/route.js +1 -1
  120. package/.next/server/app/api/skills/[id]/route.js.nft.json +1 -1
  121. package/.next/server/app/api/skills/[id]/route_client-reference-manifest.js +1 -1
  122. package/.next/server/app/api/skills/installations/route.js +1 -1
  123. package/.next/server/app/api/skills/installations/route.js.nft.json +1 -1
  124. package/.next/server/app/api/skills/installations/route_client-reference-manifest.js +1 -1
  125. package/.next/server/app/api/skills/operations/route.js +2 -2
  126. package/.next/server/app/api/skills/operations/route.js.nft.json +1 -1
  127. package/.next/server/app/api/skills/operations/route_client-reference-manifest.js +1 -1
  128. package/.next/server/app/api/skills/reindex/route.js +1 -1
  129. package/.next/server/app/api/skills/reindex/route.js.nft.json +1 -1
  130. package/.next/server/app/api/skills/reindex/route_client-reference-manifest.js +1 -1
  131. package/.next/server/app/api/skills/route.js +1 -1
  132. package/.next/server/app/api/skills/route.js.nft.json +1 -1
  133. package/.next/server/app/api/skills/route_client-reference-manifest.js +1 -1
  134. package/.next/server/app/api/slash-commands/route.js +1 -1
  135. package/.next/server/app/api/slash-commands/route.js.nft.json +1 -1
  136. package/.next/server/app/api/slash-commands/route_client-reference-manifest.js +1 -1
  137. package/.next/server/app/api/tasks/[taskId]/cancel/route.js +2 -2
  138. package/.next/server/app/api/tasks/[taskId]/cancel/route.js.nft.json +1 -1
  139. package/.next/server/app/api/tasks/[taskId]/cancel/route_client-reference-manifest.js +1 -1
  140. package/.next/server/app/api/tasks/[taskId]/route.js +2 -2
  141. package/.next/server/app/api/tasks/[taskId]/route.js.nft.json +1 -1
  142. package/.next/server/app/api/tasks/[taskId]/route_client-reference-manifest.js +1 -1
  143. package/.next/server/app/api/templates/[id]/route.js +2 -2
  144. package/.next/server/app/api/templates/[id]/route.js.nft.json +1 -1
  145. package/.next/server/app/api/templates/[id]/route_client-reference-manifest.js +1 -1
  146. package/.next/server/app/api/templates/route.js +2 -2
  147. package/.next/server/app/api/templates/route.js.nft.json +1 -1
  148. package/.next/server/app/api/templates/route_client-reference-manifest.js +1 -1
  149. package/.next/server/app/api/todos/route.js +1 -1
  150. package/.next/server/app/api/todos/route.js.nft.json +1 -1
  151. package/.next/server/app/api/todos/route_client-reference-manifest.js +1 -1
  152. package/.next/server/app/api/verification/runs/[runId]/route.js +1 -1
  153. package/.next/server/app/api/verification/runs/[runId]/route.js.nft.json +1 -1
  154. package/.next/server/app/api/verification/runs/[runId]/route_client-reference-manifest.js +1 -1
  155. package/.next/server/app/api/verification/runs/route.js +1 -1
  156. package/.next/server/app/api/verification/runs/route.js.nft.json +1 -1
  157. package/.next/server/app/api/verification/runs/route_client-reference-manifest.js +1 -1
  158. package/.next/server/app/api/worktrees/[id]/auto-yes/route.js +1 -1
  159. package/.next/server/app/api/worktrees/[id]/auto-yes/route.js.nft.json +1 -1
  160. package/.next/server/app/api/worktrees/[id]/auto-yes/route_client-reference-manifest.js +1 -1
  161. package/.next/server/app/api/worktrees/[id]/capture/route.js +1 -1
  162. package/.next/server/app/api/worktrees/[id]/capture/route.js.nft.json +1 -1
  163. package/.next/server/app/api/worktrees/[id]/capture/route_client-reference-manifest.js +1 -1
  164. package/.next/server/app/api/worktrees/[id]/cli-tool/route.js +1 -1
  165. package/.next/server/app/api/worktrees/[id]/cli-tool/route.js.nft.json +1 -1
  166. package/.next/server/app/api/worktrees/[id]/cli-tool/route_client-reference-manifest.js +1 -1
  167. package/.next/server/app/api/worktrees/[id]/cmate/schedules/route.js +2 -2
  168. package/.next/server/app/api/worktrees/[id]/cmate/schedules/route.js.nft.json +1 -1
  169. package/.next/server/app/api/worktrees/[id]/cmate/schedules/route_client-reference-manifest.js +1 -1
  170. package/.next/server/app/api/worktrees/[id]/current-output/route.js +1 -1
  171. package/.next/server/app/api/worktrees/[id]/current-output/route.js.nft.json +1 -1
  172. package/.next/server/app/api/worktrees/[id]/current-output/route_client-reference-manifest.js +1 -1
  173. package/.next/server/app/api/worktrees/[id]/execution-logs/[logId]/route.js +1 -1
  174. package/.next/server/app/api/worktrees/[id]/execution-logs/[logId]/route.js.nft.json +1 -1
  175. package/.next/server/app/api/worktrees/[id]/execution-logs/[logId]/route_client-reference-manifest.js +1 -1
  176. package/.next/server/app/api/worktrees/[id]/execution-logs/route.js +2 -2
  177. package/.next/server/app/api/worktrees/[id]/execution-logs/route.js.nft.json +1 -1
  178. package/.next/server/app/api/worktrees/[id]/execution-logs/route_client-reference-manifest.js +1 -1
  179. package/.next/server/app/api/worktrees/[id]/files/[...path]/route.js +1 -1
  180. package/.next/server/app/api/worktrees/[id]/files/[...path]/route.js.nft.json +1 -1
  181. package/.next/server/app/api/worktrees/[id]/files/[...path]/route_client-reference-manifest.js +1 -1
  182. package/.next/server/app/api/worktrees/[id]/git/branch/create/route.js +1 -1
  183. package/.next/server/app/api/worktrees/[id]/git/branch/create/route.js.nft.json +1 -1
  184. package/.next/server/app/api/worktrees/[id]/git/branch/create/route_client-reference-manifest.js +1 -1
  185. package/.next/server/app/api/worktrees/[id]/git/branch/delete/route.js +1 -1
  186. package/.next/server/app/api/worktrees/[id]/git/branch/delete/route.js.nft.json +1 -1
  187. package/.next/server/app/api/worktrees/[id]/git/branch/delete/route_client-reference-manifest.js +1 -1
  188. package/.next/server/app/api/worktrees/[id]/git/branches/route.js +1 -1
  189. package/.next/server/app/api/worktrees/[id]/git/branches/route.js.nft.json +1 -1
  190. package/.next/server/app/api/worktrees/[id]/git/branches/route_client-reference-manifest.js +1 -1
  191. package/.next/server/app/api/worktrees/[id]/git/checkout/route.js +1 -1
  192. package/.next/server/app/api/worktrees/[id]/git/checkout/route.js.nft.json +1 -1
  193. package/.next/server/app/api/worktrees/[id]/git/checkout/route_client-reference-manifest.js +1 -1
  194. package/.next/server/app/api/worktrees/[id]/git/commit/route.js +1 -1
  195. package/.next/server/app/api/worktrees/[id]/git/commit/route.js.nft.json +1 -1
  196. package/.next/server/app/api/worktrees/[id]/git/commit/route_client-reference-manifest.js +1 -1
  197. package/.next/server/app/api/worktrees/[id]/git/diff/route.js +1 -1
  198. package/.next/server/app/api/worktrees/[id]/git/diff/route.js.nft.json +1 -1
  199. package/.next/server/app/api/worktrees/[id]/git/diff/route_client-reference-manifest.js +1 -1
  200. package/.next/server/app/api/worktrees/[id]/git/fetch/route.js +1 -1
  201. package/.next/server/app/api/worktrees/[id]/git/fetch/route.js.nft.json +1 -1
  202. package/.next/server/app/api/worktrees/[id]/git/fetch/route_client-reference-manifest.js +1 -1
  203. package/.next/server/app/api/worktrees/[id]/git/log/route.js +1 -1
  204. package/.next/server/app/api/worktrees/[id]/git/log/route.js.nft.json +1 -1
  205. package/.next/server/app/api/worktrees/[id]/git/log/route_client-reference-manifest.js +1 -1
  206. package/.next/server/app/api/worktrees/[id]/git/pull/route.js +1 -1
  207. package/.next/server/app/api/worktrees/[id]/git/pull/route.js.nft.json +1 -1
  208. package/.next/server/app/api/worktrees/[id]/git/pull/route_client-reference-manifest.js +1 -1
  209. package/.next/server/app/api/worktrees/[id]/git/push/route.js +1 -1
  210. package/.next/server/app/api/worktrees/[id]/git/push/route.js.nft.json +1 -1
  211. package/.next/server/app/api/worktrees/[id]/git/push/route_client-reference-manifest.js +1 -1
  212. package/.next/server/app/api/worktrees/[id]/git/reset/route.js +1 -1
  213. package/.next/server/app/api/worktrees/[id]/git/reset/route.js.nft.json +1 -1
  214. package/.next/server/app/api/worktrees/[id]/git/reset/route_client-reference-manifest.js +1 -1
  215. package/.next/server/app/api/worktrees/[id]/git/revert/route.js +1 -1
  216. package/.next/server/app/api/worktrees/[id]/git/revert/route.js.nft.json +1 -1
  217. package/.next/server/app/api/worktrees/[id]/git/revert/route_client-reference-manifest.js +1 -1
  218. package/.next/server/app/api/worktrees/[id]/git/show/[commitHash]/route.js +1 -1
  219. package/.next/server/app/api/worktrees/[id]/git/show/[commitHash]/route.js.nft.json +1 -1
  220. package/.next/server/app/api/worktrees/[id]/git/show/[commitHash]/route_client-reference-manifest.js +1 -1
  221. package/.next/server/app/api/worktrees/[id]/git/stage/route.js +1 -1
  222. package/.next/server/app/api/worktrees/[id]/git/stage/route.js.nft.json +1 -1
  223. package/.next/server/app/api/worktrees/[id]/git/stage/route_client-reference-manifest.js +1 -1
  224. package/.next/server/app/api/worktrees/[id]/git/staged/route.js +1 -1
  225. package/.next/server/app/api/worktrees/[id]/git/staged/route.js.nft.json +1 -1
  226. package/.next/server/app/api/worktrees/[id]/git/staged/route_client-reference-manifest.js +1 -1
  227. package/.next/server/app/api/worktrees/[id]/git/stash/[index]/route.js +1 -1
  228. package/.next/server/app/api/worktrees/[id]/git/stash/[index]/route.js.nft.json +1 -1
  229. package/.next/server/app/api/worktrees/[id]/git/stash/[index]/route_client-reference-manifest.js +1 -1
  230. package/.next/server/app/api/worktrees/[id]/git/stash/apply/route.js +1 -1
  231. package/.next/server/app/api/worktrees/[id]/git/stash/apply/route.js.nft.json +1 -1
  232. package/.next/server/app/api/worktrees/[id]/git/stash/apply/route_client-reference-manifest.js +1 -1
  233. package/.next/server/app/api/worktrees/[id]/git/stash/pop/route.js +1 -1
  234. package/.next/server/app/api/worktrees/[id]/git/stash/pop/route.js.nft.json +1 -1
  235. package/.next/server/app/api/worktrees/[id]/git/stash/pop/route_client-reference-manifest.js +1 -1
  236. package/.next/server/app/api/worktrees/[id]/git/stash/push/route.js +1 -1
  237. package/.next/server/app/api/worktrees/[id]/git/stash/push/route.js.nft.json +1 -1
  238. package/.next/server/app/api/worktrees/[id]/git/stash/push/route_client-reference-manifest.js +1 -1
  239. package/.next/server/app/api/worktrees/[id]/git/stash/route.js +1 -1
  240. package/.next/server/app/api/worktrees/[id]/git/stash/route.js.nft.json +1 -1
  241. package/.next/server/app/api/worktrees/[id]/git/stash/route_client-reference-manifest.js +1 -1
  242. package/.next/server/app/api/worktrees/[id]/git/status/route.js +1 -1
  243. package/.next/server/app/api/worktrees/[id]/git/status/route.js.nft.json +1 -1
  244. package/.next/server/app/api/worktrees/[id]/git/status/route_client-reference-manifest.js +1 -1
  245. package/.next/server/app/api/worktrees/[id]/git/unstage/route.js +1 -1
  246. package/.next/server/app/api/worktrees/[id]/git/unstage/route.js.nft.json +1 -1
  247. package/.next/server/app/api/worktrees/[id]/git/unstage/route_client-reference-manifest.js +1 -1
  248. package/.next/server/app/api/worktrees/[id]/git/working-diff/route.js +1 -1
  249. package/.next/server/app/api/worktrees/[id]/git/working-diff/route.js.nft.json +1 -1
  250. package/.next/server/app/api/worktrees/[id]/git/working-diff/route_client-reference-manifest.js +1 -1
  251. package/.next/server/app/api/worktrees/[id]/interrupt/route.js +1 -1
  252. package/.next/server/app/api/worktrees/[id]/interrupt/route.js.nft.json +1 -1
  253. package/.next/server/app/api/worktrees/[id]/interrupt/route_client-reference-manifest.js +1 -1
  254. package/.next/server/app/api/worktrees/[id]/kill-session/route.js +1 -1
  255. package/.next/server/app/api/worktrees/[id]/kill-session/route.js.nft.json +1 -1
  256. package/.next/server/app/api/worktrees/[id]/kill-session/route_client-reference-manifest.js +1 -1
  257. package/.next/server/app/api/worktrees/[id]/logs/[filename]/route.js +1 -1
  258. package/.next/server/app/api/worktrees/[id]/logs/[filename]/route.js.nft.json +1 -1
  259. package/.next/server/app/api/worktrees/[id]/logs/[filename]/route_client-reference-manifest.js +1 -1
  260. package/.next/server/app/api/worktrees/[id]/logs/route.js +2 -2
  261. package/.next/server/app/api/worktrees/[id]/logs/route.js.nft.json +1 -1
  262. package/.next/server/app/api/worktrees/[id]/logs/route_client-reference-manifest.js +1 -1
  263. package/.next/server/app/api/worktrees/[id]/marp-render/route.js +6 -6
  264. package/.next/server/app/api/worktrees/[id]/marp-render/route.js.nft.json +1 -1
  265. package/.next/server/app/api/worktrees/[id]/marp-render/route_client-reference-manifest.js +1 -1
  266. package/.next/server/app/api/worktrees/[id]/memos/[memoId]/route.js +1 -1
  267. package/.next/server/app/api/worktrees/[id]/memos/[memoId]/route.js.nft.json +1 -1
  268. package/.next/server/app/api/worktrees/[id]/memos/[memoId]/route_client-reference-manifest.js +1 -1
  269. package/.next/server/app/api/worktrees/[id]/memos/route.js +1 -1
  270. package/.next/server/app/api/worktrees/[id]/memos/route.js.nft.json +1 -1
  271. package/.next/server/app/api/worktrees/[id]/memos/route_client-reference-manifest.js +1 -1
  272. package/.next/server/app/api/worktrees/[id]/messages/route.js +1 -1
  273. package/.next/server/app/api/worktrees/[id]/messages/route.js.nft.json +1 -1
  274. package/.next/server/app/api/worktrees/[id]/messages/route_client-reference-manifest.js +1 -1
  275. package/.next/server/app/api/worktrees/[id]/prompt-response/route.js +1 -1
  276. package/.next/server/app/api/worktrees/[id]/prompt-response/route.js.nft.json +1 -1
  277. package/.next/server/app/api/worktrees/[id]/prompt-response/route_client-reference-manifest.js +1 -1
  278. package/.next/server/app/api/worktrees/[id]/respond/route.js +1 -1
  279. package/.next/server/app/api/worktrees/[id]/respond/route.js.nft.json +1 -1
  280. package/.next/server/app/api/worktrees/[id]/respond/route_client-reference-manifest.js +1 -1
  281. package/.next/server/app/api/worktrees/[id]/route.js +1 -1
  282. package/.next/server/app/api/worktrees/[id]/route.js.nft.json +1 -1
  283. package/.next/server/app/api/worktrees/[id]/route_client-reference-manifest.js +1 -1
  284. package/.next/server/app/api/worktrees/[id]/schedules/[scheduleId]/route.js +2 -2
  285. package/.next/server/app/api/worktrees/[id]/schedules/[scheduleId]/route.js.nft.json +1 -1
  286. package/.next/server/app/api/worktrees/[id]/schedules/[scheduleId]/route_client-reference-manifest.js +1 -1
  287. package/.next/server/app/api/worktrees/[id]/schedules/active/route.js +1 -1
  288. package/.next/server/app/api/worktrees/[id]/schedules/active/route.js.nft.json +1 -1
  289. package/.next/server/app/api/worktrees/[id]/schedules/active/route_client-reference-manifest.js +1 -1
  290. package/.next/server/app/api/worktrees/[id]/schedules/route.js +3 -3
  291. package/.next/server/app/api/worktrees/[id]/schedules/route.js.nft.json +1 -1
  292. package/.next/server/app/api/worktrees/[id]/schedules/route_client-reference-manifest.js +1 -1
  293. package/.next/server/app/api/worktrees/[id]/search/route.js +1 -1
  294. package/.next/server/app/api/worktrees/[id]/search/route.js.nft.json +1 -1
  295. package/.next/server/app/api/worktrees/[id]/search/route_client-reference-manifest.js +1 -1
  296. package/.next/server/app/api/worktrees/[id]/send/route.js +1 -1
  297. package/.next/server/app/api/worktrees/[id]/send/route.js.nft.json +1 -1
  298. package/.next/server/app/api/worktrees/[id]/send/route_client-reference-manifest.js +1 -1
  299. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route.js +1 -1
  300. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route.js.nft.json +1 -1
  301. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route_client-reference-manifest.js +1 -1
  302. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/install/route.js +1 -1
  303. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/install/route.js.nft.json +1 -1
  304. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/install/route_client-reference-manifest.js +1 -1
  305. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/plan/route.js +1 -1
  306. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/plan/route.js.nft.json +1 -1
  307. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/plan/route_client-reference-manifest.js +1 -1
  308. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall/route.js +1 -1
  309. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall/route.js.nft.json +1 -1
  310. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall/route_client-reference-manifest.js +1 -1
  311. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall-plan/route.js +1 -1
  312. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall-plan/route.js.nft.json +1 -1
  313. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall-plan/route_client-reference-manifest.js +1 -1
  314. package/.next/server/app/api/worktrees/[id]/skills/route.js +2 -2
  315. package/.next/server/app/api/worktrees/[id]/skills/route.js.nft.json +1 -1
  316. package/.next/server/app/api/worktrees/[id]/skills/route_client-reference-manifest.js +1 -1
  317. package/.next/server/app/api/worktrees/[id]/slash-commands/route.js +1 -1
  318. package/.next/server/app/api/worktrees/[id]/slash-commands/route.js.nft.json +1 -1
  319. package/.next/server/app/api/worktrees/[id]/slash-commands/route_client-reference-manifest.js +1 -1
  320. package/.next/server/app/api/worktrees/[id]/special-keys/route.js +1 -1
  321. package/.next/server/app/api/worktrees/[id]/special-keys/route.js.nft.json +1 -1
  322. package/.next/server/app/api/worktrees/[id]/special-keys/route_client-reference-manifest.js +1 -1
  323. package/.next/server/app/api/worktrees/[id]/start-polling/route.js +1 -1
  324. package/.next/server/app/api/worktrees/[id]/start-polling/route.js.nft.json +1 -1
  325. package/.next/server/app/api/worktrees/[id]/start-polling/route_client-reference-manifest.js +1 -1
  326. package/.next/server/app/api/worktrees/[id]/tasks/route.js +4 -4
  327. package/.next/server/app/api/worktrees/[id]/tasks/route.js.nft.json +1 -1
  328. package/.next/server/app/api/worktrees/[id]/tasks/route_client-reference-manifest.js +1 -1
  329. package/.next/server/app/api/worktrees/[id]/terminal/route.js +1 -1
  330. package/.next/server/app/api/worktrees/[id]/terminal/route.js.nft.json +1 -1
  331. package/.next/server/app/api/worktrees/[id]/terminal/route_client-reference-manifest.js +1 -1
  332. package/.next/server/app/api/worktrees/[id]/timers/history/route.js +1 -1
  333. package/.next/server/app/api/worktrees/[id]/timers/history/route.js.nft.json +1 -1
  334. package/.next/server/app/api/worktrees/[id]/timers/history/route_client-reference-manifest.js +1 -1
  335. package/.next/server/app/api/worktrees/[id]/timers/route.js +1 -1
  336. package/.next/server/app/api/worktrees/[id]/timers/route.js.nft.json +1 -1
  337. package/.next/server/app/api/worktrees/[id]/timers/route_client-reference-manifest.js +1 -1
  338. package/.next/server/app/api/worktrees/[id]/todos/[todoId]/route.js +1 -1
  339. package/.next/server/app/api/worktrees/[id]/todos/[todoId]/route.js.nft.json +1 -1
  340. package/.next/server/app/api/worktrees/[id]/todos/[todoId]/route_client-reference-manifest.js +1 -1
  341. package/.next/server/app/api/worktrees/[id]/todos/route.js +1 -1
  342. package/.next/server/app/api/worktrees/[id]/todos/route.js.nft.json +1 -1
  343. package/.next/server/app/api/worktrees/[id]/todos/route_client-reference-manifest.js +1 -1
  344. package/.next/server/app/api/worktrees/[id]/tree/[...path]/route.js +1 -1
  345. package/.next/server/app/api/worktrees/[id]/tree/[...path]/route.js.nft.json +1 -1
  346. package/.next/server/app/api/worktrees/[id]/tree/[...path]/route_client-reference-manifest.js +1 -1
  347. package/.next/server/app/api/worktrees/[id]/tree/route.js +1 -1
  348. package/.next/server/app/api/worktrees/[id]/tree/route.js.nft.json +1 -1
  349. package/.next/server/app/api/worktrees/[id]/tree/route_client-reference-manifest.js +1 -1
  350. package/.next/server/app/api/worktrees/[id]/upload/[...path]/route.js +1 -1
  351. package/.next/server/app/api/worktrees/[id]/upload/[...path]/route.js.nft.json +1 -1
  352. package/.next/server/app/api/worktrees/[id]/upload/[...path]/route_client-reference-manifest.js +1 -1
  353. package/.next/server/app/api/worktrees/[id]/verify/route.js +2 -2
  354. package/.next/server/app/api/worktrees/[id]/verify/route.js.nft.json +1 -1
  355. package/.next/server/app/api/worktrees/[id]/verify/route_client-reference-manifest.js +1 -1
  356. package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/route.js +1 -1
  357. package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/route.js.nft.json +1 -1
  358. package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/route_client-reference-manifest.js +1 -1
  359. package/.next/server/app/api/worktrees/[id]/verify/runs/route.js +1 -1
  360. package/.next/server/app/api/worktrees/[id]/verify/runs/route.js.nft.json +1 -1
  361. package/.next/server/app/api/worktrees/[id]/verify/runs/route_client-reference-manifest.js +1 -1
  362. package/.next/server/app/api/worktrees/[id]/viewed/route.js +1 -1
  363. package/.next/server/app/api/worktrees/[id]/viewed/route.js.nft.json +1 -1
  364. package/.next/server/app/api/worktrees/[id]/viewed/route_client-reference-manifest.js +1 -1
  365. package/.next/server/app/api/worktrees/route.js +1 -1
  366. package/.next/server/app/api/worktrees/route.js.nft.json +1 -1
  367. package/.next/server/app/api/worktrees/route_client-reference-manifest.js +1 -1
  368. package/.next/server/app/apple-icon.png/route.js +1 -1
  369. package/.next/server/app/apple-icon.png/route.js.nft.json +1 -1
  370. package/.next/server/app/chat/page_client-reference-manifest.js +1 -1
  371. package/.next/server/app/icon.png/route.js +1 -1
  372. package/.next/server/app/icon.png/route.js.nft.json +1 -1
  373. package/.next/server/app/icon1.png/route.js +1 -1
  374. package/.next/server/app/icon1.png/route.js.nft.json +1 -1
  375. package/.next/server/app/icon2.png/route.js +1 -1
  376. package/.next/server/app/icon2.png/route.js.nft.json +1 -1
  377. package/.next/server/app/login/page_client-reference-manifest.js +1 -1
  378. package/.next/server/app/manifest.webmanifest/route.js +2 -2
  379. package/.next/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  380. package/.next/server/app/manifest.webmanifest/route_client-reference-manifest.js +1 -1
  381. package/.next/server/app/more/page_client-reference-manifest.js +1 -1
  382. package/.next/server/app/offline/page_client-reference-manifest.js +1 -1
  383. package/.next/server/app/page_client-reference-manifest.js +1 -1
  384. package/.next/server/app/proxy/[...path]/route.js +1 -1
  385. package/.next/server/app/proxy/[...path]/route.js.nft.json +1 -1
  386. package/.next/server/app/proxy/[...path]/route_client-reference-manifest.js +1 -1
  387. package/.next/server/app/repositories/page.js +1 -1
  388. package/.next/server/app/repositories/page_client-reference-manifest.js +1 -1
  389. package/.next/server/app/review/page_client-reference-manifest.js +1 -1
  390. package/.next/server/app/sessions/page_client-reference-manifest.js +1 -1
  391. package/.next/server/app/skills/[skillId]/page_client-reference-manifest.js +1 -1
  392. package/.next/server/app/skills/installed/page_client-reference-manifest.js +1 -1
  393. package/.next/server/app/skills/page_client-reference-manifest.js +1 -1
  394. package/.next/server/app/worktrees/[id]/files/[...path]/page.js +2 -2
  395. package/.next/server/app/worktrees/[id]/files/[...path]/page.js.nft.json +1 -1
  396. package/.next/server/app/worktrees/[id]/files/[...path]/page_client-reference-manifest.js +1 -1
  397. package/.next/server/app/worktrees/[id]/page.js +8 -8
  398. package/.next/server/app/worktrees/[id]/page.js.nft.json +1 -1
  399. package/.next/server/app/worktrees/[id]/page_client-reference-manifest.js +1 -1
  400. package/.next/server/app/worktrees/[id]/terminal/page.js +3 -3
  401. package/.next/server/app/worktrees/[id]/terminal/page.js.nft.json +1 -1
  402. package/.next/server/app/worktrees/[id]/terminal/page_client-reference-manifest.js +1 -1
  403. package/.next/server/app-paths-manifest.json +32 -32
  404. package/.next/server/chunks/1029.js +1 -0
  405. package/.next/server/chunks/1068.js +1 -1
  406. package/.next/server/chunks/1598.js +4 -0
  407. package/.next/server/chunks/3042.js +1 -1
  408. package/.next/server/chunks/3417.js +1 -0
  409. package/.next/server/chunks/3451.js +1 -1
  410. package/.next/server/chunks/3543.js +1 -1
  411. package/.next/server/chunks/3753.js +23 -23
  412. package/.next/server/chunks/3945.js +1 -1
  413. package/.next/server/chunks/406.js +5 -5
  414. package/.next/server/chunks/{1185.js → 5048.js} +1 -1
  415. package/.next/server/chunks/5959.js +3 -3
  416. package/.next/server/chunks/{5381.js → 5998.js} +2 -2
  417. package/.next/server/chunks/6130.js +1 -1
  418. package/.next/server/chunks/6274.js +6 -5
  419. package/.next/server/chunks/6283.js +1 -1
  420. package/.next/server/chunks/6401.js +1 -0
  421. package/.next/server/chunks/641.js +1 -0
  422. package/.next/server/chunks/8536.js +1 -0
  423. package/.next/server/chunks/8543.js +1 -0
  424. package/.next/server/chunks/8807.js +397 -378
  425. package/.next/server/chunks/8856.js +2 -2
  426. package/.next/server/chunks/9058.js +1 -0
  427. package/.next/server/chunks/9067.js +1 -0
  428. package/.next/server/chunks/9123.js +1 -1
  429. package/.next/server/middleware-manifest.json +5 -5
  430. package/.next/server/pages/500.html +1 -1
  431. package/.next/server/server-reference-manifest.json +1 -1
  432. package/.next/server/src/middleware.js +1 -1
  433. package/.next/server/src/middleware.js.map +1 -1
  434. package/.next/static/chunks/{6488-109e3825c7249e47.js → 6488-3e7539550c3ef358.js} +1 -1
  435. package/.next/static/chunks/744-fa8c0ae444c8338c.js +1 -0
  436. package/.next/static/chunks/app/api/app/update/route-5bdd550ed6386f57.js +1 -0
  437. package/.next/static/chunks/app/api/app/update-check/route-5bdd550ed6386f57.js +1 -0
  438. package/.next/static/chunks/app/api/assistant/conversation/route-5bdd550ed6386f57.js +1 -0
  439. package/.next/static/chunks/app/api/assistant/current-output/route-5bdd550ed6386f57.js +1 -0
  440. package/.next/static/chunks/app/api/assistant/messages/route-5bdd550ed6386f57.js +1 -0
  441. package/.next/static/chunks/app/api/assistant/session/route-5bdd550ed6386f57.js +1 -0
  442. package/.next/static/chunks/app/api/assistant/start/route-5bdd550ed6386f57.js +1 -0
  443. package/.next/static/chunks/app/api/assistant/terminal/route-5bdd550ed6386f57.js +1 -0
  444. package/.next/static/chunks/app/api/assistant/tools/route-5bdd550ed6386f57.js +1 -0
  445. package/.next/static/chunks/app/api/auth/login/route-5bdd550ed6386f57.js +1 -0
  446. package/.next/static/chunks/app/api/auth/logout/route-5bdd550ed6386f57.js +1 -0
  447. package/.next/static/chunks/app/api/auth/status/route-5bdd550ed6386f57.js +1 -0
  448. package/.next/static/chunks/app/api/daily-summary/route-5bdd550ed6386f57.js +1 -0
  449. package/.next/static/chunks/app/api/daily-summary/status/route-5bdd550ed6386f57.js +1 -0
  450. package/.next/static/chunks/app/api/external-apps/[id]/health/route-5bdd550ed6386f57.js +1 -0
  451. package/.next/static/chunks/app/api/external-apps/[id]/route-5bdd550ed6386f57.js +1 -0
  452. package/.next/static/chunks/app/api/external-apps/route-5bdd550ed6386f57.js +1 -0
  453. package/.next/static/chunks/app/api/fs/browse/route-5bdd550ed6386f57.js +1 -0
  454. package/.next/static/chunks/app/api/fs/recent-paths/route-5bdd550ed6386f57.js +1 -0
  455. package/.next/static/chunks/app/api/hooks/agent-event/route-5bdd550ed6386f57.js +1 -0
  456. package/.next/static/chunks/app/api/hooks/claude-done/route-5bdd550ed6386f57.js +1 -0
  457. package/.next/static/chunks/app/api/metrics/vibe/route-5bdd550ed6386f57.js +1 -0
  458. package/.next/static/chunks/app/api/ollama/models/route-5bdd550ed6386f57.js +1 -0
  459. package/.next/static/chunks/app/api/push/subscriptions/route-5bdd550ed6386f57.js +1 -0
  460. package/.next/static/chunks/app/api/push/vapid/route-5bdd550ed6386f57.js +1 -0
  461. package/.next/static/chunks/app/api/repositories/[id]/route-5bdd550ed6386f57.js +1 -0
  462. package/.next/static/chunks/app/api/repositories/[id]/todos/[todoId]/route-5bdd550ed6386f57.js +1 -0
  463. package/.next/static/chunks/app/api/repositories/[id]/todos/route-5bdd550ed6386f57.js +1 -0
  464. package/.next/static/chunks/app/api/repositories/clone/[jobId]/route-5bdd550ed6386f57.js +1 -0
  465. package/.next/static/chunks/app/api/repositories/clone/route-5bdd550ed6386f57.js +1 -0
  466. package/.next/static/chunks/app/api/repositories/excluded/route-5bdd550ed6386f57.js +1 -0
  467. package/.next/static/chunks/app/api/repositories/restore/route-5bdd550ed6386f57.js +1 -0
  468. package/.next/static/chunks/app/api/repositories/route-5bdd550ed6386f57.js +1 -0
  469. package/.next/static/chunks/app/api/repositories/scan/route-5bdd550ed6386f57.js +1 -0
  470. package/.next/static/chunks/app/api/repositories/sync/route-5bdd550ed6386f57.js +1 -0
  471. package/.next/static/chunks/app/api/repositories/validate-path/route-5bdd550ed6386f57.js +1 -0
  472. package/.next/static/chunks/app/api/sidebar/group-order/route-5bdd550ed6386f57.js +1 -0
  473. package/.next/static/chunks/app/api/skills/[id]/route-5bdd550ed6386f57.js +1 -0
  474. package/.next/static/chunks/app/api/skills/installations/route-5bdd550ed6386f57.js +1 -0
  475. package/.next/static/chunks/app/api/skills/operations/route-5bdd550ed6386f57.js +1 -0
  476. package/.next/static/chunks/app/api/skills/reindex/route-5bdd550ed6386f57.js +1 -0
  477. package/.next/static/chunks/app/api/skills/route-5bdd550ed6386f57.js +1 -0
  478. package/.next/static/chunks/app/api/slash-commands/route-5bdd550ed6386f57.js +1 -0
  479. package/.next/static/chunks/app/api/tasks/[taskId]/cancel/route-5bdd550ed6386f57.js +1 -0
  480. package/.next/static/chunks/app/api/tasks/[taskId]/route-5bdd550ed6386f57.js +1 -0
  481. package/.next/static/chunks/app/api/templates/[id]/route-5bdd550ed6386f57.js +1 -0
  482. package/.next/static/chunks/app/api/templates/route-5bdd550ed6386f57.js +1 -0
  483. package/.next/static/chunks/app/api/todos/route-5bdd550ed6386f57.js +1 -0
  484. package/.next/static/chunks/app/api/verification/runs/[runId]/route-5bdd550ed6386f57.js +1 -0
  485. package/.next/static/chunks/app/api/verification/runs/route-5bdd550ed6386f57.js +1 -0
  486. package/.next/static/chunks/app/api/worktrees/[id]/auto-yes/route-5bdd550ed6386f57.js +1 -0
  487. package/.next/static/chunks/app/api/worktrees/[id]/capture/route-5bdd550ed6386f57.js +1 -0
  488. package/.next/static/chunks/app/api/worktrees/[id]/cli-tool/route-5bdd550ed6386f57.js +1 -0
  489. package/.next/static/chunks/app/api/worktrees/[id]/cmate/schedules/route-5bdd550ed6386f57.js +1 -0
  490. package/.next/static/chunks/app/api/worktrees/[id]/current-output/route-5bdd550ed6386f57.js +1 -0
  491. package/.next/static/chunks/app/api/worktrees/[id]/execution-logs/[logId]/route-5bdd550ed6386f57.js +1 -0
  492. package/.next/static/chunks/app/api/worktrees/[id]/execution-logs/route-5bdd550ed6386f57.js +1 -0
  493. package/.next/static/chunks/app/api/worktrees/[id]/files/[...path]/route-5bdd550ed6386f57.js +1 -0
  494. package/.next/static/chunks/app/api/worktrees/[id]/git/branch/create/route-5bdd550ed6386f57.js +1 -0
  495. package/.next/static/chunks/app/api/worktrees/[id]/git/branch/delete/route-5bdd550ed6386f57.js +1 -0
  496. package/.next/static/chunks/app/api/worktrees/[id]/git/branches/route-5bdd550ed6386f57.js +1 -0
  497. package/.next/static/chunks/app/api/worktrees/[id]/git/checkout/route-5bdd550ed6386f57.js +1 -0
  498. package/.next/static/chunks/app/api/worktrees/[id]/git/commit/route-5bdd550ed6386f57.js +1 -0
  499. package/.next/static/chunks/app/api/worktrees/[id]/git/diff/route-5bdd550ed6386f57.js +1 -0
  500. package/.next/static/chunks/app/api/worktrees/[id]/git/fetch/route-5bdd550ed6386f57.js +1 -0
  501. package/.next/static/chunks/app/api/worktrees/[id]/git/log/route-5bdd550ed6386f57.js +1 -0
  502. package/.next/static/chunks/app/api/worktrees/[id]/git/pull/route-5bdd550ed6386f57.js +1 -0
  503. package/.next/static/chunks/app/api/worktrees/[id]/git/push/route-5bdd550ed6386f57.js +1 -0
  504. package/.next/static/chunks/app/api/worktrees/[id]/git/reset/route-5bdd550ed6386f57.js +1 -0
  505. package/.next/static/chunks/app/api/worktrees/[id]/git/revert/route-5bdd550ed6386f57.js +1 -0
  506. package/.next/static/chunks/app/api/worktrees/[id]/git/show/[commitHash]/route-5bdd550ed6386f57.js +1 -0
  507. package/.next/static/chunks/app/api/worktrees/[id]/git/stage/route-5bdd550ed6386f57.js +1 -0
  508. package/.next/static/chunks/app/api/worktrees/[id]/git/staged/route-5bdd550ed6386f57.js +1 -0
  509. package/.next/static/chunks/app/api/worktrees/[id]/git/stash/[index]/route-5bdd550ed6386f57.js +1 -0
  510. package/.next/static/chunks/app/api/worktrees/[id]/git/stash/apply/route-5bdd550ed6386f57.js +1 -0
  511. package/.next/static/chunks/app/api/worktrees/[id]/git/stash/pop/route-5bdd550ed6386f57.js +1 -0
  512. package/.next/static/chunks/app/api/worktrees/[id]/git/stash/push/route-5bdd550ed6386f57.js +1 -0
  513. package/.next/static/chunks/app/api/worktrees/[id]/git/stash/route-5bdd550ed6386f57.js +1 -0
  514. package/.next/static/chunks/app/api/worktrees/[id]/git/status/route-5bdd550ed6386f57.js +1 -0
  515. package/.next/static/chunks/app/api/worktrees/[id]/git/unstage/route-5bdd550ed6386f57.js +1 -0
  516. package/.next/static/chunks/app/api/worktrees/[id]/git/working-diff/route-5bdd550ed6386f57.js +1 -0
  517. package/.next/static/chunks/app/api/worktrees/[id]/interrupt/route-5bdd550ed6386f57.js +1 -0
  518. package/.next/static/chunks/app/api/worktrees/[id]/kill-session/route-5bdd550ed6386f57.js +1 -0
  519. package/.next/static/chunks/app/api/worktrees/[id]/logs/[filename]/route-5bdd550ed6386f57.js +1 -0
  520. package/.next/static/chunks/app/api/worktrees/[id]/logs/route-5bdd550ed6386f57.js +1 -0
  521. package/.next/static/chunks/app/api/worktrees/[id]/marp-render/route-5bdd550ed6386f57.js +1 -0
  522. package/.next/static/chunks/app/api/worktrees/[id]/memos/[memoId]/route-5bdd550ed6386f57.js +1 -0
  523. package/.next/static/chunks/app/api/worktrees/[id]/memos/route-5bdd550ed6386f57.js +1 -0
  524. package/.next/static/chunks/app/api/worktrees/[id]/messages/route-5bdd550ed6386f57.js +1 -0
  525. package/.next/static/chunks/app/api/worktrees/[id]/prompt-response/route-5bdd550ed6386f57.js +1 -0
  526. package/.next/static/chunks/app/api/worktrees/[id]/respond/route-5bdd550ed6386f57.js +1 -0
  527. package/.next/static/chunks/app/api/worktrees/[id]/route-5bdd550ed6386f57.js +1 -0
  528. package/.next/static/chunks/app/api/worktrees/[id]/schedules/[scheduleId]/route-5bdd550ed6386f57.js +1 -0
  529. package/.next/static/chunks/app/api/worktrees/[id]/schedules/active/route-5bdd550ed6386f57.js +1 -0
  530. package/.next/static/chunks/app/api/worktrees/[id]/schedules/route-5bdd550ed6386f57.js +1 -0
  531. package/.next/static/chunks/app/api/worktrees/[id]/search/route-5bdd550ed6386f57.js +1 -0
  532. package/.next/static/chunks/app/api/worktrees/[id]/send/route-5bdd550ed6386f57.js +1 -0
  533. package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route-5bdd550ed6386f57.js +1 -0
  534. package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/install/route-5bdd550ed6386f57.js +1 -0
  535. package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/plan/route-5bdd550ed6386f57.js +1 -0
  536. package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/uninstall/route-5bdd550ed6386f57.js +1 -0
  537. package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/uninstall-plan/route-5bdd550ed6386f57.js +1 -0
  538. package/.next/static/chunks/app/api/worktrees/[id]/skills/route-5bdd550ed6386f57.js +1 -0
  539. package/.next/static/chunks/app/api/worktrees/[id]/slash-commands/route-5bdd550ed6386f57.js +1 -0
  540. package/.next/static/chunks/app/api/worktrees/[id]/special-keys/route-5bdd550ed6386f57.js +1 -0
  541. package/.next/static/chunks/app/api/worktrees/[id]/start-polling/route-5bdd550ed6386f57.js +1 -0
  542. package/.next/static/chunks/app/api/worktrees/[id]/tasks/route-5bdd550ed6386f57.js +1 -0
  543. package/.next/static/chunks/app/api/worktrees/[id]/terminal/route-5bdd550ed6386f57.js +1 -0
  544. package/.next/static/chunks/app/api/worktrees/[id]/timers/history/route-5bdd550ed6386f57.js +1 -0
  545. package/.next/static/chunks/app/api/worktrees/[id]/timers/route-5bdd550ed6386f57.js +1 -0
  546. package/.next/static/chunks/app/api/worktrees/[id]/todos/[todoId]/route-5bdd550ed6386f57.js +1 -0
  547. package/.next/static/chunks/app/api/worktrees/[id]/todos/route-5bdd550ed6386f57.js +1 -0
  548. package/.next/static/chunks/app/api/worktrees/[id]/tree/[...path]/route-5bdd550ed6386f57.js +1 -0
  549. package/.next/static/chunks/app/api/worktrees/[id]/tree/route-5bdd550ed6386f57.js +1 -0
  550. package/.next/static/chunks/app/api/worktrees/[id]/upload/[...path]/route-5bdd550ed6386f57.js +1 -0
  551. package/.next/static/chunks/app/api/worktrees/[id]/verify/route-5bdd550ed6386f57.js +1 -0
  552. package/.next/static/chunks/app/api/worktrees/[id]/verify/runs/[runId]/route-5bdd550ed6386f57.js +1 -0
  553. package/.next/static/chunks/app/api/worktrees/[id]/verify/runs/route-5bdd550ed6386f57.js +1 -0
  554. package/.next/static/chunks/app/api/worktrees/[id]/viewed/route-5bdd550ed6386f57.js +1 -0
  555. package/.next/static/chunks/app/api/worktrees/route-5bdd550ed6386f57.js +1 -0
  556. package/.next/static/chunks/app/manifest.webmanifest/route-5bdd550ed6386f57.js +1 -0
  557. package/.next/static/chunks/app/proxy/[...path]/route-5bdd550ed6386f57.js +1 -0
  558. package/.next/static/chunks/app/repositories/page-202680fe6ec169c8.js +1 -0
  559. package/.next/static/chunks/app/worktrees/[id]/layout-5bdd550ed6386f57.js +1 -0
  560. package/.next/static/chunks/app/worktrees/[id]/page-214ee8b97dca856b.js +1 -0
  561. package/.next/trace +12 -12
  562. package/.next/types/routes.d.ts +2 -1
  563. package/.next/types/validator.ts +9 -0
  564. package/README.md +10 -1
  565. package/dist/cli/commands/auto-yes.d.ts.map +1 -1
  566. package/dist/cli/commands/auto-yes.js +12 -4
  567. package/dist/cli/commands/capture.d.ts +1 -0
  568. package/dist/cli/commands/capture.d.ts.map +1 -1
  569. package/dist/cli/commands/capture.js +115 -4
  570. package/dist/cli/commands/instances.d.ts +24 -0
  571. package/dist/cli/commands/instances.d.ts.map +1 -1
  572. package/dist/cli/commands/instances.js +44 -0
  573. package/dist/cli/commands/ls.d.ts.map +1 -1
  574. package/dist/cli/commands/ls.js +9 -3
  575. package/dist/cli/commands/respond.d.ts.map +1 -1
  576. package/dist/cli/commands/respond.js +13 -4
  577. package/dist/cli/commands/send.d.ts.map +1 -1
  578. package/dist/cli/commands/send.js +24 -14
  579. package/dist/cli/commands/update.d.ts.map +1 -1
  580. package/dist/cli/commands/update.js +66 -0
  581. package/dist/cli/commands/wait.d.ts +4 -1
  582. package/dist/cli/commands/wait.d.ts.map +1 -1
  583. package/dist/cli/commands/wait.js +82 -7
  584. package/dist/cli/config/agent-target-options.d.ts +46 -0
  585. package/dist/cli/config/agent-target-options.d.ts.map +1 -0
  586. package/dist/cli/config/agent-target-options.js +54 -0
  587. package/dist/cli/docs/agent-operations.d.ts +2 -2
  588. package/dist/cli/docs/agent-operations.d.ts.map +1 -1
  589. package/dist/cli/docs/agent-operations.js +47 -14
  590. package/dist/cli/types/index.d.ts +16 -0
  591. package/dist/cli/types/index.d.ts.map +1 -1
  592. package/dist/cli/utils/api-client.d.ts +4 -1
  593. package/dist/cli/utils/api-client.d.ts.map +1 -1
  594. package/dist/cli/utils/api-client.js +43 -5
  595. package/dist/cli/utils/npm-runner.d.ts +24 -0
  596. package/dist/cli/utils/npm-runner.d.ts.map +1 -1
  597. package/dist/cli/utils/npm-runner.js +51 -1
  598. package/dist/cli/utils/pager.d.ts +28 -0
  599. package/dist/cli/utils/pager.d.ts.map +1 -0
  600. package/dist/cli/utils/pager.js +57 -0
  601. package/dist/cli/utils/pid-manager.d.ts +12 -2
  602. package/dist/cli/utils/pid-manager.d.ts.map +1 -1
  603. package/dist/cli/utils/pid-manager.js +76 -13
  604. package/dist/lib/detection/ansi.d.ts +30 -0
  605. package/dist/lib/detection/ansi.d.ts.map +1 -0
  606. package/dist/lib/detection/ansi.js +39 -0
  607. package/dist/lib/tmux/transcript-squeeze.d.ts +76 -0
  608. package/dist/lib/tmux/transcript-squeeze.d.ts.map +1 -0
  609. package/dist/lib/tmux/transcript-squeeze.js +96 -0
  610. package/dist/server/server.js +125 -14
  611. package/dist/server/src/config/tmux-pane-config.js +33 -1
  612. package/dist/server/src/lib/auto-yes-state.js +64 -0
  613. package/dist/server/src/lib/cli-tools/antigravity.js +2 -1
  614. package/dist/server/src/lib/cli-tools/codex.js +3 -2
  615. package/dist/server/src/lib/cli-tools/copilot.js +2 -2
  616. package/dist/server/src/lib/cli-tools/gemini.js +2 -2
  617. package/dist/server/src/lib/cli-tools/opencode.js +2 -2
  618. package/dist/server/src/lib/cli-tools/vibe-local.js +2 -2
  619. package/dist/server/src/lib/db/agent-instances-db.js +53 -0
  620. package/dist/server/src/lib/db/db-repository.js +66 -2
  621. package/dist/server/src/lib/db/db.js +12 -3
  622. package/dist/server/src/lib/db/migrations/index.js +8 -0
  623. package/dist/server/src/lib/db/migrations/runner.js +1 -1
  624. package/dist/server/src/lib/db/migrations/v52-orphaned-worktree-children.js +76 -0
  625. package/dist/server/src/lib/db/migrations/v53-worktree-aliases.js +53 -0
  626. package/dist/server/src/lib/db/migrations/v54-worktree-id-path-derived.js +204 -0
  627. package/dist/server/src/lib/db/migrations/v55-compact-churned-worktree-ids.js +207 -0
  628. package/dist/server/src/lib/db/migrations/worktree-child-tables.js +119 -0
  629. package/dist/server/src/lib/db/migrations/worktree-id-rename.js +153 -0
  630. package/dist/server/src/lib/db/worktree-alias-db.js +155 -0
  631. package/dist/server/src/lib/db/worktree-db.js +82 -77
  632. package/dist/server/src/lib/detection/cli-patterns.js +109 -2
  633. package/dist/server/src/lib/detection/prompt-detect-multiple-choice.js +10 -1
  634. package/dist/server/src/lib/detection/status-detector.js +52 -2
  635. package/dist/server/src/lib/git/worktree-id.js +145 -0
  636. package/dist/server/src/lib/git/worktree-redirect.js +155 -0
  637. package/dist/server/src/lib/git/worktrees.js +173 -27
  638. package/dist/server/src/lib/logger.js +13 -1
  639. package/dist/server/src/lib/polling/auto-yes-manager.js +3 -1
  640. package/dist/server/src/lib/polling/prompt-dedup.js +22 -0
  641. package/dist/server/src/lib/polling/response-checker.js +53 -13
  642. package/dist/server/src/lib/polling/response-dedup.js +22 -0
  643. package/dist/server/src/lib/polling/response-poller-core.js +107 -0
  644. package/dist/server/src/lib/polling/response-poller.js +4 -1
  645. package/dist/server/src/lib/response-extractor.js +22 -2
  646. package/dist/server/src/lib/session/claude-session.js +121 -37
  647. package/dist/server/src/lib/session/current-output-builder.js +14 -1
  648. package/dist/server/src/lib/session/session-start-error.js +125 -0
  649. package/dist/server/src/lib/session/worktree-session-reconcile.js +603 -0
  650. package/dist/server/src/lib/tasks/contract-parser.js +17 -1
  651. package/dist/server/src/lib/tasks/task-state-machine.js +23 -1
  652. package/dist/server/src/lib/tmux/control-mode-tmux-transport.js +7 -0
  653. package/dist/server/src/lib/tmux/read-mode-pager.js +161 -0
  654. package/dist/server/src/lib/tmux/read-mode.js +347 -0
  655. package/dist/server/src/lib/tmux/tmux-capture-cache.js +33 -0
  656. package/dist/server/src/lib/tmux/tmux-control-client.js +12 -0
  657. package/dist/server/src/lib/tmux/tmux-control-registry.js +55 -11
  658. package/dist/server/src/lib/tmux/tmux.js +104 -5
  659. package/dist/server/src/lib/ws-server.js +104 -1
  660. package/package.json +1 -1
  661. package/.next/server/chunks/1117.js +0 -1
  662. package/.next/server/chunks/1356.js +0 -4
  663. package/.next/server/chunks/1692.js +0 -1
  664. package/.next/server/chunks/4018.js +0 -1
  665. package/.next/server/chunks/4390.js +0 -1
  666. package/.next/server/chunks/8681.js +0 -1
  667. package/.next/static/chunks/744-d5e47fe16e7b9e06.js +0 -1
  668. package/.next/static/chunks/app/api/app/update/route-8440b6c72bed83a1.js +0 -1
  669. package/.next/static/chunks/app/api/app/update-check/route-8440b6c72bed83a1.js +0 -1
  670. package/.next/static/chunks/app/api/assistant/conversation/route-8440b6c72bed83a1.js +0 -1
  671. package/.next/static/chunks/app/api/assistant/current-output/route-8440b6c72bed83a1.js +0 -1
  672. package/.next/static/chunks/app/api/assistant/messages/route-8440b6c72bed83a1.js +0 -1
  673. package/.next/static/chunks/app/api/assistant/session/route-8440b6c72bed83a1.js +0 -1
  674. package/.next/static/chunks/app/api/assistant/start/route-8440b6c72bed83a1.js +0 -1
  675. package/.next/static/chunks/app/api/assistant/terminal/route-8440b6c72bed83a1.js +0 -1
  676. package/.next/static/chunks/app/api/assistant/tools/route-8440b6c72bed83a1.js +0 -1
  677. package/.next/static/chunks/app/api/auth/login/route-8440b6c72bed83a1.js +0 -1
  678. package/.next/static/chunks/app/api/auth/logout/route-8440b6c72bed83a1.js +0 -1
  679. package/.next/static/chunks/app/api/auth/status/route-8440b6c72bed83a1.js +0 -1
  680. package/.next/static/chunks/app/api/daily-summary/route-8440b6c72bed83a1.js +0 -1
  681. package/.next/static/chunks/app/api/daily-summary/status/route-8440b6c72bed83a1.js +0 -1
  682. package/.next/static/chunks/app/api/external-apps/[id]/health/route-8440b6c72bed83a1.js +0 -1
  683. package/.next/static/chunks/app/api/external-apps/[id]/route-8440b6c72bed83a1.js +0 -1
  684. package/.next/static/chunks/app/api/external-apps/route-8440b6c72bed83a1.js +0 -1
  685. package/.next/static/chunks/app/api/fs/browse/route-8440b6c72bed83a1.js +0 -1
  686. package/.next/static/chunks/app/api/fs/recent-paths/route-8440b6c72bed83a1.js +0 -1
  687. package/.next/static/chunks/app/api/hooks/agent-event/route-8440b6c72bed83a1.js +0 -1
  688. package/.next/static/chunks/app/api/hooks/claude-done/route-8440b6c72bed83a1.js +0 -1
  689. package/.next/static/chunks/app/api/metrics/vibe/route-8440b6c72bed83a1.js +0 -1
  690. package/.next/static/chunks/app/api/ollama/models/route-8440b6c72bed83a1.js +0 -1
  691. package/.next/static/chunks/app/api/push/subscriptions/route-8440b6c72bed83a1.js +0 -1
  692. package/.next/static/chunks/app/api/push/vapid/route-8440b6c72bed83a1.js +0 -1
  693. package/.next/static/chunks/app/api/repositories/[id]/route-8440b6c72bed83a1.js +0 -1
  694. package/.next/static/chunks/app/api/repositories/[id]/todos/[todoId]/route-8440b6c72bed83a1.js +0 -1
  695. package/.next/static/chunks/app/api/repositories/[id]/todos/route-8440b6c72bed83a1.js +0 -1
  696. package/.next/static/chunks/app/api/repositories/clone/[jobId]/route-8440b6c72bed83a1.js +0 -1
  697. package/.next/static/chunks/app/api/repositories/clone/route-8440b6c72bed83a1.js +0 -1
  698. package/.next/static/chunks/app/api/repositories/excluded/route-8440b6c72bed83a1.js +0 -1
  699. package/.next/static/chunks/app/api/repositories/restore/route-8440b6c72bed83a1.js +0 -1
  700. package/.next/static/chunks/app/api/repositories/route-8440b6c72bed83a1.js +0 -1
  701. package/.next/static/chunks/app/api/repositories/scan/route-8440b6c72bed83a1.js +0 -1
  702. package/.next/static/chunks/app/api/repositories/sync/route-8440b6c72bed83a1.js +0 -1
  703. package/.next/static/chunks/app/api/repositories/validate-path/route-8440b6c72bed83a1.js +0 -1
  704. package/.next/static/chunks/app/api/sidebar/group-order/route-8440b6c72bed83a1.js +0 -1
  705. package/.next/static/chunks/app/api/skills/[id]/route-8440b6c72bed83a1.js +0 -1
  706. package/.next/static/chunks/app/api/skills/installations/route-8440b6c72bed83a1.js +0 -1
  707. package/.next/static/chunks/app/api/skills/operations/route-8440b6c72bed83a1.js +0 -1
  708. package/.next/static/chunks/app/api/skills/reindex/route-8440b6c72bed83a1.js +0 -1
  709. package/.next/static/chunks/app/api/skills/route-8440b6c72bed83a1.js +0 -1
  710. package/.next/static/chunks/app/api/slash-commands/route-8440b6c72bed83a1.js +0 -1
  711. package/.next/static/chunks/app/api/tasks/[taskId]/cancel/route-8440b6c72bed83a1.js +0 -1
  712. package/.next/static/chunks/app/api/tasks/[taskId]/route-8440b6c72bed83a1.js +0 -1
  713. package/.next/static/chunks/app/api/templates/[id]/route-8440b6c72bed83a1.js +0 -1
  714. package/.next/static/chunks/app/api/templates/route-8440b6c72bed83a1.js +0 -1
  715. package/.next/static/chunks/app/api/todos/route-8440b6c72bed83a1.js +0 -1
  716. package/.next/static/chunks/app/api/verification/runs/[runId]/route-8440b6c72bed83a1.js +0 -1
  717. package/.next/static/chunks/app/api/verification/runs/route-8440b6c72bed83a1.js +0 -1
  718. package/.next/static/chunks/app/api/worktrees/[id]/auto-yes/route-8440b6c72bed83a1.js +0 -1
  719. package/.next/static/chunks/app/api/worktrees/[id]/capture/route-8440b6c72bed83a1.js +0 -1
  720. package/.next/static/chunks/app/api/worktrees/[id]/cli-tool/route-8440b6c72bed83a1.js +0 -1
  721. package/.next/static/chunks/app/api/worktrees/[id]/cmate/schedules/route-8440b6c72bed83a1.js +0 -1
  722. package/.next/static/chunks/app/api/worktrees/[id]/current-output/route-8440b6c72bed83a1.js +0 -1
  723. package/.next/static/chunks/app/api/worktrees/[id]/execution-logs/[logId]/route-8440b6c72bed83a1.js +0 -1
  724. package/.next/static/chunks/app/api/worktrees/[id]/execution-logs/route-8440b6c72bed83a1.js +0 -1
  725. package/.next/static/chunks/app/api/worktrees/[id]/files/[...path]/route-8440b6c72bed83a1.js +0 -1
  726. package/.next/static/chunks/app/api/worktrees/[id]/git/branch/create/route-8440b6c72bed83a1.js +0 -1
  727. package/.next/static/chunks/app/api/worktrees/[id]/git/branch/delete/route-8440b6c72bed83a1.js +0 -1
  728. package/.next/static/chunks/app/api/worktrees/[id]/git/branches/route-8440b6c72bed83a1.js +0 -1
  729. package/.next/static/chunks/app/api/worktrees/[id]/git/checkout/route-8440b6c72bed83a1.js +0 -1
  730. package/.next/static/chunks/app/api/worktrees/[id]/git/commit/route-8440b6c72bed83a1.js +0 -1
  731. package/.next/static/chunks/app/api/worktrees/[id]/git/diff/route-8440b6c72bed83a1.js +0 -1
  732. package/.next/static/chunks/app/api/worktrees/[id]/git/fetch/route-8440b6c72bed83a1.js +0 -1
  733. package/.next/static/chunks/app/api/worktrees/[id]/git/log/route-8440b6c72bed83a1.js +0 -1
  734. package/.next/static/chunks/app/api/worktrees/[id]/git/pull/route-8440b6c72bed83a1.js +0 -1
  735. package/.next/static/chunks/app/api/worktrees/[id]/git/push/route-8440b6c72bed83a1.js +0 -1
  736. package/.next/static/chunks/app/api/worktrees/[id]/git/reset/route-8440b6c72bed83a1.js +0 -1
  737. package/.next/static/chunks/app/api/worktrees/[id]/git/revert/route-8440b6c72bed83a1.js +0 -1
  738. package/.next/static/chunks/app/api/worktrees/[id]/git/show/[commitHash]/route-8440b6c72bed83a1.js +0 -1
  739. package/.next/static/chunks/app/api/worktrees/[id]/git/stage/route-8440b6c72bed83a1.js +0 -1
  740. package/.next/static/chunks/app/api/worktrees/[id]/git/staged/route-8440b6c72bed83a1.js +0 -1
  741. package/.next/static/chunks/app/api/worktrees/[id]/git/stash/[index]/route-8440b6c72bed83a1.js +0 -1
  742. package/.next/static/chunks/app/api/worktrees/[id]/git/stash/apply/route-8440b6c72bed83a1.js +0 -1
  743. package/.next/static/chunks/app/api/worktrees/[id]/git/stash/pop/route-8440b6c72bed83a1.js +0 -1
  744. package/.next/static/chunks/app/api/worktrees/[id]/git/stash/push/route-8440b6c72bed83a1.js +0 -1
  745. package/.next/static/chunks/app/api/worktrees/[id]/git/stash/route-8440b6c72bed83a1.js +0 -1
  746. package/.next/static/chunks/app/api/worktrees/[id]/git/status/route-8440b6c72bed83a1.js +0 -1
  747. package/.next/static/chunks/app/api/worktrees/[id]/git/unstage/route-8440b6c72bed83a1.js +0 -1
  748. package/.next/static/chunks/app/api/worktrees/[id]/git/working-diff/route-8440b6c72bed83a1.js +0 -1
  749. package/.next/static/chunks/app/api/worktrees/[id]/interrupt/route-8440b6c72bed83a1.js +0 -1
  750. package/.next/static/chunks/app/api/worktrees/[id]/kill-session/route-8440b6c72bed83a1.js +0 -1
  751. package/.next/static/chunks/app/api/worktrees/[id]/logs/[filename]/route-8440b6c72bed83a1.js +0 -1
  752. package/.next/static/chunks/app/api/worktrees/[id]/logs/route-8440b6c72bed83a1.js +0 -1
  753. package/.next/static/chunks/app/api/worktrees/[id]/marp-render/route-8440b6c72bed83a1.js +0 -1
  754. package/.next/static/chunks/app/api/worktrees/[id]/memos/[memoId]/route-8440b6c72bed83a1.js +0 -1
  755. package/.next/static/chunks/app/api/worktrees/[id]/memos/route-8440b6c72bed83a1.js +0 -1
  756. package/.next/static/chunks/app/api/worktrees/[id]/messages/route-8440b6c72bed83a1.js +0 -1
  757. package/.next/static/chunks/app/api/worktrees/[id]/prompt-response/route-8440b6c72bed83a1.js +0 -1
  758. package/.next/static/chunks/app/api/worktrees/[id]/respond/route-8440b6c72bed83a1.js +0 -1
  759. package/.next/static/chunks/app/api/worktrees/[id]/route-8440b6c72bed83a1.js +0 -1
  760. package/.next/static/chunks/app/api/worktrees/[id]/schedules/[scheduleId]/route-8440b6c72bed83a1.js +0 -1
  761. package/.next/static/chunks/app/api/worktrees/[id]/schedules/active/route-8440b6c72bed83a1.js +0 -1
  762. package/.next/static/chunks/app/api/worktrees/[id]/schedules/route-8440b6c72bed83a1.js +0 -1
  763. package/.next/static/chunks/app/api/worktrees/[id]/search/route-8440b6c72bed83a1.js +0 -1
  764. package/.next/static/chunks/app/api/worktrees/[id]/send/route-8440b6c72bed83a1.js +0 -1
  765. package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route-8440b6c72bed83a1.js +0 -1
  766. package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/install/route-8440b6c72bed83a1.js +0 -1
  767. package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/plan/route-8440b6c72bed83a1.js +0 -1
  768. package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/uninstall/route-8440b6c72bed83a1.js +0 -1
  769. package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/uninstall-plan/route-8440b6c72bed83a1.js +0 -1
  770. package/.next/static/chunks/app/api/worktrees/[id]/skills/route-8440b6c72bed83a1.js +0 -1
  771. package/.next/static/chunks/app/api/worktrees/[id]/slash-commands/route-8440b6c72bed83a1.js +0 -1
  772. package/.next/static/chunks/app/api/worktrees/[id]/special-keys/route-8440b6c72bed83a1.js +0 -1
  773. package/.next/static/chunks/app/api/worktrees/[id]/start-polling/route-8440b6c72bed83a1.js +0 -1
  774. package/.next/static/chunks/app/api/worktrees/[id]/tasks/route-8440b6c72bed83a1.js +0 -1
  775. package/.next/static/chunks/app/api/worktrees/[id]/terminal/route-8440b6c72bed83a1.js +0 -1
  776. package/.next/static/chunks/app/api/worktrees/[id]/timers/history/route-8440b6c72bed83a1.js +0 -1
  777. package/.next/static/chunks/app/api/worktrees/[id]/timers/route-8440b6c72bed83a1.js +0 -1
  778. package/.next/static/chunks/app/api/worktrees/[id]/todos/[todoId]/route-8440b6c72bed83a1.js +0 -1
  779. package/.next/static/chunks/app/api/worktrees/[id]/todos/route-8440b6c72bed83a1.js +0 -1
  780. package/.next/static/chunks/app/api/worktrees/[id]/tree/[...path]/route-8440b6c72bed83a1.js +0 -1
  781. package/.next/static/chunks/app/api/worktrees/[id]/tree/route-8440b6c72bed83a1.js +0 -1
  782. package/.next/static/chunks/app/api/worktrees/[id]/upload/[...path]/route-8440b6c72bed83a1.js +0 -1
  783. package/.next/static/chunks/app/api/worktrees/[id]/verify/route-8440b6c72bed83a1.js +0 -1
  784. package/.next/static/chunks/app/api/worktrees/[id]/verify/runs/[runId]/route-8440b6c72bed83a1.js +0 -1
  785. package/.next/static/chunks/app/api/worktrees/[id]/verify/runs/route-8440b6c72bed83a1.js +0 -1
  786. package/.next/static/chunks/app/api/worktrees/[id]/viewed/route-8440b6c72bed83a1.js +0 -1
  787. package/.next/static/chunks/app/api/worktrees/route-8440b6c72bed83a1.js +0 -1
  788. package/.next/static/chunks/app/manifest.webmanifest/route-8440b6c72bed83a1.js +0 -1
  789. package/.next/static/chunks/app/proxy/[...path]/route-8440b6c72bed83a1.js +0 -1
  790. package/.next/static/chunks/app/repositories/page-1ed1e5a542ecc168.js +0 -1
  791. package/.next/static/chunks/app/worktrees/[id]/page-12b3c5f32fc6094e.js +0 -1
  792. /package/.next/static/{-BSmW0Ae2YsxyCl_ue7_d → C01FQOE5FCmB3I_GhMa4_}/_buildManifest.js +0 -0
  793. /package/.next/static/{-BSmW0Ae2YsxyCl_ue7_d → C01FQOE5FCmB3I_GhMa4_}/_ssgManifest.js +0 -0
@@ -1,5 +1,5 @@
1
- exports.id=5959,exports.ids=[1296,5959,9358],exports.modules={60:(a,b,c)=>{"use strict";c.d(b,{Q:()=>f,b:()=>e});var d=c(26283);function e(a){return d.Md.test(a)&&!d.kD.test(a)}function f(a,b,c,d,e){if(a=Math.max(0,a),"opencode"===d||"copilot"===d){let a=e(b);return a>=0?a+1:0}if("antigravity"===d){let c=e(b);return c>=0?c+1:Math.max(0,a)}if(a>=b||c){let a=e(40);return a>=0?a+1:0}if("codex"===d)return Math.max(0,a);if(a>=b-5){let a=e(50);return a>=0?a+1:Math.max(0,b-40)}return Math.max(0,a)}},3523:(a,b,c)=>{"use strict";c.d(b,{z$:()=>B,zX:()=>C});var d=c(31766),e=c(88807),f=c(56791),g=c(69297),h=c(25129),i=c(18778),j=c(15194),k=c(8988),l=c(26283),m=c(72626),n=c(46423),o=c(60),p=c(82450),q=c(56263),r=c(13033),s=c(72457),t=c(71080),u=c(45146),v=c(63865),w=c(2924);let x=(0,m.h)("response-poller");function y(a){return{response:"",isComplete:!1,lineCount:a}}function z(a,b,c,d,e,f,g){let h=(0,o.Q)(b,c,d,e,f),i=a.slice(h);return{response:(0,l.aJ)(i.join("\n")),isComplete:!0,lineCount:c,promptDetection:g,bufferReset:d}}function A(a,b){let c=(0,l.KO)(b);return(0,h.gF)((0,l._A)((0,l.aJ)(a)),c)}function B(a,b,c){let d=a.split("\n"),e=d.length;for(;e>0&&""===d[e-1].trim();)e--;let f=d.slice(0,e),g=f.length,h="claude"===c?(0,l.GT)(f):-1,i=h>=0?h:g,j=g>0&&b>25&&g+25<b,k=g>0&&b>50&&g<50,m=j||k;if(!m&&g<b-5)return null;let p=Math.max(0,g-20),q=f.slice(p),r="opencode"===c?(0,l.aJ)(f.join("\n")):q.join("\n"),{promptPattern:s,separatorPattern:t,thinkingPattern:v,skipPatterns:w}=(0,l._X)(c),x=(a=60)=>{let b;if("codex"===c)b=/^›\s+(?!Implement|Find and fix|Type|Summarize)/;else if("opencode"===c){let b=0;for(let c=g-1;c>=Math.max(0,g-a);c--){let a=(0,l.aJ)(f[c]);if(l.Md.test(a)&&2==++b)return c}return -1}else b=/^[>❯]\s+\S/;for(let c=i-1;c>=Math.max(0,i-a);c--){let a=(0,l.aJ)(f[c]);if(b.test(a))return c}return -1};if("claude"===c||"codex"===c||"copilot"===c){let a=A(f.join("\n"),c);if(a.isPrompt)return z(f,b,g,m,c,x,a)}let B=(0,l.aJ)(r),C=s.test(B),D=t.test(B),E=v.test(B),F=("codex"===c||"gemini"===c||"vibe-local"===c||"copilot"===c||"antigravity"===c)&&C&&!E,G="claude"===c&&C&&D&&!E,H="opencode"===c&&(0,o.b)(B);if(F||G||H){let a=[],d=(0,o.Q)(b,g,m,c,x),e=g;for(let b=d;b<i;b++){let d=f[b],g=(0,l.aJ)(d);if("codex"===c&&/^›\s+/.test(g)||"gemini"===c&&/^(%|\$|.*@.*[%$#])\s*$/.test(g)||"antigravity"===c&&/^>\s*$/.test(g)||"opencode"===c&&(l.sy.test(g)||l.uA.test(g))){e=b;break}w.some(a=>a.test(g))||a.push(d)}let h=a.join("\n").trim(),j=h.split("\n").slice(-n.$).join("\n");if(v.test(j))return y(g);if("claude"===c){let a=(0,l.aJ)(h),b=/[╭╮╰╯│]/.test(a)||/░{3,}/.test(a)||/▓{3,}/.test(a),c=/Claude Code|claude\/|v\d+\.\d+/.test(a),d=/Tip:|for shortcuts|\?\s*for help/.test(a),e=/^\s*\/Users\/.*$/m.test(a)&&a.split("\n").length<30,f=a.match(/^[>❯]\s+(\S.*)$/m);if(f){let b=a.indexOf(f[0]);if(0===a.substring(b+f[0].length).trim().split("\n").filter(a=>{let b=a.trim();return b&&!w.some(a=>a.test(b))&&!/^─+$/.test(b)}).length)return y(g)}else if((b||c||d||e)&&h.length<2e3)return y(g)}if("gemini"===c&&((h.match(/[░███]/g)||[]).length>.3*h.length||u.SI.some(a=>h.includes(a))||!h.includes("✦")&&h.length<10))return y(g);if("opencode"===c){let a=(0,l.aJ)(h);if((a.length<50||!l.Md.test(B))&&0===a.split("\n").filter(a=>{let b=a.trim();return b&&!l.sx.some(a=>a.test(b))}).length)return y(g)}return{response:h,isComplete:!0,lineCount:e,bufferReset:m}}if("opencode"!==c){let a=A(f.join("\n"),c);if(a.isPrompt)return z(f,b,g,m,c,x,a)}let I=[],J=m||b>=g-5,K=J?x(80):-1,L=J?K>=0?K+1:Math.max(0,g-80):Math.max(0,b);for(let a=L;a<Math.min(g,i);a++){let b=f[a],c=(0,l.aJ)(b);w.some(a=>a.test(c))||I.push(b)}let M=I.join("\n").trim();return M?{response:M,isComplete:!1,lineCount:g}:y(g)}async function C(a,b,c){let h=(0,e.getDbInstance)(),m=c??b;try{let e=(0,f.Uim)(h,a);if(!e)return x.error("worktree-worktreeid-not"),(0,u.Et)(a,b,c),!1;if(!await (0,d.K1)(a,b,c))return x.info("session-not-running"),(0,u.Et)(a,b,c),!1;let o=(0,f.y1O)(h,a,m),y=o?.lastCapturedLine||0,z=await (0,d.Wh)(a,b,1e4,c);if("opencode"===b||"copilot"===b){let d=(0,u.MN)(a,b,c);(0,r.IZ)(d,z,b)}let C=B(z,y,b);if(!C||!C.isComplete){let{thinkingPattern:c}=(0,l._X)(b),d=(0,l.aJ)(z).split("\n").slice(-n.$).join("\n");return c.test(d)&&(0,f.PLg)(h,a,b,m)>0&&x.info("marked-answeredcount-pending"),!1}let D="opencode"===b||"copilot"===b,E=!(0,j.VA)(b);if(E&&!C.bufferReset&&C.lineCount===y&&!o?.inProgressMessageId)return!1;if(E&&!C.bufferReset&&C.lineCount<=y)return x.info("already-saved-up-to-line-lastcapturedlin"),!1;let F=C.promptDetection??A(C.response,b);if(F.isPrompt){let d=F.rawContent||F.cleanContent,i=(0,u.MN)(a,b,c),j=(0,s.zm)(d,b);if((0,s.gv)(i,j))return x.info("duplicate-prompt-skipped",{worktreeId:a,cliToolId:b}),!1;let k=d;"copilot"===b&&(k=(0,p.LH)(d),k=(0,p.Sj)(k,q.Rf,q.ky)),(0,f.YXK)(h,a,b,m);let l=(0,f.oHS)(h,{worktreeId:a,role:"assistant",content:k,messageType:"prompt",promptData:F.promptData,timestamp:new Date,cliToolId:b,instanceId:m});return(0,f.PPx)(h,a,b,C.lineCount,m),(0,g.Lo)("message",{worktreeId:a,message:l}),(0,w.r)(h,a,b,m,"prompt_detected",{promptType:F.promptData?.type}),(0,v.J$)({worktreeId:a,worktreeName:e.name,kind:"prompt",agentName:m,excerpt:F.promptData?.question??k}).catch(()=>{}),D||(0,u.Et)(a,b,c),!0}if(!C.response||""===C.response.trim())return(0,f.PPx)(h,a,b,C.lineCount,m),!1;let G="claude"===b?(0,k.R)(C.response):void 0,H=C.response;if("gemini"===b)H=(0,p.IS)(C.response);else if("claude"===b)H=(0,p.NN)(C.response);else if("copilot"===b){let d=(0,u.MN)(a,b,c),e=(0,r.Uz)(d)||C.response;H=(0,p.LH)(e),H=(0,p.Sj)(H,q.Rf,q.ky),(0,r.q1)(d)}else if("opencode"===b){H=(0,p.aW)(C.response);let d=(0,u.MN)(a,b,c);(0,r.q1)(d)}if(!H||""===H.trim()||"[No content]"===H)return(0,f.PPx)(h,a,b,C.lineCount,m),(0,f.YXK)(h,a,b,m),!1;if((0,j.VA)(b)){let d=(0,u.MN)(a,b,c);if((0,t.j)(d,H))return(0,f.PPx)(h,a,b,C.lineCount,m),!1}H&&await (0,i.T)(h,a,H,b),(0,f.PLg)(h,a,b,m)>0&&x.info("marked-answeredcount-pending");let I=(0,f.y1O)(h,a,m);if(E&&I&&C.lineCount<=I.lastCapturedLine)return x.info("race-condition-detected-skipping-save-re"),!1;let J=(0,f.oHS)(h,{worktreeId:a,role:"assistant",content:H,messageType:"normal",timestamp:new Date,cliToolId:b,instanceId:m,summary:G?.summary,logFileName:G?.logFileName,requestId:G?.requestId});return(0,g.Lo)("message",{worktreeId:a,message:J}),(0,v.J$)({worktreeId:a,worktreeName:e.name,kind:"completion",agentName:m,excerpt:H}).catch(()=>{}),(0,f.PPx)(h,a,b,C.lineCount,m),D&&(0,u.Et)(a,b,c),!0}catch(a){return x.error("response:check-failed",{error:a instanceof Error?a.message:String(a)}),!1}}},7015:(a,b,c)=>{"use strict";c.d(b,{Ds:()=>g});var d=c(81719);class e{constructor(a,b=3e4){this.cache=new Map,this.allAppsCache=null,this.lastRefresh=0,this.db=a,this.ttl=b}getTTL(){return this.ttl}isStale(){return Date.now()-this.lastRefresh>this.ttl}async refresh(){let a=(0,d.$i)(this.db);for(let b of(this.cache.clear(),a))this.cache.set(b.pathPrefix,b);this.allAppsCache=a,this.lastRefresh=Date.now()}async getByPathPrefix(a){return this.isStale()&&await this.refresh(),this.cache.get(a)??null}async getAll(){return this.isStale()&&await this.refresh(),this.allAppsCache??[]}invalidate(){this.cache.clear(),this.allAppsCache=null,this.lastRefresh=0}invalidateByIssueNo(a){this.invalidate()}}let f=null;function g(a){if(!f){if(!a)throw Error("Database instance required to initialize cache");f=new e(a)}return f}},8988:(a,b,c)=>{"use strict";c.d(b,{R:()=>g});let d=/📄 Session log: (.+?\/([^\/\s]+\.jsonl))/,e=/Request ID: ([^\s\n]+)/,f=/Summary: (.+?)(?:\n─|$)/s;function g(a){let b={content:a},c=d.exec(a);c&&(b.logFileName=c[2]);let g=e.exec(a);g&&(b.requestId=g[1]);let h=f.exec(a);return h&&(b.summary=h[1].trim()),b}},11508:(a,b,c)=>{"use strict";c.d(b,{H:()=>m,m:()=>n});var d=c(44265),e=c(11665),f=c(40236),g=c(93997),h=c(26283),i=c(72626),j=c(20610);let k=(0,i.h)("cli-tools/gemini");function l(a){return a instanceof Error?a.message:String(a)}let m=200;class n extends d.M{async isRunning(a,b){let c=this.getSessionName(a,b);return await (0,e.N)(c)}async startSession(a,b,c){if(!await this.isInstalled())throw Error("Gemini CLI is not installed or not in PATH");let d=this.getSessionName(a,c);if(await (0,e.N)(d)){await this.reconcileExistingSession(d),k.info("gemini-session-sessionname");return}try{await (0,e.jw)({sessionName:d,workingDirectory:b,historyLimit:5e4}),await new Promise(a=>setTimeout(a,j.Uc)),await (0,e.V1)(d,"gemini",!0),await new Promise(a=>setTimeout(a,6e3)),await this.waitForReady(d),k.info("started-gemini-session:sessionname")}catch(b){let a=l(b);throw Error(`Failed to start Gemini session: ${a}`)}}async waitForReady(a){let b=!1;for(let c=0;c<30;c++){try{let c=await (0,e.Xg)(a,m),d=(0,h.aJ)(c);if(h.wN.test(d))return void k.info("gemini-prompt-detected");!b&&d.includes("Do you trust this folder?")&&(await (0,e.ds)(a,"Enter"),b=!0,k.info("auto-trusted-folder-for"))}catch{}await new Promise(a=>setTimeout(a,1e3))}k.info("gemini-prompt-detection")}async waitForPrompt(a){let b=Date.now();for(;Date.now()-b<15e3;){try{let b=await (0,e.Xg)(a,m),c=(0,h.aJ)(b);if(h.wN.test(c))return}catch{}await new Promise(a=>setTimeout(a,500))}k.info("gemini-prompt-not")}async sendMessage(a,b,c){let d=this.getSessionName(a,c);if(!await (0,e.N)(d))throw Error(`Gemini session ${d} does not exist. Start the session first.`);try{await this.waitForPrompt(d),await (0,f.FW)({sessionName:d,message:b,cliToolId:"gemini"}),(0,g.gm)(d),k.info("sent-message-to-gemini-session:sessionna")}catch(b){let a=l(b);throw Error(`Failed to send message to Gemini: ${a}`)}}async killSession(a,b){let c=this.getSessionName(a,b);try{await (0,e.N)(c)&&(await (0,e.ds)(c,"C-c"),await new Promise(a=>setTimeout(a,j.Is)),await (0,e.V1)(c,"/quit",!0),await new Promise(a=>setTimeout(a,j.Zf))),await (0,e.fY)(c)&&k.info("stopped-gemini-session:sessionname")}catch(a){throw k.error("session:stop-failed",{error:l(a)}),a}}constructor(...a){super(...a),this.id="gemini",this.name="Gemini CLI",this.command="gemini"}}},11665:(a,b,c)=>{"use strict";c.d(b,{Ce:()=>w,GW:()=>n,KB:()=>r,N:()=>m,N6:()=>y,Sb:()=>z,V1:()=>p,Xg:()=>s,ds:()=>v,fY:()=>t,jw:()=>o,lA:()=>k,zT:()=>l});var d=c(79646),e=c(28354),f=c(93997),g=c(16983),h=c(72626);let i=(0,e.promisify)(d.execFile),j=(0,h.h)("tmux");function k(a){return`=${a}:`}async function l(a,b={}){let c,d,e,f=b.windowWidth??g.J,h=b.windowHeight??g.s,m=k(a);try{c=(await i("tmux",["show-window-options","-v","-t",m,"window-size"],{timeout:5e3})).stdout.trim();let[a,b]=(await i("tmux",["display-message","-p","-t",m,"#{window_width}|#{window_height}"],{timeout:5e3})).stdout.trim().split("|").map(Number);Number.isFinite(a)&&(d=a),Number.isFinite(b)&&(e=b)}catch{}let n="manual"===c,o=d===f&&e===h;if(n&&o)return!1;try{return n||await i("tmux",["set-window-option","-t",m,"window-size","manual"],{timeout:5e3}),o||await i("tmux",["resize-window","-t",m,"-x",String(f),"-y",String(h)],{timeout:5e3}),!0}catch(b){return j.warn("session-geometry:reconcile-failed",{sessionName:a,error:b instanceof Error?b.message:String(b)}),!1}}async function m(a){try{return await i("tmux",["has-session","-t",k(a)],{timeout:5e3}),!0}catch{return!1}}async function n(){try{let{stdout:a}=await i("tmux",["list-sessions","-F","#{session_name}|#{session_windows}|#{session_attached}"],{timeout:5e3});if(!a||""===a.trim())return[];return a.trim().split("\n").map(a=>{let[b,c,d]=a.split("|");return{name:b,windows:parseInt(c,10)||0,attached:"1"===d}})}catch{return[]}}async function o(a,b){let c,d,e,f,h;"string"==typeof a?(c=a,d=b,e=5e4,f=g.J,h=g.s):(c=a.sessionName,d=a.workingDirectory,e=a.historyLimit||5e4,f=a.windowWidth||g.J,h=a.windowHeight||g.s);try{await i("tmux",["new-session","-d","-s",c,"-c",d,"-x",String(f),"-y",String(h)],{timeout:5e3}),await l(c,{windowWidth:f,windowHeight:h}),await i("tmux",["set-option","-t",k(c),"history-limit",String(e)],{timeout:5e3})}catch(b){let a=b instanceof Error?b.message:String(b);throw Error(`Failed to create tmux session: ${a}`)}}async function p(a,b,c=!0){let d=c?["send-keys","-t",k(a),b,"C-m"]:["send-keys","-t",k(a),b];try{await i("tmux",d,{timeout:5e3})}catch(b){let a=b instanceof Error?b.message:String(b);throw Error(`Failed to send keys to tmux session: ${a}`)}}let q=new Set(["Up","Down","Left","Right","Enter","Space","Tab","Escape","BSpace","DC","PageUp","PageDown","Home","End","q"]);async function r(a,b){if(0!==b.length){for(let a of b)if(!q.has(a))throw Error(`Invalid special key: ${a}`);try{for(let c=0;c<b.length;c++)await i("tmux",["send-keys","-t",k(a),b[c]],{timeout:5e3}),c<b.length-1&&await new Promise(a=>setTimeout(a,100))}catch(b){let a=b instanceof Error?b.message:String(b);throw Error(`Failed to send special keys to tmux session: ${a}`)}}}async function s(a,b){let c,d;"number"==typeof b?(c=-b,d="-"):b?(c=b.startLine??-1e4,d=b.endLine??"-"):(c=-1e3,d="-");try{let{stdout:b}=await i("tmux",["capture-pane","-t",k(a),"-p","-e","-S",String(c),"-E",String(d)],{timeout:5e3,maxBuffer:0xa00000});return b}catch(b){let a=b instanceof Error?b.message:String(b);throw Error(`Failed to capture pane: ${a}`)}}async function t(a){try{return await i("tmux",["kill-session","-t",k(a)],{timeout:5e3}),!0}catch(b){let a=b instanceof Error?b.message:String(b);if(a?.includes("no server running")||a?.includes("can't find session"))return!1;throw Error(`Failed to kill tmux session: ${a}`)}}let u=new Set(["Escape","C-c","C-d","C-m","Enter"]);async function v(a,b){if(!u.has(b))throw Error(`Invalid special key: ${b}`);try{await i("tmux",["send-keys","-t",k(a),b],{timeout:5e3})}catch(b){let a=b instanceof Error?b.message:String(b);throw Error(`Failed to send special key: ${a}`)}}async function w(a){try{await i("tmux",["send-keys","-t",k(a),"C-u"],{timeout:5e3})}catch(b){let a=b instanceof Error?b.message:String(b);throw Error(`Failed to clear tmux input line: ${a}`)}}let x=["Up","Down","Left","Right","Enter","Escape","Tab","BTab","PageUp","PageDown","Home","End","q"];function y(a){return x.includes(a)}async function z(a,b){await r(a,b),(0,f.gm)(a)}},13033:(a,b,c)=>{"use strict";c.d(b,{IW:()=>h,IZ:()=>l,K0:()=>g,Uz:()=>m,l1:()=>f,o0:()=>i,q1:()=>n,tb:()=>k,vQ:()=>j});var d=c(26283);let e=new Map;function f(a){return(0,d._A)((0,d.aJ)(a)).replace(/^\u2503\s?/,"").replace(/\s*\u2503$/,"").trim()}function g(a){let b=a.split("\n"),c=[];for(let a of b){let b=f(a);!(!b||d.sx.some(a=>a.test(b)))&&(d.Md.test(b)||c.push(b))}return c}function h(a){return a.replace(/[\u2500-\u257F]/g,"").replace(/\s{2,}/g," ").trim()}function i(a){let b=(0,d.aJ)(a).split("\n"),c=[];for(let a of b){let b=h(a);b&&(d.J7.some(a=>a.test(b))||c.push(b))}return c}function j(a,b){if(0===a.length||0===b.length)return 0;let c=Math.min(a.length,b.length);for(let d=c;d>=1;d--){let c=a.slice(-d),e=b.slice(0,d),f=!0;for(let a=0;a<d;a++)if(c[a]!==e[a]){f=!1;break}if(f)return d}return 0}function k(a){e.set(a,{lines:[],lastFingerprint:[],pollCount:0})}function l(a,b,c="opencode"){let d=e.get(a);if(!d)return;let f="copilot"===c?i(b):g(b);if(0!==f.length){if(d.pollCount++,0===d.lines.length)d.lines=[...f];else{let a=j(d.lastFingerprint,f);if(a>0){let b=f.slice(a);d.lines.push(...b)}else d.lines.push(...f)}d.lastFingerprint=f.slice(-10)}}function m(a){let b=e.get(a);return b&&0!==b.lines.length?b.lines.join("\n"):""}function n(a){e.delete(a)}},18778:(a,b,c)=>{"use strict";c.d(b,{T:()=>g});var d=c(56791),e=c(41364);let f=(0,c(72626).h)("conversation-logger");async function g(a,b,c,h="claude"){let i=(0,d.r8U)(a,b);if(i)try{await (0,e.hM)(b,i.content,c,h)}catch(a){f.error("conversation:log-failed",{error:a instanceof Error?a.message:String(a)})}}},18896:(a,b,c)=>{"use strict";c.d(b,{v7:()=>d.v7,LP:()=>d.LP,pL:()=>d.pL,GE:()=>d.GE,aq:()=>d.aq,kC:()=>d.kC,xU:()=>w,bZ:()=>x,W8:()=>d.W8,W5:()=>D,_i:()=>E,_C:()=>F});var d=c(24455),e=c(31766),f=c(25129),g=c(68901),h=c(56791),i=c(88807),j=c(72626);let k=(0,j.h)("auto-yes-policy"),l=new Map;var m=c(2924),n=c(63869),o=c(31268),p=c(26283),q=c(77093),r=c(93997),s=c(66007);let t=(0,j.h)("auto-yes-poller"),u=globalThis.__autoYesPollerStates??(globalThis.__autoYesPollerStates=new Map);function v(a){return u.get(a)}function w(a){let b=v(a);return b?.lastServerResponseTimestamp??null}function x(a){return u.has(a)}function y(a){let b=v(a);if(b&&(b.consecutiveErrors++,b.currentInterval=(0,d.G)(b.consecutiveErrors),b.consecutiveErrors>=g.ul)){let b=(0,d.Ue)(a),c=(0,d.pL)(a);c&&(0,d.XK)(b,c,"consecutive_errors",(0,d.GE)(a)??void 0),E(a)}}async function z(a,b,c,d){let f=c??g.FW,h=await (0,e.Wh)(a,b,f,d);return(0,p._A)((0,p.aJ)(h))}async function A(a,b,e,j,q,s){let u=(0,d.v7)(a,e,s);try{let y=(0,p.KO)(e),z=(0,f.gF)(j,{...y,...q&&{precomputedLines:q}});if(!z.isPrompt||!z.promptData)return b.lastAnsweredPromptKey=null,b.lastAnsweredAt=null,"no_prompt";let A=(w=z.promptData,`${w.type}:${w.question}`);if(b.lastAnsweredPromptKey===A&&null!==b.lastAnsweredAt&&Date.now()-b.lastAnsweredAt<d.UL)return"duplicate";let B=function(a,b,c){let e=c??b,f=(0,d.v7)(a,b,e),g=Date.now(),j=l.get(f);if(j&&j.expiresAt>g)return j.policy;let m=function(a,b,c){try{let d=(0,h.MHq)((0,i.getDbInstance)(),a,b,c);if(!d)return null;return d.contract.autoYes}catch(d){return k.warn("policy-lookup-failed",{worktreeId:a,cliToolId:b,instanceId:c,error:d instanceof Error?d.message:String(d)}),null}}(a,b,e);return l.size>=200&&function(a){for(let[b,c]of l.entries())c.expiresAt<=a&&l.delete(b)}(g),l.set(f,{policy:m,expiresAt:g+5e3}),m}(a,e,s),C=function(a,b){let c=function(a){if("yes_no"===a.type)return"y";if("multiple_choice"===a.type){let b=a.options.find(a=>a.isDefault)??a.options[0];return!b||b.requiresTextInput?null:b.number.toString()}return null}(a);if(null===c)return{answer:null,suppressedBy:null};let d=function(a,b){if(!b)return null;if("off"===b.mode)return{reason:"mode-off"};let c=function(a,b){if(0===b.length)return{outcome:"no-match"};let c=function(a){let b=[a.question];if(a.instructionText&&b.push(a.instructionText),"multiple_choice"===a.type)for(let c of a.options)b.push(c.label);else b.push(...a.options);return b.map(a=>a.length>2e4?a.slice(0,2e4):a)}(a);for(let a of b){if(a.length>200||!(0,g.P0)(a).valid)return{outcome:"unusable",pattern:a};let b=new RegExp(a);for(let d of c){let c=(0,g.eJ)(b,d);if(null===c)return{outcome:"unusable",pattern:a};if(c)return{outcome:"match",pattern:a}}}return{outcome:"no-match"}}(a,b.denyPatterns);return"match"===c.outcome?{reason:"deny-pattern",pattern:c.pattern}:"unusable"===c.outcome?{reason:"deny-pattern-unusable",pattern:c.pattern}:"safe"===b.mode?"yes_no"===a.type?null:{reason:"type-not-allowed"}:"allow-listed"===b.mode?b.allowPromptTypes.includes(a.type)?null:{reason:"type-not-allowed"}:null}(a,b);return d?{answer:null,suppressedBy:d.reason,pattern:d.pattern}:{answer:c,suppressedBy:null}}(z.promptData,B);C.suppressedBy&&t.warn("poller:auto-yes-suppressed-by-policy",{worktreeId:a,cliToolId:e,instanceId:s,reason:C.suppressedBy,mode:B?.mode??null,pattern:C.pattern,promptType:z.promptData.type});let D=C.answer;if(null===D)return"no_answer";let E=o.s.getInstance().getTool(e).getSessionName(a,s);try{await (0,n.t)({sessionName:E,answer:D,cliToolId:e,promptData:z.promptData})}finally{(0,r.gm)(E)}var w,x=Date.now();let F=v(u);F&&(F.lastServerResponseTimestamp=x);let G=v(u);G&&(G.consecutiveErrors=0,G.currentInterval=d.ps),b.lastAnsweredPromptKey=A,b.lastAnsweredAt=Date.now(),t.info("poller:response-sent",{worktreeId:a,cliToolId:e,instanceId:s}),(0,m.r)((0,i.getDbInstance)(),a,e,s??e,"prompt_answered_auto",{promptType:z.promptData.type});let[{startPolling:H},{broadcastTerminalSnapshotAfterInteraction:I}]=await Promise.all([Promise.resolve().then(c.bind(c,95220)),Promise.resolve().then(c.bind(c,99508))]);return H(a,e,s),I(a,e,s),"responded"}catch{return y(u),t.warn("poller:detect-respond-error",{worktreeId:a,cliToolId:e,instanceId:s}),"error"}}async function B(a,b,c){let e=(0,d.v7)(a,b,c),f=v(e);if("valid"===function(a,b){if(!b)return"stopped";let c=(0,d.Ue)(a),e=(0,d.pL)(a);if(!e)return E(a),"expired";let f=(0,d.GE)(a)??void 0,g=(0,d.aq)(c,e,f);return g?.enabled?"valid":(E(a),"expired")}(e,f)){try{let h=(0,d.aq)(a,b,c),i=h?.stopPattern?g.FW:g.Ke,j=await z(a,b,i,c),k=j.split("\n");if(function(a,b,c){if(b.stopCheckBaselineLength<0)return b.stopCheckBaselineLength=c.length,!1;let e=b.stopCheckBaselineLength;if(c.length>e){let f=c.substring(e);return b.stopCheckBaselineLength=c.length,(0,d.Cs)(a,f,E)}return c.length<e&&(b.stopCheckBaselineLength=c.length),!1}(e,f,j))return;let l=await A(a,f,b,j,k,c);if("responded"===l)return void C(a,b,c,d.ZO);if("no_prompt"===l){let e=k.slice(-d.Re).join("\n");if((0,p.ut)(b,e))return void C(a,b,c,g.QN)}}catch(d){y(e),t.warn("poller:poll-error",{worktreeId:a,cliToolId:b,instanceId:c,error:(0,q.u1)(d)})}C(a,b,c)}}function C(a,b,c,e){let f=v((0,d.v7)(a,b,c));if(!f)return;let g=Math.max(e??f.currentInterval,d.ps);f.timerId=setTimeout(()=>{B(a,b,c)},g)}function D(a,b,c){if(!(0,s.h6)(a))return{started:!1,reason:"invalid worktree ID"};let e=c??b,f=(0,d.aq)(a,b,e);if(!f?.enabled)return{started:!1,reason:"auto-yes not enabled"};let g=(0,d.v7)(a,b,e),h=v(g);if(!h&&u.size>=d.fC)return{started:!1,reason:"max concurrent pollers reached"};if(h&&h.cliToolId===b)return{started:!0,reason:"already_running"};h&&E(g);let i={timerId:null,cliToolId:b,instanceId:e,consecutiveErrors:0,currentInterval:d.ps,lastServerResponseTimestamp:null,lastAnsweredPromptKey:null,lastAnsweredAt:null,stopCheckBaselineLength:-1};return u.set(g,i),l.delete(g),i.timerId=setTimeout(()=>{B(a,b,e)},d.ps),t.info("poller:started",{worktreeId:a,cliToolId:b,instanceId:e}),{started:!0}}function E(a){let b=v(a);b&&(b.timerId&&clearTimeout(b.timerId),u.delete(a),l.delete(a),t.info("poller:stopped",{compositeKey:a}))}function F(a){(0,d._9)(Array.from(u.keys()),a).forEach(a=>E(a))}},20610:(a,b,c)=>{"use strict";c.d(b,{CV:()=>i,Em:()=>l,Is:()=>g,KI:()=>j,PY:()=>k,Uc:()=>d,Zf:()=>h,pL:()=>e,x9:()=>f});let d=100,e=100,f=200,g=300,h=500,i=500,j=2e3,k=200,l=100},21684:(a,b,c)=>{"use strict";c.d(b,{U:()=>g});var d=c(33873),e=c.n(d),f=c(87447);function g(){return(0,f._p)("CM_LOG_DIR")||e().join(process.cwd(),"data","logs")}},25129:(a,b,c)=>{"use strict";c.d(b,{gF:()=>B,xn:()=>v});var d=c(72626),e=c(68652),f=c(26283);let g=/^\s*[\u276F\u25CF\u203A][^\d]*(\d+)(?:\.(?!\d)|\s{2,})\s*(.+)$/,h=/^\s*[^\d]{0,3}(\d+)(?:\.(?!\d)|\s+)\s*(.+)$/,i=/^[-─]+$/,j=/^\s*\[[^\]]*\d+\s+lines?\]/i,k=/^\s*[…]?\s*[+\-↑↓⏵⏷]?\s*\d+\s+(?:pending|more)\b/i,l=/Esc\s+to\s+cancel\s*[·•]\s*Tab\s+to\s+amend/i,m=/Enter\s+to\s+select\b.*\bnavigate\b/i,n=/press\s+(?:enter|number)\s+to\s+confirm/i,o=/press\s+number\s+to\s+confirm/i,p=/(?:select|choose|pick|which|what|how|where|enter|type|specify|confirm|approve|accept|reject|decide|preference|option)/i,q=[/type\s+here/i,/tell\s+(me|claude)/i,/enter\s+/i,/custom/i,/differently/i];function r(a,b){if(0===b.length)return!0;let c=b[0].number;return a<c&&a>=c-2}function s(a){return{isPrompt:!1,cleanContent:a.trim()}}function t(a){return 0!==a.length&&!!(a.includes("?")||a.includes("?")||p.test(a))}function u(a,b){let c=b.endsWith("?")||b.endsWith("?");return!!(!c&&/^\s{2,}[^\d]/.test(a)&&!/^\s*\d+\./.test(a)||!c&&/^\s{4,}/.test(a)&&!/^\s*\d+\.\s/.test(a)||b.length<5&&!c||/^[\/~]/.test(b)||b.length>=2&&/^[a-zA-Z0-9_-]+$/.test(b))}function v(a,b="yes_no"){let c=a.toLowerCase().trim();if("multiple_choice"===b){if(/^\d+$/.test(c))return c;throw Error("Invalid answer for multiple choice prompt. Expected a number.")}if("yes"===c||"y"===c)return"y";if("no"===c||"n"===c)return"n";throw Error("Invalid answer for yes/no prompt. Expected 'yes', 'no', 'y', or 'n'.")}let w=(0,d.h)("prompt-detector"),x=null;function y(a){let b=a.split("\n"),c=(b.length>200?b.slice(-200):b).join("\n");return c.length>5e3&&(c=c.slice(-5e3)),c}let z=[{regex:/^(.+)\s+\(y\/n\)\s*$/m},{regex:/^(.+)\s+\[y\/N\]\s*$/m,defaultOption:"no"},{regex:/^(.+)\s+\[Y\/n\]\s*$/m,defaultOption:"yes"},{regex:/^(.+)\s+\(yes\/no\)\s*$/m}];function A(a,b,c,d){return{isPrompt:!0,promptData:{type:"yes_no",question:a,options:["yes","no"],status:"pending",...void 0!==d&&{defaultOption:d},instructionText:c},cleanContent:b,rawContent:c}}function B(a,b){let c=(0,e.N)(a),d=c===a&&b?.precomputedLines?b.precomputedLines:c.split("\n"),p=d.slice(-50).join("\n"),v=p===x;v||w.debug("detectPrompt:start",{outputLength:c.length}),x=p;let B=d.slice(-20).join("\n"),C=function(a,b,c){var d,p;a=(0,e.N)(a);let v=b?.requireDefaultIndicator??!0,w=a.split("\n"),x=w.length;for(;x>0&&""===w[x-1].trim();)x--;let y=Math.max(0,x-50),z=!1;for(let a=x-1;a>=y;a--){let b=m.test(w[a]);if(l.test(w[a])||b){x=a,z=b;break}}let A=w.slice(y,x);for(let b of A)if(f.l8.test(b))return s(a);let B=!1,C=!1;for(let a of A){let b=a.trim();if(!B&&n.test(b)){B=!0,o.test(b)&&(C=!0);break}}if(v){let b=!1;for(let a of A){let c=a.trim();if(g.test(c)){b=!0;break}}if(!b&&!B)return s(a)}let D=[],E=-1,F=0;for(let b=x-1;b>=y;b--){let c=w[b].trim();if(j.test(c)||k.test(c)){F++;continue}let d=c.match(g);if(d){let a=parseInt(d[1],10);if(a<=20&&r(a,D)){let b=d[2].trim();D.unshift({number:a,label:b,isDefault:!0}),F=0;continue}}let e=c.match(h);if(e){let a=parseInt(e[1],10);if(a>20);else if(r(a,D)){let b=e[2].trim();D.unshift({number:a,label:b,isDefault:!1}),F=0;continue}}if(0===D.length&&(c.startsWith("❯")||c.startsWith("●")||c.startsWith("›")))return s(a);if(D.length>0&&c&&!i.test(c)){let a=w[b];if(/^\s{4,}/.test(a)&&u(a,c)){if(++F>25){E=b;break}continue}if(t(c)){E=b;break}if(u(a,c)){if(++F>(/^\s{4,}/.test(a)?25:5)){E=b;break}continue}E=b;break}}if(!function(a){if(0===a.length||1!==a[0])return!1;let b=0;for(let c=1;c<a.length;c++){let d=a[c]-a[c-1];if(d<1||d>2||(2===d&&b++,b>1))return!1}return!0}(D.map(a=>a.number)))return s(a);let G=D.some(a=>a.isDefault),H=v&&B;if(D.length<2||v&&!G&&!H||!v&&(-1===E||!t(w[E]?.trim()??"")&&!function(a,b,c,d){let e=Math.max(d,b-3);for(let c=b-1;c>=e;c--){let b=a[c]?.trim()??"";if(!(!b||i.test(b))&&t(b))return!0}return!1}(w,E,0,y)))return s(a);let I=function(a,b){if(b<0)return"Please select an option:";let c=[];for(let d=Math.max(0,b-5);d<=b;d++){let b=a[d].trim();b&&!i.test(b)&&c.push(b)}return c.join(" ")}(w,E),J=function(a,b,c){if(b<0)return;let d=Math.max(0,b-19),e=a.slice(d,c).map(a=>a.trimEnd()).join("\n").trim();return e.length>0?e:void 0}(w,E,x),K=B?C?"answer_only":"answer_then_enter":void 0;return d=a,p=z,{isPrompt:!0,promptData:{type:"multiple_choice",question:I.trim(),options:D.map(a=>{let b=q.some(b=>b.test(a.label));return{number:a.number,label:a.label,isDefault:a.isDefault,requiresTextInput:b}}),status:"pending",instructionText:J,...K?{submitMode:K}:{},...p?{isAskUserQuestion:!0}:{}},cleanContent:I.trim(),rawContent:c(d.trim())}}(c,b,y);if(C.isPrompt)return v||w.info("detectPrompt:multipleChoice",{isPrompt:!0,question:C.promptData?.question,optionsCount:C.promptData?.options?.length}),C;let D=B.trim();for(let a of z){let b=B.match(a.regex);if(b){let c=b[1].trim();return A(c,c,D,a.defaultOption)}}let E=B.match(/^(.*?)Approve\?\s*$/m);if(E){let a=E[1].trim();return A(a?`${a} Approve?`:"Approve?",a||"Approve?",D)}return v||w.debug("detectPrompt:complete",{isPrompt:!1}),{isPrompt:!1,cleanContent:c.trim()}}},25754:(a,b,c)=>{"use strict";c.d(b,{Xn:()=>e,d9:()=>g,gB:()=>f,rv:()=>h});let d=["en","ja"],e="en",f="locale";function g(a){return"string"==typeof a&&d.includes(a)}function h(a,b){return g(a)?a:d.find(a=>(b??"").includes(a))??e}},26838:(a,b,c)=>{"use strict";c.d(b,{Mj:()=>k,Sw:()=>j,lX:()=>l});var d=c(29021),e=c(33873),f=c(90164);let g=/^v?\d+\.\d+\.\d+$/,h=/^[a-zA-Z0-9.\-\s_v]+$/,i=globalThis.__versionCheckCache??(globalThis.__versionCheckCache={result:null,fetchedAt:0,rateLimitResetAt:null});function j(){return function(){try{let a=(0,d.readFileSync)((0,e.join)(process.cwd(),"package.json"),"utf-8"),b=JSON.parse(a);if("commandmate"===b.name&&"string"==typeof b.version&&b.version.length>0)return b.version;return null}catch{return null}}()??"0.18.0"}function k(){return j()}async function l(){try{var a,b,c;if(null!==i.result&&Date.now()-i.fetchedAt<36e5||i.rateLimitResetAt&&(!(Date.now()>=i.rateLimitResetAt)||(i.rateLimitResetAt=null,0)))return i.result;let d=await fetch("https://api.github.com/repos/Kewton/CommandMate/releases/latest",{headers:{Accept:"application/vnd.github+json","User-Agent":`CommandMate/${k()}`},cache:"no-store",signal:AbortSignal.timeout(5e3)});if(403===d.status)return function(a){let b=a.headers.get("X-RateLimit-Reset");b?i.rateLimitResetAt=1e3*parseInt(b,10):i.rateLimitResetAt=Date.now()+36e5}(d),i.result;if(!d.ok)return i.result;let e=await d.json(),j=k(),l=e.tag_name.replace(/^v/,""),m={hasUpdate:function(a,b){if(!g.test(a)||!g.test(b))return!1;let c=a=>a.replace(/^v/,"").split(".").map(Number),[d,e,f]=c(a),[h,i,j]=c(b);return h!==d?h>d:i!==e?i>e:j>f}(j,e.tag_name),currentVersion:j,latestVersion:l,releaseUrl:(a=e.html_url).startsWith(f.Dk)?a:null,releaseName:(b=e.name,c=e.tag_name,h.test(b)&&b.length<=128?b:c),publishedAt:e.published_at};return i.result=m,i.fetchedAt=Date.now(),m}catch{return i.result}}},30618:(a,b,c)=>{"use strict";c.d(b,{xT:()=>w,Ui:()=>x});var d=c(44265),e=c(11665),f=c(40236),g=c(93997),h=c(29021),i=c(33873),j=c(72626);let k=(0,j.h)("cli-tools/opencode-config"),l=/^[a-zA-Z0-9._:/-]{1,100}$/,m=/^[a-zA-Z0-9._:/@-]{1,200}$/;async function n(){let a={};try{let b=new AbortController,c=setTimeout(()=>b.abort(),3e3),d=await fetch("http://localhost:11434/api/tags",{signal:b.signal}).finally(()=>{clearTimeout(c)});if(!d.ok)return k.warn("ollama-api-returned"),{};let e=await d.text();if(e.length>1048576)return k.warn("ollama-api-response"),{};let f=JSON.parse(e);if(!f||!Array.isArray(f.models))return k.warn("invalid-ollama-api"),{};for(let b of f.models.slice(0,100))"string"==typeof b?.name&&l.test(b.name)&&(a[b.name]={name:function(a){let b=String(a.name),c=a.details;if(!c)return b;let d=[b];return"string"==typeof c.parameter_size&&/^[\d.]+[BKMGT]?B?$/i.test(c.parameter_size)&&d.push(c.parameter_size),"string"==typeof c.quantization_level&&/^[A-Z0-9_]{1,20}$/i.test(c.quantization_level)&&d.push(c.quantization_level),d.length>1?`${b} (${d.slice(1).join(", ")})`:b}(b)})}catch(a){a instanceof Error&&"AbortError"===a.name?k.warn("ollama-api-timeout"):k.warn("failed-to-fetch")}return a}async function o(){let a={};try{let b=new AbortController,c=setTimeout(()=>b.abort(),3e3),d=await fetch("http://localhost:1234/v1/models",{signal:b.signal}).finally(()=>{clearTimeout(c)});if(!d.ok)return k.warn("lm-studio-api"),{};let e=await d.text();if(e.length>1048576)return k.warn("lm-studio-api"),{};let f=JSON.parse(e);if(!f||!Array.isArray(f.data))return k.warn("invalid-lm-studio"),{};for(let b of f.data.slice(0,100))"string"==typeof b?.id&&m.test(b.id)&&(a[b.id]={name:b.id})}catch(a){a instanceof Error&&"AbortError"===a.name?k.warn("lm-studio-api"):k.warn("failed-to-fetch")}return a}async function p(a){let b=function(a){let b=i.resolve(a);try{if(!h.lstatSync(b).isDirectory())throw Error(`Path is not a directory: ${b}`)}catch(a){if("ENOENT"===a.code)throw Error(`Path does not exist: ${b}`);throw a}return h.realpathSync(b)}(a),c=i.join(b,"opencode.json");if(h.existsSync(c))return;let[d,e]=await Promise.all([n(),o()]),f={};if(Object.keys(d).length>0&&(f.ollama={npm:"@ai-sdk/openai-compatible",name:"Ollama (local)",options:{baseURL:"http://localhost:11434/v1"},models:d}),Object.keys(e).length>0&&(f.lmstudio={npm:"@ai-sdk/openai-compatible",name:"LM Studio (local)",options:{baseURL:"http://localhost:1234/v1"},models:e}),0!==Object.keys(f).length)try{h.writeFileSync(c,JSON.stringify({$schema:"https://opencode.ai/config.json",provider:f},null,2),{encoding:"utf-8",flag:"wx"})}catch(a){if("EEXIST"===a.code)return;k.warn("failed-to-write-opencodejson:error-insta")}}var q=c(79646),r=c(28354),s=c(20610);let t=(0,j.h)("cli-tools/opencode"),u=(0,r.promisify)(q.execFile);function v(a){return a instanceof Error?a.message:String(a)}let w=200;class x extends d.M{async isRunning(a,b){let c=this.getSessionName(a,b);return await (0,e.N)(c)}async startSession(a,b,c){if(!await this.isInstalled())throw Error("OpenCode is not installed or not in PATH");let d=this.getSessionName(a,c);if(await (0,e.N)(d)){await this.reconcileExistingSession(d,{windowWidth:80,windowHeight:w}),t.info("opencode-session-sessionname");return}try{await p(b),await (0,e.jw)({sessionName:d,workingDirectory:b,historyLimit:5e4}),await new Promise(a=>setTimeout(a,s.Uc));try{await u("tmux",["resize-window","-t",(0,e.lA)(d),"-x","80","-y",String(w)])}catch{}await (0,e.V1)(d,"opencode",!0),await new Promise(a=>setTimeout(a,15e3)),t.info("started-opencode-session:sessionname")}catch(b){let a=v(b);throw Error(`Failed to start OpenCode session: ${a}`)}}async sendMessage(a,b,c){let d=this.getSessionName(a,c);if(!await (0,e.N)(d))throw Error(`OpenCode session ${d} does not exist. Start the session first.`);try{await (0,f.FW)({sessionName:d,message:b,cliToolId:"opencode"}),(0,g.gm)(d),t.info("sent-message-to-opencode-session:session")}catch(b){let a=v(b);throw Error(`Failed to send message to OpenCode: ${a}`)}}async killSession(a,b){let c=this.getSessionName(a,b);try{await (0,e.N)(c)?(await (0,e.V1)(c,"/exit",!0),await new Promise(a=>setTimeout(a,s.KI)),await (0,e.N)(c)&&await (0,e.fY)(c)):await (0,e.fY)(c),(0,g.gm)(c),t.info("stopped-opencode-session:sessionname")}catch(a){throw t.error("session:stop-failed",{error:v(a)}),a}}constructor(...a){super(...a),this.id="opencode",this.name="OpenCode",this.command="opencode"}}},31268:(a,b,c)=>{"use strict";c.d(b,{s:()=>K});var d=c(44265),e=c(57905);class f extends d.M{async isInstalled(){return await (0,e.zw)()}async isRunning(a,b){return await (0,e.Yq)(a,b)}async startSession(a,b,c){await (0,e.R7)({worktreeId:a,worktreePath:b,instanceId:c})}async sendMessage(a,b,c){await (0,e.pU)(a,b,c)}supportsImage(){return!0}async sendMessageWithImage(a,b,c,d){let e=`
2
- ![](${c})`,f=b?`${b}${e}`:e;await this.sendMessage(a,f,d)}async killSession(a,b){await (0,e.VU)(a,b)}constructor(...a){super(...a),this.id="claude",this.name="Claude Code",this.command="claude"}}var g=c(11665),h=c(40236),i=c(93997),j=c(26283),k=c(72626),l=c(20610);let m=(0,k.h)("cli-tools/codex");function n(a){return a instanceof Error?a.message:String(a)}class o extends d.M{async isRunning(a,b){let c=this.getSessionName(a,b);return await (0,g.N)(c)}async startSession(a,b,c){if(!await this.isInstalled())throw Error("Codex CLI is not installed or not in PATH");let d=this.getSessionName(a,c);if(await (0,g.N)(d)){await this.reconcileExistingSession(d),m.info("codex-session-sessionname");return}try{await (0,g.jw)({sessionName:d,workingDirectory:b,historyLimit:5e4}),await new Promise(a=>setTimeout(a,l.Uc)),await (0,g.V1)(d,"codex",!0),await new Promise(a=>setTimeout(a,3e3)),await this.waitForReady(d),m.info("started-codex-session:sessionname")}catch(b){let a=n(b);throw Error(`Failed to start Codex session: ${a}`)}}async waitForReady(a){let b=!1,c=!1;for(let d=0;d<30;d++){try{let d=await (0,g.Xg)(a,50),e=(0,j.aJ)(d);if((0,j.zZ)(e))return void m.info("codex-prompt-detected");let f=(0,j.Qh)(e);if("update"===f&&!b){await (0,g.V1)(a,"2",!1),b=!0,m.info("skipped-codex-update"),await new Promise(a=>setTimeout(a,l.CV));continue}if("press-enter"===f){await (0,g.ds)(a,"Enter"),m.info("dismissed-codex-notification"),await new Promise(a=>setTimeout(a,l.CV));continue}if("trust"===f&&!c){await (0,g.V1)(a,"1",!1),c=!0,m.info("auto-trusted-folder-for"),await new Promise(a=>setTimeout(a,l.CV));continue}}catch{}await new Promise(a=>setTimeout(a,1e3))}m.info("codex-prompt-detection")}async waitForPrompt(a){let b=Date.now();for(;Date.now()-b<15e3;){try{let b=await (0,g.Xg)(a,50),c=(0,j.aJ)(b);if((0,j.zZ)(c))return}catch{}await new Promise(a=>setTimeout(a,500))}throw m.info("codex-prompt-not"),Error("Codex prompt not ready: timed out waiting for the input prompt before sending")}async sendMessage(a,b,c){let d=this.getSessionName(a,c);if(!await (0,g.N)(d))throw Error(`Codex session ${d} does not exist. Start the session first.`);try{await this.waitForPrompt(d),await (0,h.FW)({sessionName:d,message:b,cliToolId:"codex"}),(0,i.gm)(d),m.info("sent-message-to-codex-session:sessionnam")}catch(b){let a=n(b);throw Error(`Failed to send message to Codex: ${a}`)}}async killSession(a,b){let c=this.getSessionName(a,b);try{await (0,g.N)(c)&&(await (0,g.ds)(c,"C-d"),await new Promise(a=>setTimeout(a,l.Zf))),await (0,g.fY)(c)&&m.info("stopped-codex-session:sessionname")}catch(a){throw m.error("session:stop-failed",{error:n(a)}),a}}constructor(...a){super(...a),this.id="codex",this.name="Codex CLI",this.command="codex"}}var p=c(11508),q=c(15194),r=c(88807),s=c(56791);let t=(0,k.h)("cli-tools/vibe-local");function u(a){return a instanceof Error?a.message:String(a)}class v extends d.M{async isRunning(a,b){let c=this.getSessionName(a,b);return await (0,g.N)(c)}async startSession(a,b,c){if(!await this.isInstalled())throw Error("vibe-local is not installed or not in PATH");let d=this.getSessionName(a,c);if(await (0,g.N)(d)){await this.reconcileExistingSession(d),t.info("vibe-local-session");return}try{await (0,g.jw)({sessionName:d,workingDirectory:b,historyLimit:5e4}),await new Promise(a=>setTimeout(a,l.Uc));let c="vibe-local -y";try{let b=(0,r.getDbInstance)(),d=(0,s.Uim)(b,a);d?.vibeLocalModel&&q.QP.test(d.vibeLocalModel)&&(c+=` -m ${d.vibeLocalModel}`);let e=d?.vibeLocalContextWindow;(0,q.FV)(e)&&(c+=` --context-window ${Number(e)}`)}catch{}await (0,g.V1)(d,c,!0),await new Promise(a=>setTimeout(a,5e3)),t.info("started-vibe-local-session:sessionname")}catch(b){let a=u(b);throw Error(`Failed to start Vibe Local session: ${a}`)}}async sendMessage(a,b,c){let d=this.getSessionName(a,c);if(!await (0,g.N)(d))throw Error(`Vibe Local session ${d} does not exist. Start the session first.`);try{await (0,h.FW)({sessionName:d,message:b,cliToolId:"vibe-local",submitEnterCount:2,interEnterWaitMs:l.PY}),(0,i.gm)(d),t.info("sent-message-to-vibe-local-session:sessi")}catch(b){let a=u(b);throw Error(`Failed to send message to Vibe Local: ${a}`)}}async killSession(a,b){let c=this.getSessionName(a,b);try{await (0,g.N)(c)&&(await (0,g.ds)(c,"C-c"),await new Promise(a=>setTimeout(a,l.Is)),await (0,g.ds)(c,"C-c"),await new Promise(a=>setTimeout(a,l.Zf))),await (0,g.fY)(c)&&t.info("stopped-vibe-local-session:sessionname")}catch(a){throw t.error("session:stop-failed",{error:u(a)}),a}}constructor(...a){super(...a),this.id="vibe-local",this.name="Vibe Local",this.command="vibe-local"}}var w=c(30618),x=c(79646),y=c(56263),z=c(77093);let A=(0,k.h)("cli-tools/copilot"),B=new Set(["model","agent","theme"]);class C extends d.M{async isInstalled(){try{return await new Promise((a,b)=>{(0,x.execFile)("gh",["--version"],{timeout:5e3},c=>{c?b(c):a()})}),await new Promise((a,b)=>{(0,x.execFile)("gh",["copilot","--help"],{timeout:5e3},c=>{c?b(c):a()})}),!0}catch{return!1}}async isRunning(a,b){let c=this.getSessionName(a,b);return await (0,g.N)(c)}async startSession(a,b,c){if(!await this.isInstalled())throw Error("GitHub Copilot CLI is not installed. Install with: gh extension install github/gh-copilot");let d=this.getSessionName(a,c);if(await (0,g.N)(d)){await this.reconcileExistingSession(d),A.info("copilot-session-exists");return}try{await (0,g.jw)({sessionName:d,workingDirectory:b,historyLimit:5e4}),await new Promise(a=>setTimeout(a,l.Uc)),await (0,g.V1)(d,"gh copilot",!0),await new Promise(a=>setTimeout(a,4e3)),await this.waitForReady(d),A.info("started-copilot-session")}catch(b){let a=(0,z.u1)(b);throw Error(`Failed to start Copilot session: ${a}`)}}async waitForReady(a){for(let b=0;b<30;b++){try{let b=await (0,g.Xg)(a,50),c=(0,j.aJ)(b);if(j.Du.test(c))return void A.info("copilot-prompt-detected")}catch{}await new Promise(a=>setTimeout(a,1e3))}A.info("copilot-prompt-detection-timeout")}async waitForPrompt(a,b=15e3){let c=Date.now();for(;Date.now()-c<b;){try{let b=await (0,g.Xg)(a,50),c=(0,j.aJ)(b);if(j.Du.test(c))return}catch{}await new Promise(a=>setTimeout(a,500))}A.info("copilot-prompt-not-detected")}extractSlashCommand(a){let b=a.trim();if(!b.startsWith("/"))return null;let c=b.match(/^\/(\S+)/);return c?c[1]:null}async waitForSelectionList(a){let b=Date.now();for(;Date.now()-b<5e3;){await new Promise(a=>setTimeout(a,300));try{let b=await (0,g.Xg)(a,50),c=(0,j.aJ)(b);if(j.Mi.test(c))return A.info("copilot-selection-list-detected"),!0}catch{}}return A.info("copilot-selection-list-not-detected-timeout"),!1}async sendMessage(a,b,c){let d=this.getSessionName(a,c);if(!await (0,g.N)(d))throw Error(`Copilot session ${d} does not exist. Start the session first.`);try{await this.waitForPrompt(d);let a=this.extractSlashCommand(b);if(a&&B.has(a)){await (0,g.V1)(d,b,!0),await this.waitForSelectionList(d),(0,i.gm)(d),A.info("sent-selection-list-command-to-copilot",{command:a});return}await (0,h.FW)({sessionName:d,message:b,cliToolId:"copilot",textInputWaitMs:y.L1,verifyDelayMs:y.wp}),(0,i.gm)(d),A.info("sent-message-to-copilot-session")}catch(b){let a=(0,z.u1)(b);throw Error(`Failed to send message to Copilot: ${a}`)}}async sendModelCommand(a,b,c){let d=this.getSessionName(a,c);if(!await (0,g.N)(d))throw Error(`Copilot session ${d} does not exist. Start the session first.`);try{await (0,g.V1)(d,`/model ${b}`,!0),await this.waitForSelectionList(d)&&await (0,g.ds)(d,"C-m"),await this.waitForPrompt(d,y.pL),(0,i.gm)(d),A.info("copilot-model-switched",{model:b})}catch(c){let a=(0,z.u1)(c);throw Error(`Failed to switch Copilot model to ${b}: ${a}`)}}async killSession(a,b){let c=this.getSessionName(a,b);try{await (0,g.N)(c)&&(await (0,g.ds)(c,"C-c"),await new Promise(a=>setTimeout(a,l.Is)),await (0,g.V1)(c,"exit",!0),await new Promise(a=>setTimeout(a,l.Zf))),await (0,g.fY)(c)&&A.info("stopped-copilot-session")}catch(a){throw A.error("session:stop-failed",{error:(0,z.u1)(a)}),a}}constructor(...a){super(...a),this.id="copilot",this.name="Copilot",this.command="gh"}}let D=(0,k.h)("cli-tools/antigravity");function E(a){return a instanceof Error?a.message:String(a)}let F=/\?\s+for\s+shortcuts/,G=/Do you trust the contents of this project\?/;function H(a){return F.test(a)&&!G.test(a)}class I extends d.M{async isRunning(a,b){let c=this.getSessionName(a,b);return await (0,g.N)(c)}async startSession(a,b,c,d){if(!await this.isInstalled())throw Error("Antigravity CLI (agy) is not installed or not in PATH");let e=this.getSessionName(a,c);if(await (0,g.N)(e)){await this.reconcileExistingSession(e),D.info("antigravity-session-exists");return}try{await (0,g.jw)({sessionName:e,workingDirectory:b,historyLimit:5e4}),await new Promise(a=>setTimeout(a,l.Uc));let a=d?`agy --model '${d.replace(/'/g,"'\\''")}'`:"agy";await (0,g.V1)(e,a,!0),await new Promise(a=>setTimeout(a,3e3)),await this.waitForReady(e),D.info("started-antigravity-session")}catch(b){let a=E(b);throw Error(`Failed to start Antigravity session: ${a}`)}}async waitForReady(a){let b=!1;for(let c=0;c<30;c++){try{let c=await (0,g.Xg)(a,50),d=(0,j.aJ)(c);if(H(d))return void D.info("antigravity-prompt-detected");if(!b&&G.test(d)){await (0,g.ds)(a,"Enter"),b=!0,D.info("auto-trusted-folder-for-antigravity"),await new Promise(a=>setTimeout(a,500));continue}}catch{}await new Promise(a=>setTimeout(a,1e3))}D.info("antigravity-prompt-detection-timeout")}async waitForPrompt(a){let b=Date.now();for(;Date.now()-b<15e3;){try{let b=await (0,g.Xg)(a,50),c=(0,j.aJ)(b);if(H(c))return}catch{}await new Promise(a=>setTimeout(a,500))}throw D.info("antigravity-prompt-not-ready"),Error("Antigravity prompt not ready: timed out waiting for the input prompt before sending")}async sendMessage(a,b,c){let d=this.getSessionName(a,c);if(!await (0,g.N)(d))throw Error(`Antigravity session ${d} does not exist. Start the session first.`);try{await this.waitForPrompt(d),await (0,h.FW)({sessionName:d,message:b,cliToolId:"antigravity"}),(0,i.gm)(d),D.info("sent-message-to-antigravity-session")}catch(b){let a=E(b);throw Error(`Failed to send message to Antigravity: ${a}`)}}async killSession(a,b){let c=this.getSessionName(a,b);try{await (0,g.N)(c)&&(await (0,g.ds)(c,"C-d"),await new Promise(a=>setTimeout(a,l.Zf)));let a=await (0,g.fY)(c);(0,i.gm)(c),a&&D.info("stopped-antigravity-session")}catch(a){throw D.error("session:stop-failed",{error:E(a)}),a}}constructor(...a){super(...a),this.id="antigravity",this.name="Antigravity CLI",this.command="agy"}}var J=c(95220);class K{constructor(){this.tools=new Map,this.tools.set("claude",new f),this.tools.set("codex",new o),this.tools.set("gemini",new p.m),this.tools.set("vibe-local",new v),this.tools.set("opencode",new w.Ui),this.tools.set("copilot",new C),this.tools.set("antigravity",new I)}static getInstance(){return K.instance||(K.instance=new K),K.instance}getTool(a){let b=this.tools.get(a);if(!b)throw Error(`CLI tool '${a}' not found`);return b}getAllTools(){return Array.from(this.tools.values())}async getToolInfo(a){let b=this.getTool(a),c=await b.isInstalled();return{id:b.id,name:b.name,command:b.command,installed:c}}async getAllToolsInfo(){return Promise.all(this.getAllTools().map(async a=>{let b=await a.isInstalled();return{id:a.id,name:a.name,command:a.command,installed:b}}))}async getInstalledTools(){return(await this.getAllToolsInfo()).filter(a=>a.installed)}stopPollers(a,b,c){(0,J.stopPolling)(a,b,c)}}},31766:(a,b,c)=>{"use strict";c.d(b,{Wh:()=>p,WD:()=>q,K1:()=>o});var d=c(31268),e=c(72626),f=c(11665);let g={streamingOutput:!1,explicitResize:!1,snapshotFallback:!0};class h{async unsubscribe(){}}class i{async ensureSession(a,b){await (0,f.N)(a)||await (0,f.jw)(a,b)}async sessionExists(a){return(0,f.N)(a)}async sendInput(a,b){await (0,f.V1)(a,b)}async sendSpecialKey(a,b){if("Escape"!==b&&"C-c"!==b&&"C-d"!==b&&"C-m"!==b&&"Enter"!==b)throw Error(`Unsupported special key for PollingTmuxTransport: ${b}`);await (0,f.ds)(a,b)}async resize(){throw Error("PollingTmuxTransport does not support explicit resize")}async captureSnapshot(a,b){return(0,f.Xg)(a,b)}async subscribe(){return new h}getCapabilities(){return g}async killSession(a){return(0,f.fY)(a)}}let j=null;var k=c(93997);let l=(0,e.h)("cli-session");function m(){return j||(j=new i),j}function n(a,b,c){let e=d.s.getInstance().getTool(b),f=e.getSessionName(a,c);return{cliTool:e,sessionName:f}}async function o(a,b,c){let{sessionName:d}=n(a,b,c);return m().sessionExists(d)}async function p(a,b,c=1e3,d){let e=l.withContext({worktreeId:a,cliToolId:b});e.debug("captureSessionOutput:start",{requestedLines:c});let{cliTool:f,sessionName:g}=n(a,b,d),h=m();try{let a=await (0,k.aq)(g,c,async()=>{if(!await h.sessionExists(g))throw Error(`${f.name} session ${g} does not exist`);return await h.captureSnapshot(g,{startLine:-k.xE})});return e.debug("captureSessionOutput:success",{actualLines:a.split("\n").length,lastFewLines:a.split("\n").slice(-3).join(" | ")}),a}catch(b){let a=b instanceof Error?b.message:String(b);if(a.includes("does not exist"))throw e.debug("captureSessionOutput:sessionNotFound",{sessionName:g}),b;throw e.error("captureSessionOutput:failed",{error:a}),Error(`Failed to capture ${f.name} output: ${a}`)}}async function q(a,b,c=5e3,d){let e=l.withContext({worktreeId:a,cliToolId:b});e.debug("captureSessionOutputFresh:start",{requestedLines:c});let{cliTool:f,sessionName:g}=n(a,b,d),h=m();try{let a=await h.captureSnapshot(g,{startLine:-c});return a.length>0?(0,k.vF)(g,a,c):(0,k.gm)(g),(0,k.wd)(a,c)}catch(b){(0,k.gm)(g);let a=b instanceof Error?b.message:String(b);throw e.error("captureSessionOutputFresh:failed",{error:a}),Error(`Failed to capture ${f.name} output: ${a}`)}}},34405:(a,b,c)=>{"use strict";c.d(b,{G:()=>e,_:()=>d});let d=1e4,e=1e3},34892:(a,b,c)=>{"use strict";c.d(b,{$:()=>k});var d=c(56791),e=c(31268),f=c(31766),g=c(95595),h=c(18896),i=c(34405),j=c(48083);async function k(a,b,c,k){let l=k??c,m=e.s.getInstance().getTool(c),n=(0,j.CE)(b,c,k);if(!await m.isRunning(b,k))return{isRunning:!1,content:"",lineCount:0,cliToolId:c,sessionStatus:"idle",sessionStatusReason:"session_not_running",lastStopEventAt:n};let o=(0,d.y1O)(a,b,l),p=o?.lastCapturedLine||0,q=await (0,f.Wh)(b,c,i._,k),r=q.split("\n"),s=r.length,t=r.slice(Math.max(0,p)).join("\n"),u=(0,h.v7)(b,c,k),v=(0,h.xU)(u),w=v?new Date(v):void 0,x=(0,g.WC)(q,c,w),y="running"===x.status&&x.reason===g.gv.THINKING_INDICATOR,z=x.hasActivePrompt,A="waiting"===x.status&&g.ug.has(x.reason),B=x.reason===g.gv.CODEX_PAGER,C="running"===x.status&&x.reason===g.gv.DEFAULT||"ready"===x.status&&x.reason===g.gv.NO_RECENT_OUTPUT,D=r.slice(-100).join("\n"),E=(0,h.aq)(b,c,k);return{isRunning:!0,cliToolId:c,sessionStatus:x.status,sessionStatusReason:x.reason,content:t,fullOutput:q,realtimeSnippet:D,lineCount:s,lastCapturedLine:p,isComplete:z,isGenerating:y,thinking:y,thinkingMessage:y?"Claude is thinking...":null,isPromptWaiting:z,promptData:z?x.promptDetection.promptData??null:null,autoYes:{enabled:E?.enabled??!1,expiresAt:E?.enabled?E.expiresAt:null,stopReason:E?.stopReason},isSelectionListActive:A,isPagerActive:B,isUnclassifiedActive:C,lastServerResponseTimestamp:v,serverPollerActive:(0,h.bZ)(u),lastStopEventAt:n}}},39727:()=>{},40236:(a,b,c)=>{"use strict";c.d(b,{FW:()=>l});var d=c(11665),e=c(93997),f=c(26283),g=c(20610);let h=(0,c(72626).h)("cli-tools/submit-verified-sender"),i=/\[Pasted text[\s#]/,j=/^\/[A-Za-z]/,k=/^\s*(?:ctx:\d+%\s*)?[>❯›]/;async function l(a){let{sessionName:b,message:c,cliToolId:l,textInputWaitMs:m=g.pL,submitEnterCount:n=1,interEnterWaitMs:o=g.pL,verifyAttempts:p=4,verifyDelayMs:q=g.x9}=a;await (0,d.V1)(b,c,!1),await new Promise(a=>setTimeout(a,m));for(let a=0;a<Math.max(1,n);a++)await (0,d.KB)(b,["Enter"]),a<n-1&&await new Promise(a=>setTimeout(a,o));let r=Math.max(1,p);for(let a=0;a<r;a++){await new Promise(a=>setTimeout(a,q));let g=function(a,b,c){let d=(0,f.aJ)(a).split("\n").slice(-12),e=d.join("\n");if((0,f.ut)(b,e))return"submitted";let g=function(a){for(let b=a.length-1;b>=0;b--)if(k.test(a[b]))return a[b];return null}(d);if(!g)return"submitted";let h=g.replace(k,"").trim();return 0===h.length?"submitted":i.test(g)||function(a,b){let c=b.split("\n").map(a=>a.trim()).find(a=>a.length>0)??"";return 0!==c.length&&c.startsWith(a)}(h,c)?"pending":j.test(h)?"replaced":"submitted"}(await (0,d.Xg)(b,{startLine:-12}),l,c);if("submitted"===g)return void(0,e.gm)(b);if("replaced"===g){try{await (0,d.Ce)(b)}catch(a){h.error("submit-clear-input-failed",{sessionName:b,cliToolId:l,error:a instanceof Error?a.message:String(a)})}throw(0,e.gm)(b),h.error("submit-replaced-by-tui-completion",{sessionName:b,cliToolId:l,attempt:a}),Error(`Message was replaced by a TUI autocompletion for session ${b}; the input no longer matches the sent text. Cleared the input line without submitting to avoid executing a different command.`)}h.warn("submit-not-confirmed:resending-enter",{sessionName:b,cliToolId:l,attempt:a}),await (0,d.KB)(b,["Enter"])}throw(0,e.gm)(b),h.error("submit-verification-failed",{sessionName:b,cliToolId:l,attempts:r}),Error(`Message submit could not be confirmed for session ${b} after ${r} attempts (typed but unsent)`)}},41364:(a,b,c)=>{"use strict";c.d(b,{Gv:()=>o,hM:()=>n});var d=c(79748),e=c.n(d),f=c(33873),g=c.n(f),h=c(1634),i=c(21684),j=c(72626),k=c(15194);function l(a="claude"){return g().join((0,i.U)(),a)}async function m(a="claude"){let b=l(a);try{await e().access(b)}catch{await e().mkdir(b,{recursive:!0})}}async function n(a,b,c,d="claude"){await m(d);let f=function(a,b="claude"){let c=(0,h.GP)(new Date,"yyyy-MM-dd"),d=`${a}-${c}.md`,e=l(b);return g().join(e,d)}(a,d),i=(0,h.GP)(new Date,"yyyy-MM-dd HH:mm:ss"),j="";try{j=await e().readFile(f,"utf-8")}catch{let b=(0,k.hR)(d)?k.ef[d]:d;j=`# ${b} Conversation Log: ${a}
1
+ exports.id=5959,exports.ids=[1296,5959,9358],exports.modules={60:(a,b,c)=>{"use strict";c.d(b,{Q:()=>f,b:()=>e});var d=c(26283);function e(a){return d.Md.test(a)&&!d.kD.test(a)}function f(a,b,c,d,e,g=!1){if(a=Math.max(0,a),"opencode"===d||"copilot"===d||g){let a=e(b);return a>=0?a+1:0}if("antigravity"===d){let c=e(b);return c>=0?c+1:Math.max(0,a)}if(a>=b||c){let a=e(40);return a>=0?a+1:0}if("codex"===d)return Math.max(0,a);if(a>=b-5){let a=e(50);return a>=0?a+1:Math.max(0,b-40)}return Math.max(0,a)}},2669:(a,b,c)=>{"use strict";c.d(b,{M7:()=>d,Sr:()=>g,mR:()=>h,su:()=>j,wQ:()=>i});let d="SESSION_STARTING",e="SESSION_START_FAILED",f=[d,e];class g extends Error{constructor(a,b,c){super(`${a} did not reach its input prompt within ${Math.round(c/1e3)}s (initialization timeout). The tmux session '${b}' and its process are still running, so this is a slow start, not a failed one — the message was not delivered, but nothing needs repairing. Retry the send in a few seconds, or run \`commandmate capture <worktree-id>\` to see what it is waiting on.`),this.toolName=a,this.sessionName=b,this.timeoutMs=c,this.code=d,this.name="SessionStartTimeoutError"}}class h extends Error{constructor(a,b,c){super(`${a} reported an error while starting in tmux session '${b}': "${c}". Retrying will not help until that is resolved; run \`commandmate capture <worktree-id>\` to see the session output.`),this.toolName=a,this.sessionName=b,this.detectedPattern=c,this.code=e,this.name="SessionStartFailedError"}}function i(a){return k(a)===d}function j(a){let b=k(a);return void 0!==b&&f.includes(b)}function k(a){if("object"!=typeof a||null===a)return;let b=a.code;return"string"==typeof b?b:void 0}},3523:(a,b,c)=>{"use strict";c.d(b,{z$:()=>C,zX:()=>D});var d=c(31766),e=c(88807),f=c(56791),g=c(69297),h=c(25129),i=c(18778),j=c(15194),k=c(8988),l=c(26283),m=c(72626),n=c(46423),o=c(93997),p=c(60),q=c(82450),r=c(56263),s=c(13033),t=c(72457),u=c(71080),v=c(45146),w=c(63865),x=c(2924);let y=(0,m.h)("response-poller");function z(a){return{response:"",isComplete:!1,lineCount:a}}function A(a,b,c,d,e,f,g,h=!1){let i=(0,p.Q)(b,c,d,e,f,h),j=a.slice(i);return{response:(0,l.aJ)(j.join("\n")),isComplete:!0,lineCount:c,promptDetection:g,bufferReset:d,captureWindowSaturated:h}}function B(a,b){let c=(0,l.KO)(b);return(0,h.gF)((0,l._A)((0,l.aJ)(a)),c)}function C(a,b,c,d=o.xE){let e=a.split("\n"),f=e.length;for(;f>0&&""===e[f-1].trim();)f--;let g=e.slice(0,f),h=g.length,i=(0,o.sl)(e.length,d),j="claude"===c?(0,l.GT)(g):-1,k=j>=0?j:h,m=h>0&&b>25&&h+25<b,q=h>0&&b>50&&h<50,r=m||q;if(!r&&h<b-5)return null;let s=Math.max(0,h-20),t=g.slice(s),u="opencode"===c?(0,l.aJ)(g.join("\n")):t.join("\n"),{promptPattern:w,separatorPattern:x,thinkingPattern:y,skipPatterns:D}=(0,l._X)(c),E=(a=60)=>{let b;if("codex"===c)b=/^›\s+(?!Implement|Find and fix|Type|Summarize)/;else if("opencode"===c){let b=0;for(let c=h-1;c>=Math.max(0,h-a);c--){let a=(0,l.aJ)(g[c]);if(l.Md.test(a)&&2==++b)return c}return -1}else b=/^[>❯]\s+\S/;for(let c=k-1;c>=Math.max(0,k-a);c--){let a=(0,l.aJ)(g[c]);if(b.test(a))return c}return -1};if("claude"===c||"codex"===c||"copilot"===c){let a=B(g.join("\n"),c);if(a.isPrompt)return A(g,b,h,r,c,E,a,i)}let F=(0,l.aJ)(u),G=w.test(F),H=x.test(F),I="codex"===c?(0,l.DR)(g,20):y.test(F),J=("codex"===c||"gemini"===c||"vibe-local"===c||"copilot"===c||"antigravity"===c)&&G&&!I,K="claude"===c&&G&&H&&!I,L="opencode"===c&&(0,p.b)(F);if(J||K||L){let a=[],d=(0,p.Q)(b,h,r,c,E,i),e=h;for(let b=d;b<k;b++){let d=g[b],f=(0,l.aJ)(d);if("codex"===c&&/^›\s+/.test(f)||"gemini"===c&&/^(%|\$|.*@.*[%$#])\s*$/.test(f)||"antigravity"===c&&/^>\s*$/.test(f)||"opencode"===c&&(l.sy.test(f)||l.uA.test(f))){e=b;break}D.some(a=>a.test(f))||a.push(d)}let f=a.join("\n").trim(),j=f.split("\n").slice(-n.$).join("\n");if(y.test(j))return z(h);if("claude"===c){let a=(0,l.aJ)(f),b=/[╭╮╰╯│]/.test(a)||/░{3,}/.test(a)||/▓{3,}/.test(a),c=/Claude Code|claude\/|v\d+\.\d+/.test(a),d=/Tip:|for shortcuts|\?\s*for help/.test(a),e=/^\s*\/Users\/.*$/m.test(a)&&a.split("\n").length<30,g=a.match(/^[>❯]\s+(\S.*)$/m);if(g){let b=a.indexOf(g[0]);if(0===a.substring(b+g[0].length).trim().split("\n").filter(a=>{let b=a.trim();return b&&!D.some(a=>a.test(b))&&!/^─+$/.test(b)}).length)return z(h)}else if((b||c||d||e)&&f.length<2e3)return z(h)}if("gemini"===c&&((f.match(/[░███]/g)||[]).length>.3*f.length||v.SI.some(a=>f.includes(a))||!f.includes("✦")&&f.length<10))return z(h);if("opencode"===c){let a=(0,l.aJ)(f);if((a.length<50||!l.Md.test(F))&&0===a.split("\n").filter(a=>{let b=a.trim();return b&&!l.sx.some(a=>a.test(b))}).length)return z(h)}return{response:f,isComplete:!0,lineCount:e,bufferReset:r,captureWindowSaturated:i}}if("opencode"!==c){let a=B(g.join("\n"),c);if(a.isPrompt)return A(g,b,h,r,c,E,a,i)}let M=[],N=r||i||b>=h-5,O=N?E(80):-1,P=N?O>=0?O+1:Math.max(0,h-80):Math.max(0,b);for(let a=P;a<Math.min(h,k);a++){let b=g[a],c=(0,l.aJ)(b);D.some(a=>a.test(c))||M.push(b)}let Q=M.join("\n").trim();return Q?{response:Q,isComplete:!1,lineCount:h}:z(h)}async function D(a,b,c){let h=(0,e.getDbInstance)(),m=c??b;try{let e=(0,f.Uim)(h,a);if(!e)return y.error("worktree-worktreeid-not"),(0,v.Et)(a,b,c),!1;if(!await (0,d.K1)(a,b,c))return y.info("session-not-running"),(0,v.Et)(a,b,c),!1;let p=(0,f.y1O)(h,a,m),z=p?.lastCapturedLine||0,A=await (0,d.Wh)(a,b,o.xE,c);if("opencode"===b||"copilot"===b){let d=(0,v.MN)(a,b,c);(0,s.IZ)(d,A,b)}let D=C(A,z,b,o.xE);if(!D||!D.isComplete){let{thinkingPattern:c}=(0,l._X)(b),d=(0,l.aJ)(A).split("\n").slice(-n.$).join("\n");return c.test(d)&&(0,f.PLg)(h,a,b,m)>0&&y.info("marked-answeredcount-pending"),!1}let E="opencode"===b||"copilot"===b,F=!(0,j.VA)(b)&&!D.captureWindowSaturated;if(F&&!D.bufferReset&&D.lineCount===z&&!p?.inProgressMessageId)return!1;if(F&&!D.bufferReset&&D.lineCount<=z)return y.info("already-saved-up-to-line-lastcapturedlin"),!1;let G=D.promptDetection??B(D.response,b);if(G.isPrompt){let d=G.rawContent||G.cleanContent,i=(0,v.MN)(a,b,c),j=(0,t.zm)(d,b);if((0,t.gv)(i,j))return y.info("duplicate-prompt-skipped",{worktreeId:a,cliToolId:b}),!1;let k=d;"copilot"===b&&(k=(0,q.LH)(d),k=(0,q.Sj)(k,r.Rf,r.ky)),(0,f.YXK)(h,a,b,m);let l=(0,f.oHS)(h,{worktreeId:a,role:"assistant",content:k,messageType:"prompt",promptData:G.promptData,timestamp:new Date,cliToolId:b,instanceId:m});return(0,f.PPx)(h,a,b,D.lineCount,m),(0,g.Lo)("message",{worktreeId:a,message:l}),(0,x.r)(h,a,b,m,"prompt_detected",{promptType:G.promptData?.type}),(0,w.J$)({worktreeId:a,worktreeName:e.name,kind:"prompt",agentName:m,excerpt:G.promptData?.question??k}).catch(()=>{}),E||(0,v.Et)(a,b,c),!0}if(!D.response||""===D.response.trim())return(0,f.PPx)(h,a,b,D.lineCount,m),!1;let H="claude"===b?(0,k.R)(D.response):void 0,I=D.response;if("gemini"===b)I=(0,q.IS)(D.response);else if("claude"===b)I=(0,q.NN)(D.response);else if("copilot"===b){let d=(0,v.MN)(a,b,c),e=(0,s.Uz)(d)||D.response;I=(0,q.LH)(e),I=(0,q.Sj)(I,r.Rf,r.ky),(0,s.q1)(d)}else if("opencode"===b){I=(0,q.aW)(D.response);let d=(0,v.MN)(a,b,c);(0,s.q1)(d)}if(!I||""===I.trim()||"[No content]"===I)return(0,f.PPx)(h,a,b,D.lineCount,m),(0,f.YXK)(h,a,b,m),!1;if(!F){let d=(0,v.MN)(a,b,c);if((0,u.j7)(d,I))return(0,f.PPx)(h,a,b,D.lineCount,m),!1}I&&await (0,i.T)(h,a,I,b),(0,f.PLg)(h,a,b,m)>0&&y.info("marked-answeredcount-pending");let J=(0,f.y1O)(h,a,m);if(F&&J&&D.lineCount<=J.lastCapturedLine)return y.info("race-condition-detected-skipping-save-re"),!1;let K=(0,f.oHS)(h,{worktreeId:a,role:"assistant",content:I,messageType:"normal",timestamp:new Date,cliToolId:b,instanceId:m,summary:H?.summary,logFileName:H?.logFileName,requestId:H?.requestId});return(0,g.Lo)("message",{worktreeId:a,message:K}),(0,w.J$)({worktreeId:a,worktreeName:e.name,kind:"completion",agentName:m,excerpt:I}).catch(()=>{}),(0,f.PPx)(h,a,b,D.lineCount,m),E&&(0,v.Et)(a,b,c),!0}catch(a){return y.error("response:check-failed",{error:a instanceof Error?a.message:String(a)}),!1}}},7015:(a,b,c)=>{"use strict";c.d(b,{Ds:()=>g});var d=c(81719);class e{constructor(a,b=3e4){this.cache=new Map,this.allAppsCache=null,this.lastRefresh=0,this.db=a,this.ttl=b}getTTL(){return this.ttl}isStale(){return Date.now()-this.lastRefresh>this.ttl}async refresh(){let a=(0,d.$i)(this.db);for(let b of(this.cache.clear(),a))this.cache.set(b.pathPrefix,b);this.allAppsCache=a,this.lastRefresh=Date.now()}async getByPathPrefix(a){return this.isStale()&&await this.refresh(),this.cache.get(a)??null}async getAll(){return this.isStale()&&await this.refresh(),this.allAppsCache??[]}invalidate(){this.cache.clear(),this.allAppsCache=null,this.lastRefresh=0}invalidateByIssueNo(a){this.invalidate()}}let f=null;function g(a){if(!f){if(!a)throw Error("Database instance required to initialize cache");f=new e(a)}return f}},8988:(a,b,c)=>{"use strict";c.d(b,{R:()=>g});let d=/📄 Session log: (.+?\/([^\/\s]+\.jsonl))/,e=/Request ID: ([^\s\n]+)/,f=/Summary: (.+?)(?:\n─|$)/s;function g(a){let b={content:a},c=d.exec(a);c&&(b.logFileName=c[2]);let g=e.exec(a);g&&(b.requestId=g[1]);let h=f.exec(a);return h&&(b.summary=h[1].trim()),b}},11508:(a,b,c)=>{"use strict";c.d(b,{H:()=>m,m:()=>n});var d=c(44265),e=c(11665),f=c(40236),g=c(93997),h=c(26283),i=c(72626),j=c(20610);let k=(0,i.h)("cli-tools/gemini");function l(a){return a instanceof Error?a.message:String(a)}let m=200;class n extends d.M{async isRunning(a,b){let c=this.getSessionName(a,b);return await (0,e.N)(c)}async startSession(a,b,c){if(!await this.isInstalled())throw Error("Gemini CLI is not installed or not in PATH");let d=this.getSessionName(a,c);if(await (0,e.N)(d)){await this.reconcileExistingSession(d),k.info("gemini-session-sessionname");return}try{await (0,e.jw)({sessionName:d,workingDirectory:b}),await new Promise(a=>setTimeout(a,j.Uc)),await (0,e.V1)(d,"gemini",!0),await new Promise(a=>setTimeout(a,6e3)),await this.waitForReady(d),k.info("started-gemini-session:sessionname")}catch(b){let a=l(b);throw Error(`Failed to start Gemini session: ${a}`)}}async waitForReady(a){let b=!1;for(let c=0;c<30;c++){try{let c=await (0,e.Xg)(a,m),d=(0,h.aJ)(c);if(h.wN.test(d))return void k.info("gemini-prompt-detected");!b&&d.includes("Do you trust this folder?")&&(await (0,e.ds)(a,"Enter"),b=!0,k.info("auto-trusted-folder-for"))}catch{}await new Promise(a=>setTimeout(a,1e3))}k.info("gemini-prompt-detection")}async waitForPrompt(a){let b=Date.now();for(;Date.now()-b<15e3;){try{let b=await (0,e.Xg)(a,m),c=(0,h.aJ)(b);if(h.wN.test(c))return}catch{}await new Promise(a=>setTimeout(a,500))}k.info("gemini-prompt-not")}async sendMessage(a,b,c){let d=this.getSessionName(a,c);if(!await (0,e.N)(d))throw Error(`Gemini session ${d} does not exist. Start the session first.`);try{await this.waitForPrompt(d),await (0,f.FW)({sessionName:d,message:b,cliToolId:"gemini"}),(0,g.gm)(d),k.info("sent-message-to-gemini-session:sessionna")}catch(b){let a=l(b);throw Error(`Failed to send message to Gemini: ${a}`)}}async killSession(a,b){let c=this.getSessionName(a,b);try{await (0,e.N)(c)&&(await (0,e.ds)(c,"C-c"),await new Promise(a=>setTimeout(a,j.Is)),await (0,e.V1)(c,"/quit",!0),await new Promise(a=>setTimeout(a,j.Zf))),await (0,e.fY)(c)&&k.info("stopped-gemini-session:sessionname")}catch(a){throw k.error("session:stop-failed",{error:l(a)}),a}}constructor(...a){super(...a),this.id="gemini",this.name="Gemini CLI",this.command="gemini"}}},11665:(a,b,c)=>{"use strict";c.d(b,{Ce:()=>w,GW:()=>n,KB:()=>r,N:()=>m,N6:()=>y,Sb:()=>z,V1:()=>p,Xg:()=>s,ds:()=>v,fY:()=>t,jw:()=>o,lA:()=>k,zT:()=>l});var d=c(79646),e=c(28354),f=c(93997),g=c(16983),h=c(72626);let i=(0,e.promisify)(d.execFile),j=(0,h.h)("tmux");function k(a){return`=${a}:`}async function l(a,b={}){let c,d,e,f=b.windowWidth??g.Jn,h=b.windowHeight??g.sO,m=k(a);try{c=(await i("tmux",["show-window-options","-v","-t",m,"window-size"],{timeout:5e3})).stdout.trim();let[a,b]=(await i("tmux",["display-message","-p","-t",m,"#{window_width}|#{window_height}"],{timeout:5e3})).stdout.trim().split("|").map(Number);Number.isFinite(a)&&(d=a),Number.isFinite(b)&&(e=b)}catch{}let n="manual"===c,o=d===f&&e===h;if(n&&o)return!1;try{return n||await i("tmux",["set-window-option","-t",m,"window-size","manual"],{timeout:5e3}),o||await i("tmux",["resize-window","-t",m,"-x",String(f),"-y",String(h)],{timeout:5e3}),!0}catch(b){return j.warn("session-geometry:reconcile-failed",{sessionName:a,error:b instanceof Error?b.message:String(b)}),!1}}async function m(a){try{return await i("tmux",["has-session","-t",k(a)],{timeout:5e3}),!0}catch{return!1}}async function n(){try{let{stdout:a}=await i("tmux",["list-sessions","-F","#{session_name}|#{session_windows}|#{session_attached}"],{timeout:5e3});if(!a||""===a.trim())return[];return a.trim().split("\n").map(a=>{let[b,c,d]=a.split("|");return{name:b,windows:parseInt(c,10)||0,attached:"1"===d}})}catch{return[]}}async function o(a,b){let c,d,e,f,h;"string"==typeof a?(c=a,d=b,e=g.eu,f=g.Jn,h=g.sO):(c=a.sessionName,d=a.workingDirectory,e=a.historyLimit||g.eu,f=a.windowWidth||g.Jn,h=a.windowHeight||g.sO);try{await i("tmux",["new-session","-d","-s",c,"-c",d,"-x",String(f),"-y",String(h)],{timeout:5e3}),await i("tmux",["set-option","-t",k(c),"history-limit",String(e)],{timeout:5e3});try{await i("tmux",["new-window","-k","-t",`${k(c)}0`,"-c",d],{timeout:5e3})}catch(a){j.warn("session-history-limit:window-rebuild-failed",{sessionName:c,historyLimit:e,error:a instanceof Error?a.message:String(a)})}await l(c,{windowWidth:f,windowHeight:h})}catch(b){let a=b instanceof Error?b.message:String(b);throw Error(`Failed to create tmux session: ${a}`)}}async function p(a,b,c=!0){let d=c?["send-keys","-t",k(a),b,"C-m"]:["send-keys","-t",k(a),b];try{await i("tmux",d,{timeout:5e3})}catch(b){let a=b instanceof Error?b.message:String(b);throw Error(`Failed to send keys to tmux session: ${a}`)}}let q=new Set(["Up","Down","Left","Right","Enter","Space","Tab","Escape","BSpace","DC","PageUp","PageDown","Home","End","q"]);async function r(a,b){if(0!==b.length){for(let a of b)if(!q.has(a))throw Error(`Invalid special key: ${a}`);try{for(let c=0;c<b.length;c++)await i("tmux",["send-keys","-t",k(a),b[c]],{timeout:5e3}),c<b.length-1&&await new Promise(a=>setTimeout(a,100))}catch(b){let a=b instanceof Error?b.message:String(b);throw Error(`Failed to send special keys to tmux session: ${a}`)}}}async function s(a,b){let c,d;"number"==typeof b?(c=-b,d="-"):b?(c=b.startLine??-1e4,d=b.endLine??"-"):(c=-1e3,d="-");try{let{stdout:b}=await i("tmux",["capture-pane","-t",k(a),"-p","-e","-S",String(c),"-E",String(d)],{timeout:5e3,maxBuffer:0xa00000});return b}catch(b){let a=b instanceof Error?b.message:String(b);throw Error(`Failed to capture pane: ${a}`)}}async function t(a){try{return await i("tmux",["kill-session","-t",k(a)],{timeout:5e3}),!0}catch(b){let a=b instanceof Error?b.message:String(b);if(a?.includes("no server running")||a?.includes("can't find session"))return!1;throw Error(`Failed to kill tmux session: ${a}`)}}let u=new Set(["Escape","C-c","C-d","C-m","Enter"]);async function v(a,b){if(!u.has(b))throw Error(`Invalid special key: ${b}`);try{await i("tmux",["send-keys","-t",k(a),b],{timeout:5e3})}catch(b){let a=b instanceof Error?b.message:String(b);throw Error(`Failed to send special key: ${a}`)}}async function w(a){try{await i("tmux",["send-keys","-t",k(a),"C-u"],{timeout:5e3})}catch(b){let a=b instanceof Error?b.message:String(b);throw Error(`Failed to clear tmux input line: ${a}`)}}let x=["Up","Down","Left","Right","Enter","Escape","Tab","BTab","PageUp","PageDown","Home","End","q"];function y(a){return x.includes(a)}async function z(a,b){await r(a,b),(0,f.gm)(a)}},13033:(a,b,c)=>{"use strict";c.d(b,{IW:()=>h,IZ:()=>l,K0:()=>g,Uz:()=>m,l1:()=>f,o0:()=>i,q1:()=>n,tb:()=>k,vQ:()=>j});var d=c(26283);let e=new Map;function f(a){return(0,d._A)((0,d.aJ)(a)).replace(/^\u2503\s?/,"").replace(/\s*\u2503$/,"").trim()}function g(a){let b=a.split("\n"),c=[];for(let a of b){let b=f(a);!(!b||d.sx.some(a=>a.test(b)))&&(d.Md.test(b)||c.push(b))}return c}function h(a){return a.replace(/[\u2500-\u257F]/g,"").replace(/\s{2,}/g," ").trim()}function i(a){let b=(0,d.aJ)(a).split("\n"),c=[];for(let a of b){let b=h(a);b&&(d.J7.some(a=>a.test(b))||c.push(b))}return c}function j(a,b){if(0===a.length||0===b.length)return 0;let c=Math.min(a.length,b.length);for(let d=c;d>=1;d--){let c=a.slice(-d),e=b.slice(0,d),f=!0;for(let a=0;a<d;a++)if(c[a]!==e[a]){f=!1;break}if(f)return d}return 0}function k(a){e.set(a,{lines:[],lastFingerprint:[],pollCount:0})}function l(a,b,c="opencode"){let d=e.get(a);if(!d)return;let f="copilot"===c?i(b):g(b);if(0!==f.length){if(d.pollCount++,0===d.lines.length)d.lines=[...f];else{let a=j(d.lastFingerprint,f);if(a>0){let b=f.slice(a);d.lines.push(...b)}else d.lines.push(...f)}d.lastFingerprint=f.slice(-10)}}function m(a){let b=e.get(a);return b&&0!==b.lines.length?b.lines.join("\n"):""}function n(a){e.delete(a)}},18778:(a,b,c)=>{"use strict";c.d(b,{T:()=>g});var d=c(56791),e=c(41364);let f=(0,c(72626).h)("conversation-logger");async function g(a,b,c,h="claude"){let i=(0,d.r8U)(a,b);if(i)try{await (0,e.hM)(b,i.content,c,h)}catch(a){f.error("conversation:log-failed",{error:a instanceof Error?a.message:String(a)})}}},18896:(a,b,c)=>{"use strict";c.d(b,{v7:()=>d.v7,LP:()=>d.LP,pL:()=>d.pL,GE:()=>d.GE,aq:()=>d.aq,kC:()=>d.kC,xU:()=>w,bZ:()=>x,W8:()=>d.W8,W5:()=>D,_i:()=>E,_C:()=>F});var d=c(24455),e=c(31766),f=c(25129),g=c(68901),h=c(56791),i=c(88807),j=c(72626);let k=(0,j.h)("auto-yes-policy"),l=new Map;var m=c(2924),n=c(63869),o=c(31268),p=c(26283),q=c(77093),r=c(93997),s=c(66007);let t=(0,j.h)("auto-yes-poller"),u=globalThis.__autoYesPollerStates??(globalThis.__autoYesPollerStates=new Map);function v(a){return u.get(a)}function w(a){let b=v(a);return b?.lastServerResponseTimestamp??null}function x(a){return u.has(a)}function y(a){let b=v(a);if(b&&(b.consecutiveErrors++,b.currentInterval=(0,d.G)(b.consecutiveErrors),b.consecutiveErrors>=g.ul)){let b=(0,d.Ue)(a),c=(0,d.pL)(a);c&&(0,d.XK)(b,c,"consecutive_errors",(0,d.GE)(a)??void 0),E(a)}}async function z(a,b,c,d){let f=c??g.FW,h=await (0,e.Wh)(a,b,f,d);return(0,p._A)((0,p.aJ)(h))}async function A(a,b,e,j,q,s){let u=(0,d.v7)(a,e,s);try{let y=(0,p.KO)(e),z=(0,f.gF)(j,{...y,...q&&{precomputedLines:q}});if(!z.isPrompt||!z.promptData)return b.lastAnsweredPromptKey=null,b.lastAnsweredAt=null,"no_prompt";let A=(w=z.promptData,`${w.type}:${w.question}`);if(b.lastAnsweredPromptKey===A&&null!==b.lastAnsweredAt&&Date.now()-b.lastAnsweredAt<d.UL)return"duplicate";let B=function(a,b,c){let e=c??b,f=(0,d.v7)(a,b,e),g=Date.now(),j=l.get(f);if(j&&j.expiresAt>g)return j.policy;let m=function(a,b,c){try{let d=(0,h.MHq)((0,i.getDbInstance)(),a,b,c);if(!d)return null;return d.contract.autoYes}catch(d){return k.warn("policy-lookup-failed",{worktreeId:a,cliToolId:b,instanceId:c,error:d instanceof Error?d.message:String(d)}),null}}(a,b,e);return l.size>=200&&function(a){for(let[b,c]of l.entries())c.expiresAt<=a&&l.delete(b)}(g),l.set(f,{policy:m,expiresAt:g+5e3}),m}(a,e,s),C=function(a,b){let c=function(a){if("yes_no"===a.type)return"y";if("multiple_choice"===a.type){let b=a.options.find(a=>a.isDefault)??a.options[0];return!b||b.requiresTextInput?null:b.number.toString()}return null}(a);if(null===c)return{answer:null,suppressedBy:null};let d=function(a,b){if(!b)return null;if("off"===b.mode)return{reason:"mode-off"};let c=function(a,b){if(0===b.length)return{outcome:"no-match"};let c=function(a){let b=[a.question];if(a.instructionText&&b.push(a.instructionText),"multiple_choice"===a.type)for(let c of a.options)b.push(c.label);else b.push(...a.options);return b.map(a=>a.length>2e4?a.slice(0,2e4):a)}(a);for(let a of b){if(a.length>200||!(0,g.P0)(a).valid)return{outcome:"unusable",pattern:a};let b=new RegExp(a);for(let d of c){let c=(0,g.eJ)(b,d);if(null===c)return{outcome:"unusable",pattern:a};if(c)return{outcome:"match",pattern:a}}}return{outcome:"no-match"}}(a,b.denyPatterns);return"match"===c.outcome?{reason:"deny-pattern",pattern:c.pattern}:"unusable"===c.outcome?{reason:"deny-pattern-unusable",pattern:c.pattern}:"safe"===b.mode?"yes_no"===a.type?null:{reason:"type-not-allowed"}:"allow-listed"===b.mode?b.allowPromptTypes.includes(a.type)?null:{reason:"type-not-allowed"}:null}(a,b);return d?{answer:null,suppressedBy:d.reason,pattern:d.pattern}:{answer:c,suppressedBy:null}}(z.promptData,B);C.suppressedBy&&t.warn("poller:auto-yes-suppressed-by-policy",{worktreeId:a,cliToolId:e,instanceId:s,reason:C.suppressedBy,mode:B?.mode??null,pattern:C.pattern,promptType:z.promptData.type});let D=C.answer;if(null===D)return"no_answer";let E=o.s.getInstance().getTool(e).getSessionName(a,s);try{await (0,n.t)({sessionName:E,answer:D,cliToolId:e,promptData:z.promptData})}finally{(0,r.gm)(E)}var w,x=Date.now();let F=v(u);F&&(F.lastServerResponseTimestamp=x);let G=v(u);G&&(G.consecutiveErrors=0,G.currentInterval=d.ps),b.lastAnsweredPromptKey=A,b.lastAnsweredAt=Date.now(),t.info("poller:response-sent",{worktreeId:a,cliToolId:e,instanceId:s}),(0,m.r)((0,i.getDbInstance)(),a,e,s??e,"prompt_answered_auto",{promptType:z.promptData.type});let[{startPolling:H},{broadcastTerminalSnapshotAfterInteraction:I}]=await Promise.all([Promise.resolve().then(c.bind(c,95220)),Promise.resolve().then(c.bind(c,99508))]);return H(a,e,s),I(a,e,s),"responded"}catch{return y(u),t.warn("poller:detect-respond-error",{worktreeId:a,cliToolId:e,instanceId:s}),"error"}}async function B(a,b,c){let e=(0,d.v7)(a,b,c),f=v(e);if("valid"===function(a,b){if(!b)return"stopped";let c=(0,d.Ue)(a),e=(0,d.pL)(a);if(!e)return E(a),"expired";let f=(0,d.GE)(a)??void 0,g=(0,d.aq)(c,e,f);return g?.enabled?"valid":(E(a),"expired")}(e,f)){try{let h=(0,d.aq)(a,b,c),i=h?.stopPattern?g.FW:g.Ke,j=await z(a,b,i,c),k=j.split("\n");if(function(a,b,c){if(b.stopCheckBaselineLength<0)return b.stopCheckBaselineLength=c.length,!1;let e=b.stopCheckBaselineLength;if(c.length>e){let f=c.substring(e);return b.stopCheckBaselineLength=c.length,(0,d.Cs)(a,f,E)}return c.length<e&&(b.stopCheckBaselineLength=c.length),!1}(e,f,j))return;let l=await A(a,f,b,j,k,c);if("responded"===l)return void C(a,b,c,d.ZO);if("no_prompt"===l){let e=k.slice(-d.Re).join("\n");if((0,p.ut)(b,e))return void C(a,b,c,g.QN)}}catch(d){y(e),t.warn("poller:poll-error",{worktreeId:a,cliToolId:b,instanceId:c,error:(0,q.u1)(d)})}C(a,b,c)}}function C(a,b,c,e){let f=v((0,d.v7)(a,b,c));if(!f)return;let g=Math.max(e??f.currentInterval,d.ps);f.timerId=setTimeout(()=>{B(a,b,c)},g)}function D(a,b,c){if(!(0,s.h6)(a))return{started:!1,reason:"invalid worktree ID"};let e=c??b,f=(0,d.aq)(a,b,e);if(!f?.enabled)return{started:!1,reason:"auto-yes not enabled"};let g=(0,d.v7)(a,b,e),h=v(g);if(!h&&u.size>=d.fC)return{started:!1,reason:"max concurrent pollers reached"};if(h&&h.cliToolId===b)return{started:!0,reason:"already_running"};h&&E(g);let i={timerId:null,cliToolId:b,instanceId:e,consecutiveErrors:0,currentInterval:d.ps,lastServerResponseTimestamp:null,lastAnsweredPromptKey:null,lastAnsweredAt:null,stopCheckBaselineLength:-1};return u.set(g,i),l.delete(g),i.timerId=setTimeout(()=>{B(a,b,e)},d.ps),t.info("poller:started",{worktreeId:a,cliToolId:b,instanceId:e}),{started:!0}}function E(a){let b=v(a);b&&(b.timerId&&clearTimeout(b.timerId),u.delete(a),l.delete(a),t.info("poller:stopped",{compositeKey:a}))}function F(a){(0,d._9)(Array.from(u.keys()),a).forEach(a=>E(a))}},20610:(a,b,c)=>{"use strict";c.d(b,{CV:()=>i,Em:()=>l,Is:()=>g,KI:()=>j,PY:()=>k,Uc:()=>d,Zf:()=>h,pL:()=>e,x9:()=>f});let d=100,e=100,f=200,g=300,h=500,i=500,j=2e3,k=200,l=100},21684:(a,b,c)=>{"use strict";c.d(b,{U:()=>g});var d=c(33873),e=c.n(d),f=c(87447);function g(){return(0,f._p)("CM_LOG_DIR")||e().join(process.cwd(),"data","logs")}},25129:(a,b,c)=>{"use strict";c.d(b,{gF:()=>B,xn:()=>v});var d=c(72626),e=c(68652),f=c(26283);let g=/^\s*[\u276F\u25CF\u203A][^\d]*(\d+)(?:\.(?!\d)|\s{2,})\s*(.+)$/,h=/^\s*[^\d]{0,3}(\d+)(?:\.(?!\d)|\s+)\s*(.+)$/,i=/^[-─]+$/,j=/^\s*\[[^\]]*\d+\s+lines?\]/i,k=/^\s*[…]?\s*[+\-↑↓⏵⏷]?\s*\d+\s+(?:pending|more)\b/i,l=/Esc\s+to\s+cancel\s*[·•]\s*Tab\s+to\s+amend/i,m=/Enter\s+to\s+select\b.*\bnavigate\b/i,n=/press\s+(?:enter|number)\s+to\s+confirm/i,o=/press\s+number\s+to\s+confirm/i,p=/(?:select|choose|pick|which|what|how|where|enter|type|specify|confirm|approve|accept|reject|decide|preference|option)/i,q=[/type\s+here/i,/tell\s+(me|claude)/i,/enter\s+/i,/custom/i,/differently/i];function r(a,b){if(0===b.length)return!0;let c=b[0].number;return a<c&&a>=c-2}function s(a){return{isPrompt:!1,cleanContent:a.trim()}}function t(a){return 0!==a.length&&!!(a.includes("?")||a.includes("?")||p.test(a))}function u(a,b){let c=b.endsWith("?")||b.endsWith("?");return!!(!c&&/^\s{2,}[^\d]/.test(a)&&!/^\s*\d+\./.test(a)||!c&&/^\s{4,}/.test(a)&&!/^\s*\d+\.\s/.test(a)||b.length<5&&!c||/^[\/~]/.test(b)||b.length>=2&&/^[a-zA-Z0-9_-]+$/.test(b))}function v(a,b="yes_no"){let c=a.toLowerCase().trim();if("multiple_choice"===b){if(/^\d+$/.test(c))return c;throw Error("Invalid answer for multiple choice prompt. Expected a number.")}if("yes"===c||"y"===c)return"y";if("no"===c||"n"===c)return"n";throw Error("Invalid answer for yes/no prompt. Expected 'yes', 'no', 'y', or 'n'.")}let w=(0,d.h)("prompt-detector"),x=null;function y(a){let b=a.split("\n"),c=(b.length>200?b.slice(-200):b).join("\n");return c.length>5e3&&(c=c.slice(-5e3)),c}let z=[{regex:/^(.+)\s+\(y\/n\)\s*$/m},{regex:/^(.+)\s+\[y\/N\]\s*$/m,defaultOption:"no"},{regex:/^(.+)\s+\[Y\/n\]\s*$/m,defaultOption:"yes"},{regex:/^(.+)\s+\(yes\/no\)\s*$/m}];function A(a,b,c,d){return{isPrompt:!0,promptData:{type:"yes_no",question:a,options:["yes","no"],status:"pending",...void 0!==d&&{defaultOption:d},instructionText:c},cleanContent:b,rawContent:c}}function B(a,b){let c=(0,e.N)(a),d=c===a&&b?.precomputedLines?b.precomputedLines:c.split("\n"),p=d.slice(-50).join("\n"),v=p===x;v||w.debug("detectPrompt:start",{outputLength:c.length}),x=p;let B=d.slice(-20).join("\n"),C=function(a,b,c){var d,p;a=(0,e.N)(a);let v=b?.requireDefaultIndicator??!0,w=a.split("\n"),x=w.length;for(;x>0&&""===w[x-1].trim();)x--;let y=Math.max(0,x-50),z=!1;for(let a=x-1;a>=y;a--){let b=m.test(w[a]);if(l.test(w[a])||b){x=a,z=b;break}}let A=w.slice(y,x);for(let b of A)if(f.l8.test(b))return s(a);let B=!1,C=!1;for(let a of A){let b=a.trim();if(!B&&n.test(b)){B=!0,o.test(b)&&(C=!0);break}}if(v){let b=!1;for(let a of A){let c=a.trim();if(g.test(c)){b=!0;break}}if(!b&&!B)return s(a)}let D=[],E=-1,F=0;for(let b=x-1;b>=y;b--){let c=w[b].trim();if(j.test(c)||k.test(c)){F++;continue}let d=c.match(g);if(d){let a=parseInt(d[1],10);if(a<=20&&r(a,D)){let b=d[2].trim();D.unshift({number:a,label:b,isDefault:!0}),F=0;continue}}let e=c.match(h);if(e){let a=parseInt(e[1],10);if(a>20);else if(r(a,D)){let b=e[2].trim();D.unshift({number:a,label:b,isDefault:!1}),F=0;continue}}if(0===D.length&&(c.startsWith("❯")||c.startsWith("●")||c.startsWith("›")))return s(a);if(D.length>0&&c&&!i.test(c)){let a=w[b];if(/^\s{4,}/.test(a)&&u(a,c)){if(++F>25){E=b;break}continue}if(t(c)){E=b;break}if(u(a,c)){if(++F>(/^\s{4,}/.test(a)?25:5)){E=b;break}continue}E=b;break}}if(!function(a){if(0===a.length||1!==a[0])return!1;let b=0;for(let c=1;c<a.length;c++){let d=a[c]-a[c-1];if(d<1||d>2||(2===d&&b++,b>1))return!1}return!0}(D.map(a=>a.number)))return s(a);let G=D.some(a=>a.isDefault),H=v&&B;if(D.length<2||v&&!G&&!H||!v&&!G&&(-1===E||!t(w[E]?.trim()??"")&&!function(a,b,c,d){let e=Math.max(d,b-3);for(let c=b-1;c>=e;c--){let b=a[c]?.trim()??"";if(!(!b||i.test(b))&&t(b))return!0}return!1}(w,E,0,y)))return s(a);let I=function(a,b){if(b<0)return"Please select an option:";let c=[];for(let d=Math.max(0,b-5);d<=b;d++){let b=a[d].trim();b&&!i.test(b)&&c.push(b)}return c.join(" ")}(w,E),J=function(a,b,c){if(b<0)return;let d=Math.max(0,b-19),e=a.slice(d,c).map(a=>a.trimEnd()).join("\n").trim();return e.length>0?e:void 0}(w,E,x),K=B?C?"answer_only":"answer_then_enter":void 0;return d=a,p=z,{isPrompt:!0,promptData:{type:"multiple_choice",question:I.trim(),options:D.map(a=>{let b=q.some(b=>b.test(a.label));return{number:a.number,label:a.label,isDefault:a.isDefault,requiresTextInput:b}}),status:"pending",instructionText:J,...K?{submitMode:K}:{},...p?{isAskUserQuestion:!0}:{}},cleanContent:I.trim(),rawContent:c(d.trim())}}(c,b,y);if(C.isPrompt)return v||w.info("detectPrompt:multipleChoice",{isPrompt:!0,question:C.promptData?.question,optionsCount:C.promptData?.options?.length}),C;let D=B.trim();for(let a of z){let b=B.match(a.regex);if(b){let c=b[1].trim();return A(c,c,D,a.defaultOption)}}let E=B.match(/^(.*?)Approve\?\s*$/m);if(E){let a=E[1].trim();return A(a?`${a} Approve?`:"Approve?",a||"Approve?",D)}return v||w.debug("detectPrompt:complete",{isPrompt:!1}),{isPrompt:!1,cleanContent:c.trim()}}},25754:(a,b,c)=>{"use strict";c.d(b,{Xn:()=>e,d9:()=>g,gB:()=>f,rv:()=>h});let d=["en","ja"],e="en",f="locale";function g(a){return"string"==typeof a&&d.includes(a)}function h(a,b){return g(a)?a:d.find(a=>(b??"").includes(a))??e}},26838:(a,b,c)=>{"use strict";c.d(b,{Mj:()=>k,Sw:()=>j,lX:()=>l});var d=c(29021),e=c(33873),f=c(90164);let g=/^v?\d+\.\d+\.\d+$/,h=/^[a-zA-Z0-9.\-\s_v]+$/,i=globalThis.__versionCheckCache??(globalThis.__versionCheckCache={result:null,fetchedAt:0,rateLimitResetAt:null});function j(){return function(){try{let a=(0,d.readFileSync)((0,e.join)(process.cwd(),"package.json"),"utf-8"),b=JSON.parse(a);if("commandmate"===b.name&&"string"==typeof b.version&&b.version.length>0)return b.version;return null}catch{return null}}()??"0.20.0"}function k(){return j()}async function l(){try{var a,b,c;if(null!==i.result&&Date.now()-i.fetchedAt<36e5||i.rateLimitResetAt&&(!(Date.now()>=i.rateLimitResetAt)||(i.rateLimitResetAt=null,0)))return i.result;let d=await fetch("https://api.github.com/repos/Kewton/CommandMate/releases/latest",{headers:{Accept:"application/vnd.github+json","User-Agent":`CommandMate/${k()}`},cache:"no-store",signal:AbortSignal.timeout(5e3)});if(403===d.status)return function(a){let b=a.headers.get("X-RateLimit-Reset");b?i.rateLimitResetAt=1e3*parseInt(b,10):i.rateLimitResetAt=Date.now()+36e5}(d),i.result;if(!d.ok)return i.result;let e=await d.json(),j=k(),l=e.tag_name.replace(/^v/,""),m={hasUpdate:function(a,b){if(!g.test(a)||!g.test(b))return!1;let c=a=>a.replace(/^v/,"").split(".").map(Number),[d,e,f]=c(a),[h,i,j]=c(b);return h!==d?h>d:i!==e?i>e:j>f}(j,e.tag_name),currentVersion:j,latestVersion:l,releaseUrl:(a=e.html_url).startsWith(f.Dk)?a:null,releaseName:(b=e.name,c=e.tag_name,h.test(b)&&b.length<=128?b:c),publishedAt:e.published_at};return i.result=m,i.fetchedAt=Date.now(),m}catch{return i.result}}},30618:(a,b,c)=>{"use strict";c.d(b,{xT:()=>w,Ui:()=>x});var d=c(44265),e=c(11665),f=c(40236),g=c(93997),h=c(29021),i=c(33873),j=c(72626);let k=(0,j.h)("cli-tools/opencode-config"),l=/^[a-zA-Z0-9._:/-]{1,100}$/,m=/^[a-zA-Z0-9._:/@-]{1,200}$/;async function n(){let a={};try{let b=new AbortController,c=setTimeout(()=>b.abort(),3e3),d=await fetch("http://localhost:11434/api/tags",{signal:b.signal}).finally(()=>{clearTimeout(c)});if(!d.ok)return k.warn("ollama-api-returned"),{};let e=await d.text();if(e.length>1048576)return k.warn("ollama-api-response"),{};let f=JSON.parse(e);if(!f||!Array.isArray(f.models))return k.warn("invalid-ollama-api"),{};for(let b of f.models.slice(0,100))"string"==typeof b?.name&&l.test(b.name)&&(a[b.name]={name:function(a){let b=String(a.name),c=a.details;if(!c)return b;let d=[b];return"string"==typeof c.parameter_size&&/^[\d.]+[BKMGT]?B?$/i.test(c.parameter_size)&&d.push(c.parameter_size),"string"==typeof c.quantization_level&&/^[A-Z0-9_]{1,20}$/i.test(c.quantization_level)&&d.push(c.quantization_level),d.length>1?`${b} (${d.slice(1).join(", ")})`:b}(b)})}catch(a){a instanceof Error&&"AbortError"===a.name?k.warn("ollama-api-timeout"):k.warn("failed-to-fetch")}return a}async function o(){let a={};try{let b=new AbortController,c=setTimeout(()=>b.abort(),3e3),d=await fetch("http://localhost:1234/v1/models",{signal:b.signal}).finally(()=>{clearTimeout(c)});if(!d.ok)return k.warn("lm-studio-api"),{};let e=await d.text();if(e.length>1048576)return k.warn("lm-studio-api"),{};let f=JSON.parse(e);if(!f||!Array.isArray(f.data))return k.warn("invalid-lm-studio"),{};for(let b of f.data.slice(0,100))"string"==typeof b?.id&&m.test(b.id)&&(a[b.id]={name:b.id})}catch(a){a instanceof Error&&"AbortError"===a.name?k.warn("lm-studio-api"):k.warn("failed-to-fetch")}return a}async function p(a){let b=function(a){let b=i.resolve(a);try{if(!h.lstatSync(b).isDirectory())throw Error(`Path is not a directory: ${b}`)}catch(a){if("ENOENT"===a.code)throw Error(`Path does not exist: ${b}`);throw a}return h.realpathSync(b)}(a),c=i.join(b,"opencode.json");if(h.existsSync(c))return;let[d,e]=await Promise.all([n(),o()]),f={};if(Object.keys(d).length>0&&(f.ollama={npm:"@ai-sdk/openai-compatible",name:"Ollama (local)",options:{baseURL:"http://localhost:11434/v1"},models:d}),Object.keys(e).length>0&&(f.lmstudio={npm:"@ai-sdk/openai-compatible",name:"LM Studio (local)",options:{baseURL:"http://localhost:1234/v1"},models:e}),0!==Object.keys(f).length)try{h.writeFileSync(c,JSON.stringify({$schema:"https://opencode.ai/config.json",provider:f},null,2),{encoding:"utf-8",flag:"wx"})}catch(a){if("EEXIST"===a.code)return;k.warn("failed-to-write-opencodejson:error-insta")}}var q=c(79646),r=c(28354),s=c(20610);let t=(0,j.h)("cli-tools/opencode"),u=(0,r.promisify)(q.execFile);function v(a){return a instanceof Error?a.message:String(a)}let w=200;class x extends d.M{async isRunning(a,b){let c=this.getSessionName(a,b);return await (0,e.N)(c)}async startSession(a,b,c){if(!await this.isInstalled())throw Error("OpenCode is not installed or not in PATH");let d=this.getSessionName(a,c);if(await (0,e.N)(d)){await this.reconcileExistingSession(d,{windowWidth:80,windowHeight:w}),t.info("opencode-session-sessionname");return}try{await p(b),await (0,e.jw)({sessionName:d,workingDirectory:b}),await new Promise(a=>setTimeout(a,s.Uc));try{await u("tmux",["resize-window","-t",(0,e.lA)(d),"-x","80","-y",String(w)])}catch{}await (0,e.V1)(d,"opencode",!0),await new Promise(a=>setTimeout(a,15e3)),t.info("started-opencode-session:sessionname")}catch(b){let a=v(b);throw Error(`Failed to start OpenCode session: ${a}`)}}async sendMessage(a,b,c){let d=this.getSessionName(a,c);if(!await (0,e.N)(d))throw Error(`OpenCode session ${d} does not exist. Start the session first.`);try{await (0,f.FW)({sessionName:d,message:b,cliToolId:"opencode"}),(0,g.gm)(d),t.info("sent-message-to-opencode-session:session")}catch(b){let a=v(b);throw Error(`Failed to send message to OpenCode: ${a}`)}}async killSession(a,b){let c=this.getSessionName(a,b);try{await (0,e.N)(c)?(await (0,e.V1)(c,"/exit",!0),await new Promise(a=>setTimeout(a,s.KI)),await (0,e.N)(c)&&await (0,e.fY)(c)):await (0,e.fY)(c),(0,g.gm)(c),t.info("stopped-opencode-session:sessionname")}catch(a){throw t.error("session:stop-failed",{error:v(a)}),a}}constructor(...a){super(...a),this.id="opencode",this.name="OpenCode",this.command="opencode"}}},31268:(a,b,c)=>{"use strict";c.d(b,{s:()=>K});var d=c(44265),e=c(57905);class f extends d.M{async isInstalled(){return await (0,e.zw)()}async isRunning(a,b){return await (0,e.Yq)(a,b)}async startSession(a,b,c){await (0,e.R7)({worktreeId:a,worktreePath:b,instanceId:c})}async sendMessage(a,b,c){await (0,e.pU)(a,b,c)}supportsImage(){return!0}async sendMessageWithImage(a,b,c,d){let e=`
2
+ ![](${c})`,f=b?`${b}${e}`:e;await this.sendMessage(a,f,d)}async killSession(a,b){await (0,e.VU)(a,b)}constructor(...a){super(...a),this.id="claude",this.name="Claude Code",this.command="claude"}}var g=c(11665),h=c(40236),i=c(93997),j=c(26283),k=c(72626),l=c(20610);let m=(0,k.h)("cli-tools/codex");function n(a){return a instanceof Error?a.message:String(a)}class o extends d.M{async isRunning(a,b){let c=this.getSessionName(a,b);return await (0,g.N)(c)}async startSession(a,b,c){if(!await this.isInstalled())throw Error("Codex CLI is not installed or not in PATH");let d=this.getSessionName(a,c);if(await (0,g.N)(d)){await this.reconcileExistingSession(d),m.info("codex-session-sessionname");return}try{await (0,g.jw)({sessionName:d,workingDirectory:b}),await new Promise(a=>setTimeout(a,l.Uc)),await (0,g.V1)(d,"codex",!0),await new Promise(a=>setTimeout(a,3e3)),await this.waitForReady(d),m.info("started-codex-session:sessionname")}catch(b){let a=n(b);throw Error(`Failed to start Codex session: ${a}`)}}async waitForReady(a){let b=!1,c=!1;for(let d=0;d<30;d++){try{let d=await (0,g.Xg)(a,50),e=(0,j.aJ)(d);if((0,j.zZ)(e))return void m.info("codex-prompt-detected");let f=(0,j.Qh)(e);if("update"===f&&!b){await (0,g.V1)(a,"2",!1),b=!0,m.info("skipped-codex-update"),await new Promise(a=>setTimeout(a,l.CV));continue}if("press-enter"===f){await (0,g.ds)(a,"Enter"),m.info("dismissed-codex-notification"),await new Promise(a=>setTimeout(a,l.CV));continue}if("trust"===f&&!c){await (0,g.V1)(a,"1",!1),c=!0,m.info("auto-trusted-folder-for"),await new Promise(a=>setTimeout(a,l.CV));continue}}catch{}await new Promise(a=>setTimeout(a,1e3))}m.info("codex-prompt-detection")}async waitForPrompt(a){let b=Date.now();for(;Date.now()-b<15e3;){try{let b=await (0,g.Xg)(a,50),c=(0,j.aJ)(b);if((0,j.zZ)(c))return}catch{}await new Promise(a=>setTimeout(a,500))}throw m.info("codex-prompt-not"),Error("Codex prompt not ready: timed out waiting for the input prompt before sending")}async sendMessage(a,b,c){let d=this.getSessionName(a,c);if(!await (0,g.N)(d))throw Error(`Codex session ${d} does not exist. Start the session first.`);try{await this.waitForPrompt(d),await (0,h.FW)({sessionName:d,message:b,cliToolId:"codex"}),(0,i.gm)(d),m.info("sent-message-to-codex-session:sessionnam")}catch(b){let a=n(b);throw Error(`Failed to send message to Codex: ${a}`)}}async killSession(a,b){let c=this.getSessionName(a,b);try{await (0,g.N)(c)&&(await (0,g.ds)(c,"C-d"),await new Promise(a=>setTimeout(a,l.Zf))),await (0,g.fY)(c)&&m.info("stopped-codex-session:sessionname")}catch(a){throw m.error("session:stop-failed",{error:n(a)}),a}}constructor(...a){super(...a),this.id="codex",this.name="Codex CLI",this.command="codex"}}var p=c(11508),q=c(15194),r=c(88807),s=c(56791);let t=(0,k.h)("cli-tools/vibe-local");function u(a){return a instanceof Error?a.message:String(a)}class v extends d.M{async isRunning(a,b){let c=this.getSessionName(a,b);return await (0,g.N)(c)}async startSession(a,b,c){if(!await this.isInstalled())throw Error("vibe-local is not installed or not in PATH");let d=this.getSessionName(a,c);if(await (0,g.N)(d)){await this.reconcileExistingSession(d),t.info("vibe-local-session");return}try{await (0,g.jw)({sessionName:d,workingDirectory:b}),await new Promise(a=>setTimeout(a,l.Uc));let c="vibe-local -y";try{let b=(0,r.getDbInstance)(),d=(0,s.Uim)(b,a);d?.vibeLocalModel&&q.QP.test(d.vibeLocalModel)&&(c+=` -m ${d.vibeLocalModel}`);let e=d?.vibeLocalContextWindow;(0,q.FV)(e)&&(c+=` --context-window ${Number(e)}`)}catch{}await (0,g.V1)(d,c,!0),await new Promise(a=>setTimeout(a,5e3)),t.info("started-vibe-local-session:sessionname")}catch(b){let a=u(b);throw Error(`Failed to start Vibe Local session: ${a}`)}}async sendMessage(a,b,c){let d=this.getSessionName(a,c);if(!await (0,g.N)(d))throw Error(`Vibe Local session ${d} does not exist. Start the session first.`);try{await (0,h.FW)({sessionName:d,message:b,cliToolId:"vibe-local",submitEnterCount:2,interEnterWaitMs:l.PY}),(0,i.gm)(d),t.info("sent-message-to-vibe-local-session:sessi")}catch(b){let a=u(b);throw Error(`Failed to send message to Vibe Local: ${a}`)}}async killSession(a,b){let c=this.getSessionName(a,b);try{await (0,g.N)(c)&&(await (0,g.ds)(c,"C-c"),await new Promise(a=>setTimeout(a,l.Is)),await (0,g.ds)(c,"C-c"),await new Promise(a=>setTimeout(a,l.Zf))),await (0,g.fY)(c)&&t.info("stopped-vibe-local-session:sessionname")}catch(a){throw t.error("session:stop-failed",{error:u(a)}),a}}constructor(...a){super(...a),this.id="vibe-local",this.name="Vibe Local",this.command="vibe-local"}}var w=c(30618),x=c(79646),y=c(56263),z=c(77093);let A=(0,k.h)("cli-tools/copilot"),B=new Set(["model","agent","theme"]);class C extends d.M{async isInstalled(){try{return await new Promise((a,b)=>{(0,x.execFile)("gh",["--version"],{timeout:5e3},c=>{c?b(c):a()})}),await new Promise((a,b)=>{(0,x.execFile)("gh",["copilot","--help"],{timeout:5e3},c=>{c?b(c):a()})}),!0}catch{return!1}}async isRunning(a,b){let c=this.getSessionName(a,b);return await (0,g.N)(c)}async startSession(a,b,c){if(!await this.isInstalled())throw Error("GitHub Copilot CLI is not installed. Install with: gh extension install github/gh-copilot");let d=this.getSessionName(a,c);if(await (0,g.N)(d)){await this.reconcileExistingSession(d),A.info("copilot-session-exists");return}try{await (0,g.jw)({sessionName:d,workingDirectory:b}),await new Promise(a=>setTimeout(a,l.Uc)),await (0,g.V1)(d,"gh copilot",!0),await new Promise(a=>setTimeout(a,4e3)),await this.waitForReady(d),A.info("started-copilot-session")}catch(b){let a=(0,z.u1)(b);throw Error(`Failed to start Copilot session: ${a}`)}}async waitForReady(a){for(let b=0;b<30;b++){try{let b=await (0,g.Xg)(a,50),c=(0,j.aJ)(b);if(j.Du.test(c))return void A.info("copilot-prompt-detected")}catch{}await new Promise(a=>setTimeout(a,1e3))}A.info("copilot-prompt-detection-timeout")}async waitForPrompt(a,b=15e3){let c=Date.now();for(;Date.now()-c<b;){try{let b=await (0,g.Xg)(a,50),c=(0,j.aJ)(b);if(j.Du.test(c))return}catch{}await new Promise(a=>setTimeout(a,500))}A.info("copilot-prompt-not-detected")}extractSlashCommand(a){let b=a.trim();if(!b.startsWith("/"))return null;let c=b.match(/^\/(\S+)/);return c?c[1]:null}async waitForSelectionList(a){let b=Date.now();for(;Date.now()-b<5e3;){await new Promise(a=>setTimeout(a,300));try{let b=await (0,g.Xg)(a,50),c=(0,j.aJ)(b);if(j.Mi.test(c))return A.info("copilot-selection-list-detected"),!0}catch{}}return A.info("copilot-selection-list-not-detected-timeout"),!1}async sendMessage(a,b,c){let d=this.getSessionName(a,c);if(!await (0,g.N)(d))throw Error(`Copilot session ${d} does not exist. Start the session first.`);try{await this.waitForPrompt(d);let a=this.extractSlashCommand(b);if(a&&B.has(a)){await (0,g.V1)(d,b,!0),await this.waitForSelectionList(d),(0,i.gm)(d),A.info("sent-selection-list-command-to-copilot",{command:a});return}await (0,h.FW)({sessionName:d,message:b,cliToolId:"copilot",textInputWaitMs:y.L1,verifyDelayMs:y.wp}),(0,i.gm)(d),A.info("sent-message-to-copilot-session")}catch(b){let a=(0,z.u1)(b);throw Error(`Failed to send message to Copilot: ${a}`)}}async sendModelCommand(a,b,c){let d=this.getSessionName(a,c);if(!await (0,g.N)(d))throw Error(`Copilot session ${d} does not exist. Start the session first.`);try{await (0,g.V1)(d,`/model ${b}`,!0),await this.waitForSelectionList(d)&&await (0,g.ds)(d,"C-m"),await this.waitForPrompt(d,y.pL),(0,i.gm)(d),A.info("copilot-model-switched",{model:b})}catch(c){let a=(0,z.u1)(c);throw Error(`Failed to switch Copilot model to ${b}: ${a}`)}}async killSession(a,b){let c=this.getSessionName(a,b);try{await (0,g.N)(c)&&(await (0,g.ds)(c,"C-c"),await new Promise(a=>setTimeout(a,l.Is)),await (0,g.V1)(c,"exit",!0),await new Promise(a=>setTimeout(a,l.Zf))),await (0,g.fY)(c)&&A.info("stopped-copilot-session")}catch(a){throw A.error("session:stop-failed",{error:(0,z.u1)(a)}),a}}constructor(...a){super(...a),this.id="copilot",this.name="Copilot",this.command="gh"}}let D=(0,k.h)("cli-tools/antigravity");function E(a){return a instanceof Error?a.message:String(a)}let F=/\?\s+for\s+shortcuts/,G=/Do you trust the contents of this project\?/;function H(a){return F.test(a)&&!G.test(a)}class I extends d.M{async isRunning(a,b){let c=this.getSessionName(a,b);return await (0,g.N)(c)}async startSession(a,b,c,d){if(!await this.isInstalled())throw Error("Antigravity CLI (agy) is not installed or not in PATH");let e=this.getSessionName(a,c);if(await (0,g.N)(e)){await this.reconcileExistingSession(e),D.info("antigravity-session-exists");return}try{await (0,g.jw)({sessionName:e,workingDirectory:b}),await new Promise(a=>setTimeout(a,l.Uc));let a=d?`agy --model '${d.replace(/'/g,"'\\''")}'`:"agy";await (0,g.V1)(e,a,!0),await new Promise(a=>setTimeout(a,3e3)),await this.waitForReady(e),D.info("started-antigravity-session")}catch(b){let a=E(b);throw Error(`Failed to start Antigravity session: ${a}`)}}async waitForReady(a){let b=!1;for(let c=0;c<30;c++){try{let c=await (0,g.Xg)(a,50),d=(0,j.aJ)(c);if(H(d))return void D.info("antigravity-prompt-detected");if(!b&&G.test(d)){await (0,g.ds)(a,"Enter"),b=!0,D.info("auto-trusted-folder-for-antigravity"),await new Promise(a=>setTimeout(a,500));continue}}catch{}await new Promise(a=>setTimeout(a,1e3))}D.info("antigravity-prompt-detection-timeout")}async waitForPrompt(a){let b=Date.now();for(;Date.now()-b<15e3;){try{let b=await (0,g.Xg)(a,50),c=(0,j.aJ)(b);if(H(c))return}catch{}await new Promise(a=>setTimeout(a,500))}throw D.info("antigravity-prompt-not-ready"),Error("Antigravity prompt not ready: timed out waiting for the input prompt before sending")}async sendMessage(a,b,c){let d=this.getSessionName(a,c);if(!await (0,g.N)(d))throw Error(`Antigravity session ${d} does not exist. Start the session first.`);try{await this.waitForPrompt(d),await (0,h.FW)({sessionName:d,message:b,cliToolId:"antigravity"}),(0,i.gm)(d),D.info("sent-message-to-antigravity-session")}catch(b){let a=E(b);throw Error(`Failed to send message to Antigravity: ${a}`)}}async killSession(a,b){let c=this.getSessionName(a,b);try{await (0,g.N)(c)&&(await (0,g.ds)(c,"C-d"),await new Promise(a=>setTimeout(a,l.Zf)));let a=await (0,g.fY)(c);(0,i.gm)(c),a&&D.info("stopped-antigravity-session")}catch(a){throw D.error("session:stop-failed",{error:E(a)}),a}}constructor(...a){super(...a),this.id="antigravity",this.name="Antigravity CLI",this.command="agy"}}var J=c(95220);class K{constructor(){this.tools=new Map,this.tools.set("claude",new f),this.tools.set("codex",new o),this.tools.set("gemini",new p.m),this.tools.set("vibe-local",new v),this.tools.set("opencode",new w.Ui),this.tools.set("copilot",new C),this.tools.set("antigravity",new I)}static getInstance(){return K.instance||(K.instance=new K),K.instance}getTool(a){let b=this.tools.get(a);if(!b)throw Error(`CLI tool '${a}' not found`);return b}getAllTools(){return Array.from(this.tools.values())}async getToolInfo(a){let b=this.getTool(a),c=await b.isInstalled();return{id:b.id,name:b.name,command:b.command,installed:c}}async getAllToolsInfo(){return Promise.all(this.getAllTools().map(async a=>{let b=await a.isInstalled();return{id:a.id,name:a.name,command:a.command,installed:b}}))}async getInstalledTools(){return(await this.getAllToolsInfo()).filter(a=>a.installed)}stopPollers(a,b,c){(0,J.stopPolling)(a,b,c)}}},31766:(a,b,c)=>{"use strict";c.d(b,{Wh:()=>p,WD:()=>q,K1:()=>o});var d=c(31268),e=c(72626),f=c(11665);let g={streamingOutput:!1,explicitResize:!1,snapshotFallback:!0};class h{async unsubscribe(){}}class i{async ensureSession(a,b){await (0,f.N)(a)||await (0,f.jw)(a,b)}async sessionExists(a){return(0,f.N)(a)}async sendInput(a,b){await (0,f.V1)(a,b)}async sendSpecialKey(a,b){if("Escape"!==b&&"C-c"!==b&&"C-d"!==b&&"C-m"!==b&&"Enter"!==b)throw Error(`Unsupported special key for PollingTmuxTransport: ${b}`);await (0,f.ds)(a,b)}async resize(){throw Error("PollingTmuxTransport does not support explicit resize")}async captureSnapshot(a,b){return(0,f.Xg)(a,b)}async subscribe(){return new h}getCapabilities(){return g}async killSession(a){return(0,f.fY)(a)}}let j=null;var k=c(93997);let l=(0,e.h)("cli-session");function m(){return j||(j=new i),j}function n(a,b,c){let e=d.s.getInstance().getTool(b),f=e.getSessionName(a,c);return{cliTool:e,sessionName:f}}async function o(a,b,c){let{sessionName:d}=n(a,b,c);return m().sessionExists(d)}async function p(a,b,c=1e3,d){let e=l.withContext({worktreeId:a,cliToolId:b});e.debug("captureSessionOutput:start",{requestedLines:c});let{cliTool:f,sessionName:g}=n(a,b,d),h=m();try{let a=await (0,k.aq)(g,c,async()=>{if(!await h.sessionExists(g))throw Error(`${f.name} session ${g} does not exist`);return await h.captureSnapshot(g,{startLine:-k.xE})});return e.debug("captureSessionOutput:success",{actualLines:a.split("\n").length,lastFewLines:a.split("\n").slice(-3).join(" | ")}),a}catch(b){let a=b instanceof Error?b.message:String(b);if(a.includes("does not exist"))throw e.debug("captureSessionOutput:sessionNotFound",{sessionName:g}),b;throw e.error("captureSessionOutput:failed",{error:a}),Error(`Failed to capture ${f.name} output: ${a}`)}}async function q(a,b,c=5e3,d){let e=l.withContext({worktreeId:a,cliToolId:b});e.debug("captureSessionOutputFresh:start",{requestedLines:c});let{cliTool:f,sessionName:g}=n(a,b,d),h=m();try{let a=await h.captureSnapshot(g,{startLine:-c});return a.length>0?(0,k.vF)(g,a,c):(0,k.gm)(g),(0,k.wd)(a,c)}catch(b){(0,k.gm)(g);let a=b instanceof Error?b.message:String(b);throw e.error("captureSessionOutputFresh:failed",{error:a}),Error(`Failed to capture ${f.name} output: ${a}`)}}},34405:(a,b,c)=>{"use strict";c.d(b,{G:()=>e,_:()=>d});let d=1e4,e=1e3},34892:(a,b,c)=>{"use strict";c.d(b,{$:()=>l});var d=c(56791),e=c(31268),f=c(31766),g=c(95595),h=c(18896),i=c(34405),j=c(93997),k=c(48083);async function l(a,b,c,l){let m=l??c,n=e.s.getInstance().getTool(c),o=(0,k.CE)(b,c,l);if(!await n.isRunning(b,l))return{isRunning:!1,content:"",lineCount:0,cliToolId:c,sessionStatus:"idle",sessionStatusReason:"session_not_running",lastStopEventAt:o};let p=(0,d.y1O)(a,b,m),q=p?.lastCapturedLine||0,r=await (0,f.Wh)(b,c,i._,l),s=r.split("\n"),t=s.length,u=((0,j.sl)(t,Math.min(i._,j.xE))?s:s.slice(Math.max(0,q))).join("\n"),v=(0,h.v7)(b,c,l),w=(0,h.xU)(v),x=w?new Date(w):void 0,y=(0,g.WC)(r,c,x),z="running"===y.status&&y.reason===g.gv.THINKING_INDICATOR,A=y.hasActivePrompt,B="waiting"===y.status&&g.ug.has(y.reason),C=y.reason===g.gv.CODEX_PAGER,D="running"===y.status&&y.reason===g.gv.DEFAULT||"ready"===y.status&&y.reason===g.gv.NO_RECENT_OUTPUT,E=s.slice(-100).join("\n"),F=(0,h.aq)(b,c,l);return{isRunning:!0,cliToolId:c,sessionStatus:y.status,sessionStatusReason:y.reason,content:u,fullOutput:r,realtimeSnippet:E,lineCount:t,lastCapturedLine:q,isComplete:A,isGenerating:z,thinking:z,thinkingMessage:z?"Claude is thinking...":null,isPromptWaiting:A,promptData:A?y.promptDetection.promptData??null:null,autoYes:{enabled:F?.enabled??!1,expiresAt:F?.enabled?F.expiresAt:null,stopReason:F?.stopReason},isSelectionListActive:B,isPagerActive:C,isUnclassifiedActive:D,lastServerResponseTimestamp:w,serverPollerActive:(0,h.bZ)(v),lastStopEventAt:o}}},39727:()=>{},40236:(a,b,c)=>{"use strict";c.d(b,{FW:()=>l});var d=c(11665),e=c(93997),f=c(26283),g=c(20610);let h=(0,c(72626).h)("cli-tools/submit-verified-sender"),i=/\[Pasted text[\s#]/,j=/^\/[A-Za-z]/,k=/^\s*(?:ctx:\d+%\s*)?[>❯›]/;async function l(a){let{sessionName:b,message:c,cliToolId:l,textInputWaitMs:m=g.pL,submitEnterCount:n=1,interEnterWaitMs:o=g.pL,verifyAttempts:p=4,verifyDelayMs:q=g.x9}=a;await (0,d.V1)(b,c,!1),await new Promise(a=>setTimeout(a,m));for(let a=0;a<Math.max(1,n);a++)await (0,d.KB)(b,["Enter"]),a<n-1&&await new Promise(a=>setTimeout(a,o));let r=Math.max(1,p);for(let a=0;a<r;a++){await new Promise(a=>setTimeout(a,q));let g=function(a,b,c){let d=(0,f.aJ)(a).split("\n").slice(-12),e=d.join("\n");if((0,f.ut)(b,e))return"submitted";let g=function(a){for(let b=a.length-1;b>=0;b--)if(k.test(a[b]))return a[b];return null}(d);if(!g)return"submitted";let h=g.replace(k,"").trim();return 0===h.length?"submitted":i.test(g)||function(a,b){let c=b.split("\n").map(a=>a.trim()).find(a=>a.length>0)??"";return 0!==c.length&&c.startsWith(a)}(h,c)?"pending":j.test(h)?"replaced":"submitted"}(await (0,d.Xg)(b,{startLine:-12}),l,c);if("submitted"===g)return void(0,e.gm)(b);if("replaced"===g){try{await (0,d.Ce)(b)}catch(a){h.error("submit-clear-input-failed",{sessionName:b,cliToolId:l,error:a instanceof Error?a.message:String(a)})}throw(0,e.gm)(b),h.error("submit-replaced-by-tui-completion",{sessionName:b,cliToolId:l,attempt:a}),Error(`Message was replaced by a TUI autocompletion for session ${b}; the input no longer matches the sent text. Cleared the input line without submitting to avoid executing a different command.`)}h.warn("submit-not-confirmed:resending-enter",{sessionName:b,cliToolId:l,attempt:a}),await (0,d.KB)(b,["Enter"])}throw(0,e.gm)(b),h.error("submit-verification-failed",{sessionName:b,cliToolId:l,attempts:r}),Error(`Message submit could not be confirmed for session ${b} after ${r} attempts (typed but unsent)`)}},41364:(a,b,c)=>{"use strict";c.d(b,{Gv:()=>o,hM:()=>n});var d=c(79748),e=c.n(d),f=c(33873),g=c.n(f),h=c(1634),i=c(21684),j=c(72626),k=c(15194);function l(a="claude"){return g().join((0,i.U)(),a)}async function m(a="claude"){let b=l(a);try{await e().access(b)}catch{await e().mkdir(b,{recursive:!0})}}async function n(a,b,c,d="claude"){await m(d);let f=function(a,b="claude"){let c=(0,h.GP)(new Date,"yyyy-MM-dd"),d=`${a}-${c}.md`,e=l(b);return g().join(e,d)}(a,d),i=(0,h.GP)(new Date,"yyyy-MM-dd HH:mm:ss"),j="";try{j=await e().readFile(f,"utf-8")}catch{let b=(0,k.hR)(d)?k.ef[d]:d;j=`# ${b} Conversation Log: ${a}
3
3
 
4
4
  Created: ${i}
5
5
 
@@ -17,4 +17,4 @@ Created: ${i}
17
17
 
18
18
  `,j+=`---
19
19
 
20
- `,await e().writeFile(f,j,"utf-8"),f}async function o(a,b="all"){let c="all"===b?[...k.XH]:[b],d=[];for(let b of c){await m(b);let c=l(b);try{let b=(await e().readdir(c)).filter(b=>b.startsWith(`${a}-`)&&b.endsWith(".md")).map(a=>g().join(c,a));d.push(...b)}catch{}}return d.sort().reverse()}(0,j.h)("log-manager")},44265:(a,b,c)=>{"use strict";c.d(b,{M:()=>k});var d=c(79646),e=c(28354),f=c(15194);let g=/^[a-zA-Z0-9_-]+$/;function h(a){if(!g.test(a))throw Error(`Invalid session name format: ${a}`)}var i=c(11665);let j=(0,e.promisify)(d.exec);class k{async isInstalled(){try{return await j(`which ${this.command}`,{timeout:5e3}),!0}catch{return!1}}getSessionName(a,b){let c=`mcbd-${this.id}-${a}`;if(!b||b===this.id)return h(c),c;let d=(0,f.pL)(b,this.id),e=d?`${c}-${d}`:c;return h(e),e}async reconcileExistingSession(a,b){await (0,i.zT)(a,b)}async interrupt(a,b){let c=this.getSessionName(a,b);await (0,i.ds)(c,"Escape")}}},45146:(a,b,c)=>{"use strict";c.d(b,{Et:()=>q,KQ:()=>s,MN:()=>n,SI:()=>k,fq:()=>r,g8:()=>o});var d=c(72626),e=c(13033),f=c(72457),g=c(71080),h=c(3523),i=c(99508);let j=(0,d.h)("response-poller"),k=["Waiting for auth","⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"],l=new Map,m=new Map;function n(a,b,c){return`${a}:${c??b}`}function o(a,b,c){let d=n(a,b,c);q(a,b,c),m.set(d,Date.now()),("opencode"===b||"copilot"===b)&&(0,e.tb)(d),function a(b,c,d){let e=n(b,c,d),f=setTimeout(async()=>{let f=m.get(e);if(f&&Date.now()-f>18e5)return void q(b,c,d);try{await (0,h.zX)(b,c,d)}catch(a){j.error("error:",{error:a instanceof Error?a.message:String(a)})}(0,i.broadcastTerminalSnapshot)(b,c,d),l.has(e)&&a(b,c,d)},2e3);l.set(e,f)}(a,b,c)}function p(a){let b=l.get(a);b&&(clearTimeout(b),l.delete(a),m.delete(a)),(0,e.q1)(a),(0,f.iX)(a),(0,g.L)(a)}function q(a,b,c){p(n(a,b,c))}function r(){for(let a of Array.from(l.keys()))p(a)}function s(){return Array.from(l.keys())}},46423:(a,b,c)=>{"use strict";c.d(b,{$:()=>d});let d=5},47990:()=>{},49358:a=>{"use strict";a.exports=JSON.parse('{"title":"Notifications","description":"Get a push notification when an agent is waiting for you or finishes a session — even when the app is closed.","enable":"Enable notifications","enabling":"Enabling…","enabledOnThisDevice":"Notifications are enabled on this device.","unsubscribe":"Unsubscribe this device","types":{"heading":"Notify me about","promptWaiting":"Prompt waiting","promptWaitingDesc":"When an agent is waiting for your reply","completion":"Session complete","completionDesc":"When an agent finishes a session"},"permission":{"denied":"Notifications are blocked in your browser settings. Allow them for this site to receive push notifications."},"unsupported":"This browser does not support push notifications.","notConfigured":"Push notifications are not configured on this server. Set the VAPID keys to enable them.","ios":{"guidance":"On iPhone/iPad, add this app to your Home Screen and open it from there to enable notifications."},"toast":{"enabled":"Notifications enabled on this device","disabled":"Notifications turned off on this device","error":"Could not enable notifications","updated":"Notification settings updated"},"push":{"promptWaitingWithExcerpt":"Waiting for reply: {excerpt}","promptWaiting":"Waiting for your reply","completionWithExcerpt":"Done: {excerpt}","completion":"Session complete"}}')},56263:(a,b,c)=>{"use strict";c.d(b,{L1:()=>e,MJ:()=>j,Rf:()=>f,ky:()=>g,lM:()=>i,pL:()=>h,wp:()=>d});let d=200,e=100,f=1e5,g="[... truncated ...]",h=3e4,i=/^[a-zA-Z0-9][a-zA-Z0-9\-._/:]*$/,j=128},57905:(a,b,c)=>{"use strict";c.d(b,{c0:()=>I,zw:()=>E,Yq:()=>F,oV:()=>B,pU:()=>H,R7:()=>G,VU:()=>J});var d=c(11665),e=c(26283),f=c(40236),g=c(93997),h=c(77093),i=c(20610),j=c(79646),k=c(28354),l=c(72626);let m=(0,l.h)("session-key-sender"),n=(0,k.promisify)(j.exec);async function o(a,b=50){let c=await (0,d.Xg)(a,{startLine:-b});return(0,e.aJ)(c)}async function p(a){await n("tmux set-environment -g -u CLAUDECODE 2>/dev/null || true"),await (0,d.V1)(a,"unset CLAUDECODE",!0),await new Promise(a=>setTimeout(a,i.Em))}async function q(a,b){let c=Date.now();for(;Date.now()-c<b;){let b=await o(a);if(e.hx.test(b))return;await new Promise(a=>setTimeout(a,200))}throw Error(`Prompt detection timeout (${b}ms)`)}async function r(a,b,c,h){if(!await (0,d.N)(a))throw Error(`Claude session ${a} does not exist. Start the session first.`);let i=await o(a);e.hx.test(i)||await q(a,h),await new Promise(a=>setTimeout(a,c)),await (0,f.FW)({sessionName:a,message:b,cliToolId:"claude"}),(0,g.gm)(a),m.info("sent-message-to-session",{sessionName:a})}async function s(a){try{await (0,d.N)(a)&&(await (0,d.V1)(a,"",!1),await (0,d.ds)(a,"C-d"),(0,g.gm)(a),await new Promise(a=>setTimeout(a,i.Zf)));let b=await (0,d.fY)(a);return b&&m.info("stopped-session",{sessionName:a}),b}catch(a){return m.error("session:stop-failed",{error:(0,h.u1)(a)}),!1}}var t=c(79748),u=c(15194);let v=(0,l.h)("claude-session"),w=(0,k.promisify)(j.exec),x=["$","%","#"],y=null;async function z(){if(y)return y;let a=process.env.CLAUDE_PATH;if(a&&(/^[/a-zA-Z0-9._-]+$/.test(a)?!a.includes("..")||(v.info("claudepath-contains-path"),!1):(v.info("claudepath-contains-invalid-characters-i"),!1)))try{return await (0,t.access)(a,t.constants.X_OK),y=a}catch{v.info("claudepath-is-not-executable:envclaudepa")}try{let{stdout:a}=await w("which claude",{timeout:5e3});return y=a.trim()}catch{for(let a of["/opt/homebrew/bin/claude","/usr/local/bin/claude","/usr/bin/claude"])try{return await w(`test -x "${a}"`,{timeout:1e3}),y=a}catch{}throw Error("Claude CLI not found. Set CLAUDE_PATH environment variable or install Claude CLI.")}}async function A(a,b=50){let c=await (0,d.Xg)(a,{startLine:-b});return(0,e.aJ)(c)}async function B(a){try{let b=(await A(a)).trim();if(""===b)return{healthy:!1,reason:"empty output"};if(e.hx.test(b))return{healthy:!0};let c=b.split("\n").filter(a=>""!==a.trim()),d=c.slice(-10).join("\n");for(let a of e.F0)if(d.includes(a))return{healthy:!1,reason:`error pattern: ${a}`};for(let a of e.Fw)if(a.test(d))return{healthy:!1,reason:`error pattern: ${a.source}`};let f=c[c.length-1]?.trim()??"";if(f.length>=40)return{healthy:!0};if(x.some(a=>!(!f.endsWith(a)||"%"===a&&/\d+%$/.test(f))))return{healthy:!1,reason:`shell prompt ending detected: ${f}`};return{healthy:!0}}catch{return{healthy:!1,reason:"capture error"}}}async function C(a){return!!(await B(a)).healthy||(v.warn("session-sessionname-unhealthy:resultreas"),await (0,d.fY)(a),!1)}function D(a,b){let c=`mcbd-claude-${a}`;if(!b||"claude"===b)return c;let d=(0,u.pL)(b,"claude");return d?`${c}-${d}`:c}async function E(){try{return await w("which claude",{timeout:5e3}),!0}catch{return!1}}async function F(a,b){let c=D(a,b);return!!await (0,d.N)(c)&&(!!(await B(c)).healthy||(v.warn("session-sessionname-unhealthy:resultreas"),!1))}async function G(a){let{worktreeId:b,worktreePath:c,instanceId:f}=a;if(!await E())throw Error("Claude CLI is not installed or not in PATH");let g=D(b,f);if(await (0,d.N)(g)&&await C(g)){await (0,d.zT)(g),v.info("claude-session-sessionname");return}try{await (0,d.jw)({sessionName:g,workingDirectory:c,historyLimit:5e4}),await p(g);let a=await z();await (0,d.V1)(g,a,!0);let b=Date.now(),f=!1,h=!1;for(;Date.now()-b<15e3;){await new Promise(a=>setTimeout(a,300));try{let a=await A(g);if(e.hx.test(a)){await new Promise(a=>setTimeout(a,500)),v.info("claude-initialized-in"),f=!0;break}!h&&e.CX.test(a)&&(await (0,d.V1)(g,"",!0),h=!0,v.info("trust-dialog-detected"))}catch{}}if(!f)throw Error("Claude initialization timeout (15000ms)");v.info("started-claude-session:sessionname")}catch(a){throw y=null,v.error("session:start-failed",{error:a instanceof Error?a.message:String(a)}),Error("Failed to start Claude session")}}async function H(a,b,c){let d=D(a,c);await r(d,b,500,1e4)}async function I(a,b=1e3,c){let e=D(a,c);if(!await (0,d.N)(e))throw Error(`Claude session ${e} does not exist`);try{return await (0,d.Xg)(e,{startLine:-b})}catch(a){throw Error(`Failed to capture Claude output: ${a instanceof Error?a.message:String(a)}`)}}async function J(a,b){return s(D(a,b))}},61296:a=>{"use strict";a.exports=JSON.parse('{"title":"通知","description":"エージェントが応答待ちになったり、セッションが完了したときに、アプリを開いていなくてもプッシュ通知を受け取れます。","enable":"通知を有効にする","enabling":"有効化中…","enabledOnThisDevice":"この端末で通知が有効です。","unsubscribe":"この端末の通知を解除","types":{"heading":"通知する種別","promptWaiting":"応答待ち","promptWaitingDesc":"エージェントがあなたの応答を待っているとき","completion":"セッション完了","completionDesc":"エージェントがセッションを完了したとき"},"permission":{"denied":"ブラウザの設定で通知がブロックされています。このサイトの通知を許可してください。"},"unsupported":"このブラウザはプッシュ通知に対応していません。","notConfigured":"このサーバーではプッシュ通知が設定されていません。VAPID鍵を設定すると有効になります。","ios":{"guidance":"iPhone/iPadでは、このアプリをホーム画面に追加し、そこから開くと通知を有効にできます。"},"toast":{"enabled":"この端末で通知を有効にしました","disabled":"この端末の通知をオフにしました","error":"通知を有効にできませんでした","updated":"通知設定を更新しました"},"push":{"promptWaitingWithExcerpt":"応答待ち: {excerpt}","promptWaiting":"応答待ちです","completionWithExcerpt":"完了: {excerpt}","completion":"セッションが完了しました"}}')},63865:(a,b,c)=>{"use strict";function d(){let a=process.env.CM_VAPID_PUBLIC_KEY?.trim(),b=process.env.CM_VAPID_PRIVATE_KEY?.trim();return a&&b?{publicKey:a,privateKey:b,subject:process.env.CM_VAPID_SUBJECT?.trim()||"mailto:commandmate@localhost"}:null}function e(){return d()?.publicKey??null}c.d(b,{HR:()=>e,J$:()=>t});var f=c(48975),g=c.n(f),h=c(88807),i=c(43167),j=c(72626),k=c(25754),l=c(49358),m=c(61296),n=c(55511);let o=new Map,p=(0,j.h)("push/sender"),q={en:l.push,ja:m.push};function r(a){return(0,k.d9)(a)?a:k.Xn}async function s(a,b){try{await g().sendNotification({endpoint:a.endpoint,keys:a.keys},b)}catch(c){let b=c.statusCode;if(404===b||410===b){(0,i.th)((0,h.getDbInstance)(),a.endpoint),p.info("push-subscription-removed",{statusCode:b});return}p.warn("push-send-failed",{statusCode:b??"unknown"})}}async function t(a){try{let b=d();if(!b||!function(a,b=Date.now(),c=3e4){var d;let e=`${a.worktreeId}:${a.kind}`,f=(d=a.content??"",(0,n.createHash)("sha256").update(d).digest("hex")),g=o.get(e);return(!g||g.hash!==f||!(b-g.at<c))&&(o.set(e,{hash:f,at:b}),!0)}({worktreeId:a.worktreeId,kind:a.kind,content:a.excerpt}))return;let c=(0,h.getDbInstance)(),e=(0,i.gn)(c,a.kind);if(0===e.length)return;g().setVapidDetails(b.subject,b.publicKey,b.privateKey);let f=new Map;for(let a of e){let b=r(a.locale),c=f.get(b);c?c.push(a):f.set(b,[a])}await Promise.all(Array.from(f,([b,c])=>{let d=JSON.stringify(function(a,b=k.Xn,c=Date.now()){let d=function(a,b=120){if(!a)return"";let c=a.replace(/\s+/g," ").trim();return c.length<=b?c:c.slice(0,b-1).trimEnd()+"…"}(a.excerpt),e=a.agentName?` (${a.agentName})`:"",f=`${a.worktreeName}${e}`,g=q[r(b)],h="prompt"===a.kind?d?g.promptWaitingWithExcerpt.replace("{excerpt}",d):g.promptWaiting:d?g.completionWithExcerpt.replace("{excerpt}",d):g.completion;return{kind:a.kind,title:f,body:h,worktreeId:a.worktreeId,url:`/worktrees/${a.worktreeId}`,tag:`${a.worktreeId}:${a.kind}`,timestamp:c}}(a,b));return Promise.all(c.map(a=>s(a,d)))}))}catch(a){p.warn("push-fanout-error",{error:a instanceof Error?a.message:String(a)})}}},63869:(a,b,c)=>{"use strict";c.d(b,{t:()=>j});var d=c(11665),e=c(81254),f=c(93997),g=c(20610);let h=/^\[[ x]\] /;function i(a){if(0===a)return[];let b=a>0?"Down":"Up";return Array.from({length:Math.abs(a)},()=>b)}async function j(a){let{sessionName:b,answer:c,cliToolId:j,promptData:k,fallbackPromptType:l,fallbackDefaultOptionNumber:m}=a;if(("claude"===j||"antigravity"===j)&&(k?.type==="multiple_choice"||"multiple_choice"===l)&&/^\d+$/.test(c)){let a,e=parseInt(c,10),f=null;if(k?.type==="multiple_choice"){let b=(f=k.options).find(a=>a.isDefault);a=b?.number??1}else a=m??1;let g=e-a;if(null!==f&&f.some(a=>h.test(a.label))&&null!==f){let a=f.filter(a=>h.test(a.label)).length,c=[...i(g),"Space"];c.push(...i(a-e+1)),c.push("Enter"),await (0,d.KB)(b,c)}else{let a=i(g),c=k?.type==="multiple_choice"&&!0===k.isAskUserQuestion&&0===g?["Down","Up","Enter"]:[...a,"Enter"];await (0,d.KB)(b,c)}}else{await (0,d.V1)(b,c,!1);let f=function(a){let b=(a.promptData?.type==="multiple_choice"?a.promptData.submitMode:void 0)??a.fallbackSubmitMode??"answer_then_enter";return(0,e.M)(b)?b:"answer_then_enter"}(a);"answer_only"===f&&(a.promptData?.type==="multiple_choice"||"multiple_choice"===a.fallbackPromptType)&&/^\d+$/.test(a.answer)||(await new Promise(a=>setTimeout(a,g.pL)),await (0,d.V1)(b,"",!0))}(0,f.gm)(b)}},68652:(a,b,c)=>{"use strict";c.d(b,{N:()=>g});let d=/Esc\s+to\s+cancel\s*[·•]\s*Tab\s+to\s+amend/i,e=/Enter\s+to\s+select\b.*\bnavigate\b/i,f=/^\s*[>❯]\s*(?:\d{1,2}[.)])?|esc\s+to\s+interrupt|[✻✽✶✢✳⦿◉●⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏]\s+.+…/i;function g(a){if(""===a)return"";let b=a.split("\n"),c=-1;for(let a=b.length-1;a>=0;a--){var g;if(g=b[a],d.test(g)||e.test(g)){c=a;break}}let h=b;return c>=0&&(h=b.slice(c+1).some(a=>f.test(a))?b.slice(c+1):b.slice(0,c+1)),(function(a){let b=[],c=!1;for(let d of a){let a=""===d.trim();a&&c||(b.push(d),c=a)}for(;b.length>0&&""===b[b.length-1].trim();)b.pop();return b})(h).join("\n")}},69297:(a,b,c)=>{"use strict";c.d(b,{mq:()=>l,Lo:()=>n,TB:()=>o,h7:()=>m});var d=c(81503);c(91645),c(93390),c(3453);c(15194),c(31268),c(88807),c(56791);var e=c(11665),f=c(72626),g=c(79646);(0,f.h)("tmux-control-client");(0,f.h)("tmux-control-registry");c(7015),c(26838);let h=(0,f.h)("ws-server"),i=new Map,j=new Map;function k(a,b){let c=j.get(a);if(c&&0!==c.size)try{let e=JSON.stringify({type:"broadcast",worktreeId:a,data:b});c.forEach(a=>{if(a.readyState===d.kb.OPEN)try{a.send(e)}catch(a){h.error("broadcast:send-failed",{error:a instanceof Error?a.message:String(a)})}})}catch(b){h.error("broadcast:failed",{worktreeId:a,error:b instanceof Error?b.message:String(b)});try{let b=JSON.stringify({type:"broadcast",worktreeId:a,data:{error:"Message encoding error"}});c.forEach(a=>{if(a.readyState===d.kb.OPEN)try{a.send(b)}catch{}})}catch(a){h.error("fallback:send-failed",{error:a instanceof Error?a.message:String(a)})}}}function l(a,b){k(a,b)}function m(a){let b=j.get(a);return!!b&&b.size>0}function n(a,b){b.worktreeId?k(b.worktreeId,{type:a,...b}):h.warn("broadcast:missing-worktree-id")}function o(a){for(let b of a){let a=j.get(b);a&&(a.forEach(a=>{let c=i.get(a);c&&c.worktreeIds.delete(b)}),j.delete(b))}}},71080:(a,b,c)=>{"use strict";c.d(b,{L:()=>g,j:()=>f});var d=c(55511);let e=new Map;function f(a,b){let c=(0,d.createHash)("sha256").update(b).digest("hex");return e.get(a)===c||(e.set(a,c),!1)}function g(a){e.delete(a)}},72457:(a,b,c)=>{"use strict";c.d(b,{gv:()=>f,iX:()=>g,zm:()=>h});var d=c(55511);let e=new Map;function f(a,b){let c=(0,d.createHash)("sha256").update(b).digest("hex");return e.get(a)===c||(e.set(a,c),!1)}function g(a){e.delete(a)}function h(a,b){return"copilot"!==b?a:a.replace(/^[❯>]\s/gm," ")}},77093:(a,b,c)=>{"use strict";function d(a){return a instanceof Error?a.message:String(a)}c.d(b,{u1:()=>d})},81254:(a,b,c)=>{"use strict";function d(a){return"answer_only"===a||"answer_then_enter"===a}c.d(b,{M:()=>d})},82450:(a,b,c)=>{"use strict";c.d(b,{IS:()=>h,LH:()=>m,NN:()=>g,Sj:()=>o,aW:()=>n});var d=c(26283),e=c(13033),f=c(56263);function g(a){let b=(0,d.aJ)(a).split("\n"),c=(0,d.GT)(b),e=c>=0?b.slice(0,c):b,f=-1;for(let a=e.length-1;a>=0;a--)if(/^❯\s+\S/.test(e[a])){f=a;break}let g=f>=0?f+1:0,h=e.slice(g),i=[/CLAUDE_HOOKS_/,/\/bin\/claude/,/^claude\s*$/,/@.*\s+%\s*$/,/^[^⏺]*curl.*POST/,/^[^⏺]*Content-Type/,/^[^⏺]*export\s+CLAUDE_/,/^\s*$/,/^[╭╮╰╯│─\s]+$/,/^[│╭╮╰╯].*[│╭╮╰╯]$/,/Claude Code v[\d.]+/,/^Tips for getting started/,/^Welcome back/,/Run \/init to create/,/^Recent activity/,/^No recent activity/,/▐▛███▜▌|▝▜█████▛▘|▘▘ ▝▝/,/^\s*Opus \d+\.\d+\s*·\s*Claude Max/,/\.com's Organization/,/\?\s*for shortcuts\s*$/,/^─{10,}$/,/^❯\s*$/,d.fW],j=[];for(let a of h)!i.some(b=>b.test(a))&&a.trim()&&j.push(a);return j.join("\n").trim()}function h(a){let b=(0,d.aJ)(a).split("\n"),c=[],e=[/^maenokota@.*%/,/^zsh:/,/^feature-issue-\d+/,/^\s*$/],f=!1,g=[];for(let a of b){if(a.includes("✦")){f=!0;let b=a.indexOf("✦"),c=a.substring(b+1).trim();c&&g.push(c);continue}if(f){if(e.some(b=>b.test(a)))continue;g.push(a)}}if(g.length>0)return g.join("\n").trim();for(let a of b)e.some(b=>b.test(a))||c.push(a);return c.join("\n").trim()}let i=/^●\s+(?:Get |Read |Run |Search |Write |Delete |Edit |List |Create |Check |Fetch |Map |Explore |Execute |Find |Install |Update |Open |Close |Copy |Move |Rename |Set |Test |Build |Deploy |Start |Stop |Restart |Kill |Call |Send |Upload |Download |Compile |Analyze |Scan |Apply |Revert |Reset |Push |Pull |Clone |Merge |Commit |Checkout |Branch |Tag |Diff |Log |Show |Status |Init |Config |Add |Remove |Index |Query |Connect |Disconnect |Ping |Trace |Debug |Validate |Verify |Inspect |Monitor |Watch |Clean |Purge |Flush |Load |Save |Export |Import |Format |Lint |Parse |Generate |Transform |Convert |Migrate |Upgrade |Patch |Enable |Disable |Grant |Revoke |Approve |Deny |Lock |Unlock |Mount |Unmount |Attach |Detach |Register |Unregister |Subscribe |Unsubscribe |Publish |Unpublish |Encrypt |Decrypt |Sign |Hash |Encode |Decode |Compress |Decompress |Archive |Extract |Backup |Restore |Dump |Model changed to:)/,j=/^\d+\s+lines\.\.\.$/,k=/^[◐◑◒◓]/,l=/^(?:git\s+--no-pager|git\s+(?:log|diff|show|status|branch|remote|fetch|pull|push|merge|rebase|checkout|reset|stash|tag|config|clone|init|add|commit|rm|mv|bisect|grep|ls-files|rev-parse|describe|shortlog|blame|reflog|cherry-pick|revert|submodule|worktree)\b|npm\s+|npx\s+|node\s+|yarn\s+|pnpm\s+|cargo\s+|pip\s+|python\s+|ruby\s+|go\s+|rustc\s+|make\s+|cmake\s+|docker\s+|kubectl\s+|aws\s+|gcloud\s+|az\s+|terraform\s+|ansible\s+|curl\s+|wget\s+|ssh\s+|scp\s+|rsync\s+|find\s+|grep\s+|sed\s+|awk\s+|cat\s+|ls\s+|cd\s+|mkdir\s+|rm\s+|cp\s+|mv\s+|chmod\s+|chown\s+|echo\s+)/;function m(a){let b=(0,d.aJ)(a).split("\n"),c=-1;for(let a=b.length-1;a>=0;a--){let d=(0,e.IW)(b[a]);if(d&&/^❯\s+\S/.test(d)){c=a;break}}let f=c>=0?c+1:0,g=b.slice(f),h=[],m=!1,n=!1;for(let a of g){let b=(0,e.IW)(a);if(!(!b||d.J7.some(a=>a.test(b)))){if(i.test(b)){n=!0,m=!1;continue}if(k.test(b)){m=!0,n=!1;continue}if(!(j.test(b)||l.test(b)||/^❯\s*/.test(b)||/^[│└]/.test(b))){if(/^●/.test(b)){m=!1,n=!1,h.push(b.replace(/^●\s*/,""));continue}m||n||h.push(b)}}}return h.join("\n").trim()}function n(a){let b=a.split("\n"),c=[];for(let a=0;a<b.length;a++){let f=(0,e.l1)(b[a]);f&&d.Md.test(f)&&c.push(a)}let f=0;c.length>=2&&(f=c[c.length-2]+1);let g=[];for(let a=f;a<b.length;a++){let c=(0,e.l1)(b[a]);!(!c||d.sx.some(a=>a.test(c)))&&(d.Md.test(c)||g.push(c))}return g.join("\n").trim()}function o(a,b=f.Rf,c=f.ky){if(!a||a.length<=b)return a;let d=c+"\n",e=b-d.length;if(e<=0)return c.slice(0,b);let g=a.length-e;if(g>0&&g<a.length){let b=a.charCodeAt(g);b>=56320&&b<=57343&&(g+=1)}return d+a.slice(g)}},90164:(a,b,c)=>{"use strict";c.d(b,{Dk:()=>e,kD:()=>f});let d="https://github.com/Kewton/CommandMate",e=`${d}/releases/`,f=`${d}/blob/main/docs/security-guide.md`},93997:(a,b,c)=>{"use strict";c.d(b,{aq:()=>l,gm:()=>j,pc:()=>k,vF:()=>i,wd:()=>h,xE:()=>e});let d=(0,c(72626).h)("tmux-capture-cache"),e=1e4;function f(){return globalThis.__tmuxCaptureCache??=new Map}function g(){return globalThis.__tmuxCaptureCacheInflight??=new Map}function h(a,b){if(""===a)return"";let c=a.split("\n");return b>=c.length?a:c.slice(-b).join("\n")}function i(a,b,c){let d=f(),e=Date.now();for(let[a,b]of d)e-b.timestamp>5e3&&d.delete(a);if(d.size>=100&&!d.has(a)){let a=null,b=1/0;for(let[c,e]of d)e.timestamp<b&&(b=e.timestamp,a=c);a&&d.delete(a)}d.set(a,{output:b,capturedLines:c,timestamp:e})}function j(a){f().delete(a),d.debug("cache:invalidate",{sessionName:a})}function k(){f().clear(),g().clear()}async function l(a,b,c){let d=function(a,b){let c=f(),d=c.get(a);return d?Date.now()-d.timestamp>5e3?(c.delete(a),null):b>d.capturedLines?null:h(d.output,b):null}(a,b);if(null!==d)return d;let j=g(),k=j.get(a);if(k)return h(await k,b);let l=c();j.set(a,l);try{let c=await l;return c.length>0&&i(a,c,e),h(c,b)}finally{j.delete(a)}}},95220:(a,b,c)=>{"use strict";c.r(b),c.d(b,{accumulateTuiContent:()=>g.IZ,cleanClaudeResponse:()=>f.NN,cleanCopilotResponse:()=>f.LH,cleanGeminiResponse:()=>f.IS,cleanOpenCodeResponse:()=>f.aW,clearPromptHashCache:()=>h.iX,clearTuiAccumulator:()=>g.q1,extractCopilotContentLines:()=>g.o0,extractTuiContentLines:()=>g.K0,findOverlapIndex:()=>g.vQ,getAccumulatedContent:()=>g.Uz,getActivePollers:()=>d.KQ,initTuiAccumulator:()=>g.tb,isDuplicatePrompt:()=>h.gv,isOpenCodeComplete:()=>e.b,normalizeCopilotLine:()=>g.IW,normalizePromptForDedup:()=>h.zm,resolveExtractionStartIndex:()=>e.Q,startPolling:()=>d.g8,stopAllPolling:()=>d.fq,stopPolling:()=>d.Et,truncateMessage:()=>f.Sj});var d=c(45146),e=c(60),f=c(82450),g=c(13033),h=c(72457)},95595:(a,b,c)=>{"use strict";c.d(b,{WC:()=>l,gv:()=>h,ug:()=>i});var d=c(26283),e=c(25129),f=c(68652),g=c(46423);let h={PROMPT_DETECTED:"prompt_detected",THINKING_INDICATOR:"thinking_indicator",OPENCODE_PROCESSING_INDICATOR:"opencode_processing_indicator",OPENCODE_SELECTION_LIST:"opencode_selection_list",CLAUDE_SELECTION_LIST:"claude_selection_list",COPILOT_SELECTION_LIST:"copilot_selection_list",CODEX_SELECTION_LIST:"codex_selection_list",CODEX_PAGER:"codex_pager",ANTIGRAVITY_SELECTION_LIST:"antigravity_selection_list",OPENCODE_RESPONSE_COMPLETE:"opencode_response_complete",INPUT_PROMPT:"input_prompt",NO_RECENT_OUTPUT:"no_recent_output",DEFAULT:"default"},i=new Set([h.OPENCODE_SELECTION_LIST,h.CLAUDE_SELECTION_LIST,h.COPILOT_SELECTION_LIST,h.CODEX_SELECTION_LIST,h.CODEX_PAGER,h.ANTIGRAVITY_SELECTION_LIST]),j=/press\s+(?:number|enter)\s+to\s+confirm/i,k=/^\s*[❯›●]?\s*\d{1,2}[.)]\s/;function l(a,b,c){let i=(0,f.N)((0,d.aJ)(a)),l=i.split("\n"),m=l.length-1;for(;m>=0&&""===l[m].trim();)m--;let n=l.slice(0,m+1),o=n.slice(-15).join("\n"),p=n.slice(-g.$).join("\n"),q=n.slice(-30).join("\n");if("copilot"===b&&d.Mi.test(q)){let a=(0,d.KO)(b),c=(0,e.gF)((0,d._A)(i),a);return c.isPrompt&&(c.promptData?.options?.length??0)<=3?{status:"waiting",confidence:"high",reason:"prompt_detected",hasActivePrompt:!0,promptDetection:c}:{status:"waiting",confidence:"high",reason:h.COPILOT_SELECTION_LIST,hasActivePrompt:!1,promptDetection:c}}let r=n.slice(-15).join("\n");if("copilot"===b&&(0,d.ut)(b,r)){let a=(0,d.KO)(b);return{status:"running",confidence:"high",reason:"thinking_indicator",hasActivePrompt:!1,promptDetection:(0,e.gF)((0,d._A)(i),a)}}if("codex"===b&&d.pn.test(o)){let a=(0,d.KO)(b),c=(0,e.gF)((0,d._A)(i),a);return{status:"waiting",confidence:"high",reason:h.CODEX_PAGER,hasActivePrompt:!1,promptDetection:c}}if("codex"===b){let a=-1;for(let b=n.length-1;b>=Math.max(0,n.length-10);b--)if(d.aW.test(n[b])){a=b;break}let c=a>=0?a-1:n.length-1;for(;c>=0&&""===n[c].trim();)c--;if(c>=0){let a=n.slice(Math.max(0,c-15+1),c+1).join("\n");if(d.Jn.test(a)){let a=(0,d.KO)(b),c=(0,e.gF)((0,d._A)(i),a);return{status:"waiting",confidence:"high",reason:h.CODEX_SELECTION_LIST,hasActivePrompt:!1,promptDetection:c}}}}if("antigravity"===b&&d.kT.test(o)){let a=(0,d.KO)(b),c=(0,e.gF)((0,d._A)(i),a);return{status:"waiting",confidence:"high",reason:h.ANTIGRAVITY_SELECTION_LIST,hasActivePrompt:!1,promptDetection:c}}let s=(0,d.KO)(b),t="opencode"===b||"codex"===b||"claude"===b||"copilot"===b?(0,d._A)(i):(0,d._A)(o),u=(0,e.gF)(t,s);if(u.isPrompt)if(!("codex"===b&&function(a){let b=-1;for(let c=a.length-1;c>=Math.max(0,a.length-10);c--)if(d.aW.test(a[c])){b=c;break}let c=b>=0?b:a.length,e=-1,f=-1;for(let b=0;b<c;b++){let c=a[b],g=c.trim();""!==g&&((j.test(g)||k.test(g))&&(e=b),(0,d.ut)("codex",c)&&(f=b))}return e>=0&&f>e}(n)))return{status:"waiting",confidence:"high",reason:"prompt_detected",hasActivePrompt:!0,promptDetection:u};else u={...u,isPrompt:!1,promptData:void 0};if("claude"===b&&d.XY.test(o))return{status:"waiting",confidence:"high",reason:h.CLAUDE_SELECTION_LIST,hasActivePrompt:!1,promptDetection:u};if((0,d.ut)(b,p))return{status:"running",confidence:"high",reason:"thinking_indicator",hasActivePrompt:!1,promptDetection:u};if("claude"===b&&d.aU.test(o))return{status:"running",confidence:"high",reason:h.THINKING_INDICATOR,hasActivePrompt:!1,promptDetection:u};if("opencode"===b){if(d.kD.test(o))return{status:"running",confidence:"high",reason:"opencode_processing_indicator",hasActivePrompt:!1,promptDetection:u};let a=(0,d._A)(i).split("\n"),b=Math.max(0,a.length-7);for(let c=a.length-1;c>=Math.max(0,a.length-10);c--)if(/ctrl\+[tp]/.test(a[c])){b=Math.max(0,c-2);break}let c=a.slice(0,b),e=c.length-1;for(;e>=0&&""===c[e].trim();)e--;if(e>=0){let a=c.slice(Math.max(0,e-g.$+1),e+1).join("\n");if((0,d.ut)("opencode",a))return{status:"running",confidence:"high",reason:"thinking_indicator",hasActivePrompt:!1,promptDetection:u};let b=c.slice(Math.max(0,e-15+1),e+1).join("\n"),f=c.join("\n");if(d.LO.test(f))return{status:"waiting",confidence:"high",reason:h.OPENCODE_SELECTION_LIST,hasActivePrompt:!1,promptDetection:u};if(d.Md.test(b))return{status:"ready",confidence:"high",reason:h.OPENCODE_RESPONSE_COMPLETE,hasActivePrompt:!1,promptDetection:u};let{promptPattern:i}=(0,d._X)("opencode");if(i.test(b))return{status:"ready",confidence:"high",reason:h.PROMPT_DETECTED,hasActivePrompt:!0,promptDetection:u}}}if("codex"===b){let a=-1;for(let b=n.length-1;b>=Math.max(0,n.length-10);b--)if(d.aW.test(n[b])){a=b;break}if(a>=0){let b=a-1;for(;b>=0&&""===n[b].trim();)b--;if(b>=0){let a=n.slice(Math.max(0,b-g.$+1),b+1).join("\n");if((0,d.ut)("codex",a))return{status:"running",confidence:"high",reason:"thinking_indicator",hasActivePrompt:!1,promptDetection:u};let c=n[b].trim();return d.gm.test(c)?{status:"ready",confidence:"high",reason:"input_prompt",hasActivePrompt:!1,promptDetection:u}:{status:"running",confidence:"high",reason:"thinking_indicator",hasActivePrompt:!1,promptDetection:u}}}else{let a=n.length-1;for(;a>=0&&""===n[a].trim();)a--;if(!(a>=0&&d.gm.test(n[a].trim()))&&(0,d.ut)("codex",o))return{status:"running",confidence:"high",reason:"thinking_indicator",hasActivePrompt:!1,promptDetection:u}}}if("antigravity"===b){if((0,d.ut)("antigravity",o))return{status:"running",confidence:"high",reason:h.THINKING_INDICATOR,hasActivePrompt:!1,promptDetection:u};let{promptPattern:a}=(0,d._X)("antigravity");if(a.test(o))return{status:"ready",confidence:"high",reason:h.INPUT_PROMPT,hasActivePrompt:!1,promptDetection:u}}let{promptPattern:v}=(0,d._X)(b);return v.test(o)?{status:"ready",confidence:"high",reason:"input_prompt",hasActivePrompt:!1,promptDetection:u}:c&&Date.now()-c.getTime()>5e3?{status:"ready",confidence:"low",reason:"no_recent_output",hasActivePrompt:!1,promptDetection:u}:{status:"running",confidence:"low",reason:"default",hasActivePrompt:!1,promptDetection:u}}},99508:(a,b,c)=>{"use strict";c.r(b),c.d(b,{INTERACTION_SNAPSHOT_RETRY_DELAYS_MS:()=>l,__resetTerminalBroadcastState:()=>s,broadcastSessionStatus:()=>r,broadcastTerminalSnapshot:()=>m,broadcastTerminalSnapshotAfterInteraction:()=>q});var d=c(69297),e=c(88807),f=c(34892),g=c(72626),h=c(31268),i=c(93997);let j=(0,g.h)("terminal-broadcast"),k=new Map,l=[100,250,500,750];async function m(a,b,c){if((0,d.h7)(a))try{let d=(0,e.getDbInstance)(),g=await (0,f.$)(d,a,b,c);p(a,b,g,c)}catch(b){j.error("terminal-snapshot:failed",{worktreeId:a,error:b instanceof Error?b.message:String(b)})}}function n(a){return JSON.stringify([a.fullOutput??"",a.isRunning,a.thinking??!1,a.isPromptWaiting??!1,a.isSelectionListActive??!1,a.isPagerActive??!1,a.isUnclassifiedActive??!1])}async function o(a,b,c){let d=h.s.getInstance().getTool(b);return(0,i.gm)(d.getSessionName(a,c)),(0,f.$)((0,e.getDbInstance)(),a,b,c)}function p(a,b,c,e){let f=e??b,g=`${a}:${b}:${f}`;(0,d.mq)(a,{type:"terminal_snapshot",worktreeId:a,cliToolId:b,instanceId:f,output:c.fullOutput??"",isRunning:c.isRunning,thinking:c.thinking??!1,isPromptWaiting:c.isPromptWaiting??!1,promptData:c.promptData??null,isSelectionListActive:c.isSelectionListActive??!1,isPagerActive:c.isPagerActive??!1,isUnclassifiedActive:c.isUnclassifiedActive??!1,version:function(a){let b=(k.get(a)??0)+1;return k.set(a,b),b}(g)})}async function q(a,b,c,e=l){if((0,d.h7)(a))try{let d=await o(a,b,c),f=n(d);for(let g of(p(a,b,d,c),e)){await new Promise(a=>setTimeout(a,g));let d=await o(a,b,c);if(n(d)!==f)return void p(a,b,d,c)}}catch(d){j.error("terminal-snapshot:interaction-refresh-failed",{worktreeId:a,cliToolId:b,instanceId:c,error:d instanceof Error?d.message:String(d)})}}function r(a,b,c){(0,d.mq)(a,{type:"session_status_changed",worktreeId:a,isRunning:b,cliTool:c?.cliTool??null,instance:c?.instance??null})}function s(){k.clear()}}};
20
+ `,await e().writeFile(f,j,"utf-8"),f}async function o(a,b="all"){let c="all"===b?[...k.XH]:[b],d=[];for(let b of c){await m(b);let c=l(b);try{let b=(await e().readdir(c)).filter(b=>b.startsWith(`${a}-`)&&b.endsWith(".md")).map(a=>g().join(c,a));d.push(...b)}catch{}}return d.sort().reverse()}(0,j.h)("log-manager")},44265:(a,b,c)=>{"use strict";c.d(b,{M:()=>k});var d=c(79646),e=c(28354),f=c(15194);let g=/^[a-zA-Z0-9_-]+$/;function h(a){if(!g.test(a))throw Error(`Invalid session name format: ${a}`)}var i=c(11665);let j=(0,e.promisify)(d.exec);class k{async isInstalled(){try{return await j(`which ${this.command}`,{timeout:5e3}),!0}catch{return!1}}getSessionName(a,b){let c=`mcbd-${this.id}-${a}`;if(!b||b===this.id)return h(c),c;let d=(0,f.pL)(b,this.id),e=d?`${c}-${d}`:c;return h(e),e}async reconcileExistingSession(a,b){await (0,i.zT)(a,b)}async interrupt(a,b){let c=this.getSessionName(a,b);await (0,i.ds)(c,"Escape")}}},45146:(a,b,c)=>{"use strict";c.d(b,{Et:()=>r,KQ:()=>t,MN:()=>n,SI:()=>k,fq:()=>s,g8:()=>o,sR:()=>u});var d=c(72626),e=c(13033),f=c(72457),g=c(71080),h=c(3523),i=c(99508);let j=(0,d.h)("response-poller"),k=["Waiting for auth","⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"],l=new Map,m=new Map;function n(a,b,c){return`${a}:${c??b}`}function o(a,b,c){let d=n(a,b,c);r(a,b,c),m.set(d,Date.now()),("opencode"===b||"copilot"===b)&&(0,e.tb)(d),p(a,b,c)}function p(a,b,c){let d=n(a,b,c),e=setTimeout(async()=>{let e=m.get(d);if(e&&Date.now()-e>18e5)return void r(a,b,c);try{await (0,h.zX)(a,b,c)}catch(a){j.error("error:",{error:a instanceof Error?a.message:String(a)})}(0,i.broadcastTerminalSnapshot)(a,b,c),l.has(d)&&p(a,b,c)},2e3);l.set(d,e)}function q(a){let b=l.get(a);b&&(clearTimeout(b),l.delete(a),m.delete(a)),(0,e.q1)(a),(0,f.iX)(a),(0,g.L1)(a)}function r(a,b,c){q(n(a,b,c))}function s(){for(let a of Array.from(l.keys()))q(a)}function t(){return Array.from(l.keys())}function u(a,b){let c=new Map;for(let{oldId:b,newId:d}of a)b&&d&&b!==d&&c.set(b,d);if(0===c.size)return[];let d=[],h=[];for(let a of Array.from(l.keys())){let e=function(a){let b=a.indexOf(":");return b<=0||b===a.length-1?null:{worktreeId:a.slice(0,b),instanceId:a.slice(b+1)}}(a);if(!e)continue;let f=c.get(e.worktreeId);if(!f)continue;let g=b(e.worktreeId,e.instanceId);if(!g){h.push(a);continue}d.push({oldKey:a,newKey:n(f,g,e.instanceId),newWorktreeId:f,cliToolId:g,instanceId:e.instanceId})}let i=new Map;for(let a of d){let b=l.get(a.oldKey);b&&clearTimeout(b),l.delete(a.oldKey),i.set(a.newKey,{startedAt:m.get(a.oldKey)}),m.delete(a.oldKey),(0,f.i2)(a.oldKey,a.newKey),(0,g.Re)(a.oldKey,a.newKey),(0,e.q1)(a.oldKey)}for(let a of h)q(a),j.warn("poller:migrate-abandoned",{pollerKey:a});for(let a of d){let b=i.get(a.newKey)?.startedAt;m.set(a.newKey,b??Date.now()),("opencode"===a.cliToolId||"copilot"===a.cliToolId)&&(0,e.tb)(a.newKey),p(a.newWorktreeId,a.cliToolId,a.instanceId)}return d}},47990:()=>{},49358:a=>{"use strict";a.exports=JSON.parse('{"title":"Notifications","description":"Get a push notification when an agent is waiting for you or finishes a session — even when the app is closed.","enable":"Enable notifications","enabling":"Enabling…","enabledOnThisDevice":"Notifications are enabled on this device.","unsubscribe":"Unsubscribe this device","types":{"heading":"Notify me about","promptWaiting":"Prompt waiting","promptWaitingDesc":"When an agent is waiting for your reply","completion":"Session complete","completionDesc":"When an agent finishes a session"},"permission":{"denied":"Notifications are blocked in your browser settings. Allow them for this site to receive push notifications."},"unsupported":"This browser does not support push notifications.","notConfigured":"Push notifications are not configured on this server. Set the VAPID keys to enable them.","ios":{"guidance":"On iPhone/iPad, add this app to your Home Screen and open it from there to enable notifications."},"toast":{"enabled":"Notifications enabled on this device","disabled":"Notifications turned off on this device","error":"Could not enable notifications","updated":"Notification settings updated"},"push":{"promptWaitingWithExcerpt":"Waiting for reply: {excerpt}","promptWaiting":"Waiting for your reply","completionWithExcerpt":"Done: {excerpt}","completion":"Session complete"}}')},56263:(a,b,c)=>{"use strict";c.d(b,{L1:()=>e,MJ:()=>j,Rf:()=>f,ky:()=>g,lM:()=>i,pL:()=>h,wp:()=>d});let d=200,e=100,f=1e5,g="[... truncated ...]",h=3e4,i=/^[a-zA-Z0-9][a-zA-Z0-9\-._/:]*$/,j=128},57905:(a,b,c)=>{"use strict";c.d(b,{c0:()=>K,zw:()=>G,Yq:()=>H,oV:()=>D,pU:()=>J,R7:()=>I,VU:()=>L});var d=c(11665),e=c(26283),f=c(40236),g=c(93997),h=c(77093),i=c(20610),j=c(79646),k=c(28354),l=c(72626);let m=(0,l.h)("session-key-sender"),n=(0,k.promisify)(j.exec);async function o(a,b=50){let c=await (0,d.Xg)(a,{startLine:-b});return(0,e.aJ)(c)}async function p(a){await n("tmux set-environment -g -u CLAUDECODE 2>/dev/null || true"),await (0,d.V1)(a,"unset CLAUDECODE",!0),await new Promise(a=>setTimeout(a,i.Em))}async function q(a,b){let c=Date.now();for(;Date.now()-c<b;){let b=await o(a);if(e.hx.test(b))return;await new Promise(a=>setTimeout(a,200))}throw Error(`Prompt detection timeout (${b}ms)`)}async function r(a,b,c,h){if(!await (0,d.N)(a))throw Error(`Claude session ${a} does not exist. Start the session first.`);let i=await o(a);e.hx.test(i)||await q(a,h),await new Promise(a=>setTimeout(a,c)),await (0,f.FW)({sessionName:a,message:b,cliToolId:"claude"}),(0,g.gm)(a),m.info("sent-message-to-session",{sessionName:a})}async function s(a){try{await (0,d.N)(a)&&(await (0,d.V1)(a,"",!1),await (0,d.ds)(a,"C-d"),(0,g.gm)(a),await new Promise(a=>setTimeout(a,i.Zf)));let b=await (0,d.fY)(a);return b&&m.info("stopped-session",{sessionName:a}),b}catch(a){return m.error("session:stop-failed",{error:(0,h.u1)(a)}),!1}}var t=c(79748),u=c(15194),v=c(2669);let w=(0,l.h)("claude-session"),x=(0,k.promisify)(j.exec),y=["$","%","#"],z=null;async function A(){if(z)return z;let a=process.env.CLAUDE_PATH;if(a&&(/^[/a-zA-Z0-9._-]+$/.test(a)?!a.includes("..")||(w.info("claudepath-contains-path"),!1):(w.info("claudepath-contains-invalid-characters-i"),!1)))try{return await (0,t.access)(a,t.constants.X_OK),z=a}catch{w.info("claudepath-is-not-executable:envclaudepa")}try{let{stdout:a}=await x("which claude",{timeout:5e3});return z=a.trim()}catch{for(let a of["/opt/homebrew/bin/claude","/usr/local/bin/claude","/usr/bin/claude"])try{return await x(`test -x "${a}"`,{timeout:1e3}),z=a}catch{}throw Error("Claude CLI not found. Set CLAUDE_PATH environment variable or install Claude CLI.")}}async function B(a,b=50){let c=await (0,d.Xg)(a,{startLine:-b});return(0,e.aJ)(c)}function C(a){let b=a.trim().split("\n").filter(a=>""!==a.trim()).slice(-10).join("\n");for(let a of e.F0)if(b.includes(a))return a;for(let a of e.Fw)if(a.test(b))return a.source;return null}async function D(a){try{let b=(await B(a)).trim();if(""===b)return{healthy:!1,reason:"empty output"};if(e.hx.test(b))return{healthy:!0};let c=b.split("\n").filter(a=>""!==a.trim()),d=C(b);if(null!==d)return{healthy:!1,reason:`error pattern: ${d}`};let f=c[c.length-1]?.trim()??"";if(f.length>=40)return{healthy:!0};if(y.some(a=>!(!f.endsWith(a)||"%"===a&&/\d+%$/.test(f))))return{healthy:!1,reason:`shell prompt ending detected: ${f}`};return{healthy:!0}}catch{return{healthy:!1,reason:"capture error"}}}async function E(a){return!!(await D(a)).healthy||(w.warn("session-sessionname-unhealthy:resultreas"),await (0,d.fY)(a),!1)}function F(a,b){let c=`mcbd-claude-${a}`;if(!b||"claude"===b)return c;let d=(0,u.pL)(b,"claude");return d?`${c}-${d}`:c}async function G(){try{return await x("which claude",{timeout:5e3}),!0}catch{return!1}}async function H(a,b){let c=F(a,b);return!!await (0,d.N)(c)&&(!!(await D(c)).healthy||(w.warn("session-sessionname-unhealthy:resultreas"),!1))}async function I(a){let{worktreeId:b,worktreePath:c,instanceId:f}=a;if(!await G())throw Error("Claude CLI is not installed or not in PATH");let g=F(b,f);if(await (0,d.N)(g)&&await E(g)){await (0,d.zT)(g),w.info("claude-session-sessionname");return}try{await (0,d.jw)({sessionName:g,workingDirectory:c}),await p(g);let a=await A();await (0,d.V1)(g,a,!0);let b=Date.now(),f=!1,h=!1;for(;Date.now()-b<6e4;){await new Promise(a=>setTimeout(a,300));let a=null;try{a=await B(g)}catch{}if(null===a)continue;if(e.hx.test(a)){await new Promise(a=>setTimeout(a,500)),w.info("claude-initialized-in"),f=!0;break}if(!h&&e.CX.test(a))try{await (0,d.V1)(g,"",!0),h=!0,w.info("trust-dialog-detected")}catch{}let b=C(a);if(null!==b)throw new v.mR("Claude Code",g,b)}if(!f)throw new v.Sr("Claude Code",g,6e4);w.info("started-claude-session:sessionname")}catch(a){if(z=null,w.error("session:start-failed",{error:a instanceof Error?a.message:String(a)}),(0,v.su)(a))throw a;throw Error("Failed to start Claude session")}}async function J(a,b,c){let d=F(a,c);await r(d,b,500,1e4)}async function K(a,b=1e3,c){let e=F(a,c);if(!await (0,d.N)(e))throw Error(`Claude session ${e} does not exist`);try{return await (0,d.Xg)(e,{startLine:-b})}catch(a){throw Error(`Failed to capture Claude output: ${a instanceof Error?a.message:String(a)}`)}}async function L(a,b){return s(F(a,b))}},61296:a=>{"use strict";a.exports=JSON.parse('{"title":"通知","description":"エージェントが応答待ちになったり、セッションが完了したときに、アプリを開いていなくてもプッシュ通知を受け取れます。","enable":"通知を有効にする","enabling":"有効化中…","enabledOnThisDevice":"この端末で通知が有効です。","unsubscribe":"この端末の通知を解除","types":{"heading":"通知する種別","promptWaiting":"応答待ち","promptWaitingDesc":"エージェントがあなたの応答を待っているとき","completion":"セッション完了","completionDesc":"エージェントがセッションを完了したとき"},"permission":{"denied":"ブラウザの設定で通知がブロックされています。このサイトの通知を許可してください。"},"unsupported":"このブラウザはプッシュ通知に対応していません。","notConfigured":"このサーバーではプッシュ通知が設定されていません。VAPID鍵を設定すると有効になります。","ios":{"guidance":"iPhone/iPadでは、このアプリをホーム画面に追加し、そこから開くと通知を有効にできます。"},"toast":{"enabled":"この端末で通知を有効にしました","disabled":"この端末の通知をオフにしました","error":"通知を有効にできませんでした","updated":"通知設定を更新しました"},"push":{"promptWaitingWithExcerpt":"応答待ち: {excerpt}","promptWaiting":"応答待ちです","completionWithExcerpt":"完了: {excerpt}","completion":"セッションが完了しました"}}')},63865:(a,b,c)=>{"use strict";function d(){let a=process.env.CM_VAPID_PUBLIC_KEY?.trim(),b=process.env.CM_VAPID_PRIVATE_KEY?.trim();return a&&b?{publicKey:a,privateKey:b,subject:process.env.CM_VAPID_SUBJECT?.trim()||"mailto:commandmate@localhost"}:null}function e(){return d()?.publicKey??null}c.d(b,{HR:()=>e,J$:()=>t});var f=c(48975),g=c.n(f),h=c(88807),i=c(43167),j=c(72626),k=c(25754),l=c(49358),m=c(61296),n=c(55511);let o=new Map,p=(0,j.h)("push/sender"),q={en:l.push,ja:m.push};function r(a){return(0,k.d9)(a)?a:k.Xn}async function s(a,b){try{await g().sendNotification({endpoint:a.endpoint,keys:a.keys},b)}catch(c){let b=c.statusCode;if(404===b||410===b){(0,i.th)((0,h.getDbInstance)(),a.endpoint),p.info("push-subscription-removed",{statusCode:b});return}p.warn("push-send-failed",{statusCode:b??"unknown"})}}async function t(a){try{let b=d();if(!b||!function(a,b=Date.now(),c=3e4){var d;let e=`${a.worktreeId}:${a.kind}`,f=(d=a.content??"",(0,n.createHash)("sha256").update(d).digest("hex")),g=o.get(e);return(!g||g.hash!==f||!(b-g.at<c))&&(o.set(e,{hash:f,at:b}),!0)}({worktreeId:a.worktreeId,kind:a.kind,content:a.excerpt}))return;let c=(0,h.getDbInstance)(),e=(0,i.gn)(c,a.kind);if(0===e.length)return;g().setVapidDetails(b.subject,b.publicKey,b.privateKey);let f=new Map;for(let a of e){let b=r(a.locale),c=f.get(b);c?c.push(a):f.set(b,[a])}await Promise.all(Array.from(f,([b,c])=>{let d=JSON.stringify(function(a,b=k.Xn,c=Date.now()){let d=function(a,b=120){if(!a)return"";let c=a.replace(/\s+/g," ").trim();return c.length<=b?c:c.slice(0,b-1).trimEnd()+"…"}(a.excerpt),e=a.agentName?` (${a.agentName})`:"",f=`${a.worktreeName}${e}`,g=q[r(b)],h="prompt"===a.kind?d?g.promptWaitingWithExcerpt.replace("{excerpt}",d):g.promptWaiting:d?g.completionWithExcerpt.replace("{excerpt}",d):g.completion;return{kind:a.kind,title:f,body:h,worktreeId:a.worktreeId,url:`/worktrees/${a.worktreeId}`,tag:`${a.worktreeId}:${a.kind}`,timestamp:c}}(a,b));return Promise.all(c.map(a=>s(a,d)))}))}catch(a){p.warn("push-fanout-error",{error:a instanceof Error?a.message:String(a)})}}},63869:(a,b,c)=>{"use strict";c.d(b,{t:()=>j});var d=c(11665),e=c(81254),f=c(93997),g=c(20610);let h=/^\[[ x]\] /;function i(a){if(0===a)return[];let b=a>0?"Down":"Up";return Array.from({length:Math.abs(a)},()=>b)}async function j(a){let{sessionName:b,answer:c,cliToolId:j,promptData:k,fallbackPromptType:l,fallbackDefaultOptionNumber:m}=a;if(("claude"===j||"antigravity"===j)&&(k?.type==="multiple_choice"||"multiple_choice"===l)&&/^\d+$/.test(c)){let a,e=parseInt(c,10),f=null;if(k?.type==="multiple_choice"){let b=(f=k.options).find(a=>a.isDefault);a=b?.number??1}else a=m??1;let g=e-a;if(null!==f&&f.some(a=>h.test(a.label))&&null!==f){let a=f.filter(a=>h.test(a.label)).length,c=[...i(g),"Space"];c.push(...i(a-e+1)),c.push("Enter"),await (0,d.KB)(b,c)}else{let a=i(g),c=k?.type==="multiple_choice"&&!0===k.isAskUserQuestion&&0===g?["Down","Up","Enter"]:[...a,"Enter"];await (0,d.KB)(b,c)}}else{await (0,d.V1)(b,c,!1);let f=function(a){let b=(a.promptData?.type==="multiple_choice"?a.promptData.submitMode:void 0)??a.fallbackSubmitMode??"answer_then_enter";return(0,e.M)(b)?b:"answer_then_enter"}(a);"answer_only"===f&&(a.promptData?.type==="multiple_choice"||"multiple_choice"===a.fallbackPromptType)&&/^\d+$/.test(a.answer)||(await new Promise(a=>setTimeout(a,g.pL)),await (0,d.V1)(b,"",!0))}(0,f.gm)(b)}},68652:(a,b,c)=>{"use strict";c.d(b,{N:()=>g});let d=/Esc\s+to\s+cancel\s*[·•]\s*Tab\s+to\s+amend/i,e=/Enter\s+to\s+select\b.*\bnavigate\b/i,f=/^\s*[>❯]\s*(?:\d{1,2}[.)])?|esc\s+to\s+interrupt|[✻✽✶✢✳⦿◉●⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏]\s+.+…/i;function g(a){if(""===a)return"";let b=a.split("\n"),c=-1;for(let a=b.length-1;a>=0;a--){var g;if(g=b[a],d.test(g)||e.test(g)){c=a;break}}let h=b;return c>=0&&(h=b.slice(c+1).some(a=>f.test(a))?b.slice(c+1):b.slice(0,c+1)),(function(a){let b=[],c=!1;for(let d of a){let a=""===d.trim();a&&c||(b.push(d),c=a)}for(;b.length>0&&""===b[b.length-1].trim();)b.pop();return b})(h).join("\n")}},69297:(a,b,c)=>{"use strict";c.d(b,{mq:()=>l,Lo:()=>n,TB:()=>o,h7:()=>m});var d=c(81503);c(91645),c(93390),c(3453);c(15194),c(31268),c(88807),c(56791);var e=c(11665),f=c(72626),g=c(79646);(0,f.h)("tmux-control-client");(0,f.h)("tmux-control-registry");c(7015),c(26838);let h=(0,f.h)("ws-server"),i=new Map,j=new Map;function k(a,b){let c=j.get(a);if(c&&0!==c.size)try{let e=JSON.stringify({type:"broadcast",worktreeId:a,data:b});c.forEach(a=>{if(a.readyState===d.kb.OPEN)try{a.send(e)}catch(a){h.error("broadcast:send-failed",{error:a instanceof Error?a.message:String(a)})}})}catch(b){h.error("broadcast:failed",{worktreeId:a,error:b instanceof Error?b.message:String(b)});try{let b=JSON.stringify({type:"broadcast",worktreeId:a,data:{error:"Message encoding error"}});c.forEach(a=>{if(a.readyState===d.kb.OPEN)try{a.send(b)}catch{}})}catch(a){h.error("fallback:send-failed",{error:a instanceof Error?a.message:String(a)})}}}function l(a,b){k(a,b)}function m(a){let b=j.get(a);return!!b&&b.size>0}function n(a,b){b.worktreeId?k(b.worktreeId,{type:a,...b}):h.warn("broadcast:missing-worktree-id")}function o(a){for(let b of a){let a=j.get(b);a&&(a.forEach(a=>{let c=i.get(a);c&&c.worktreeIds.delete(b)}),j.delete(b))}}},71080:(a,b,c)=>{"use strict";c.d(b,{L1:()=>g,Re:()=>h,j7:()=>f});var d=c(55511);let e=new Map;function f(a,b){let c=(0,d.createHash)("sha256").update(b).digest("hex");return e.get(a)===c||(e.set(a,c),!1)}function g(a){e.delete(a)}function h(a,b){if(a===b)return;let c=e.get(a);e.delete(a),void 0!==c&&e.set(b,c)}},72457:(a,b,c)=>{"use strict";c.d(b,{gv:()=>f,i2:()=>h,iX:()=>g,zm:()=>i});var d=c(55511);let e=new Map;function f(a,b){let c=(0,d.createHash)("sha256").update(b).digest("hex");return e.get(a)===c||(e.set(a,c),!1)}function g(a){e.delete(a)}function h(a,b){if(a===b)return;let c=e.get(a);e.delete(a),void 0!==c&&e.set(b,c)}function i(a,b){return"copilot"!==b?a:a.replace(/^[❯>]\s/gm," ")}},77093:(a,b,c)=>{"use strict";function d(a){return a instanceof Error?a.message:String(a)}c.d(b,{u1:()=>d})},81254:(a,b,c)=>{"use strict";function d(a){return"answer_only"===a||"answer_then_enter"===a}c.d(b,{M:()=>d})},82450:(a,b,c)=>{"use strict";c.d(b,{IS:()=>h,LH:()=>m,NN:()=>g,Sj:()=>o,aW:()=>n});var d=c(26283),e=c(13033),f=c(56263);function g(a){let b=(0,d.aJ)(a).split("\n"),c=(0,d.GT)(b),e=c>=0?b.slice(0,c):b,f=-1;for(let a=e.length-1;a>=0;a--)if(/^❯\s+\S/.test(e[a])){f=a;break}let g=f>=0?f+1:0,h=e.slice(g),i=[/CLAUDE_HOOKS_/,/\/bin\/claude/,/^claude\s*$/,/@.*\s+%\s*$/,/^[^⏺]*curl.*POST/,/^[^⏺]*Content-Type/,/^[^⏺]*export\s+CLAUDE_/,/^\s*$/,/^[╭╮╰╯│─\s]+$/,/^[│╭╮╰╯].*[│╭╮╰╯]$/,/Claude Code v[\d.]+/,/^Tips for getting started/,/^Welcome back/,/Run \/init to create/,/^Recent activity/,/^No recent activity/,/▐▛███▜▌|▝▜█████▛▘|▘▘ ▝▝/,/^\s*Opus \d+\.\d+\s*·\s*Claude Max/,/\.com's Organization/,/\?\s*for shortcuts\s*$/,/^─{10,}$/,/^❯\s*$/,d.fW],j=[];for(let a of h)!i.some(b=>b.test(a))&&a.trim()&&j.push(a);return j.join("\n").trim()}function h(a){let b=(0,d.aJ)(a).split("\n"),c=[],e=[/^maenokota@.*%/,/^zsh:/,/^feature-issue-\d+/,/^\s*$/],f=!1,g=[];for(let a of b){if(a.includes("✦")){f=!0;let b=a.indexOf("✦"),c=a.substring(b+1).trim();c&&g.push(c);continue}if(f){if(e.some(b=>b.test(a)))continue;g.push(a)}}if(g.length>0)return g.join("\n").trim();for(let a of b)e.some(b=>b.test(a))||c.push(a);return c.join("\n").trim()}let i=/^●\s+(?:Get |Read |Run |Search |Write |Delete |Edit |List |Create |Check |Fetch |Map |Explore |Execute |Find |Install |Update |Open |Close |Copy |Move |Rename |Set |Test |Build |Deploy |Start |Stop |Restart |Kill |Call |Send |Upload |Download |Compile |Analyze |Scan |Apply |Revert |Reset |Push |Pull |Clone |Merge |Commit |Checkout |Branch |Tag |Diff |Log |Show |Status |Init |Config |Add |Remove |Index |Query |Connect |Disconnect |Ping |Trace |Debug |Validate |Verify |Inspect |Monitor |Watch |Clean |Purge |Flush |Load |Save |Export |Import |Format |Lint |Parse |Generate |Transform |Convert |Migrate |Upgrade |Patch |Enable |Disable |Grant |Revoke |Approve |Deny |Lock |Unlock |Mount |Unmount |Attach |Detach |Register |Unregister |Subscribe |Unsubscribe |Publish |Unpublish |Encrypt |Decrypt |Sign |Hash |Encode |Decode |Compress |Decompress |Archive |Extract |Backup |Restore |Dump |Model changed to:)/,j=/^\d+\s+lines\.\.\.$/,k=/^[◐◑◒◓]/,l=/^(?:git\s+--no-pager|git\s+(?:log|diff|show|status|branch|remote|fetch|pull|push|merge|rebase|checkout|reset|stash|tag|config|clone|init|add|commit|rm|mv|bisect|grep|ls-files|rev-parse|describe|shortlog|blame|reflog|cherry-pick|revert|submodule|worktree)\b|npm\s+|npx\s+|node\s+|yarn\s+|pnpm\s+|cargo\s+|pip\s+|python\s+|ruby\s+|go\s+|rustc\s+|make\s+|cmake\s+|docker\s+|kubectl\s+|aws\s+|gcloud\s+|az\s+|terraform\s+|ansible\s+|curl\s+|wget\s+|ssh\s+|scp\s+|rsync\s+|find\s+|grep\s+|sed\s+|awk\s+|cat\s+|ls\s+|cd\s+|mkdir\s+|rm\s+|cp\s+|mv\s+|chmod\s+|chown\s+|echo\s+)/;function m(a){let b=(0,d.aJ)(a).split("\n"),c=-1;for(let a=b.length-1;a>=0;a--){let d=(0,e.IW)(b[a]);if(d&&/^❯\s+\S/.test(d)){c=a;break}}let f=c>=0?c+1:0,g=b.slice(f),h=[],m=!1,n=!1;for(let a of g){let b=(0,e.IW)(a);if(!(!b||d.J7.some(a=>a.test(b)))){if(i.test(b)){n=!0,m=!1;continue}if(k.test(b)){m=!0,n=!1;continue}if(!(j.test(b)||l.test(b)||/^❯\s*/.test(b)||/^[│└]/.test(b))){if(/^●/.test(b)){m=!1,n=!1,h.push(b.replace(/^●\s*/,""));continue}m||n||h.push(b)}}}return h.join("\n").trim()}function n(a){let b=a.split("\n"),c=[];for(let a=0;a<b.length;a++){let f=(0,e.l1)(b[a]);f&&d.Md.test(f)&&c.push(a)}let f=0;c.length>=2&&(f=c[c.length-2]+1);let g=[];for(let a=f;a<b.length;a++){let c=(0,e.l1)(b[a]);!(!c||d.sx.some(a=>a.test(c)))&&(d.Md.test(c)||g.push(c))}return g.join("\n").trim()}function o(a,b=f.Rf,c=f.ky){if(!a||a.length<=b)return a;let d=c+"\n",e=b-d.length;if(e<=0)return c.slice(0,b);let g=a.length-e;if(g>0&&g<a.length){let b=a.charCodeAt(g);b>=56320&&b<=57343&&(g+=1)}return d+a.slice(g)}},90164:(a,b,c)=>{"use strict";c.d(b,{Dk:()=>e,kD:()=>f});let d="https://github.com/Kewton/CommandMate",e=`${d}/releases/`,f=`${d}/blob/main/docs/security-guide.md`},93997:(a,b,c)=>{"use strict";c.d(b,{aq:()=>m,gm:()=>k,pc:()=>l,sl:()=>f,vF:()=>j,wd:()=>i,xE:()=>e});let d=(0,c(72626).h)("tmux-capture-cache"),e=1e4;function f(a,b=e){return b>0&&a>=b}function g(){return globalThis.__tmuxCaptureCache??=new Map}function h(){return globalThis.__tmuxCaptureCacheInflight??=new Map}function i(a,b){if(""===a)return"";let c=a.split("\n");return b>=c.length?a:c.slice(-b).join("\n")}function j(a,b,c){let d=g(),e=Date.now();for(let[a,b]of d)e-b.timestamp>5e3&&d.delete(a);if(d.size>=100&&!d.has(a)){let a=null,b=1/0;for(let[c,e]of d)e.timestamp<b&&(b=e.timestamp,a=c);a&&d.delete(a)}d.set(a,{output:b,capturedLines:c,timestamp:e})}function k(a){g().delete(a),d.debug("cache:invalidate",{sessionName:a})}function l(){g().clear(),h().clear()}async function m(a,b,c){let d=function(a,b){let c=g(),d=c.get(a);return d?Date.now()-d.timestamp>5e3?(c.delete(a),null):b>d.capturedLines?null:i(d.output,b):null}(a,b);if(null!==d)return d;let f=h(),k=f.get(a);if(k)return i(await k,b);let l=c();f.set(a,l);try{let c=await l;return c.length>0&&j(a,c,e),i(c,b)}finally{f.delete(a)}}},95220:(a,b,c)=>{"use strict";c.r(b),c.d(b,{accumulateTuiContent:()=>g.IZ,cleanClaudeResponse:()=>f.NN,cleanCopilotResponse:()=>f.LH,cleanGeminiResponse:()=>f.IS,cleanOpenCodeResponse:()=>f.aW,clearPromptHashCache:()=>h.iX,clearTuiAccumulator:()=>g.q1,extractCopilotContentLines:()=>g.o0,extractTuiContentLines:()=>g.K0,findOverlapIndex:()=>g.vQ,getAccumulatedContent:()=>g.Uz,getActivePollers:()=>d.KQ,initTuiAccumulator:()=>g.tb,isDuplicatePrompt:()=>h.gv,isOpenCodeComplete:()=>e.b,migrateResponsePollerWorktreeIds:()=>d.sR,normalizeCopilotLine:()=>g.IW,normalizePromptForDedup:()=>h.zm,renamePromptHashCacheKey:()=>h.i2,resolveExtractionStartIndex:()=>e.Q,startPolling:()=>d.g8,stopAllPolling:()=>d.fq,stopPolling:()=>d.Et,truncateMessage:()=>f.Sj});var d=c(45146),e=c(60),f=c(82450),g=c(13033),h=c(72457)},95595:(a,b,c)=>{"use strict";c.d(b,{WC:()=>m,gv:()=>h,ug:()=>i});var d=c(26283),e=c(25129),f=c(68652),g=c(46423);let h={PROMPT_DETECTED:"prompt_detected",THINKING_INDICATOR:"thinking_indicator",OPENCODE_PROCESSING_INDICATOR:"opencode_processing_indicator",OPENCODE_SELECTION_LIST:"opencode_selection_list",CLAUDE_SELECTION_LIST:"claude_selection_list",COPILOT_SELECTION_LIST:"copilot_selection_list",CODEX_SELECTION_LIST:"codex_selection_list",CODEX_PAGER:"codex_pager",ANTIGRAVITY_SELECTION_LIST:"antigravity_selection_list",OPENCODE_RESPONSE_COMPLETE:"opencode_response_complete",INPUT_PROMPT:"input_prompt",NO_RECENT_OUTPUT:"no_recent_output",DEFAULT:"default"},i=new Set([h.OPENCODE_SELECTION_LIST,h.CLAUDE_SELECTION_LIST,h.COPILOT_SELECTION_LIST,h.CODEX_SELECTION_LIST,h.CODEX_PAGER,h.ANTIGRAVITY_SELECTION_LIST]),j=/press\s+(?:number|enter)\s+to\s+confirm/i,k=/^\s*[❯›●]?\s*\d{1,2}[.)]\s/;function l(a){let b=-1;for(let c=a.length-1;c>=Math.max(0,a.length-10);c--)if(d.aW.test(a[c])){b=c;break}let c=b>=0?b:a.length,e=-1,f=-1;for(let b=0;b<c;b++){let c=a[b],g=c.trim();""!==g&&((j.test(g)||k.test(g))&&(e=b),(0,d.ut)("codex",c)&&(f=b))}return e>=0&&f>e}function m(a,b,c){let i=(0,f.N)((0,d.aJ)(a)),j=i.split("\n"),k=j.length-1;for(;k>=0&&""===j[k].trim();)k--;let m=j.slice(0,k+1),n=m.slice(-15).join("\n"),o=m.slice(-g.$).join("\n"),p=m.slice(-30).join("\n");if("copilot"===b&&d.Mi.test(p)){let a=(0,d.KO)(b),c=(0,e.gF)((0,d._A)(i),a);return c.isPrompt&&(c.promptData?.options?.length??0)<=3?{status:"waiting",confidence:"high",reason:"prompt_detected",hasActivePrompt:!0,promptDetection:c}:{status:"waiting",confidence:"high",reason:h.COPILOT_SELECTION_LIST,hasActivePrompt:!1,promptDetection:c}}let q=m.slice(-15).join("\n");if("copilot"===b&&(0,d.ut)(b,q)){let a=(0,d.KO)(b);return{status:"running",confidence:"high",reason:"thinking_indicator",hasActivePrompt:!1,promptDetection:(0,e.gF)((0,d._A)(i),a)}}if("codex"===b&&d.pn.test(n)){let a=(0,d.KO)(b),c=(0,e.gF)((0,d._A)(i),a);return{status:"waiting",confidence:"high",reason:h.CODEX_PAGER,hasActivePrompt:!1,promptDetection:c}}if("codex"===b){let a=-1;for(let b=m.length-1;b>=Math.max(0,m.length-10);b--)if(d.aW.test(m[b])){a=b;break}let c=a>=0?a-1:m.length-1;for(;c>=0&&""===m[c].trim();)c--;if(c>=0){let a=m.slice(Math.max(0,c-15+1),c+1).join("\n");if(d.Jn.test(a)){let c=(0,d.KO)(b),f=(0,e.gF)((0,d._A)(i),c);return f.isPrompt&&((f.promptData?.question?.trim()??"").endsWith("?")||d.Dd.test(a))&&!l(m)?{status:"waiting",confidence:"high",reason:h.PROMPT_DETECTED,hasActivePrompt:!0,promptDetection:f}:{status:"waiting",confidence:"high",reason:h.CODEX_SELECTION_LIST,hasActivePrompt:!1,promptDetection:f}}}}if("antigravity"===b&&d.kT.test(n)){let a=(0,d.KO)(b),c=(0,e.gF)((0,d._A)(i),a);return{status:"waiting",confidence:"high",reason:h.ANTIGRAVITY_SELECTION_LIST,hasActivePrompt:!1,promptDetection:c}}let r=(0,d.KO)(b),s="opencode"===b||"codex"===b||"claude"===b||"copilot"===b?(0,d._A)(i):(0,d._A)(n),t=(0,e.gF)(s,r);if(t.isPrompt)if(!("codex"===b&&l(m)))return{status:"waiting",confidence:"high",reason:"prompt_detected",hasActivePrompt:!0,promptDetection:t};else t={...t,isPrompt:!1,promptData:void 0};if("claude"===b&&d.XY.test(n))return{status:"waiting",confidence:"high",reason:h.CLAUDE_SELECTION_LIST,hasActivePrompt:!1,promptDetection:t};if((0,d.ut)(b,o))return{status:"running",confidence:"high",reason:"thinking_indicator",hasActivePrompt:!1,promptDetection:t};if("claude"===b&&d.aU.test(n))return{status:"running",confidence:"high",reason:h.THINKING_INDICATOR,hasActivePrompt:!1,promptDetection:t};if("opencode"===b){if(d.kD.test(n))return{status:"running",confidence:"high",reason:"opencode_processing_indicator",hasActivePrompt:!1,promptDetection:t};let a=(0,d._A)(i).split("\n"),b=Math.max(0,a.length-7);for(let c=a.length-1;c>=Math.max(0,a.length-10);c--)if(/ctrl\+[tp]/.test(a[c])){b=Math.max(0,c-2);break}let c=a.slice(0,b),e=c.length-1;for(;e>=0&&""===c[e].trim();)e--;if(e>=0){let a=c.slice(Math.max(0,e-g.$+1),e+1).join("\n");if((0,d.ut)("opencode",a))return{status:"running",confidence:"high",reason:"thinking_indicator",hasActivePrompt:!1,promptDetection:t};let b=c.slice(Math.max(0,e-15+1),e+1).join("\n"),f=c.join("\n");if(d.LO.test(f))return{status:"waiting",confidence:"high",reason:h.OPENCODE_SELECTION_LIST,hasActivePrompt:!1,promptDetection:t};if(d.Md.test(b))return{status:"ready",confidence:"high",reason:h.OPENCODE_RESPONSE_COMPLETE,hasActivePrompt:!1,promptDetection:t};let{promptPattern:i}=(0,d._X)("opencode");if(i.test(b))return{status:"ready",confidence:"high",reason:h.PROMPT_DETECTED,hasActivePrompt:!0,promptDetection:t}}}if("codex"===b){let a=-1;for(let b=m.length-1;b>=Math.max(0,m.length-10);b--)if(d.aW.test(m[b])){a=b;break}if(a>=0){let b=a-1;for(;b>=0&&""===m[b].trim();)b--;if(b>=0){let a=m.slice(Math.max(0,b-g.$+1),b+1).join("\n");if((0,d.ut)("codex",a))return{status:"running",confidence:"high",reason:"thinking_indicator",hasActivePrompt:!1,promptDetection:t};let c=m[b].trim();return d.gm.test(c)?{status:"ready",confidence:"high",reason:"input_prompt",hasActivePrompt:!1,promptDetection:t}:{status:"running",confidence:"high",reason:"thinking_indicator",hasActivePrompt:!1,promptDetection:t}}}else{let a=m.length-1;for(;a>=0&&""===m[a].trim();)a--;if(!(a>=0&&d.gm.test(m[a].trim()))&&(0,d.ut)("codex",n))return{status:"running",confidence:"high",reason:"thinking_indicator",hasActivePrompt:!1,promptDetection:t}}}if("antigravity"===b){if((0,d.ut)("antigravity",n))return{status:"running",confidence:"high",reason:h.THINKING_INDICATOR,hasActivePrompt:!1,promptDetection:t};let{promptPattern:a}=(0,d._X)("antigravity");if(a.test(n))return{status:"ready",confidence:"high",reason:h.INPUT_PROMPT,hasActivePrompt:!1,promptDetection:t}}let{promptPattern:u}=(0,d._X)(b);return u.test(n)?{status:"ready",confidence:"high",reason:"input_prompt",hasActivePrompt:!1,promptDetection:t}:c&&Date.now()-c.getTime()>5e3?{status:"ready",confidence:"low",reason:"no_recent_output",hasActivePrompt:!1,promptDetection:t}:{status:"running",confidence:"low",reason:"default",hasActivePrompt:!1,promptDetection:t}}},99508:(a,b,c)=>{"use strict";c.r(b),c.d(b,{INTERACTION_SNAPSHOT_RETRY_DELAYS_MS:()=>l,__resetTerminalBroadcastState:()=>s,broadcastSessionStatus:()=>r,broadcastTerminalSnapshot:()=>m,broadcastTerminalSnapshotAfterInteraction:()=>q});var d=c(69297),e=c(88807),f=c(34892),g=c(72626),h=c(31268),i=c(93997);let j=(0,g.h)("terminal-broadcast"),k=new Map,l=[100,250,500,750];async function m(a,b,c){if((0,d.h7)(a))try{let d=(0,e.getDbInstance)(),g=await (0,f.$)(d,a,b,c);p(a,b,g,c)}catch(b){j.error("terminal-snapshot:failed",{worktreeId:a,error:b instanceof Error?b.message:String(b)})}}function n(a){return JSON.stringify([a.fullOutput??"",a.isRunning,a.thinking??!1,a.isPromptWaiting??!1,a.isSelectionListActive??!1,a.isPagerActive??!1,a.isUnclassifiedActive??!1])}async function o(a,b,c){let d=h.s.getInstance().getTool(b);return(0,i.gm)(d.getSessionName(a,c)),(0,f.$)((0,e.getDbInstance)(),a,b,c)}function p(a,b,c,e){let f=e??b,g=`${a}:${b}:${f}`;(0,d.mq)(a,{type:"terminal_snapshot",worktreeId:a,cliToolId:b,instanceId:f,output:c.fullOutput??"",isRunning:c.isRunning,thinking:c.thinking??!1,isPromptWaiting:c.isPromptWaiting??!1,promptData:c.promptData??null,isSelectionListActive:c.isSelectionListActive??!1,isPagerActive:c.isPagerActive??!1,isUnclassifiedActive:c.isUnclassifiedActive??!1,version:function(a){let b=(k.get(a)??0)+1;return k.set(a,b),b}(g)})}async function q(a,b,c,e=l){if((0,d.h7)(a))try{let d=await o(a,b,c),f=n(d);for(let g of(p(a,b,d,c),e)){await new Promise(a=>setTimeout(a,g));let d=await o(a,b,c);if(n(d)!==f)return void p(a,b,d,c)}}catch(d){j.error("terminal-snapshot:interaction-refresh-failed",{worktreeId:a,cliToolId:b,instanceId:c,error:d instanceof Error?d.message:String(d)})}}function r(a,b,c){(0,d.mq)(a,{type:"session_status_changed",worktreeId:a,isRunning:b,cliTool:c?.cliTool??null,instance:c?.instance??null})}function s(){k.clear()}}};
@@ -1,4 +1,4 @@
1
- "use strict";exports.id=5381,exports.ids=[5381],exports.modules={4868:(a,b,c)=>{function d(a,b){let c=a.prepare(`
1
+ "use strict";exports.id=5998,exports.ids=[5998],exports.modules={3421:(a,b,c)=>{Object.defineProperty(b,"I",{enumerable:!0,get:function(){return g}});let d=c(71237),e=c(55088),f=c(17679);async function g(a,b,c,g){if((0,d.isNodeNextResponse)(b)){var h;b.statusCode=c.status,b.statusMessage=c.statusText;let d=["set-cookie","www-authenticate","proxy-authenticate","vary"];null==(h=c.headers)||h.forEach((a,c)=>{if("x-middleware-set-cookie"!==c.toLowerCase())if("set-cookie"===c.toLowerCase())for(let d of(0,f.splitCookiesString)(a))b.appendHeader(c,d);else{let e=void 0!==b.getHeader(c);(d.includes(c.toLowerCase())||!e)&&b.appendHeader(c,a)}});let{originalResponse:i}=b;c.body&&"HEAD"!==a.method?await (0,e.pipeToNodeResponse)(c.body,i,g):i.end()}}},4868:(a,b,c)=>{function d(a,b){let c=a.prepare(`
2
2
  SELECT date, content, generated_by_tool, model, created_at, updated_at
3
3
  FROM daily_reports
4
4
  WHERE date = ?
@@ -82,4 +82,4 @@ ${d}`:""].join("\n"))),exitCode:"number"==typeof e?e:null,status:h?"timeout":"fa
82
82
  WHERE created_at >= ? AND created_at < ?
83
83
  AND event IN ('prompt_answered_human', 'prompt_answered_auto')
84
84
  GROUP BY event
85
- `).all(b,c));return{humanResponds:d.get("prompt_answered_human")??0,autoAnswered:d.get("prompt_answered_auto")??0}}(a,l,k):{humanResponds:0,autoAnswered:0},suppressedByPolicy:null}}}},70673:(a,b,c)=>{function d(a){return a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function e(a,b=30){return a.length<=b?a:`${a.substring(0,b-3)}...`}c.d(b,{Nt:()=>d,W5:()=>e,wj:()=>g});class f extends Error{constructor(a){super(a),this.name="TimeoutError"}}function g(a,b,c){return new Promise((d,e)=>{let g=setTimeout(()=>{void 0!==c?d(c):e(new f(`Operation timed out after ${b}ms`))},b);a.then(a=>{clearTimeout(g),d(a)},a=>{clearTimeout(g),e(a)})})}},73434:(a,b,c)=>{c.d(b,{h:()=>e});let d=["CLAUDECODE","CM_AUTH_TOKEN_HASH","CM_AUTH_EXPIRE","CM_HTTPS_KEY","CM_HTTPS_CERT","CM_ALLOWED_IPS","CM_TRUST_PROXY","CM_DB_PATH","GH_DEBUG"];function e(){let a={...process.env};for(let b of d)delete a[b];return a}}};
85
+ `).all(b,c));return{humanResponds:d.get("prompt_answered_human")??0,autoAnswered:d.get("prompt_answered_auto")??0}}(a,l,k):{humanResponds:0,autoAnswered:0},suppressedByPolicy:null}}}},70673:(a,b,c)=>{function d(a){return a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function e(a,b=30){return a.length<=b?a:`${a.substring(0,b-3)}...`}c.d(b,{Nt:()=>d,W5:()=>e,wj:()=>g});class f extends Error{constructor(a){super(a),this.name="TimeoutError"}}function g(a,b,c){return new Promise((d,e)=>{let g=setTimeout(()=>{void 0!==c?d(c):e(new f(`Operation timed out after ${b}ms`))},b);a.then(a=>{clearTimeout(g),d(a)},a=>{clearTimeout(g),e(a)})})}},73434:(a,b,c)=>{c.d(b,{h:()=>e});let d=["CLAUDECODE","CM_AUTH_TOKEN_HASH","CM_AUTH_EXPIRE","CM_HTTPS_KEY","CM_HTTPS_CERT","CM_ALLOWED_IPS","CM_TRUST_PROXY","CM_DB_PATH","GH_DEBUG"];function e(){let a={...process.env};for(let b of d)delete a[b];return a}},95736:(a,b,c)=>{a.exports=c(44870)}};
@@ -1 +1 @@
1
- "use strict";exports.id=6130,exports.ids=[6130],exports.modules={26838:(a,b,c)=>{c.d(b,{Mj:()=>k,Sw:()=>j,lX:()=>l});var d=c(29021),e=c(33873),f=c(90164);let g=/^v?\d+\.\d+\.\d+$/,h=/^[a-zA-Z0-9.\-\s_v]+$/,i=globalThis.__versionCheckCache??(globalThis.__versionCheckCache={result:null,fetchedAt:0,rateLimitResetAt:null});function j(){return function(){try{let a=(0,d.readFileSync)((0,e.join)(process.cwd(),"package.json"),"utf-8"),b=JSON.parse(a);if("commandmate"===b.name&&"string"==typeof b.version&&b.version.length>0)return b.version;return null}catch{return null}}()??"0.18.0"}function k(){return j()}async function l(){try{var a,b,c;if(null!==i.result&&Date.now()-i.fetchedAt<36e5||i.rateLimitResetAt&&(!(Date.now()>=i.rateLimitResetAt)||(i.rateLimitResetAt=null,0)))return i.result;let d=await fetch("https://api.github.com/repos/Kewton/CommandMate/releases/latest",{headers:{Accept:"application/vnd.github+json","User-Agent":`CommandMate/${k()}`},cache:"no-store",signal:AbortSignal.timeout(5e3)});if(403===d.status)return function(a){let b=a.headers.get("X-RateLimit-Reset");b?i.rateLimitResetAt=1e3*parseInt(b,10):i.rateLimitResetAt=Date.now()+36e5}(d),i.result;if(!d.ok)return i.result;let e=await d.json(),j=k(),l=e.tag_name.replace(/^v/,""),m={hasUpdate:function(a,b){if(!g.test(a)||!g.test(b))return!1;let c=a=>a.replace(/^v/,"").split(".").map(Number),[d,e,f]=c(a),[h,i,j]=c(b);return h!==d?h>d:i!==e?i>e:j>f}(j,e.tag_name),currentVersion:j,latestVersion:l,releaseUrl:(a=e.html_url).startsWith(f.Dk)?a:null,releaseName:(b=e.name,c=e.tag_name,h.test(b)&&b.length<=128?b:c),publishedAt:e.published_at};return i.result=m,i.fetchedAt=Date.now(),m}catch{return i.result}}},88573:(a,b,c)=>{c.d(b,{Lw:()=>s});let d="https://raw.githubusercontent.com/Kewton/commandmate-skills/main/catalog/v1/catalog.json",e=[d],f=/^[A-Za-z0-9/+=_."-]{1,128}$/;var g=c(72626),h=c(13075);let i=(0,g.h)("lib/skills/catalog-client"),j={FETCH_FAILED:"SKILL_CATALOG_FETCH_FAILED",RATE_LIMITED:"SKILL_CATALOG_RATE_LIMITED",OVERSIZED:"SKILL_CATALOG_OVERSIZED",MALFORMED:"SKILL_CATALOG_MALFORMED",INVALID_SCHEMA:"SKILL_CATALOG_INVALID_SCHEMA"},k=globalThis.__skillCatalogCache??={catalog:null,validatedAt:0,confirmedAt:0,etag:null,revision:null,rateLimitResetAt:null,inflight:null};class l extends Error{}let m={[j.FETCH_FAILED]:"The Skill Catalog could not be retrieved.",[j.RATE_LIMITED]:"The Skill Catalog origin is rate limiting requests.",[j.OVERSIZED]:"The Skill Catalog response exceeded the allowed size.",[j.MALFORMED]:"The Skill Catalog response was not valid JSON.",[j.INVALID_SCHEMA]:"The Skill Catalog response did not match the supported Catalog schema."};function n(a){return new Date(a).toISOString()}function o(a,b,c){return{catalog:a,fetchedAt:n(k.validatedAt),revalidatedAt:n(k.confirmedAt),state:b,stale:"stale"===b,offline:"stale"===b,staleReason:c,source:{repository:"Kewton/commandmate-skills",ref:"main",revision:k.revision}}}function p(a,b=[]){return k.catalog?{ok:!0,snapshot:o(k.catalog,"stale",a)}:{ok:!1,failure:{code:a,message:m[a],errors:b}}}async function q(a,b){let c=a.headers.get("Content-Length");if(null!==c){let a=Number(c);if(!Number.isFinite(a)||a<0||a>b)throw new l("content-length out of bounds")}let d=a.body;if(!d||"function"!=typeof d.getReader){let c=await a.text();if(new TextEncoder().encode(c).length>b)throw new l("body exceeded size cap");return c}let e=d.getReader(),f=[],g=0;for(;;){let{done:a,value:c}=await e.read();if(a)break;if(c){if((g+=c.byteLength)>b)throw await e.cancel(),new l("body exceeded size cap");f.push(c)}}let h=new Uint8Array(g),i=0;for(let a of f)h.set(a,i),i+=a.byteLength;return new TextDecoder("utf-8").decode(h)}async function r(a){let b,c,g;if(!e.includes(d))return p(j.FETCH_FAILED);let m={Accept:"application/json","User-Agent":`CommandMate/${a}`};null!==k.catalog&&null!==k.etag&&(m["If-None-Match"]=k.etag);try{b=await fetch(d,{headers:m,cache:"no-store",signal:AbortSignal.timeout(5e3)})}catch{return i.warn("catalog-fetch-failed",{reason:j.FETCH_FAILED}),p(j.FETCH_FAILED)}if(304===b.status&&null!==k.catalog)return k.confirmedAt=Date.now(),{ok:!0,snapshot:o(k.catalog,"revalidated",null)};if(403===b.status||429===b.status)return!function(a){let b=Date.now(),c=b+864e5,d=a.headers.get("X-RateLimit-Reset");if(null!==d){let a=Number(d);if(Number.isFinite(a)&&a>0){k.rateLimitResetAt=Math.min(1e3*a,c);return}}let e=a.headers.get("Retry-After");if(null!==e){let a=Number(e);if(Number.isFinite(a)&&a>0){k.rateLimitResetAt=Math.min(b+1e3*a,c);return}}k.rateLimitResetAt=b+36e5}(b),i.warn("catalog-rate-limited",{status:b.status}),p(j.RATE_LIMITED);if(!b.ok)return i.warn("catalog-fetch-failed",{status:b.status}),p(j.FETCH_FAILED);try{c=await q(b,1048576)}catch(b){let a=b instanceof l?j.OVERSIZED:j.FETCH_FAILED;return i.warn("catalog-body-rejected",{reason:a}),p(a)}try{g=JSON.parse(c)}catch{return i.warn("catalog-malformed",{reason:j.MALFORMED}),p(j.MALFORMED)}let n=(0,h.JJ)(g);if(!n.ok)return i.warn("catalog-invalid-schema",{errorCount:n.errors.length}),p(j.INVALID_SCHEMA,n.errors);let r=Date.now();return k.catalog=n.value,k.validatedAt=r,k.confirmedAt=r,k.etag=b.headers.get("ETag"),k.revision=function(a){if(null===a)return null;let b=a.trim();return f.test(b)?b:null}(k.etag),{ok:!0,snapshot:o(n.value,"fresh",null)}}async function s(a={}){let{hostVersion:b="0.0.0",forceRevalidate:c=!1}=a;return!c&&null!==k.catalog&&Date.now()-k.confirmedAt<9e5&&null!==k.catalog?{ok:!0,snapshot:o(k.catalog,"cached",null)}:null!==k.rateLimitResetAt&&(!(Date.now()>=k.rateLimitResetAt)||(k.rateLimitResetAt=null,0))?p(j.RATE_LIMITED):(null===k.inflight&&(k.inflight=r(b).finally(()=>{k.inflight=null})),k.inflight)}},90164:(a,b,c)=>{c.d(b,{Dk:()=>e,kD:()=>f});let d="https://github.com/Kewton/CommandMate",e=`${d}/releases/`,f=`${d}/blob/main/docs/security-guide.md`}};
1
+ "use strict";exports.id=6130,exports.ids=[6130],exports.modules={26838:(a,b,c)=>{c.d(b,{Mj:()=>k,Sw:()=>j,lX:()=>l});var d=c(29021),e=c(33873),f=c(90164);let g=/^v?\d+\.\d+\.\d+$/,h=/^[a-zA-Z0-9.\-\s_v]+$/,i=globalThis.__versionCheckCache??(globalThis.__versionCheckCache={result:null,fetchedAt:0,rateLimitResetAt:null});function j(){return function(){try{let a=(0,d.readFileSync)((0,e.join)(process.cwd(),"package.json"),"utf-8"),b=JSON.parse(a);if("commandmate"===b.name&&"string"==typeof b.version&&b.version.length>0)return b.version;return null}catch{return null}}()??"0.20.0"}function k(){return j()}async function l(){try{var a,b,c;if(null!==i.result&&Date.now()-i.fetchedAt<36e5||i.rateLimitResetAt&&(!(Date.now()>=i.rateLimitResetAt)||(i.rateLimitResetAt=null,0)))return i.result;let d=await fetch("https://api.github.com/repos/Kewton/CommandMate/releases/latest",{headers:{Accept:"application/vnd.github+json","User-Agent":`CommandMate/${k()}`},cache:"no-store",signal:AbortSignal.timeout(5e3)});if(403===d.status)return function(a){let b=a.headers.get("X-RateLimit-Reset");b?i.rateLimitResetAt=1e3*parseInt(b,10):i.rateLimitResetAt=Date.now()+36e5}(d),i.result;if(!d.ok)return i.result;let e=await d.json(),j=k(),l=e.tag_name.replace(/^v/,""),m={hasUpdate:function(a,b){if(!g.test(a)||!g.test(b))return!1;let c=a=>a.replace(/^v/,"").split(".").map(Number),[d,e,f]=c(a),[h,i,j]=c(b);return h!==d?h>d:i!==e?i>e:j>f}(j,e.tag_name),currentVersion:j,latestVersion:l,releaseUrl:(a=e.html_url).startsWith(f.Dk)?a:null,releaseName:(b=e.name,c=e.tag_name,h.test(b)&&b.length<=128?b:c),publishedAt:e.published_at};return i.result=m,i.fetchedAt=Date.now(),m}catch{return i.result}}},88573:(a,b,c)=>{c.d(b,{Lw:()=>s});let d="https://raw.githubusercontent.com/Kewton/commandmate-skills/main/catalog/v1/catalog.json",e=[d],f=/^[A-Za-z0-9/+=_."-]{1,128}$/;var g=c(72626),h=c(13075);let i=(0,g.h)("lib/skills/catalog-client"),j={FETCH_FAILED:"SKILL_CATALOG_FETCH_FAILED",RATE_LIMITED:"SKILL_CATALOG_RATE_LIMITED",OVERSIZED:"SKILL_CATALOG_OVERSIZED",MALFORMED:"SKILL_CATALOG_MALFORMED",INVALID_SCHEMA:"SKILL_CATALOG_INVALID_SCHEMA"},k=globalThis.__skillCatalogCache??={catalog:null,validatedAt:0,confirmedAt:0,etag:null,revision:null,rateLimitResetAt:null,inflight:null};class l extends Error{}let m={[j.FETCH_FAILED]:"The Skill Catalog could not be retrieved.",[j.RATE_LIMITED]:"The Skill Catalog origin is rate limiting requests.",[j.OVERSIZED]:"The Skill Catalog response exceeded the allowed size.",[j.MALFORMED]:"The Skill Catalog response was not valid JSON.",[j.INVALID_SCHEMA]:"The Skill Catalog response did not match the supported Catalog schema."};function n(a){return new Date(a).toISOString()}function o(a,b,c){return{catalog:a,fetchedAt:n(k.validatedAt),revalidatedAt:n(k.confirmedAt),state:b,stale:"stale"===b,offline:"stale"===b,staleReason:c,source:{repository:"Kewton/commandmate-skills",ref:"main",revision:k.revision}}}function p(a,b=[]){return k.catalog?{ok:!0,snapshot:o(k.catalog,"stale",a)}:{ok:!1,failure:{code:a,message:m[a],errors:b}}}async function q(a,b){let c=a.headers.get("Content-Length");if(null!==c){let a=Number(c);if(!Number.isFinite(a)||a<0||a>b)throw new l("content-length out of bounds")}let d=a.body;if(!d||"function"!=typeof d.getReader){let c=await a.text();if(new TextEncoder().encode(c).length>b)throw new l("body exceeded size cap");return c}let e=d.getReader(),f=[],g=0;for(;;){let{done:a,value:c}=await e.read();if(a)break;if(c){if((g+=c.byteLength)>b)throw await e.cancel(),new l("body exceeded size cap");f.push(c)}}let h=new Uint8Array(g),i=0;for(let a of f)h.set(a,i),i+=a.byteLength;return new TextDecoder("utf-8").decode(h)}async function r(a){let b,c,g;if(!e.includes(d))return p(j.FETCH_FAILED);let m={Accept:"application/json","User-Agent":`CommandMate/${a}`};null!==k.catalog&&null!==k.etag&&(m["If-None-Match"]=k.etag);try{b=await fetch(d,{headers:m,cache:"no-store",signal:AbortSignal.timeout(5e3)})}catch{return i.warn("catalog-fetch-failed",{reason:j.FETCH_FAILED}),p(j.FETCH_FAILED)}if(304===b.status&&null!==k.catalog)return k.confirmedAt=Date.now(),{ok:!0,snapshot:o(k.catalog,"revalidated",null)};if(403===b.status||429===b.status)return!function(a){let b=Date.now(),c=b+864e5,d=a.headers.get("X-RateLimit-Reset");if(null!==d){let a=Number(d);if(Number.isFinite(a)&&a>0){k.rateLimitResetAt=Math.min(1e3*a,c);return}}let e=a.headers.get("Retry-After");if(null!==e){let a=Number(e);if(Number.isFinite(a)&&a>0){k.rateLimitResetAt=Math.min(b+1e3*a,c);return}}k.rateLimitResetAt=b+36e5}(b),i.warn("catalog-rate-limited",{status:b.status}),p(j.RATE_LIMITED);if(!b.ok)return i.warn("catalog-fetch-failed",{status:b.status}),p(j.FETCH_FAILED);try{c=await q(b,1048576)}catch(b){let a=b instanceof l?j.OVERSIZED:j.FETCH_FAILED;return i.warn("catalog-body-rejected",{reason:a}),p(a)}try{g=JSON.parse(c)}catch{return i.warn("catalog-malformed",{reason:j.MALFORMED}),p(j.MALFORMED)}let n=(0,h.JJ)(g);if(!n.ok)return i.warn("catalog-invalid-schema",{errorCount:n.errors.length}),p(j.INVALID_SCHEMA,n.errors);let r=Date.now();return k.catalog=n.value,k.validatedAt=r,k.confirmedAt=r,k.etag=b.headers.get("ETag"),k.revision=function(a){if(null===a)return null;let b=a.trim();return f.test(b)?b:null}(k.etag),{ok:!0,snapshot:o(n.value,"fresh",null)}}async function s(a={}){let{hostVersion:b="0.0.0",forceRevalidate:c=!1}=a;return!c&&null!==k.catalog&&Date.now()-k.confirmedAt<9e5&&null!==k.catalog?{ok:!0,snapshot:o(k.catalog,"cached",null)}:null!==k.rateLimitResetAt&&(!(Date.now()>=k.rateLimitResetAt)||(k.rateLimitResetAt=null,0))?p(j.RATE_LIMITED):(null===k.inflight&&(k.inflight=r(b).finally(()=>{k.inflight=null})),k.inflight)}},90164:(a,b,c)=>{c.d(b,{Dk:()=>e,kD:()=>f});let d="https://github.com/Kewton/CommandMate",e=`${d}/releases/`,f=`${d}/blob/main/docs/security-guide.md`}};