commandmate 0.47.2 → 0.49.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 (434) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-build-manifest.json +180 -180
  3. package/.next/app-path-routes-manifest.json +30 -30
  4. package/.next/build-manifest.json +2 -2
  5. package/.next/prerender-manifest.json +9 -9
  6. package/.next/required-server-files.json +1 -1
  7. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  8. package/.next/server/app/api/agents/update/route_client-reference-manifest.js +1 -1
  9. package/.next/server/app/api/agents/versions/route_client-reference-manifest.js +1 -1
  10. package/.next/server/app/api/app/release-notes/route_client-reference-manifest.js +1 -1
  11. package/.next/server/app/api/app/update/route.js +3 -3
  12. package/.next/server/app/api/app/update/route_client-reference-manifest.js +1 -1
  13. package/.next/server/app/api/app/update-check/route_client-reference-manifest.js +1 -1
  14. package/.next/server/app/api/auth/login/route_client-reference-manifest.js +1 -1
  15. package/.next/server/app/api/auth/logout/route_client-reference-manifest.js +1 -1
  16. package/.next/server/app/api/auth/status/route_client-reference-manifest.js +1 -1
  17. package/.next/server/app/api/capabilities/route.js +1 -1
  18. package/.next/server/app/api/capabilities/route_client-reference-manifest.js +1 -1
  19. package/.next/server/app/api/daily-summary/route_client-reference-manifest.js +1 -1
  20. package/.next/server/app/api/daily-summary/status/route_client-reference-manifest.js +1 -1
  21. package/.next/server/app/api/external-apps/[id]/health/route_client-reference-manifest.js +1 -1
  22. package/.next/server/app/api/external-apps/[id]/route_client-reference-manifest.js +1 -1
  23. package/.next/server/app/api/external-apps/route_client-reference-manifest.js +1 -1
  24. package/.next/server/app/api/fs/browse/route_client-reference-manifest.js +1 -1
  25. package/.next/server/app/api/fs/recent-paths/route_client-reference-manifest.js +1 -1
  26. package/.next/server/app/api/hooks/agent-event/route.js +2 -2
  27. package/.next/server/app/api/hooks/agent-event/route.js.nft.json +1 -1
  28. package/.next/server/app/api/hooks/agent-event/route_client-reference-manifest.js +1 -1
  29. package/.next/server/app/api/hooks/claude-done/route.js +2 -2
  30. package/.next/server/app/api/hooks/claude-done/route.js.nft.json +1 -1
  31. package/.next/server/app/api/hooks/claude-done/route_client-reference-manifest.js +1 -1
  32. package/.next/server/app/api/hooks/permission-request/route.js +1 -1
  33. package/.next/server/app/api/hooks/permission-request/route.js.nft.json +1 -1
  34. package/.next/server/app/api/hooks/permission-request/route_client-reference-manifest.js +1 -1
  35. package/.next/server/app/api/metrics/vibe/route_client-reference-manifest.js +1 -1
  36. package/.next/server/app/api/ollama/models/route_client-reference-manifest.js +1 -1
  37. package/.next/server/app/api/push/escalation/route.js +1 -1
  38. package/.next/server/app/api/push/escalation/route_client-reference-manifest.js +1 -1
  39. package/.next/server/app/api/push/subscriptions/route_client-reference-manifest.js +1 -1
  40. package/.next/server/app/api/push/vapid/route.js +1 -1
  41. package/.next/server/app/api/push/vapid/route_client-reference-manifest.js +1 -1
  42. package/.next/server/app/api/relays/[relayId]/cancel/route.js +1 -1
  43. package/.next/server/app/api/relays/[relayId]/cancel/route.js.nft.json +1 -1
  44. package/.next/server/app/api/relays/[relayId]/cancel/route_client-reference-manifest.js +1 -1
  45. package/.next/server/app/api/relays/route.js +1 -1
  46. package/.next/server/app/api/relays/route.js.nft.json +1 -1
  47. package/.next/server/app/api/relays/route_client-reference-manifest.js +1 -1
  48. package/.next/server/app/api/remote/pair/route_client-reference-manifest.js +1 -1
  49. package/.next/server/app/api/repositories/[id]/route_client-reference-manifest.js +1 -1
  50. package/.next/server/app/api/repositories/clone/[jobId]/route.js +1 -1
  51. package/.next/server/app/api/repositories/clone/[jobId]/route.js.nft.json +1 -1
  52. package/.next/server/app/api/repositories/clone/[jobId]/route_client-reference-manifest.js +1 -1
  53. package/.next/server/app/api/repositories/clone/route.js +1 -1
  54. package/.next/server/app/api/repositories/clone/route.js.nft.json +1 -1
  55. package/.next/server/app/api/repositories/clone/route_client-reference-manifest.js +1 -1
  56. package/.next/server/app/api/repositories/excluded/route_client-reference-manifest.js +1 -1
  57. package/.next/server/app/api/repositories/restore/route.js +1 -1
  58. package/.next/server/app/api/repositories/restore/route.js.nft.json +1 -1
  59. package/.next/server/app/api/repositories/restore/route_client-reference-manifest.js +1 -1
  60. package/.next/server/app/api/repositories/route.js +1 -1
  61. package/.next/server/app/api/repositories/route.js.nft.json +1 -1
  62. package/.next/server/app/api/repositories/route_client-reference-manifest.js +1 -1
  63. package/.next/server/app/api/repositories/scan/route.js +1 -1
  64. package/.next/server/app/api/repositories/scan/route.js.nft.json +1 -1
  65. package/.next/server/app/api/repositories/scan/route_client-reference-manifest.js +1 -1
  66. package/.next/server/app/api/repositories/sync/route.js +1 -1
  67. package/.next/server/app/api/repositories/sync/route.js.nft.json +1 -1
  68. package/.next/server/app/api/repositories/sync/route_client-reference-manifest.js +1 -1
  69. package/.next/server/app/api/repositories/validate-path/route_client-reference-manifest.js +1 -1
  70. package/.next/server/app/api/settings/default-agents/route.js +1 -1
  71. package/.next/server/app/api/settings/default-agents/route.js.nft.json +1 -1
  72. package/.next/server/app/api/settings/default-agents/route_client-reference-manifest.js +1 -1
  73. package/.next/server/app/api/settings/default-surface-mode/route_client-reference-manifest.js +1 -1
  74. package/.next/server/app/api/sidebar/group-order/route_client-reference-manifest.js +1 -1
  75. package/.next/server/app/api/skills/[id]/route_client-reference-manifest.js +1 -1
  76. package/.next/server/app/api/skills/installations/route_client-reference-manifest.js +1 -1
  77. package/.next/server/app/api/skills/operations/route_client-reference-manifest.js +1 -1
  78. package/.next/server/app/api/skills/reindex/route_client-reference-manifest.js +1 -1
  79. package/.next/server/app/api/skills/route_client-reference-manifest.js +1 -1
  80. package/.next/server/app/api/slash-commands/route_client-reference-manifest.js +1 -1
  81. package/.next/server/app/api/tasks/[taskId]/cancel/route_client-reference-manifest.js +1 -1
  82. package/.next/server/app/api/tasks/[taskId]/route_client-reference-manifest.js +1 -1
  83. package/.next/server/app/api/templates/[id]/route_client-reference-manifest.js +1 -1
  84. package/.next/server/app/api/templates/route_client-reference-manifest.js +1 -1
  85. package/.next/server/app/api/verification/runs/[runId]/route_client-reference-manifest.js +1 -1
  86. package/.next/server/app/api/verification/runs/route_client-reference-manifest.js +1 -1
  87. package/.next/server/app/api/worktrees/[id]/auto-yes/route.js +1 -1
  88. package/.next/server/app/api/worktrees/[id]/auto-yes/route.js.nft.json +1 -1
  89. package/.next/server/app/api/worktrees/[id]/auto-yes/route_client-reference-manifest.js +1 -1
  90. package/.next/server/app/api/worktrees/[id]/capture/route.js +1 -1
  91. package/.next/server/app/api/worktrees/[id]/capture/route.js.nft.json +1 -1
  92. package/.next/server/app/api/worktrees/[id]/capture/route_client-reference-manifest.js +1 -1
  93. package/.next/server/app/api/worktrees/[id]/clear-composer/route.js +1 -1
  94. package/.next/server/app/api/worktrees/[id]/clear-composer/route.js.nft.json +1 -1
  95. package/.next/server/app/api/worktrees/[id]/clear-composer/route_client-reference-manifest.js +1 -1
  96. package/.next/server/app/api/worktrees/[id]/cli-reference/route_client-reference-manifest.js +1 -1
  97. package/.next/server/app/api/worktrees/[id]/cli-tool/route_client-reference-manifest.js +1 -1
  98. package/.next/server/app/api/worktrees/[id]/cmate/schedules/route_client-reference-manifest.js +1 -1
  99. package/.next/server/app/api/worktrees/[id]/current-output/route.js +1 -1
  100. package/.next/server/app/api/worktrees/[id]/current-output/route.js.nft.json +1 -1
  101. package/.next/server/app/api/worktrees/[id]/current-output/route_client-reference-manifest.js +1 -1
  102. package/.next/server/app/api/worktrees/[id]/direct-input/route.js +1 -1
  103. package/.next/server/app/api/worktrees/[id]/direct-input/route.js.nft.json +1 -1
  104. package/.next/server/app/api/worktrees/[id]/direct-input/route_client-reference-manifest.js +1 -1
  105. package/.next/server/app/api/worktrees/[id]/env/route_client-reference-manifest.js +1 -1
  106. package/.next/server/app/api/worktrees/[id]/execution-logs/[logId]/route_client-reference-manifest.js +1 -1
  107. package/.next/server/app/api/worktrees/[id]/execution-logs/route_client-reference-manifest.js +1 -1
  108. package/.next/server/app/api/worktrees/[id]/files/[...path]/route_client-reference-manifest.js +1 -1
  109. package/.next/server/app/api/worktrees/[id]/git/branch/create/route_client-reference-manifest.js +1 -1
  110. package/.next/server/app/api/worktrees/[id]/git/branch/delete/route_client-reference-manifest.js +1 -1
  111. package/.next/server/app/api/worktrees/[id]/git/branches/route_client-reference-manifest.js +1 -1
  112. package/.next/server/app/api/worktrees/[id]/git/checkout/route_client-reference-manifest.js +1 -1
  113. package/.next/server/app/api/worktrees/[id]/git/commit/route_client-reference-manifest.js +1 -1
  114. package/.next/server/app/api/worktrees/[id]/git/diff/route_client-reference-manifest.js +1 -1
  115. package/.next/server/app/api/worktrees/[id]/git/fetch/route_client-reference-manifest.js +1 -1
  116. package/.next/server/app/api/worktrees/[id]/git/log/route_client-reference-manifest.js +1 -1
  117. package/.next/server/app/api/worktrees/[id]/git/pull/route_client-reference-manifest.js +1 -1
  118. package/.next/server/app/api/worktrees/[id]/git/push/route_client-reference-manifest.js +1 -1
  119. package/.next/server/app/api/worktrees/[id]/git/reset/route_client-reference-manifest.js +1 -1
  120. package/.next/server/app/api/worktrees/[id]/git/revert/route_client-reference-manifest.js +1 -1
  121. package/.next/server/app/api/worktrees/[id]/git/show/[commitHash]/route_client-reference-manifest.js +1 -1
  122. package/.next/server/app/api/worktrees/[id]/git/stage/route_client-reference-manifest.js +1 -1
  123. package/.next/server/app/api/worktrees/[id]/git/staged/route_client-reference-manifest.js +1 -1
  124. package/.next/server/app/api/worktrees/[id]/git/stash/[index]/route_client-reference-manifest.js +1 -1
  125. package/.next/server/app/api/worktrees/[id]/git/stash/apply/route_client-reference-manifest.js +1 -1
  126. package/.next/server/app/api/worktrees/[id]/git/stash/pop/route_client-reference-manifest.js +1 -1
  127. package/.next/server/app/api/worktrees/[id]/git/stash/push/route_client-reference-manifest.js +1 -1
  128. package/.next/server/app/api/worktrees/[id]/git/stash/route_client-reference-manifest.js +1 -1
  129. package/.next/server/app/api/worktrees/[id]/git/status/route_client-reference-manifest.js +1 -1
  130. package/.next/server/app/api/worktrees/[id]/git/unstage/route_client-reference-manifest.js +1 -1
  131. package/.next/server/app/api/worktrees/[id]/git/working-diff/route_client-reference-manifest.js +1 -1
  132. package/.next/server/app/api/worktrees/[id]/instances/notes/route_client-reference-manifest.js +1 -1
  133. package/.next/server/app/api/worktrees/[id]/instances/opencode/route.js +1 -1
  134. package/.next/server/app/api/worktrees/[id]/instances/opencode/route.js.nft.json +1 -1
  135. package/.next/server/app/api/worktrees/[id]/instances/opencode/route_client-reference-manifest.js +1 -1
  136. package/.next/server/app/api/worktrees/[id]/interrupt/route.js +1 -1
  137. package/.next/server/app/api/worktrees/[id]/interrupt/route.js.nft.json +1 -1
  138. package/.next/server/app/api/worktrees/[id]/interrupt/route_client-reference-manifest.js +1 -1
  139. package/.next/server/app/api/worktrees/[id]/kill-session/route.js +1 -1
  140. package/.next/server/app/api/worktrees/[id]/kill-session/route.js.nft.json +1 -1
  141. package/.next/server/app/api/worktrees/[id]/kill-session/route_client-reference-manifest.js +1 -1
  142. package/.next/server/app/api/worktrees/[id]/logs/[filename]/route_client-reference-manifest.js +1 -1
  143. package/.next/server/app/api/worktrees/[id]/logs/route_client-reference-manifest.js +1 -1
  144. package/.next/server/app/api/worktrees/[id]/marp-render/route_client-reference-manifest.js +1 -1
  145. package/.next/server/app/api/worktrees/[id]/memos/[memoId]/route_client-reference-manifest.js +1 -1
  146. package/.next/server/app/api/worktrees/[id]/memos/route_client-reference-manifest.js +1 -1
  147. package/.next/server/app/api/worktrees/[id]/messages/route_client-reference-manifest.js +1 -1
  148. package/.next/server/app/api/worktrees/[id]/opencode/diff/route_client-reference-manifest.js +1 -1
  149. package/.next/server/app/api/worktrees/[id]/opencode/session/route.js +1 -1
  150. package/.next/server/app/api/worktrees/[id]/opencode/session/route.js.nft.json +1 -1
  151. package/.next/server/app/api/worktrees/[id]/opencode/session/route_client-reference-manifest.js +1 -1
  152. package/.next/server/app/api/worktrees/[id]/opencode/share/route.js +1 -1
  153. package/.next/server/app/api/worktrees/[id]/opencode/share/route.js.nft.json +1 -1
  154. package/.next/server/app/api/worktrees/[id]/opencode/share/route_client-reference-manifest.js +1 -1
  155. package/.next/server/app/api/worktrees/[id]/prompt-response/route.js +1 -1
  156. package/.next/server/app/api/worktrees/[id]/prompt-response/route.js.nft.json +1 -1
  157. package/.next/server/app/api/worktrees/[id]/prompt-response/route_client-reference-manifest.js +1 -1
  158. package/.next/server/app/api/worktrees/[id]/prompt-response/strict/route.js +1 -1
  159. package/.next/server/app/api/worktrees/[id]/prompt-response/strict/route.js.nft.json +1 -1
  160. package/.next/server/app/api/worktrees/[id]/prompt-response/strict/route_client-reference-manifest.js +1 -1
  161. package/.next/server/app/api/worktrees/[id]/resolve-target/route_client-reference-manifest.js +1 -1
  162. package/.next/server/app/api/worktrees/[id]/respond/route.js +1 -1
  163. package/.next/server/app/api/worktrees/[id]/respond/route.js.nft.json +1 -1
  164. package/.next/server/app/api/worktrees/[id]/respond/route_client-reference-manifest.js +1 -1
  165. package/.next/server/app/api/worktrees/[id]/route.js +1 -1
  166. package/.next/server/app/api/worktrees/[id]/route.js.nft.json +1 -1
  167. package/.next/server/app/api/worktrees/[id]/route_client-reference-manifest.js +1 -1
  168. package/.next/server/app/api/worktrees/[id]/schedules/[scheduleId]/route_client-reference-manifest.js +1 -1
  169. package/.next/server/app/api/worktrees/[id]/schedules/active/route_client-reference-manifest.js +1 -1
  170. package/.next/server/app/api/worktrees/[id]/schedules/route_client-reference-manifest.js +1 -1
  171. package/.next/server/app/api/worktrees/[id]/search/route_client-reference-manifest.js +1 -1
  172. package/.next/server/app/api/worktrees/[id]/send/route.js +1 -1
  173. package/.next/server/app/api/worktrees/[id]/send/route.js.nft.json +1 -1
  174. package/.next/server/app/api/worktrees/[id]/send/route_client-reference-manifest.js +1 -1
  175. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route.js +3 -3
  176. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route.js.nft.json +1 -1
  177. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route_client-reference-manifest.js +1 -1
  178. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/install/route_client-reference-manifest.js +1 -1
  179. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/plan/route_client-reference-manifest.js +1 -1
  180. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall/route_client-reference-manifest.js +1 -1
  181. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall-plan/route_client-reference-manifest.js +1 -1
  182. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/update/route_client-reference-manifest.js +1 -1
  183. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/update-plan/route_client-reference-manifest.js +1 -1
  184. package/.next/server/app/api/worktrees/[id]/skills/route_client-reference-manifest.js +1 -1
  185. package/.next/server/app/api/worktrees/[id]/slash-commands/route_client-reference-manifest.js +1 -1
  186. package/.next/server/app/api/worktrees/[id]/special-keys/route.js +1 -1
  187. package/.next/server/app/api/worktrees/[id]/special-keys/route.js.nft.json +1 -1
  188. package/.next/server/app/api/worktrees/[id]/special-keys/route_client-reference-manifest.js +1 -1
  189. package/.next/server/app/api/worktrees/[id]/tasks/route_client-reference-manifest.js +1 -1
  190. package/.next/server/app/api/worktrees/[id]/terminal/route.js +1 -103
  191. package/.next/server/app/api/worktrees/[id]/terminal/route.js.nft.json +1 -1
  192. package/.next/server/app/api/worktrees/[id]/terminal/route_client-reference-manifest.js +1 -1
  193. package/.next/server/app/api/worktrees/[id]/timers/history/route_client-reference-manifest.js +1 -1
  194. package/.next/server/app/api/worktrees/[id]/timers/route.js +1 -1
  195. package/.next/server/app/api/worktrees/[id]/timers/route.js.nft.json +1 -1
  196. package/.next/server/app/api/worktrees/[id]/timers/route_client-reference-manifest.js +1 -1
  197. package/.next/server/app/api/worktrees/[id]/todos/[todoId]/route_client-reference-manifest.js +1 -1
  198. package/.next/server/app/api/worktrees/[id]/todos/route_client-reference-manifest.js +1 -1
  199. package/.next/server/app/api/worktrees/[id]/tree/[...path]/route_client-reference-manifest.js +1 -1
  200. package/.next/server/app/api/worktrees/[id]/tree/route_client-reference-manifest.js +1 -1
  201. package/.next/server/app/api/worktrees/[id]/upload/[...path]/route_client-reference-manifest.js +1 -1
  202. package/.next/server/app/api/worktrees/[id]/verify/config/route_client-reference-manifest.js +1 -1
  203. package/.next/server/app/api/worktrees/[id]/verify/route.js +1 -1
  204. package/.next/server/app/api/worktrees/[id]/verify/route_client-reference-manifest.js +1 -1
  205. package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/cancel/route.js +1 -1
  206. package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/cancel/route_client-reference-manifest.js +1 -1
  207. package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/route_client-reference-manifest.js +1 -1
  208. package/.next/server/app/api/worktrees/[id]/verify/runs/route_client-reference-manifest.js +1 -1
  209. package/.next/server/app/api/worktrees/[id]/viewed/route_client-reference-manifest.js +1 -1
  210. package/.next/server/app/api/worktrees/apply-default-agents/route_client-reference-manifest.js +1 -1
  211. package/.next/server/app/api/worktrees/route.js +1 -1
  212. package/.next/server/app/api/worktrees/route.js.nft.json +1 -1
  213. package/.next/server/app/api/worktrees/route_client-reference-manifest.js +1 -1
  214. package/.next/server/app/login/page_client-reference-manifest.js +1 -1
  215. package/.next/server/app/manifest.webmanifest/route_client-reference-manifest.js +1 -1
  216. package/.next/server/app/more/page_client-reference-manifest.js +1 -1
  217. package/.next/server/app/offline/page_client-reference-manifest.js +1 -1
  218. package/.next/server/app/page_client-reference-manifest.js +1 -1
  219. package/.next/server/app/proxy/[...path]/route_client-reference-manifest.js +1 -1
  220. package/.next/server/app/repositories/page_client-reference-manifest.js +1 -1
  221. package/.next/server/app/review/page_client-reference-manifest.js +1 -1
  222. package/.next/server/app/sessions/page.js +1 -1
  223. package/.next/server/app/sessions/page.js.nft.json +1 -1
  224. package/.next/server/app/sessions/page_client-reference-manifest.js +1 -1
  225. package/.next/server/app/skills/[skillId]/page.js +1 -1
  226. package/.next/server/app/skills/[skillId]/page.js.nft.json +1 -1
  227. package/.next/server/app/skills/[skillId]/page_client-reference-manifest.js +1 -1
  228. package/.next/server/app/skills/installed/page_client-reference-manifest.js +1 -1
  229. package/.next/server/app/skills/page_client-reference-manifest.js +1 -1
  230. package/.next/server/app/worktrees/[id]/files/[...path]/page.js +2 -2
  231. package/.next/server/app/worktrees/[id]/files/[...path]/page.js.nft.json +1 -1
  232. package/.next/server/app/worktrees/[id]/files/[...path]/page_client-reference-manifest.js +1 -1
  233. package/.next/server/app/worktrees/[id]/page.js +12 -12
  234. package/.next/server/app/worktrees/[id]/page.js.nft.json +1 -1
  235. package/.next/server/app/worktrees/[id]/page_client-reference-manifest.js +1 -1
  236. package/.next/server/app/worktrees/[id]/terminal/page_client-reference-manifest.js +1 -1
  237. package/.next/server/app-paths-manifest.json +30 -30
  238. package/.next/server/chunks/1191.js +11 -4
  239. package/.next/server/chunks/1501.js +1 -1
  240. package/.next/server/chunks/1601.js +2 -2
  241. package/.next/server/chunks/1656.js +2 -2
  242. package/.next/server/chunks/1945.js +3 -3
  243. package/.next/server/chunks/1990.js +103 -0
  244. package/.next/server/chunks/2069.js +1 -0
  245. package/.next/server/chunks/2119.js +1 -1
  246. package/.next/server/chunks/2404.js +1 -1
  247. package/.next/server/chunks/2422.js +1 -1
  248. package/.next/server/chunks/2445.js +1 -1
  249. package/.next/server/chunks/2534.js +1 -1
  250. package/.next/server/chunks/255.js +1 -1
  251. package/.next/server/chunks/3241.js +1 -1
  252. package/.next/server/chunks/3505.js +2 -2
  253. package/.next/server/chunks/4243.js +1 -1
  254. package/.next/server/chunks/4248.js +1 -1
  255. package/.next/server/chunks/4280.js +1 -0
  256. package/.next/server/chunks/5209.js +1 -1
  257. package/.next/server/chunks/6119.js +1 -1
  258. package/.next/server/chunks/6130.js +1 -1
  259. package/.next/server/chunks/6401.js +1 -1
  260. package/.next/server/chunks/6486.js +9 -8
  261. package/.next/server/chunks/6781.js +1 -1
  262. package/.next/server/chunks/720.js +103 -0
  263. package/.next/server/chunks/7604.js +2 -0
  264. package/.next/server/chunks/7905.js +1 -1
  265. package/.next/server/chunks/8581.js +8 -8
  266. package/.next/server/chunks/8728.js +3 -3
  267. package/.next/server/chunks/8791.js +1 -1
  268. package/.next/server/chunks/8807.js +19 -18
  269. package/.next/server/chunks/8918.js +2 -104
  270. package/.next/server/chunks/936.js +1 -1
  271. package/.next/server/chunks/9390.js +1 -1
  272. package/.next/server/chunks/9540.js +1 -1
  273. package/.next/server/chunks/9627.js +5 -5
  274. package/.next/server/chunks/9731.js +2 -2
  275. package/.next/server/middleware-manifest.json +5 -5
  276. package/.next/server/pages/500.html +1 -1
  277. package/.next/server/server-reference-manifest.json +1 -1
  278. package/.next/static/chunks/1128-914c559913546bbc.js +1 -0
  279. package/.next/static/chunks/{2407-a6533805a86d05bd.js → 2407-ab92ae9837c39dce.js} +1 -1
  280. package/.next/static/chunks/{2863-6a07ec82fb52f4dd.js → 2863-7173dc305dffc4f6.js} +1 -1
  281. package/.next/static/chunks/6288-6fadbba6e84393b2.js +1 -0
  282. package/.next/static/chunks/7665-e9ef6e0a85b9fa49.js +1 -0
  283. package/.next/static/chunks/8407-35bbfc84793d7004.js +1 -0
  284. package/.next/static/chunks/9079-987939d231704218.js +1 -0
  285. package/.next/static/chunks/app/{layout-538d8d2746ad1588.js → layout-aa8e66164a4367af.js} +1 -1
  286. package/.next/static/chunks/app/sessions/page-cfd645305e25fd33.js +1 -0
  287. package/.next/static/chunks/app/skills/[skillId]/{page-52ba58712faf3378.js → page-cb6e74fd9a6a571d.js} +1 -1
  288. package/.next/static/chunks/app/worktrees/[id]/files/[...path]/page-704086656fb45699.js +1 -0
  289. package/.next/static/chunks/app/worktrees/[id]/page-a8d7886703ffc7b4.js +1 -0
  290. package/.next/static/css/{743f79ff19ab91e9.css → db8959555c3d9c96.css} +1 -1
  291. package/.next/trace +13 -13
  292. package/dist/cli/commands/auto-yes.d.ts +24 -0
  293. package/dist/cli/commands/auto-yes.d.ts.map +1 -1
  294. package/dist/cli/commands/auto-yes.js +76 -8
  295. package/dist/cli/commands/capture.d.ts.map +1 -1
  296. package/dist/cli/commands/capture.js +5 -0
  297. package/dist/cli/commands/instances.d.ts.map +1 -1
  298. package/dist/cli/commands/instances.js +10 -1
  299. package/dist/cli/commands/prompt.d.ts.map +1 -1
  300. package/dist/cli/commands/prompt.js +5 -3
  301. package/dist/cli/commands/send.d.ts.map +1 -1
  302. package/dist/cli/commands/send.js +19 -6
  303. package/dist/cli/commands/verify.d.ts.map +1 -1
  304. package/dist/cli/commands/verify.js +8 -1
  305. package/dist/cli/commands/wait.d.ts.map +1 -1
  306. package/dist/cli/commands/wait.js +101 -13
  307. package/dist/cli/config/duration-constants.d.ts +16 -13
  308. package/dist/cli/config/duration-constants.d.ts.map +1 -1
  309. package/dist/cli/config/duration-constants.js +21 -21
  310. package/dist/cli/docs/agent-operations.d.ts +2 -2
  311. package/dist/cli/docs/agent-operations.d.ts.map +1 -1
  312. package/dist/cli/docs/agent-operations.js +29 -1
  313. package/dist/cli/types/api-responses.d.ts +145 -3
  314. package/dist/cli/types/api-responses.d.ts.map +1 -1
  315. package/dist/cli/types/index.d.ts +4 -0
  316. package/dist/cli/types/index.d.ts.map +1 -1
  317. package/dist/cli/utils/resource-resolvers.d.ts +0 -18
  318. package/dist/cli/utils/resource-resolvers.d.ts.map +1 -1
  319. package/dist/cli/utils/resource-resolvers.js +1 -51
  320. package/dist/cli/utils/verify-runner.d.ts +24 -1
  321. package/dist/cli/utils/verify-runner.d.ts.map +1 -1
  322. package/dist/cli/utils/verify-runner.js +54 -1
  323. package/dist/config/auto-yes-duration.d.ts +56 -0
  324. package/dist/config/auto-yes-duration.d.ts.map +1 -0
  325. package/dist/config/auto-yes-duration.js +76 -0
  326. package/dist/lib/polling/auto-yes-suppression-reason.d.ts +54 -2
  327. package/dist/lib/polling/auto-yes-suppression-reason.d.ts.map +1 -1
  328. package/dist/lib/polling/auto-yes-suppression-reason.js +33 -2
  329. package/dist/lib/prompt-observation/types.d.ts +13 -0
  330. package/dist/lib/prompt-observation/types.d.ts.map +1 -1
  331. package/dist/server/locales/en/worktree.json +2 -1
  332. package/dist/server/locales/ja/worktree.json +2 -1
  333. package/dist/server/src/config/auto-yes-config.js +14 -19
  334. package/dist/server/src/config/auto-yes-duration.js +76 -0
  335. package/dist/server/src/lib/auto-yes-poller-answer-target.js +38 -0
  336. package/dist/server/src/lib/auto-yes-poller-keys.js +35 -0
  337. package/dist/server/src/lib/auto-yes-poller-session-presence.js +26 -0
  338. package/dist/server/src/lib/auto-yes-poller-tick.js +233 -0
  339. package/dist/server/src/lib/auto-yes-poller.js +337 -376
  340. package/dist/server/src/lib/auto-yes-state.js +59 -4
  341. package/dist/server/src/lib/cli-tools/submit-verified-sender.js +235 -19
  342. package/dist/server/src/lib/db/chat-db.js +5 -1
  343. package/dist/server/src/lib/db/verification-db.js +23 -2
  344. package/dist/server/src/lib/detection/composer-text.js +215 -11
  345. package/dist/server/src/lib/detection/option-recommendation.js +120 -0
  346. package/dist/server/src/lib/detection/prompt-detect-multiple-choice-approval-context.js +290 -0
  347. package/dist/server/src/lib/detection/prompt-detect-multiple-choice-chrome.js +193 -0
  348. package/dist/server/src/lib/detection/prompt-detect-multiple-choice.js +402 -539
  349. package/dist/server/src/lib/detection/prompt-detector.js +92 -21
  350. package/dist/server/src/lib/detection/prompt-screen-key.js +60 -0
  351. package/dist/server/src/lib/detection/tools/antigravity/dialog.js +158 -35
  352. package/dist/server/src/lib/detection/tools/claude/detect.js +111 -10
  353. package/dist/server/src/lib/detection/tools/command-code/dialog.js +67 -0
  354. package/dist/server/src/lib/detection/tools/dialog-block.js +16 -0
  355. package/dist/server/src/lib/detection/upstream-faults.js +19 -2
  356. package/dist/server/src/lib/detection/waiting-screen-reading.js +98 -0
  357. package/dist/server/src/lib/hooks/permission-decision-service.js +7 -0
  358. package/dist/server/src/lib/hooks/structured-decision-response.js +1 -1
  359. package/dist/server/src/lib/polling/auto-yes-confirm-page.js +2 -2
  360. package/dist/server/src/lib/polling/auto-yes-confirmation-ledger-types.js +3 -0
  361. package/dist/server/src/lib/polling/auto-yes-confirmation-ledger.js +34 -3
  362. package/dist/server/src/lib/polling/auto-yes-decision-state.js +195 -0
  363. package/dist/server/src/lib/polling/auto-yes-dialog-gate.js +139 -10
  364. package/dist/server/src/lib/polling/auto-yes-enter-fallback.js +14 -0
  365. package/dist/server/src/lib/polling/auto-yes-manual-answer.js +124 -0
  366. package/dist/server/src/lib/polling/auto-yes-option-effect.js +157 -0
  367. package/dist/server/src/lib/polling/auto-yes-policy.js +11 -5
  368. package/dist/server/src/lib/polling/auto-yes-poller-capture.js +15 -2
  369. package/dist/server/src/lib/polling/auto-yes-poller-generation.js +42 -1
  370. package/dist/server/src/lib/polling/auto-yes-poller-receipt-log.js +42 -5
  371. package/dist/server/src/lib/polling/auto-yes-poller-state.js +147 -49
  372. package/dist/server/src/lib/polling/auto-yes-poller-steps.js +172 -2
  373. package/dist/server/src/lib/polling/auto-yes-prompt-suppression.js +2 -2
  374. package/dist/server/src/lib/polling/auto-yes-question-choice.js +57 -0
  375. package/dist/server/src/lib/polling/auto-yes-resolver.js +96 -21
  376. package/dist/server/src/lib/polling/auto-yes-suppression-reason.js +33 -2
  377. package/dist/server/src/lib/polling/auto-yes-suppression-state.js +25 -1
  378. package/dist/server/src/lib/polling/prompt-screen-reading.js +232 -0
  379. package/dist/server/src/lib/polling/response-checker-dialog-gate.js +39 -0
  380. package/dist/server/src/lib/polling/response-checker.js +145 -58
  381. package/dist/server/src/lib/prompt-answer-sender.js +104 -10
  382. package/dist/server/src/lib/push/notification-dedup.js +15 -2
  383. package/dist/server/src/lib/push/prompt-card-state.js +140 -19
  384. package/dist/server/src/lib/push/prompt-push-gate.js +158 -12
  385. package/dist/server/src/lib/push/push-sender.js +23 -3
  386. package/dist/server/src/lib/push/resolution-push-notifier.js +14 -0
  387. package/dist/server/src/lib/push/waiting-push-notifier.js +139 -17
  388. package/dist/server/src/lib/realtime/terminal-broadcast.js +16 -0
  389. package/dist/server/src/lib/session/agent-event-state.js +25 -5
  390. package/dist/server/src/lib/session/agent-event-turn.js +140 -46
  391. package/dist/server/src/lib/session/cli-session.js +21 -2
  392. package/dist/server/src/lib/session/composer-clear.js +56 -4
  393. package/dist/server/src/lib/session/current-output-builder.js +66 -12
  394. package/dist/server/src/lib/session/send-attempt-state.js +24 -7
  395. package/dist/server/src/lib/session/waiting-episode-binding-observation.js +289 -0
  396. package/dist/server/src/lib/session/waiting-episode-binding-resolve.js +38 -0
  397. package/dist/server/src/lib/session/waiting-episode-binding.js +276 -0
  398. package/dist/server/src/lib/session/waiting-episode-state-ops.js +152 -0
  399. package/dist/server/src/lib/session/waiting-episode-state-store.js +202 -0
  400. package/dist/server/src/lib/session/waiting-episode-state-types.js +6 -0
  401. package/dist/server/src/lib/session/waiting-episode-state.js +68 -91
  402. package/dist/server/src/lib/session/waiting-episode-verdict.js +174 -0
  403. package/dist/server/src/lib/tmux/tmux-capture-cache.js +76 -11
  404. package/dist/server/src/lib/tmux/tmux.js +79 -9
  405. package/dist/server/src/lib/verification/gate-runner.js +172 -16
  406. package/dist/server/src/lib/verification/machine-lock.js +5 -0
  407. package/dist/server/src/lib/ws-server.js +18 -3
  408. package/dist/server/src/types/auto-yes-answer-mode.js +38 -0
  409. package/dist/server/src/types/auto-yes-decision.js +61 -0
  410. package/dist/server/src/types/auto-yes.js +6 -0
  411. package/dist/server/src/types/prompt-reading.js +32 -0
  412. package/dist/types/auto-yes-answer-mode.d.ts +35 -0
  413. package/dist/types/auto-yes-answer-mode.d.ts.map +1 -0
  414. package/dist/types/auto-yes-answer-mode.js +38 -0
  415. package/docs/en/user-guide/webapp-guide.md +47 -13
  416. package/package.json +1 -1
  417. package/public/sw.js +76 -4
  418. package/release-notes/0.48.0.json +57 -0
  419. package/release-notes/0.49.0.json +45 -0
  420. package/.next/server/chunks/1559.js +0 -2
  421. package/.next/server/chunks/2460.js +0 -1
  422. package/.next/server/chunks/5595.js +0 -1
  423. package/.next/server/chunks/610.js +0 -1
  424. package/.next/server/chunks/6722.js +0 -1
  425. package/.next/static/chunks/5371-a549a0d2c2044d41.js +0 -1
  426. package/.next/static/chunks/602-1c1488959215e140.js +0 -1
  427. package/.next/static/chunks/6288-09feba367cc2c65e.js +0 -1
  428. package/.next/static/chunks/8407-155f84e5ba05f1d5.js +0 -1
  429. package/.next/static/chunks/9079-24f9fa549ed298f1.js +0 -1
  430. package/.next/static/chunks/app/sessions/page-e02f1adb1d1c1ccc.js +0 -1
  431. package/.next/static/chunks/app/worktrees/[id]/files/[...path]/page-9cf1ecc59e36a004.js +0 -1
  432. package/.next/static/chunks/app/worktrees/[id]/page-46aced20b2b1c010.js +0 -1
  433. /package/.next/static/{etorRtpxbQqqOzdUeXdw2 → 3_JtAZaKMJEDFIIfkHv4n}/_buildManifest.js +0 -0
  434. /package/.next/static/{etorRtpxbQqqOzdUeXdw2 → 3_JtAZaKMJEDFIIfkHv4n}/_ssgManifest.js +0 -0
