commandmate 0.30.2 → 0.31.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 (440) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-build-manifest.json +160 -160
  3. package/.next/app-path-routes-manifest.json +27 -27
  4. package/.next/build-manifest.json +2 -2
  5. package/.next/prerender-manifest.json +9 -9
  6. package/.next/required-server-files.json +1 -1
  7. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  8. package/.next/server/app/api/agents/update/route_client-reference-manifest.js +1 -1
  9. package/.next/server/app/api/agents/versions/route_client-reference-manifest.js +1 -1
  10. package/.next/server/app/api/app/update/route_client-reference-manifest.js +1 -1
  11. package/.next/server/app/api/app/update-check/route.js +1 -1
  12. package/.next/server/app/api/app/update-check/route_client-reference-manifest.js +1 -1
  13. package/.next/server/app/api/assistant/conversation/route.js +1 -1
  14. package/.next/server/app/api/assistant/conversation/route.js.nft.json +1 -1
  15. package/.next/server/app/api/assistant/conversation/route_client-reference-manifest.js +1 -1
  16. package/.next/server/app/api/assistant/current-output/route.js +1 -1
  17. package/.next/server/app/api/assistant/current-output/route.js.nft.json +1 -1
  18. package/.next/server/app/api/assistant/current-output/route_client-reference-manifest.js +1 -1
  19. package/.next/server/app/api/assistant/messages/route.js +1 -1
  20. package/.next/server/app/api/assistant/messages/route.js.nft.json +1 -1
  21. package/.next/server/app/api/assistant/messages/route_client-reference-manifest.js +1 -1
  22. package/.next/server/app/api/assistant/session/route.js +1 -1
  23. package/.next/server/app/api/assistant/session/route.js.nft.json +1 -1
  24. package/.next/server/app/api/assistant/session/route_client-reference-manifest.js +1 -1
  25. package/.next/server/app/api/assistant/start/route.js +3 -3
  26. package/.next/server/app/api/assistant/start/route.js.nft.json +1 -1
  27. package/.next/server/app/api/assistant/start/route_client-reference-manifest.js +1 -1
  28. package/.next/server/app/api/assistant/terminal/route.js +4 -4
  29. package/.next/server/app/api/assistant/terminal/route.js.nft.json +1 -1
  30. package/.next/server/app/api/assistant/terminal/route_client-reference-manifest.js +1 -1
  31. package/.next/server/app/api/assistant/tools/route.js +1 -1
  32. package/.next/server/app/api/assistant/tools/route.js.nft.json +1 -1
  33. package/.next/server/app/api/assistant/tools/route_client-reference-manifest.js +1 -1
  34. package/.next/server/app/api/auth/login/route_client-reference-manifest.js +1 -1
  35. package/.next/server/app/api/auth/logout/route_client-reference-manifest.js +1 -1
  36. package/.next/server/app/api/auth/status/route_client-reference-manifest.js +1 -1
  37. package/.next/server/app/api/capabilities/route.js +1 -1
  38. package/.next/server/app/api/capabilities/route_client-reference-manifest.js +1 -1
  39. package/.next/server/app/api/daily-summary/route_client-reference-manifest.js +1 -1
  40. package/.next/server/app/api/daily-summary/status/route_client-reference-manifest.js +1 -1
  41. package/.next/server/app/api/external-apps/[id]/health/route_client-reference-manifest.js +1 -1
  42. package/.next/server/app/api/external-apps/[id]/route_client-reference-manifest.js +1 -1
  43. package/.next/server/app/api/external-apps/route_client-reference-manifest.js +1 -1
  44. package/.next/server/app/api/fs/browse/route_client-reference-manifest.js +1 -1
  45. package/.next/server/app/api/fs/recent-paths/route_client-reference-manifest.js +1 -1
  46. package/.next/server/app/api/hooks/agent-event/route.js +1 -1
  47. package/.next/server/app/api/hooks/agent-event/route.js.nft.json +1 -1
  48. package/.next/server/app/api/hooks/agent-event/route_client-reference-manifest.js +1 -1
  49. package/.next/server/app/api/hooks/claude-done/route.js +1 -1
  50. package/.next/server/app/api/hooks/claude-done/route.js.nft.json +1 -1
  51. package/.next/server/app/api/hooks/claude-done/route_client-reference-manifest.js +1 -1
  52. package/.next/server/app/api/hooks/permission-request/route.js +1 -1
  53. package/.next/server/app/api/hooks/permission-request/route.js.nft.json +1 -1
  54. package/.next/server/app/api/hooks/permission-request/route_client-reference-manifest.js +1 -1
  55. package/.next/server/app/api/metrics/vibe/route_client-reference-manifest.js +1 -1
  56. package/.next/server/app/api/ollama/models/route_client-reference-manifest.js +1 -1
  57. package/.next/server/app/api/push/escalation/route_client-reference-manifest.js +1 -1
  58. package/.next/server/app/api/push/subscriptions/route_client-reference-manifest.js +1 -1
  59. package/.next/server/app/api/push/vapid/route_client-reference-manifest.js +1 -1
  60. package/.next/server/app/api/remote/pair/route_client-reference-manifest.js +1 -1
  61. package/.next/server/app/api/repositories/[id]/route_client-reference-manifest.js +1 -1
  62. package/.next/server/app/api/repositories/[id]/todos/[todoId]/route_client-reference-manifest.js +1 -1
  63. package/.next/server/app/api/repositories/[id]/todos/route_client-reference-manifest.js +1 -1
  64. package/.next/server/app/api/repositories/clone/[jobId]/route.js +1 -1
  65. package/.next/server/app/api/repositories/clone/[jobId]/route.js.nft.json +1 -1
  66. package/.next/server/app/api/repositories/clone/[jobId]/route_client-reference-manifest.js +1 -1
  67. package/.next/server/app/api/repositories/clone/route.js +1 -1
  68. package/.next/server/app/api/repositories/clone/route.js.nft.json +1 -1
  69. package/.next/server/app/api/repositories/clone/route_client-reference-manifest.js +1 -1
  70. package/.next/server/app/api/repositories/excluded/route_client-reference-manifest.js +1 -1
  71. package/.next/server/app/api/repositories/restore/route.js +1 -1
  72. package/.next/server/app/api/repositories/restore/route.js.nft.json +1 -1
  73. package/.next/server/app/api/repositories/restore/route_client-reference-manifest.js +1 -1
  74. package/.next/server/app/api/repositories/route.js +1 -1
  75. package/.next/server/app/api/repositories/route.js.nft.json +1 -1
  76. package/.next/server/app/api/repositories/route_client-reference-manifest.js +1 -1
  77. package/.next/server/app/api/repositories/scan/route.js +1 -1
  78. package/.next/server/app/api/repositories/scan/route.js.nft.json +1 -1
  79. package/.next/server/app/api/repositories/scan/route_client-reference-manifest.js +1 -1
  80. package/.next/server/app/api/repositories/sync/route.js +1 -1
  81. package/.next/server/app/api/repositories/sync/route.js.nft.json +1 -1
  82. package/.next/server/app/api/repositories/sync/route_client-reference-manifest.js +1 -1
  83. package/.next/server/app/api/repositories/validate-path/route_client-reference-manifest.js +1 -1
  84. package/.next/server/app/api/settings/default-agents/route.js +1 -1
  85. package/.next/server/app/api/settings/default-agents/route.js.nft.json +1 -1
  86. package/.next/server/app/api/settings/default-agents/route_client-reference-manifest.js +1 -1
  87. package/.next/server/app/api/settings/default-surface-mode/route_client-reference-manifest.js +1 -1
  88. package/.next/server/app/api/sidebar/group-order/route_client-reference-manifest.js +1 -1
  89. package/.next/server/app/api/skills/[id]/route.js +1 -1
  90. package/.next/server/app/api/skills/[id]/route_client-reference-manifest.js +1 -1
  91. package/.next/server/app/api/skills/installations/route_client-reference-manifest.js +1 -1
  92. package/.next/server/app/api/skills/operations/route_client-reference-manifest.js +1 -1
  93. package/.next/server/app/api/skills/reindex/route_client-reference-manifest.js +1 -1
  94. package/.next/server/app/api/skills/route.js +1 -1
  95. package/.next/server/app/api/skills/route_client-reference-manifest.js +1 -1
  96. package/.next/server/app/api/slash-commands/route.js +1 -1
  97. package/.next/server/app/api/slash-commands/route_client-reference-manifest.js +1 -1
  98. package/.next/server/app/api/tasks/[taskId]/cancel/route_client-reference-manifest.js +1 -1
  99. package/.next/server/app/api/tasks/[taskId]/route_client-reference-manifest.js +1 -1
  100. package/.next/server/app/api/templates/[id]/route_client-reference-manifest.js +1 -1
  101. package/.next/server/app/api/templates/route_client-reference-manifest.js +1 -1
  102. package/.next/server/app/api/todos/route_client-reference-manifest.js +1 -1
  103. package/.next/server/app/api/verification/runs/[runId]/route_client-reference-manifest.js +1 -1
  104. package/.next/server/app/api/verification/runs/route_client-reference-manifest.js +1 -1
  105. package/.next/server/app/api/worktrees/[id]/auto-yes/route.js +1 -1
  106. package/.next/server/app/api/worktrees/[id]/auto-yes/route.js.nft.json +1 -1
  107. package/.next/server/app/api/worktrees/[id]/auto-yes/route_client-reference-manifest.js +1 -1
  108. package/.next/server/app/api/worktrees/[id]/capture/route.js +1 -1
  109. package/.next/server/app/api/worktrees/[id]/capture/route.js.nft.json +1 -1
  110. package/.next/server/app/api/worktrees/[id]/capture/route_client-reference-manifest.js +1 -1
  111. package/.next/server/app/api/worktrees/[id]/clear-composer/route.js +1 -1
  112. package/.next/server/app/api/worktrees/[id]/clear-composer/route.js.nft.json +1 -1
  113. package/.next/server/app/api/worktrees/[id]/clear-composer/route_client-reference-manifest.js +1 -1
  114. package/.next/server/app/api/worktrees/[id]/cli-reference/route_client-reference-manifest.js +1 -1
  115. package/.next/server/app/api/worktrees/[id]/cli-tool/route_client-reference-manifest.js +1 -1
  116. package/.next/server/app/api/worktrees/[id]/cmate/schedules/route_client-reference-manifest.js +1 -1
  117. package/.next/server/app/api/worktrees/[id]/current-output/route.js +1 -1
  118. package/.next/server/app/api/worktrees/[id]/current-output/route.js.nft.json +1 -1
  119. package/.next/server/app/api/worktrees/[id]/current-output/route_client-reference-manifest.js +1 -1
  120. package/.next/server/app/api/worktrees/[id]/env/route_client-reference-manifest.js +1 -1
  121. package/.next/server/app/api/worktrees/[id]/execution-logs/[logId]/route.js +1 -1
  122. package/.next/server/app/api/worktrees/[id]/execution-logs/[logId]/route_client-reference-manifest.js +1 -1
  123. package/.next/server/app/api/worktrees/[id]/execution-logs/route_client-reference-manifest.js +1 -1
  124. package/.next/server/app/api/worktrees/[id]/files/[...path]/route.js +1 -1
  125. package/.next/server/app/api/worktrees/[id]/files/[...path]/route_client-reference-manifest.js +1 -1
  126. package/.next/server/app/api/worktrees/[id]/git/branch/create/route_client-reference-manifest.js +1 -1
  127. package/.next/server/app/api/worktrees/[id]/git/branch/delete/route_client-reference-manifest.js +1 -1
  128. package/.next/server/app/api/worktrees/[id]/git/branches/route_client-reference-manifest.js +1 -1
  129. package/.next/server/app/api/worktrees/[id]/git/checkout/route_client-reference-manifest.js +1 -1
  130. package/.next/server/app/api/worktrees/[id]/git/commit/route_client-reference-manifest.js +1 -1
  131. package/.next/server/app/api/worktrees/[id]/git/diff/route_client-reference-manifest.js +1 -1
  132. package/.next/server/app/api/worktrees/[id]/git/fetch/route_client-reference-manifest.js +1 -1
  133. package/.next/server/app/api/worktrees/[id]/git/log/route_client-reference-manifest.js +1 -1
  134. package/.next/server/app/api/worktrees/[id]/git/pull/route_client-reference-manifest.js +1 -1
  135. package/.next/server/app/api/worktrees/[id]/git/push/route_client-reference-manifest.js +1 -1
  136. package/.next/server/app/api/worktrees/[id]/git/reset/route_client-reference-manifest.js +1 -1
  137. package/.next/server/app/api/worktrees/[id]/git/revert/route_client-reference-manifest.js +1 -1
  138. package/.next/server/app/api/worktrees/[id]/git/show/[commitHash]/route_client-reference-manifest.js +1 -1
  139. package/.next/server/app/api/worktrees/[id]/git/stage/route_client-reference-manifest.js +1 -1
  140. package/.next/server/app/api/worktrees/[id]/git/staged/route_client-reference-manifest.js +1 -1
  141. package/.next/server/app/api/worktrees/[id]/git/stash/[index]/route_client-reference-manifest.js +1 -1
  142. package/.next/server/app/api/worktrees/[id]/git/stash/apply/route_client-reference-manifest.js +1 -1
  143. package/.next/server/app/api/worktrees/[id]/git/stash/pop/route_client-reference-manifest.js +1 -1
  144. package/.next/server/app/api/worktrees/[id]/git/stash/push/route_client-reference-manifest.js +1 -1
  145. package/.next/server/app/api/worktrees/[id]/git/stash/route_client-reference-manifest.js +1 -1
  146. package/.next/server/app/api/worktrees/[id]/git/status/route_client-reference-manifest.js +1 -1
  147. package/.next/server/app/api/worktrees/[id]/git/unstage/route_client-reference-manifest.js +1 -1
  148. package/.next/server/app/api/worktrees/[id]/git/working-diff/route_client-reference-manifest.js +1 -1
  149. package/.next/server/app/api/worktrees/[id]/instances/opencode/route.js.nft.json +1 -1
  150. package/.next/server/app/api/worktrees/[id]/instances/opencode/route_client-reference-manifest.js +1 -1
  151. package/.next/server/app/api/worktrees/[id]/interrupt/route.js +1 -1
  152. package/.next/server/app/api/worktrees/[id]/interrupt/route.js.nft.json +1 -1
  153. package/.next/server/app/api/worktrees/[id]/interrupt/route_client-reference-manifest.js +1 -1
  154. package/.next/server/app/api/worktrees/[id]/kill-session/route.js +1 -1
  155. package/.next/server/app/api/worktrees/[id]/kill-session/route.js.nft.json +1 -1
  156. package/.next/server/app/api/worktrees/[id]/kill-session/route_client-reference-manifest.js +1 -1
  157. package/.next/server/app/api/worktrees/[id]/logs/[filename]/route_client-reference-manifest.js +1 -1
  158. package/.next/server/app/api/worktrees/[id]/logs/route_client-reference-manifest.js +1 -1
  159. package/.next/server/app/api/worktrees/[id]/marp-render/route_client-reference-manifest.js +1 -1
  160. package/.next/server/app/api/worktrees/[id]/memos/[memoId]/route_client-reference-manifest.js +1 -1
  161. package/.next/server/app/api/worktrees/[id]/memos/route_client-reference-manifest.js +1 -1
  162. package/.next/server/app/api/worktrees/[id]/messages/route_client-reference-manifest.js +1 -1
  163. package/.next/server/app/api/worktrees/[id]/opencode/diff/route_client-reference-manifest.js +1 -1
  164. package/.next/server/app/api/worktrees/[id]/opencode/session/route_client-reference-manifest.js +1 -1
  165. package/.next/server/app/api/worktrees/[id]/opencode/share/route_client-reference-manifest.js +1 -1
  166. package/.next/server/app/api/worktrees/[id]/prompt-response/route.js +1 -1
  167. package/.next/server/app/api/worktrees/[id]/prompt-response/route.js.nft.json +1 -1
  168. package/.next/server/app/api/worktrees/[id]/prompt-response/route_client-reference-manifest.js +1 -1
  169. package/.next/server/app/api/worktrees/[id]/resolve-target/route_client-reference-manifest.js +1 -1
  170. package/.next/server/app/api/worktrees/[id]/respond/route.js +1 -1
  171. package/.next/server/app/api/worktrees/[id]/respond/route.js.nft.json +1 -1
  172. package/.next/server/app/api/worktrees/[id]/respond/route_client-reference-manifest.js +1 -1
  173. package/.next/server/app/api/worktrees/[id]/route.js +1 -1
  174. package/.next/server/app/api/worktrees/[id]/route.js.nft.json +1 -1
  175. package/.next/server/app/api/worktrees/[id]/route_client-reference-manifest.js +1 -1
  176. package/.next/server/app/api/worktrees/[id]/schedules/[scheduleId]/route.js +4 -3
  177. package/.next/server/app/api/worktrees/[id]/schedules/[scheduleId]/route_client-reference-manifest.js +1 -1
  178. package/.next/server/app/api/worktrees/[id]/schedules/active/route_client-reference-manifest.js +1 -1
  179. package/.next/server/app/api/worktrees/[id]/schedules/route.js +4 -3
  180. package/.next/server/app/api/worktrees/[id]/schedules/route_client-reference-manifest.js +1 -1
  181. package/.next/server/app/api/worktrees/[id]/search/route_client-reference-manifest.js +1 -1
  182. package/.next/server/app/api/worktrees/[id]/send/route.js +1 -1
  183. package/.next/server/app/api/worktrees/[id]/send/route.js.nft.json +1 -1
  184. package/.next/server/app/api/worktrees/[id]/send/route_client-reference-manifest.js +1 -1
  185. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route.js +2 -2
  186. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route.js.nft.json +1 -1
  187. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route_client-reference-manifest.js +1 -1
  188. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/install/route_client-reference-manifest.js +1 -1
  189. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/plan/route_client-reference-manifest.js +1 -1
  190. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall/route_client-reference-manifest.js +1 -1
  191. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall-plan/route_client-reference-manifest.js +1 -1
  192. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/update/route_client-reference-manifest.js +1 -1
  193. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/update-plan/route_client-reference-manifest.js +1 -1
  194. package/.next/server/app/api/worktrees/[id]/skills/route_client-reference-manifest.js +1 -1
  195. package/.next/server/app/api/worktrees/[id]/slash-commands/route.js +1 -1
  196. package/.next/server/app/api/worktrees/[id]/slash-commands/route_client-reference-manifest.js +1 -1
  197. package/.next/server/app/api/worktrees/[id]/special-keys/route.js +1 -1
  198. package/.next/server/app/api/worktrees/[id]/special-keys/route.js.nft.json +1 -1
  199. package/.next/server/app/api/worktrees/[id]/special-keys/route_client-reference-manifest.js +1 -1
  200. package/.next/server/app/api/worktrees/[id]/tasks/route_client-reference-manifest.js +1 -1
  201. package/.next/server/app/api/worktrees/[id]/terminal/route.js +1 -1
  202. package/.next/server/app/api/worktrees/[id]/terminal/route.js.nft.json +1 -1
  203. package/.next/server/app/api/worktrees/[id]/terminal/route_client-reference-manifest.js +1 -1
  204. package/.next/server/app/api/worktrees/[id]/timers/history/route_client-reference-manifest.js +1 -1
  205. package/.next/server/app/api/worktrees/[id]/timers/route.js +1 -1
  206. package/.next/server/app/api/worktrees/[id]/timers/route.js.nft.json +1 -1
  207. package/.next/server/app/api/worktrees/[id]/timers/route_client-reference-manifest.js +1 -1
  208. package/.next/server/app/api/worktrees/[id]/todos/[todoId]/route_client-reference-manifest.js +1 -1
  209. package/.next/server/app/api/worktrees/[id]/todos/route_client-reference-manifest.js +1 -1
  210. package/.next/server/app/api/worktrees/[id]/tree/[...path]/route_client-reference-manifest.js +1 -1
  211. package/.next/server/app/api/worktrees/[id]/tree/route_client-reference-manifest.js +1 -1
  212. package/.next/server/app/api/worktrees/[id]/upload/[...path]/route_client-reference-manifest.js +1 -1
  213. package/.next/server/app/api/worktrees/[id]/verify/config/route_client-reference-manifest.js +1 -1
  214. package/.next/server/app/api/worktrees/[id]/verify/route_client-reference-manifest.js +1 -1
  215. package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/cancel/route_client-reference-manifest.js +1 -1
  216. package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/route_client-reference-manifest.js +1 -1
  217. package/.next/server/app/api/worktrees/[id]/verify/runs/route_client-reference-manifest.js +1 -1
  218. package/.next/server/app/api/worktrees/[id]/viewed/route_client-reference-manifest.js +1 -1
  219. package/.next/server/app/api/worktrees/apply-default-agents/route_client-reference-manifest.js +1 -1
  220. package/.next/server/app/api/worktrees/route.js +1 -1
  221. package/.next/server/app/api/worktrees/route.js.nft.json +1 -1
  222. package/.next/server/app/api/worktrees/route_client-reference-manifest.js +1 -1
  223. package/.next/server/app/chat/page.js +2 -2
  224. package/.next/server/app/chat/page.js.nft.json +1 -1
  225. package/.next/server/app/chat/page_client-reference-manifest.js +1 -1
  226. package/.next/server/app/login/page_client-reference-manifest.js +1 -1
  227. package/.next/server/app/manifest.webmanifest/route_client-reference-manifest.js +1 -1
  228. package/.next/server/app/more/page.js +2 -2
  229. package/.next/server/app/more/page.js.nft.json +1 -1
  230. package/.next/server/app/more/page_client-reference-manifest.js +1 -1
  231. package/.next/server/app/offline/page_client-reference-manifest.js +1 -1
  232. package/.next/server/app/page.js +1 -1
  233. package/.next/server/app/page.js.nft.json +1 -1
  234. package/.next/server/app/page_client-reference-manifest.js +1 -1
  235. package/.next/server/app/proxy/[...path]/route_client-reference-manifest.js +1 -1
  236. package/.next/server/app/repositories/page.js +2 -2
  237. package/.next/server/app/repositories/page.js.nft.json +1 -1
  238. package/.next/server/app/repositories/page_client-reference-manifest.js +1 -1
  239. package/.next/server/app/review/page.js +1 -1
  240. package/.next/server/app/review/page.js.nft.json +1 -1
  241. package/.next/server/app/review/page_client-reference-manifest.js +1 -1
  242. package/.next/server/app/sessions/page.js +1 -1
  243. package/.next/server/app/sessions/page.js.nft.json +1 -1
  244. package/.next/server/app/sessions/page_client-reference-manifest.js +1 -1
  245. package/.next/server/app/skills/[skillId]/page.js +2 -2
  246. package/.next/server/app/skills/[skillId]/page.js.nft.json +1 -1
  247. package/.next/server/app/skills/[skillId]/page_client-reference-manifest.js +1 -1
  248. package/.next/server/app/skills/installed/page.js +2 -2
  249. package/.next/server/app/skills/installed/page.js.nft.json +1 -1
  250. package/.next/server/app/skills/installed/page_client-reference-manifest.js +1 -1
  251. package/.next/server/app/skills/page.js +1 -1
  252. package/.next/server/app/skills/page.js.nft.json +1 -1
  253. package/.next/server/app/skills/page_client-reference-manifest.js +1 -1
  254. package/.next/server/app/worktrees/[id]/files/[...path]/page_client-reference-manifest.js +1 -1
  255. package/.next/server/app/worktrees/[id]/page.js +10 -10
  256. package/.next/server/app/worktrees/[id]/page.js.nft.json +1 -1
  257. package/.next/server/app/worktrees/[id]/page_client-reference-manifest.js +1 -1
  258. package/.next/server/app/worktrees/[id]/terminal/page_client-reference-manifest.js +1 -1
  259. package/.next/server/app-paths-manifest.json +27 -27
  260. package/.next/server/chunks/1058.js +1 -1
  261. package/.next/server/chunks/1068.js +1 -1
  262. package/.next/server/chunks/1262.js +1 -1
  263. package/.next/server/chunks/1886.js +3 -3
  264. package/.next/server/chunks/1990.js +103 -0
  265. package/.next/server/chunks/2119.js +1 -1
  266. package/.next/server/chunks/2328.js +1 -1
  267. package/.next/server/chunks/2404.js +1 -1
  268. package/.next/server/chunks/2445.js +1 -1
  269. package/.next/server/chunks/261.js +1 -1
  270. package/.next/server/chunks/3123.js +1 -1
  271. package/.next/server/chunks/3241.js +1 -1
  272. package/.next/server/chunks/3480.js +5 -4
  273. package/.next/server/chunks/4299.js +1 -1
  274. package/.next/server/chunks/4393.js +1 -1
  275. package/.next/server/chunks/4443.js +1 -5
  276. package/.next/server/chunks/5017.js +1 -1
  277. package/.next/server/chunks/5043.js +1 -1
  278. package/.next/server/chunks/5164.js +1 -1
  279. package/.next/server/chunks/552.js +2 -2
  280. package/.next/server/chunks/6072.js +1 -1
  281. package/.next/server/chunks/6130.js +1 -1
  282. package/.next/server/chunks/663.js +4 -3
  283. package/.next/server/chunks/6894.js +2 -2
  284. package/.next/server/chunks/7187.js +1 -0
  285. package/.next/server/chunks/7472.js +1 -1
  286. package/.next/server/chunks/{880.js → 7859.js} +6 -6
  287. package/.next/server/chunks/7905.js +1 -1
  288. package/.next/server/chunks/8800.js +2 -2
  289. package/.next/server/chunks/8918.js +7 -0
  290. package/.next/server/chunks/9123.js +2 -2
  291. package/.next/server/chunks/9130.js +4 -4
  292. package/.next/server/chunks/9627.js +1 -1
  293. package/.next/server/chunks/9696.js +1 -1
  294. package/.next/server/chunks/9798.js +1 -1
  295. package/.next/server/middleware-manifest.json +5 -5
  296. package/.next/server/pages/500.html +1 -1
  297. package/.next/server/pages-manifest.json +1 -1
  298. package/.next/server/server-reference-manifest.json +1 -1
  299. package/.next/static/chunks/1783-11c9b4d8a52ebd91.js +1 -0
  300. package/.next/static/chunks/4718-de1224c9e8a6e7fc.js +1 -0
  301. package/.next/static/chunks/6022-2fa0b5a82d4ce7b6.js +1 -0
  302. package/.next/static/chunks/{5229-6c89475b61bd2c8b.js → 6170-951b9f5fe6b4b3b5.js} +1 -1
  303. package/.next/static/chunks/app/chat/{page-9aa2011410895b0d.js → page-37d7615d17d7e2a0.js} +1 -1
  304. package/.next/static/chunks/app/layout-4c2f21e3f653ee4c.js +1 -0
  305. package/.next/static/chunks/app/more/{page-333bba1c8bbc9c11.js → page-353a3924e6d7968e.js} +1 -1
  306. package/.next/static/chunks/app/{page-214f7ffa13a0cf10.js → page-c2bf871d953a1d6f.js} +1 -1
  307. package/.next/static/chunks/app/repositories/{page-4951cac905e50224.js → page-7d0f26df0537254c.js} +1 -1
  308. package/.next/static/chunks/app/review/{page-a0899b2d285318c3.js → page-e3f141b2829973e9.js} +1 -1
  309. package/.next/static/chunks/app/sessions/{page-fb36145ec732092a.js → page-53f188ed9ca49e5f.js} +1 -1
  310. package/.next/static/chunks/app/skills/[skillId]/{page-9099e26b60442873.js → page-80569b720aea59cc.js} +1 -1
  311. package/.next/static/chunks/app/skills/installed/{page-182e32368696d824.js → page-dbd2690ad72da95b.js} +1 -1
  312. package/.next/static/chunks/app/skills/{page-d3fdc88239ebe0ab.js → page-dacd36f9c11aa7da.js} +1 -1
  313. package/.next/static/chunks/app/worktrees/[id]/page-97205088520255a5.js +1 -0
  314. package/.next/static/css/5c13ea243dfdcb66.css +1 -0
  315. package/.next/trace +13 -13
  316. package/README.md +37 -11
  317. package/dist/cli/commands/attach.d.ts +50 -0
  318. package/dist/cli/commands/attach.d.ts.map +1 -0
  319. package/dist/cli/commands/attach.js +204 -0
  320. package/dist/cli/commands/capture.d.ts.map +1 -1
  321. package/dist/cli/commands/capture.js +114 -0
  322. package/dist/cli/commands/instances.d.ts.map +1 -1
  323. package/dist/cli/commands/instances.js +23 -2
  324. package/dist/cli/commands/ls.d.ts.map +1 -1
  325. package/dist/cli/commands/ls.js +41 -1
  326. package/dist/cli/config/cli-dependencies.d.ts.map +1 -1
  327. package/dist/cli/config/cli-dependencies.js +34 -0
  328. package/dist/cli/program.d.ts.map +1 -1
  329. package/dist/cli/program.js +5 -0
  330. package/dist/cli/types/index.d.ts +36 -0
  331. package/dist/cli/types/index.d.ts.map +1 -1
  332. package/dist/config/tmux-pane-config.d.ts +153 -0
  333. package/dist/config/tmux-pane-config.d.ts.map +1 -0
  334. package/dist/config/tmux-pane-config.js +172 -0
  335. package/dist/lib/cli-tools/session-name.d.ts +44 -0
  336. package/dist/lib/cli-tools/session-name.d.ts.map +1 -0
  337. package/dist/lib/cli-tools/session-name.js +57 -0
  338. package/dist/lib/cli-tools/types.d.ts +1 -1
  339. package/dist/lib/cli-tools/types.d.ts.map +1 -1
  340. package/dist/lib/cli-tools/types.js +6 -1
  341. package/dist/lib/cli-tools/validation.d.ts +34 -0
  342. package/dist/lib/cli-tools/validation.d.ts.map +1 -0
  343. package/dist/lib/cli-tools/validation.js +41 -0
  344. package/dist/lib/detection/status-reason.d.ts +18 -0
  345. package/dist/lib/detection/status-reason.d.ts.map +1 -1
  346. package/dist/lib/detection/status-reason.js +18 -0
  347. package/dist/lib/detection/tools/verified-against.d.ts +57 -7
  348. package/dist/lib/detection/tools/verified-against.d.ts.map +1 -1
  349. package/dist/lib/detection/tools/verified-against.js +59 -8
  350. package/dist/lib/detection/version-probes.d.ts +26 -5
  351. package/dist/lib/detection/version-probes.d.ts.map +1 -1
  352. package/dist/lib/detection/version-probes.js +28 -6
  353. package/dist/lib/session/tmux-session-surface.d.ts +369 -0
  354. package/dist/lib/session/tmux-session-surface.d.ts.map +1 -0
  355. package/dist/lib/session/tmux-session-surface.js +525 -0
  356. package/dist/server/src/config/cli-tool-timing-config.js +12 -1
  357. package/dist/server/src/config/detection-evidence-config.js +5 -0
  358. package/dist/server/src/config/schedule-config.js +28 -1
  359. package/dist/server/src/lib/cli-tools/antigravity.js +2 -2
  360. package/dist/server/src/lib/cli-tools/base.js +13 -8
  361. package/dist/server/src/lib/cli-tools/claude.js +20 -0
  362. package/dist/server/src/lib/cli-tools/codex.js +205 -61
  363. package/dist/server/src/lib/cli-tools/command-code.js +349 -0
  364. package/dist/server/src/lib/cli-tools/composer-spec.js +6 -0
  365. package/dist/server/src/lib/cli-tools/copilot.js +2 -2
  366. package/dist/server/src/lib/cli-tools/gemini.js +2 -2
  367. package/dist/server/src/lib/cli-tools/graceful-exit.js +16 -1
  368. package/dist/server/src/lib/cli-tools/index.js +4 -1
  369. package/dist/server/src/lib/cli-tools/install-hints.js +131 -0
  370. package/dist/server/src/lib/cli-tools/liveness-spec.js +18 -0
  371. package/dist/server/src/lib/cli-tools/manager.js +2 -0
  372. package/dist/server/src/lib/cli-tools/opencode.js +2 -2
  373. package/dist/server/src/lib/cli-tools/start-availability.js +18 -11
  374. package/dist/server/src/lib/cli-tools/types.js +6 -1
  375. package/dist/server/src/lib/cli-tools/vibe-local.js +2 -2
  376. package/dist/server/src/lib/cmate-parser.js +6 -0
  377. package/dist/server/src/lib/detection/cli-patterns.js +441 -8
  378. package/dist/server/src/lib/detection/opencode-modal-overlay.js +66 -100
  379. package/dist/server/src/lib/detection/selection-shape.js +341 -0
  380. package/dist/server/src/lib/detection/sgr-background.js +210 -0
  381. package/dist/server/src/lib/detection/status-detector.js +6 -0
  382. package/dist/server/src/lib/detection/status-reason.js +18 -0
  383. package/dist/server/src/lib/detection/tools/antigravity/detect.js +38 -15
  384. package/dist/server/src/lib/detection/tools/codex/cli-patterns.js +392 -0
  385. package/dist/server/src/lib/detection/tools/codex/detect.js +83 -2
  386. package/dist/server/src/lib/detection/tools/command-code/detect.js +159 -0
  387. package/dist/server/src/lib/detection/tools/registry.js +6 -4
  388. package/dist/server/src/lib/detection/tools/verified-against.js +59 -8
  389. package/dist/server/src/lib/detection/version-probes.js +28 -6
  390. package/dist/server/src/lib/hooks/sources/antigravity/history.js +77 -16
  391. package/dist/server/src/lib/hooks/sources/claude/history.js +94 -18
  392. package/dist/server/src/lib/hooks/sources/codex/history.js +84 -15
  393. package/dist/server/src/lib/hooks/sources/codex/hooks-config.js +130 -17
  394. package/dist/server/src/lib/hooks/sources/codex/relay-install.js +145 -0
  395. package/dist/server/src/lib/hooks/sources/command-code/history.js +865 -0
  396. package/dist/server/src/lib/hooks/sources/command-code/hooks-config.js +390 -0
  397. package/dist/server/src/lib/hooks/sources/command-code/source.js +290 -0
  398. package/dist/server/src/lib/hooks/sources/command-code/tool-id.js +18 -0
  399. package/dist/server/src/lib/hooks/sources/command-code/transcript.js +604 -0
  400. package/dist/server/src/lib/hooks/sources/index.js +3 -1
  401. package/dist/server/src/lib/hooks/sources/opencode/history.js +57 -3
  402. package/dist/server/src/lib/hooks/sources/opencode/transcript.js +24 -28
  403. package/dist/server/src/lib/hooks/sources/registry.js +4 -0
  404. package/dist/server/src/lib/hooks/sources/turn-body.js +77 -19
  405. package/dist/server/src/lib/job-executor.js +12 -0
  406. package/dist/server/src/lib/polling/auto-yes-dialog-gate.js +6 -0
  407. package/dist/server/src/lib/polling/response-checker.js +112 -7
  408. package/dist/server/src/lib/polling/structured-history-gate.js +15 -8
  409. package/dist/server/src/lib/realtime/types.js +15 -5
  410. package/dist/server/src/lib/response-cleaner.js +24 -1
  411. package/dist/server/src/lib/response-extractor.js +11 -0
  412. package/dist/server/src/lib/session/claude-executor.js +223 -4
  413. package/dist/server/src/lib/session/cli-session.js +52 -0
  414. package/dist/server/src/lib/session/tmux-session-surface.js +525 -0
  415. package/dist/server/src/lib/skills/compatibility-matrix.js +117 -1
  416. package/dist/server/src/lib/tmux/geometry-delegation.js +143 -0
  417. package/dist/server/src/lib/tmux/read-mode-pager.js +76 -10
  418. package/dist/server/src/lib/tmux/read-mode.js +44 -2
  419. package/dist/server/src/lib/tmux/session-hook-scripts.js +249 -0
  420. package/dist/server/src/lib/tmux/session-hooks.js +122 -0
  421. package/dist/server/src/lib/tmux/session-status-options.js +213 -0
  422. package/dist/server/src/lib/tmux/tmux.js +79 -2
  423. package/dist/server/src/lib/version-checker.js +110 -0
  424. package/dist/server/src/lib/ws-server.js +16 -10
  425. package/dist/server/src/types/agent-transcript.js +73 -1
  426. package/dist/server/src/types/terminal-keys.js +131 -3
  427. package/dist/types/terminal-keys.d.ts +100 -3
  428. package/dist/types/terminal-keys.d.ts.map +1 -1
  429. package/dist/types/terminal-keys.js +131 -3
  430. package/package.json +1 -1
  431. package/.next/server/chunks/3099.js +0 -5
  432. package/.next/server/chunks/7824.js +0 -1
  433. package/.next/static/chunks/3916-0e929d089282dc5d.js +0 -1
  434. package/.next/static/chunks/6022-7a7d1760fc9814c7.js +0 -1
  435. package/.next/static/chunks/6381-147dde2a967e9458.js +0 -1
  436. package/.next/static/chunks/app/layout-6a26ea22d5cf03dc.js +0 -1
  437. package/.next/static/chunks/app/worktrees/[id]/page-2f73d69187936627.js +0 -1
  438. package/.next/static/css/23f9c40ecc458c77.css +0 -1
  439. /package/.next/static/{QXxQbXWoo7ldUyOcv7PCZ → nXW4dPkpE_9xUf_9ySRff}/_buildManifest.js +0 -0
  440. /package/.next/static/{QXxQbXWoo7ldUyOcv7PCZ → nXW4dPkpE_9xUf_9ySRff}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- "use strict";exports.id=1262,exports.ids=[1262],exports.modules={51262:a=>{a.exports=JSON.parse('{"offline":{"metaTitle":"Offline","title":"You\'re offline","description":"CommandMate can\'t reach the server right now. Check your connection and try again.","reconnect":"Reconnect"},"update":{"available":"A new version is available.","reload":"Reload"}}')}};
