commandmate 0.22.2 → 0.23.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 (476) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-build-manifest.json +108 -108
  3. package/.next/app-path-routes-manifest.json +21 -21
  4. package/.next/build-manifest.json +2 -2
  5. package/.next/prerender-manifest.json +12 -12
  6. package/.next/required-server-files.json +1 -1
  7. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  8. package/.next/server/app/api/app/update/route_client-reference-manifest.js +1 -1
  9. package/.next/server/app/api/app/update-check/route.js +1 -1
  10. package/.next/server/app/api/app/update-check/route_client-reference-manifest.js +1 -1
  11. package/.next/server/app/api/assistant/conversation/route.js +1 -1
  12. package/.next/server/app/api/assistant/conversation/route.js.nft.json +1 -1
  13. package/.next/server/app/api/assistant/conversation/route_client-reference-manifest.js +1 -1
  14. package/.next/server/app/api/assistant/current-output/route.js +1 -1
  15. package/.next/server/app/api/assistant/current-output/route.js.nft.json +1 -1
  16. package/.next/server/app/api/assistant/current-output/route_client-reference-manifest.js +1 -1
  17. package/.next/server/app/api/assistant/messages/route.js +1 -1
  18. package/.next/server/app/api/assistant/messages/route.js.nft.json +1 -1
  19. package/.next/server/app/api/assistant/messages/route_client-reference-manifest.js +1 -1
  20. package/.next/server/app/api/assistant/session/route.js +1 -1
  21. package/.next/server/app/api/assistant/session/route.js.nft.json +1 -1
  22. package/.next/server/app/api/assistant/session/route_client-reference-manifest.js +1 -1
  23. package/.next/server/app/api/assistant/start/route.js +1 -1
  24. package/.next/server/app/api/assistant/start/route.js.nft.json +1 -1
  25. package/.next/server/app/api/assistant/start/route_client-reference-manifest.js +1 -1
  26. package/.next/server/app/api/assistant/terminal/route.js +3 -3
  27. package/.next/server/app/api/assistant/terminal/route.js.nft.json +1 -1
  28. package/.next/server/app/api/assistant/terminal/route_client-reference-manifest.js +1 -1
  29. package/.next/server/app/api/assistant/tools/route.js +1 -1
  30. package/.next/server/app/api/assistant/tools/route.js.nft.json +1 -1
  31. package/.next/server/app/api/assistant/tools/route_client-reference-manifest.js +1 -1
  32. package/.next/server/app/api/auth/login/route_client-reference-manifest.js +1 -1
  33. package/.next/server/app/api/auth/logout/route_client-reference-manifest.js +1 -1
  34. package/.next/server/app/api/auth/status/route_client-reference-manifest.js +1 -1
  35. package/.next/server/app/api/daily-summary/route.js +1 -1
  36. package/.next/server/app/api/daily-summary/route.js.nft.json +1 -1
  37. package/.next/server/app/api/daily-summary/route_client-reference-manifest.js +1 -1
  38. package/.next/server/app/api/daily-summary/status/route.js +1 -1
  39. package/.next/server/app/api/daily-summary/status/route.js.nft.json +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.js +1 -1
  42. package/.next/server/app/api/external-apps/[id]/health/route.js.nft.json +1 -1
  43. package/.next/server/app/api/external-apps/[id]/health/route_client-reference-manifest.js +1 -1
  44. package/.next/server/app/api/external-apps/[id]/route.js +1 -1
  45. package/.next/server/app/api/external-apps/[id]/route.js.nft.json +1 -1
  46. package/.next/server/app/api/external-apps/[id]/route_client-reference-manifest.js +1 -1
  47. package/.next/server/app/api/external-apps/route.js +1 -1
  48. package/.next/server/app/api/external-apps/route.js.nft.json +1 -1
  49. package/.next/server/app/api/external-apps/route_client-reference-manifest.js +1 -1
  50. package/.next/server/app/api/fs/browse/route.js +1 -1
  51. package/.next/server/app/api/fs/browse/route.js.nft.json +1 -1
  52. package/.next/server/app/api/fs/browse/route_client-reference-manifest.js +1 -1
  53. package/.next/server/app/api/fs/recent-paths/route.js +1 -1
  54. package/.next/server/app/api/fs/recent-paths/route.js.nft.json +1 -1
  55. package/.next/server/app/api/fs/recent-paths/route_client-reference-manifest.js +1 -1
  56. package/.next/server/app/api/hooks/agent-event/route.js +1 -1
  57. package/.next/server/app/api/hooks/agent-event/route.js.nft.json +1 -1
  58. package/.next/server/app/api/hooks/agent-event/route_client-reference-manifest.js +1 -1
  59. package/.next/server/app/api/hooks/claude-done/route.js +1 -1
  60. package/.next/server/app/api/hooks/claude-done/route.js.nft.json +1 -1
  61. package/.next/server/app/api/hooks/claude-done/route_client-reference-manifest.js +1 -1
  62. package/.next/server/app/api/hooks/permission-request/route.js +1 -1
  63. package/.next/server/app/api/hooks/permission-request/route.js.nft.json +1 -1
  64. package/.next/server/app/api/hooks/permission-request/route_client-reference-manifest.js +1 -1
  65. package/.next/server/app/api/metrics/vibe/route.js +1 -1
  66. package/.next/server/app/api/metrics/vibe/route.js.nft.json +1 -1
  67. package/.next/server/app/api/metrics/vibe/route_client-reference-manifest.js +1 -1
  68. package/.next/server/app/api/ollama/models/route_client-reference-manifest.js +1 -1
  69. package/.next/server/app/api/push/subscriptions/route.js +1 -1
  70. package/.next/server/app/api/push/subscriptions/route.js.nft.json +1 -1
  71. package/.next/server/app/api/push/subscriptions/route_client-reference-manifest.js +1 -1
  72. package/.next/server/app/api/push/vapid/route.js +1 -1
  73. package/.next/server/app/api/push/vapid/route.js.nft.json +1 -1
  74. package/.next/server/app/api/push/vapid/route_client-reference-manifest.js +1 -1
  75. package/.next/server/app/api/repositories/[id]/route.js +1 -1
  76. package/.next/server/app/api/repositories/[id]/route.js.nft.json +1 -1
  77. package/.next/server/app/api/repositories/[id]/route_client-reference-manifest.js +1 -1
  78. package/.next/server/app/api/repositories/[id]/todos/[todoId]/route.js +1 -1
  79. package/.next/server/app/api/repositories/[id]/todos/[todoId]/route.js.nft.json +1 -1
  80. package/.next/server/app/api/repositories/[id]/todos/[todoId]/route_client-reference-manifest.js +1 -1
  81. package/.next/server/app/api/repositories/[id]/todos/route.js +1 -1
  82. package/.next/server/app/api/repositories/[id]/todos/route.js.nft.json +1 -1
  83. package/.next/server/app/api/repositories/[id]/todos/route_client-reference-manifest.js +1 -1
  84. package/.next/server/app/api/repositories/clone/[jobId]/route.js +1 -1
  85. package/.next/server/app/api/repositories/clone/[jobId]/route.js.nft.json +1 -1
  86. package/.next/server/app/api/repositories/clone/[jobId]/route_client-reference-manifest.js +1 -1
  87. package/.next/server/app/api/repositories/clone/route.js +1 -1
  88. package/.next/server/app/api/repositories/clone/route.js.nft.json +1 -1
  89. package/.next/server/app/api/repositories/clone/route_client-reference-manifest.js +1 -1
  90. package/.next/server/app/api/repositories/excluded/route.js +1 -1
  91. package/.next/server/app/api/repositories/excluded/route.js.nft.json +1 -1
  92. package/.next/server/app/api/repositories/excluded/route_client-reference-manifest.js +1 -1
  93. package/.next/server/app/api/repositories/restore/route.js +1 -1
  94. package/.next/server/app/api/repositories/restore/route.js.nft.json +1 -1
  95. package/.next/server/app/api/repositories/restore/route_client-reference-manifest.js +1 -1
  96. package/.next/server/app/api/repositories/route.js +1 -1
  97. package/.next/server/app/api/repositories/route.js.nft.json +1 -1
  98. package/.next/server/app/api/repositories/route_client-reference-manifest.js +1 -1
  99. package/.next/server/app/api/repositories/scan/route.js +1 -1
  100. package/.next/server/app/api/repositories/scan/route.js.nft.json +1 -1
  101. package/.next/server/app/api/repositories/scan/route_client-reference-manifest.js +1 -1
  102. package/.next/server/app/api/repositories/sync/route.js +1 -1
  103. package/.next/server/app/api/repositories/sync/route.js.nft.json +1 -1
  104. package/.next/server/app/api/repositories/sync/route_client-reference-manifest.js +1 -1
  105. package/.next/server/app/api/repositories/validate-path/route.js +1 -1
  106. package/.next/server/app/api/repositories/validate-path/route.js.nft.json +1 -1
  107. package/.next/server/app/api/repositories/validate-path/route_client-reference-manifest.js +1 -1
  108. package/.next/server/app/api/sidebar/group-order/route.js +1 -1
  109. package/.next/server/app/api/sidebar/group-order/route.js.nft.json +1 -1
  110. package/.next/server/app/api/sidebar/group-order/route_client-reference-manifest.js +1 -1
  111. package/.next/server/app/api/skills/[id]/route_client-reference-manifest.js +1 -1
  112. package/.next/server/app/api/skills/installations/route.js +1 -1
  113. package/.next/server/app/api/skills/installations/route.js.nft.json +1 -1
  114. package/.next/server/app/api/skills/installations/route_client-reference-manifest.js +1 -1
  115. package/.next/server/app/api/skills/operations/route.js +1 -1
  116. package/.next/server/app/api/skills/operations/route.js.nft.json +1 -1
  117. package/.next/server/app/api/skills/operations/route_client-reference-manifest.js +1 -1
  118. package/.next/server/app/api/skills/reindex/route.js +1 -1
  119. package/.next/server/app/api/skills/reindex/route.js.nft.json +1 -1
  120. package/.next/server/app/api/skills/reindex/route_client-reference-manifest.js +1 -1
  121. package/.next/server/app/api/skills/route_client-reference-manifest.js +1 -1
  122. package/.next/server/app/api/slash-commands/route_client-reference-manifest.js +1 -1
  123. package/.next/server/app/api/tasks/[taskId]/cancel/route.js +1 -4
  124. package/.next/server/app/api/tasks/[taskId]/cancel/route.js.nft.json +1 -1
  125. package/.next/server/app/api/tasks/[taskId]/cancel/route_client-reference-manifest.js +1 -1
  126. package/.next/server/app/api/tasks/[taskId]/route.js +1 -4
  127. package/.next/server/app/api/tasks/[taskId]/route.js.nft.json +1 -1
  128. package/.next/server/app/api/tasks/[taskId]/route_client-reference-manifest.js +1 -1
  129. package/.next/server/app/api/templates/[id]/route.js +1 -1
  130. package/.next/server/app/api/templates/[id]/route.js.nft.json +1 -1
  131. package/.next/server/app/api/templates/[id]/route_client-reference-manifest.js +1 -1
  132. package/.next/server/app/api/templates/route.js +1 -1
  133. package/.next/server/app/api/templates/route.js.nft.json +1 -1
  134. package/.next/server/app/api/templates/route_client-reference-manifest.js +1 -1
  135. package/.next/server/app/api/todos/route.js +1 -1
  136. package/.next/server/app/api/todos/route.js.nft.json +1 -1
  137. package/.next/server/app/api/todos/route_client-reference-manifest.js +1 -1
  138. package/.next/server/app/api/verification/runs/[runId]/route.js +1 -1
  139. package/.next/server/app/api/verification/runs/[runId]/route.js.nft.json +1 -1
  140. package/.next/server/app/api/verification/runs/[runId]/route_client-reference-manifest.js +1 -1
  141. package/.next/server/app/api/verification/runs/route.js +1 -1
  142. package/.next/server/app/api/verification/runs/route.js.nft.json +1 -1
  143. package/.next/server/app/api/verification/runs/route_client-reference-manifest.js +1 -1
  144. package/.next/server/app/api/worktrees/[id]/auto-yes/route.js +1 -1
  145. package/.next/server/app/api/worktrees/[id]/auto-yes/route.js.nft.json +1 -1
  146. package/.next/server/app/api/worktrees/[id]/auto-yes/route_client-reference-manifest.js +1 -1
  147. package/.next/server/app/api/worktrees/[id]/capture/route.js +1 -1
  148. package/.next/server/app/api/worktrees/[id]/capture/route.js.nft.json +1 -1
  149. package/.next/server/app/api/worktrees/[id]/capture/route_client-reference-manifest.js +1 -1
  150. package/.next/server/app/api/worktrees/[id]/cli-tool/route.js +1 -1
  151. package/.next/server/app/api/worktrees/[id]/cli-tool/route.js.nft.json +1 -1
  152. package/.next/server/app/api/worktrees/[id]/cli-tool/route_client-reference-manifest.js +1 -1
  153. package/.next/server/app/api/worktrees/[id]/cmate/schedules/route.js +2 -2
  154. package/.next/server/app/api/worktrees/[id]/cmate/schedules/route.js.nft.json +1 -1
  155. package/.next/server/app/api/worktrees/[id]/cmate/schedules/route_client-reference-manifest.js +1 -1
  156. package/.next/server/app/api/worktrees/[id]/current-output/route.js +1 -1
  157. package/.next/server/app/api/worktrees/[id]/current-output/route.js.nft.json +1 -1
  158. package/.next/server/app/api/worktrees/[id]/current-output/route_client-reference-manifest.js +1 -1
  159. package/.next/server/app/api/worktrees/[id]/execution-logs/[logId]/route.js +1 -1
  160. package/.next/server/app/api/worktrees/[id]/execution-logs/[logId]/route.js.nft.json +1 -1
  161. package/.next/server/app/api/worktrees/[id]/execution-logs/[logId]/route_client-reference-manifest.js +1 -1
  162. package/.next/server/app/api/worktrees/[id]/execution-logs/route.js +2 -2
  163. package/.next/server/app/api/worktrees/[id]/execution-logs/route.js.nft.json +1 -1
  164. package/.next/server/app/api/worktrees/[id]/execution-logs/route_client-reference-manifest.js +1 -1
  165. package/.next/server/app/api/worktrees/[id]/files/[...path]/route.js +1 -1
  166. package/.next/server/app/api/worktrees/[id]/files/[...path]/route.js.nft.json +1 -1
  167. package/.next/server/app/api/worktrees/[id]/files/[...path]/route_client-reference-manifest.js +1 -1
  168. package/.next/server/app/api/worktrees/[id]/git/branch/create/route.js +1 -1
  169. package/.next/server/app/api/worktrees/[id]/git/branch/create/route.js.nft.json +1 -1
  170. package/.next/server/app/api/worktrees/[id]/git/branch/create/route_client-reference-manifest.js +1 -1
  171. package/.next/server/app/api/worktrees/[id]/git/branch/delete/route.js +1 -1
  172. package/.next/server/app/api/worktrees/[id]/git/branch/delete/route.js.nft.json +1 -1
  173. package/.next/server/app/api/worktrees/[id]/git/branch/delete/route_client-reference-manifest.js +1 -1
  174. package/.next/server/app/api/worktrees/[id]/git/branches/route.js +1 -1
  175. package/.next/server/app/api/worktrees/[id]/git/branches/route.js.nft.json +1 -1
  176. package/.next/server/app/api/worktrees/[id]/git/branches/route_client-reference-manifest.js +1 -1
  177. package/.next/server/app/api/worktrees/[id]/git/checkout/route.js +1 -1
  178. package/.next/server/app/api/worktrees/[id]/git/checkout/route.js.nft.json +1 -1
  179. package/.next/server/app/api/worktrees/[id]/git/checkout/route_client-reference-manifest.js +1 -1
  180. package/.next/server/app/api/worktrees/[id]/git/commit/route.js +1 -1
  181. package/.next/server/app/api/worktrees/[id]/git/commit/route.js.nft.json +1 -1
  182. package/.next/server/app/api/worktrees/[id]/git/commit/route_client-reference-manifest.js +1 -1
  183. package/.next/server/app/api/worktrees/[id]/git/diff/route.js +1 -1
  184. package/.next/server/app/api/worktrees/[id]/git/diff/route.js.nft.json +1 -1
  185. package/.next/server/app/api/worktrees/[id]/git/diff/route_client-reference-manifest.js +1 -1
  186. package/.next/server/app/api/worktrees/[id]/git/fetch/route.js +1 -1
  187. package/.next/server/app/api/worktrees/[id]/git/fetch/route.js.nft.json +1 -1
  188. package/.next/server/app/api/worktrees/[id]/git/fetch/route_client-reference-manifest.js +1 -1
  189. package/.next/server/app/api/worktrees/[id]/git/log/route.js +1 -1
  190. package/.next/server/app/api/worktrees/[id]/git/log/route.js.nft.json +1 -1
  191. package/.next/server/app/api/worktrees/[id]/git/log/route_client-reference-manifest.js +1 -1
  192. package/.next/server/app/api/worktrees/[id]/git/pull/route.js +1 -1
  193. package/.next/server/app/api/worktrees/[id]/git/pull/route.js.nft.json +1 -1
  194. package/.next/server/app/api/worktrees/[id]/git/pull/route_client-reference-manifest.js +1 -1
  195. package/.next/server/app/api/worktrees/[id]/git/push/route.js +1 -1
  196. package/.next/server/app/api/worktrees/[id]/git/push/route.js.nft.json +1 -1
  197. package/.next/server/app/api/worktrees/[id]/git/push/route_client-reference-manifest.js +1 -1
  198. package/.next/server/app/api/worktrees/[id]/git/reset/route.js +1 -1
  199. package/.next/server/app/api/worktrees/[id]/git/reset/route.js.nft.json +1 -1
  200. package/.next/server/app/api/worktrees/[id]/git/reset/route_client-reference-manifest.js +1 -1
  201. package/.next/server/app/api/worktrees/[id]/git/revert/route.js +1 -1
  202. package/.next/server/app/api/worktrees/[id]/git/revert/route.js.nft.json +1 -1
  203. package/.next/server/app/api/worktrees/[id]/git/revert/route_client-reference-manifest.js +1 -1
  204. package/.next/server/app/api/worktrees/[id]/git/show/[commitHash]/route.js +1 -1
  205. package/.next/server/app/api/worktrees/[id]/git/show/[commitHash]/route.js.nft.json +1 -1
  206. package/.next/server/app/api/worktrees/[id]/git/show/[commitHash]/route_client-reference-manifest.js +1 -1
  207. package/.next/server/app/api/worktrees/[id]/git/stage/route.js +1 -1
  208. package/.next/server/app/api/worktrees/[id]/git/stage/route.js.nft.json +1 -1
  209. package/.next/server/app/api/worktrees/[id]/git/stage/route_client-reference-manifest.js +1 -1
  210. package/.next/server/app/api/worktrees/[id]/git/staged/route.js +1 -1
  211. package/.next/server/app/api/worktrees/[id]/git/staged/route.js.nft.json +1 -1
  212. package/.next/server/app/api/worktrees/[id]/git/staged/route_client-reference-manifest.js +1 -1
  213. package/.next/server/app/api/worktrees/[id]/git/stash/[index]/route.js +1 -1
  214. package/.next/server/app/api/worktrees/[id]/git/stash/[index]/route.js.nft.json +1 -1
  215. package/.next/server/app/api/worktrees/[id]/git/stash/[index]/route_client-reference-manifest.js +1 -1
  216. package/.next/server/app/api/worktrees/[id]/git/stash/apply/route.js +1 -1
  217. package/.next/server/app/api/worktrees/[id]/git/stash/apply/route.js.nft.json +1 -1
  218. package/.next/server/app/api/worktrees/[id]/git/stash/apply/route_client-reference-manifest.js +1 -1
  219. package/.next/server/app/api/worktrees/[id]/git/stash/pop/route.js +1 -1
  220. package/.next/server/app/api/worktrees/[id]/git/stash/pop/route.js.nft.json +1 -1
  221. package/.next/server/app/api/worktrees/[id]/git/stash/pop/route_client-reference-manifest.js +1 -1
  222. package/.next/server/app/api/worktrees/[id]/git/stash/push/route.js +1 -1
  223. package/.next/server/app/api/worktrees/[id]/git/stash/push/route.js.nft.json +1 -1
  224. package/.next/server/app/api/worktrees/[id]/git/stash/push/route_client-reference-manifest.js +1 -1
  225. package/.next/server/app/api/worktrees/[id]/git/stash/route.js +1 -1
  226. package/.next/server/app/api/worktrees/[id]/git/stash/route.js.nft.json +1 -1
  227. package/.next/server/app/api/worktrees/[id]/git/stash/route_client-reference-manifest.js +1 -1
  228. package/.next/server/app/api/worktrees/[id]/git/status/route.js +1 -1
  229. package/.next/server/app/api/worktrees/[id]/git/status/route.js.nft.json +1 -1
  230. package/.next/server/app/api/worktrees/[id]/git/status/route_client-reference-manifest.js +1 -1
  231. package/.next/server/app/api/worktrees/[id]/git/unstage/route.js +1 -1
  232. package/.next/server/app/api/worktrees/[id]/git/unstage/route.js.nft.json +1 -1
  233. package/.next/server/app/api/worktrees/[id]/git/unstage/route_client-reference-manifest.js +1 -1
  234. package/.next/server/app/api/worktrees/[id]/git/working-diff/route.js +1 -1
  235. package/.next/server/app/api/worktrees/[id]/git/working-diff/route.js.nft.json +1 -1
  236. package/.next/server/app/api/worktrees/[id]/git/working-diff/route_client-reference-manifest.js +1 -1
  237. package/.next/server/app/api/worktrees/[id]/interrupt/route.js +1 -1
  238. package/.next/server/app/api/worktrees/[id]/interrupt/route.js.nft.json +1 -1
  239. package/.next/server/app/api/worktrees/[id]/interrupt/route_client-reference-manifest.js +1 -1
  240. package/.next/server/app/api/worktrees/[id]/kill-session/route.js +1 -1
  241. package/.next/server/app/api/worktrees/[id]/kill-session/route.js.nft.json +1 -1
  242. package/.next/server/app/api/worktrees/[id]/kill-session/route_client-reference-manifest.js +1 -1
  243. package/.next/server/app/api/worktrees/[id]/logs/[filename]/route.js +1 -1
  244. package/.next/server/app/api/worktrees/[id]/logs/[filename]/route.js.nft.json +1 -1
  245. package/.next/server/app/api/worktrees/[id]/logs/[filename]/route_client-reference-manifest.js +1 -1
  246. package/.next/server/app/api/worktrees/[id]/logs/route.js +1 -1
  247. package/.next/server/app/api/worktrees/[id]/logs/route.js.nft.json +1 -1
  248. package/.next/server/app/api/worktrees/[id]/logs/route_client-reference-manifest.js +1 -1
  249. package/.next/server/app/api/worktrees/[id]/marp-render/route.js +3 -3
  250. package/.next/server/app/api/worktrees/[id]/marp-render/route.js.nft.json +1 -1
  251. package/.next/server/app/api/worktrees/[id]/marp-render/route_client-reference-manifest.js +1 -1
  252. package/.next/server/app/api/worktrees/[id]/memos/[memoId]/route.js +1 -1
  253. package/.next/server/app/api/worktrees/[id]/memos/[memoId]/route.js.nft.json +1 -1
  254. package/.next/server/app/api/worktrees/[id]/memos/[memoId]/route_client-reference-manifest.js +1 -1
  255. package/.next/server/app/api/worktrees/[id]/memos/route.js +1 -1
  256. package/.next/server/app/api/worktrees/[id]/memos/route.js.nft.json +1 -1
  257. package/.next/server/app/api/worktrees/[id]/memos/route_client-reference-manifest.js +1 -1
  258. package/.next/server/app/api/worktrees/[id]/messages/route.js +1 -1
  259. package/.next/server/app/api/worktrees/[id]/messages/route.js.nft.json +1 -1
  260. package/.next/server/app/api/worktrees/[id]/messages/route_client-reference-manifest.js +1 -1
  261. package/.next/server/app/api/worktrees/[id]/prompt-response/route.js +1 -1
  262. package/.next/server/app/api/worktrees/[id]/prompt-response/route.js.nft.json +1 -1
  263. package/.next/server/app/api/worktrees/[id]/prompt-response/route_client-reference-manifest.js +1 -1
  264. package/.next/server/app/api/worktrees/[id]/respond/route.js +1 -1
  265. package/.next/server/app/api/worktrees/[id]/respond/route.js.nft.json +1 -1
  266. package/.next/server/app/api/worktrees/[id]/respond/route_client-reference-manifest.js +1 -1
  267. package/.next/server/app/api/worktrees/[id]/route.js +1 -1
  268. package/.next/server/app/api/worktrees/[id]/route.js.nft.json +1 -1
  269. package/.next/server/app/api/worktrees/[id]/route_client-reference-manifest.js +1 -1
  270. package/.next/server/app/api/worktrees/[id]/schedules/[scheduleId]/route.js +2 -2
  271. package/.next/server/app/api/worktrees/[id]/schedules/[scheduleId]/route.js.nft.json +1 -1
  272. package/.next/server/app/api/worktrees/[id]/schedules/[scheduleId]/route_client-reference-manifest.js +1 -1
  273. package/.next/server/app/api/worktrees/[id]/schedules/active/route.js +1 -1
  274. package/.next/server/app/api/worktrees/[id]/schedules/active/route.js.nft.json +1 -1
  275. package/.next/server/app/api/worktrees/[id]/schedules/active/route_client-reference-manifest.js +1 -1
  276. package/.next/server/app/api/worktrees/[id]/schedules/route.js +3 -3
  277. package/.next/server/app/api/worktrees/[id]/schedules/route.js.nft.json +1 -1
  278. package/.next/server/app/api/worktrees/[id]/schedules/route_client-reference-manifest.js +1 -1
  279. package/.next/server/app/api/worktrees/[id]/search/route.js +1 -1
  280. package/.next/server/app/api/worktrees/[id]/search/route.js.nft.json +1 -1
  281. package/.next/server/app/api/worktrees/[id]/search/route_client-reference-manifest.js +1 -1
  282. package/.next/server/app/api/worktrees/[id]/send/route.js +1 -1
  283. package/.next/server/app/api/worktrees/[id]/send/route.js.nft.json +1 -1
  284. package/.next/server/app/api/worktrees/[id]/send/route_client-reference-manifest.js +1 -1
  285. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route.js +1 -1
  286. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route.js.nft.json +1 -1
  287. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route_client-reference-manifest.js +1 -1
  288. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/install/route.js +1 -1
  289. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/install/route.js.nft.json +1 -1
  290. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/install/route_client-reference-manifest.js +1 -1
  291. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/plan/route.js +1 -1
  292. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/plan/route.js.nft.json +1 -1
  293. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/plan/route_client-reference-manifest.js +1 -1
  294. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall/route.js +1 -1
  295. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall/route.js.nft.json +1 -1
  296. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall/route_client-reference-manifest.js +1 -1
  297. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall-plan/route.js +1 -1
  298. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall-plan/route.js.nft.json +1 -1
  299. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall-plan/route_client-reference-manifest.js +1 -1
  300. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/update/route.js +1 -1
  301. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/update/route.js.nft.json +1 -1
  302. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/update/route_client-reference-manifest.js +1 -1
  303. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/update-plan/route.js +1 -1
  304. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/update-plan/route.js.nft.json +1 -1
  305. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/update-plan/route_client-reference-manifest.js +1 -1
  306. package/.next/server/app/api/worktrees/[id]/skills/route.js +1 -1
  307. package/.next/server/app/api/worktrees/[id]/skills/route.js.nft.json +1 -1
  308. package/.next/server/app/api/worktrees/[id]/skills/route_client-reference-manifest.js +1 -1
  309. package/.next/server/app/api/worktrees/[id]/slash-commands/route.js +1 -1
  310. package/.next/server/app/api/worktrees/[id]/slash-commands/route.js.nft.json +1 -1
  311. package/.next/server/app/api/worktrees/[id]/slash-commands/route_client-reference-manifest.js +1 -1
  312. package/.next/server/app/api/worktrees/[id]/special-keys/route.js +1 -1
  313. package/.next/server/app/api/worktrees/[id]/special-keys/route.js.nft.json +1 -1
  314. package/.next/server/app/api/worktrees/[id]/special-keys/route_client-reference-manifest.js +1 -1
  315. package/.next/server/app/api/worktrees/[id]/start-polling/route.js +1 -1
  316. package/.next/server/app/api/worktrees/[id]/start-polling/route.js.nft.json +1 -1
  317. package/.next/server/app/api/worktrees/[id]/start-polling/route_client-reference-manifest.js +1 -1
  318. package/.next/server/app/api/worktrees/[id]/tasks/route.js +2 -2
  319. package/.next/server/app/api/worktrees/[id]/tasks/route.js.nft.json +1 -1
  320. package/.next/server/app/api/worktrees/[id]/tasks/route_client-reference-manifest.js +1 -1
  321. package/.next/server/app/api/worktrees/[id]/terminal/route.js +1 -1
  322. package/.next/server/app/api/worktrees/[id]/terminal/route.js.nft.json +1 -1
  323. package/.next/server/app/api/worktrees/[id]/terminal/route_client-reference-manifest.js +1 -1
  324. package/.next/server/app/api/worktrees/[id]/timers/history/route.js +1 -1
  325. package/.next/server/app/api/worktrees/[id]/timers/history/route.js.nft.json +1 -1
  326. package/.next/server/app/api/worktrees/[id]/timers/history/route_client-reference-manifest.js +1 -1
  327. package/.next/server/app/api/worktrees/[id]/timers/route.js +1 -1
  328. package/.next/server/app/api/worktrees/[id]/timers/route.js.nft.json +1 -1
  329. package/.next/server/app/api/worktrees/[id]/timers/route_client-reference-manifest.js +1 -1
  330. package/.next/server/app/api/worktrees/[id]/todos/[todoId]/route.js +1 -1
  331. package/.next/server/app/api/worktrees/[id]/todos/[todoId]/route.js.nft.json +1 -1
  332. package/.next/server/app/api/worktrees/[id]/todos/[todoId]/route_client-reference-manifest.js +1 -1
  333. package/.next/server/app/api/worktrees/[id]/todos/route.js +1 -1
  334. package/.next/server/app/api/worktrees/[id]/todos/route.js.nft.json +1 -1
  335. package/.next/server/app/api/worktrees/[id]/todos/route_client-reference-manifest.js +1 -1
  336. package/.next/server/app/api/worktrees/[id]/tree/[...path]/route.js +1 -1
  337. package/.next/server/app/api/worktrees/[id]/tree/[...path]/route.js.nft.json +1 -1
  338. package/.next/server/app/api/worktrees/[id]/tree/[...path]/route_client-reference-manifest.js +1 -1
  339. package/.next/server/app/api/worktrees/[id]/tree/route.js +1 -1
  340. package/.next/server/app/api/worktrees/[id]/tree/route.js.nft.json +1 -1
  341. package/.next/server/app/api/worktrees/[id]/tree/route_client-reference-manifest.js +1 -1
  342. package/.next/server/app/api/worktrees/[id]/upload/[...path]/route.js +1 -1
  343. package/.next/server/app/api/worktrees/[id]/upload/[...path]/route.js.nft.json +1 -1
  344. package/.next/server/app/api/worktrees/[id]/upload/[...path]/route_client-reference-manifest.js +1 -1
  345. package/.next/server/app/api/worktrees/[id]/verify/route.js +1 -4
  346. package/.next/server/app/api/worktrees/[id]/verify/route.js.nft.json +1 -1
  347. package/.next/server/app/api/worktrees/[id]/verify/route_client-reference-manifest.js +1 -1
  348. package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/route.js +1 -1
  349. package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/route.js.nft.json +1 -1
  350. package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/route_client-reference-manifest.js +1 -1
  351. package/.next/server/app/api/worktrees/[id]/verify/runs/route.js +1 -1
  352. package/.next/server/app/api/worktrees/[id]/verify/runs/route.js.nft.json +1 -1
  353. package/.next/server/app/api/worktrees/[id]/verify/runs/route_client-reference-manifest.js +1 -1
  354. package/.next/server/app/api/worktrees/[id]/viewed/route.js +1 -1
  355. package/.next/server/app/api/worktrees/[id]/viewed/route.js.nft.json +1 -1
  356. package/.next/server/app/api/worktrees/[id]/viewed/route_client-reference-manifest.js +1 -1
  357. package/.next/server/app/api/worktrees/route.js +1 -1
  358. package/.next/server/app/api/worktrees/route.js.nft.json +1 -1
  359. package/.next/server/app/api/worktrees/route_client-reference-manifest.js +1 -1
  360. package/.next/server/app/chat/page_client-reference-manifest.js +1 -1
  361. package/.next/server/app/login/page_client-reference-manifest.js +1 -1
  362. package/.next/server/app/manifest.webmanifest/route_client-reference-manifest.js +1 -1
  363. package/.next/server/app/more/page_client-reference-manifest.js +1 -1
  364. package/.next/server/app/offline/page_client-reference-manifest.js +1 -1
  365. package/.next/server/app/page_client-reference-manifest.js +1 -1
  366. package/.next/server/app/proxy/[...path]/route.js +1 -1
  367. package/.next/server/app/proxy/[...path]/route.js.nft.json +1 -1
  368. package/.next/server/app/proxy/[...path]/route_client-reference-manifest.js +1 -1
  369. package/.next/server/app/repositories/page_client-reference-manifest.js +1 -1
  370. package/.next/server/app/review/page_client-reference-manifest.js +1 -1
  371. package/.next/server/app/sessions/page_client-reference-manifest.js +1 -1
  372. package/.next/server/app/skills/[skillId]/page_client-reference-manifest.js +1 -1
  373. package/.next/server/app/skills/installed/page_client-reference-manifest.js +1 -1
  374. package/.next/server/app/skills/page_client-reference-manifest.js +1 -1
  375. package/.next/server/app/worktrees/[id]/files/[...path]/page.js +1 -1
  376. package/.next/server/app/worktrees/[id]/files/[...path]/page.js.nft.json +1 -1
  377. package/.next/server/app/worktrees/[id]/files/[...path]/page_client-reference-manifest.js +1 -1
  378. package/.next/server/app/worktrees/[id]/page.js +2 -2
  379. package/.next/server/app/worktrees/[id]/page.js.nft.json +1 -1
  380. package/.next/server/app/worktrees/[id]/page_client-reference-manifest.js +1 -1
  381. package/.next/server/app/worktrees/[id]/terminal/page.js +1 -1
  382. package/.next/server/app/worktrees/[id]/terminal/page.js.nft.json +1 -1
  383. package/.next/server/app/worktrees/[id]/terminal/page_client-reference-manifest.js +1 -1
  384. package/.next/server/app-paths-manifest.json +21 -21
  385. package/.next/server/chunks/1029.js +1 -1
  386. package/.next/server/chunks/1068.js +1 -1
  387. package/.next/server/chunks/2119.js +1 -1
  388. package/.next/server/chunks/2404.js +1 -1
  389. package/.next/server/chunks/2445.js +1 -1
  390. package/.next/server/chunks/2546.js +1 -1
  391. package/.next/server/chunks/3241.js +1 -0
  392. package/.next/server/chunks/3417.js +1 -1
  393. package/.next/server/chunks/406.js +10 -6
  394. package/.next/server/chunks/4444.js +1 -1
  395. package/.next/server/chunks/5959.js +4 -5
  396. package/.next/server/chunks/5998.js +1 -12
  397. package/.next/server/chunks/6130.js +1 -1
  398. package/.next/server/chunks/6274.js +3 -3
  399. package/.next/server/chunks/6401.js +1 -1
  400. package/.next/server/chunks/6781.js +1 -0
  401. package/.next/server/chunks/7458.js +6 -0
  402. package/.next/server/chunks/{3753.js → 7970.js} +57 -32
  403. package/.next/server/chunks/8536.js +1 -1
  404. package/.next/server/chunks/8807.js +180 -127
  405. package/.next/server/chunks/9058.js +1 -1
  406. package/.next/server/chunks/9067.js +1 -1
  407. package/.next/server/chunks/9360.js +1 -1
  408. package/.next/server/chunks/9687.js +2 -2
  409. package/.next/server/middleware-manifest.json +5 -5
  410. package/.next/server/pages/500.html +1 -1
  411. package/.next/server/server-reference-manifest.json +1 -1
  412. package/.next/server/src/middleware.js.map +1 -1
  413. package/.next/static/chunks/{6488-53a3e1d78e4fe8f7.js → 6488-95ba9d24a76f0cc5.js} +1 -1
  414. package/.next/static/chunks/app/worktrees/[id]/{page-6dc0b8c4e808ea3e.js → page-966a451ae7b0903a.js} +1 -1
  415. package/.next/trace +12 -12
  416. package/dist/server/src/config/log-config.js +10 -1
  417. package/dist/server/src/config/safe-directory.js +103 -0
  418. package/dist/server/src/config/system-directories.js +74 -9
  419. package/dist/server/src/lib/cli-tools/antigravity.js +19 -2
  420. package/dist/server/src/lib/cli-tools/codex.js +95 -1
  421. package/dist/server/src/lib/cli-tools/copilot.js +30 -1
  422. package/dist/server/src/lib/cli-tools/gemini.js +28 -2
  423. package/dist/server/src/lib/cli-tools/opencode.js +51 -2
  424. package/dist/server/src/lib/git/git-default-branch.js +59 -0
  425. package/dist/server/src/lib/hooks/agent-event-service.js +205 -0
  426. package/dist/server/src/lib/hooks/agent-event-types.js +7 -86
  427. package/dist/server/src/lib/hooks/hook-settings-generator.js +26 -11
  428. package/dist/server/src/lib/hooks/permission-decision-service.js +269 -0
  429. package/dist/server/src/lib/hooks/sources/abstain.js +78 -0
  430. package/dist/server/src/lib/hooks/sources/antigravity/hooks-config.js +372 -0
  431. package/dist/server/src/lib/hooks/sources/antigravity/source.js +225 -0
  432. package/dist/server/src/lib/hooks/sources/antigravity/tool-id.js +16 -0
  433. package/dist/server/src/lib/hooks/sources/claude/source.js +143 -0
  434. package/dist/server/src/lib/hooks/sources/claude/tool-id.js +18 -0
  435. package/dist/server/src/lib/hooks/sources/codex/hooks-config.js +465 -0
  436. package/dist/server/src/lib/hooks/sources/codex/source.js +138 -0
  437. package/dist/server/src/lib/hooks/sources/codex/tool-id.js +15 -0
  438. package/dist/server/src/lib/hooks/sources/copilot/hook-settings.js +473 -0
  439. package/dist/server/src/lib/hooks/sources/copilot/source.js +210 -0
  440. package/dist/server/src/lib/hooks/sources/copilot/tool-id.js +15 -0
  441. package/dist/server/src/lib/hooks/sources/define-source.js +169 -0
  442. package/dist/server/src/lib/hooks/sources/event-mapper.js +157 -0
  443. package/dist/server/src/lib/hooks/sources/gemini/event-vocabulary.js +102 -0
  444. package/dist/server/src/lib/hooks/sources/gemini/settings-generator.js +315 -0
  445. package/dist/server/src/lib/hooks/sources/gemini/shared-config-tree.js +103 -0
  446. package/dist/server/src/lib/hooks/sources/gemini/source.js +151 -0
  447. package/dist/server/src/lib/hooks/sources/gemini/tool-id.js +17 -0
  448. package/dist/server/src/lib/hooks/sources/hook-event-vocabulary.js +111 -0
  449. package/dist/server/src/lib/hooks/sources/index.js +62 -0
  450. package/dist/server/src/lib/hooks/sources/legacy-relay.js +84 -0
  451. package/dist/server/src/lib/hooks/sources/opencode/client.js +299 -0
  452. package/dist/server/src/lib/hooks/sources/opencode/ingest.js +261 -0
  453. package/dist/server/src/lib/hooks/sources/opencode/mappers.js +154 -0
  454. package/dist/server/src/lib/hooks/sources/opencode/payloads.js +189 -0
  455. package/dist/server/src/lib/hooks/sources/opencode/ports.js +295 -0
  456. package/dist/server/src/lib/hooks/sources/opencode/runtime.js +159 -0
  457. package/dist/server/src/lib/hooks/sources/opencode/source.js +250 -0
  458. package/dist/server/src/lib/hooks/sources/opencode/subscription.js +422 -0
  459. package/dist/server/src/lib/hooks/sources/opencode/tool-id.js +14 -0
  460. package/dist/server/src/lib/hooks/sources/opencode/turn-gate.js +193 -0
  461. package/dist/server/src/lib/hooks/sources/pending-decisions.js +127 -0
  462. package/dist/server/src/lib/hooks/sources/registry.js +111 -0
  463. package/dist/server/src/lib/hooks/sources/types.js +46 -0
  464. package/dist/server/src/lib/session/agent-session-lifecycle.js +82 -0
  465. package/dist/server/src/lib/session/claude-session.js +10 -3
  466. package/dist/server/src/lib/tasks/contract-message.js +175 -0
  467. package/dist/server/src/lib/verification/env-clean-gate.js +320 -0
  468. package/dist/server/src/lib/verification/env-snapshot.js +474 -0
  469. package/dist/server/src/lib/verification/gate-runner.js +802 -0
  470. package/dist/server/src/lib/verification/scope-gate.js +402 -0
  471. package/dist/server/src/lib/verification/verify-config.js +281 -0
  472. package/package.json +1 -1
  473. package/scripts/hooks/cmate-agent-event.sh +73 -3
  474. package/.next/server/chunks/8856.js +0 -4
  475. /package/.next/static/{XpKfn5x6H-mtTaXI9yNmb → wH6K6QNPHSdATFkVoIcy3}/_buildManifest.js +0 -0
  476. /package/.next/static/{XpKfn5x6H-mtTaXI9yNmb → wH6K6QNPHSdATFkVoIcy3}/_ssgManifest.js +0 -0