@@ -22,8 +22,10 @@
22
22
  * ## The poller still notifies, and that is deliberate
23
23
  *
24
24
  * Contrary to the Issue's premise, the edge is *not* observed by a background
25
- * process: `observeWaitingEdge`'s only caller is `worktree-status-helper`, on
26
- * the worktree list / detail API probe. So the edge fires when a client is
25
+ * process: when #1790 was written, `observeWaitingEdge`'s only caller was
26
+ * `worktree-status-helper`, on the worktree list / detail API probe (Issue
27
+ * #3798 added the agent's own turn transitions as closers, not as openers). So
28
+ * the edge fires when a client is
27
29
  * looking, and moving push onto it *alone* would have swapped one blind spot
28
30
  * (no poller) for a worse one (nobody has the app open — the very situation a
29
31
  * phone notification is for). The poller therefore keeps its call, and
@@ -50,6 +52,30 @@
50
52
  * under whatever the episode is called at that point. One notification either
51
53
  * way — no correction push, and nothing at all if the wait ended meanwhile.
52
54
  *
55
+ * ## Which wait is which (Issue #3798)
56
+ *
57
+ * A wait is its episode's id, not its `since`: two waits can share a `since`,
58
+ * and the episode store can put a new wait in place of an old one in one step
59
+ * (`replaced`). So this subscribes with `onWaitingEpisodeTransition`, which
60
+ * says which of the three happened, and every re-read of the store — the end of
61
+ * a classification hold, the end of an Auto-Yes hold, the reminder — compares
62
+ * the id it reads with `getWaitingEpisodeRecord`. A replacement drops the old
63
+ * wait's timers and hold and starts the new wait's from scratch, and sends no
64
+ * resolution: nobody stopped waiting. A pending wait that came without an id
65
+ * (a test driving {@link handleWaitingTransition} with the #1786 shape) is
66
+ * compared by `since`, as before.
67
+ *
68
+ * A wait the Auto-Yes poller answered and has not yet seen gone is asked
69
+ * about again, a grace apart, for as long as it lasts (the gate's
70
+ * `auto-yes-answered`): it notifies only once it turns into a screen a person
71
+ * drives, and a replacement brings an edge of its own.
72
+ *
73
+ * A producer that fans out for the wait it is opening (the response poller,
74
+ * with the prompt's question to quote) commits the episode inside
75
+ * {@link fanOutAfterCommit}: the edge's gate runs after the producer's
76
+ * fan-out, so both name the episode the store just gave the wait and the
77
+ * producer's notification is the one the episode dedup lets through.
78
+ *
53
79
  * Everything here is advisory: a failure must not disturb the status read that
54
80
  * observed the edge (`emit` contains listener throws) nor the poller.
55
81
  *
@@ -57,6 +83,7 @@
57
83
  */
58
84
  Object.defineProperty(exports, "__esModule", { value: true });
59
85
  exports.CLASSIFICATION_GRACE_MS = exports.ESCALATION_TICK_MS = void 0;
86
+ exports.fanOutAfterCommit = fanOutAfterCommit;
60
87
  exports.handleWaitingTransition = handleWaitingTransition;
61
88
  exports.runEscalationTick = runEscalationTick;
62
89
  exports.startWaitingPushNotifier = startWaitingPushNotifier;
@@ -100,6 +127,17 @@ exports.ESCALATION_TICK_MS = 60_000;
100
127
  * still notify on the edge itself.
101
128
  */
102
129
  exports.CLASSIFICATION_GRACE_MS = 8_000;
130
+ /**
131
+ * The open episode, when it is still `wait` (Issue #3798): the same id, or —
132
+ * for a wait that came without one — the same `since`. Null when the wait is
133
+ * over or another one is open.
134
+ */
135
+ function currentEpisodeOf(wait) {
136
+ const episode = (0, waiting_episode_state_1.getWaitingEpisodeRecord)(wait.worktreeId, wait.cliToolId, wait.instanceId);
137
+ if (episode === null)
138
+ return null;
139
+ return (0, prompt_push_gate_1.isSameWait)(episode, wait) ? episode : null;
140
+ }
103
141
  const pending = (0, global_state_1.getOrInitGlobal)('__waitingPushPending', () => new Map());
104
142
  /** Composite key -> the timer holding that wait's first notification (#2156). */
105
143
  const graceTimers = (0, global_state_1.getOrInitGlobal)('__waitingPushGraceTimers', () => new Map());
@@ -109,6 +147,43 @@ const graceTimers = (0, global_state_1.getOrInitGlobal)('__waitingPushGraceTimer
109
147
  * that one is the classification hold of #2156, this one the Auto-Yes hold.
110
148
  */
111
149
  const answerGraceTimers = (0, global_state_1.getOrInitGlobal)('__waitingPushAnswerGraceTimers', () => new Map());
150
+ /**
151
+ * Composite key -> the edge gates held back while a producer commits the
152
+ * episode and fans out for it ({@link fanOutAfterCommit}, Issue #3798).
153
+ */
154
+ const deferredGates = (0, global_state_1.getOrInitGlobal)('__waitingPushDeferredGates', () => new Map());
155
+ /**
156
+ * Commit a waiting episode and fan out for it, in that order, with the gate
157
+ * the episode's own edge runs held back until the fan-out is done (Issue
158
+ * #3798). The producer then names the episode id the commit just created —
159
+ * to the gate and to the fan-out — and its notification, carrying what only
160
+ * the producer has (the prompt's question), claims the episode dedup before
161
+ * the edge's id-named one asks for the same episode. All synchronous: the
162
+ * held gates run before this returns, whatever the fan-out threw.
163
+ *
164
+ * @param commit - The store write; its edge reaches this module during it
165
+ * @param fanOut - Given what `commit` returned
166
+ * @returns What `commit` returned
167
+ */
168
+ function fanOutAfterCommit(parts, commit, fanOut) {
169
+ const key = (0, auto_yes_state_1.buildCompositeKey)(parts.worktreeId, parts.cliToolId, parts.instanceId);
170
+ const outermost = !deferredGates.has(key);
171
+ if (outermost)
172
+ deferredGates.set(key, []);
173
+ try {
174
+ const committed = commit();
175
+ fanOut(committed);
176
+ return committed;
177
+ }
178
+ finally {
179
+ if (outermost) {
180
+ const held = deferredGates.get(key) ?? [];
181
+ deferredGates.delete(key);
182
+ for (const run of held)
183
+ run();
184
+ }
185
+ }
186
+ }
112
187
  /**
113
188
  * The worktree's display name, for the notification title.
114
189
  *
@@ -136,6 +211,7 @@ async function sendWaitingPush(wait, escalated, now) {
136
211
  instanceId,
137
212
  waitingKind: wait.kind,
138
213
  waitingSince: wait.since,
214
+ waitingEpisodeId: wait.episodeId,
139
215
  escalated,
140
216
  },
141
217
  // The deciding tick's clock, not a fresh reading: the reminder's body
@@ -189,6 +265,7 @@ function gateAndSend(wait, now, recheck = false) {
189
265
  cliToolId: wait.cliToolId,
190
266
  instanceId: wait.instanceId,
191
267
  waitingSince: wait.since,
268
+ waitingEpisodeId: wait.episodeId,
192
269
  now,
193
270
  }, { recheck });
194
271
  if (decision.suppress) {
@@ -197,6 +274,10 @@ function gateAndSend(wait, now, recheck = false) {
197
274
  // by then and nothing is sent.
198
275
  if (decision.reason === 'auto-yes-answering')
199
276
  holdForAutoYesAnswer(wait, now);
277
+ // Issue #3798: answered, and not yet seen gone — ask again a grace later,
278
+ // so the screen a person drives that may follow still notifies.
279
+ else if (decision.reason === 'auto-yes-answered')
280
+ holdForAutoYesAnswer(wait, now, prompt_push_gate_1.AUTO_YES_ANSWER_GRACE_MS);
200
281
  return;
201
282
  }
202
283
  void sendWaitingPush(wait, false, now);
@@ -207,21 +288,29 @@ function gateAndSend(wait, now, recheck = false) {
207
288
  * answered — a screen the poller cannot read and records nothing about — stayed
208
289
  * silent until the escalation reminder, ten minutes later.
209
290
  */
210
- function holdForAutoYesAnswer(wait, now) {
291
+ function holdForAutoYesAnswer(wait, now, afterMs) {
211
292
  const key = (0, auto_yes_state_1.buildCompositeKey)(wait.worktreeId, wait.cliToolId, wait.instanceId);
212
293
  const existing = answerGraceTimers.get(key);
213
294
  if (existing !== undefined)
214
295
  clearTimeout(existing);
215
296
  // From the gate's own origin, not `since` (Issue #3757 review), and past the
216
- // poller's session-wait tick (Issue #3791). Capped at the grace, so a clock
297
+ // poller's session-wait tick or the duplicate guard's retry it reserved (Issue #3791). Capped at the grace, so a clock
217
298
  // that went backwards cannot arm an overflowing timer, and a longer hold is
218
299
  // asked about again every grace: a poller stopped meanwhile ends it then
219
300
  // rather than at a tick that will not come.
220
- const holdEndsAt = (0, prompt_push_gate_1.autoYesHoldEndsAt)({ worktreeId: wait.worktreeId, cliToolId: wait.cliToolId, instanceId: wait.instanceId, waitingSince: wait.since }, now);
221
- const delay = Math.min(prompt_push_gate_1.AUTO_YES_ANSWER_GRACE_MS, Math.max(0, holdEndsAt - now));
301
+ const holdEndsAt = (0, prompt_push_gate_1.autoYesHoldEndsAt)({
302
+ worktreeId: wait.worktreeId,
303
+ cliToolId: wait.cliToolId,
304
+ instanceId: wait.instanceId,
305
+ waitingSince: wait.since,
306
+ waitingEpisodeId: wait.episodeId,
307
+ }, now);
308
+ // Issue #3798: an answered wait whose hold is over is asked about again
309
+ // `afterMs` later; the hold's end is already behind it.
310
+ const delay = afterMs ?? Math.min(prompt_push_gate_1.AUTO_YES_ANSWER_GRACE_MS, Math.max(0, holdEndsAt - now));
222
311
  const timer = setTimeout(() => {
223
312
  answerGraceTimers.delete(key);
224
- releaseAutoYesHold(key, wait.since);
313
+ releaseAutoYesHold(key, wait);
225
314
  }, delay);
226
315
  // Never hold the process open for it, as with the other timers here.
227
316
  timer.unref?.();
@@ -231,15 +320,15 @@ function holdForAutoYesAnswer(wait, now) {
231
320
  * The Auto-Yes hold ended: notify unless the wait is over or is another one
232
321
  * (Issue #3757). Read from the episode store, as {@link releaseHeldWait} does.
233
322
  */
234
- function releaseAutoYesHold(key, since) {
323
+ function releaseAutoYesHold(key, wait) {
235
324
  const held = pending.get(key);
236
- if (held === undefined || held.since !== since)
325
+ if (held === undefined || !(0, prompt_push_gate_1.isSameWait)(held, wait))
237
326
  return;
238
- const episode = (0, waiting_episode_state_1.getWaitingEpisode)(held.worktreeId, held.cliToolId, held.instanceId);
239
- if (episode === null || episode.since !== held.since) {
327
+ const episode = currentEpisodeOf(held);
328
+ if (episode === null) {
240
329
  pending.delete(key);
241
330
  // Issue #3776: this episode's hold only — the next one may hold already.
242
- (0, prompt_push_gate_1.forgetAutoYesHold)(key, held.since);
331
+ (0, prompt_push_gate_1.forgetAutoYesHold)(key, { since: held.since, episodeId: held.episodeId });
243
332
  stopEscalationTimerIfIdle();
244
333
  return;
245
334
  }
@@ -264,8 +353,8 @@ function releaseHeldWait(key) {
264
353
  // Gone means the closing edge dropped it, or a reminder already claimed it.
265
354
  if (held === undefined)
266
355
  return;
267
- const episode = (0, waiting_episode_state_1.getWaitingEpisode)(held.worktreeId, held.cliToolId, held.instanceId);
268
- if (episode === null || episode.since !== held.since) {
356
+ const episode = currentEpisodeOf(held);
357
+ if (episode === null) {
269
358
  pending.delete(key);
270
359
  stopEscalationTimerIfIdle();
271
360
  return;
@@ -309,6 +398,7 @@ function handleWaitingTransition(transition) {
309
398
  if (!(0, vapid_1.isPushConfigured)())
310
399
  return;
311
400
  const key = (0, auto_yes_state_1.buildCompositeKey)(transition.worktreeId, transition.cliToolId, transition.instanceId);
401
+ const cause = 'cause' in transition ? transition.cause : null;
312
402
  if (!transition.waiting || transition.since === null) {
313
403
  // Issue #2156: a wait still inside its grace is answered, not notified.
314
404
  cancelGrace(key);
@@ -335,11 +425,22 @@ function handleWaitingTransition(transition) {
335
425
  });
336
426
  return;
337
427
  }
428
+ // Issue #3798: a new wait in place of the old one. The old wait's holds and
429
+ // timers go — it is over — and no resolution is sent: nobody stopped
430
+ // waiting, and the new wait's card is about to replace the old one anyway.
431
+ if (cause === 'replaced') {
432
+ const old = pending.get(key);
433
+ cancelGrace(key);
434
+ pending.delete(key);
435
+ const previousEpisodeId = 'previousEpisodeId' in transition ? transition.previousEpisodeId : null;
436
+ (0, prompt_push_gate_1.forgetAutoYesHold)(key, { since: old?.since ?? transition.since, episodeId: previousEpisodeId ?? old?.episodeId });
437
+ }
338
438
  const wait = {
339
439
  worktreeId: transition.worktreeId,
340
440
  cliToolId: transition.cliToolId,
341
441
  instanceId: transition.instanceId,
342
442
  since: transition.since,
443
+ episodeId: episodeIdOf(transition),
343
444
  kind: transition.kind,
344
445
  };
345
446
  // Issue #1999: the wait is tracked and the reminder armed either way — only
@@ -362,8 +463,27 @@ function handleWaitingTransition(transition) {
362
463
  graceTimers.set(key, timer);
363
464
  return;
364
465
  }
466
+ // Issue #3798: a producer is fanning out for this very edge; its gate runs
467
+ // after that (`fanOutAfterCommit`).
468
+ const held = deferredGates.get(key);
469
+ if (held !== undefined) {
470
+ held.push(() => gateAndSend(wait, transition.at));
471
+ return;
472
+ }
365
473
  gateAndSend(wait, transition.at);
366
474
  }
475
+ /**
476
+ * The id of the wait an opening edge is about (Issue #3798). The episode edge
477
+ * carries it; an edge in the #1786 shape (a test calling
478
+ * {@link handleWaitingTransition} directly) is matched to the open episode by
479
+ * its `since`, read with `getWaitingEpisodeRecord`.
480
+ */
481
+ function episodeIdOf(transition) {
482
+ if ('episodeId' in transition)
483
+ return transition.episodeId;
484
+ const episode = (0, waiting_episode_state_1.getWaitingEpisodeRecord)(transition.worktreeId, transition.cliToolId, transition.instanceId);
485
+ return episode !== null && episode.since === transition.since ? episode.episodeId : null;
486
+ }
367
487
  /**
368
488
  * Re-notify every wait that has outlived the threshold, once each.
369
489
  *
@@ -381,8 +501,8 @@ function runEscalationTick(now = Date.now()) {
381
501
  // still going: it is written by the status probe, so an answer given in
382
502
  // another tab — or a wait whose closing edge this module never saw — is
383
503
  // caught here even when `pending` still lists it.
384
- const episode = (0, waiting_episode_state_1.getWaitingEpisode)(wait.worktreeId, wait.cliToolId, wait.instanceId);
385
- if (episode === null || episode.since !== wait.since) {
504
+ const episode = currentEpisodeOf(wait);
505
+ if (episode === null) {
386
506
  pending.delete(key);
387
507
  continue;
388
508
  }
@@ -401,6 +521,7 @@ function runEscalationTick(now = Date.now()) {
401
521
  cliToolId: wait.cliToolId,
402
522
  instanceId: wait.instanceId,
403
523
  waitingSince: wait.since,
524
+ waitingEpisodeId: wait.episodeId,
404
525
  escalated: true,
405
526
  })) {
406
527
  continue;
@@ -424,7 +545,8 @@ function runEscalationTick(now = Date.now()) {
424
545
  */
425
546
  function startWaitingPushNotifier() {
426
547
  stopWaitingPushNotifier();
427
- const unsubscribe = (0, waiting_episode_state_1.onWaitingTransition)((transition) => {
548
+ // Issue #3798: the episode edge, so a replacement is told from a new wait.
549
+ const unsubscribe = (0, waiting_episode_state_1.onWaitingEpisodeTransition)((transition) => {
428
550
  handleWaitingTransition(transition);
429
551
  });
430
552
  globalThis.__waitingPushUnsubscribe = unsubscribe;
@@ -88,6 +88,17 @@ function snapshotFingerprint(payload) {
88
88
  // Issue #3397: so "Auto-Yes sent Enter" (and its `no-effect` follow-up)
89
89
  // reaches the push even when the frame did not change.
90
90
  payload.autoYes?.lastEnterFallback ?? null,
91
+ // Issue #3821: so a decision that changed on a screen that did not
92
+ // (`answering` -> `withheld` on the next tick, say) reaches the push, and
93
+ // the answer panel opens without waiting for the HTTP poll. State and
94
+ // reason only: `observedAt` moves on every build. And the confirmation it
95
+ // is about, so a decision moved to another approval target is pushed too.
96
+ payload.autoYesDecision?.state ?? null,
97
+ payload.autoYesDecision?.reason ?? null,
98
+ payload.autoYesDecision?.confirmation ?? null,
99
+ // Issue #3863: so a mode change on a screen that did not change reaches the
100
+ // push too (the answer mode decides whether a question waits for a human).
101
+ payload.autoYesAnswerMode ?? null,
91
102
  payload.isSelectionListActive ?? false,
92
103
  payload.isPagerActive ?? false,
93
104
  // Issue #2369: in the fingerprint for the same reason `sessionStatus` is —
@@ -156,6 +167,11 @@ function emitTerminalSnapshot(worktreeId, cliToolId, payload, instanceId) {
156
167
  // Issue #3397: straight through, like `promptAnswerable` — undefined (and so
157
168
  // off the wire) when the payload carries no `autoYes`.
158
169
  autoYesEnterFallback: payload.autoYes?.lastEnterFallback,
170
+ // Issue #3821: straight through as well — absent when the session is not
171
+ // running (the payload carries none then).
172
+ autoYesDecision: payload.autoYesDecision,
173
+ // Issue #3863: straight through — the key is absent while Auto-Yes is off.
174
+ ...(payload.autoYesAnswerMode !== undefined ? { autoYesAnswerMode: payload.autoYesAnswerMode } : {}),
159
175
  isSelectionListActive: payload.isSelectionListActive ?? false,
160
176
  isPagerActive: payload.isPagerActive ?? false,
161
177
  isDismissablePanelActive: payload.isDismissablePanelActive ?? false,
@@ -60,6 +60,11 @@ const agent_event_dedup_1 = require("../../lib/session/agent-event-dedup");
60
60
  const agent_event_model_1 = require("../../lib/session/agent-event-model");
61
61
  const provisional_turn_1 = require("../../lib/session/provisional-turn");
62
62
  const agent_event_turn_1 = require("../../lib/session/agent-event-turn");
63
+ // Issue #3798: the waiting episode follows the turn in the same synchronous
64
+ // step. Imported for its effect too — it registers the binding resolver the
65
+ // episode store uses — so every bundle that records an event or reads a
66
+ // status (both reach this module) has it.
67
+ const waiting_episode_binding_1 = require("../../lib/session/waiting-episode-binding");
63
68
  const agent_event_structured_state_1 = require("../../lib/session/agent-event-structured-state");
64
69
  const agent_event_awaiting_instruction_1 = require("../../lib/session/agent-event-awaiting-instruction");
65
70
  const agent_event_ask_user_question_1 = require("../../lib/session/agent-event-ask-user-question");
@@ -219,6 +224,7 @@ function recordAgentEvent(worktreeId, cliToolId, instanceId, record, options = {
219
224
  return { recorded: false, skipped: 'late-session-start' };
220
225
  }
221
226
  lastAgentEvent.set(key, record);
227
+ const outcomes = [];
222
228
  if (record.event === 'session_start') {
223
229
  // Issue #2357: a new agent process, whatever model it names first is its
224
230
  // STARTING model — recorded below, announced to nobody. Dropped before the
@@ -246,12 +252,17 @@ function recordAgentEvent(worktreeId, cliToolId, instanceId, record, options = {
246
252
  // here rather than inside the transition below so the two paths into a new
247
253
  // generation — this one and `beginAgentEventGeneration` — close the turn in
248
254
  // exactly one place.
249
- (0, agent_event_turn_1.fenceTurnForNewGeneration)(key, record.at);
255
+ outcomes.push((0, agent_event_turn_1.fenceTurnForNewGeneration)(key, record.at, 'session-start'));
250
256
  }
251
257
  // Issue #1930: after the generation is settled, so a turn opened by this
252
258
  // event belongs to the generation the event itself opened.
253
- (0, agent_event_turn_1.applyTurnTransition)(key, record);
259
+ outcomes.push((0, agent_event_turn_1.applyTurnTransition)(key, record));
254
260
  (0, agent_event_awaiting_instruction_1.applyAwaitingInstructionTransition)(key, record);
261
+ // Issue #3798: last, once every map above says what this delivery did, so
262
+ // an edge's listeners read the state the delivery left. The stop is recorded,
263
+ // the turn ended and its wait closed in this one synchronous step; whatever
264
+ // the caller awaits next (`applyAgentStopEvent`) never touches the episode.
265
+ (0, waiting_episode_binding_1.applyTurnOutcomesToEpisode)({ worktreeId, cliToolId, instanceId }, outcomes);
255
266
  return { recorded: true };
256
267
  }
257
268
  /**
@@ -287,7 +298,7 @@ function beginAgentEventGeneration(worktreeId, cliToolId, instanceId, at = Date.
287
298
  // `closedBy: 'generation'`, so `capture --json` can say why it ended instead
288
299
  // of going quiet. The dialogs #1725 kept in a map of their own live on that
289
300
  // record now, which is what makes this one call retire both.
290
- (0, agent_event_turn_1.fenceTurnForNewGeneration)(key, at);
301
+ const fenced = (0, agent_event_turn_1.fenceTurnForNewGeneration)(key, at, 'process-start');
291
302
  // Same reasoning for the question that dialog was asking (Issue #1726).
292
303
  agent_event_ask_user_question_1.askUserQuestion.delete(key);
293
304
  // And for "waiting for your input" (Issue #1786): a new process has not asked
@@ -317,6 +328,8 @@ function beginAgentEventGeneration(worktreeId, cliToolId, instanceId, at = Date.
317
328
  // has just been replaced. Unlike the time-window keys, they never expire on
318
329
  // their own, so a generation is the only thing that retires them.
319
330
  agent_event_dedup_1.recentEventIdentities.delete(key);
331
+ // Issue #3798: and the wait the replaced process was in (design T19).
332
+ (0, waiting_episode_binding_1.applyTurnOutcomesToEpisode)({ worktreeId, cliToolId, instanceId }, [fenced], at);
320
333
  }
321
334
  /**
322
335
  * @returns Epoch ms the current generation began, or null when no generation
@@ -381,7 +394,7 @@ exports.STRUCTURED_PROMPT_PROVISIONAL_MAX_AGE_MS = provisional_turn_1.DIALOG_PEN
381
394
  */
382
395
  function reportPermissionRequestPending(worktreeId, cliToolId, instanceId, toolName, at = Date.now()) {
383
396
  const key = (0, auto_yes_state_1.buildCompositeKey)(worktreeId, cliToolId, instanceId);
384
- (0, agent_event_turn_1.openDecision)(key, (0, agent_event_turn_1.currentGeneration)(key), {
397
+ const opened = (0, agent_event_turn_1.openDecision)(key, (0, agent_event_turn_1.currentGeneration)(key), {
385
398
  source: 'permission-request',
386
399
  at,
387
400
  message: null,
@@ -396,6 +409,9 @@ function reportPermissionRequestPending(worktreeId, cliToolId, instanceId, toolN
396
409
  // is unaffected — that reads `getLastAgentEvent`, which nothing here writes.
397
410
  bootstrapDisplay: { event: 'notification', at, detail: 'permission_prompt' },
398
411
  });
412
+ // Issue #3798 (design R3-6): a decision opened outside `recordAgentEvent`
413
+ // tells the waiting episode itself.
414
+ (0, waiting_episode_binding_1.applyTurnOutcomesToEpisode)({ worktreeId, cliToolId, instanceId }, [{ kind: 'decision-opened', ...opened }]);
399
415
  }
400
416
  /**
401
417
  * Report that a QUESTION dialog is open, naming the decision it is answered by
@@ -437,7 +453,7 @@ function reportPermissionRequestPending(worktreeId, cliToolId, instanceId, toolN
437
453
  */
438
454
  function reportQuestionPending(worktreeId, cliToolId, instanceId, input, at = Date.now()) {
439
455
  const key = (0, auto_yes_state_1.buildCompositeKey)(worktreeId, cliToolId, instanceId);
440
- (0, agent_event_turn_1.openDecision)(key, (0, agent_event_turn_1.currentGeneration)(key), {
456
+ const opened = (0, agent_event_turn_1.openDecision)(key, (0, agent_event_turn_1.currentGeneration)(key), {
441
457
  source: 'notification',
442
458
  at,
443
459
  // The question TEXT is not the dialog's `message`: it is published as
@@ -451,6 +467,8 @@ function reportQuestionPending(worktreeId, cliToolId, instanceId, input, at = Da
451
467
  decisionId: input.decisionId,
452
468
  bootstrapDisplay: { event: 'notification', at, detail: input.detail },
453
469
  });
470
+ // Issue #3798 (design R3-6): as for the forecast above.
471
+ (0, waiting_episode_binding_1.applyTurnOutcomesToEpisode)({ worktreeId, cliToolId, instanceId }, [{ kind: 'decision-opened', ...opened }]);
454
472
  }
455
473
  /**
456
474
  * The open dialog this instance's structured events imply, or null.
@@ -534,4 +552,6 @@ function clearAgentStopEvents() {
534
552
  // listener set is deliberately NOT cleared — a subscription belongs to the
535
553
  // process, not to a session, and a suite that armed one expects it to stay.
536
554
  agent_event_model_1.modelBaseline.clear();
555
+ // Issue #3798: and which generation last heard a hook stop.
556
+ (0, waiting_episode_binding_1.clearWaitingEpisodeBindingState)();
537
557
  }