commandmate 0.21.4 → 0.22.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 (546) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-build-manifest.json +247 -240
  3. package/.next/app-path-routes-manifest.json +33 -32
  4. package/.next/build-manifest.json +2 -2
  5. package/.next/prerender-manifest.json +9 -9
  6. package/.next/required-server-files.json +1 -1
  7. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  8. package/.next/server/app/api/app/update/route_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 +1 -1
  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_client-reference-manifest.js +1 -1
  36. package/.next/server/app/api/daily-summary/status/route_client-reference-manifest.js +1 -1
  37. package/.next/server/app/api/external-apps/[id]/health/route_client-reference-manifest.js +1 -1
  38. package/.next/server/app/api/external-apps/[id]/route_client-reference-manifest.js +1 -1
  39. package/.next/server/app/api/external-apps/route_client-reference-manifest.js +1 -1
  40. package/.next/server/app/api/fs/browse/route.js +2 -2
  41. package/.next/server/app/api/fs/browse/route.js.nft.json +1 -1
  42. package/.next/server/app/api/fs/browse/route_client-reference-manifest.js +1 -1
  43. package/.next/server/app/api/fs/recent-paths/route_client-reference-manifest.js +1 -1
  44. package/.next/server/app/api/hooks/agent-event/route.js +1 -1
  45. package/.next/server/app/api/hooks/agent-event/route.js.nft.json +1 -1
  46. package/.next/server/app/api/hooks/agent-event/route_client-reference-manifest.js +1 -1
  47. package/.next/server/app/api/hooks/claude-done/route.js +1 -1
  48. package/.next/server/app/api/hooks/claude-done/route.js.nft.json +1 -1
  49. package/.next/server/app/api/hooks/claude-done/route_client-reference-manifest.js +1 -1
  50. package/.next/server/app/api/hooks/permission-request/route.js +1 -0
  51. package/.next/server/app/api/hooks/permission-request/route.js.nft.json +1 -0
  52. package/.next/server/app/api/hooks/permission-request/route_client-reference-manifest.js +1 -0
  53. package/.next/server/app/api/metrics/vibe/route_client-reference-manifest.js +1 -1
  54. package/.next/server/app/api/ollama/models/route_client-reference-manifest.js +1 -1
  55. package/.next/server/app/api/push/subscriptions/route_client-reference-manifest.js +1 -1
  56. package/.next/server/app/api/push/vapid/route.js +1 -1
  57. package/.next/server/app/api/push/vapid/route.js.nft.json +1 -1
  58. package/.next/server/app/api/push/vapid/route_client-reference-manifest.js +1 -1
  59. package/.next/server/app/api/repositories/[id]/route_client-reference-manifest.js +1 -1
  60. package/.next/server/app/api/repositories/[id]/todos/[todoId]/route_client-reference-manifest.js +1 -1
  61. package/.next/server/app/api/repositories/[id]/todos/route_client-reference-manifest.js +1 -1
  62. package/.next/server/app/api/repositories/clone/[jobId]/route.js +1 -1
  63. package/.next/server/app/api/repositories/clone/[jobId]/route.js.nft.json +1 -1
  64. package/.next/server/app/api/repositories/clone/[jobId]/route_client-reference-manifest.js +1 -1
  65. package/.next/server/app/api/repositories/clone/route.js +1 -1
  66. package/.next/server/app/api/repositories/clone/route.js.nft.json +1 -1
  67. package/.next/server/app/api/repositories/clone/route_client-reference-manifest.js +1 -1
  68. package/.next/server/app/api/repositories/excluded/route_client-reference-manifest.js +1 -1
  69. package/.next/server/app/api/repositories/restore/route.js +1 -1
  70. package/.next/server/app/api/repositories/restore/route.js.nft.json +1 -1
  71. package/.next/server/app/api/repositories/restore/route_client-reference-manifest.js +1 -1
  72. package/.next/server/app/api/repositories/route.js +1 -1
  73. package/.next/server/app/api/repositories/route.js.nft.json +1 -1
  74. package/.next/server/app/api/repositories/route_client-reference-manifest.js +1 -1
  75. package/.next/server/app/api/repositories/scan/route.js +1 -1
  76. package/.next/server/app/api/repositories/scan/route.js.nft.json +1 -1
  77. package/.next/server/app/api/repositories/scan/route_client-reference-manifest.js +1 -1
  78. package/.next/server/app/api/repositories/sync/route.js +1 -1
  79. package/.next/server/app/api/repositories/sync/route.js.nft.json +1 -1
  80. package/.next/server/app/api/repositories/sync/route_client-reference-manifest.js +1 -1
  81. package/.next/server/app/api/repositories/validate-path/route.js +1 -1
  82. package/.next/server/app/api/repositories/validate-path/route.js.nft.json +1 -1
  83. package/.next/server/app/api/repositories/validate-path/route_client-reference-manifest.js +1 -1
  84. package/.next/server/app/api/sidebar/group-order/route_client-reference-manifest.js +1 -1
  85. package/.next/server/app/api/skills/[id]/route_client-reference-manifest.js +1 -1
  86. package/.next/server/app/api/skills/installations/route_client-reference-manifest.js +1 -1
  87. package/.next/server/app/api/skills/operations/route_client-reference-manifest.js +1 -1
  88. package/.next/server/app/api/skills/reindex/route_client-reference-manifest.js +1 -1
  89. package/.next/server/app/api/skills/route_client-reference-manifest.js +1 -1
  90. package/.next/server/app/api/slash-commands/route_client-reference-manifest.js +1 -1
  91. package/.next/server/app/api/tasks/[taskId]/cancel/route_client-reference-manifest.js +1 -1
  92. package/.next/server/app/api/tasks/[taskId]/route_client-reference-manifest.js +1 -1
  93. package/.next/server/app/api/templates/[id]/route_client-reference-manifest.js +1 -1
  94. package/.next/server/app/api/templates/route_client-reference-manifest.js +1 -1
  95. package/.next/server/app/api/todos/route_client-reference-manifest.js +1 -1
  96. package/.next/server/app/api/verification/runs/[runId]/route_client-reference-manifest.js +1 -1
  97. package/.next/server/app/api/verification/runs/route_client-reference-manifest.js +1 -1
  98. package/.next/server/app/api/worktrees/[id]/auto-yes/route.js +1 -1
  99. package/.next/server/app/api/worktrees/[id]/auto-yes/route.js.nft.json +1 -1
  100. package/.next/server/app/api/worktrees/[id]/auto-yes/route_client-reference-manifest.js +1 -1
  101. package/.next/server/app/api/worktrees/[id]/capture/route.js +1 -1
  102. package/.next/server/app/api/worktrees/[id]/capture/route.js.nft.json +1 -1
  103. package/.next/server/app/api/worktrees/[id]/capture/route_client-reference-manifest.js +1 -1
  104. package/.next/server/app/api/worktrees/[id]/cli-tool/route_client-reference-manifest.js +1 -1
  105. package/.next/server/app/api/worktrees/[id]/cmate/schedules/route.js +1 -1
  106. package/.next/server/app/api/worktrees/[id]/cmate/schedules/route.js.nft.json +1 -1
  107. package/.next/server/app/api/worktrees/[id]/cmate/schedules/route_client-reference-manifest.js +1 -1
  108. package/.next/server/app/api/worktrees/[id]/current-output/route.js +1 -1
  109. package/.next/server/app/api/worktrees/[id]/current-output/route.js.nft.json +1 -1
  110. package/.next/server/app/api/worktrees/[id]/current-output/route_client-reference-manifest.js +1 -1
  111. package/.next/server/app/api/worktrees/[id]/execution-logs/[logId]/route_client-reference-manifest.js +1 -1
  112. package/.next/server/app/api/worktrees/[id]/execution-logs/route_client-reference-manifest.js +1 -1
  113. package/.next/server/app/api/worktrees/[id]/files/[...path]/route_client-reference-manifest.js +1 -1
  114. package/.next/server/app/api/worktrees/[id]/git/branch/create/route_client-reference-manifest.js +1 -1
  115. package/.next/server/app/api/worktrees/[id]/git/branch/delete/route_client-reference-manifest.js +1 -1
  116. package/.next/server/app/api/worktrees/[id]/git/branches/route_client-reference-manifest.js +1 -1
  117. package/.next/server/app/api/worktrees/[id]/git/checkout/route_client-reference-manifest.js +1 -1
  118. package/.next/server/app/api/worktrees/[id]/git/commit/route_client-reference-manifest.js +1 -1
  119. package/.next/server/app/api/worktrees/[id]/git/diff/route_client-reference-manifest.js +1 -1
  120. package/.next/server/app/api/worktrees/[id]/git/fetch/route_client-reference-manifest.js +1 -1
  121. package/.next/server/app/api/worktrees/[id]/git/log/route_client-reference-manifest.js +1 -1
  122. package/.next/server/app/api/worktrees/[id]/git/pull/route_client-reference-manifest.js +1 -1
  123. package/.next/server/app/api/worktrees/[id]/git/push/route_client-reference-manifest.js +1 -1
  124. package/.next/server/app/api/worktrees/[id]/git/reset/route_client-reference-manifest.js +1 -1
  125. package/.next/server/app/api/worktrees/[id]/git/revert/route_client-reference-manifest.js +1 -1
  126. package/.next/server/app/api/worktrees/[id]/git/show/[commitHash]/route_client-reference-manifest.js +1 -1
  127. package/.next/server/app/api/worktrees/[id]/git/stage/route_client-reference-manifest.js +1 -1
  128. package/.next/server/app/api/worktrees/[id]/git/staged/route_client-reference-manifest.js +1 -1
  129. package/.next/server/app/api/worktrees/[id]/git/stash/[index]/route_client-reference-manifest.js +1 -1
  130. package/.next/server/app/api/worktrees/[id]/git/stash/apply/route_client-reference-manifest.js +1 -1
  131. package/.next/server/app/api/worktrees/[id]/git/stash/pop/route_client-reference-manifest.js +1 -1
  132. package/.next/server/app/api/worktrees/[id]/git/stash/push/route_client-reference-manifest.js +1 -1
  133. package/.next/server/app/api/worktrees/[id]/git/stash/route_client-reference-manifest.js +1 -1
  134. package/.next/server/app/api/worktrees/[id]/git/status/route_client-reference-manifest.js +1 -1
  135. package/.next/server/app/api/worktrees/[id]/git/unstage/route_client-reference-manifest.js +1 -1
  136. package/.next/server/app/api/worktrees/[id]/git/working-diff/route_client-reference-manifest.js +1 -1
  137. package/.next/server/app/api/worktrees/[id]/interrupt/route.js +1 -1
  138. package/.next/server/app/api/worktrees/[id]/interrupt/route.js.nft.json +1 -1
  139. package/.next/server/app/api/worktrees/[id]/interrupt/route_client-reference-manifest.js +1 -1
  140. package/.next/server/app/api/worktrees/[id]/kill-session/route.js +1 -1
  141. package/.next/server/app/api/worktrees/[id]/kill-session/route.js.nft.json +1 -1
  142. package/.next/server/app/api/worktrees/[id]/kill-session/route_client-reference-manifest.js +1 -1
  143. package/.next/server/app/api/worktrees/[id]/logs/[filename]/route_client-reference-manifest.js +1 -1
  144. package/.next/server/app/api/worktrees/[id]/logs/route_client-reference-manifest.js +1 -1
  145. package/.next/server/app/api/worktrees/[id]/marp-render/route_client-reference-manifest.js +1 -1
  146. package/.next/server/app/api/worktrees/[id]/memos/[memoId]/route_client-reference-manifest.js +1 -1
  147. package/.next/server/app/api/worktrees/[id]/memos/route_client-reference-manifest.js +1 -1
  148. package/.next/server/app/api/worktrees/[id]/messages/route_client-reference-manifest.js +1 -1
  149. package/.next/server/app/api/worktrees/[id]/prompt-response/route.js +1 -1
  150. package/.next/server/app/api/worktrees/[id]/prompt-response/route.js.nft.json +1 -1
  151. package/.next/server/app/api/worktrees/[id]/prompt-response/route_client-reference-manifest.js +1 -1
  152. package/.next/server/app/api/worktrees/[id]/respond/route.js +1 -1
  153. package/.next/server/app/api/worktrees/[id]/respond/route.js.nft.json +1 -1
  154. package/.next/server/app/api/worktrees/[id]/respond/route_client-reference-manifest.js +1 -1
  155. package/.next/server/app/api/worktrees/[id]/route.js +1 -1
  156. package/.next/server/app/api/worktrees/[id]/route.js.nft.json +1 -1
  157. package/.next/server/app/api/worktrees/[id]/route_client-reference-manifest.js +1 -1
  158. package/.next/server/app/api/worktrees/[id]/schedules/[scheduleId]/route_client-reference-manifest.js +1 -1
  159. package/.next/server/app/api/worktrees/[id]/schedules/active/route.js +1 -1
  160. package/.next/server/app/api/worktrees/[id]/schedules/active/route.js.nft.json +1 -1
  161. package/.next/server/app/api/worktrees/[id]/schedules/active/route_client-reference-manifest.js +1 -1
  162. package/.next/server/app/api/worktrees/[id]/schedules/route_client-reference-manifest.js +1 -1
  163. package/.next/server/app/api/worktrees/[id]/search/route_client-reference-manifest.js +1 -1
  164. package/.next/server/app/api/worktrees/[id]/send/route.js +1 -1
  165. package/.next/server/app/api/worktrees/[id]/send/route.js.nft.json +1 -1
  166. package/.next/server/app/api/worktrees/[id]/send/route_client-reference-manifest.js +1 -1
  167. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route.js +1 -1
  168. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route.js.nft.json +1 -1
  169. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route_client-reference-manifest.js +1 -1
  170. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/install/route_client-reference-manifest.js +1 -1
  171. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/plan/route_client-reference-manifest.js +1 -1
  172. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall/route_client-reference-manifest.js +1 -1
  173. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall-plan/route_client-reference-manifest.js +1 -1
  174. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/update/route_client-reference-manifest.js +1 -1
  175. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/update-plan/route_client-reference-manifest.js +1 -1
  176. package/.next/server/app/api/worktrees/[id]/skills/route_client-reference-manifest.js +1 -1
  177. package/.next/server/app/api/worktrees/[id]/slash-commands/route_client-reference-manifest.js +1 -1
  178. package/.next/server/app/api/worktrees/[id]/special-keys/route.js +1 -1
  179. package/.next/server/app/api/worktrees/[id]/special-keys/route.js.nft.json +1 -1
  180. package/.next/server/app/api/worktrees/[id]/special-keys/route_client-reference-manifest.js +1 -1
  181. package/.next/server/app/api/worktrees/[id]/start-polling/route.js +1 -1
  182. package/.next/server/app/api/worktrees/[id]/start-polling/route.js.nft.json +1 -1
  183. package/.next/server/app/api/worktrees/[id]/start-polling/route_client-reference-manifest.js +1 -1
  184. package/.next/server/app/api/worktrees/[id]/tasks/route.js +2 -6
  185. package/.next/server/app/api/worktrees/[id]/tasks/route.js.nft.json +1 -1
  186. package/.next/server/app/api/worktrees/[id]/tasks/route_client-reference-manifest.js +1 -1
  187. package/.next/server/app/api/worktrees/[id]/terminal/route.js +1 -1
  188. package/.next/server/app/api/worktrees/[id]/terminal/route.js.nft.json +1 -1
  189. package/.next/server/app/api/worktrees/[id]/terminal/route_client-reference-manifest.js +1 -1
  190. package/.next/server/app/api/worktrees/[id]/timers/history/route_client-reference-manifest.js +1 -1
  191. package/.next/server/app/api/worktrees/[id]/timers/route.js +1 -1
  192. package/.next/server/app/api/worktrees/[id]/timers/route.js.nft.json +1 -1
  193. package/.next/server/app/api/worktrees/[id]/timers/route_client-reference-manifest.js +1 -1
  194. package/.next/server/app/api/worktrees/[id]/todos/[todoId]/route_client-reference-manifest.js +1 -1
  195. package/.next/server/app/api/worktrees/[id]/todos/route_client-reference-manifest.js +1 -1
  196. package/.next/server/app/api/worktrees/[id]/tree/[...path]/route_client-reference-manifest.js +1 -1
  197. package/.next/server/app/api/worktrees/[id]/tree/route_client-reference-manifest.js +1 -1
  198. package/.next/server/app/api/worktrees/[id]/upload/[...path]/route_client-reference-manifest.js +1 -1
  199. package/.next/server/app/api/worktrees/[id]/verify/route.js +1 -1
  200. package/.next/server/app/api/worktrees/[id]/verify/route.js.nft.json +1 -1
  201. package/.next/server/app/api/worktrees/[id]/verify/route_client-reference-manifest.js +1 -1
  202. package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/route_client-reference-manifest.js +1 -1
  203. package/.next/server/app/api/worktrees/[id]/verify/runs/route_client-reference-manifest.js +1 -1
  204. package/.next/server/app/api/worktrees/[id]/viewed/route_client-reference-manifest.js +1 -1
  205. package/.next/server/app/api/worktrees/route.js +1 -1
  206. package/.next/server/app/api/worktrees/route.js.nft.json +1 -1
  207. package/.next/server/app/api/worktrees/route_client-reference-manifest.js +1 -1
  208. package/.next/server/app/chat/page_client-reference-manifest.js +1 -1
  209. package/.next/server/app/login/page_client-reference-manifest.js +1 -1
  210. package/.next/server/app/manifest.webmanifest/route_client-reference-manifest.js +1 -1
  211. package/.next/server/app/more/page_client-reference-manifest.js +1 -1
  212. package/.next/server/app/offline/page_client-reference-manifest.js +1 -1
  213. package/.next/server/app/page_client-reference-manifest.js +1 -1
  214. package/.next/server/app/proxy/[...path]/route_client-reference-manifest.js +1 -1
  215. package/.next/server/app/repositories/page_client-reference-manifest.js +1 -1
  216. package/.next/server/app/review/page_client-reference-manifest.js +1 -1
  217. package/.next/server/app/sessions/page_client-reference-manifest.js +1 -1
  218. package/.next/server/app/skills/[skillId]/page_client-reference-manifest.js +1 -1
  219. package/.next/server/app/skills/installed/page_client-reference-manifest.js +1 -1
  220. package/.next/server/app/skills/page_client-reference-manifest.js +1 -1
  221. package/.next/server/app/worktrees/[id]/files/[...path]/page_client-reference-manifest.js +1 -1
  222. package/.next/server/app/worktrees/[id]/page.js +9 -9
  223. package/.next/server/app/worktrees/[id]/page_client-reference-manifest.js +1 -1
  224. package/.next/server/app/worktrees/[id]/terminal/page_client-reference-manifest.js +1 -1
  225. package/.next/server/app-paths-manifest.json +33 -32
  226. package/.next/server/chunks/1068.js +1 -1
  227. package/.next/server/chunks/1356.js +4 -0
  228. package/.next/server/chunks/1841.js +1 -0
  229. package/.next/server/chunks/2404.js +1 -1
  230. package/.next/server/chunks/2816.js +1 -1
  231. package/.next/server/chunks/3022.js +1 -0
  232. package/.next/server/chunks/3736.js +1 -1
  233. package/.next/server/chunks/5959.js +5 -4
  234. package/.next/server/chunks/6130.js +1 -1
  235. package/.next/server/chunks/6274.js +8 -12
  236. package/.next/server/chunks/6919.js +1 -0
  237. package/.next/server/chunks/7685.js +1 -1
  238. package/.next/server/chunks/8856.js +1 -1
  239. package/.next/server/chunks/9067.js +1 -1
  240. package/.next/server/chunks/9373.js +8 -0
  241. package/.next/server/chunks/9687.js +2 -2
  242. package/.next/server/middleware-manifest.json +5 -5
  243. package/.next/server/pages/500.html +1 -1
  244. package/.next/server/server-reference-manifest.json +1 -1
  245. package/.next/server/src/middleware.js.map +1 -1
  246. package/.next/static/b69eWhjC1rRrFTa-g3lMS/_buildManifest.js +1 -0
  247. package/.next/static/chunks/{6488-675c07e04e6e5a2e.js → 6488-2ad4f67779f8d00a.js} +1 -1
  248. package/.next/static/chunks/app/api/app/update/route-973ec48531555712.js +1 -0
  249. package/.next/static/chunks/app/api/app/update-check/route-973ec48531555712.js +1 -0
  250. package/.next/static/chunks/app/api/assistant/conversation/route-973ec48531555712.js +1 -0
  251. package/.next/static/chunks/app/api/assistant/current-output/route-973ec48531555712.js +1 -0
  252. package/.next/static/chunks/app/api/assistant/messages/route-973ec48531555712.js +1 -0
  253. package/.next/static/chunks/app/api/assistant/session/route-973ec48531555712.js +1 -0
  254. package/.next/static/chunks/app/api/assistant/start/route-973ec48531555712.js +1 -0
  255. package/.next/static/chunks/app/api/assistant/terminal/route-973ec48531555712.js +1 -0
  256. package/.next/static/chunks/app/api/assistant/tools/route-973ec48531555712.js +1 -0
  257. package/.next/static/chunks/app/api/auth/login/route-973ec48531555712.js +1 -0
  258. package/.next/static/chunks/app/api/auth/logout/route-973ec48531555712.js +1 -0
  259. package/.next/static/chunks/app/api/auth/status/route-973ec48531555712.js +1 -0
  260. package/.next/static/chunks/app/api/daily-summary/route-973ec48531555712.js +1 -0
  261. package/.next/static/chunks/app/api/daily-summary/status/route-973ec48531555712.js +1 -0
  262. package/.next/static/chunks/app/api/external-apps/[id]/health/route-973ec48531555712.js +1 -0
  263. package/.next/static/chunks/app/api/external-apps/[id]/route-973ec48531555712.js +1 -0
  264. package/.next/static/chunks/app/api/external-apps/route-973ec48531555712.js +1 -0
  265. package/.next/static/chunks/app/api/fs/browse/route-973ec48531555712.js +1 -0
  266. package/.next/static/chunks/app/api/fs/recent-paths/route-973ec48531555712.js +1 -0
  267. package/.next/static/chunks/app/api/hooks/agent-event/route-973ec48531555712.js +1 -0
  268. package/.next/static/chunks/app/api/hooks/claude-done/route-973ec48531555712.js +1 -0
  269. package/.next/static/chunks/app/api/hooks/permission-request/route-973ec48531555712.js +1 -0
  270. package/.next/static/chunks/app/api/metrics/vibe/route-973ec48531555712.js +1 -0
  271. package/.next/static/chunks/app/api/ollama/models/route-973ec48531555712.js +1 -0
  272. package/.next/static/chunks/app/api/push/subscriptions/route-973ec48531555712.js +1 -0
  273. package/.next/static/chunks/app/api/push/vapid/route-973ec48531555712.js +1 -0
  274. package/.next/static/chunks/app/api/repositories/[id]/route-973ec48531555712.js +1 -0
  275. package/.next/static/chunks/app/api/repositories/[id]/todos/[todoId]/route-973ec48531555712.js +1 -0
  276. package/.next/static/chunks/app/api/repositories/[id]/todos/route-973ec48531555712.js +1 -0
  277. package/.next/static/chunks/app/api/repositories/clone/[jobId]/route-973ec48531555712.js +1 -0
  278. package/.next/static/chunks/app/api/repositories/clone/route-973ec48531555712.js +1 -0
  279. package/.next/static/chunks/app/api/repositories/excluded/route-973ec48531555712.js +1 -0
  280. package/.next/static/chunks/app/api/repositories/restore/route-973ec48531555712.js +1 -0
  281. package/.next/static/chunks/app/api/repositories/route-973ec48531555712.js +1 -0
  282. package/.next/static/chunks/app/api/repositories/scan/route-973ec48531555712.js +1 -0
  283. package/.next/static/chunks/app/api/repositories/sync/route-973ec48531555712.js +1 -0
  284. package/.next/static/chunks/app/api/repositories/validate-path/route-973ec48531555712.js +1 -0
  285. package/.next/static/chunks/app/api/sidebar/group-order/route-973ec48531555712.js +1 -0
  286. package/.next/static/chunks/app/api/skills/[id]/route-973ec48531555712.js +1 -0
  287. package/.next/static/chunks/app/api/skills/installations/route-973ec48531555712.js +1 -0
  288. package/.next/static/chunks/app/api/skills/operations/route-973ec48531555712.js +1 -0
  289. package/.next/static/chunks/app/api/skills/reindex/route-973ec48531555712.js +1 -0
  290. package/.next/static/chunks/app/api/skills/route-973ec48531555712.js +1 -0
  291. package/.next/static/chunks/app/api/slash-commands/route-973ec48531555712.js +1 -0
  292. package/.next/static/chunks/app/api/tasks/[taskId]/cancel/route-973ec48531555712.js +1 -0
  293. package/.next/static/chunks/app/api/tasks/[taskId]/route-973ec48531555712.js +1 -0
  294. package/.next/static/chunks/app/api/templates/[id]/route-973ec48531555712.js +1 -0
  295. package/.next/static/chunks/app/api/templates/route-973ec48531555712.js +1 -0
  296. package/.next/static/chunks/app/api/todos/route-973ec48531555712.js +1 -0
  297. package/.next/static/chunks/app/api/verification/runs/[runId]/route-973ec48531555712.js +1 -0
  298. package/.next/static/chunks/app/api/verification/runs/route-973ec48531555712.js +1 -0
  299. package/.next/static/chunks/app/api/worktrees/[id]/auto-yes/route-973ec48531555712.js +1 -0
  300. package/.next/static/chunks/app/api/worktrees/[id]/capture/route-973ec48531555712.js +1 -0
  301. package/.next/static/chunks/app/api/worktrees/[id]/cli-tool/route-973ec48531555712.js +1 -0
  302. package/.next/static/chunks/app/api/worktrees/[id]/cmate/schedules/route-973ec48531555712.js +1 -0
  303. package/.next/static/chunks/app/api/worktrees/[id]/current-output/route-973ec48531555712.js +1 -0
  304. package/.next/static/chunks/app/api/worktrees/[id]/execution-logs/[logId]/route-973ec48531555712.js +1 -0
  305. package/.next/static/chunks/app/api/worktrees/[id]/execution-logs/route-973ec48531555712.js +1 -0
  306. package/.next/static/chunks/app/api/worktrees/[id]/files/[...path]/route-973ec48531555712.js +1 -0
  307. package/.next/static/chunks/app/api/worktrees/[id]/git/branch/create/route-973ec48531555712.js +1 -0
  308. package/.next/static/chunks/app/api/worktrees/[id]/git/branch/delete/route-973ec48531555712.js +1 -0
  309. package/.next/static/chunks/app/api/worktrees/[id]/git/branches/route-973ec48531555712.js +1 -0
  310. package/.next/static/chunks/app/api/worktrees/[id]/git/checkout/route-973ec48531555712.js +1 -0
  311. package/.next/static/chunks/app/api/worktrees/[id]/git/commit/route-973ec48531555712.js +1 -0
  312. package/.next/static/chunks/app/api/worktrees/[id]/git/diff/route-973ec48531555712.js +1 -0
  313. package/.next/static/chunks/app/api/worktrees/[id]/git/fetch/route-973ec48531555712.js +1 -0
  314. package/.next/static/chunks/app/api/worktrees/[id]/git/log/route-973ec48531555712.js +1 -0
  315. package/.next/static/chunks/app/api/worktrees/[id]/git/pull/route-973ec48531555712.js +1 -0
  316. package/.next/static/chunks/app/api/worktrees/[id]/git/push/route-973ec48531555712.js +1 -0
  317. package/.next/static/chunks/app/api/worktrees/[id]/git/reset/route-973ec48531555712.js +1 -0
  318. package/.next/static/chunks/app/api/worktrees/[id]/git/revert/route-973ec48531555712.js +1 -0
  319. package/.next/static/chunks/app/api/worktrees/[id]/git/show/[commitHash]/route-973ec48531555712.js +1 -0
  320. package/.next/static/chunks/app/api/worktrees/[id]/git/stage/route-973ec48531555712.js +1 -0
  321. package/.next/static/chunks/app/api/worktrees/[id]/git/staged/route-973ec48531555712.js +1 -0
  322. package/.next/static/chunks/app/api/worktrees/[id]/git/stash/[index]/route-973ec48531555712.js +1 -0
  323. package/.next/static/chunks/app/api/worktrees/[id]/git/stash/apply/route-973ec48531555712.js +1 -0
  324. package/.next/static/chunks/app/api/worktrees/[id]/git/stash/pop/route-973ec48531555712.js +1 -0
  325. package/.next/static/chunks/app/api/worktrees/[id]/git/stash/push/route-973ec48531555712.js +1 -0
  326. package/.next/static/chunks/app/api/worktrees/[id]/git/stash/route-973ec48531555712.js +1 -0
  327. package/.next/static/chunks/app/api/worktrees/[id]/git/status/route-973ec48531555712.js +1 -0
  328. package/.next/static/chunks/app/api/worktrees/[id]/git/unstage/route-973ec48531555712.js +1 -0
  329. package/.next/static/chunks/app/api/worktrees/[id]/git/working-diff/route-973ec48531555712.js +1 -0
  330. package/.next/static/chunks/app/api/worktrees/[id]/interrupt/route-973ec48531555712.js +1 -0
  331. package/.next/static/chunks/app/api/worktrees/[id]/kill-session/route-973ec48531555712.js +1 -0
  332. package/.next/static/chunks/app/api/worktrees/[id]/logs/[filename]/route-973ec48531555712.js +1 -0
  333. package/.next/static/chunks/app/api/worktrees/[id]/logs/route-973ec48531555712.js +1 -0
  334. package/.next/static/chunks/app/api/worktrees/[id]/marp-render/route-973ec48531555712.js +1 -0
  335. package/.next/static/chunks/app/api/worktrees/[id]/memos/[memoId]/route-973ec48531555712.js +1 -0
  336. package/.next/static/chunks/app/api/worktrees/[id]/memos/route-973ec48531555712.js +1 -0
  337. package/.next/static/chunks/app/api/worktrees/[id]/messages/route-973ec48531555712.js +1 -0
  338. package/.next/static/chunks/app/api/worktrees/[id]/prompt-response/route-973ec48531555712.js +1 -0
  339. package/.next/static/chunks/app/api/worktrees/[id]/respond/route-973ec48531555712.js +1 -0
  340. package/.next/static/chunks/app/api/worktrees/[id]/route-973ec48531555712.js +1 -0
  341. package/.next/static/chunks/app/api/worktrees/[id]/schedules/[scheduleId]/route-973ec48531555712.js +1 -0
  342. package/.next/static/chunks/app/api/worktrees/[id]/schedules/active/route-973ec48531555712.js +1 -0
  343. package/.next/static/chunks/app/api/worktrees/[id]/schedules/route-973ec48531555712.js +1 -0
  344. package/.next/static/chunks/app/api/worktrees/[id]/search/route-973ec48531555712.js +1 -0
  345. package/.next/static/chunks/app/api/worktrees/[id]/send/route-973ec48531555712.js +1 -0
  346. package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route-973ec48531555712.js +1 -0
  347. package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/install/route-973ec48531555712.js +1 -0
  348. package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/plan/route-973ec48531555712.js +1 -0
  349. package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/uninstall/route-973ec48531555712.js +1 -0
  350. package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/uninstall-plan/route-973ec48531555712.js +1 -0
  351. package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/update/route-973ec48531555712.js +1 -0
  352. package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/update-plan/route-973ec48531555712.js +1 -0
  353. package/.next/static/chunks/app/api/worktrees/[id]/skills/route-973ec48531555712.js +1 -0
  354. package/.next/static/chunks/app/api/worktrees/[id]/slash-commands/route-973ec48531555712.js +1 -0
  355. package/.next/static/chunks/app/api/worktrees/[id]/special-keys/route-973ec48531555712.js +1 -0
  356. package/.next/static/chunks/app/api/worktrees/[id]/start-polling/route-973ec48531555712.js +1 -0
  357. package/.next/static/chunks/app/api/worktrees/[id]/tasks/route-973ec48531555712.js +1 -0
  358. package/.next/static/chunks/app/api/worktrees/[id]/terminal/route-973ec48531555712.js +1 -0
  359. package/.next/static/chunks/app/api/worktrees/[id]/timers/history/route-973ec48531555712.js +1 -0
  360. package/.next/static/chunks/app/api/worktrees/[id]/timers/route-973ec48531555712.js +1 -0
  361. package/.next/static/chunks/app/api/worktrees/[id]/todos/[todoId]/route-973ec48531555712.js +1 -0
  362. package/.next/static/chunks/app/api/worktrees/[id]/todos/route-973ec48531555712.js +1 -0
  363. package/.next/static/chunks/app/api/worktrees/[id]/tree/[...path]/route-973ec48531555712.js +1 -0
  364. package/.next/static/chunks/app/api/worktrees/[id]/tree/route-973ec48531555712.js +1 -0
  365. package/.next/static/chunks/app/api/worktrees/[id]/upload/[...path]/route-973ec48531555712.js +1 -0
  366. package/.next/static/chunks/app/api/worktrees/[id]/verify/route-973ec48531555712.js +1 -0
  367. package/.next/static/chunks/app/api/worktrees/[id]/verify/runs/[runId]/route-973ec48531555712.js +1 -0
  368. package/.next/static/chunks/app/api/worktrees/[id]/verify/runs/route-973ec48531555712.js +1 -0
  369. package/.next/static/chunks/app/api/worktrees/[id]/viewed/route-973ec48531555712.js +1 -0
  370. package/.next/static/chunks/app/api/worktrees/route-973ec48531555712.js +1 -0
  371. package/.next/static/chunks/app/manifest.webmanifest/route-973ec48531555712.js +1 -0
  372. package/.next/static/chunks/app/proxy/[...path]/route-973ec48531555712.js +1 -0
  373. package/.next/static/chunks/app/worktrees/[id]/layout-973ec48531555712.js +1 -0
  374. package/.next/static/chunks/app/worktrees/[id]/page-70704fe257e0cccc.js +1 -0
  375. package/.next/trace +12 -12
  376. package/.next/types/app/api/hooks/permission-request/route.ts +347 -0
  377. package/.next/types/routes.d.ts +2 -1
  378. package/.next/types/validator.ts +9 -0
  379. package/dist/cli/commands/capture.d.ts.map +1 -1
  380. package/dist/cli/commands/capture.js +27 -1
  381. package/dist/cli/commands/respond.d.ts.map +1 -1
  382. package/dist/cli/commands/respond.js +9 -3
  383. package/dist/cli/commands/send.d.ts.map +1 -1
  384. package/dist/cli/commands/send.js +35 -0
  385. package/dist/cli/commands/wait.d.ts +4 -1
  386. package/dist/cli/commands/wait.d.ts.map +1 -1
  387. package/dist/cli/commands/wait.js +109 -2
  388. package/dist/cli/docs/agent-operations.d.ts +1 -1
  389. package/dist/cli/docs/agent-operations.d.ts.map +1 -1
  390. package/dist/cli/docs/agent-operations.js +39 -0
  391. package/dist/cli/types/api-responses.d.ts +69 -4
  392. package/dist/cli/types/api-responses.d.ts.map +1 -1
  393. package/dist/cli/types/index.d.ts +6 -0
  394. package/dist/cli/types/index.d.ts.map +1 -1
  395. package/dist/server/src/lib/detection/prompt-detect-multiple-choice.js +105 -1
  396. package/dist/server/src/lib/detection/unclassified-frame-tracker.js +96 -0
  397. package/dist/server/src/lib/env.js +27 -1
  398. package/dist/server/src/lib/hooks/agent-event-types.js +131 -0
  399. package/dist/server/src/lib/hooks/ask-user-question-payload.js +156 -0
  400. package/dist/server/src/lib/hooks/hook-settings-generator.js +411 -0
  401. package/dist/server/src/lib/hooks/permission-request-payload.js +144 -0
  402. package/dist/server/src/lib/polling/auto-yes-resolver.js +25 -10
  403. package/dist/server/src/lib/polling/auto-yes-suppression-state.js +2 -1
  404. package/dist/server/src/lib/session/agent-event-state.js +612 -11
  405. package/dist/server/src/lib/session/ask-user-question-prompt.js +295 -0
  406. package/dist/server/src/lib/session/claude-session.js +41 -2
  407. package/dist/server/src/lib/session/current-output-builder.js +375 -8
  408. package/dist/server/src/lib/session/prompt-waiting-composition.js +178 -0
  409. package/dist/server/src/lib/session/prompt-waiting-guard.js +147 -0
  410. package/dist/server/src/lib/session/send-user-message.js +35 -0
  411. package/dist/server/src/lib/session/status-mapping.js +121 -0
  412. package/dist/server/src/lib/session/structured-prompt.js +109 -0
  413. package/dist/server/src/types/models.js +30 -0
  414. package/package.json +3 -2
  415. package/scripts/hooks/cmate-agent-event.sh +44 -3
  416. package/.next/server/chunks/1355.js +0 -1
  417. package/.next/server/chunks/1598.js +0 -4
  418. package/.next/server/chunks/2366.js +0 -1
  419. package/.next/static/Yr3HhIDgtWJeOPqvqxsug/_buildManifest.js +0 -1
  420. package/.next/static/chunks/app/api/app/update/route-be21650964d61b1d.js +0 -1
  421. package/.next/static/chunks/app/api/app/update-check/route-be21650964d61b1d.js +0 -1
  422. package/.next/static/chunks/app/api/assistant/conversation/route-be21650964d61b1d.js +0 -1
  423. package/.next/static/chunks/app/api/assistant/current-output/route-be21650964d61b1d.js +0 -1
  424. package/.next/static/chunks/app/api/assistant/messages/route-be21650964d61b1d.js +0 -1
  425. package/.next/static/chunks/app/api/assistant/session/route-be21650964d61b1d.js +0 -1
  426. package/.next/static/chunks/app/api/assistant/start/route-be21650964d61b1d.js +0 -1
  427. package/.next/static/chunks/app/api/assistant/terminal/route-be21650964d61b1d.js +0 -1
  428. package/.next/static/chunks/app/api/assistant/tools/route-be21650964d61b1d.js +0 -1
  429. package/.next/static/chunks/app/api/auth/login/route-be21650964d61b1d.js +0 -1
  430. package/.next/static/chunks/app/api/auth/logout/route-be21650964d61b1d.js +0 -1
  431. package/.next/static/chunks/app/api/auth/status/route-be21650964d61b1d.js +0 -1
  432. package/.next/static/chunks/app/api/daily-summary/route-be21650964d61b1d.js +0 -1
  433. package/.next/static/chunks/app/api/daily-summary/status/route-be21650964d61b1d.js +0 -1
  434. package/.next/static/chunks/app/api/external-apps/[id]/health/route-be21650964d61b1d.js +0 -1
  435. package/.next/static/chunks/app/api/external-apps/[id]/route-be21650964d61b1d.js +0 -1
  436. package/.next/static/chunks/app/api/external-apps/route-be21650964d61b1d.js +0 -1
  437. package/.next/static/chunks/app/api/fs/browse/route-be21650964d61b1d.js +0 -1
  438. package/.next/static/chunks/app/api/fs/recent-paths/route-be21650964d61b1d.js +0 -1
  439. package/.next/static/chunks/app/api/hooks/agent-event/route-be21650964d61b1d.js +0 -1
  440. package/.next/static/chunks/app/api/hooks/claude-done/route-be21650964d61b1d.js +0 -1
  441. package/.next/static/chunks/app/api/metrics/vibe/route-be21650964d61b1d.js +0 -1
  442. package/.next/static/chunks/app/api/ollama/models/route-be21650964d61b1d.js +0 -1
  443. package/.next/static/chunks/app/api/push/subscriptions/route-be21650964d61b1d.js +0 -1
  444. package/.next/static/chunks/app/api/push/vapid/route-be21650964d61b1d.js +0 -1
  445. package/.next/static/chunks/app/api/repositories/[id]/route-be21650964d61b1d.js +0 -1
  446. package/.next/static/chunks/app/api/repositories/[id]/todos/[todoId]/route-be21650964d61b1d.js +0 -1
  447. package/.next/static/chunks/app/api/repositories/[id]/todos/route-be21650964d61b1d.js +0 -1
  448. package/.next/static/chunks/app/api/repositories/clone/[jobId]/route-be21650964d61b1d.js +0 -1
  449. package/.next/static/chunks/app/api/repositories/clone/route-be21650964d61b1d.js +0 -1
  450. package/.next/static/chunks/app/api/repositories/excluded/route-be21650964d61b1d.js +0 -1
  451. package/.next/static/chunks/app/api/repositories/restore/route-be21650964d61b1d.js +0 -1
  452. package/.next/static/chunks/app/api/repositories/route-be21650964d61b1d.js +0 -1
  453. package/.next/static/chunks/app/api/repositories/scan/route-be21650964d61b1d.js +0 -1
  454. package/.next/static/chunks/app/api/repositories/sync/route-be21650964d61b1d.js +0 -1
  455. package/.next/static/chunks/app/api/repositories/validate-path/route-be21650964d61b1d.js +0 -1
  456. package/.next/static/chunks/app/api/sidebar/group-order/route-be21650964d61b1d.js +0 -1
  457. package/.next/static/chunks/app/api/skills/[id]/route-be21650964d61b1d.js +0 -1
  458. package/.next/static/chunks/app/api/skills/installations/route-be21650964d61b1d.js +0 -1
  459. package/.next/static/chunks/app/api/skills/operations/route-be21650964d61b1d.js +0 -1
  460. package/.next/static/chunks/app/api/skills/reindex/route-be21650964d61b1d.js +0 -1
  461. package/.next/static/chunks/app/api/skills/route-be21650964d61b1d.js +0 -1
  462. package/.next/static/chunks/app/api/slash-commands/route-be21650964d61b1d.js +0 -1
  463. package/.next/static/chunks/app/api/tasks/[taskId]/cancel/route-be21650964d61b1d.js +0 -1
  464. package/.next/static/chunks/app/api/tasks/[taskId]/route-be21650964d61b1d.js +0 -1
  465. package/.next/static/chunks/app/api/templates/[id]/route-be21650964d61b1d.js +0 -1
  466. package/.next/static/chunks/app/api/templates/route-be21650964d61b1d.js +0 -1
  467. package/.next/static/chunks/app/api/todos/route-be21650964d61b1d.js +0 -1
  468. package/.next/static/chunks/app/api/verification/runs/[runId]/route-be21650964d61b1d.js +0 -1
  469. package/.next/static/chunks/app/api/verification/runs/route-be21650964d61b1d.js +0 -1
  470. package/.next/static/chunks/app/api/worktrees/[id]/auto-yes/route-be21650964d61b1d.js +0 -1
  471. package/.next/static/chunks/app/api/worktrees/[id]/capture/route-be21650964d61b1d.js +0 -1
  472. package/.next/static/chunks/app/api/worktrees/[id]/cli-tool/route-be21650964d61b1d.js +0 -1
  473. package/.next/static/chunks/app/api/worktrees/[id]/cmate/schedules/route-be21650964d61b1d.js +0 -1
  474. package/.next/static/chunks/app/api/worktrees/[id]/current-output/route-be21650964d61b1d.js +0 -1
  475. package/.next/static/chunks/app/api/worktrees/[id]/execution-logs/[logId]/route-be21650964d61b1d.js +0 -1
  476. package/.next/static/chunks/app/api/worktrees/[id]/execution-logs/route-be21650964d61b1d.js +0 -1
  477. package/.next/static/chunks/app/api/worktrees/[id]/files/[...path]/route-be21650964d61b1d.js +0 -1
  478. package/.next/static/chunks/app/api/worktrees/[id]/git/branch/create/route-be21650964d61b1d.js +0 -1
  479. package/.next/static/chunks/app/api/worktrees/[id]/git/branch/delete/route-be21650964d61b1d.js +0 -1
  480. package/.next/static/chunks/app/api/worktrees/[id]/git/branches/route-be21650964d61b1d.js +0 -1
  481. package/.next/static/chunks/app/api/worktrees/[id]/git/checkout/route-be21650964d61b1d.js +0 -1
  482. package/.next/static/chunks/app/api/worktrees/[id]/git/commit/route-be21650964d61b1d.js +0 -1
  483. package/.next/static/chunks/app/api/worktrees/[id]/git/diff/route-be21650964d61b1d.js +0 -1
  484. package/.next/static/chunks/app/api/worktrees/[id]/git/fetch/route-be21650964d61b1d.js +0 -1
  485. package/.next/static/chunks/app/api/worktrees/[id]/git/log/route-be21650964d61b1d.js +0 -1
  486. package/.next/static/chunks/app/api/worktrees/[id]/git/pull/route-be21650964d61b1d.js +0 -1
  487. package/.next/static/chunks/app/api/worktrees/[id]/git/push/route-be21650964d61b1d.js +0 -1
  488. package/.next/static/chunks/app/api/worktrees/[id]/git/reset/route-be21650964d61b1d.js +0 -1
  489. package/.next/static/chunks/app/api/worktrees/[id]/git/revert/route-be21650964d61b1d.js +0 -1
  490. package/.next/static/chunks/app/api/worktrees/[id]/git/show/[commitHash]/route-be21650964d61b1d.js +0 -1
  491. package/.next/static/chunks/app/api/worktrees/[id]/git/stage/route-be21650964d61b1d.js +0 -1
  492. package/.next/static/chunks/app/api/worktrees/[id]/git/staged/route-be21650964d61b1d.js +0 -1
  493. package/.next/static/chunks/app/api/worktrees/[id]/git/stash/[index]/route-be21650964d61b1d.js +0 -1
  494. package/.next/static/chunks/app/api/worktrees/[id]/git/stash/apply/route-be21650964d61b1d.js +0 -1
  495. package/.next/static/chunks/app/api/worktrees/[id]/git/stash/pop/route-be21650964d61b1d.js +0 -1
  496. package/.next/static/chunks/app/api/worktrees/[id]/git/stash/push/route-be21650964d61b1d.js +0 -1
  497. package/.next/static/chunks/app/api/worktrees/[id]/git/stash/route-be21650964d61b1d.js +0 -1
  498. package/.next/static/chunks/app/api/worktrees/[id]/git/status/route-be21650964d61b1d.js +0 -1
  499. package/.next/static/chunks/app/api/worktrees/[id]/git/unstage/route-be21650964d61b1d.js +0 -1
  500. package/.next/static/chunks/app/api/worktrees/[id]/git/working-diff/route-be21650964d61b1d.js +0 -1
  501. package/.next/static/chunks/app/api/worktrees/[id]/interrupt/route-be21650964d61b1d.js +0 -1
  502. package/.next/static/chunks/app/api/worktrees/[id]/kill-session/route-be21650964d61b1d.js +0 -1
  503. package/.next/static/chunks/app/api/worktrees/[id]/logs/[filename]/route-be21650964d61b1d.js +0 -1
  504. package/.next/static/chunks/app/api/worktrees/[id]/logs/route-be21650964d61b1d.js +0 -1
  505. package/.next/static/chunks/app/api/worktrees/[id]/marp-render/route-be21650964d61b1d.js +0 -1
  506. package/.next/static/chunks/app/api/worktrees/[id]/memos/[memoId]/route-be21650964d61b1d.js +0 -1
  507. package/.next/static/chunks/app/api/worktrees/[id]/memos/route-be21650964d61b1d.js +0 -1
  508. package/.next/static/chunks/app/api/worktrees/[id]/messages/route-be21650964d61b1d.js +0 -1
  509. package/.next/static/chunks/app/api/worktrees/[id]/prompt-response/route-be21650964d61b1d.js +0 -1
  510. package/.next/static/chunks/app/api/worktrees/[id]/respond/route-be21650964d61b1d.js +0 -1
  511. package/.next/static/chunks/app/api/worktrees/[id]/route-be21650964d61b1d.js +0 -1
  512. package/.next/static/chunks/app/api/worktrees/[id]/schedules/[scheduleId]/route-be21650964d61b1d.js +0 -1
  513. package/.next/static/chunks/app/api/worktrees/[id]/schedules/active/route-be21650964d61b1d.js +0 -1
  514. package/.next/static/chunks/app/api/worktrees/[id]/schedules/route-be21650964d61b1d.js +0 -1
  515. package/.next/static/chunks/app/api/worktrees/[id]/search/route-be21650964d61b1d.js +0 -1
  516. package/.next/static/chunks/app/api/worktrees/[id]/send/route-be21650964d61b1d.js +0 -1
  517. package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route-be21650964d61b1d.js +0 -1
  518. package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/install/route-be21650964d61b1d.js +0 -1
  519. package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/plan/route-be21650964d61b1d.js +0 -1
  520. package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/uninstall/route-be21650964d61b1d.js +0 -1
  521. package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/uninstall-plan/route-be21650964d61b1d.js +0 -1
  522. package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/update/route-be21650964d61b1d.js +0 -1
  523. package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/update-plan/route-be21650964d61b1d.js +0 -1
  524. package/.next/static/chunks/app/api/worktrees/[id]/skills/route-be21650964d61b1d.js +0 -1
  525. package/.next/static/chunks/app/api/worktrees/[id]/slash-commands/route-be21650964d61b1d.js +0 -1
  526. package/.next/static/chunks/app/api/worktrees/[id]/special-keys/route-be21650964d61b1d.js +0 -1
  527. package/.next/static/chunks/app/api/worktrees/[id]/start-polling/route-be21650964d61b1d.js +0 -1
  528. package/.next/static/chunks/app/api/worktrees/[id]/tasks/route-be21650964d61b1d.js +0 -1
  529. package/.next/static/chunks/app/api/worktrees/[id]/terminal/route-be21650964d61b1d.js +0 -1
  530. package/.next/static/chunks/app/api/worktrees/[id]/timers/history/route-be21650964d61b1d.js +0 -1
  531. package/.next/static/chunks/app/api/worktrees/[id]/timers/route-be21650964d61b1d.js +0 -1
  532. package/.next/static/chunks/app/api/worktrees/[id]/todos/[todoId]/route-be21650964d61b1d.js +0 -1
  533. package/.next/static/chunks/app/api/worktrees/[id]/todos/route-be21650964d61b1d.js +0 -1
  534. package/.next/static/chunks/app/api/worktrees/[id]/tree/[...path]/route-be21650964d61b1d.js +0 -1
  535. package/.next/static/chunks/app/api/worktrees/[id]/tree/route-be21650964d61b1d.js +0 -1
  536. package/.next/static/chunks/app/api/worktrees/[id]/upload/[...path]/route-be21650964d61b1d.js +0 -1
  537. package/.next/static/chunks/app/api/worktrees/[id]/verify/route-be21650964d61b1d.js +0 -1
  538. package/.next/static/chunks/app/api/worktrees/[id]/verify/runs/[runId]/route-be21650964d61b1d.js +0 -1
  539. package/.next/static/chunks/app/api/worktrees/[id]/verify/runs/route-be21650964d61b1d.js +0 -1
  540. package/.next/static/chunks/app/api/worktrees/[id]/viewed/route-be21650964d61b1d.js +0 -1
  541. package/.next/static/chunks/app/api/worktrees/route-be21650964d61b1d.js +0 -1
  542. package/.next/static/chunks/app/manifest.webmanifest/route-be21650964d61b1d.js +0 -1
  543. package/.next/static/chunks/app/proxy/[...path]/route-be21650964d61b1d.js +0 -1
  544. package/.next/static/chunks/app/worktrees/[id]/layout-be21650964d61b1d.js +0 -1
  545. package/.next/static/chunks/app/worktrees/[id]/page-9f78fcce8ee9fe00.js +0 -1
  546. /package/.next/static/{Yr3HhIDgtWJeOPqvqxsug → b69eWhjC1rRrFTa-g3lMS}/_ssgManifest.js +0 -0
