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,175 @@
1
+ "use strict";
2
+ /**
3
+ * Turn an execution contract into the message the agent actually receives, and
4
+ * cross-check it against the repository's verify.yaml (Issue #1545, Phase 2-1).
5
+ *
6
+ * Canonical spec: docs/design/task-contract.md §5
7
+ *
8
+ * The preamble spells the completion criterion out as the *real commands* the
9
+ * gates will run. A gate id alone tells the agent nothing about what will be
10
+ * executed, so a contract sent that way declares a criterion the recipient
11
+ * cannot evaluate.
12
+ *
13
+ * Server-only: consumes a loaded VerifyConfig.
14
+ *
15
+ * @module lib/tasks/contract-message
16
+ */
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.REQUIRE_COMMIT_SOURCE_CONTRACT = exports.REQUIRE_COMMIT_SOURCE_CONFIG = void 0;
19
+ exports.resolveRequireCommit = resolveRequireCommit;
20
+ exports.resolveContractGateIds = resolveContractGateIds;
21
+ exports.validateContractAgainstVerifyConfig = validateContractAgainstVerifyConfig;
22
+ exports.resolveGateCommands = resolveGateCommands;
23
+ exports.composeContractMessage = composeContractMessage;
24
+ const verify_config_1 = require("../../lib/verification/verify-config");
25
+ /**
26
+ * How the built-in gates read in the preamble; they run git plumbing, not shell
27
+ * commands.
28
+ *
29
+ * work-evidence has two readings because it has two behaviours. Leaving it on
30
+ * the permissive wording while `requireCommit` is in force would tell the agent
31
+ * a criterion the run does not apply — and stating the strict wording while it
32
+ * is not in force is the D-4 defect (#1628) this Issue closes.
33
+ */
34
+ const WORK_EVIDENCE_ANY_CHANGE_LABEL = `${verify_config_1.WORK_EVIDENCE_GATE_ID}(commit または未 commit の変更が存在すること)`;
35
+ const WORK_EVIDENCE_COMMIT_LABEL = `${verify_config_1.WORK_EVIDENCE_GATE_ID}(commit が存在すること。未 commit の変更は作業証跡として数えない)`;
36
+ const SCOPE_LABEL = `${verify_config_1.SCOPE_GATE_ID}(変更ファイルが scope.allow の内側に収まっていること)`;
37
+ /** The obligation line, in the two forms the pipeline can actually enforce. */
38
+ const COMMIT_REQUIRED_LINE = '- 作業完了後は必ず commit すること(未 commit の作業は未完了とみなされる)';
39
+ const COMMIT_EXPECTED_LINE = '- 作業完了後は commit すること(ただし work-evidence は未 commit の変更も作業証跡として' +
40
+ '認めるため、commit の有無そのものは検査されない)';
41
+ /** Named so a failing gate can say which declaration put it there. */
42
+ exports.REQUIRE_COMMIT_SOURCE_CONFIG = `options.requireCommit (${verify_config_1.VERIFY_CONFIG_RELATIVE_PATH})`;
43
+ exports.REQUIRE_COMMIT_SOURCE_CONTRACT = 'success.requireCommit (task contract)';
44
+ /**
45
+ * Combine the repository-wide and per-delegation commit requirements (#1642).
46
+ *
47
+ * OR, deliberately, rather than "the nearer declaration wins". The whole point
48
+ * of the contract-side flag is to stop a rule from being declared and never
49
+ * checked; letting a contract answer `false` to a repository that answered
50
+ * `true` would reopen exactly that hole one delegation at a time. A contract can
51
+ * only ever tighten.
52
+ *
53
+ * Lives here rather than in gate-runner because both callers need the same
54
+ * answer: this module writes the sentence the agent reads, gate-runner reaches
55
+ * the verdict, and the two disagreeing is the defect being fixed.
56
+ */
57
+ function resolveRequireCommit(contract, config) {
58
+ const sources = [];
59
+ if (config?.options.requireCommit)
60
+ sources.push(exports.REQUIRE_COMMIT_SOURCE_CONFIG);
61
+ if (contract?.success.requireCommit)
62
+ sources.push(exports.REQUIRE_COMMIT_SOURCE_CONTRACT);
63
+ return { required: sources.length > 0, sources };
64
+ }
65
+ /**
66
+ * The gate ids a contract asks for, or null for "every gate".
67
+ *
68
+ * The `success` flags — not the `verify.gates` list — decide whether the built-in
69
+ * gates run. A contract that required work evidence or a clean scope while
70
+ * listing only `[lint, unit]` would otherwise declare rules that nothing
71
+ * checked: the flags would read as enforced and the gates would never run.
72
+ */
73
+ function resolveContractGateIds(contract) {
74
+ const gates = contract.verify.gates;
75
+ if (!gates)
76
+ return null;
77
+ const builtIns = [
78
+ [verify_config_1.WORK_EVIDENCE_GATE_ID, contract.success.requireWorkEvidence],
79
+ [verify_config_1.SCOPE_GATE_ID, contract.success.requireScopeClean],
80
+ ];
81
+ // Built-ins are listed first and in their execution order even when the
82
+ // contract already named one, so the resolved list reads as the order the run
83
+ // will actually take rather than the order the contract happened to type.
84
+ const selected = builtIns
85
+ .filter(([id, required]) => required || gates.includes(id))
86
+ .map(([id]) => id);
87
+ const rest = gates.filter((id) => !builtIns.some(([builtIn]) => builtIn === id));
88
+ return [...selected, ...rest];
89
+ }
90
+ /**
91
+ * Check that every gate the contract names can actually be resolved.
92
+ *
93
+ * A contract pointing at a gate id that does not exist would only be caught at
94
+ * verification time, by which point the agent has already been told a
95
+ * completion criterion that cannot be evaluated. Reporting it here makes
96
+ * "the contract was accepted" and "the contract's gates exist" the same moment.
97
+ *
98
+ * @returns issue strings, empty when the contract resolves cleanly
99
+ */
100
+ function validateContractAgainstVerifyConfig(contract, config) {
101
+ const gates = contract.verify.gates;
102
+ if (!gates)
103
+ return [];
104
+ if (!config) {
105
+ return [
106
+ `verify.gates: declared ${gates.join(', ')}, but ${verify_config_1.VERIFY_CONFIG_RELATIVE_PATH} ` +
107
+ 'is missing or unreadable in this worktree, so the gate ids cannot be resolved',
108
+ ];
109
+ }
110
+ const known = new Set([
111
+ verify_config_1.WORK_EVIDENCE_GATE_ID,
112
+ verify_config_1.SCOPE_GATE_ID,
113
+ ...config.gates.map((gate) => gate.id),
114
+ ]);
115
+ const unknown = gates.filter((id) => !known.has(id));
116
+ if (unknown.length === 0)
117
+ return [];
118
+ return [
119
+ `verify.gates: unknown gate id(s) ${unknown.join(', ')}. ` +
120
+ `Declared in ${verify_config_1.VERIFY_CONFIG_RELATIVE_PATH}: ${[...known].join(', ')}`,
121
+ ];
122
+ }
123
+ /**
124
+ * The commands the contract's gates will run, in the order they will run.
125
+ *
126
+ * Only ever called after {@link validateContractAgainstVerifyConfig} has
127
+ * accepted the contract, so an unresolvable id cannot reach here.
128
+ */
129
+ function resolveGateCommands(contract, config) {
130
+ if (!config)
131
+ return [];
132
+ const workEvidenceLabel = resolveRequireCommit(contract, config).required
133
+ ? WORK_EVIDENCE_COMMIT_LABEL
134
+ : WORK_EVIDENCE_ANY_CHANGE_LABEL;
135
+ const builtInLabels = new Map([
136
+ [verify_config_1.WORK_EVIDENCE_GATE_ID, workEvidenceLabel],
137
+ [verify_config_1.SCOPE_GATE_ID, SCOPE_LABEL],
138
+ ]);
139
+ const selected = resolveContractGateIds(contract);
140
+ if (!selected) {
141
+ // An omitted gates list runs every gate, and the built-ins are still governed
142
+ // by the success flags rather than by the (absent) list.
143
+ const builtIns = [workEvidenceLabel];
144
+ if (contract.success.requireScopeClean)
145
+ builtIns.push(SCOPE_LABEL);
146
+ return [...builtIns, ...config.gates.map((gate) => gate.command)];
147
+ }
148
+ const byId = new Map(config.gates.map((gate) => [gate.id, gate.command]));
149
+ return selected.map((id) => builtInLabels.get(id) ?? byId.get(id));
150
+ }
151
+ /**
152
+ * Compose the message sent to the agent: contract preamble, then the goal.
153
+ *
154
+ * Every line states an obligation the pipeline can later check, so the agent is
155
+ * not asked to infer the rules from the goal text.
156
+ */
157
+ function composeContractMessage(contract, config) {
158
+ const lines = ['## 実行契約'];
159
+ lines.push(contract.scope.allow.length > 0
160
+ ? `- 変更してよいのは次のパスのみ: ${contract.scope.allow.join(', ')}`
161
+ : '- 変更パスの制限: なし(scope.allow が未宣言)');
162
+ if (contract.scope.deny.length > 0) {
163
+ lines.push(`- 変更してはならないパス: ${contract.scope.deny.join(', ')}`);
164
+ }
165
+ // The sentence follows the verdict, never the other way round: this line used
166
+ // to be a constant asserting "未 commit の作業は未完了とみなされる" while the
167
+ // gate passed on an uncommitted change alone (#1628 D-4, measured in the
168
+ // Epic #1585 acceptance run).
169
+ lines.push(resolveRequireCommit(contract, config).required ? COMMIT_REQUIRED_LINE : COMMIT_EXPECTED_LINE);
170
+ const commands = resolveGateCommands(contract, config);
171
+ lines.push(commands.length > 0
172
+ ? `- 完了条件: 次の検証コマンドがすべて成功すること: ${commands.join(' / ')}`
173
+ : `- 完了条件: ${verify_config_1.VERIFY_CONFIG_RELATIVE_PATH} に検証ゲートが宣言されていないため、検証コマンドは無い`);
174
+ return `${lines.join('\n')}\n\n## タスク\n${contract.goal}`;
175
+ }
@@ -0,0 +1,320 @@
1
+ "use strict";
2
+ /**
3
+ * Built-in `env-clean` gate: reconcile the machine against the snapshot taken
4
+ * when the task was created (Issue #1740).
5
+ *
6
+ * Canonical spec: docs/design/task-contract.md §2.6
7
+ *
8
+ * `scope` closes the question "what did this delegation change inside the
9
+ * repository". This gate closes the other half. Together they are the first
10
+ * point at which "what did this delegation change" has a complete answer.
11
+ *
12
+ * Two design rules, in order of importance:
13
+ *
14
+ * 1. **Never fail open.** A probe that could not answer produces `unknown`,
15
+ * the gate reports `error`, and the run fails. Turning an unmeasured probe
16
+ * into "nothing changed" is how #1614 shipped a 0 that had never been
17
+ * counted, and it is the single failure this gate must not reproduce.
18
+ * 2. **Additions and removals are judged asymmetrically.** Everything that
19
+ * existed at task start must still exist, whoever it belonged to — that is
20
+ * the pkill (#1739) and `kill-server` (#1624) case. New things are a
21
+ * violation *unless they are attributable to another worker*, because
22
+ * parallel delegations legitimately start their own sessions and servers
23
+ * inside each other's measurement windows.
24
+ *
25
+ * Server-only: consumes snapshots produced by env-snapshot.
26
+ *
27
+ * @module lib/verification/env-clean-gate
28
+ */
29
+ Object.defineProperty(exports, "__esModule", { value: true });
30
+ exports.ENV_CLEAN_GUIDANCE = exports.MAX_REPORTED_ENV_CHANGES = exports.REQUIRE_ENV_CLEAN_SOURCE_CONTRACT = exports.REQUIRE_ENV_CLEAN_SOURCE_CONFIG = void 0;
31
+ exports.resolveRequireEnvClean = resolveRequireEnvClean;
32
+ exports.attributeSessionName = attributeSessionName;
33
+ exports.attributeAnchor = attributeAnchor;
34
+ exports.diffEnvSnapshots = diffEnvSnapshots;
35
+ exports.formatEnvCleanReport = formatEnvCleanReport;
36
+ exports.envCleanNoBaseline = envCleanNoBaseline;
37
+ exports.evaluateEnvClean = evaluateEnvClean;
38
+ const path_1 = require("path");
39
+ const types_1 = require("../../lib/cli-tools/types");
40
+ const env_snapshot_1 = require("./env-snapshot");
41
+ const verify_config_1 = require("./verify-config");
42
+ // =============================================================================
43
+ // Opt-in resolution
44
+ // =============================================================================
45
+ /** Named so a failing gate can say which declaration switched it on. */
46
+ exports.REQUIRE_ENV_CLEAN_SOURCE_CONFIG = `options.requireEnvClean (${verify_config_1.VERIFY_CONFIG_RELATIVE_PATH})`;
47
+ exports.REQUIRE_ENV_CLEAN_SOURCE_CONTRACT = 'success.requireEnvClean (task contract)';
48
+ /**
49
+ * Read `success.requireEnvClean` off a contract without depending on the parser
50
+ * having a field for it.
51
+ *
52
+ * `TaskContractSuccess` is a closed key set in `lib/tasks/contract-parser.ts`,
53
+ * which is outside this delegation's `scope.allow`, so the key cannot be added
54
+ * to the parser here — a contract that spells it today is rejected at send time
55
+ * with `unknown key "requireEnvClean"`. Resolving it structurally means the
56
+ * per-delegation switch starts working the moment the parser opens the key
57
+ * (`SUCCESS_KEYS` and `TaskContractSuccess`, two lines) with no further change
58
+ * in this module. See docs/design/task-contract.md §2.6.
59
+ */
60
+ function contractRequiresEnvClean(contract) {
61
+ if (!contract)
62
+ return false;
63
+ const success = contract.success;
64
+ return success.requireEnvClean === true;
65
+ }
66
+ /**
67
+ * Combine the repository-wide and per-delegation switches.
68
+ *
69
+ * ORed, never overridden, for the reason `resolveRequireCommit` is: a contract
70
+ * may tighten a rule the repository left off, but must not be able to switch off
71
+ * one the repository declared. Both default to false, so a contract that says
72
+ * nothing leaves every existing verdict exactly as it was.
73
+ */
74
+ function resolveRequireEnvClean(contract, config) {
75
+ const sources = [];
76
+ if (config?.options.requireEnvClean)
77
+ sources.push(exports.REQUIRE_ENV_CLEAN_SOURCE_CONFIG);
78
+ if (contractRequiresEnvClean(contract))
79
+ sources.push(exports.REQUIRE_ENV_CLEAN_SOURCE_CONTRACT);
80
+ return { required: sources.length > 0, sources };
81
+ }
82
+ /** CLI tool ids, longest first: `vibe-local` must not be stripped as `vibe`. */
83
+ const CLI_PREFIXES = [...types_1.CLI_TOOL_IDS].sort((a, b) => b.length - a.length);
84
+ /**
85
+ * Attribute an `mcbd-<cli>-<worktreeId>[-suffix]` session name to a worktree.
86
+ *
87
+ * Ambiguity resolves towards `self` on purpose. Worktree ids may contain
88
+ * hyphens, so `mcbd-claude-foo-bar` is genuinely ambiguous between worktree
89
+ * `foo` with suffix `bar` and worktree `foo-bar`; calling it `self` makes an
90
+ * addition a violation, and being wrong in that direction costs a false report
91
+ * rather than a missed leak.
92
+ */
93
+ function attributeSessionName(name, worktreeId) {
94
+ if (!name.startsWith(env_snapshot_1.MCBD_SESSION_PREFIX))
95
+ return 'unattributed';
96
+ const rest = name.slice(env_snapshot_1.MCBD_SESSION_PREFIX.length);
97
+ const cli = CLI_PREFIXES.find((id) => rest.startsWith(`${id}-`));
98
+ if (!cli)
99
+ return 'unattributed';
100
+ const tail = rest.slice(cli.length + 1);
101
+ if (tail === worktreeId || tail.startsWith(`${worktreeId}-`))
102
+ return 'self';
103
+ return 'other';
104
+ }
105
+ /**
106
+ * Attribute a listening process by the directory it runs in.
107
+ *
108
+ * Inside this worktree is this task. A *sibling* of this worktree is another
109
+ * worker — linked worktrees are created side by side, and the primary checkout
110
+ * the user's production server runs from sits there too, which is what keeps a
111
+ * parallel delegation and the user's own server from being reported as this
112
+ * task's leak. Anything else, including a process with no readable cwd, stays
113
+ * unattributed and is judged.
114
+ */
115
+ function attributeAnchor(anchor, worktreePath) {
116
+ if (!anchor)
117
+ return 'unattributed';
118
+ const worktree = (0, path_1.resolve)(worktreePath);
119
+ const path = (0, path_1.resolve)(anchor);
120
+ if (path === worktree || path.startsWith(worktree + path_1.sep))
121
+ return 'self';
122
+ const parent = (0, path_1.dirname)(worktree);
123
+ // The parent directory itself is not a sibling; a process running there is as
124
+ // unattributable as one running in `/`.
125
+ if (path !== parent && path.startsWith(parent + path_1.sep))
126
+ return 'other';
127
+ return 'unattributed';
128
+ }
129
+ function attributeEntry(probeId, entry, context) {
130
+ switch (probeId) {
131
+ case 'tmux-sessions':
132
+ return attributeSessionName(entry.key, context.worktreeId);
133
+ case 'listeners':
134
+ return attributeAnchor(entry.anchor, context.worktreePath);
135
+ default:
136
+ // A file has no owner. `$HOME` and `~/.commandmate` are shared, so an
137
+ // entry appearing there is a violation for whoever is being judged — the
138
+ // rule the Issue's incident list is made of.
139
+ return 'unattributed';
140
+ }
141
+ }
142
+ function toChange(entry, owner) {
143
+ return { key: entry.key, detail: entry.detail, owner };
144
+ }
145
+ /**
146
+ * Compare two snapshots probe by probe.
147
+ *
148
+ * A probe is compared only when *both* snapshots answered it. One unavailable
149
+ * side makes that probe `unknown`: the alternative — treating the missing side
150
+ * as an empty set — would report every entry as added or removed, which is worse
151
+ * than useless, and treating it as equal would be the fail-open.
152
+ */
153
+ function diffEnvSnapshots(baseline, final, context) {
154
+ const probes = env_snapshot_1.ENV_PROBE_IDS.map((probeId) => {
155
+ const before = baseline.probes[probeId];
156
+ const after = final.probes[probeId];
157
+ if (!before || before.status !== 'ok') {
158
+ return {
159
+ probeId,
160
+ status: 'unknown',
161
+ reason: `baseline probe unavailable: ${before?.reason ?? 'not recorded'}`,
162
+ added: [],
163
+ ignoredAdded: [],
164
+ removed: [],
165
+ };
166
+ }
167
+ if (!after || after.status !== 'ok') {
168
+ return {
169
+ probeId,
170
+ status: 'unknown',
171
+ reason: `current probe unavailable: ${after?.reason ?? 'not recorded'}`,
172
+ added: [],
173
+ ignoredAdded: [],
174
+ removed: [],
175
+ };
176
+ }
177
+ const beforeKeys = new Set(before.entries.map((entry) => entry.key));
178
+ const afterKeys = new Set(after.entries.map((entry) => entry.key));
179
+ const added = [];
180
+ const ignoredAdded = [];
181
+ for (const entry of after.entries) {
182
+ if (beforeKeys.has(entry.key))
183
+ continue;
184
+ const owner = attributeEntry(probeId, entry, context);
185
+ (owner === 'other' ? ignoredAdded : added).push(toChange(entry, owner));
186
+ }
187
+ const removed = before.entries
188
+ .filter((entry) => !afterKeys.has(entry.key))
189
+ .map((entry) => toChange(entry, attributeEntry(probeId, entry, context)));
190
+ return {
191
+ probeId,
192
+ status: added.length + removed.length > 0 ? 'violated' : 'clean',
193
+ reason: null,
194
+ added,
195
+ ignoredAdded,
196
+ removed,
197
+ };
198
+ });
199
+ // A measured violation is a verdict and outranks an unmeasured probe; an
200
+ // unmeasured probe outranks clean. `clean` requires every probe to have been
201
+ // compared and to have matched.
202
+ const status = probes.some((probe) => probe.status === 'violated')
203
+ ? 'violated'
204
+ : probes.some((probe) => probe.status === 'unknown')
205
+ ? 'unknown'
206
+ : 'clean';
207
+ return { status, probes };
208
+ }
209
+ // =============================================================================
210
+ // Reporting
211
+ // =============================================================================
212
+ /** Violating entries listed per probe before the rest becomes a count. */
213
+ exports.MAX_REPORTED_ENV_CHANGES = 25;
214
+ /**
215
+ * Actionable coda, in the same spirit as SCOPE_ALLOW_GUIDANCE: the change list
216
+ * says what moved but not what to do, and the two directions are genuinely
217
+ * different actions.
218
+ */
219
+ exports.ENV_CLEAN_GUIDANCE = 'Anything listed under "+" was started or created during this task and left behind — ' +
220
+ 'stop it by PID and remove it. Anything under "-" existed when the task started and is ' +
221
+ 'now gone — it was killed or deleted; restart or restore it. Never stop a process by ' +
222
+ 'pattern (`pkill -f`): it takes every process whose command line matches, which is how ' +
223
+ 'the production server was stopped in #1739.';
224
+ function formatChanges(sign, changes) {
225
+ const listed = changes.slice(0, exports.MAX_REPORTED_ENV_CHANGES);
226
+ const remainder = changes.length - listed.length;
227
+ const lines = listed.map((change) => {
228
+ const detail = change.detail ? ` ${change.detail}` : '';
229
+ return ` ${sign} ${change.key}${detail} [${change.owner}]`;
230
+ });
231
+ if (remainder > 0)
232
+ lines.push(` ... and ${remainder} more`);
233
+ return lines;
234
+ }
235
+ /** Render a diff for `log_tail`. */
236
+ function formatEnvCleanReport(diff) {
237
+ const lines = [];
238
+ for (const probe of diff.probes) {
239
+ const label = env_snapshot_1.ENV_PROBE_LABELS[probe.probeId];
240
+ if (probe.status === 'unknown') {
241
+ lines.push(` ${probe.probeId} UNKNOWN (${label}): ${probe.reason ?? 'no reason recorded'}`);
242
+ continue;
243
+ }
244
+ if (probe.status === 'clean') {
245
+ const excused = probe.ignoredAdded.length > 0
246
+ ? ` (${probe.ignoredAdded.length} addition(s) attributed to another worktree)`
247
+ : '';
248
+ lines.push(` ${probe.probeId} clean (${label})${excused}`);
249
+ continue;
250
+ }
251
+ lines.push(` ${probe.probeId} VIOLATED (${label}): +${probe.added.length} -${probe.removed.length}`);
252
+ lines.push(...formatChanges('+', probe.added));
253
+ lines.push(...formatChanges('-', probe.removed));
254
+ for (const excused of probe.ignoredAdded) {
255
+ lines.push(` · ${excused.key} (ignored: belongs to another worktree)`);
256
+ }
257
+ }
258
+ return lines.join('\n');
259
+ }
260
+ // =============================================================================
261
+ // Gate evaluation
262
+ // =============================================================================
263
+ /**
264
+ * Why the gate could not reach a verdict at all, phrased for `log_tail`.
265
+ *
266
+ * Spelled out rather than reduced to "no baseline" because the reader's next
267
+ * question is always "so how do I get one", and the answer — the baseline is
268
+ * recorded when the task is created, and only when the gate is switched on — is
269
+ * not guessable from the failure.
270
+ */
271
+ function envCleanNoBaseline(taskId, sources) {
272
+ const who = taskId ? `task ${taskId}` : 'this run';
273
+ const how = sources.length > 0 ? sources.join(' and ') : 'nothing';
274
+ return (`${verify_config_1.ENV_CLEAN_GATE_ID}: UNKNOWN — no baseline snapshot exists for ${who}, so nothing can be ` +
275
+ 'compared. This is NOT "the environment is unchanged": no measurement was taken. ' +
276
+ 'A baseline is recorded when the task is created (`send --contract`) and only while the ' +
277
+ `gate is switched on (currently: ${how}). Switch it on, then re-send the task.`);
278
+ }
279
+ /**
280
+ * Judge the machine against the task's baseline.
281
+ *
282
+ * `passed` requires every probe to have been compared and matched. `failed`
283
+ * means a violation was measured. `error` means no verdict could be reached —
284
+ * either there is no baseline or a probe would not answer — and it is
285
+ * deliberately not `skipped`: a skip reads as "there was nothing to judge",
286
+ * which is the sentence this gate must never say about an unmeasured machine.
287
+ */
288
+ async function evaluateEnvClean(input) {
289
+ const startedAt = Date.now();
290
+ const done = (status, logTail, exitCode) => ({
291
+ status,
292
+ exitCode,
293
+ startedAt,
294
+ durationMs: Date.now() - startedAt,
295
+ logTail,
296
+ });
297
+ if (!input.baseline) {
298
+ return done('error', envCleanNoBaseline(input.taskId, input.sources), null);
299
+ }
300
+ const capture = input.capture ?? (() => (0, env_snapshot_1.captureEnvSnapshot)({ worktreeId: input.worktreeId }));
301
+ let final;
302
+ try {
303
+ final = await capture();
304
+ }
305
+ catch (error) {
306
+ return done('error', `${verify_config_1.ENV_CLEAN_GATE_ID}: UNKNOWN — the current snapshot could not be taken: ` +
307
+ `${error instanceof Error ? error.message : String(error)}`, null);
308
+ }
309
+ const diff = diffEnvSnapshots(input.baseline, final, input);
310
+ const header = `${verify_config_1.ENV_CLEAN_GATE_ID}: baseline=${new Date(input.baseline.capturedAt).toISOString()} ` +
311
+ `status=${diff.status}`;
312
+ const report = `${header}\n${formatEnvCleanReport(diff)}`;
313
+ if (diff.status === 'clean')
314
+ return done('passed', report, 0);
315
+ if (diff.status === 'unknown') {
316
+ return done('error', `${report}\nUNKNOWN is not a pass: at least one probe could not be compared, so the ` +
317
+ 'environment was not measured.', null);
318
+ }
319
+ return done('failed', `${report}\n${exports.ENV_CLEAN_GUIDANCE}`, 1);
320
+ }