1
+ "use strict";exports.id=1262,exports.ids=[1262],exports.modules={51262:a=>{a.exports=JSON.parse('{"offline":{"metaTitle":"Offline","title":"You\'re offline","description":"CommandMate can\'t reach the server right now. Check your connection and try again.","reconnect":"Reconnect"},"update":{"available":"An updated app is ready to install.","reload":"Reload"}}')}};
@@ -1,4 +1,4 @@
1
- "use strict";exports.id=1886,exports.ids=[1886],exports.modules={17287:(a,b,c)=>{c.d(b,{CD:()=>g,nL:()=>f});var d=c(24455);let e=globalThis.__permissionDecisions??(globalThis.__permissionDecisions=new Map);function f(a,b,c,f){e.set((0,d.v7)(a,b,c),f)}function g(a,b,c){return e.get((0,d.v7)(a,b,c))??null}},23365:(a,b,c)=>{c.d(b,{H:()=>g,y:()=>h});var d=c(16983),e=c(34405),f=c(15194);let g=200;function h(a){var b;return{statusLines:"opencode"===(b=a)?d.xT:"gemini"===b?g:e.G,usesAlternateScreen:(0,f.VA)(a)}}},34405:(a,b,c)=>{c.d(b,{G:()=>e,_:()=>d});let d=1e4,e=1e3},39333:(a,b,c)=>{c.d(b,{$Y:()=>g,Bg:()=>i,HB:()=>f,df:()=>h,f9:()=>d});let d=[".png",".jpg",".jpeg",".gif",".webp",".svg"],e=[{extension:".png",mimeType:"image/png",magicBytes:[137,80,78,71]},{extension:".jpg",mimeType:"image/jpeg",magicBytes:[255,216,255]},{extension:".jpeg",mimeType:"image/jpeg",magicBytes:[255,216,255]},{extension:".gif",mimeType:"image/gif",magicBytes:[71,73,70,56]},{extension:".webp",mimeType:"image/webp",magicBytes:[82,73,70,70]},{extension:".svg",mimeType:"image/svg+xml"}];function f(a){return a?a.startsWith(".")?a.toLowerCase():"."+a.toLowerCase():""}function g(a){let b=f(a),c=e.find(a=>a.extension===b);return c?.mimeType||"application/octet-stream"}function h(a){if(!a)return!1;let b=f(a);return d.includes(b)}function i(a,b){if(b.length>0x1400000)return{valid:!1,error:"File size exceeds 20MB limit"};if(".svg"===f(a)){var c;return(c=b.toString("utf-8")).includes("<svg")||c.startsWith("<?xml")?/<script[\s>]/i.test(c)?{valid:!1,error:"SVG contains script tags"}:/\s+on\w+\s*=/i.test(c)?{valid:!1,error:"SVG contains event handler attributes"}:/(?:xlink:)?href\s*=\s*["']?\s*(?:javascript|data|vbscript):/i.test(c)?{valid:!1,error:"SVG contains dangerous URI scheme"}:/<foreignObject[\s>]/i.test(c)?{valid:!1,error:"SVG contains foreignObject element"}:{valid:!0}:{valid:!1,error:"Invalid SVG format"}}return!function(a,b){let c=f(a),d=e.find(a=>a.extension===c);if(!d?.magicBytes)return".svg"===c;let g=d.magicBytesOffset||0;return!(b.length<g+d.magicBytes.length)&&d.magicBytes.every((a,c)=>b[g+c]===a)}(a,b)?{valid:!1,error:"Invalid image magic bytes"}:{valid:!0}}d.filter(a=>".svg"!==a).map(a=>g(a)).filter(a=>"application/octet-stream"!==a).join(",")},41466:(a,b,c)=>{c.d(b,{Ui:()=>as,TZ:()=>ar});var d=c(81886),e=c(8953),f=c(79892),g=c(85164),h=c(40236),i=c(93997),j=c(29021),k=c(21820),l=c(33873),m=c(8004),n=c(72626);let o=(0,n.h)("cli-tools/opencode-config"),p=/^[a-zA-Z0-9._:/-]{1,100}$/,q=/^[a-zA-Z0-9._:/@-]{1,200}$/,r="CM_OPENCODE_LOCAL_PROVIDER_CONFIG",s="OPENCODE_CONFIG",t=["opencode.json","opencode.jsonc",l.join(".opencode","opencode.json"),l.join(".opencode","opencode.jsonc")],u=["opencode.json","opencode.jsonc"];async function v(){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 o.warn("ollama-api-returned"),{};let e=await d.text();if(e.length>1048576)return o.warn("ollama-api-response"),{};let f=JSON.parse(e);if(!f||!Array.isArray(f.models))return o.warn("invalid-ollama-api"),{};for(let b of f.models.slice(0,100))"string"==typeof b?.name&&p.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?o.warn("ollama-api-timeout"):o.warn("failed-to-fetch")}return a}async function w(){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 o.warn("lm-studio-api"),{};let e=await d.text();if(e.length>1048576)return o.warn("lm-studio-api"),{};let f=JSON.parse(e);if(!f||!Array.isArray(f.data))return o.warn("invalid-lm-studio"),{};for(let b of f.data.slice(0,100))"string"==typeof b?.id&&q.test(b.id)&&(a[b.id]={name:b.id})}catch(a){a instanceof Error&&"AbortError"===a.name?o.warn("lm-studio-api"):o.warn("failed-to-fetch")}return a}function x(a=process.env){let b=l.join(k.homedir(),".config");return l.join((0,m.T)(a.XDG_CONFIG_HOME,b,"XDG_CONFIG_HOME"),"opencode")}async function y(){let[a,b]=await Promise.all([v(),w()]),c={};return Object.keys(a).length>0&&(c.ollama={npm:"@ai-sdk/openai-compatible",name:"Ollama (local)",options:{baseURL:"http://localhost:11434/v1"},models:a}),Object.keys(b).length>0&&(c.lmstudio={npm:"@ai-sdk/openai-compatible",name:"LM Studio (local)",options:{baseURL:"http://localhost:1234/v1"},models:b}),c}async function z(a){let b=function(a=process.env){let b=(a[r]??"").trim().toLowerCase();return"worktree"===b||"project"===b?"worktree":"global"===b||"user"===b?"global":(""!==b&&"off"!==b&&"0"!==b&&"false"!==b&&"none"!==b&&o.warn("opencode-config-mode-unrecognised",{variable:r,value:b}),"off")}();if("off"===b)return{written:!1,configPath:null,reason:"disabled"};let c="worktree"===b?function(a){let b=l.resolve(a);try{if(!j.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 j.realpathSync(b)}(a):null,d=function(a,b=process.env){if(""!==(b[s]??"").trim())return`env:${s}`;if(null!==a)for(let b of t){let c=l.join(a,b);if(j.existsSync(c))return c}let c=x(b);for(let a of u){let b=l.join(c,a);if(j.existsSync(b))return b}return null}(c);if(null!==d)return o.info("opencode-config-generation-skipped",{mode:b,owned:d}),{written:!1,configPath:null,reason:"existing-config"};let e=c??x(),f=l.join(e,"opencode.json"),g=await y();if(0===Object.keys(g).length)return{written:!1,configPath:null,reason:"no-providers"};try{"global"===b&&j.mkdirSync(e,{recursive:!0}),j.writeFileSync(f,JSON.stringify({$schema:"https://opencode.ai/config.json",provider:g},null,2),{encoding:"utf-8",flag:"wx"})}catch(a){if("EEXIST"===a.code)return{written:!1,configPath:null,reason:"existing-config"};return o.warn("failed-to-write-opencodejson:error-insta"),{written:!1,configPath:null,reason:"write-failed"}}return o.info("opencode-config-generated",{mode:b,configPath:f}),{written:!0,configPath:f,reason:"written"}}var A=c(16983),B=c(79646),C=c(28354),D=c(39333),E=c(4970),F=c(49791),G=c(62887),H=c(72272),I=c(49154),J=c(48083),K=c(36051),L=c(57510),M=c(97709),N=c(75356),O=c(98211),P=c(90488),Q=c(85322);let R=(0,n.h)("lib/hooks/sources/opencode/ingest");async function S(a,b,c){let d=(0,M.VM)(Q.k),e=(0,O.Lu)(b.raw,b.receivedAt);if(!e)return R.info("opencode-permission-unparsed",{worktreeId:a.worktreeId,instanceId:c}),!1;let f=await (0,H.t)(d,a,e,d.parsePermissionRequest(b.raw));return R.info("opencode-permission-decided",{worktreeId:a.worktreeId,instanceId:c,decisionId:e.id,behavior:f.behavior,reason:f.reason,delivered:f.delivered,settled:f.settled}),f.settled}async function T(a,b){let[{getDbInstance:d},{getWorktreeById:e},{applyAgentStopEvent:f}]=await Promise.all([Promise.resolve().then(c.bind(c,88807)),Promise.resolve().then(c.bind(c,56791)),Promise.all([c.e(1356),c.e(6065),c.e(1191),c.e(6337),c.e(1501),c.e(7366),c.e(3707),c.e(5043)]).then(c.bind(c,35043))]),g=d(),h=e(g,a.worktreeId)??null;if(!h)return void R.info("opencode-stop-unresolved-target",{worktreeId:a.worktreeId});let i=await f(g,h,Q.k,b);R.info("opencode-stop-applied",{worktreeId:a.worktreeId,instanceId:b,taskId:i.taskId,taskEventApplied:i.taskEventApplied,verificationRunId:i.verificationRunId})}async function U(a,b){let c=a.instanceId??Q.k;try{let d=(0,M.VM)(Q.k),e=(0,J.qo)({worktreeId:a.worktreeId,cliToolId:Q.k,instanceId:c,event:b.event,detail:b.detail,sessionId:b.conversationId,at:b.receivedAt,identity:d.eventIdentityOf(b.raw),identityKind:d.capabilities.eventIdentity});if(e.duplicate)return void R.info("opencode-event-duplicate-dropped",{worktreeId:a.worktreeId,instanceId:c,event:b.event,detail:b.detail,by:e.by});let f={event:b.event,at:b.receivedAt,detail:b.detail?.slice(0,G.h9)??null,sessionId:b.conversationId,message:(function(a){let b=(0,L.Qd)(a.raw.properties)?a.raw.properties:{};if(a.detail===N.aF)return(0,L.NZ)(b,["metadata","command"])??(0,L.O2)(b,"permission");if(a.detail===N.Tm){let a=b.questions;return Array.isArray(a)&&(0,L.Qd)(a[0])?(0,L.O2)(a[0],"question"):null}return a.detail===N.vE?(0,L.NZ)(b,["error","data","message"])??(0,L.NZ)(b,["error","name"]):null})(b)?.slice(0,K.lY)??null,model:b.model},g={sessionStartMayArriveLate:d.capabilities.sessionStartMayArriveLate};if("notification"===b.event&&b.detail===N.aF){f.decisionId=(0,L.O2)((0,L.Qd)(b.raw.properties)?b.raw.properties:{},"id");let d=(0,O.LF)(b.raw,b.receivedAt);f.toolName=d?.toolName??null,f.decisionPatterns=d?.patterns??null,f.promptSettled=await S(a,b,c),(0,J.recordAgentEvent)(a.worktreeId,Q.k,c,f,g);return}if("notification"===b.event&&b.detail===N.C8){f.decisionId=(0,N.Mn)(b.raw),f.promptSettled=!!(0,M.VM)(Q.k).capabilities.permissionReplyReleasesPrompt||(R.info("opencode-permission-reply-not-releasing",{worktreeId:a.worktreeId,instanceId:c,reason:"capability-permissionReplyReleasesPrompt-false"}),!1),(0,J.recordAgentEvent)(a.worktreeId,Q.k,c,f,g),R.info("opencode-permission-reply-observed",{worktreeId:a.worktreeId,instanceId:c,decisionId:f.decisionId,released:f.promptSettled});return}if((0,J.recordAgentEvent)(a.worktreeId,Q.k,c,f,g),"notification"===b.event&&b.detail===N.Tm){let d=(0,M.VM)(Q.k).parseQuestion(b.raw);d&&((0,J._N)(a.worktreeId,Q.k,c,d,b.receivedAt),(0,J.MU)(a.worktreeId,Q.k,c,{toolName:I.GF,decisionId:d.promptId,detail:N.Tm},b.receivedAt),R.info("opencode-question-recorded",{worktreeId:a.worktreeId,instanceId:c,decisionId:d.promptId,questionCount:d.questions.length,optionCounts:d.questions.map(a=>a.choices.length)})),await (0,P.Vo)(a,c,f.message??null,b.receivedAt);return}if("stop"===b.event)return void await T(a,c);"notification"===b.event&&b.detail===N.vE&&await (0,P.dJ)(a,c,(0,L.NZ)((0,L.Qd)(b.raw.properties)?b.raw.properties:{},["error","name"]),f.message??null,b.conversationId,b.receivedAt),R.info("opencode-event-received",{worktreeId:a.worktreeId,instanceId:c,event:b.event,detail:b.detail})}catch(d){R.error("opencode-event-ingest-failed",{worktreeId:a.worktreeId,instanceId:c,event:b.event,error:d instanceof Error?d.message:String(d)})}}var V=c(84574),W=c(85965),X=c(53163);let Y=(0,n.h)("lib/hooks/sources/opencode/runtime");function Z(a,b){return{worktreeId:a,cliToolId:"opencode",instanceId:b}}async function $(a,b){try{return await (0,V.CU)(a,b)}catch(b){return Y.warn("opencode-port-reserve-failed",{worktreeId:a.worktreeId,error:b instanceof Error?b.message:String(b)}),null}}let _=[0,500,1e3,2e3,4e3];async function aa(a,b){for(let[c,d]of _.entries()){d>0&&await new Promise(a=>setTimeout(a,d));let e=await (0,F.sc)(b);if("healthy"===e.kind)return c>0&&Y.info("opencode-server-reachable-after-retry",{worktreeId:a.worktreeId,instanceId:a.instanceId??a.cliToolId,port:b,attempt:c}),e.health;if("rejected"===e.kind){Y.warn("opencode-server-refused-commandmate",{worktreeId:a.worktreeId,instanceId:a.instanceId??a.cliToolId,port:b,status:e.status,consequence:"structured events are off for this session; the scraper decides"});break}}return null}async function ab(a){try{let b=(0,V.hC)(a);if(null===b)return!1;if((0,X.wb)(a))return!0;let c=await aa(a,b);if(!c)return Y.info("opencode-server-not-reachable",{worktreeId:a.worktreeId,instanceId:a.instanceId??a.cliToolId,port:b,attempts:_.length}),!1;await W.cC.subscribe(a,b=>{U(a,b)});let d=await ac(a);return Y.info("opencode-event-stream-attached",{worktreeId:a.worktreeId,instanceId:a.instanceId??a.cliToolId,port:b,version:c.version,activity:d}),!0}catch(b){return Y.warn("opencode-event-stream-attach-failed",{worktreeId:a.worktreeId,error:b instanceof Error?b.message:String(b)}),!1}}async function ac(a){let b=null;try{b=await W.cC.probeActivity(a)}catch(b){Y.debug("opencode-activity-probe-failed",{worktreeId:a.worktreeId,instanceId:a.instanceId??a.cliToolId,error:b instanceof Error?b.message:String(b)})}return(0,X.yn)(a,b,Date.now()),b}async function ad(a,b){try{if((0,X.wb)(a))return!0;let c=await (0,V.jp)(a,b);if(null===c)return!1;return await ab(a)}catch(b){return Y.warn("opencode-event-stream-resume-failed",{worktreeId:a.worktreeId,error:b instanceof Error?b.message:String(b)}),!1}}async function ae(a){let b=a.instanceId??a.cliToolId;try{let c=(0,V.hC)(a);if(null===c)return!1;let d=(0,X.lf)(a);if("live"!==d.state)return Y.info("opencode-abort-skipped-not-live",{worktreeId:a.worktreeId,instanceId:b,port:c,liveness:d.state}),!1;let e=(0,X.ym)(a);if(null===e)return Y.info("opencode-abort-skipped-no-session",{worktreeId:a.worktreeId,instanceId:b,port:c}),!1;let f=(0,X.H1)(a,e,2e3);if(!await (0,F.UR)(c,e))return f.cancel(),Y.warn("opencode-abort-rejected",{worktreeId:a.worktreeId,instanceId:b,port:c,sessionId:e}),!1;if(!await f.seen)return Y.warn("opencode-abort-unconfirmed",{worktreeId:a.worktreeId,instanceId:b,port:c,sessionId:e,timeoutMs:2e3}),!1;return Y.info("opencode-abort-confirmed",{worktreeId:a.worktreeId,instanceId:b,port:c,sessionId:e}),!0}catch(c){return Y.warn("opencode-abort-failed",{worktreeId:a.worktreeId,instanceId:b,error:c instanceof Error?c.message:String(c)}),!1}}async function af(a){try{await (0,X.FN)(a),(0,V.kE)(a)}catch(b){Y.warn("opencode-event-stream-release-failed",{worktreeId:a.worktreeId,error:b instanceof Error?b.message:String(b)})}}var ag=c(18529),ah=c(70849),ai=c(27939),aj=c(93949),ak=c(20610),al=c(2669);let am=(0,n.h)("cli-tools/opencode"),an=(0,C.promisify)(B.execFile);function ao(a){return a instanceof Error?a.message:String(a)}function ap(){let a=process.env[A.ao],b=(0,A._u)();return void 0!==a&&String(b)!==a.trim()?am.warn("opencode-pane-width-rejected",{requested:a,applied:b}):b>=A.Lg&&am.warn("opencode-pane-width-sidebar-visible",{width:b,sidebarMinWidth:A.Lg}),b}let aq=[0,50,100,200];function ar(a,b){return a?`${a}
1
+ "use strict";exports.id=1886,exports.ids=[1886],exports.modules={17287:(a,b,c)=>{c.d(b,{CD:()=>g,nL:()=>f});var d=c(24455);let e=globalThis.__permissionDecisions??(globalThis.__permissionDecisions=new Map);function f(a,b,c,f){e.set((0,d.v7)(a,b,c),f)}function g(a,b,c){return e.get((0,d.v7)(a,b,c))??null}},23365:(a,b,c)=>{c.d(b,{H:()=>g,y:()=>h});var d=c(16983),e=c(34405),f=c(15194);let g=200;function h(a){var b;return{statusLines:"opencode"===(b=a)?d.xT:"gemini"===b?g:e.G,usesAlternateScreen:(0,f.VA)(a)}}},34405:(a,b,c)=>{c.d(b,{G:()=>e,_:()=>d});let d=1e4,e=1e3},39333:(a,b,c)=>{c.d(b,{$Y:()=>g,Bg:()=>i,HB:()=>f,df:()=>h,f9:()=>d});let d=[".png",".jpg",".jpeg",".gif",".webp",".svg"],e=[{extension:".png",mimeType:"image/png",magicBytes:[137,80,78,71]},{extension:".jpg",mimeType:"image/jpeg",magicBytes:[255,216,255]},{extension:".jpeg",mimeType:"image/jpeg",magicBytes:[255,216,255]},{extension:".gif",mimeType:"image/gif",magicBytes:[71,73,70,56]},{extension:".webp",mimeType:"image/webp",magicBytes:[82,73,70,70]},{extension:".svg",mimeType:"image/svg+xml"}];function f(a){return a?a.startsWith(".")?a.toLowerCase():"."+a.toLowerCase():""}function g(a){let b=f(a),c=e.find(a=>a.extension===b);return c?.mimeType||"application/octet-stream"}function h(a){if(!a)return!1;let b=f(a);return d.includes(b)}function i(a,b){if(b.length>0x1400000)return{valid:!1,error:"File size exceeds 20MB limit"};if(".svg"===f(a)){var c;return(c=b.toString("utf-8")).includes("<svg")||c.startsWith("<?xml")?/<script[\s>]/i.test(c)?{valid:!1,error:"SVG contains script tags"}:/\s+on\w+\s*=/i.test(c)?{valid:!1,error:"SVG contains event handler attributes"}:/(?:xlink:)?href\s*=\s*["']?\s*(?:javascript|data|vbscript):/i.test(c)?{valid:!1,error:"SVG contains dangerous URI scheme"}:/<foreignObject[\s>]/i.test(c)?{valid:!1,error:"SVG contains foreignObject element"}:{valid:!0}:{valid:!1,error:"Invalid SVG format"}}return!function(a,b){let c=f(a),d=e.find(a=>a.extension===c);if(!d?.magicBytes)return".svg"===c;let g=d.magicBytesOffset||0;return!(b.length<g+d.magicBytes.length)&&d.magicBytes.every((a,c)=>b[g+c]===a)}(a,b)?{valid:!1,error:"Invalid image magic bytes"}:{valid:!0}}d.filter(a=>".svg"!==a).map(a=>g(a)).filter(a=>"application/octet-stream"!==a).join(",")},41466:(a,b,c)=>{c.d(b,{Ui:()=>as,TZ:()=>ar});var d=c(81886),e=c(8953),f=c(79892),g=c(85164),h=c(40236),i=c(93997),j=c(29021),k=c(21820),l=c(33873),m=c(8004),n=c(72626);let o=(0,n.h)("cli-tools/opencode-config"),p=/^[a-zA-Z0-9._:/-]{1,100}$/,q=/^[a-zA-Z0-9._:/@-]{1,200}$/,r="CM_OPENCODE_LOCAL_PROVIDER_CONFIG",s="OPENCODE_CONFIG",t=["opencode.json","opencode.jsonc",l.join(".opencode","opencode.json"),l.join(".opencode","opencode.jsonc")],u=["opencode.json","opencode.jsonc"];async function v(){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 o.warn("ollama-api-returned"),{};let e=await d.text();if(e.length>1048576)return o.warn("ollama-api-response"),{};let f=JSON.parse(e);if(!f||!Array.isArray(f.models))return o.warn("invalid-ollama-api"),{};for(let b of f.models.slice(0,100))"string"==typeof b?.name&&p.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?o.warn("ollama-api-timeout"):o.warn("failed-to-fetch")}return a}async function w(){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 o.warn("lm-studio-api"),{};let e=await d.text();if(e.length>1048576)return o.warn("lm-studio-api"),{};let f=JSON.parse(e);if(!f||!Array.isArray(f.data))return o.warn("invalid-lm-studio"),{};for(let b of f.data.slice(0,100))"string"==typeof b?.id&&q.test(b.id)&&(a[b.id]={name:b.id})}catch(a){a instanceof Error&&"AbortError"===a.name?o.warn("lm-studio-api"):o.warn("failed-to-fetch")}return a}function x(a=process.env){let b=l.join(k.homedir(),".config");return l.join((0,m.T)(a.XDG_CONFIG_HOME,b,"XDG_CONFIG_HOME"),"opencode")}async function y(){let[a,b]=await Promise.all([v(),w()]),c={};return Object.keys(a).length>0&&(c.ollama={npm:"@ai-sdk/openai-compatible",name:"Ollama (local)",options:{baseURL:"http://localhost:11434/v1"},models:a}),Object.keys(b).length>0&&(c.lmstudio={npm:"@ai-sdk/openai-compatible",name:"LM Studio (local)",options:{baseURL:"http://localhost:1234/v1"},models:b}),c}async function z(a){let b=function(a=process.env){let b=(a[r]??"").trim().toLowerCase();return"worktree"===b||"project"===b?"worktree":"global"===b||"user"===b?"global":(""!==b&&"off"!==b&&"0"!==b&&"false"!==b&&"none"!==b&&o.warn("opencode-config-mode-unrecognised",{variable:r,value:b}),"off")}();if("off"===b)return{written:!1,configPath:null,reason:"disabled"};let c="worktree"===b?function(a){let b=l.resolve(a);try{if(!j.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 j.realpathSync(b)}(a):null,d=function(a,b=process.env){if(""!==(b[s]??"").trim())return`env:${s}`;if(null!==a)for(let b of t){let c=l.join(a,b);if(j.existsSync(c))return c}let c=x(b);for(let a of u){let b=l.join(c,a);if(j.existsSync(b))return b}return null}(c);if(null!==d)return o.info("opencode-config-generation-skipped",{mode:b,owned:d}),{written:!1,configPath:null,reason:"existing-config"};let e=c??x(),f=l.join(e,"opencode.json"),g=await y();if(0===Object.keys(g).length)return{written:!1,configPath:null,reason:"no-providers"};try{"global"===b&&j.mkdirSync(e,{recursive:!0}),j.writeFileSync(f,JSON.stringify({$schema:"https://opencode.ai/config.json",provider:g},null,2),{encoding:"utf-8",flag:"wx"})}catch(a){if("EEXIST"===a.code)return{written:!1,configPath:null,reason:"existing-config"};return o.warn("failed-to-write-opencodejson:error-insta"),{written:!1,configPath:null,reason:"write-failed"}}return o.info("opencode-config-generated",{mode:b,configPath:f}),{written:!0,configPath:f,reason:"written"}}var A=c(16983),B=c(79646),C=c(28354),D=c(39333),E=c(4970),F=c(49791),G=c(62887),H=c(72272),I=c(49154),J=c(48083),K=c(36051),L=c(57510),M=c(129),N=c(75356),O=c(98211),P=c(90488),Q=c(85322);let R=(0,n.h)("lib/hooks/sources/opencode/ingest");async function S(a,b,c){let d=(0,M.VM)(Q.k),e=(0,O.Lu)(b.raw,b.receivedAt);if(!e)return R.info("opencode-permission-unparsed",{worktreeId:a.worktreeId,instanceId:c}),!1;let f=await (0,H.t)(d,a,e,d.parsePermissionRequest(b.raw));return R.info("opencode-permission-decided",{worktreeId:a.worktreeId,instanceId:c,decisionId:e.id,behavior:f.behavior,reason:f.reason,delivered:f.delivered,settled:f.settled}),f.settled}async function T(a,b){let[{getDbInstance:d},{getWorktreeById:e},{applyAgentStopEvent:f}]=await Promise.all([Promise.resolve().then(c.bind(c,88807)),Promise.resolve().then(c.bind(c,56791)),Promise.all([c.e(1356),c.e(6065),c.e(1191),c.e(6337),c.e(1501),c.e(7366),c.e(3707),c.e(5043)]).then(c.bind(c,35043))]),g=d(),h=e(g,a.worktreeId)??null;if(!h)return void R.info("opencode-stop-unresolved-target",{worktreeId:a.worktreeId});let i=await f(g,h,Q.k,b);R.info("opencode-stop-applied",{worktreeId:a.worktreeId,instanceId:b,taskId:i.taskId,taskEventApplied:i.taskEventApplied,verificationRunId:i.verificationRunId})}async function U(a,b){let c=a.instanceId??Q.k;try{let d=(0,M.VM)(Q.k),e=(0,J.qo)({worktreeId:a.worktreeId,cliToolId:Q.k,instanceId:c,event:b.event,detail:b.detail,sessionId:b.conversationId,at:b.receivedAt,identity:d.eventIdentityOf(b.raw),identityKind:d.capabilities.eventIdentity});if(e.duplicate)return void R.info("opencode-event-duplicate-dropped",{worktreeId:a.worktreeId,instanceId:c,event:b.event,detail:b.detail,by:e.by});let f={event:b.event,at:b.receivedAt,detail:b.detail?.slice(0,G.h9)??null,sessionId:b.conversationId,message:(function(a){let b=(0,L.Qd)(a.raw.properties)?a.raw.properties:{};if(a.detail===N.aF)return(0,L.NZ)(b,["metadata","command"])??(0,L.O2)(b,"permission");if(a.detail===N.Tm){let a=b.questions;return Array.isArray(a)&&(0,L.Qd)(a[0])?(0,L.O2)(a[0],"question"):null}return a.detail===N.vE?(0,L.NZ)(b,["error","data","message"])??(0,L.NZ)(b,["error","name"]):null})(b)?.slice(0,K.lY)??null,model:b.model},g={sessionStartMayArriveLate:d.capabilities.sessionStartMayArriveLate};if("notification"===b.event&&b.detail===N.aF){f.decisionId=(0,L.O2)((0,L.Qd)(b.raw.properties)?b.raw.properties:{},"id");let d=(0,O.LF)(b.raw,b.receivedAt);f.toolName=d?.toolName??null,f.decisionPatterns=d?.patterns??null,f.promptSettled=await S(a,b,c),(0,J.recordAgentEvent)(a.worktreeId,Q.k,c,f,g);return}if("notification"===b.event&&b.detail===N.C8){f.decisionId=(0,N.Mn)(b.raw),f.promptSettled=!!(0,M.VM)(Q.k).capabilities.permissionReplyReleasesPrompt||(R.info("opencode-permission-reply-not-releasing",{worktreeId:a.worktreeId,instanceId:c,reason:"capability-permissionReplyReleasesPrompt-false"}),!1),(0,J.recordAgentEvent)(a.worktreeId,Q.k,c,f,g),R.info("opencode-permission-reply-observed",{worktreeId:a.worktreeId,instanceId:c,decisionId:f.decisionId,released:f.promptSettled});return}if((0,J.recordAgentEvent)(a.worktreeId,Q.k,c,f,g),"notification"===b.event&&b.detail===N.Tm){let d=(0,M.VM)(Q.k).parseQuestion(b.raw);d&&((0,J._N)(a.worktreeId,Q.k,c,d,b.receivedAt),(0,J.MU)(a.worktreeId,Q.k,c,{toolName:I.GF,decisionId:d.promptId,detail:N.Tm},b.receivedAt),R.info("opencode-question-recorded",{worktreeId:a.worktreeId,instanceId:c,decisionId:d.promptId,questionCount:d.questions.length,optionCounts:d.questions.map(a=>a.choices.length)})),await (0,P.Vo)(a,c,f.message??null,b.receivedAt);return}if("stop"===b.event)return void await T(a,c);"notification"===b.event&&b.detail===N.vE&&await (0,P.dJ)(a,c,(0,L.NZ)((0,L.Qd)(b.raw.properties)?b.raw.properties:{},["error","name"]),f.message??null,b.conversationId,b.receivedAt),R.info("opencode-event-received",{worktreeId:a.worktreeId,instanceId:c,event:b.event,detail:b.detail})}catch(d){R.error("opencode-event-ingest-failed",{worktreeId:a.worktreeId,instanceId:c,event:b.event,error:d instanceof Error?d.message:String(d)})}}var V=c(84574),W=c(85965),X=c(53163);let Y=(0,n.h)("lib/hooks/sources/opencode/runtime");function Z(a,b){return{worktreeId:a,cliToolId:"opencode",instanceId:b}}async function $(a,b){try{return await (0,V.CU)(a,b)}catch(b){return Y.warn("opencode-port-reserve-failed",{worktreeId:a.worktreeId,error:b instanceof Error?b.message:String(b)}),null}}let _=[0,500,1e3,2e3,4e3];async function aa(a,b){for(let[c,d]of _.entries()){d>0&&await new Promise(a=>setTimeout(a,d));let e=await (0,F.sc)(b);if("healthy"===e.kind)return c>0&&Y.info("opencode-server-reachable-after-retry",{worktreeId:a.worktreeId,instanceId:a.instanceId??a.cliToolId,port:b,attempt:c}),e.health;if("rejected"===e.kind){Y.warn("opencode-server-refused-commandmate",{worktreeId:a.worktreeId,instanceId:a.instanceId??a.cliToolId,port:b,status:e.status,consequence:"structured events are off for this session; the scraper decides"});break}}return null}async function ab(a){try{let b=(0,V.hC)(a);if(null===b)return!1;if((0,X.wb)(a))return!0;let c=await aa(a,b);if(!c)return Y.info("opencode-server-not-reachable",{worktreeId:a.worktreeId,instanceId:a.instanceId??a.cliToolId,port:b,attempts:_.length}),!1;await W.cC.subscribe(a,b=>{U(a,b)});let d=await ac(a);return Y.info("opencode-event-stream-attached",{worktreeId:a.worktreeId,instanceId:a.instanceId??a.cliToolId,port:b,version:c.version,activity:d}),!0}catch(b){return Y.warn("opencode-event-stream-attach-failed",{worktreeId:a.worktreeId,error:b instanceof Error?b.message:String(b)}),!1}}async function ac(a){let b=null;try{b=await W.cC.probeActivity(a)}catch(b){Y.debug("opencode-activity-probe-failed",{worktreeId:a.worktreeId,instanceId:a.instanceId??a.cliToolId,error:b instanceof Error?b.message:String(b)})}return(0,X.yn)(a,b,Date.now()),b}async function ad(a,b){try{if((0,X.wb)(a))return!0;let c=await (0,V.jp)(a,b);if(null===c)return!1;return await ab(a)}catch(b){return Y.warn("opencode-event-stream-resume-failed",{worktreeId:a.worktreeId,error:b instanceof Error?b.message:String(b)}),!1}}async function ae(a){let b=a.instanceId??a.cliToolId;try{let c=(0,V.hC)(a);if(null===c)return!1;let d=(0,X.lf)(a);if("live"!==d.state)return Y.info("opencode-abort-skipped-not-live",{worktreeId:a.worktreeId,instanceId:b,port:c,liveness:d.state}),!1;let e=(0,X.ym)(a);if(null===e)return Y.info("opencode-abort-skipped-no-session",{worktreeId:a.worktreeId,instanceId:b,port:c}),!1;let f=(0,X.H1)(a,e,2e3);if(!await (0,F.UR)(c,e))return f.cancel(),Y.warn("opencode-abort-rejected",{worktreeId:a.worktreeId,instanceId:b,port:c,sessionId:e}),!1;if(!await f.seen)return Y.warn("opencode-abort-unconfirmed",{worktreeId:a.worktreeId,instanceId:b,port:c,sessionId:e,timeoutMs:2e3}),!1;return Y.info("opencode-abort-confirmed",{worktreeId:a.worktreeId,instanceId:b,port:c,sessionId:e}),!0}catch(c){return Y.warn("opencode-abort-failed",{worktreeId:a.worktreeId,instanceId:b,error:c instanceof Error?c.message:String(c)}),!1}}async function af(a){try{await (0,X.FN)(a),(0,V.kE)(a)}catch(b){Y.warn("opencode-event-stream-release-failed",{worktreeId:a.worktreeId,error:b instanceof Error?b.message:String(b)})}}var ag=c(18529),ah=c(70849),ai=c(27939),aj=c(93949),ak=c(20610),al=c(78099);let am=(0,n.h)("cli-tools/opencode"),an=(0,C.promisify)(B.execFile);function ao(a){return a instanceof Error?a.message:String(a)}function ap(){let a=process.env[A.ao],b=(0,A._u)();return void 0!==a&&String(b)!==a.trim()?am.warn("opencode-pane-width-rejected",{requested:a,applied:b}):b>=A.Lg&&am.warn("opencode-pane-width-sidebar-visible",{width:b,sidebarMinWidth:A.Lg}),b}let aq=[0,50,100,200];function ar(a,b){return a?`${a}
2
2
 
3
- [添付画像: ${b}]`:`[添付画像: ${b}]`}class as extends d.M{navigationKeys(){return{keys:e.sM,leaderKey:e.Mx}}async isRunning(a,b){let c=this.getSessionName(a,b);return await (0,f.N)(c)}async launchSession(a,b,c){if(!await this.isInstalled())throw new al.lU(this.name,"OpenCode is not installed or not in PATH");let d=this.getSessionName(a,c),e=Z(a,c),g=await (0,f.N)(d);if(g){if(await this.reconcileExistingSession(d,{windowWidth:ap(),windowHeight:A.xT}),await this.isToolLive(d,{confirm:!0})){await ad(e,b),am.info("opencode-session-sessionname");return}am.warn("opencode-session-relaunch",{sessionName:d}),await af(e)}(0,E.Fq)(e);try{await z(b),g||(await (0,f.jw)({sessionName:d,workingDirectory:b}),await new Promise(a=>setTimeout(a,ak.Uc)));try{await an("tmux",["resize-window","-t",(0,f.lA)(d),"-x",String(ap()),"-y",String(A.xT)])}catch{}await $(e,b);let h=(0,E.wK)({target:e,executablePath:this.command,worktreePath:b}),i=(0,ai.pr)(e,b),j=null===i?h:(0,ai.XO)(h,i);null!==i&&am.info("opencode-session-resumed",{worktreeId:a,instanceId:c??this.id,sessionId:i}),await (0,f.V1)(d,j,!0),await this.waitForReady(d),await ab(e),am.info("started-opencode-session:sessionname")}catch(b){let a=ao(b);throw Error(`Failed to start OpenCode session: ${a}`)}}async waitForReady(a){for(let b=0;b<60;b++){try{let c=(0,g.aJ)(await (0,f.Xg)(a,50));if(g.vU.test(c))return am.info("opencode-composer-detected",{attempt:b}),!0;if(g.LO.test(c))return am.info("opencode-overlay-detected",{attempt:b}),!0}catch{}await new Promise(a=>setTimeout(a,500))}return am.info("opencode-ready-detection-timeout"),!1}async trySendViaServer(a,b,c){let d=a.instanceId??a.cliToolId;try{let e=(0,V.hC)(a);if(null===e)return!1;let f=(0,X.lf)(a);if("live"!==f.state)return am.info("opencode-send-skipped-not-live",{worktreeId:a.worktreeId,instanceId:d,port:e,liveness:f.state}),!1;let g=(0,X.ym)(a);if(null===g)return am.info("opencode-send-skipped-no-session",{worktreeId:a.worktreeId,instanceId:d,port:e}),!1;let h=[{type:"text",text:b}];void 0!==c&&h.push({type:"file",mime:(0,D.$Y)((0,l.extname)(c)),filename:(0,l.basename)(c),url:(0,F.fy)(c)});let i=(0,F.CH)(),j=(0,ag.QH)((0,ag.Q1)(a));if(!await (0,F.wZ)(e,g,i,h,j))return!1;if(!await this.verifyPostedMessage(e,g,i,b))return am.warn("opencode-send-unverified",{worktreeId:a.worktreeId,instanceId:d,port:e,sessionId:g,messageId:i,hasImage:void 0!==c}),!1;return am.info("opencode-send-delivered-via-api",{worktreeId:a.worktreeId,instanceId:d,port:e,sessionId:g,messageId:i,hasImage:void 0!==c}),!0}catch(b){return am.warn("opencode-send-api-failed",{worktreeId:a.worktreeId,instanceId:d,error:ao(b)}),!1}}async verifyPostedMessage(a,b,c,d){for(let e of aq){e>0&&await new Promise(a=>setTimeout(a,e));let f=await (0,F.ep)(a,b,c);if("found"===f.kind)return f.texts.includes(d);if("missing"===f.kind)break}return!1}async sendMessage(a,b,c){let d=this.getSessionName(a,c);if(!await (0,f.N)(d))throw Error(`OpenCode session ${d} does not exist. Start the session first.`);if(await this.relaunchIfToolExited(a,c),await this.trySendViaServer(Z(a,c),b))return void(0,i.gm)(d);try{await (0,h.FW)({sessionName:d,message:b,cliToolId:"opencode",composer:this.describeComposer()}),(0,i.gm)(d),am.info("sent-message-to-opencode-session:session")}catch(b){let a=ao(b);throw Error(`Failed to send message to OpenCode: ${a}`)}}supportsImage(){return!0}async sendMessageWithImage(a,b,c,d){let e=this.getSessionName(a,d);if(!await (0,f.N)(e))throw Error(`OpenCode session ${e} does not exist. Start the session first.`);let g=Z(a,d);if(await this.trySendViaServer(g,b,c))return void(0,i.gm)(e);am.info("opencode-image-degraded-to-path",{worktreeId:a,instanceId:d??this.id}),await this.sendMessage(a,ar(b,c),d)}async killSession(a,b){let c=this.getSessionName(a,b),d=Z(a,b),e=(0,V.hC)(d),g=await (0,ah.LQ)(d).catch(()=>null);g&&!g.captured&&am.info("opencode-session-capture-skipped",{sessionName:c,reason:g.skipped}),await af(d);try{if(await (0,f.N)(c)){await (0,f.V1)(c,"/exit",!1),await new Promise(a=>setTimeout(a,ak.pL)),await (0,f.KB)(c,["Enter"]),await new Promise(a=>setTimeout(a,ak.KI));let a=await (0,aj.rY)({sessionAlive:()=>(0,f.N)(c),portAnswering:null===e?null:async()=>await (0,F.Ok)(e)!==null});a.ok||(am.warn("opencode-graceful-exit-postcondition-failed",{sessionName:c,reason:a.reason,...null!==e?{port:e}:{}}),await (0,f.fY)(c))}else await (0,f.fY)(c);(0,i.gm)(c),am.info("stopped-opencode-session:sessionname")}catch(a){throw am.error("session:stop-failed",{error:ao(a)}),a}}async interrupt(a,b){let c=this.getSessionName(a,b);if(await ae(Z(a,b))){(0,i.gm)(c),am.info("opencode-interrupt-aborted-via-api");return}await (0,f.ds)(c,"Escape"),await new Promise(a=>setTimeout(a,ak.os)),await (0,f.ds)(c,"Escape"),(0,i.gm)(c),am.info("opencode-interrupt-sent")}constructor(...a){super(...a),this.id="opencode",this.name="OpenCode",this.command="opencode"}}},56263:(a,b,c)=>{c.d(b,{L1:()=>e,MJ:()=>j,Rf:()=>f,ky:()=>g,lM:()=>i,pL:()=>h,wp:()=>d,zt:()=>k});let d=200,e=100,f=1e5,g="[... truncated ...]",h=3e4,i=/^[a-zA-Z0-9][a-zA-Z0-9\-._/:]*$/,j=128,k="Install with: brew install copilot-cli (macOS) or npm i -g @github/copilot"},70849:(a,b,c)=>{c.d(b,{LQ:()=>k,SW:()=>l});var d=c(72626),e=c(84574),f=c(48083),g=c(77634),h=c(27939);let i=(0,d.h)("lib/session/opencode-session-recall");async function j(a,b){let c=new Set,d=await (0,g.GP)(a,b);for(let b=0;b<3;b+=1){if(null===d)return null;if(null===d.parentId||c.has(d.parentId))break;c.add(d.parentId),i.debug("opencode-session-parent-hop",{from:d.id,to:d.parentId}),d=await (0,g.GP)(a,d.parentId)}return d}async function k(a){let b=a.instanceId??a.cliToolId,c=(0,e.hC)(a);if(null===c)return{captured:!1,skipped:"no-port"};let d=(0,f.getLastAgentEvent)(a.worktreeId,"opencode",a.instanceId)?.sessionId;if(!(0,h.jp)(d))return{captured:!1,skipped:"no-session-observed"};let g=await j(c,d);if(null===g)return{captured:!1,skipped:"session-unreadable"};if(null===g.directory)return{captured:!1,skipped:"no-directory"};let k=(0,e.U9)(a);return null!==k&&k!==g.directory?(i.warn("opencode-session-capture-directory-mismatch",{worktreeId:a.worktreeId,instanceId:b,expected:k,reported:g.directory}),{captured:!1,skipped:"directory-mismatch"}):(0,h.F_)(a,{sessionId:g.id,title:g.title,worktreePath:g.directory})?(i.info("opencode-session-captured",{worktreeId:a.worktreeId,instanceId:b,sessionId:g.id,viaParentOf:g.id===d?null:d}),{captured:!0,memory:{sessionId:g.id,title:g.title,worktreePath:g.directory,updatedAt:Date.now()}}):{captured:!1,skipped:"not-persisted"}}async function l(a){let b=(0,e.hC)(a),c=(0,f.getLastAgentEvent)(a.worktreeId,"opencode",a.instanceId)?.sessionId;if(null!==b&&(0,h.jp)(c)){let a=await j(b,c);if(null!==a)return a.id}return(0,h.KA)(a)?.sessionId??null}},72272:(a,b,c)=>{c.d(b,{t:()=>i});var d=c(72626),e=c(50474),f=c(25071),g=c(17287);let h=(0,d.h)("lib/hooks/permission-adjudication");async function i(a,b,d,j,k="event"){let l=b.instanceId??b.cliToolId,m={worktreeId:b.worktreeId,cliToolId:b.cliToolId,instanceId:l},{resolvePermissionRequest:n}=await c.e(3241).then(c.bind(c,43241)),o=n(m,j),p="allow"===o.behavior?{kind:"allowOnce"}:{kind:"abstain"};if("abstain"===p.kind){let c=(0,e.y_)(a);c.safe||h.warn("permission-request-abstain-blocks-agent",{worktreeId:b.worktreeId,cliToolId:b.cliToolId,instanceId:l,toolName:j?.toolName??null,decisionId:d.id,reason:o.reason,consequence:c.summary,blocksForMs:c.blocksForMs})}let{delivery:q}=await (0,f.GW)(a,b,d,p),r=q?.delivered===!0,s=r&&a.capabilities.permissionReplyReleasesPrompt;return(0,g.nL)(b.worktreeId,b.cliToolId,b.instanceId,{decisionId:d.id,toolName:j?.toolName??null,behavior:"allow"===o.behavior?"allow":null,reason:o.reason,delivered:r,releasedPrompt:s,trigger:k,at:d.askedAt}),h.info("permission-decision-adjudicated",{worktreeId:b.worktreeId,cliToolId:b.cliToolId,instanceId:l,decisionId:d.id,toolName:j?.toolName??null,behavior:o.behavior,reason:o.reason,suppressedBy:o.suppressedBy,delivered:r,settled:s,trigger:k}),{decisionId:d.id,behavior:"allow"===o.behavior?"allow":null,reason:o.reason,delivered:r,settled:s}}},77634:(a,b,c)=>{c.d(b,{GP:()=>l,Hv:()=>h,eJ:()=>n,mf:()=>o,y4:()=>m,yg:()=>p});var d=c(72626),e=c(49791),f=c(27939);let g=(0,d.h)("lib/session/opencode-session-api"),h="session_new";function i(a,b){let c=a[b];return"string"==typeof c&&c.length>0?c:null}async function j(a,b){try{let c=await fetch(a,{...b,redirect:e.uS,signal:AbortSignal.timeout(e.T0)});if(!c.ok)return null;if(!function(a){let b=a.headers?.get?.("content-type");return"string"==typeof b&&b.split(";",1)[0]?.trim().toLowerCase()===e._t}(c))return g.debug("opencode-session-request-content-type",{url:a,contentType:c.headers?.get?.("content-type")??null}),null;return await c.json()}catch(b){return g.debug("opencode-session-request-failed",{url:a,error:b instanceof Error?b.message:String(b)}),null}}function k(a){if(!("object"==typeof a&&null!==a&&!Array.isArray(a)))return null;let b=i(a,"id");if(!(0,f.jp)(b))return null;let c=i(a,"title");return{id:b,title:null===c?null:c.slice(0,f.Y2),directory:i(a,"directory"),parentId:i(a,"parentID")}}async function l(a,b){return(0,f.jp)(b)?k(await j(`${(0,e.M2)(a)}/session/${encodeURIComponent(b)}`)):null}async function m(a,b){return(0,f.jp)(b)?k(await j(`${(0,e.M2)(a)}/session/${encodeURIComponent(b)}/fork`,{method:"POST",headers:{"content-type":e._t},body:"{}"})):null}async function n(a){return!0===await j(`${(0,e.M2)(a)}/tui/open-sessions`,{method:"POST",headers:{"content-type":e._t},body:"{}"})}async function o(a,b){return!0===await j(`${(0,e.M2)(a)}/tui/execute-command`,{method:"POST",headers:{"content-type":e._t},body:JSON.stringify({command:b})})}async function p(a,b){return!!(0,f.jp)(b)&&!0===await j(`${(0,e.M2)(a)}/tui/select-session`,{method:"POST",headers:{"content-type":e._t},body:JSON.stringify({sessionID:b})})}},81886:(a,b,c)=>{c.d(b,{M:()=>s});var d=c(79646),e=c(28354),f=c(40964),g=c(79892),h=c(56717),i=c(23365),j=c(93949),k=c(91536),l=c(50945),m=c(96287),n=c(72626),o=c(8953),p=c(20610);let q=(0,e.promisify)(d.exec),r=(0,n.h)("cli-tools/base");class s{async isInstalled(){try{return await q(`which ${this.command}`,{timeout:5e3}),!0}catch{return!1}}getSessionName(a,b){return(0,f.m)(this.id,a,b)}async startSession(a,b,c,d){try{await this.launchSession(a,b,c,d)}catch(b){throw(0,m.Zl)({worktreeId:a,cliToolId:this.id,instanceId:c,toolName:this.name},b),b}}async reconcileExistingSession(a,b){await (0,g.zT)(a,b)}async interrupt(a,b){let c=this.getSessionName(a,b);await (0,g.ds)(c,"Escape")}describeComposer(){return(0,h.gc)(this.id)}gracefulExitSequence(){return(0,j.JV)(this.id)}captureSpec(){return(0,i.y)(this.id)}livenessSpec(){return(0,k.H7)(this.id)}async isToolLive(a,b){let c=this.livenessSpec(),d=await (0,l.Q)(a,c);if(d.alive)return!0;if(!b?.confirm)return!1;await new Promise(a=>setTimeout(a,p.kZ));let e=await (0,l.Q)(a,c);return e.alive?(r.info("session:liveness-confirm-recovered",{cliToolId:this.id,firstReason:d.reason}),!0):(r.warn("session:tool-exited",{cliToolId:this.id,reason:e.reason}),!1)}async relaunchIfToolExited(a,b){let c=this.getSessionName(a,b);if(await this.isToolLive(c))return;let d=await (0,g.nS)(c);if(null===d)return void r.warn("session:relaunch-skipped-no-path",{cliToolId:this.id,worktreeId:a});r.info("session:relaunch-before-send",{cliToolId:this.id,sessionName:c}),await this.startSession(a,d,b)}navigationKeys(){return{keys:o.qD,leaderKey:null}}}},83468:(a,b,c)=>{c.r(b),c.d(b,{CLIToolManager:()=>Y});var d=c(81886),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 launchSession(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=`
4
- ![](${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(79892),h=c(40236),i=c(93997),j=c(85164),k=c(11472);let l=["skip","skip-until-next-version","update","ask"],m=Object.freeze({update:"1",skip:"2","skip-until-next-version":"3",ask:null});function n(a){if("string"!=typeof a)return null;let b=a.trim().toLowerCase();return"string"==typeof b&&l.includes(b)?b:null}c(68847);var o=c(61260);c(48800);var p=c(72626),q=c(22354),r=c(4970),s=c(20610),t=c(2669);let u=(0,p.h)("cli-tools/codex");function v(a){return a instanceof Error?a.message:String(a)}let w="codex";class x extends d.M{async isRunning(a,b){let c=this.getSessionName(a,b);return await (0,g.N)(c)}async launchSession(a,b,c){if(!await this.isInstalled())throw new t.lU(this.name,"Codex CLI is not installed or not in PATH");let d=this.getSessionName(a,c),e=await (0,g.N)(d);if(e){if(await this.reconcileExistingSession(d),await this.isToolLive(d,{confirm:!0}))return void u.info("codex-session-sessionname");u.warn("codex-session-relaunch",{sessionName:d})}(0,r.Fq)({worktreeId:a,cliToolId:q.c1,instanceId:c});try{e||(await (0,g.jw)({sessionName:d,workingDirectory:b}),await new Promise(a=>setTimeout(a,s.Uc)));let f=(0,r.wK)({target:{worktreeId:a,cliToolId:q.c1,instanceId:c},executablePath:this.command,worktreePath:b}),h=async()=>{(0,r.Fq)({worktreeId:a,cliToolId:q.c1,instanceId:c}),await (0,g.V1)(d,f,!0),await new Promise(a=>setTimeout(a,3e3))};await (0,g.V1)(d,f,!0),await new Promise(a=>setTimeout(a,3e3)),await this.waitForReady(d,{relaunch:h}),u.info("started-codex-session:sessionname")}catch(b){let a=v(b);throw Error(`Failed to start Codex session: ${a}`)}}async waitForReady(a,b){let c=!1,d=!1,e=!1,f=0,h=function(a){let b=n(void 0);if(null!==b)return b;let c=n(((void 0)??process.env).CM_CODEX_UPDATE_DIALOG);return null!==c?c:"skip-until-next-version"}(),i=m[h],l=!1,p=!1,q=!1,r=30;try{for(let n=0;n<r;n++){try{let t=await (0,g.Xg)(a,50),v=(0,j.aJ)(t);if((0,j.zZ)(v))return void u.info("codex-prompt-detected");if(l&&!p&&b?.relaunch&&null!==(0,k.GE)(v,this.livenessSpec())){p=!0,r=Math.max(r,n+1+30),d=!1,e=!1,f=0,q&&(q=!1,(0,o.lM)(w),u.info("codex-update-lock-released",{sessionName:a})),u.info("codex-relaunched-after-update",{sessionName:a,policy:h}),await b.relaunch();continue}if(!e&&function(a){return j.XV.every(b=>a.includes(b))}(v)){await (0,g.V1)(a,"3",!1),e=!0,u.info("codex-hooks-review-declined"),await new Promise(a=>setTimeout(a,s.CV));continue}let x=(0,j.E6)(v);if(("hooks-list"===x||"hooks-detail"===x)&&f<4){await (0,g.ds)(a,"Escape"),f++,u.info("codex-hooks-screen-escaped"),await new Promise(a=>setTimeout(a,s.CV));continue}let y=(0,j.Qh)(v);if("update"===y){if(l=!0,null===i){await new Promise(a=>setTimeout(a,1e3));continue}if(!c){let b=i;b!==m.update||(0,o.mf)(w)?b===m.update&&(q=!0):(b=m["skip-until-next-version"],u.warn("codex-update-dialog-yielded-to-running-update",{sessionName:a,policy:h,requestedKey:i,key:b})),await (0,g.V1)(a,b,!1),c=!0,b===m.update&&(r=Math.max(r,n+1+120)),u.info("codex-update-dialog-answered",{sessionName:a,policy:h,key:b}),await new Promise(a=>setTimeout(a,s.CV));continue}}if("press-enter"===y){await (0,g.ds)(a,"Enter"),u.info("dismissed-codex-notification"),await new Promise(a=>setTimeout(a,s.CV));continue}if("trust"===y&&!d){await (0,g.V1)(a,"1",!1),d=!0,u.info("auto-trusted-folder-for"),await new Promise(a=>setTimeout(a,s.CV));continue}}catch{}await new Promise(a=>setTimeout(a,1e3))}u.info("codex-prompt-detection")}finally{q&&(q=!1,(0,o.lM)(w),u.warn("codex-update-lock-released-unfinished",{sessionName:a}))}}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 u.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.`);await this.relaunchIfToolExited(a,c);try{await this.waitForPrompt(d),await (0,h.FW)({sessionName:d,message:b,cliToolId:"codex",composer:this.describeComposer()}),(0,i.gm)(d),u.info("sent-message-to-codex-session:sessionnam")}catch(b){let a=v(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,s.Zf))),await (0,g.fY)(c)&&u.info("stopped-codex-session:sessionname")}catch(a){throw u.error("session:stop-failed",{error:v(a)}),a}}constructor(...a){super(...a),this.id="codex",this.name="Codex CLI",this.command="codex"}}var y=c(23365);let z=(0,p.h)("cli-tools/gemini");function A(a){return a instanceof Error?a.message:String(a)}class B extends d.M{async isRunning(a,b){let c=this.getSessionName(a,b);return await (0,g.N)(c)}async launchSession(a,b,c){if(!await this.isInstalled())throw new t.lU(this.name,"Gemini CLI is not installed or not in PATH");let d=this.getSessionName(a,c),e=await (0,g.N)(d);if(e){if(await this.reconcileExistingSession(d),await this.isToolLive(d,{confirm:!0}))return void z.info("gemini-session-sessionname");z.warn("gemini-session-relaunch",{sessionName:d})}(0,r.Fq)({worktreeId:a,cliToolId:q.o,instanceId:c});try{e||(await (0,g.jw)({sessionName:d,workingDirectory:b}),await new Promise(a=>setTimeout(a,s.Uc)));let f=(0,r.wK)({target:{worktreeId:a,cliToolId:q.o,instanceId:c},executablePath:this.command,worktreePath:b});await (0,g.V1)(d,f,!0),await new Promise(a=>setTimeout(a,6e3)),await this.waitForReady(d),z.info("started-gemini-session:sessionname")}catch(b){let a=A(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,g.Xg)(a,y.H),d=(0,j.aJ)(c);if(j.wN.test(d))return void z.info("gemini-prompt-detected");!b&&d.includes("Do you trust this folder?")&&(await (0,g.ds)(a,"Enter"),b=!0,z.info("auto-trusted-folder-for"))}catch{}await new Promise(a=>setTimeout(a,1e3))}z.info("gemini-prompt-detection")}async waitForPrompt(a){let b=Date.now();for(;Date.now()-b<15e3;){try{let b=await (0,g.Xg)(a,y.H),c=(0,j.aJ)(b);if(j.wN.test(c))return}catch{}await new Promise(a=>setTimeout(a,500))}z.info("gemini-prompt-not")}async sendMessage(a,b,c){let d=this.getSessionName(a,c);if(!await (0,g.N)(d))throw Error(`Gemini session ${d} does not exist. Start the session first.`);await this.relaunchIfToolExited(a,c);try{await this.waitForPrompt(d),await (0,h.FW)({sessionName:d,message:b,cliToolId:"gemini",composer:this.describeComposer()}),(0,i.gm)(d),z.info("sent-message-to-gemini-session:sessionna")}catch(b){let a=A(b);throw Error(`Failed to send message to Gemini: ${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,s.Is)),await (0,g.V1)(c,"/quit",!0),await new Promise(a=>setTimeout(a,s.Zf))),await (0,g.fY)(c)&&z.info("stopped-gemini-session:sessionname")}catch(a){throw z.error("session:stop-failed",{error:A(a)}),a}}constructor(...a){super(...a),this.id="gemini",this.name="Gemini CLI",this.command="gemini"}}var C=c(15194),D=c(88807),E=c(56791);let F=(0,p.h)("cli-tools/vibe-local");function G(a){return a instanceof Error?a.message:String(a)}class H extends d.M{async isRunning(a,b){let c=this.getSessionName(a,b);return await (0,g.N)(c)}async launchSession(a,b,c){if(!await this.isInstalled())throw new t.lU(this.name,"vibe-local is not installed or not in PATH");let d=this.getSessionName(a,c),e=await (0,g.N)(d);if(e){if(await this.reconcileExistingSession(d),await this.isToolLive(d,{confirm:!0}))return void F.info("vibe-local-session");F.warn("vibe-local-session-relaunch",{sessionName:d})}try{e||(await (0,g.jw)({sessionName:d,workingDirectory:b}),await new Promise(a=>setTimeout(a,s.Uc)));let c="vibe-local -y";try{let b=(0,D.getDbInstance)(),d=(0,E.getWorktreeById)(b,a);d?.vibeLocalModel&&C.QP.test(d.vibeLocalModel)&&(c+=` -m ${d.vibeLocalModel}`);let e=d?.vibeLocalContextWindow;(0,C.FV)(e)&&(c+=` --context-window ${Number(e)}`)}catch{}await (0,g.V1)(d,c,!0),await new Promise(a=>setTimeout(a,5e3)),F.info("started-vibe-local-session:sessionname")}catch(b){let a=G(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.`);await this.relaunchIfToolExited(a,c);try{await (0,h.FW)({sessionName:d,message:b,cliToolId:"vibe-local",composer:this.describeComposer(),interEnterWaitMs:s.PY}),(0,i.gm)(d),F.info("sent-message-to-vibe-local-session:sessi")}catch(b){let a=G(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,s.Is)),await (0,g.ds)(c,"C-c"),await new Promise(a=>setTimeout(a,s.Zf))),await (0,g.fY)(c)&&F.info("stopped-vibe-local-session:sessionname")}catch(a){throw F.error("session:stop-failed",{error:G(a)}),a}}constructor(...a){super(...a),this.id="vibe-local",this.name="Vibe Local",this.command="vibe-local"}}var I=c(41466),J=c(81776),K=c(56263),L=c(21758),M=c(54633),N=c(77093);let O=(0,p.h)("cli-tools/copilot"),P=new Set(["model","agent","theme","permissions","skills","mcp","settings","statusline","subagents","resume","session"]),Q=/^[>❯](?:\s|$)/;class R extends d.M{async isInstalled(){return await (0,J.B0)()!==null}launchExecutable(a){return"path"===a.source?this.command:L.nL}async isRunning(a,b){let c=this.getSessionName(a,b);return await (0,g.N)(c)}async launchSession(a,b,c){let d=await (0,J.B0)();if(!d)throw new t.lU(this.name,`GitHub Copilot CLI is not installed. ${K.zt}`);let e=this.getSessionName(a,c),f=await (0,g.N)(e);if(f){if(await this.reconcileExistingSession(e),await this.isToolLive(e,{confirm:!0}))return void O.info("copilot-session-exists");O.warn("copilot-session-relaunch",{sessionName:e})}(0,r.Fq)({worktreeId:a,cliToolId:M.V,instanceId:c});try{f||(await (0,g.jw)({sessionName:e,workingDirectory:b}),await new Promise(a=>setTimeout(a,s.Uc)));let h=(0,r.wK)({target:{worktreeId:a,cliToolId:M.V,instanceId:c},executablePath:this.launchExecutable(d),worktreePath:b});await (0,g.V1)(e,h,!0),await this.waitForReady(e),O.info("started-copilot-session",{executableSource:d.source,version:d.version})}catch(b){let a=(0,N.u1)(b);throw Error(`Failed to start Copilot session: ${a}`)}}async answerFolderTrustDialog(a,b){return!!(0,j.Rx)(b)&&(await (0,g.V1)(a,j.oD,!1),(0,i.gm)(a),O.info("copilot-folder-trust-answered"),!0)}isComposerDrawn(a){let b=a.split("\n");for(let a=1;a<b.length-1;a++)if(Q.test(b[a])&&j.A.test(b[a-1].trimEnd())&&j.A.test(b[a+1].trimEnd()))return!0;return!1}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(this.isComposerDrawn(d))return void O.info("copilot-prompt-detected");!b&&await this.answerFolderTrustDialog(a,d)&&(b=!0)}catch{}await new Promise(a=>setTimeout(a,1e3))}O.info("copilot-prompt-detection-timeout")}async waitForPrompt(a,b=15e3){let c=Date.now(),d=!1;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;!d&&await this.answerFolderTrustDialog(a,c)&&(d=!0)}catch{}await new Promise(a=>setTimeout(a,500))}O.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((0,j.gT)(c.split("\n")))return O.info("copilot-selection-list-detected"),!0}catch{}}return O.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.`);await this.relaunchIfToolExited(a,c);try{await this.waitForPrompt(d);let a=this.extractSlashCommand(b);if(a&&P.has(a)){await (0,g.V1)(d,b,!0),await this.waitForSelectionList(d),(0,i.gm)(d),O.info("sent-selection-list-command-to-copilot",{command:a});return}await (0,h.FW)({sessionName:d,message:b,cliToolId:"copilot",composer:this.describeComposer(),textInputWaitMs:K.L1,verifyDelayMs:K.wp}),(0,i.gm)(d),O.info("sent-message-to-copilot-session")}catch(b){let a=(0,N.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.waitForPrompt(d,K.pL),(0,i.gm)(d),O.info("copilot-model-switched",{model:b})}catch(c){let a=(0,N.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,s.Is)),await (0,g.V1)(c,"/exit",!1),await new Promise(a=>setTimeout(a,K.L1)),await (0,g.KB)(c,["Enter"]),await new Promise(a=>setTimeout(a,s.Rk))),await (0,g.fY)(c)&&O.info("stopped-copilot-session")}catch(a){throw O.error("session:stop-failed",{error:(0,N.u1)(a)}),a}}constructor(...a){super(...a),this.id="copilot",this.name="Copilot",this.command="copilot"}}let S=(0,p.h)("cli-tools/antigravity");function T(a){return a instanceof Error?a.message:String(a)}let U=/\?\s+for\s+shortcuts/,V=/Do you trust the contents of this project\?/;function W(a){return U.test(a)&&!V.test(a)}class X extends d.M{async isRunning(a,b){let c=this.getSessionName(a,b);return await (0,g.N)(c)}async launchSession(a,b,c,d){if(!await this.isInstalled())throw new t.lU(this.name,"Antigravity CLI (agy) is not installed or not in PATH");let e=this.getSessionName(a,c),f=await (0,g.N)(e);if(f){if(await this.reconcileExistingSession(e),await this.isToolLive(e,{confirm:!0}))return void S.info("antigravity-session-exists");S.warn("antigravity-session-relaunch",{sessionName:e})}(0,r.Fq)({worktreeId:a,cliToolId:q.F0,instanceId:c});try{f||(await (0,g.jw)({sessionName:e,workingDirectory:b}),await new Promise(a=>setTimeout(a,s.Uc)));let h=(0,r.wK)({target:{worktreeId:a,cliToolId:q.F0,instanceId:c},executablePath:this.command,worktreePath:b}),i=d?`${h} --model '${d.replace(/'/g,"'\\''")}'`:h;await (0,g.V1)(e,i,!0),await new Promise(a=>setTimeout(a,3e3)),await this.waitForReady(e),S.info("started-antigravity-session")}catch(b){let a=T(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(W(d))return void S.info("antigravity-prompt-detected");if(!b&&V.test(d)){await (0,g.ds)(a,"Enter"),b=!0,S.info("auto-trusted-folder-for-antigravity"),await new Promise(a=>setTimeout(a,500));continue}}catch{}await new Promise(a=>setTimeout(a,1e3))}S.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(W(c))return}catch{}await new Promise(a=>setTimeout(a,500))}throw S.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.`);await this.relaunchIfToolExited(a,c);try{await this.waitForPrompt(d),await (0,h.FW)({sessionName:d,message:b,cliToolId:"antigravity",composer:this.describeComposer()}),(0,i.gm)(d),S.info("sent-message-to-antigravity-session")}catch(b){let a=T(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,s.Zf)));let a=await (0,g.fY)(c);(0,i.gm)(c),a&&S.info("stopped-antigravity-session")}catch(a){throw S.error("session:stop-failed",{error:T(a)}),a}}constructor(...a){super(...a),this.id="antigravity",this.name="Antigravity CLI",this.command="agy"}}class Y{constructor(){this.tools=new Map,this.tools.set("claude",new f),this.tools.set("codex",new x),this.tools.set("gemini",new B),this.tools.set("vibe-local",new H),this.tools.set("opencode",new I.Ui),this.tools.set("copilot",new R),this.tools.set("antigravity",new X)}static getInstance(){return Y.instance||(Y.instance=new Y),Y.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)}async stopPollers(a,b,d){let{stopPolling:e}=await Promise.all([c.e(1356),c.e(1503),c.e(1634),c.e(1719),c.e(1191),c.e(6894),c.e(6337),c.e(7824),c.e(7472),c.e(5017),c.e(1058),c.e(9696),c.e(3099),c.e(552),c.e(5220)]).then(c.bind(c,95220));e(a,b,d)}}},93949:(a,b,c)=>{c.d(b,{JV:()=>i,rY:()=>k});var d=c(56263),e=c(20610),f=c(86069);let g={keys:[(0,f.IS)("C-d")],exitWaitMs:e.Zf,ownsLoopbackServer:!1},h={claude:g,codex:g,antigravity:g,gemini:{keys:[(0,f.IS)("C-c",e.Is),(0,f.iF)(`/quit\r`,void 0)],exitWaitMs:e.Zf,ownsLoopbackServer:!1},"vibe-local":{keys:[(0,f.IS)("C-c",e.Is),(0,f.IS)("C-c")],exitWaitMs:e.Zf,ownsLoopbackServer:!1},copilot:{keys:[(0,f.IS)("C-c",e.Is),(0,f.iF)("/exit",d.L1),(0,f.IS)("Enter")],exitWaitMs:e.Rk,ownsLoopbackServer:!1},opencode:{keys:[(0,f.iF)("/exit",e.pL),(0,f.IS)("Enter")],exitWaitMs:e.KI,ownsLoopbackServer:!0}};function i(a){return h[a]??g}let j=a=>new Promise(b=>setTimeout(b,a));async function k(a){let b=Math.max(1,a.attempts??1),c=a.intervalMs??0,d=a.sleep??j,e=!0;for(let f=0;f<b&&(e=await a.sessionAlive());f+=1)f<b-1&&c>0&&await d(c);if(e)return{ok:!1,reason:"graceful_exit_timeout"};let f=a.portAnswering;if(!f)return{ok:!0};let g=!0;for(let a=0;a<b&&(g=await f());a+=1)a<b-1&&c>0&&await d(c);return g?{ok:!1,reason:"port_orphaned"}:{ok:!0}}},96287:(a,b,c)=>{c.d(b,{$k:()=>f,VI:()=>g,Zl:()=>e});var d=c(2669);function e(a,b){Promise.all([c.e(1356),c.e(1191),c.e(6337)]).then(c.bind(c,81099)).then(({notifySessionStartFailurePush:c})=>c({...a,error:b})).catch(()=>{})}async function f(a,b){if(await a.isInstalled())return;let c=new d.lU(a.name);throw e({worktreeId:b.worktreeId,cliToolId:a.id,instanceId:b.instanceId,toolName:a.name,subject:b.subject},c),c}function g(a,b){Promise.resolve().then(c.bind(c,83468)).then(({CLIToolManager:c})=>{let f=c.getInstance().getTool(a).name;e({worktreeId:b.worktreeId,cliToolId:a,instanceId:b.instanceId,toolName:f,subject:b.subject},new d.lU(f))}).catch(()=>{})}}};
3
+ [添付画像: ${b}]`:`[添付画像: ${b}]`}class as extends d.M{navigationKeys(){return{keys:e.sM,leaderKey:e.Mx}}async isRunning(a,b){let c=this.getSessionName(a,b);return await (0,f.N)(c)}async launchSession(a,b,c){if(!await this.isInstalled())throw(0,al.Tl)(this);let d=this.getSessionName(a,c),e=Z(a,c),g=await (0,f.N)(d);if(g){if(await this.reconcileExistingSession(d,{windowWidth:ap(),windowHeight:A.xT}),await this.isToolLive(d,{confirm:!0})){await ad(e,b),am.info("opencode-session-sessionname");return}am.warn("opencode-session-relaunch",{sessionName:d}),await af(e)}(0,E.Fq)(e);try{await z(b),g||(await (0,f.jw)({sessionName:d,workingDirectory:b}),await new Promise(a=>setTimeout(a,ak.Uc)));try{await an("tmux",["resize-window","-t",(0,f.lA)(d),"-x",String(ap()),"-y",String(A.xT)])}catch{}await $(e,b);let h=(0,E.wK)({target:e,executablePath:this.command,worktreePath:b}),i=(0,ai.pr)(e,b),j=null===i?h:(0,ai.XO)(h,i);null!==i&&am.info("opencode-session-resumed",{worktreeId:a,instanceId:c??this.id,sessionId:i}),await (0,f.V1)(d,j,!0),await this.waitForReady(d),await ab(e),am.info("started-opencode-session:sessionname")}catch(b){let a=ao(b);throw Error(`Failed to start OpenCode session: ${a}`)}}async waitForReady(a){for(let b=0;b<60;b++){try{let c=(0,g.aJ)(await (0,f.Xg)(a,50));if(g.vU.test(c))return am.info("opencode-composer-detected",{attempt:b}),!0;if(g.LO.test(c))return am.info("opencode-overlay-detected",{attempt:b}),!0}catch{}await new Promise(a=>setTimeout(a,500))}return am.info("opencode-ready-detection-timeout"),!1}async trySendViaServer(a,b,c){let d=a.instanceId??a.cliToolId;try{let e=(0,V.hC)(a);if(null===e)return!1;let f=(0,X.lf)(a);if("live"!==f.state)return am.info("opencode-send-skipped-not-live",{worktreeId:a.worktreeId,instanceId:d,port:e,liveness:f.state}),!1;let g=(0,X.ym)(a);if(null===g)return am.info("opencode-send-skipped-no-session",{worktreeId:a.worktreeId,instanceId:d,port:e}),!1;let h=[{type:"text",text:b}];void 0!==c&&h.push({type:"file",mime:(0,D.$Y)((0,l.extname)(c)),filename:(0,l.basename)(c),url:(0,F.fy)(c)});let i=(0,F.CH)(),j=(0,ag.QH)((0,ag.Q1)(a));if(!await (0,F.wZ)(e,g,i,h,j))return!1;if(!await this.verifyPostedMessage(e,g,i,b))return am.warn("opencode-send-unverified",{worktreeId:a.worktreeId,instanceId:d,port:e,sessionId:g,messageId:i,hasImage:void 0!==c}),!1;return am.info("opencode-send-delivered-via-api",{worktreeId:a.worktreeId,instanceId:d,port:e,sessionId:g,messageId:i,hasImage:void 0!==c}),!0}catch(b){return am.warn("opencode-send-api-failed",{worktreeId:a.worktreeId,instanceId:d,error:ao(b)}),!1}}async verifyPostedMessage(a,b,c,d){for(let e of aq){e>0&&await new Promise(a=>setTimeout(a,e));let f=await (0,F.ep)(a,b,c);if("found"===f.kind)return f.texts.includes(d);if("missing"===f.kind)break}return!1}async sendMessage(a,b,c){let d=this.getSessionName(a,c);if(!await (0,f.N)(d))throw Error(`OpenCode session ${d} does not exist. Start the session first.`);if(await this.relaunchIfToolExited(a,c),await this.trySendViaServer(Z(a,c),b))return void(0,i.gm)(d);try{await (0,h.FW)({sessionName:d,message:b,cliToolId:"opencode",composer:this.describeComposer()}),(0,i.gm)(d),am.info("sent-message-to-opencode-session:session")}catch(b){let a=ao(b);throw Error(`Failed to send message to OpenCode: ${a}`)}}supportsImage(){return!0}async sendMessageWithImage(a,b,c,d){let e=this.getSessionName(a,d);if(!await (0,f.N)(e))throw Error(`OpenCode session ${e} does not exist. Start the session first.`);let g=Z(a,d);if(await this.trySendViaServer(g,b,c))return void(0,i.gm)(e);am.info("opencode-image-degraded-to-path",{worktreeId:a,instanceId:d??this.id}),await this.sendMessage(a,ar(b,c),d)}async killSession(a,b){let c=this.getSessionName(a,b),d=Z(a,b),e=(0,V.hC)(d),g=await (0,ah.LQ)(d).catch(()=>null);g&&!g.captured&&am.info("opencode-session-capture-skipped",{sessionName:c,reason:g.skipped}),await af(d);try{if(await (0,f.N)(c)){await (0,f.V1)(c,"/exit",!1),await new Promise(a=>setTimeout(a,ak.pL)),await (0,f.KB)(c,["Enter"]),await new Promise(a=>setTimeout(a,ak.KI));let a=await (0,aj.rY)({sessionAlive:()=>(0,f.N)(c),portAnswering:null===e?null:async()=>await (0,F.Ok)(e)!==null});a.ok||(am.warn("opencode-graceful-exit-postcondition-failed",{sessionName:c,reason:a.reason,...null!==e?{port:e}:{}}),await (0,f.fY)(c))}else await (0,f.fY)(c);(0,i.gm)(c),am.info("stopped-opencode-session:sessionname")}catch(a){throw am.error("session:stop-failed",{error:ao(a)}),a}}async interrupt(a,b){let c=this.getSessionName(a,b);if(await ae(Z(a,b))){(0,i.gm)(c),am.info("opencode-interrupt-aborted-via-api");return}await (0,f.ds)(c,"Escape"),await new Promise(a=>setTimeout(a,ak.os)),await (0,f.ds)(c,"Escape"),(0,i.gm)(c),am.info("opencode-interrupt-sent")}constructor(...a){super(...a),this.id="opencode",this.name="OpenCode",this.command="opencode"}}},43234:(a,b,c)=>{c.r(b),c.d(b,{CLIToolManager:()=>ae});var d=c(81886),e=c(8953),f=c(57905);class g extends d.M{navigationKeys(){return{keys:e.pU,leaderKey:null}}async isInstalled(){return await (0,f.zw)()}async isRunning(a,b){return await (0,f.Yq)(a,b)}async launchSession(a,b,c){await (0,f.R7)({worktreeId:a,worktreePath:b,instanceId:c})}async sendMessage(a,b,c){await (0,f.pU)(a,b,c)}supportsImage(){return!0}async sendMessageWithImage(a,b,c,d){let e=`
4
+ ![](${c})`,f=b?`${b}${e}`:e;await this.sendMessage(a,f,d)}async killSession(a,b){await (0,f.VU)(a,b)}constructor(...a){super(...a),this.id="claude",this.name="Claude Code",this.command="claude"}}var h=c(79892),i=c(40236),j=c(93997),k=c(85164),l=c(11472);let m=["skip","skip-until-next-version","update","ask"],n=Object.freeze({update:"1",skip:"2","skip-until-next-version":"3",ask:null});function o(a){if("string"!=typeof a)return null;let b=a.trim().toLowerCase();return"string"==typeof b&&m.includes(b)?b:null}c(68847);var p=c(61260);c(48800);var q=c(72626),r=c(22354),s=c(99432),t=c(4970),u=c(20610),v=c(78099);let w=(0,q.h)("cli-tools/codex");function x(a){return a instanceof Error?a.message:String(a)}let y="codex";function z(){return{screen:null,attempts:0}}class A extends d.M{async isRunning(a,b){let c=this.getSessionName(a,b);return await (0,h.N)(c)}async launchSession(a,b,c){if(!await this.isInstalled())throw(0,v.Tl)(this);let d=this.getSessionName(a,c),e=await (0,h.N)(d);if(e){if(await this.reconcileExistingSession(d),await this.isToolLive(d,{confirm:!0}))return void w.info("codex-session-sessionname");w.warn("codex-session-relaunch",{sessionName:d})}(0,t.Fq)({worktreeId:a,cliToolId:r.c1,instanceId:c});try{e||(await (0,h.jw)({sessionName:d,workingDirectory:b}),await new Promise(a=>setTimeout(a,u.Uc)));let f=(0,t.wK)({target:{worktreeId:a,cliToolId:r.c1,instanceId:c},executablePath:this.command,worktreePath:b}),g=async()=>{(0,t.Fq)({worktreeId:a,cliToolId:r.c1,instanceId:c}),await (0,h.V1)(d,f,!0),await new Promise(a=>setTimeout(a,3e3))};await (0,h.V1)(d,f,!0),await new Promise(a=>setTimeout(a,3e3)),await this.waitForReady(d,{relaunch:g,trustHooks:(0,s.dO)(b)}),w.info("started-codex-session:sessionname")}catch(b){let a=x(b);throw Error(`Failed to start Codex session: ${a}`)}}async waitForReady(a,b){let c=b?.trustHooks??!1,d=!1,e=!1,f=z(),g=function(a){let b=o(void 0);if(null!==b)return b;let c=o(((void 0)??process.env).CM_CODEX_UPDATE_DIALOG);return null!==c?c:"skip-until-next-version"}(),i=n[g],j=!1,m=!1,q=!1,r=30;try{for(let o=0;o<r;o++){try{let s=await (0,h.Xg)(a,50),t=(0,k.aJ)(s),v=(0,k.E6)(t);if(("hooks-review"===v||"hooks-list"===v||"hooks-detail"===v)&&await this.answerCodexHooksScreen(a,v,f,c)){await new Promise(a=>setTimeout(a,u.CV));continue}if((0,k.zZ)(t))return void w.info("codex-prompt-detected");if(j&&!m&&b?.relaunch&&null!==(0,l.GE)(t,this.livenessSpec())){m=!0,r=Math.max(r,o+1+30),e=!1,f.screen=null,f.attempts=0,q&&(q=!1,(0,p.lM)(y),w.info("codex-update-lock-released",{sessionName:a})),w.info("codex-relaunched-after-update",{sessionName:a,policy:g}),await b.relaunch();continue}let x=(0,k.Qh)(t);if("update"===x){if(j=!0,null===i){await new Promise(a=>setTimeout(a,1e3));continue}if(!d){let b=i;b!==n.update||(0,p.mf)(y)?b===n.update&&(q=!0):(b=n["skip-until-next-version"],w.warn("codex-update-dialog-yielded-to-running-update",{sessionName:a,policy:g,requestedKey:i,key:b})),await (0,h.V1)(a,b,!1),d=!0,b===n.update&&(r=Math.max(r,o+1+120)),w.info("codex-update-dialog-answered",{sessionName:a,policy:g,key:b}),await new Promise(a=>setTimeout(a,u.CV));continue}}if("press-enter"===x){await (0,h.ds)(a,"Enter"),w.info("dismissed-codex-notification"),await new Promise(a=>setTimeout(a,u.CV));continue}if("trust"===x&&!e){await (0,h.V1)(a,"1",!1),e=!0,w.info("auto-trusted-folder-for"),await new Promise(a=>setTimeout(a,u.CV));continue}}catch{}await new Promise(a=>setTimeout(a,1e3))}w.info("codex-prompt-detection")}finally{q&&(q=!1,(0,p.lM)(y),w.warn("codex-update-lock-released-unfinished",{sessionName:a}))}}async answerCodexHooksScreen(a,b,c,d){if(c.screen!==b&&(c.screen=b,c.attempts=0),c.attempts>=3)return w.warn("codex-hooks-screen-unresponsive",{sessionName:a,screen:b,trust:d}),!1;let e=++c.attempts;if("hooks-review"===b){let b=1===e?d?"2":"3":"1";return await (0,h.V1)(a,b,!1),w.info("codex-hooks-review-answered",{sessionName:a,key:b,attempt:e,trust:d}),!0}return d?(await (0,h.V1)(a,"t",!1,{literal:!0}),w.info("codex-hooks-screen-trusted",{sessionName:a,screen:b,attempt:e})):(await (0,h.ds)(a,"Escape"),w.info("codex-hooks-screen-escaped",{sessionName:a,screen:b,attempt:e})),!0}async waitForPrompt(a){let b=Date.now(),c=z(),d=null;for(;Date.now()-b<15e3;){try{let b=await (0,h.Xg)(a,50),e=(0,k.aJ)(b),f=(0,k.E6)(e);if("hooks-review"===f||"hooks-list"===f||"hooks-detail"===f){if(null===d){let b=await (0,h.nS)(a);d=null!==b&&(0,s.dO)(b)}await this.answerCodexHooksScreen(a,f,c,d)}else if((0,k.zZ)(e))return}catch{}await new Promise(a=>setTimeout(a,500))}throw w.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,h.N)(d))throw Error(`Codex session ${d} does not exist. Start the session first.`);await this.relaunchIfToolExited(a,c);try{await this.waitForPrompt(d),await (0,i.FW)({sessionName:d,message:b,cliToolId:"codex",composer:this.describeComposer()}),(0,j.gm)(d),w.info("sent-message-to-codex-session:sessionnam")}catch(b){let a=x(b);throw Error(`Failed to send message to Codex: ${a}`)}}async killSession(a,b){let c=this.getSessionName(a,b);try{await (0,h.N)(c)&&(await (0,h.ds)(c,"C-d"),await new Promise(a=>setTimeout(a,u.Zf))),await (0,h.fY)(c)&&w.info("stopped-codex-session:sessionname")}catch(a){throw w.error("session:stop-failed",{error:x(a)}),a}}constructor(...a){super(...a),this.id="codex",this.name="Codex CLI",this.command="codex"}}var B=c(23365);let C=(0,q.h)("cli-tools/gemini");function D(a){return a instanceof Error?a.message:String(a)}class E extends d.M{async isRunning(a,b){let c=this.getSessionName(a,b);return await (0,h.N)(c)}async launchSession(a,b,c){if(!await this.isInstalled())throw(0,v.Tl)(this);let d=this.getSessionName(a,c),e=await (0,h.N)(d);if(e){if(await this.reconcileExistingSession(d),await this.isToolLive(d,{confirm:!0}))return void C.info("gemini-session-sessionname");C.warn("gemini-session-relaunch",{sessionName:d})}(0,t.Fq)({worktreeId:a,cliToolId:r.o,instanceId:c});try{e||(await (0,h.jw)({sessionName:d,workingDirectory:b}),await new Promise(a=>setTimeout(a,u.Uc)));let f=(0,t.wK)({target:{worktreeId:a,cliToolId:r.o,instanceId:c},executablePath:this.command,worktreePath:b});await (0,h.V1)(d,f,!0),await new Promise(a=>setTimeout(a,6e3)),await this.waitForReady(d),C.info("started-gemini-session:sessionname")}catch(b){let a=D(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,h.Xg)(a,B.H),d=(0,k.aJ)(c);if(k.wN.test(d))return void C.info("gemini-prompt-detected");!b&&d.includes("Do you trust this folder?")&&(await (0,h.ds)(a,"Enter"),b=!0,C.info("auto-trusted-folder-for"))}catch{}await new Promise(a=>setTimeout(a,1e3))}C.info("gemini-prompt-detection")}async waitForPrompt(a){let b=Date.now();for(;Date.now()-b<15e3;){try{let b=await (0,h.Xg)(a,B.H),c=(0,k.aJ)(b);if(k.wN.test(c))return}catch{}await new Promise(a=>setTimeout(a,500))}C.info("gemini-prompt-not")}async sendMessage(a,b,c){let d=this.getSessionName(a,c);if(!await (0,h.N)(d))throw Error(`Gemini session ${d} does not exist. Start the session first.`);await this.relaunchIfToolExited(a,c);try{await this.waitForPrompt(d),await (0,i.FW)({sessionName:d,message:b,cliToolId:"gemini",composer:this.describeComposer()}),(0,j.gm)(d),C.info("sent-message-to-gemini-session:sessionna")}catch(b){let a=D(b);throw Error(`Failed to send message to Gemini: ${a}`)}}async killSession(a,b){let c=this.getSessionName(a,b);try{await (0,h.N)(c)&&(await (0,h.ds)(c,"C-c"),await new Promise(a=>setTimeout(a,u.Is)),await (0,h.V1)(c,"/quit",!0),await new Promise(a=>setTimeout(a,u.Zf))),await (0,h.fY)(c)&&C.info("stopped-gemini-session:sessionname")}catch(a){throw C.error("session:stop-failed",{error:D(a)}),a}}constructor(...a){super(...a),this.id="gemini",this.name="Gemini CLI",this.command="gemini"}}var F=c(15194),G=c(88807),H=c(56791);let I=(0,q.h)("cli-tools/vibe-local");function J(a){return a instanceof Error?a.message:String(a)}class K extends d.M{async isRunning(a,b){let c=this.getSessionName(a,b);return await (0,h.N)(c)}async launchSession(a,b,c){if(!await this.isInstalled())throw(0,v.Tl)(this);let d=this.getSessionName(a,c),e=await (0,h.N)(d);if(e){if(await this.reconcileExistingSession(d),await this.isToolLive(d,{confirm:!0}))return void I.info("vibe-local-session");I.warn("vibe-local-session-relaunch",{sessionName:d})}try{e||(await (0,h.jw)({sessionName:d,workingDirectory:b}),await new Promise(a=>setTimeout(a,u.Uc)));let c="vibe-local -y";try{let b=(0,G.getDbInstance)(),d=(0,H.getWorktreeById)(b,a);d?.vibeLocalModel&&F.QP.test(d.vibeLocalModel)&&(c+=` -m ${d.vibeLocalModel}`);let e=d?.vibeLocalContextWindow;(0,F.FV)(e)&&(c+=` --context-window ${Number(e)}`)}catch{}await (0,h.V1)(d,c,!0),await new Promise(a=>setTimeout(a,5e3)),I.info("started-vibe-local-session:sessionname")}catch(b){let a=J(b);throw Error(`Failed to start Vibe Local session: ${a}`)}}async sendMessage(a,b,c){let d=this.getSessionName(a,c);if(!await (0,h.N)(d))throw Error(`Vibe Local session ${d} does not exist. Start the session first.`);await this.relaunchIfToolExited(a,c);try{await (0,i.FW)({sessionName:d,message:b,cliToolId:"vibe-local",composer:this.describeComposer(),interEnterWaitMs:u.PY}),(0,j.gm)(d),I.info("sent-message-to-vibe-local-session:sessi")}catch(b){let a=J(b);throw Error(`Failed to send message to Vibe Local: ${a}`)}}async killSession(a,b){let c=this.getSessionName(a,b);try{await (0,h.N)(c)&&(await (0,h.ds)(c,"C-c"),await new Promise(a=>setTimeout(a,u.Is)),await (0,h.ds)(c,"C-c"),await new Promise(a=>setTimeout(a,u.Zf))),await (0,h.fY)(c)&&I.info("stopped-vibe-local-session:sessionname")}catch(a){throw I.error("session:stop-failed",{error:J(a)}),a}}constructor(...a){super(...a),this.id="vibe-local",this.name="Vibe Local",this.command="vibe-local"}}var L=c(41466),M=c(81776),N=c(56263),O=c(21758),P=c(54633),Q=c(77093);let R=(0,q.h)("cli-tools/copilot"),S=new Set(["model","agent","theme","permissions","skills","mcp","settings","statusline","subagents","resume","session"]),T=/^[>❯](?:\s|$)/;class U extends d.M{async isInstalled(){return await (0,M.B0)()!==null}launchExecutable(a){return"path"===a.source?this.command:O.nL}async isRunning(a,b){let c=this.getSessionName(a,b);return await (0,h.N)(c)}async launchSession(a,b,c){let d=await (0,M.B0)();if(!d)throw(0,v.Tl)(this);let e=this.getSessionName(a,c),f=await (0,h.N)(e);if(f){if(await this.reconcileExistingSession(e),await this.isToolLive(e,{confirm:!0}))return void R.info("copilot-session-exists");R.warn("copilot-session-relaunch",{sessionName:e})}(0,t.Fq)({worktreeId:a,cliToolId:P.V,instanceId:c});try{f||(await (0,h.jw)({sessionName:e,workingDirectory:b}),await new Promise(a=>setTimeout(a,u.Uc)));let g=(0,t.wK)({target:{worktreeId:a,cliToolId:P.V,instanceId:c},executablePath:this.launchExecutable(d),worktreePath:b});await (0,h.V1)(e,g,!0),await this.waitForReady(e),R.info("started-copilot-session",{executableSource:d.source,version:d.version})}catch(b){let a=(0,Q.u1)(b);throw Error(`Failed to start Copilot session: ${a}`)}}async answerFolderTrustDialog(a,b){return!!(0,k.Rx)(b)&&(await (0,h.V1)(a,k.oD,!1),(0,j.gm)(a),R.info("copilot-folder-trust-answered"),!0)}isComposerDrawn(a){let b=a.split("\n");for(let a=1;a<b.length-1;a++)if(T.test(b[a])&&k.A.test(b[a-1].trimEnd())&&k.A.test(b[a+1].trimEnd()))return!0;return!1}async waitForReady(a){let b=!1;for(let c=0;c<30;c++){try{let c=await (0,h.Xg)(a,50),d=(0,k.aJ)(c);if(this.isComposerDrawn(d))return void R.info("copilot-prompt-detected");!b&&await this.answerFolderTrustDialog(a,d)&&(b=!0)}catch{}await new Promise(a=>setTimeout(a,1e3))}R.info("copilot-prompt-detection-timeout")}async waitForPrompt(a,b=15e3){let c=Date.now(),d=!1;for(;Date.now()-c<b;){try{let b=await (0,h.Xg)(a,50),c=(0,k.aJ)(b);if(k.Du.test(c))return;!d&&await this.answerFolderTrustDialog(a,c)&&(d=!0)}catch{}await new Promise(a=>setTimeout(a,500))}R.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,h.Xg)(a,50),c=(0,k.aJ)(b);if((0,k.gT)(c.split("\n")))return R.info("copilot-selection-list-detected"),!0}catch{}}return R.info("copilot-selection-list-not-detected-timeout"),!1}async sendMessage(a,b,c){let d=this.getSessionName(a,c);if(!await (0,h.N)(d))throw Error(`Copilot session ${d} does not exist. Start the session first.`);await this.relaunchIfToolExited(a,c);try{await this.waitForPrompt(d);let a=this.extractSlashCommand(b);if(a&&S.has(a)){await (0,h.V1)(d,b,!0),await this.waitForSelectionList(d),(0,j.gm)(d),R.info("sent-selection-list-command-to-copilot",{command:a});return}await (0,i.FW)({sessionName:d,message:b,cliToolId:"copilot",composer:this.describeComposer(),textInputWaitMs:N.L1,verifyDelayMs:N.wp}),(0,j.gm)(d),R.info("sent-message-to-copilot-session")}catch(b){let a=(0,Q.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,h.N)(d))throw Error(`Copilot session ${d} does not exist. Start the session first.`);try{await (0,h.V1)(d,`/model ${b}`,!0),await this.waitForPrompt(d,N.pL),(0,j.gm)(d),R.info("copilot-model-switched",{model:b})}catch(c){let a=(0,Q.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,h.N)(c)&&(await (0,h.ds)(c,"C-c"),await new Promise(a=>setTimeout(a,u.Is)),await (0,h.V1)(c,"/exit",!1),await new Promise(a=>setTimeout(a,N.L1)),await (0,h.KB)(c,["Enter"]),await new Promise(a=>setTimeout(a,u.Rk))),await (0,h.fY)(c)&&R.info("stopped-copilot-session")}catch(a){throw R.error("session:stop-failed",{error:(0,Q.u1)(a)}),a}}constructor(...a){super(...a),this.id="copilot",this.name="Copilot",this.command="copilot"}}let V=(0,q.h)("cli-tools/antigravity");function W(a){return a instanceof Error?a.message:String(a)}let X=/\?\s+for\s+shortcuts/,Y=/Do you trust the contents of this project\?/;function Z(a){return X.test(a)&&!Y.test(a)}class $ extends d.M{async isRunning(a,b){let c=this.getSessionName(a,b);return await (0,h.N)(c)}async launchSession(a,b,c,d){if(!await this.isInstalled())throw(0,v.Tl)(this);let e=this.getSessionName(a,c),f=await (0,h.N)(e);if(f){if(await this.reconcileExistingSession(e),await this.isToolLive(e,{confirm:!0}))return void V.info("antigravity-session-exists");V.warn("antigravity-session-relaunch",{sessionName:e})}(0,t.Fq)({worktreeId:a,cliToolId:r.F0,instanceId:c});try{f||(await (0,h.jw)({sessionName:e,workingDirectory:b}),await new Promise(a=>setTimeout(a,u.Uc)));let g=(0,t.wK)({target:{worktreeId:a,cliToolId:r.F0,instanceId:c},executablePath:this.command,worktreePath:b}),i=d?`${g} --model '${d.replace(/'/g,"'\\''")}'`:g;await (0,h.V1)(e,i,!0),await new Promise(a=>setTimeout(a,3e3)),await this.waitForReady(e),V.info("started-antigravity-session")}catch(b){let a=W(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,h.Xg)(a,50),d=(0,k.aJ)(c);if(Z(d))return void V.info("antigravity-prompt-detected");if(!b&&Y.test(d)){await (0,h.ds)(a,"Enter"),b=!0,V.info("auto-trusted-folder-for-antigravity"),await new Promise(a=>setTimeout(a,500));continue}}catch{}await new Promise(a=>setTimeout(a,1e3))}V.info("antigravity-prompt-detection-timeout")}async waitForPrompt(a){let b=Date.now();for(;Date.now()-b<15e3;){try{let b=await (0,h.Xg)(a,50),c=(0,k.aJ)(b);if(Z(c))return}catch{}await new Promise(a=>setTimeout(a,500))}throw V.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,h.N)(d))throw Error(`Antigravity session ${d} does not exist. Start the session first.`);await this.relaunchIfToolExited(a,c);try{await this.waitForPrompt(d),await (0,i.FW)({sessionName:d,message:b,cliToolId:"antigravity",composer:this.describeComposer()}),(0,j.gm)(d),V.info("sent-message-to-antigravity-session")}catch(b){let a=W(b);throw Error(`Failed to send message to Antigravity: ${a}`)}}async killSession(a,b){let c=this.getSessionName(a,b);try{await (0,h.N)(c)&&(await (0,h.ds)(c,"C-d"),await new Promise(a=>setTimeout(a,u.Zf)));let a=await (0,h.fY)(c);(0,j.gm)(c),a&&V.info("stopped-antigravity-session")}catch(a){throw V.error("session:stop-failed",{error:W(a)}),a}}constructor(...a){super(...a),this.id="antigravity",this.name="Antigravity CLI",this.command="agy"}}var _=c(28862);let aa=(0,q.h)("cli-tools/command-code"),ab=["--trust","--skip-onboarding","--no-auto-update"];function ac(a){let b=a.split("\n");return!(0>(0,k.I$)(b))&&!k.k0.test((0,k.aJ)(a))}class ad extends d.M{navigationKeys(){return{keys:e.pU,leaderKey:null}}async isRunning(a,b){let c=this.getSessionName(a,b);return await (0,h.N)(c)}async launchSession(a,b,c){if(!await this.isInstalled())throw(0,v.Tl)(this);let d=this.getSessionName(a,c),e=await (0,h.N)(d);if(e){if(await this.reconcileExistingSession(d),await this.isToolLive(d,{confirm:!0}))return void aa.info("command-code-session-exists");aa.warn("command-code-session-relaunch",{sessionName:d})}(0,t.Fq)({worktreeId:a,cliToolId:_.k,instanceId:c});try{var f;e||(await (0,h.jw)({sessionName:d,workingDirectory:b}),await new Promise(a=>setTimeout(a,u.Uc))),await (0,h.V1)(d,(f={target:{worktreeId:a,cliToolId:_.k,instanceId:c},executablePath:this.command,worktreePath:b},[(0,t.wK)(f),...ab].join(" ")),!0),await new Promise(a=>setTimeout(a,u.yO)),await this.waitForReady(d),aa.info("started-command-code-session")}catch(a){throw Error(`Failed to start Command Code session: ${(0,Q.u1)(a)}`)}}async waitForReady(a){for(let b=0;b<30;b++){try{let b=await (0,h.Xg)(a,50);if(ac(b))return void aa.info("command-code-prompt-detected")}catch{}await new Promise(a=>setTimeout(a,1e3))}aa.info("command-code-prompt-detection-timeout")}async waitForPrompt(a){let b=Date.now();for(;Date.now()-b<15e3;){try{let b=await (0,h.Xg)(a,50);if(ac(b))return}catch{}await new Promise(a=>setTimeout(a,500))}throw aa.info("command-code-prompt-not-ready"),Error("Command Code prompt not ready: timed out waiting for the composer before sending")}async sendMessage(a,b,c){let d=this.getSessionName(a,c);if(!await (0,h.N)(d))throw Error(`Command Code session ${d} does not exist. Start the session first.`);await this.relaunchIfToolExited(a,c);try{await this.waitForPrompt(d),await (0,i.FW)({sessionName:d,message:b,cliToolId:"command-code",composer:this.describeComposer()}),(0,j.gm)(d),aa.info("sent-message-to-command-code-session")}catch(a){throw Error(`Failed to send message to Command Code: ${(0,Q.u1)(a)}`)}}async killSession(a,b){let c=this.getSessionName(a,b);try{await (0,h.N)(c)&&(await (0,h.V1)(c,"/exit",!1),await new Promise(a=>setTimeout(a,u.pL)),await (0,h.KB)(c,["Enter"]),await new Promise(a=>setTimeout(a,u.Zf)));let a=await (0,h.fY)(c);(0,j.gm)(c),a&&aa.info("stopped-command-code-session")}catch(a){throw aa.error("session:stop-failed",{error:(0,Q.u1)(a)}),a}}constructor(...a){super(...a),this.id="command-code",this.name="Command Code CLI",this.command="commandcode"}}class ae{constructor(){this.tools=new Map,this.tools.set("claude",new g),this.tools.set("codex",new A),this.tools.set("gemini",new E),this.tools.set("vibe-local",new K),this.tools.set("opencode",new L.Ui),this.tools.set("copilot",new U),this.tools.set("antigravity",new $),this.tools.set("command-code",new ad)}static getInstance(){return ae.instance||(ae.instance=new ae),ae.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)}async stopPollers(a,b,d){let{stopPolling:e}=await Promise.all([c.e(1356),c.e(1503),c.e(1634),c.e(1719),c.e(1191),c.e(6894),c.e(6337),c.e(1990),c.e(7187),c.e(7472),c.e(5017),c.e(1058),c.e(9696),c.e(8918),c.e(552),c.e(5220)]).then(c.bind(c,95220));e(a,b,d)}}},56263:(a,b,c)=>{c.d(b,{L1:()=>e,MJ:()=>j,Rf:()=>f,ky:()=>g,lM:()=>i,pL:()=>h,wp:()=>d,zt:()=>k});let d=200,e=100,f=1e5,g="[... truncated ...]",h=3e4,i=/^[a-zA-Z0-9][a-zA-Z0-9\-._/:]*$/,j=128,k="Install with: brew install copilot-cli (macOS) or npm i -g @github/copilot"},70849:(a,b,c)=>{c.d(b,{LQ:()=>k,SW:()=>l});var d=c(72626),e=c(84574),f=c(48083),g=c(77634),h=c(27939);let i=(0,d.h)("lib/session/opencode-session-recall");async function j(a,b){let c=new Set,d=await (0,g.GP)(a,b);for(let b=0;b<3;b+=1){if(null===d)return null;if(null===d.parentId||c.has(d.parentId))break;c.add(d.parentId),i.debug("opencode-session-parent-hop",{from:d.id,to:d.parentId}),d=await (0,g.GP)(a,d.parentId)}return d}async function k(a){let b=a.instanceId??a.cliToolId,c=(0,e.hC)(a);if(null===c)return{captured:!1,skipped:"no-port"};let d=(0,f.getLastAgentEvent)(a.worktreeId,"opencode",a.instanceId)?.sessionId;if(!(0,h.jp)(d))return{captured:!1,skipped:"no-session-observed"};let g=await j(c,d);if(null===g)return{captured:!1,skipped:"session-unreadable"};if(null===g.directory)return{captured:!1,skipped:"no-directory"};let k=(0,e.U9)(a);return null!==k&&k!==g.directory?(i.warn("opencode-session-capture-directory-mismatch",{worktreeId:a.worktreeId,instanceId:b,expected:k,reported:g.directory}),{captured:!1,skipped:"directory-mismatch"}):(0,h.F_)(a,{sessionId:g.id,title:g.title,worktreePath:g.directory})?(i.info("opencode-session-captured",{worktreeId:a.worktreeId,instanceId:b,sessionId:g.id,viaParentOf:g.id===d?null:d}),{captured:!0,memory:{sessionId:g.id,title:g.title,worktreePath:g.directory,updatedAt:Date.now()}}):{captured:!1,skipped:"not-persisted"}}async function l(a){let b=(0,e.hC)(a),c=(0,f.getLastAgentEvent)(a.worktreeId,"opencode",a.instanceId)?.sessionId;if(null!==b&&(0,h.jp)(c)){let a=await j(b,c);if(null!==a)return a.id}return(0,h.KA)(a)?.sessionId??null}},72272:(a,b,c)=>{c.d(b,{t:()=>i});var d=c(72626),e=c(50474),f=c(25071),g=c(17287);let h=(0,d.h)("lib/hooks/permission-adjudication");async function i(a,b,d,j,k="event"){let l=b.instanceId??b.cliToolId,m={worktreeId:b.worktreeId,cliToolId:b.cliToolId,instanceId:l},{resolvePermissionRequest:n}=await c.e(3241).then(c.bind(c,43241)),o=n(m,j),p="allow"===o.behavior?{kind:"allowOnce"}:{kind:"abstain"};if("abstain"===p.kind){let c=(0,e.y_)(a);c.safe||h.warn("permission-request-abstain-blocks-agent",{worktreeId:b.worktreeId,cliToolId:b.cliToolId,instanceId:l,toolName:j?.toolName??null,decisionId:d.id,reason:o.reason,consequence:c.summary,blocksForMs:c.blocksForMs})}let{delivery:q}=await (0,f.GW)(a,b,d,p),r=q?.delivered===!0,s=r&&a.capabilities.permissionReplyReleasesPrompt;return(0,g.nL)(b.worktreeId,b.cliToolId,b.instanceId,{decisionId:d.id,toolName:j?.toolName??null,behavior:"allow"===o.behavior?"allow":null,reason:o.reason,delivered:r,releasedPrompt:s,trigger:k,at:d.askedAt}),h.info("permission-decision-adjudicated",{worktreeId:b.worktreeId,cliToolId:b.cliToolId,instanceId:l,decisionId:d.id,toolName:j?.toolName??null,behavior:o.behavior,reason:o.reason,suppressedBy:o.suppressedBy,delivered:r,settled:s,trigger:k}),{decisionId:d.id,behavior:"allow"===o.behavior?"allow":null,reason:o.reason,delivered:r,settled:s}}},77634:(a,b,c)=>{c.d(b,{GP:()=>l,Hv:()=>h,eJ:()=>n,mf:()=>o,y4:()=>m,yg:()=>p});var d=c(72626),e=c(49791),f=c(27939);let g=(0,d.h)("lib/session/opencode-session-api"),h="session_new";function i(a,b){let c=a[b];return"string"==typeof c&&c.length>0?c:null}async function j(a,b){try{let c=await fetch(a,{...b,redirect:e.uS,signal:AbortSignal.timeout(e.T0)});if(!c.ok)return null;if(!function(a){let b=a.headers?.get?.("content-type");return"string"==typeof b&&b.split(";",1)[0]?.trim().toLowerCase()===e._t}(c))return g.debug("opencode-session-request-content-type",{url:a,contentType:c.headers?.get?.("content-type")??null}),null;return await c.json()}catch(b){return g.debug("opencode-session-request-failed",{url:a,error:b instanceof Error?b.message:String(b)}),null}}function k(a){if(!("object"==typeof a&&null!==a&&!Array.isArray(a)))return null;let b=i(a,"id");if(!(0,f.jp)(b))return null;let c=i(a,"title");return{id:b,title:null===c?null:c.slice(0,f.Y2),directory:i(a,"directory"),parentId:i(a,"parentID")}}async function l(a,b){return(0,f.jp)(b)?k(await j(`${(0,e.M2)(a)}/session/${encodeURIComponent(b)}`)):null}async function m(a,b){return(0,f.jp)(b)?k(await j(`${(0,e.M2)(a)}/session/${encodeURIComponent(b)}/fork`,{method:"POST",headers:{"content-type":e._t},body:"{}"})):null}async function n(a){return!0===await j(`${(0,e.M2)(a)}/tui/open-sessions`,{method:"POST",headers:{"content-type":e._t},body:"{}"})}async function o(a,b){return!0===await j(`${(0,e.M2)(a)}/tui/execute-command`,{method:"POST",headers:{"content-type":e._t},body:JSON.stringify({command:b})})}async function p(a,b){return!!(0,f.jp)(b)&&!0===await j(`${(0,e.M2)(a)}/tui/select-session`,{method:"POST",headers:{"content-type":e._t},body:JSON.stringify({sessionID:b})})}},78099:(a,b,c)=>{c.d(b,{Tl:()=>g});var d=c(56263),e=c(2669);let f={claude:"Install with: npm install -g @anthropic-ai/claude-code",codex:"Install with: npm install -g @openai/codex",gemini:"Install with: npm install -g @google/gemini-cli",opencode:"Install with: npm install -g opencode-ai",copilot:d.zt,"command-code":"Install with: npm install -g command-code",antigravity:"Install the Antigravity CLI: https://antigravity.google/docs/cli/reference","vibe-local":"vibe-local is a local script rather than a published package: put your own `vibe-local` executable on PATH."};function g(a){var b;return new e.lU(a.name,(b=a,`${b.name} (${b.command}) is not installed or not in PATH. ${f[b.id]}`))}},81886:(a,b,c)=>{c.d(b,{M:()=>s});var d=c(79646),e=c(28354),f=c(40964),g=c(79892),h=c(56717),i=c(23365),j=c(93949),k=c(91536),l=c(50945),m=c(96287),n=c(72626),o=c(8953),p=c(20610);let q=(0,e.promisify)(d.exec),r=(0,n.h)("cli-tools/base");class s{async isInstalled(){try{return await q(`which ${this.command}`,{timeout:5e3}),!0}catch{return!1}}getSessionName(a,b){return(0,f.m)(this.id,a,b)}async startSession(a,b,c,d){try{await this.launchSession(a,b,c,d)}catch(b){throw(0,m.Zl)({worktreeId:a,cliToolId:this.id,instanceId:c,toolName:this.name},b),b}}async reconcileExistingSession(a,b){await (0,g.zT)(a,b)}async interrupt(a,b){let c=this.getSessionName(a,b);await (0,g.ds)(c,"Escape")}describeComposer(){return(0,h.gc)(this.id)}gracefulExitSequence(){return(0,j.JV)(this.id)}captureSpec(){return(0,i.y)(this.id)}livenessSpec(){return(0,k.H7)(this.id)}async isToolLive(a,b){let c=this.livenessSpec(),d=await (0,l.Q)(a,c);if(d.alive)return!0;if(!b?.confirm)return!1;await new Promise(a=>setTimeout(a,p.kZ));let e=await (0,l.Q)(a,c);return e.alive?(r.info("session:liveness-confirm-recovered",{cliToolId:this.id,firstReason:d.reason}),!0):(r.warn("session:tool-exited",{cliToolId:this.id,reason:e.reason}),!1)}async relaunchIfToolExited(a,b){let c=this.getSessionName(a,b);if(await this.isToolLive(c))return;let d=await (0,g.nS)(c);if(null===d)return void r.warn("session:relaunch-skipped-no-path",{cliToolId:this.id,worktreeId:a});r.info("session:relaunch-before-send",{cliToolId:this.id,sessionName:c}),await this.startSession(a,d,b)}navigationKeys(){return{keys:o.qD,leaderKey:null}}}},93949:(a,b,c)=>{c.d(b,{JV:()=>i,rY:()=>k});var d=c(56263),e=c(20610),f=c(86069);let g={keys:[(0,f.IS)("C-d")],exitWaitMs:e.Zf,ownsLoopbackServer:!1},h={claude:g,codex:g,antigravity:g,gemini:{keys:[(0,f.IS)("C-c",e.Is),(0,f.iF)(`/quit\r`,void 0)],exitWaitMs:e.Zf,ownsLoopbackServer:!1},"vibe-local":{keys:[(0,f.IS)("C-c",e.Is),(0,f.IS)("C-c")],exitWaitMs:e.Zf,ownsLoopbackServer:!1},copilot:{keys:[(0,f.IS)("C-c",e.Is),(0,f.iF)("/exit",d.L1),(0,f.IS)("Enter")],exitWaitMs:e.Rk,ownsLoopbackServer:!1},"command-code":{keys:[(0,f.iF)("/exit",e.pL),(0,f.IS)("Enter")],exitWaitMs:e.Zf,ownsLoopbackServer:!1},opencode:{keys:[(0,f.iF)("/exit",e.pL),(0,f.IS)("Enter")],exitWaitMs:e.KI,ownsLoopbackServer:!0}};function i(a){return h[a]??g}let j=a=>new Promise(b=>setTimeout(b,a));async function k(a){let b=Math.max(1,a.attempts??1),c=a.intervalMs??0,d=a.sleep??j,e=!0;for(let f=0;f<b&&(e=await a.sessionAlive());f+=1)f<b-1&&c>0&&await d(c);if(e)return{ok:!1,reason:"graceful_exit_timeout"};let f=a.portAnswering;if(!f)return{ok:!0};let g=!0;for(let a=0;a<b&&(g=await f());a+=1)a<b-1&&c>0&&await d(c);return g?{ok:!1,reason:"port_orphaned"}:{ok:!0}}},96287:(a,b,c)=>{c.d(b,{$k:()=>f,VI:()=>g,Zl:()=>e});var d=c(78099);function e(a,b){Promise.all([c.e(1356),c.e(1191),c.e(6337)]).then(c.bind(c,81099)).then(({notifySessionStartFailurePush:c})=>c({...a,error:b})).catch(()=>{})}async function f(a,b){if(await a.isInstalled())return;let c=(0,d.Tl)(a);throw e({worktreeId:b.worktreeId,cliToolId:a.id,instanceId:b.instanceId,toolName:a.name,subject:b.subject},c),c}function g(a,b){Promise.resolve().then(c.bind(c,43234)).then(({CLIToolManager:c})=>{let f=c.getInstance().getTool(a);e({worktreeId:b.worktreeId,cliToolId:a,instanceId:b.instanceId,toolName:f.name,subject:b.subject},(0,d.Tl)(f))}).catch(()=>{})}}};
@@ -0,0 +1,103 @@
1
+ "use strict";exports.id=1990,exports.ids=[1990],exports.modules={31990:(a,b,c)=>{c.d(b,{Wh:()=>Q,WD:()=>R,Lw:()=>T,K1:()=>P,N5:()=>S});var d=c(43234),e=c(72626),f=c(79892);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),l=c(79646),m=c(28354),n=c(31442),o=c(29021),p=c(21820),q=c(33873),r=c(16983);let s="cm-live-restore.sh",t="cm-live-delegate.sh",u="cm-auto-popup.sh",v=`#!/bin/sh
2
+ # CommandMate live-attach restore (Issue #2317) — generated file, edits are overwritten.
3
+ #
4
+ # sh ~/.commandmate/bin/${s} <session> [control_mode] [width] [height]
5
+ #
6
+ # Pins the session's window back to CommandMate's canvas once no human client is
7
+ # attached to it any more. Safe to run when nothing is delegated: it then simply
8
+ # re-applies the geometry the session already has.
9
+ set -u
10
+
11
+ SESSION="\${1:-}"
12
+ CONTROL_MODE="\${2:-0}"
13
+ WIDTH="\${3:-${r.Jn}}"
14
+ HEIGHT="\${4:-${r.sO}}"
15
+
16
+ case "$SESSION" in
17
+ ${n.HL}*) ;;
18
+ *) exit 0 ;;
19
+ esac
20
+
21
+ # A control-mode client detaching is CommandMate's own transport reconnecting,
22
+ # not the human leaving. Doing the restore here would fight the human's attach.
23
+ if [ "$CONTROL_MODE" = "1" ]; then
24
+ exit 0
25
+ fi
26
+
27
+ # Anyone left who is NOT a control client? Then the geometry is still theirs.
28
+ HUMANS=$(tmux list-clients -t "=$SESSION:" -F '#{client_control_mode}' 2>/dev/null \\
29
+ | grep -c -v '^1$') || HUMANS=0
30
+ if [ "\${HUMANS:-0}" -gt 0 ]; then
31
+ exit 0
32
+ fi
33
+
34
+ tmux set-window-option -t "=$SESSION:" window-size manual 2>/dev/null || exit 0
35
+ tmux resize-window -t "=$SESSION:" -x "$WIDTH" -y "$HEIGHT" 2>/dev/null || true
36
+ tmux set-option -u -t "=$SESSION:" @cm_delegated 2>/dev/null || true
37
+ `,w=`#!/bin/sh
38
+ # CommandMate live-attach delegate (Issue #2317) — generated file, edits are overwritten.
39
+ #
40
+ # sh ~/.commandmate/bin/${t} <session> <control_mode> [client]
41
+ #
42
+ # Hands the session's window from CommandMate's pinned canvas to the terminal
43
+ # that just attached, so an alternate-screen agent re-lays-out and its transcript
44
+ # becomes readable. Installed as a session-scoped \`client-attached[0]\` hook only
45
+ # when CM_LIVE_ATTACH_HOOK=on; \`commandmate attach --live\` does the same two
46
+ # writes itself and needs no hook.
47
+ #
48
+ # The window is put back by whoever notices the human is gone first: the CLI on
49
+ # return from attach-session, or the server's status poll. This script never
50
+ # restores — the attach edge is the only edge tmux 3.5a lets a session-scoped
51
+ # hook see.
52
+ set -u
53
+
54
+ SESSION="\${1:-}"
55
+ CONTROL_MODE="\${2:-0}"
56
+
57
+ case "$SESSION" in
58
+ ${n.HL}claude-*) ;;
59
+ *) exit 0 ;;
60
+ esac
61
+
62
+ # A control-mode client is CommandMate's own transport. Handing it the geometry
63
+ # would resize the canvas to whatever that connection negotiated, which is the
64
+ # #1163 regression this whole feature is built to avoid.
65
+ if [ "$CONTROL_MODE" = "1" ]; then
66
+ exit 0
67
+ fi
68
+
69
+ # Raised BEFORE the size change, so a status poll landing between the two sees
70
+ # "delegated, still pinned" rather than "not delegated, 44 rows".
71
+ tmux set-option -t "=$SESSION:" @cm_delegated 1 2>/dev/null || exit 0
72
+ tmux set-window-option -t "=$SESSION:" window-size latest 2>/dev/null || true
73
+ `,x=`#!/bin/sh
74
+ # CommandMate auto read popup (Issue #2317) — generated file, edits are overwritten.
75
+ #
76
+ # sh ~/.commandmate/bin/${u} <session> <control_mode> <client>
77
+ #
78
+ # Opens the following transcript popup for a human client attaching to a
79
+ # CommandMate session. Never opens for a control-mode client.
80
+ set -u
81
+
82
+ SESSION="\${1:-}"
83
+ CONTROL_MODE="\${2:-0}"
84
+ CLIENT="\${3:-}"
85
+
86
+ case "$SESSION" in
87
+ ${n.HL}*) ;;
88
+ *) exit 0 ;;
89
+ esac
90
+
91
+ if [ "$CONTROL_MODE" = "1" ]; then
92
+ exit 0
93
+ fi
94
+
95
+ PAGER_SCRIPT="$HOME/.commandmate/bin/cm-read-pane.sh"
96
+ [ -x "$PAGER_SCRIPT" ] || exit 0
97
+
98
+ if [ -n "$CLIENT" ]; then
99
+ tmux display-popup -c "$CLIENT" -w 90% -h 85% -E "sh \\"$PAGER_SCRIPT\\" --follow \\"$SESSION\\"" 2>/dev/null || true
100
+ else
101
+ tmux display-popup -w 90% -h 85% -E "sh \\"$PAGER_SCRIPT\\" --follow \\"$SESSION\\"" 2>/dev/null || true
102
+ fi
103
+ `;function y(a,b){let c,d=(0,q.join)((0,q.join)((0,p.homedir)(),".commandmate","bin"),a);if((0,o.mkdirSync)((0,q.dirname)(d),{recursive:!0}),(0,o.existsSync)(d))try{c=(0,o.readFileSync)(d,"utf-8")}catch{c=void 0}return c!==b&&(0,o.writeFileSync)(d,b,{mode:493}),(0,o.chmodSync)(d,493),d}var z=c(83598);let A=(0,m.promisify)(l.execFile),B=(0,e.h)("tmux-session-hooks"),C=globalThis.__cmEnsuredSessionHooks??(globalThis.__cmEnsuredSessionHooks=new Set);async function D(a){if((0,n.N_)(a)&&!C.has(a)){C.add(a);try{if((0,n.gM)()&&(0,n.n9)(a)){y(s,v);let b=(0,n.Rr)(a,y(t,w));b&&await A("tmux",b,{timeout:5e3})}else await A("tmux",(0,n.g4)(a),{timeout:5e3});if((0,n.jx)()){let b=(0,n.Ls)(a,y(u,x));b&&await A("tmux",b,{timeout:5e3})}else await A("tmux",(0,n.sL)(a),{timeout:5e3})}catch(b){B.debug("session-hooks:reconcile-failed",{sessionName:a,error:b instanceof Error?b.message:String(b)})}}}async function E(a){try{if(!await (0,z.Us)(a)||await (0,z.Fh)(a))return!1;for(let b of(0,n.RS)(a))await A("tmux",b,{timeout:5e3});return B.info("session-hooks:geometry-restored",{sessionName:a}),!0}catch(b){return B.debug("session-hooks:geometry-restore-failed",{sessionName:a,error:b instanceof Error?b.message:String(b)}),!1}}let F=(0,m.promisify)(l.execFile),G=(0,e.h)("tmux-session-status"),H=globalThis.__cmPublishedTmuxStatus??(globalThis.__cmPublishedTmuxStatus=new Map),I=globalThis.__cmClearedTmuxStatus??(globalThis.__cmClearedTmuxStatus=new Set);async function J(a){let{sessionName:b,worktreeId:c,cliToolId:d,instanceId:e,status:f}=a;if(!(0,n.om)())return I.has(b)||(I.add(b),await L(b)),"disabled";let g=H.get(b);if(g&&g.status===f&&g.worktreeId===c&&g.cliToolId===d&&g.instanceId===e)return"unchanged";let h=(a.now??new Date).toISOString(),i=[[n.eC,f],[n.jp,c],[n.wv,d],[n.L0,e],[n.tx,h]];try{for(let[a,c]of i)await F("tmux",(0,n.ND)(b,a,c),{timeout:5e3});return H.set(b,{status:f,worktreeId:c,cliToolId:d,instanceId:e}),await K(b),"written"}catch(a){return H.delete(b),G.debug("session-status:write-failed",{sessionName:b,error:a instanceof Error?a.message:String(a)}),"error"}}async function K(a){try{let{stdout:b}=await F("tmux",(0,n.Ys)(a,"status-right"),{timeout:5e3}),c=b.trim();if(""!==c&&!c.includes(n.lY))return G.debug("session-status:status-right-user-owned",{sessionName:a,existing:c}),!1;return""===c&&await F("tmux",(0,n.KB)(a,n.lY),{timeout:5e3}),!0}catch(b){return G.debug("session-status:status-right-failed",{sessionName:a,error:b instanceof Error?b.message:String(b)}),!1}}async function L(a){for(let b of(H.delete(a),n.bq))try{await F("tmux",(0,n.cD)(a,b),{timeout:5e3})}catch{}try{let{stdout:b}=await F("tmux",(0,n.Ys)(a,"status-right"),{timeout:5e3});b.includes(n.lY)&&await F("tmux",(0,n.$D)(a),{timeout:5e3})}catch{}}let M=(0,e.h)("cli-session");function N(){return j||(j=new i),j}function O(a,b,c){let e=d.CLIToolManager.getInstance().getTool(b),f=e.getSessionName(a,c);return{cliTool:e,sessionName:f}}async function P(a,b,c){let{sessionName:d}=O(a,b,c);return N().sessionExists(d)}async function Q(a,b,c=1e3,d){let e=M.withContext({worktreeId:a,cliToolId:b});e.debug("captureSessionOutput:start",{requestedLines:c});let{cliTool:f,sessionName:g}=O(a,b,d),h=N();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 R(a,b,c=5e3,d){let e=M.withContext({worktreeId:a,cliToolId:b});e.debug("captureSessionOutputFresh:start",{requestedLines:c});let{cliTool:f,sessionName:g}=O(a,b,d),h=N();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}`)}}async function S(a){await D(a.sessionName),(0,n.n9)(a.sessionName)&&await E(a.sessionName),await J(a)}function T(a){H.delete(a),I.delete(a),C.delete(a),(0,z.G9)(a)}}};