@@ -1,29 +1,103 @@
1
1
  "use strict";
2
2
  /**
3
- * In-memory record of the last structured "the agent stopped" event (#1549).
3
+ * In-memory record of the structured lifecycle events an agent has reported,
4
+ * and the session status they imply (#1549, #1722, promoted in #1723, extended
5
+ * with the open-dialog state machine in #1725).
4
6
  *
5
- * The agent CLI telling us it stopped is a different kind of fact from the
6
- * screen-scraped status: it is exact, but it only exists when someone wired a
7
- * hook up. So this is kept beside the detector's output rather than folded into
8
- * it `buildCurrentOutput` exposes the timestamp, and nothing in the completion
9
- * decision reads it yet. Phase 3-2 is deliberately observation only; swapping
10
- * the wait/poller verdict from string matching to hook events before there is
11
- * field data on how often hooks actually fire would trade a known failure mode
12
- * for an unknown one.
7
+ * The agent CLI telling us what it did is a different kind of fact from the
8
+ * screen-scraped status: it is exact, but it only exists where hooks actually
9
+ * fire. #1549 and #1722 therefore kept it strictly beside the detector's
10
+ * output. #1723 promotes it to a first-class source {@link
11
+ * getStructuredSessionState} answers with a `SessionStatus`, and
12
+ * `current-output-builder` prefers that answer to the scraper's while
13
+ * `detectSessionStatus()` stays a pure function of the terminal frame and stays
14
+ * in charge wherever no event has arrived.
15
+ *
16
+ * Three things bound how far that trust extends, because a hook is an
17
+ * unreliable channel by design (every failure is fail-open):
18
+ *
19
+ * - **generation** — events are keyed by (worktree, tool, instance), a key a
20
+ * recreated session reuses, so a generation marker fences off the previous
21
+ * process's events. See {@link beginAgentEventGeneration}.
22
+ * - **age** — see {@link STRUCTURED_STATE_MAX_AGE_MS}, which bounds the damage
23
+ * of a `Stop` that never arrived.
24
+ * - **liveness** — a dead tmux session has no structured state; the caller
25
+ * establishes that before asking.
26
+ *
27
+ * #1725 adds a second, independent state alongside the status verdict: whether
28
+ * a dialog is open. It is separate because it is released by different things —
29
+ * there is no "the human answered" event, so the scraper has to be part of the
30
+ * rule — and because `lastAgentEvent` holds only the newest event, which cannot
31
+ * express "a dialog is still up" once anything else has arrived. See
32
+ * {@link getStructuredPromptWaiting}.
13
33
  *
14
34
  * In-memory and not in SQLite for the same reason `auto-yes-state` is: the value
15
35
  * describes a live tmux session, and a session does not survive a server restart
16
- * for the timestamp to still be about.
36
+ * for the timestamp to still be about. Losing it on restart is safe precisely
37
+ * because the scraper is still there to answer.
17
38
  *
18
39
  * @module lib/session/agent-event-state
19
40
  */