@@ -0,0 +1,210 @@
1
+ "use strict";
2
+ /**
3
+ * GitHub Copilot CLI's {@link AgentEventSource} (Issue #1761, Epic #1720 Phase
4
+ * 4-3).
5
+ *
6
+ * Issue #1761 was filed as conditional — "copilot 1.0.77 may have no hooks at
7
+ * all; if it does not, withdraw this Issue" — on the evidence that
8
+ * `copilot --help` never says the word. The #1757 spike then found the feature
9
+ * documented in `copilot help config`, drove six events out of a live session,
10
+ * and captured them into `tests/fixtures/hooks/copilot/`. The premise is
11
+ * inverted: of the four tools Phase 4 adds, **copilot's payloads are the
12
+ * closest to Claude Code's**, and this file is correspondingly short.
13
+ *
14
+ * What it does *not* share with Claude is where the config goes, how a verdict
15
+ * gets back, and how long there is to send one. All three live in
16
+ * `./hook-settings`; the module comment there is the one to read before
17
+ * changing anything about delivery.
18
+ *
19
+ * ## The four values that are not Claude's
20
+ *
21
+ * - **`configScope: 'global-singleton'`.** There is no `--settings`. One file,
22
+ * `~/.copilot/settings.json`, for every session on the machine — so the
23
+ * correlation keys cannot be baked into it and ride in the environment
24
+ * instead.
25
+ * - **`decisionTimeoutSeconds: 10`**, against Claude's 600 (#1757 §5.2.3). A
26
+ * decision path budgeted for Claude misses copilot's window entirely and the
27
+ * tool call proceeds unadjudicated.
28
+ * - **`supportedEvents` omits `notification` and `pre_tool_use`.** See below;
29
+ * both omissions are deliberate and neither is a gap in the mapping.
30
+ * - **`encodeVerdict` speaks `permissionDecision`**, not Claude's
31
+ * `decision.behavior`, and copilot can express a denial that Claude cannot.
32
+ *
33
+ * ## Why `pre_tool_use` is not in `supportedEvents`
34
+ *
35
+ * Copilot has no `PermissionRequest`. `PreToolUse` *is* its approval gate: the
36
+ * hook's stdout decides whether the call runs (#1757 §5.2.4, re-measured for
37
+ * this Issue against 1.0.79 — `deny` prints `Denied by preToolUse hook: …` and
38
+ * the command does not execute). CommandMate therefore points that one event at
39
+ * `/api/hooks/permission-request`, which adjudicates and does not record.
40
+ *
41
+ * So `pre_tool_use` never reaches `agent-event-state` for copilot, and
42
+ * `supportedEvents` is a promise about what does: listing it would leave a
43
+ * caller waiting for an event that is being answered somewhere else. The mapper
44
+ * still recognises the spelling — a hand-configured hook from #1549 pointed at
45
+ * the event route keeps working — which is why the omission is in
46
+ * `capabilities` and not in `mappers`.
47
+ *
48
+ * `notification` is omitted for the opposite reason: it was configured during
49
+ * the spike and **never fired once**, so there is no captured payload and no
50
+ * evidence about what `notification_type` would even contain. Prompt detection
51
+ * for copilot stays with the screen scraper (#1723), which is where it already
52
+ * is.
53
+ *
54
+ * ## Why `session_start` is not a "the agent is up" signal
55
+ *
56
+ * Copilot fires `UserPromptSubmit` **before** `SessionStart` — 20.813Z against
57
+ * 20.915Z, measured. Anything ordering-sensitive built on these two words is
58
+ * wrong for this tool specifically, which is why the fence in
59
+ * `beginAgentSession` is a timestamp rather than a state machine.
60
+ *
61
+ * @module lib/hooks/sources/copilot/source
62
+ */
63
+ Object.defineProperty(exports, "__esModule", { value: true });
64
+ exports.copilotAgentEventSource = void 0;
65
+ exports.parseCopilotPermissionRequest = parseCopilotPermissionRequest;
66
+ exports.encodeCopilotVerdict = encodeCopilotVerdict;
67
+ const permission_request_payload_1 = require("../../../../lib/hooks/permission-request-payload");
68
+ const define_source_1 = require("../define-source");
69
+ const event_mapper_1 = require("../event-mapper");
70
+ const hook_event_vocabulary_1 = require("../hook-event-vocabulary");
71
+ const hook_settings_1 = require("./hook-settings");
72
+ const tool_id_1 = require("./tool-id");
73
+ /**
74
+ * No opinion, byte-for-byte the reply the spike measured copilot treating as
75
+ * "carry on" (#1757 §5.2.4).
76
+ *
77
+ * The same object Claude reads the same way — which is a coincidence worth
78
+ * naming, because it is emphatically not true of antigravity, where `{}` is a
79
+ * denial (#1757 P10).
80
+ */
81
+ const NO_DECISION_BODY = {};
82
+ /**
83
+ * Read copilot's `PreToolUse` payload as a permission request (S7).
84
+ *
85
+ * Deliberately not `parsePermissionRequestPayload`: that one insists on
86
+ * `hook_event_name === 'PermissionRequest'`, an event copilot does not have, so
87
+ * reusing it would answer null for every request copilot ever makes and
88
+ * Auto-Yes would abstain on all of them — silently, and looking exactly like a
89
+ * working feature with nothing to approve.
90
+ *
91
+ * Strict in the same way and for the same reason: anything unvouchable becomes
92
+ * null, the caller turns null into no-decision, and the fallback is a dialog
93
+ * rather than an execution.
94
+ *
95
+ * `promptId` is always null — copilot sends no correlation id on this payload
96
+ * (nor on `PreToolUse`/`PostToolUse`; #1757 R5) — so the permission route mints
97
+ * its own id for the in-flight request.
98
+ *
99
+ * @param body - Whatever was posted to `/api/hooks/permission-request`
100
+ */
101
+ function parseCopilotPermissionRequest(body) {
102
+ if (!(0, event_mapper_1.isPlainObject)(body))
103
+ return null;
104
+ if (body.hook_event_name !== hook_settings_1.COPILOT_PERMISSION_HOOK_EVENT)
105
+ return null;
106
+ const toolName = (0, event_mapper_1.readStringField)(body, 'tool_name');
107
+ if (!toolName || toolName.length > permission_request_payload_1.MAX_TOOL_NAME_LENGTH)
108
+ return null;
109
+ // No `tool_input` means nothing for the deny patterns to be judged against,
110
+ // which makes the request unadjudicatable rather than harmless.
111
+ if (!(0, event_mapper_1.isPlainObject)(body.tool_input))
112
+ return null;
113
+ return {
114
+ toolName,
115
+ toolInput: body.tool_input,
116
+ promptId: null,
117
+ sessionId: (0, event_mapper_1.readStringField)(body, 'session_id'),
118
+ permissionMode: null,
119
+ permissionSuggestions: null,
120
+ };
121
+ }
122
+ /**
123
+ * Encode a verdict in copilot's wire form (S6).
124
+ *
125
+ * `hookSpecificOutput.permissionDecision`, verified end to end against copilot
126
+ * 1.0.79: `allow` ran a shell command that would otherwise have prompted,
127
+ * `deny` refused it and printed the reason, and `{}` fell through to the
128
+ * ordinary flow.
129
+ *
130
+ * `deny` is encoded rather than collapsed — this is the one place copilot is
131
+ * *more* expressive than Claude, whose source has no spelling for it. Nothing
132
+ * produces one today (`permission-decision-service` answers allow or
133
+ * no-decision and never denies, on purpose), so this branch is a capability
134
+ * being stated honestly, not a behaviour being switched on.
135
+ *
136
+ * `allowAlways` and `answer` collapse to no-decision: copilot's
137
+ * `permissionDecision` has no persistent form, and approving one call is not
138
+ * the same promise as writing a standing rule.
139
+ */
140
+ function encodeCopilotVerdict(verdict) {
141
+ if (verdict.kind === 'allowOnce') {
142
+ return {
143
+ hookSpecificOutput: {
144
+ hookEventName: hook_settings_1.COPILOT_PERMISSION_HOOK_EVENT,
145
+ permissionDecision: 'allow',
146
+ },
147
+ };
148
+ }
149
+ if (verdict.kind === 'deny') {
150
+ return {
151
+ hookSpecificOutput: {
152
+ hookEventName: hook_settings_1.COPILOT_PERMISSION_HOOK_EVENT,
153
+ permissionDecision: 'deny',
154
+ permissionDecisionReason: verdict.message ?? 'denied by CommandMate',
155
+ },
156
+ };
157
+ }
158
+ return NO_DECISION_BODY;
159
+ }
160
+ /**
161
+ * GitHub Copilot CLI as an event source.
162
+ *
163
+ * Registered in `../registry`. Nothing outside this directory imports it by
164
+ * name; callers ask the registry for the tool they are holding.
165
+ */
166
+ exports.copilotAgentEventSource = (0, define_source_1.definePushHookSource)({
167
+ cliToolId: tool_id_1.COPILOT_CLI_TOOL_ID,
168
+ // #1757 §5.2.4, re-confirmed here: an empty reply, an unreachable server and
169
+ // a late reply all land in copilot's ordinary approval flow. Abstaining costs
170
+ // a dialog and nothing else — true for Claude, codex and copilot, false for
171
+ // antigravity and opencode (C3).
172
+ noDecision: { kind: 'proceeds' },
173
+ capabilities: {
174
+ // Five of the seven. `pre_tool_use` is answered by the permission receiver
175
+ // rather than recorded, and `notification` has never been observed to fire.
176
+ // Both are explained at the top of this file; neither is an oversight.
177
+ supportedEvents: [
178
+ 'stop',
179
+ 'session_start',
180
+ 'session_end',
181
+ 'user_prompt_submit',
182
+ 'post_tool_use',
183
+ ],
184
+ // One file for the whole machine. See `./hook-settings`.
185
+ configScope: 'global-singleton',
186
+ decisionTimeoutSeconds: hook_settings_1.COPILOT_HOOK_TIMEOUT_SECONDS,
187
+ },
188
+ // The same CamelCase dialect as Claude and codex — measured against six
189
+ // captured payloads (#1757 §8.1), not assumed from the resemblance. Shared
190
+ // rather than copied: `hook-event-vocabulary` exists to be the dialect these
191
+ // three tools agree on, and a private copy here would be a second place for
192
+ // the same spelling to drift.
193
+ mappers: (0, event_mapper_1.fromNameTable)(hook_event_vocabulary_1.CAMEL_CASE_HOOK_EVENT_NAMES),
194
+ nativeEventNameFields: ['hook_event_name'],
195
+ conversationIdFields: hook_event_vocabulary_1.SESSION_ID_FIELDS,
196
+ // No captured copilot payload carries one, so this answers null in practice;
197
+ // it is wired anyway so that a future release which adds `tool_use_id` is
198
+ // correlated rather than ignored.
199
+ toolCallIdFields: hook_event_vocabulary_1.TOOL_CALL_ID_FIELDS,
200
+ // snake_case throughout, exactly as Claude spells it: `source` on
201
+ // `SessionStart`, `reason` on `SessionEnd`, `tool_name` on the tool events.
202
+ extractDetail: hook_event_vocabulary_1.extractSnakeCaseEventDetail,
203
+ parsePermissionRequest: parseCopilotPermissionRequest,
204
+ // Copilot has no `AskUserQuestion` tool and no captured payload resembling
205
+ // one. Null is "no structured data", which degrades to the behaviour of a
206
+ // machine without hooks rather than to a guess.
207
+ parseQuestion: () => null,
208
+ encodeVerdict: encodeCopilotVerdict,
209
+ prepareLaunch: (target, executablePath) => (0, hook_settings_1.buildCopilotLaunchCommand)(executablePath, target),
210
+ });
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ /**
3
+ * GitHub Copilot CLI's {@link CLIToolType}, on its own so that anything needing
4
+ * only the id does not pull in the source (Issue #1761).
5
+ *
6
+ * The same split Claude has, and for the same reason: `hook-settings-generator`
7
+ * imports `CLAUDE_CLI_TOOL_ID` while `claude/source.ts` imports
8
+ * `hook-settings-generator`, so a single module would be a cycle.
9
+ *
10
+ * @module lib/hooks/sources/copilot/tool-id
11
+ */
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.COPILOT_CLI_TOOL_ID = void 0;
14
+ /** `copilot`, as `CLI_TOOL_IDS` spells it. */
15
+ exports.COPILOT_CLI_TOOL_ID = 'copilot';
@@ -0,0 +1,169 @@
1
+ "use strict";
2
+ /**
3
+ * Factories that turn a tool's *differences* into an {@link AgentEventSource}
4
+ * (Issue #1759).
5
+ *
6
+ * The interface is wide because the six tools genuinely differ in eleven
7
+ * places. Making every implementer restate all eleven would guarantee that
8
+ * Phase 4-2…4-5 is four copies of Claude's file with four things changed —
9
+ * which is the failure mode Epic #1720 was opened about. So the parts that are
10
+ * the *same for every push transport* live here exactly once:
11
+ *
12
+ * - `subscribe` resolves immediately; the receiver route is already listening
13
+ * and there is nothing per-instance to hold open (C1).
14
+ * - `decide` writes into the slot the receiver opened, so the verdict leaves
15
+ * through the response body (C2).
16
+ * - `listPending` answers with the requests in flight, because a hook that was
17
+ * dropped is gone and there is nothing to re-read (C7).
18
+ * - `probeActivity` answers null: an event cannot be asked again (C7).
19
+ * - `liveness` answers `unknown`: a quiet hook and a dead agent look identical
20
+ * (C6).
21
+ *
22
+ * What a push tool then has to supply is the list in
23
+ * {@link PushHookSourceSpec} — spellings, field names, verdict shape, launch
24
+ * command. `docs/design/agent-event-source-interface.md` walks through adding
25
+ * one.
26
+ *
27
+ * {@link definePullEventSource} exists for the same reason in reverse: opencode
28
+ * has real subscription, liveness and re-sync behaviour and no launch config at
29
+ * all, so its defaults are the opposite ones.
30
+ *
31
+ * @module lib/hooks/sources/define-source
32
+ */
33
+ Object.defineProperty(exports, "__esModule", { value: true });
34
+ exports.definePushHookSource = definePushHookSource;
35
+ exports.definePullEventSource = definePullEventSource;
36
+ const agent_event_types_1 = require("../../../lib/hooks/agent-event-types");
37
+ const event_mapper_1 = require("./event-mapper");
38
+ const pending_decisions_1 = require("./pending-decisions");
39
+ /** A subscription that was never really opened. Closing it is legal and inert. */
40
+ const INERT_SUBSCRIPTION = {
41
+ close: async () => { },
42
+ liveness: { state: 'unknown' },
43
+ };
44
+ /**
45
+ * Build a push (hook) source from its differences.
46
+ *
47
+ * @returns A source whose transport is `push` and whose lifecycle methods are
48
+ * the inert-but-callable ones every hook tool shares
49
+ */
50
+ function definePushHookSource(spec) {
51
+ const nativeEventNameFields = spec.nativeEventNameFields ?? ['hook_event_name'];
52
+ return {
53
+ cliToolId: spec.cliToolId,
54
+ transport: 'push',
55
+ noDecision: spec.noDecision,
56
+ capabilities: spec.capabilities,
57
+ normalizeEvent(raw) {
58
+ const receivedAt = raw.receivedAt ?? Date.now();
59
+ const nativeEventName = nativeEventNameFields.length > 0
60
+ ? (0, event_mapper_1.readFirstStringField)(raw.payload, nativeEventNameFields)
61
+ : null;
62
+ // An event word the caller already resolved wins over the payload. This
63
+ // is the only channel antigravity has, and it is also how the relay
64
+ // script's `--event` reaches here for every other tool.
65
+ if (raw.event != null && (0, agent_event_types_1.isAgentEventType)(raw.event)) {
66
+ return (0, event_mapper_1.buildNormalizedEvent)({ event: raw.event }, raw.payload, receivedAt, {
67
+ detail: spec.extractDetail,
68
+ conversationId: spec.conversationIdFields,
69
+ toolCallId: spec.toolCallIdFields,
70
+ });
71
+ }
72
+ const mapping = (0, event_mapper_1.runEventMappers)(spec.mappers, nativeEventName, raw.payload);
73
+ if (!mapping) {
74
+ // C8. Not an error: a tool emits more events than CommandMate has words
75
+ // for, and it grows more of them between releases.
76
+ (0, event_mapper_1.recordUnknownEvent)(spec.cliToolId, nativeEventName);
77
+ return null;
78
+ }
79
+ return (0, event_mapper_1.buildNormalizedEvent)(mapping, raw.payload, receivedAt, {
80
+ detail: spec.extractDetail,
81
+ conversationId: spec.conversationIdFields,
82
+ toolCallId: spec.toolCallIdFields,
83
+ });
84
+ },
85
+ parsePermissionRequest: spec.parsePermissionRequest,
86
+ parseQuestion: spec.parseQuestion,
87
+ encodeVerdict(verdict) {
88
+ return { kind: 'responseBody', body: spec.encodeVerdict(verdict) };
89
+ },
90
+ prepareLaunch: spec.prepareLaunch,
91
+ async subscribe() {
92
+ // C1: push sources are subscribed to by existing, not by connecting. The
93
+ // method is here so a caller can treat both transports the same way.
94
+ return INERT_SUBSCRIPTION;
95
+ },
96
+ async decide(target, decision, verdict) {
97
+ // C2: the verdict leaves through the body of the request the agent is
98
+ // blocked on, which the receiver is holding open in a slot.
99
+ (0, pending_decisions_1.fillDecisionSlot)(target, decision.id, spec.encodeVerdict(verdict));
100
+ },
101
+ async listPending(target) {
102
+ return (0, pending_decisions_1.listOpenDecisions)(target);
103
+ },
104
+ async probeActivity() {
105
+ // C7: there is no endpoint to ask. Callers fall back to the scraper.
106
+ return null;
107
+ },
108
+ liveness() {
109
+ // C6: a hook that has not fired and an agent that has died look the same.
110
+ return { state: 'unknown' };
111
+ },
112
+ };
113
+ }
114
+ /**
115
+ * Build a pull (subscription) source from its differences.
116
+ *
117
+ * The mirror image of {@link definePushHookSource}: the lifecycle is real and
118
+ * the verdict never rides on a response body, so {@link
119
+ * AgentEventSource.encodeVerdict} always answers `outOfBand` and callers are
120
+ * pushed towards `decide()`.
121
+ */
122
+ function definePullEventSource(spec) {
123
+ const nativeEventNameFields = spec.nativeEventNameFields ?? ['type'];
124
+ return {
125
+ cliToolId: spec.cliToolId,
126
+ transport: 'pull',
127
+ noDecision: spec.noDecision,
128
+ capabilities: spec.capabilities,
129
+ normalizeEvent(raw) {
130
+ const receivedAt = raw.receivedAt ?? Date.now();
131
+ const nativeEventName = nativeEventNameFields.length > 0
132
+ ? (0, event_mapper_1.readFirstStringField)(raw.payload, nativeEventNameFields)
133
+ : null;
134
+ if (raw.event != null && (0, agent_event_types_1.isAgentEventType)(raw.event)) {
135
+ return (0, event_mapper_1.buildNormalizedEvent)({ event: raw.event }, raw.payload, receivedAt, {
136
+ detail: spec.extractDetail,
137
+ conversationId: spec.conversationIdFields,
138
+ toolCallId: spec.toolCallIdFields,
139
+ });
140
+ }
141
+ const mapping = (0, event_mapper_1.runEventMappers)(spec.mappers, nativeEventName, raw.payload);
142
+ if (!mapping) {
143
+ (0, event_mapper_1.recordUnknownEvent)(spec.cliToolId, nativeEventName);
144
+ return null;
145
+ }
146
+ return (0, event_mapper_1.buildNormalizedEvent)(mapping, raw.payload, receivedAt, {
147
+ detail: spec.extractDetail,
148
+ conversationId: spec.conversationIdFields,
149
+ toolCallId: spec.toolCallIdFields,
150
+ });
151
+ },
152
+ parsePermissionRequest: spec.parsePermissionRequest,
153
+ parseQuestion: spec.parseQuestion,
154
+ encodeVerdict() {
155
+ // C2. There is no request to answer: the event arrived on a stream that
156
+ // has been open for hours and carries no reply channel.
157
+ return { kind: 'outOfBand' };
158
+ },
159
+ prepareLaunch: spec.prepareLaunch ?? ((_target, executablePath) => ({
160
+ command: executablePath,
161
+ settingsPath: null,
162
+ })),
163
+ subscribe: spec.subscribe,
164
+ decide: spec.decide,
165
+ listPending: spec.listPending,
166
+ probeActivity: spec.probeActivity,
167
+ liveness: spec.liveness,
168
+ };
169
+ }
@@ -0,0 +1,157 @@
1
+ "use strict";
2
+ /**
3
+ * Predicate-based mapping from a source's own events onto the seven words
4
+ * (Issue #1759, constraint C4).
5
+ *
6
+ * The Claude-only implementation this replaces was a
7
+ * `Record<string, AgentEventType>`: one native spelling in, one word out. That
8
+ * shape is not general, and #1758 §5.2.3 is the proof:
9
+ *
10
+ * - `message.part.updated` is `pre_tool_use` when `part.state.status` is
11
+ * `running` and `post_tool_use` when it is `completed` or `error` — **the
12
+ * same event name, two different words, chosen by a field.**
13
+ * - `user_prompt_submit` has no event of its own; it is `message.updated` with
14
+ * `info.role === "user"`.
15
+ * - `notification` is three unrelated events (`permission.asked`,
16
+ * `question.asked`, `session.error`) that differ only in `detail`.
17
+ *
18
+ * So a mapper is a function, and a source carries an ordered list of them:
19
+ * the first that returns a value wins, and a list that returns nothing means
20
+ * "this event is not one of the seven", which is a normal outcome, not an
21
+ * error (C8).
22
+ *
23
+ * @module lib/hooks/sources/event-mapper
24
+ */
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.MAX_UNKNOWN_EVENT_NAMES = void 0;
27
+ exports.whenNamed = whenNamed;
28
+ exports.fromNameTable = fromNameTable;
29
+ exports.runEventMappers = runEventMappers;
30
+ exports.recordUnknownEvent = recordUnknownEvent;
31
+ exports.getUnknownEventTally = getUnknownEventTally;
32
+ exports.resetUnknownEventTallies = resetUnknownEventTallies;
33
+ exports.readStringField = readStringField;
34
+ exports.readFirstStringField = readFirstStringField;
35
+ exports.boundDetail = boundDetail;
36
+ exports.isPlainObject = isPlainObject;
37
+ exports.readNestedString = readNestedString;
38
+ exports.buildNormalizedEvent = buildNormalizedEvent;
39
+ const agent_event_types_1 = require("../../../lib/hooks/agent-event-types");
40
+ /**
41
+ * The commonest rule: this native name is always that word.
42
+ *
43
+ * @param nativeName - e.g. `Stop`, `session.idle`
44
+ * @param event - The word it maps to
45
+ * @param detail - A fixed subtype, for sources that fold several events into
46
+ * `notification` and need `detail` to tell them apart
47
+ */
48
+ function whenNamed(nativeName, event, detail) {
49
+ return (nativeEventName) => nativeEventName === nativeName ? { event, detail: detail ?? null } : null;
50
+ }
51
+ /** Every entry of a name table, as rules. Order within the table is preserved. */
52
+ function fromNameTable(table) {
53
+ return Object.entries(table).map(([nativeName, event]) => whenNamed(nativeName, event));
54
+ }
55
+ /**
56
+ * Run an ordered rule list.
57
+ *
58
+ * @returns The first mapping produced, or null when no rule matched
59
+ */
60
+ function runEventMappers(mappers, nativeEventName, payload) {
61
+ for (const mapper of mappers) {
62
+ const mapped = mapper(nativeEventName, payload);
63
+ if (mapped)
64
+ return mapped;
65
+ }
66
+ return null;
67
+ }
68
+ /** Cap on remembered distinct names, so an unbounded vocabulary cannot grow this. */
69
+ exports.MAX_UNKNOWN_EVENT_NAMES = 32;
70
+ const unknownEvents = (globalThis.__agentSourceUnknownEvents ??= new Map());
71
+ /**
72
+ * Record an event that mapped to nothing.
73
+ *
74
+ * Counted rather than thrown, because "I do not recognise this" is the steady
75
+ * state, not a fault: opencode publishes 89 event types against seven words,
76
+ * and `server.heartbeat` — which arrives every ten seconds — is not even in the
77
+ * server's own OpenAPI document (#1758 D3/D5). A receiver that threw would fail
78
+ * ten times a minute on a healthy connection.
79
+ */
80
+ function recordUnknownEvent(cliToolId, nativeEventName) {
81
+ const tally = unknownEvents.get(cliToolId) ?? { count: 0, names: [] };
82
+ tally.count += 1;
83
+ const name = nativeEventName ?? '(unnamed)';
84
+ if (!tally.names.includes(name) && tally.names.length < exports.MAX_UNKNOWN_EVENT_NAMES) {
85
+ tally.names.push(name);
86
+ }
87
+ unknownEvents.set(cliToolId, tally);
88
+ }
89
+ /** @returns What this tool has sent that no rule claimed. */
90
+ function getUnknownEventTally(cliToolId) {
91
+ const tally = unknownEvents.get(cliToolId);
92
+ return { count: tally?.count ?? 0, names: [...(tally?.names ?? [])] };
93
+ }
94
+ /** Forget the tallies. For tests; nothing in production resets them. */
95
+ function resetUnknownEventTallies() {
96
+ unknownEvents.clear();
97
+ }
98
+ // =============================================================================
99
+ // Payload field helpers
100
+ // =============================================================================
101
+ /** A non-empty string field, or null. */
102
+ function readStringField(payload, key) {
103
+ const value = payload[key];
104
+ return typeof value === 'string' && value !== '' ? value : null;
105
+ }
106
+ /** The first of `keys` present as a non-empty string, or null. */
107
+ function readFirstStringField(payload, keys) {
108
+ for (const key of keys) {
109
+ const value = readStringField(payload, key);
110
+ if (value !== null)
111
+ return value;
112
+ }
113
+ return null;
114
+ }
115
+ /** Trim a subtype to the length the store accepts. */
116
+ function boundDetail(value) {
117
+ if (value === null || value === '')
118
+ return null;
119
+ return value.slice(0, agent_event_types_1.MAX_EVENT_DETAIL_LENGTH);
120
+ }
121
+ /** Type guard for a JSON object (not an array, not null). */
122
+ function isPlainObject(value) {
123
+ return typeof value === 'object' && value !== null && !Array.isArray(value);
124
+ }
125
+ /** Read a nested path, e.g. `['part', 'state', 'status']`. */
126
+ function readNestedString(payload, path) {
127
+ let current = payload;
128
+ for (const key of path) {
129
+ if (!isPlainObject(current))
130
+ return null;
131
+ current = current[key];
132
+ }
133
+ return typeof current === 'string' && current !== '' ? current : null;
134
+ }
135
+ /**
136
+ * Assemble a {@link NormalizedAgentEvent} from a mapping and the payload.
137
+ *
138
+ * @param mapping - What the rules decided
139
+ * @param payload - The event, verbatim
140
+ * @param receivedAt - Epoch ms
141
+ * @param fallbacks - Where to look for the fields the rule left unset
142
+ */
143
+ function buildNormalizedEvent(mapping, payload, receivedAt, fallbacks = {}) {
144
+ const detail = mapping.detail !== undefined && mapping.detail !== null
145
+ ? boundDetail(mapping.detail)
146
+ : boundDetail(fallbacks.detail?.(mapping.event, payload) ?? null);
147
+ return {
148
+ event: mapping.event,
149
+ detail,
150
+ conversationId: mapping.conversationId ??
151
+ (fallbacks.conversationId ? readFirstStringField(payload, fallbacks.conversationId) : null),
152
+ toolCallId: mapping.toolCallId ??
153
+ (fallbacks.toolCallId ? readFirstStringField(payload, fallbacks.toolCallId) : null),
154
+ raw: payload,
155
+ receivedAt,
156
+ };
157
+ }
@@ -0,0 +1,102 @@
1
+ "use strict";
2
+ /**
3
+ * Gemini CLI's hook vocabulary — its event spellings and its subtype values
4
+ * (Issue #1762).
5
+ *
6
+ * Kept here rather than added to `../hook-event-vocabulary`, which is
7
+ * deliberate and is spelled out in `docs/design/agent-event-source-interface.md`
8
+ * §5: that table is *the CamelCase dialect Claude, codex and copilot share*, and
9
+ * putting `BeforeTool` in it would make every one of those tools accept a
10
+ * spelling none of them ever sends. The fact that no gemini session has ever
11
+ * emitted `Stop` is information, and merging the tables destroys it.
12
+ *
13
+ * ## Where the table comes from
14
+ *
15
+ * The CLI's own migration command. `gemini hooks migrate --from-claude` exists
16
+ * to port a Claude `settings.json` across, so the map it carries is gemini's
17
+ * authoritative statement of "this Claude event is that gemini event" (#1757
18
+ * §5.3.1). Confirmed against the shipped bundle's `HookEventName` enum in
19
+ * v0.55.1, which lists eleven events:
20
+ *
21
+ * ```
22
+ * BeforeTool AfterTool BeforeAgent Notification AfterAgent SessionStart
23
+ * SessionEnd PreCompress BeforeModel AfterModel BeforeToolSelection
24
+ * ```
25
+ *
26
+ * Four of them have no word in `AGENT_EVENT_TYPES` and are deliberately absent
27
+ * below: `PreCompress`, `BeforeModel`, `AfterModel` and `BeforeToolSelection`
28
+ * are real gemini events (`PreCompress` and `BeforeModel` were captured live in
29
+ * #1757) that mean nothing CommandMate models. They map to null, get counted by
30
+ * `recordUnknownEvent`, and are not filed under something adjacent.
31
+ *
32
+ * @module lib/hooks/sources/gemini/event-vocabulary
33
+ */
34
+ Object.defineProperty(exports, "__esModule", { value: true });
35
+ exports.GEMINI_NOTIFICATION_SUBTYPES = exports.GEMINI_HOOK_EVENT_NAMES = void 0;
36
+ exports.extractGeminiEventDetail = extractGeminiEventDetail;
37
+ const event_mapper_1 = require("../event-mapper");
38
+ const hook_event_vocabulary_1 = require("../hook-event-vocabulary");
39
+ /**
40
+ * `hook_event_name` values gemini sends, mapped onto the seven words.
41
+ *
42
+ * Four of the seven are spelled differently from Claude's — `BeforeAgent`,
43
+ * `AfterAgent`, `BeforeTool`, `AfterTool` — which is the whole reason a source
44
+ * carries its own mappers. `SubagentStop` has no gemini counterpart (the CLI
45
+ * has no subagents; `migrate` folds it onto `AfterAgent`), so it is absent.
46
+ */
47
+ exports.GEMINI_HOOK_EVENT_NAMES = {
48
+ SessionStart: 'session_start',
49
+ SessionEnd: 'session_end',
50
+ BeforeAgent: 'user_prompt_submit',
51
+ AfterAgent: 'stop',
52
+ BeforeTool: 'pre_tool_use',
53
+ AfterTool: 'post_tool_use',
54
+ Notification: 'notification',
55
+ };
56
+ /**
57
+ * gemini's only notification subtype, and the word CommandMate spells it with.
58
+ *
59
+ * The value is read out of the shipped bundle: `NotificationType` has exactly
60
+ * one member, `ToolPermission`, and `fireNotificationEvent` puts it on the wire
61
+ * verbatim as `notification_type` (v0.55.1). It means precisely what Claude's
62
+ * `permission_prompt` means — a tool is asking for approval and a dialog is on
63
+ * screen.
64
+ *
65
+ * **The translation is not cosmetic.** `status-mapping.ts` and
66
+ * `agent-event-state.ts` compare `detail` against the literal string
67
+ * `permission_prompt`; #1759 abstracted the event *names* but left the subtype
68
+ * vocabulary shared and Claude-shaped. Publishing `ToolPermission` would
69
+ * therefore be publishing a subtype nothing downstream recognises, and gemini
70
+ * would never report `waiting` — silently, with the event arriving and being
71
+ * recorded correctly the whole time. Translating here is the one place that can
72
+ * fix it without either editing a tool-agnostic consumer to know a tool's
73
+ * dialect, or teaching the shared table a gemini spelling.
74
+ */
75
+ exports.GEMINI_NOTIFICATION_SUBTYPES = {
76
+ ToolPermission: 'permission_prompt',
77
+ };
78
+ /**
79
+ * The subtype for a gemini payload, in CommandMate's vocabulary.
80
+ *
81
+ * gemini's payload is Claude-shaped snake_case — verified field by field
82
+ * against the bundle's per-event input builders (`source` on `SessionStart`,
83
+ * `reason` on `SessionEnd`, `tool_name` on `BeforeTool`/`AfterTool`,
84
+ * `notification_type` on `Notification`) — so the shared extractor does the
85
+ * reading. Only `notification` needs translating afterwards.
86
+ *
87
+ * An unrecognised notification type is passed through rather than dropped: a
88
+ * type gemini adds later is worth recording under its own name, and nothing
89
+ * downstream branches on a value it does not know.
90
+ *
91
+ * @param event - The word this payload mapped to
92
+ * @param payload - The event, verbatim
93
+ * @returns The subtype, or null when the event has none
94
+ */
95
+ function extractGeminiEventDetail(event, payload) {
96
+ if (event !== 'notification')
97
+ return (0, hook_event_vocabulary_1.extractSnakeCaseEventDetail)(event, payload);
98
+ const native = (0, event_mapper_1.readStringField)(payload, 'notification_type');
99
+ if (native === null)
100
+ return null;
101
+ return (0, event_mapper_1.boundDetail)(exports.GEMINI_NOTIFICATION_SUBTYPES[native] ?? native);
102
+ }