20
41
  Object.defineProperty(exports, "__esModule", { value: true });
42
+ exports.STRUCTURED_PROMPT_PROVISIONAL_MAX_AGE_MS = exports.STRUCTURED_STATE_MAX_AGE_MS = exports.AGENT_EVENT_DEDUP_WINDOW_MS = void 0;
21
43
  exports.recordAgentStopEvent = recordAgentStopEvent;
22
44
  exports.getLastStopEventAt = getLastStopEventAt;
45
+ exports.recordAgentEvent = recordAgentEvent;
46
+ exports.getLastAgentEvent = getLastAgentEvent;
47
+ exports.beginAgentEventGeneration = beginAgentEventGeneration;
48
+ exports.getAgentEventGenerationStartedAt = getAgentEventGenerationStartedAt;
49
+ exports.discardAgentEventState = discardAgentEventState;
50
+ exports.getStructuredSessionState = getStructuredSessionState;
51
+ exports.reportPermissionRequestPending = reportPermissionRequestPending;
52
+ exports.getStructuredPromptWaiting = getStructuredPromptWaiting;
53
+ exports.corroborateStructuredPromptWaiting = corroborateStructuredPromptWaiting;
54
+ exports.markStructuredPromptRecorded = markStructuredPromptRecorded;
55
+ exports.clearStructuredPromptWaiting = clearStructuredPromptWaiting;
56
+ exports.recordAskUserQuestion = recordAskUserQuestion;
57
+ exports.getAskUserQuestion = getAskUserQuestion;
58
+ exports.clearAskUserQuestion = clearAskUserQuestion;
59
+ exports.isDuplicateAgentEvent = isDuplicateAgentEvent;
60
+ exports.getRecentEventKeyCount = getRecentEventKeyCount;
23
61
  exports.clearAgentStopEvents = clearAgentStopEvents;
24
62
  const auto_yes_state_1 = require("../../lib/auto-yes-state");
63
+ const permission_request_payload_1 = require("../../lib/hooks/permission-request-payload");
64
+ const status_mapping_1 = require("../../lib/session/status-mapping");
65
+ const structured_prompt_1 = require("../../lib/session/structured-prompt");
25
66
  /** compositeKey -> epoch ms of the most recent stop event. */
26
- const lastStopEventAt = new Map();
67
+ const lastStopEventAt = globalThis.__agentEventLastStopAt ??
68
+ (globalThis.__agentEventLastStopAt = new Map());
69
+ /** compositeKey -> the most recent event of any kind. */
70
+ const lastAgentEvent = globalThis.__agentEventLast ??
71
+ (globalThis.__agentEventLast = new Map());
72
+ /** compositeKey -> epoch ms the current generation began. See {@link beginAgentEventGeneration}. */
73
+ const generationStartedAt = globalThis.__agentEventGenerationStartedAt ??
74
+ (globalThis.__agentEventGenerationStartedAt = new Map());
75
+ /** compositeKey -> the open dialog the structured layer knows about (#1725). */
76
+ const promptWaiting = globalThis.__agentEventPromptWaiting ??
77
+ (globalThis.__agentEventPromptWaiting = new Map());
78
+ /** compositeKey -> the `AskUserQuestion` call currently in flight (#1726). */
79
+ const askUserQuestion = globalThis.__agentEventAskUserQuestion ??
80
+ (globalThis.__agentEventAskUserQuestion = new Map());
81
+ /** dedup key -> epoch ms it was first seen. See {@link isDuplicateAgentEvent}. */
82
+ const recentEventKeys = globalThis.__agentEventRecentKeys ??
83
+ (globalThis.__agentEventRecentKeys = new Map());
84
+ /**
85
+ * How long two identical events count as one delivery.
86
+ *
87
+ * Issue #1722 injects hooks at session start, and `--settings` hooks are
88
+ * *concatenated* with the user's own rather than replacing them, so anyone who
89
+ * followed the #1549 manual setup now has two `Stop` hooks posting the same
90
+ * turn. `applyAgentStopEvent` is idempotent for the timestamp, but
91
+ * `applyTaskEvent` is not: each delivery writes its own `agent_idle` row, and a
92
+ * reader counting rows would see one turn as two.
93
+ *
94
+ * A turn cannot end twice in three seconds, and both deliveries carry the same
95
+ * `session_id`, so the window is generous relative to the real signal and tight
96
+ * relative to anything it could wrongly swallow.
97
+ */
98
+ exports.AGENT_EVENT_DEDUP_WINDOW_MS = 3000;
99
+ /** Cap on retained dedup keys, so a long-lived server cannot grow one per turn. */
100
+ const MAX_RECENT_EVENT_KEYS = 512;
27
101
  /**
28
102
  * Record that `instanceId` reported it stopped.
29
103
  *
@@ -40,7 +114,534 @@ function recordAgentStopEvent(worktreeId, cliToolId, instanceId, at = Date.now()
40
114
  function getLastStopEventAt(worktreeId, cliToolId, instanceId) {
41
115
  return lastStopEventAt.get((0, auto_yes_state_1.buildCompositeKey)(worktreeId, cliToolId, instanceId)) ?? null;
42
116
  }
117
+ /**
118
+ * Record any structured event against an instance (Issue #1722).
119
+ *
120
+ * Deliberately does not touch `lastStopEventAt`: that timestamp belongs to
121
+ * `applyAgentStopEvent`, which writes it alongside the task transition it drives
122
+ * so the two cannot disagree.
123
+ */
124
+ function recordAgentEvent(worktreeId, cliToolId, instanceId, record) {
125
+ const key = (0, auto_yes_state_1.buildCompositeKey)(worktreeId, cliToolId, instanceId);
126
+ lastAgentEvent.set(key, record);
127
+ applyAskUserQuestionTransition(key, record);
128
+ if (record.event === 'session_start') {
129
+ // The agent restarting inside a pane CommandMate never touched — `claude`
130
+ // relaunched by hand, or a `/clear` (which emits SessionEnd then
131
+ // SessionStart on a live session) — is a new generation just as much as a
132
+ // new tmux session is. Recorded from the event's own timestamp, so the
133
+ // event that opens a generation is never stale against it.
134
+ generationStartedAt.set(key, record.at);
135
+ }
136
+ applyPromptWaitingTransition(key, record);
137
+ }
138
+ /**
139
+ * The `prompt_waiting` half of the state machine, driven by the same events
140
+ * (Issue #1725).
141
+ *
142
+ * | event | effect on prompt_waiting |
143
+ * |-----------------------------------|--------------------------|
144
+ * | `notification(permission_prompt)` | **open**, confirmed |
145
+ * | `notification(idle_prompt)` | release |
146
+ * | `notification(other/none)` | unchanged |
147
+ * | `stop` | release |
148
+ * | `user_prompt_submit` | release |
149
+ * | `session_start` / `session_end` | release |
150
+ * | `pre_tool_use` | unchanged |
151
+ * | `post_tool_use` | release |
152
+ *
153
+ * `pre_tool_use` leaves this half alone on purpose (Issue #1726). It is the
154
+ * `AskUserQuestion` invocation, and a picker being *about to be drawn* is not
155
+ * the kind of fact this state can carry: nothing marks the picker as answered
156
+ * (§5.6 measured total silence through the selection and confirmation screens),
157
+ * so an open record from this source would keep asserting `waiting` for up to
158
+ * {@link STRUCTURED_STATE_MAX_AGE_MS} after a human answered in the terminal.
159
+ * Whether that screen is up stays the scraper's question; what Issue #1726 adds
160
+ * is the *content* of the question, kept in a separate record that decides no
161
+ * status. The `PermissionRequest` `AskUserQuestion` also raises still opens a
162
+ * provisional record here, exactly as it did in #1725 — unchanged.
163
+ *
164
+ * The release set is the one the spike could actually justify. `Stop` is
165
+ * *measured*: answering an `AskUserQuestion` resumed the turn and delivered a
166
+ * `Stop` (§5.6, received 23 → 24). `PostToolUse` — which Issue #1725's text
167
+ * proposed — was **not** observed at all in the spike, so it is not wired up
168
+ * here; the route does not even map it to a lifecycle event.
169
+ * `user_prompt_submit` is release by construction: a prompt was typed at the
170
+ * composer, so no dialog was in front of it. `session_start` / `session_end`
171
+ * are generation changes, and a dialog does not survive one.
172
+ *
173
+ * `idle_prompt` releases for the same reason it maps to `ready`: the agent
174
+ * reporting it is sitting at the composer waiting for input is the agent saying
175
+ * nothing is in front of that composer.
176
+ *
177
+ * What is deliberately absent is a timer that closes it. There is no event for
178
+ * "the human answered the dialog" — Claude emits none (§5.6) — so the other
179
+ * half of the release rule lives in `current-output-builder`, where the scraper
180
+ * can be asked whether the frame it saw a moment ago is still blocking.
181
+ */
182
+ function applyPromptWaitingTransition(key, record) {
183
+ switch (record.event) {
184
+ case 'notification':
185
+ if (record.detail === 'permission_prompt') {
186
+ openPromptWaiting(key, {
187
+ source: 'notification',
188
+ message: record.message ?? null,
189
+ at: record.at,
190
+ });
191
+ }
192
+ else if (record.detail === 'idle_prompt') {
193
+ promptWaiting.delete(key);
194
+ }
195
+ return;
196
+ case 'stop':
197
+ case 'user_prompt_submit':
198
+ case 'session_start':
199
+ case 'session_end':
200
+ promptWaiting.delete(key);
201
+ return;
202
+ case 'post_tool_use':
203
+ // The tool call the dialog was gating has finished, so somebody answered
204
+ // it (Issue #1726). This is the release #1725 could not have: it had no
205
+ // event meaning "the human answered", only `Stop` meaning "the turn
206
+ // ended", which can be minutes later.
207
+ promptWaiting.delete(key);
208
+ return;
209
+ case 'pre_tool_use':
210
+ return;
211
+ default:
212
+ // exhaustive check: a new AgentEventType must decide its transition here
213
+ record.event;
214
+ return;
215
+ }
216
+ }
217
+ /**
218
+ * @returns The last structured event reported by this instance, or null when it
219
+ * has reported none.
220
+ */
221
+ function getLastAgentEvent(worktreeId, cliToolId, instanceId) {
222
+ return lastAgentEvent.get((0, auto_yes_state_1.buildCompositeKey)(worktreeId, cliToolId, instanceId)) ?? null;
223
+ }
224
+ /**
225
+ * How long a structured verdict is trusted after the event that produced it
226
+ * (Issue #1723).
227
+ *
228
+ * Hooks are fail-open by design: a timeout or a refused connection costs the
229
+ * event and never the agent's turn (`agent-hooks-live-verification.md` §1.1).
230
+ * A *lost* `Stop` is therefore possible, and without a bound it would leave
231
+ * this layer asserting `running` for a session that finished — `commandmate
232
+ * wait` would then poll until `--timeout` on a session the scraper could have
233
+ * called done. The bound converts "forever" into "at most this long", after
234
+ * which the scraper takes the session back.
235
+ *
236
+ * Deliberately generous. A single agent turn running past 30 minutes is
237
+ * ordinary for the workloads this tool exists to babysit, and expiring a live
238
+ * verdict mid-turn costs the whole benefit of the two-layer split. Expiry is
239
+ * not a failure mode: it is exactly the pre-#1723 behaviour.
240
+ */
241
+ exports.STRUCTURED_STATE_MAX_AGE_MS = 30 * 60 * 1000;
242
+ /**
243
+ * Open a new generation for this instance, invalidating everything reported
244
+ * before now (Issue #1723).
245
+ *
246
+ * Called from the session *creation* path, not from every start: a
247
+ * `startClaudeSession()` that finds a healthy session and returns is the same
248
+ * generation, and bumping there would throw away a still-valid verdict on
249
+ * every reconnect.
250
+ *
251
+ * The failure this prevents is specific. Events live in a Map keyed by
252
+ * (worktree, tool, instance) — a key a recreated session reuses exactly — so
253
+ * without a generation the last `user_prompt_submit` of the *previous* Claude
254
+ * process would be read as the current one's, and a freshly started session
255
+ * would report `running` before anybody had typed anything into it.
256
+ *
257
+ * @param at - Epoch ms; defaults to now
258
+ */
259
+ function beginAgentEventGeneration(worktreeId, cliToolId, instanceId, at = Date.now()) {
260
+ const key = (0, auto_yes_state_1.buildCompositeKey)(worktreeId, cliToolId, instanceId);
261
+ generationStartedAt.set(key, at);
262
+ // A dialog belongs to the process that drew it (Issue #1725). The generation
263
+ // bound in `getStructuredPromptWaiting` would already hide it, but leaving the
264
+ // record behind means a later `corroborate`/`markRecorded` would mutate a
265
+ // dead episode.
266
+ promptWaiting.delete(key);
267
+ // Same reasoning for the question that dialog was asking (Issue #1726).
268
+ askUserQuestion.delete(key);
269
+ }
270
+ /**
271
+ * @returns Epoch ms the current generation began, or null when no generation
272
+ * has been opened — the ordinary case for a session that predates this
273
+ * server process, whose events are then judged on age alone.
274
+ */
275
+ function getAgentEventGenerationStartedAt(worktreeId, cliToolId, instanceId) {
276
+ return generationStartedAt.get((0, auto_yes_state_1.buildCompositeKey)(worktreeId, cliToolId, instanceId)) ?? null;
277
+ }
278
+ /**
279
+ * Discard the structured state for one instance — the session it described is
280
+ * gone (Issue #1723).
281
+ *
282
+ * `lastStopEventAt` is deliberately left alone. It is #1549's observational
283
+ * timestamp with its own published meaning ("when did this agent last say it
284
+ * stopped"), it decides nothing, and clearing it here would silently change
285
+ * what the field has always reported.
286
+ */
287
+ function discardAgentEventState(worktreeId, cliToolId, instanceId) {
288
+ const key = (0, auto_yes_state_1.buildCompositeKey)(worktreeId, cliToolId, instanceId);
289
+ lastAgentEvent.delete(key);
290
+ generationStartedAt.delete(key);
291
+ promptWaiting.delete(key);
292
+ askUserQuestion.delete(key);
293
+ }
294
+ /**
295
+ * The status this instance's structured events imply, or null when they imply
296
+ * nothing (Issue #1723).
297
+ *
298
+ * Null is the answer for every session on a machine where hooks never fire,
299
+ * which is what keeps the unconfigured environment on exactly the behaviour it
300
+ * had before this Issue. It is also the answer when:
301
+ *
302
+ * - the last event carries no verdict (`session_start`, `session_end`, a
303
+ * `Notification` of an unrecognised type) — see `agentEventToSessionStatus`;
304
+ * - the event predates the current generation, i.e. it belongs to a previous
305
+ * Claude process in a reused pane;
306
+ * - the event is older than {@link STRUCTURED_STATE_MAX_AGE_MS}.
307
+ *
308
+ * Whether the tmux session is alive is NOT checked here — the caller
309
+ * (`buildCurrentOutput`) has already answered that question with the CLI tool's
310
+ * own `isRunning()` and returned early, and asking twice would mean a second
311
+ * tmux round-trip on the hot path for an answer it is holding.
312
+ *
313
+ * @param now - Epoch ms; defaults to now
314
+ */
315
+ function getStructuredSessionState(worktreeId, cliToolId, instanceId, now = Date.now()) {
316
+ const key = (0, auto_yes_state_1.buildCompositeKey)(worktreeId, cliToolId, instanceId);
317
+ const record = lastAgentEvent.get(key);
318
+ if (!record)
319
+ return null;
320
+ const generation = generationStartedAt.get(key);
321
+ if (generation !== undefined && record.at < generation)
322
+ return null;
323
+ if (now - record.at >= exports.STRUCTURED_STATE_MAX_AGE_MS)
324
+ return null;
325
+ const verdict = (0, status_mapping_1.agentEventToSessionStatus)(record.event, record.detail);
326
+ if (verdict === null)
327
+ return null;
328
+ return { ...verdict, event: record.event, at: record.at, detail: record.detail };
329
+ }
330
+ /**
331
+ * How long a `permission-request`-sourced record survives without
332
+ * corroboration (Issue #1725).
333
+ *
334
+ * The two sources differ in kind. `Notification(permission_prompt)` fires ~6 s
335
+ * *after* the dialog is drawn and only when one is (§5.5): its arrival is proof.
336
+ * A no-decision `PermissionRequest` fires *before* the dialog, so it is a
337
+ * prediction — an accurate one (D5 measured `{}` landing in the ordinary TUI
338
+ * approval flow), but a prediction about a version of Claude, a permission mode
339
+ * and a rule set this server does not get to see in full.
340
+ *
341
+ * A prediction that nothing confirms must expire, because the cost of it
342
+ * sticking is a `wait --on-prompt agent` that exits 10 on a session with no
343
+ * dialog in it — a worker aborted for nothing. 20 s is generous against both
344
+ * confirmations: the `Notification` lands at ~6 s, and the scraper reads the
345
+ * pane through a 5 s capture cache on a 5 s poll. Expiring is not a failure
346
+ * mode; it is the pre-#1725 behaviour for a dialog neither layer ever saw.
347
+ */
348
+ exports.STRUCTURED_PROMPT_PROVISIONAL_MAX_AGE_MS = 20_000;
349
+ /** Open, or refresh, the prompt-waiting record for one instance. */
350
+ function openPromptWaiting(key, input) {
351
+ const existing = promptWaiting.get(key);
352
+ const confirmed = input.source === 'notification';
353
+ if (existing) {
354
+ // The same dialog, reported twice: `PermissionRequest` predicted it and the
355
+ // `Notification` then proved it. Keep the earliest `at` — that is when the
356
+ // human was first blocked, and it is what the scraper-release grace and the
357
+ // age bound are measured from — and take the confirmation.
358
+ existing.message = input.message ?? existing.message;
359
+ existing.toolName = input.toolName ?? existing.toolName;
360
+ if (confirmed) {
361
+ existing.source = 'notification';
362
+ existing.confirmedAt ??= input.at;
363
+ }
364
+ return;
365
+ }
366
+ promptWaiting.set(key, {
367
+ at: input.at,
368
+ source: input.source,
369
+ message: input.message
370
+ ? input.message.slice(0, structured_prompt_1.MAX_STRUCTURED_PROMPT_MESSAGE_LENGTH)
371
+ : null,
372
+ toolName: input.toolName ?? null,
373
+ confirmedAt: confirmed ? input.at : null,
374
+ scraperCorroborated: false,
375
+ recorded: false,
376
+ });
377
+ }
378
+ /**
379
+ * Report that a dialog is open because the agent asked us to adjudicate one and
380
+ * we declined to (Issue #1725, Auto-Yes v2's no-decision path).
381
+ *
382
+ * Provisional: see {@link STRUCTURED_PROMPT_PROVISIONAL_MAX_AGE_MS}.
383
+ *
384
+ * @param at - Epoch ms; defaults to now
385
+ */
386
+ function reportPermissionRequestPending(worktreeId, cliToolId, instanceId, toolName, at = Date.now()) {
387
+ openPromptWaiting((0, auto_yes_state_1.buildCompositeKey)(worktreeId, cliToolId, instanceId), {
388
+ source: 'permission-request',
389
+ message: null,
390
+ toolName,
391
+ at,
392
+ });
393
+ }
394
+ /**
395
+ * The open dialog this instance's structured events imply, or null.
396
+ *
397
+ * Bounded exactly like {@link getStructuredSessionState}: a record from a
398
+ * previous generation is not this session's, and one older than
399
+ * {@link STRUCTURED_STATE_MAX_AGE_MS} has outlived the fact it describes. An
400
+ * unconfirmed `permission-request` record expires far sooner — see
401
+ * {@link STRUCTURED_PROMPT_PROVISIONAL_MAX_AGE_MS}.
402
+ *
403
+ * The returned object is the live record, not a copy: `current-output-builder`
404
+ * marks corroboration and the history write on it.
405
+ *
406
+ * @param now - Epoch ms; defaults to now
407
+ */
408
+ function getStructuredPromptWaiting(worktreeId, cliToolId, instanceId, now = Date.now()) {
409
+ const key = (0, auto_yes_state_1.buildCompositeKey)(worktreeId, cliToolId, instanceId);
410
+ const state = promptWaiting.get(key);
411
+ if (!state)
412
+ return null;
413
+ const generation = generationStartedAt.get(key);
414
+ if (generation !== undefined && state.at < generation)
415
+ return null;
416
+ if (now - state.at >= exports.STRUCTURED_STATE_MAX_AGE_MS)
417
+ return null;
418
+ if (state.confirmedAt === null &&
419
+ now - state.at >= exports.STRUCTURED_PROMPT_PROVISIONAL_MAX_AGE_MS) {
420
+ return null;
421
+ }
422
+ return state;
423
+ }
424
+ /**
425
+ * Record that the scraper has seen a blocking frame while this dialog is open
426
+ * (Issue #1725).
427
+ *
428
+ * Two effects, both needed: it confirms a provisional record, and it arms the
429
+ * only release rule the scraper is entitled to apply. See
430
+ * {@link StructuredPromptWaitingState.scraperCorroborated}.
431
+ *
432
+ * @param at - Epoch ms; defaults to now
433
+ */
434
+ function corroborateStructuredPromptWaiting(worktreeId, cliToolId, instanceId, at = Date.now()) {
435
+ const state = promptWaiting.get((0, auto_yes_state_1.buildCompositeKey)(worktreeId, cliToolId, instanceId));
436
+ if (!state)
437
+ return;
438
+ state.scraperCorroborated = true;
439
+ state.confirmedAt ??= at;
440
+ }
441
+ /** Note that this episode's prompt-history row has been written. */
442
+ function markStructuredPromptRecorded(worktreeId, cliToolId, instanceId) {
443
+ const state = promptWaiting.get((0, auto_yes_state_1.buildCompositeKey)(worktreeId, cliToolId, instanceId));
444
+ if (state)
445
+ state.recorded = true;
446
+ }
447
+ /**
448
+ * Release the prompt-waiting record — the dialog is gone (Issue #1725).
449
+ *
450
+ * Called from the event transitions above and from `current-output-builder`
451
+ * when the scraper reports that the frame it corroborated has cleared.
452
+ */
453
+ function clearStructuredPromptWaiting(worktreeId, cliToolId, instanceId) {
454
+ promptWaiting.delete((0, auto_yes_state_1.buildCompositeKey)(worktreeId, cliToolId, instanceId));
455
+ }
456
+ /**
457
+ * When the in-flight question is released (Issue #1726).
458
+ *
459
+ * | event | effect on the question |
460
+ * |-----------------------------------|------------------------|
461
+ * | `pre_tool_use(AskUserQuestion)` | unchanged (this IS it) |
462
+ * | `pre_tool_use(any other tool)` | release |
463
+ * | `post_tool_use` | release |
464
+ * | `notification(permission_prompt)` | **unchanged** |
465
+ * | `notification(idle_prompt)` | release |
466
+ * | `notification(other)` | unchanged |
467
+ * | `stop` | release |
468
+ * | `user_prompt_submit` | release |
469
+ * | `session_start` / `session_end` | release |
470
+ *
471
+ * `PostToolUse` is the precise release — "this tool call is over" — and `Stop`
472
+ * is the backstop for a delivery that never arrives. Issue #1726's text proposed
473
+ * `PostToolUse` and the #1721 spike recorded it as never observed, so this Issue
474
+ * measured it directly on a live v2.1.223 session (2026-08-06):
475
+ *
476
+ * ```
477
+ * 15:36:04.112 PreToolUse AskUserQuestion
478
+ * 15:36:28.643 PostToolUse AskUserQuestion <- the human answered
479
+ * 15:36:29.992 Stop
480
+ * ```
481
+ *
482
+ * It fires, 1.3 s ahead of `Stop` here — and much further ahead whenever the
483
+ * agent keeps working after the answer, which is the case that matters: `Stop`
484
+ * alone would leave a finished question in place for the whole rest of the turn.
485
+ *
486
+ * A `PostToolUse` for any other tool releases as well: the agent could not have
487
+ * finished another tool call while this question was still on screen.
488
+ *
489
+ * **`Notification(permission_prompt)` keeping the question is a live
490
+ * measurement, not a guess.** The #1721 report says the picker emits no events
491
+ * while it is displayed (§5.6), and a first cut of this module read that as "any
492
+ * event means the picker is gone". Driving a real v2.1.223 session through the
493
+ * server on 2026-08-06 disproved it:
494
+ *
495
+ * ```
496
+ * 15:29:18.099 PreToolUse(AskUserQuestion)
497
+ * 15:29:18.109 PermissionRequest(AskUserQuestion) -> no decision
498
+ * 15:29:24.128 Notification(permission_prompt) <- picker still on screen
499
+ * ```
500
+ *
501
+ * The notification lands ~6 s after the dialog is drawn (§5.5's timing exactly),
502
+ * which is *inside* the window §5.6 was counting rather than outside it. Under
503
+ * the first rule it deleted the question six seconds after it arrived, and the
504
+ * options went back to being the screen's — which is the whole feature, silently
505
+ * off, on every real session.
506
+ *
507
+ * `idle_prompt` still releases: the agent reporting it is sitting at the
508
+ * composer is the agent saying no picker is in front of it. An unrecognised
509
+ * notification type changes nothing, because nothing is known about it.
510
+ */
511
+ function applyAskUserQuestionTransition(key, record) {
512
+ switch (record.event) {
513
+ case 'pre_tool_use':
514
+ // A `PreToolUse` for anything else means the agent has moved on to another
515
+ // tool, so whatever question was in flight has been answered. Only
516
+ // reachable when the operator's own settings.json registers a wider
517
+ // matcher than the injected `AskUserQuestion` one — the two files are
518
+ // concatenated, not substituted (#1722).
519
+ if (record.detail !== permission_request_payload_1.ASK_USER_QUESTION_TOOL)
520
+ askUserQuestion.delete(key);
521
+ return;
522
+ case 'notification':
523
+ if (record.detail === 'idle_prompt')
524
+ askUserQuestion.delete(key);
525
+ return;
526
+ case 'post_tool_use':
527
+ case 'stop':
528
+ case 'user_prompt_submit':
529
+ case 'session_start':
530
+ case 'session_end':
531
+ askUserQuestion.delete(key);
532
+ return;
533
+ default:
534
+ // exhaustive check: a new AgentEventType must decide its transition here
535
+ record.event;
536
+ return;
537
+ }
538
+ }
539
+ /**
540
+ * Record the `AskUserQuestion` invocation reported for one instance.
541
+ *
542
+ * Idempotent by construction: the same call is reported twice on every session
543
+ * — once by `PreToolUse` and once by the `PermissionRequest` that
544
+ * `AskUserQuestion` also raises with a byte-identical `tool_input` — and the
545
+ * second delivery simply overwrites the first with the same content.
546
+ *
547
+ * @param at - Epoch ms; defaults to now
548
+ */
549
+ function recordAskUserQuestion(worktreeId, cliToolId, instanceId, spec, at = Date.now()) {
550
+ askUserQuestion.set((0, auto_yes_state_1.buildCompositeKey)(worktreeId, cliToolId, instanceId), { at, spec });
551
+ }
552
+ /**
553
+ * The `AskUserQuestion` call in flight for this instance, or null.
554
+ *
555
+ * Bounded exactly like {@link getStructuredSessionState}: a record from a
556
+ * previous generation belongs to a Claude process that no longer exists, and one
557
+ * older than {@link STRUCTURED_STATE_MAX_AGE_MS} has outlived the screen it
558
+ * describes. There is no provisional bound — unlike a `PermissionRequest`, a
559
+ * `PreToolUse(AskUserQuestion)` is not a prediction that a dialog *might*
560
+ * appear: allowing the permission request does not dismiss the picker (§5.6), so
561
+ * the picker is drawn unconditionally.
562
+ *
563
+ * @param now - Epoch ms; defaults to now
564
+ */
565
+ function getAskUserQuestion(worktreeId, cliToolId, instanceId, now = Date.now()) {
566
+ const key = (0, auto_yes_state_1.buildCompositeKey)(worktreeId, cliToolId, instanceId);
567
+ const episode = askUserQuestion.get(key);
568
+ if (!episode)
569
+ return null;
570
+ const generation = generationStartedAt.get(key);
571
+ if (generation !== undefined && episode.at < generation)
572
+ return null;
573
+ if (now - episode.at >= exports.STRUCTURED_STATE_MAX_AGE_MS)
574
+ return null;
575
+ return episode;
576
+ }
577
+ /** Drop the in-flight question for one instance. */
578
+ function clearAskUserQuestion(worktreeId, cliToolId, instanceId) {
579
+ askUserQuestion.delete((0, auto_yes_state_1.buildCompositeKey)(worktreeId, cliToolId, instanceId));
580
+ }
581
+ /**
582
+ * Whether this event is a second copy of one already handled, and should be
583
+ * dropped.
584
+ *
585
+ * Only events that name a `sessionId` can be deduplicated, and calling this
586
+ * *claims* the key: a first call answers false and marks it, so the caller must
587
+ * ask once per request and act on the answer. Events with no session id are
588
+ * never suppressed — a caller that omits it (the #1549 relay run without a hook
589
+ * payload, a hand-rolled `curl`) has given us nothing to tell two deliveries of
590
+ * one turn from two genuine turns, and inventing a match there would silently
591
+ * drop real events.
592
+ *
593
+ * The subtype is part of the key (Issue #1726). It has to be, now that
594
+ * `pre_tool_use` exists: that event's subtype is the tool name, several tool
595
+ * calls a second is ordinary, and a key without it would read a `Bash` call and
596
+ * the `AskUserQuestion` that follows it as one delivery and drop the second. The
597
+ * same correction applies to two `Notification`s of different types inside the
598
+ * window, which were previously collapsed as well.
599
+ *
600
+ * @param at - Epoch ms; defaults to now
601
+ * @param detail - The event's subtype, when it has one
602
+ */
603
+ function isDuplicateAgentEvent(worktreeId, cliToolId, instanceId, event, sessionId, at = Date.now(), detail = null) {
604
+ if (!sessionId)
605
+ return false;
606
+ const key = [
607
+ (0, auto_yes_state_1.buildCompositeKey)(worktreeId, cliToolId, instanceId),
608
+ event,
609
+ detail ?? '',
610
+ sessionId,
611
+ ].join(' ');
612
+ const seenAt = recentEventKeys.get(key);
613
+ if (seenAt !== undefined && at - seenAt < exports.AGENT_EVENT_DEDUP_WINDOW_MS) {
614
+ return true;
615
+ }
616
+ recentEventKeys.set(key, at);
617
+ pruneRecentEventKeys(at);
618
+ return false;
619
+ }
620
+ /** Drop keys past the window, then the oldest survivors if still over the cap. */
621
+ function pruneRecentEventKeys(now) {
622
+ for (const [key, seenAt] of recentEventKeys) {
623
+ if (now - seenAt >= exports.AGENT_EVENT_DEDUP_WINDOW_MS) {
624
+ recentEventKeys.delete(key);
625
+ }
626
+ }
627
+ // Map iterates in insertion order, so the head is the oldest.
628
+ while (recentEventKeys.size > MAX_RECENT_EVENT_KEYS) {
629
+ const oldest = recentEventKeys.keys().next();
630
+ if (oldest.done)
631
+ break;
632
+ recentEventKeys.delete(oldest.value);
633
+ }
634
+ }
635
+ /** How many dedup keys are currently retained. Test seam for the bound above. */
636
+ function getRecentEventKeyCount() {
637
+ return recentEventKeys.size;
638
+ }
43
639
  /** Drop every recorded event. Test seam. */
44
640
  function clearAgentStopEvents() {
45
641
  lastStopEventAt.clear();
642
+ lastAgentEvent.clear();
643
+ recentEventKeys.clear();
644
+ generationStartedAt.clear();
645
+ promptWaiting.clear();
646
+ askUserQuestion.clear();
46
647
  }