commandmate 0.49.1 → 0.49.2

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 (456) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-build-manifest.json +128 -132
  3. package/.next/app-path-routes-manifest.json +22 -22
  4. package/.next/build-manifest.json +2 -2
  5. package/.next/prerender-manifest.json +12 -12
  6. package/.next/required-server-files.json +1 -1
  7. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  8. package/.next/server/app/api/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_client-reference-manifest.js +1 -1
  12. package/.next/server/app/api/app/update-check/route_client-reference-manifest.js +1 -1
  13. package/.next/server/app/api/auth/login/route_client-reference-manifest.js +1 -1
  14. package/.next/server/app/api/auth/logout/route_client-reference-manifest.js +1 -1
  15. package/.next/server/app/api/auth/status/route_client-reference-manifest.js +1 -1
  16. package/.next/server/app/api/capabilities/route.js +1 -1
  17. package/.next/server/app/api/capabilities/route_client-reference-manifest.js +1 -1
  18. package/.next/server/app/api/daily-summary/route_client-reference-manifest.js +1 -1
  19. package/.next/server/app/api/daily-summary/status/route_client-reference-manifest.js +1 -1
  20. package/.next/server/app/api/external-apps/[id]/health/route_client-reference-manifest.js +1 -1
  21. package/.next/server/app/api/external-apps/[id]/route_client-reference-manifest.js +1 -1
  22. package/.next/server/app/api/external-apps/route_client-reference-manifest.js +1 -1
  23. package/.next/server/app/api/fs/browse/route_client-reference-manifest.js +1 -1
  24. package/.next/server/app/api/fs/recent-paths/route_client-reference-manifest.js +1 -1
  25. package/.next/server/app/api/hooks/agent-event/route.js +2 -2
  26. package/.next/server/app/api/hooks/agent-event/route.js.nft.json +1 -1
  27. package/.next/server/app/api/hooks/agent-event/route_client-reference-manifest.js +1 -1
  28. package/.next/server/app/api/hooks/claude-done/route.js +2 -2
  29. package/.next/server/app/api/hooks/claude-done/route.js.nft.json +1 -1
  30. package/.next/server/app/api/hooks/claude-done/route_client-reference-manifest.js +1 -1
  31. package/.next/server/app/api/hooks/permission-request/route.js +1 -1
  32. package/.next/server/app/api/hooks/permission-request/route.js.nft.json +1 -1
  33. package/.next/server/app/api/hooks/permission-request/route_client-reference-manifest.js +1 -1
  34. package/.next/server/app/api/metrics/vibe/route_client-reference-manifest.js +1 -1
  35. package/.next/server/app/api/ollama/models/route_client-reference-manifest.js +1 -1
  36. package/.next/server/app/api/push/escalation/route_client-reference-manifest.js +1 -1
  37. package/.next/server/app/api/push/subscriptions/route.js +1 -1
  38. package/.next/server/app/api/push/subscriptions/route_client-reference-manifest.js +1 -1
  39. package/.next/server/app/api/push/vapid/route_client-reference-manifest.js +1 -1
  40. package/.next/server/app/api/relays/[relayId]/cancel/route.js +1 -1
  41. package/.next/server/app/api/relays/[relayId]/cancel/route.js.nft.json +1 -1
  42. package/.next/server/app/api/relays/[relayId]/cancel/route_client-reference-manifest.js +1 -1
  43. package/.next/server/app/api/relays/[relayId]/route_client-reference-manifest.js +1 -1
  44. package/.next/server/app/api/relays/route.js +1 -1
  45. package/.next/server/app/api/relays/route.js.nft.json +1 -1
  46. package/.next/server/app/api/relays/route_client-reference-manifest.js +1 -1
  47. package/.next/server/app/api/remote/pair/route_client-reference-manifest.js +1 -1
  48. package/.next/server/app/api/repositories/[id]/route_client-reference-manifest.js +1 -1
  49. package/.next/server/app/api/repositories/clone/[jobId]/route.js +1 -1
  50. package/.next/server/app/api/repositories/clone/[jobId]/route.js.nft.json +1 -1
  51. package/.next/server/app/api/repositories/clone/[jobId]/route_client-reference-manifest.js +1 -1
  52. package/.next/server/app/api/repositories/clone/route.js +1 -1
  53. package/.next/server/app/api/repositories/clone/route.js.nft.json +1 -1
  54. package/.next/server/app/api/repositories/clone/route_client-reference-manifest.js +1 -1
  55. package/.next/server/app/api/repositories/excluded/route_client-reference-manifest.js +1 -1
  56. package/.next/server/app/api/repositories/restore/route.js +1 -1
  57. package/.next/server/app/api/repositories/restore/route.js.nft.json +1 -1
  58. package/.next/server/app/api/repositories/restore/route_client-reference-manifest.js +1 -1
  59. package/.next/server/app/api/repositories/route.js +1 -1
  60. package/.next/server/app/api/repositories/route.js.nft.json +1 -1
  61. package/.next/server/app/api/repositories/route_client-reference-manifest.js +1 -1
  62. package/.next/server/app/api/repositories/scan/route.js +1 -1
  63. package/.next/server/app/api/repositories/scan/route.js.nft.json +1 -1
  64. package/.next/server/app/api/repositories/scan/route_client-reference-manifest.js +1 -1
  65. package/.next/server/app/api/repositories/sync/route.js +1 -1
  66. package/.next/server/app/api/repositories/sync/route.js.nft.json +1 -1
  67. package/.next/server/app/api/repositories/sync/route_client-reference-manifest.js +1 -1
  68. package/.next/server/app/api/repositories/validate-path/route_client-reference-manifest.js +1 -1
  69. package/.next/server/app/api/settings/default-agents/route.js +1 -1
  70. package/.next/server/app/api/settings/default-agents/route.js.nft.json +1 -1
  71. package/.next/server/app/api/settings/default-agents/route_client-reference-manifest.js +1 -1
  72. package/.next/server/app/api/settings/default-surface-mode/route_client-reference-manifest.js +1 -1
  73. package/.next/server/app/api/sidebar/group-order/route_client-reference-manifest.js +1 -1
  74. package/.next/server/app/api/skills/[id]/route_client-reference-manifest.js +1 -1
  75. package/.next/server/app/api/skills/installations/route_client-reference-manifest.js +1 -1
  76. package/.next/server/app/api/skills/operations/route_client-reference-manifest.js +1 -1
  77. package/.next/server/app/api/skills/reindex/route_client-reference-manifest.js +1 -1
  78. package/.next/server/app/api/skills/route_client-reference-manifest.js +1 -1
  79. package/.next/server/app/api/slash-commands/route_client-reference-manifest.js +1 -1
  80. package/.next/server/app/api/tasks/[taskId]/cancel/route_client-reference-manifest.js +1 -1
  81. package/.next/server/app/api/tasks/[taskId]/route.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.js +1 -1
  86. package/.next/server/app/api/verification/runs/[runId]/route_client-reference-manifest.js +1 -1
  87. package/.next/server/app/api/verification/runs/route.js +1 -1
  88. package/.next/server/app/api/verification/runs/route_client-reference-manifest.js +1 -1
  89. package/.next/server/app/api/worktrees/[id]/auto-yes/route.js +1 -1
  90. package/.next/server/app/api/worktrees/[id]/auto-yes/route.js.nft.json +1 -1
  91. package/.next/server/app/api/worktrees/[id]/auto-yes/route_client-reference-manifest.js +1 -1
  92. package/.next/server/app/api/worktrees/[id]/capture/route.js +1 -1
  93. package/.next/server/app/api/worktrees/[id]/capture/route.js.nft.json +1 -1
  94. package/.next/server/app/api/worktrees/[id]/capture/route_client-reference-manifest.js +1 -1
  95. package/.next/server/app/api/worktrees/[id]/clear-composer/route.js +1 -1
  96. package/.next/server/app/api/worktrees/[id]/clear-composer/route.js.nft.json +1 -1
  97. package/.next/server/app/api/worktrees/[id]/clear-composer/route_client-reference-manifest.js +1 -1
  98. package/.next/server/app/api/worktrees/[id]/cli-reference/route.js +1 -1
  99. package/.next/server/app/api/worktrees/[id]/cli-reference/route_client-reference-manifest.js +1 -1
  100. package/.next/server/app/api/worktrees/[id]/cli-tool/route.js +1 -1
  101. package/.next/server/app/api/worktrees/[id]/cli-tool/route_client-reference-manifest.js +1 -1
  102. package/.next/server/app/api/worktrees/[id]/cmate/schedules/route.js +1 -1
  103. package/.next/server/app/api/worktrees/[id]/cmate/schedules/route_client-reference-manifest.js +1 -1
  104. package/.next/server/app/api/worktrees/[id]/current-output/route.js +1 -1
  105. package/.next/server/app/api/worktrees/[id]/current-output/route.js.nft.json +1 -1
  106. package/.next/server/app/api/worktrees/[id]/current-output/route_client-reference-manifest.js +1 -1
  107. package/.next/server/app/api/worktrees/[id]/direct-input/route.js +1 -1
  108. package/.next/server/app/api/worktrees/[id]/direct-input/route.js.nft.json +1 -1
  109. package/.next/server/app/api/worktrees/[id]/direct-input/route_client-reference-manifest.js +1 -1
  110. package/.next/server/app/api/worktrees/[id]/env/route.js +1 -1
  111. package/.next/server/app/api/worktrees/[id]/env/route_client-reference-manifest.js +1 -1
  112. package/.next/server/app/api/worktrees/[id]/execution-logs/[logId]/route.js +1 -1
  113. package/.next/server/app/api/worktrees/[id]/execution-logs/[logId]/route_client-reference-manifest.js +1 -1
  114. package/.next/server/app/api/worktrees/[id]/execution-logs/route.js +1 -1
  115. package/.next/server/app/api/worktrees/[id]/execution-logs/route_client-reference-manifest.js +1 -1
  116. package/.next/server/app/api/worktrees/[id]/files/[...path]/route_client-reference-manifest.js +1 -1
  117. package/.next/server/app/api/worktrees/[id]/git/branch/create/route.js +1 -1
  118. package/.next/server/app/api/worktrees/[id]/git/branch/create/route_client-reference-manifest.js +1 -1
  119. package/.next/server/app/api/worktrees/[id]/git/branch/delete/route.js +1 -1
  120. package/.next/server/app/api/worktrees/[id]/git/branch/delete/route_client-reference-manifest.js +1 -1
  121. package/.next/server/app/api/worktrees/[id]/git/branches/route.js +1 -1
  122. package/.next/server/app/api/worktrees/[id]/git/branches/route_client-reference-manifest.js +1 -1
  123. package/.next/server/app/api/worktrees/[id]/git/checkout/route.js +1 -1
  124. package/.next/server/app/api/worktrees/[id]/git/checkout/route_client-reference-manifest.js +1 -1
  125. package/.next/server/app/api/worktrees/[id]/git/commit/route.js +1 -1
  126. package/.next/server/app/api/worktrees/[id]/git/commit/route_client-reference-manifest.js +1 -1
  127. package/.next/server/app/api/worktrees/[id]/git/diff/route.js +1 -1
  128. package/.next/server/app/api/worktrees/[id]/git/diff/route_client-reference-manifest.js +1 -1
  129. package/.next/server/app/api/worktrees/[id]/git/fetch/route.js +1 -1
  130. package/.next/server/app/api/worktrees/[id]/git/fetch/route_client-reference-manifest.js +1 -1
  131. package/.next/server/app/api/worktrees/[id]/git/log/route.js +1 -1
  132. package/.next/server/app/api/worktrees/[id]/git/log/route_client-reference-manifest.js +1 -1
  133. package/.next/server/app/api/worktrees/[id]/git/pull/route.js +1 -1
  134. package/.next/server/app/api/worktrees/[id]/git/pull/route_client-reference-manifest.js +1 -1
  135. package/.next/server/app/api/worktrees/[id]/git/push/route.js +1 -1
  136. package/.next/server/app/api/worktrees/[id]/git/push/route_client-reference-manifest.js +1 -1
  137. package/.next/server/app/api/worktrees/[id]/git/reset/route.js +1 -1
  138. package/.next/server/app/api/worktrees/[id]/git/reset/route_client-reference-manifest.js +1 -1
  139. package/.next/server/app/api/worktrees/[id]/git/revert/route.js +1 -1
  140. package/.next/server/app/api/worktrees/[id]/git/revert/route_client-reference-manifest.js +1 -1
  141. package/.next/server/app/api/worktrees/[id]/git/show/[commitHash]/route.js +1 -1
  142. package/.next/server/app/api/worktrees/[id]/git/show/[commitHash]/route_client-reference-manifest.js +1 -1
  143. package/.next/server/app/api/worktrees/[id]/git/stage/route.js +1 -1
  144. package/.next/server/app/api/worktrees/[id]/git/stage/route_client-reference-manifest.js +1 -1
  145. package/.next/server/app/api/worktrees/[id]/git/staged/route.js +1 -1
  146. package/.next/server/app/api/worktrees/[id]/git/staged/route_client-reference-manifest.js +1 -1
  147. package/.next/server/app/api/worktrees/[id]/git/stash/[index]/route.js +1 -1
  148. package/.next/server/app/api/worktrees/[id]/git/stash/[index]/route_client-reference-manifest.js +1 -1
  149. package/.next/server/app/api/worktrees/[id]/git/stash/apply/route.js +1 -1
  150. package/.next/server/app/api/worktrees/[id]/git/stash/apply/route_client-reference-manifest.js +1 -1
  151. package/.next/server/app/api/worktrees/[id]/git/stash/pop/route.js +1 -1
  152. package/.next/server/app/api/worktrees/[id]/git/stash/pop/route_client-reference-manifest.js +1 -1
  153. package/.next/server/app/api/worktrees/[id]/git/stash/push/route.js +1 -1
  154. package/.next/server/app/api/worktrees/[id]/git/stash/push/route_client-reference-manifest.js +1 -1
  155. package/.next/server/app/api/worktrees/[id]/git/stash/route.js +1 -1
  156. package/.next/server/app/api/worktrees/[id]/git/stash/route_client-reference-manifest.js +1 -1
  157. package/.next/server/app/api/worktrees/[id]/git/status/route.js +1 -1
  158. package/.next/server/app/api/worktrees/[id]/git/status/route_client-reference-manifest.js +1 -1
  159. package/.next/server/app/api/worktrees/[id]/git/unstage/route.js +1 -1
  160. package/.next/server/app/api/worktrees/[id]/git/unstage/route_client-reference-manifest.js +1 -1
  161. package/.next/server/app/api/worktrees/[id]/git/working-diff/route.js +1 -1
  162. package/.next/server/app/api/worktrees/[id]/git/working-diff/route_client-reference-manifest.js +1 -1
  163. package/.next/server/app/api/worktrees/[id]/instances/notes/route.js +1 -1
  164. package/.next/server/app/api/worktrees/[id]/instances/notes/route_client-reference-manifest.js +1 -1
  165. package/.next/server/app/api/worktrees/[id]/instances/opencode/route.js +1 -1
  166. package/.next/server/app/api/worktrees/[id]/instances/opencode/route.js.nft.json +1 -1
  167. package/.next/server/app/api/worktrees/[id]/instances/opencode/route_client-reference-manifest.js +1 -1
  168. package/.next/server/app/api/worktrees/[id]/interrupt/route.js +1 -1
  169. package/.next/server/app/api/worktrees/[id]/interrupt/route.js.nft.json +1 -1
  170. package/.next/server/app/api/worktrees/[id]/interrupt/route_client-reference-manifest.js +1 -1
  171. package/.next/server/app/api/worktrees/[id]/kill-session/route.js +2 -1
  172. package/.next/server/app/api/worktrees/[id]/kill-session/route.js.nft.json +1 -1
  173. package/.next/server/app/api/worktrees/[id]/kill-session/route_client-reference-manifest.js +1 -1
  174. package/.next/server/app/api/worktrees/[id]/logs/[filename]/route.js +1 -1
  175. package/.next/server/app/api/worktrees/[id]/logs/[filename]/route.js.nft.json +1 -1
  176. package/.next/server/app/api/worktrees/[id]/logs/[filename]/route_client-reference-manifest.js +1 -1
  177. package/.next/server/app/api/worktrees/[id]/logs/route.js +2 -2
  178. package/.next/server/app/api/worktrees/[id]/logs/route.js.nft.json +1 -1
  179. package/.next/server/app/api/worktrees/[id]/logs/route_client-reference-manifest.js +1 -1
  180. package/.next/server/app/api/worktrees/[id]/marp-render/route.js +1 -1
  181. package/.next/server/app/api/worktrees/[id]/marp-render/route_client-reference-manifest.js +1 -1
  182. package/.next/server/app/api/worktrees/[id]/memos/[memoId]/route.js +1 -1
  183. package/.next/server/app/api/worktrees/[id]/memos/[memoId]/route_client-reference-manifest.js +1 -1
  184. package/.next/server/app/api/worktrees/[id]/memos/route.js +1 -1
  185. package/.next/server/app/api/worktrees/[id]/memos/route_client-reference-manifest.js +1 -1
  186. package/.next/server/app/api/worktrees/[id]/messages/route.js +1 -1
  187. package/.next/server/app/api/worktrees/[id]/messages/route_client-reference-manifest.js +1 -1
  188. package/.next/server/app/api/worktrees/[id]/opencode/diff/route.js +1 -1
  189. package/.next/server/app/api/worktrees/[id]/opencode/diff/route.js.nft.json +1 -1
  190. package/.next/server/app/api/worktrees/[id]/opencode/diff/route_client-reference-manifest.js +1 -1
  191. package/.next/server/app/api/worktrees/[id]/opencode/session/route.js +1 -1
  192. package/.next/server/app/api/worktrees/[id]/opencode/session/route.js.nft.json +1 -1
  193. package/.next/server/app/api/worktrees/[id]/opencode/session/route_client-reference-manifest.js +1 -1
  194. package/.next/server/app/api/worktrees/[id]/opencode/share/route.js +1 -1
  195. package/.next/server/app/api/worktrees/[id]/opencode/share/route.js.nft.json +1 -1
  196. package/.next/server/app/api/worktrees/[id]/opencode/share/route_client-reference-manifest.js +1 -1
  197. package/.next/server/app/api/worktrees/[id]/prompt-response/route.js +1 -1
  198. package/.next/server/app/api/worktrees/[id]/prompt-response/route.js.nft.json +1 -1
  199. package/.next/server/app/api/worktrees/[id]/prompt-response/route_client-reference-manifest.js +1 -1
  200. package/.next/server/app/api/worktrees/[id]/prompt-response/strict/route.js +1 -1
  201. package/.next/server/app/api/worktrees/[id]/prompt-response/strict/route.js.nft.json +1 -1
  202. package/.next/server/app/api/worktrees/[id]/prompt-response/strict/route_client-reference-manifest.js +1 -1
  203. package/.next/server/app/api/worktrees/[id]/resolve-target/route.js +1 -1
  204. package/.next/server/app/api/worktrees/[id]/resolve-target/route_client-reference-manifest.js +1 -1
  205. package/.next/server/app/api/worktrees/[id]/respond/route.js +1 -1
  206. package/.next/server/app/api/worktrees/[id]/respond/route.js.nft.json +1 -1
  207. package/.next/server/app/api/worktrees/[id]/respond/route_client-reference-manifest.js +1 -1
  208. package/.next/server/app/api/worktrees/[id]/route.js +1 -1
  209. package/.next/server/app/api/worktrees/[id]/route.js.nft.json +1 -1
  210. package/.next/server/app/api/worktrees/[id]/route_client-reference-manifest.js +1 -1
  211. package/.next/server/app/api/worktrees/[id]/schedules/[scheduleId]/route.js +1 -1
  212. package/.next/server/app/api/worktrees/[id]/schedules/[scheduleId]/route_client-reference-manifest.js +1 -1
  213. package/.next/server/app/api/worktrees/[id]/schedules/active/route.js +1 -1
  214. package/.next/server/app/api/worktrees/[id]/schedules/active/route_client-reference-manifest.js +1 -1
  215. package/.next/server/app/api/worktrees/[id]/schedules/route.js +1 -1
  216. package/.next/server/app/api/worktrees/[id]/schedules/route_client-reference-manifest.js +1 -1
  217. package/.next/server/app/api/worktrees/[id]/search/route_client-reference-manifest.js +1 -1
  218. package/.next/server/app/api/worktrees/[id]/send/route.js +2 -2
  219. package/.next/server/app/api/worktrees/[id]/send/route.js.nft.json +1 -1
  220. package/.next/server/app/api/worktrees/[id]/send/route_client-reference-manifest.js +1 -1
  221. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route.js +3 -3
  222. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route.js.nft.json +1 -1
  223. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route_client-reference-manifest.js +1 -1
  224. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/install/route_client-reference-manifest.js +1 -1
  225. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/plan/route_client-reference-manifest.js +1 -1
  226. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall/route_client-reference-manifest.js +1 -1
  227. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall-plan/route_client-reference-manifest.js +1 -1
  228. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/update/route_client-reference-manifest.js +1 -1
  229. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/update-plan/route_client-reference-manifest.js +1 -1
  230. package/.next/server/app/api/worktrees/[id]/skills/route.js +1 -1
  231. package/.next/server/app/api/worktrees/[id]/skills/route_client-reference-manifest.js +1 -1
  232. package/.next/server/app/api/worktrees/[id]/slash-commands/route.js +1 -1
  233. package/.next/server/app/api/worktrees/[id]/slash-commands/route_client-reference-manifest.js +1 -1
  234. package/.next/server/app/api/worktrees/[id]/special-keys/route.js +1 -1
  235. package/.next/server/app/api/worktrees/[id]/special-keys/route.js.nft.json +1 -1
  236. package/.next/server/app/api/worktrees/[id]/special-keys/route_client-reference-manifest.js +1 -1
  237. package/.next/server/app/api/worktrees/[id]/tasks/route.js +1 -1
  238. package/.next/server/app/api/worktrees/[id]/tasks/route_client-reference-manifest.js +1 -1
  239. package/.next/server/app/api/worktrees/[id]/terminal/route.js +2 -2
  240. package/.next/server/app/api/worktrees/[id]/terminal/route.js.nft.json +1 -1
  241. package/.next/server/app/api/worktrees/[id]/terminal/route_client-reference-manifest.js +1 -1
  242. package/.next/server/app/api/worktrees/[id]/timers/history/route.js +1 -1
  243. package/.next/server/app/api/worktrees/[id]/timers/history/route_client-reference-manifest.js +1 -1
  244. package/.next/server/app/api/worktrees/[id]/timers/route.js +1 -1
  245. package/.next/server/app/api/worktrees/[id]/timers/route.js.nft.json +1 -1
  246. package/.next/server/app/api/worktrees/[id]/timers/route_client-reference-manifest.js +1 -1
  247. package/.next/server/app/api/worktrees/[id]/todos/[todoId]/route.js +1 -1
  248. package/.next/server/app/api/worktrees/[id]/todos/[todoId]/route.js.nft.json +1 -1
  249. package/.next/server/app/api/worktrees/[id]/todos/[todoId]/route_client-reference-manifest.js +1 -1
  250. package/.next/server/app/api/worktrees/[id]/todos/route.js +1 -1
  251. package/.next/server/app/api/worktrees/[id]/todos/route.js.nft.json +1 -1
  252. package/.next/server/app/api/worktrees/[id]/todos/route_client-reference-manifest.js +1 -1
  253. package/.next/server/app/api/worktrees/[id]/tree/[...path]/route_client-reference-manifest.js +1 -1
  254. package/.next/server/app/api/worktrees/[id]/tree/route_client-reference-manifest.js +1 -1
  255. package/.next/server/app/api/worktrees/[id]/upload/[...path]/route_client-reference-manifest.js +1 -1
  256. package/.next/server/app/api/worktrees/[id]/verify/config/route.js +1 -1
  257. package/.next/server/app/api/worktrees/[id]/verify/config/route_client-reference-manifest.js +1 -1
  258. package/.next/server/app/api/worktrees/[id]/verify/route.js +1 -1
  259. package/.next/server/app/api/worktrees/[id]/verify/route.js.nft.json +1 -1
  260. package/.next/server/app/api/worktrees/[id]/verify/route_client-reference-manifest.js +1 -1
  261. package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/cancel/route.js +1 -1
  262. package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/cancel/route.js.nft.json +1 -1
  263. package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/cancel/route_client-reference-manifest.js +1 -1
  264. package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/route.js +1 -1
  265. package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/route_client-reference-manifest.js +1 -1
  266. package/.next/server/app/api/worktrees/[id]/verify/runs/route.js +1 -1
  267. package/.next/server/app/api/worktrees/[id]/verify/runs/route_client-reference-manifest.js +1 -1
  268. package/.next/server/app/api/worktrees/[id]/viewed/route.js +1 -1
  269. package/.next/server/app/api/worktrees/[id]/viewed/route_client-reference-manifest.js +1 -1
  270. package/.next/server/app/api/worktrees/apply-default-agents/route_client-reference-manifest.js +1 -1
  271. package/.next/server/app/api/worktrees/route.js +1 -1
  272. package/.next/server/app/api/worktrees/route.js.nft.json +1 -1
  273. package/.next/server/app/api/worktrees/route_client-reference-manifest.js +1 -1
  274. package/.next/server/app/login/page_client-reference-manifest.js +1 -1
  275. package/.next/server/app/manifest.webmanifest/route_client-reference-manifest.js +1 -1
  276. package/.next/server/app/more/page_client-reference-manifest.js +1 -1
  277. package/.next/server/app/offline/page_client-reference-manifest.js +1 -1
  278. package/.next/server/app/page_client-reference-manifest.js +1 -1
  279. package/.next/server/app/proxy/[...path]/route_client-reference-manifest.js +1 -1
  280. package/.next/server/app/repositories/page_client-reference-manifest.js +1 -1
  281. package/.next/server/app/review/page.js +1 -1
  282. package/.next/server/app/review/page_client-reference-manifest.js +1 -1
  283. package/.next/server/app/sessions/page_client-reference-manifest.js +1 -1
  284. package/.next/server/app/skills/[skillId]/page_client-reference-manifest.js +1 -1
  285. package/.next/server/app/skills/installed/page_client-reference-manifest.js +1 -1
  286. package/.next/server/app/skills/page_client-reference-manifest.js +1 -1
  287. package/.next/server/app/worktrees/[id]/files/[...path]/page_client-reference-manifest.js +1 -1
  288. package/.next/server/app/worktrees/[id]/page.js +2 -2
  289. package/.next/server/app/worktrees/[id]/page_client-reference-manifest.js +1 -1
  290. package/.next/server/app/worktrees/[id]/terminal/page_client-reference-manifest.js +1 -1
  291. package/.next/server/app-paths-manifest.json +22 -22
  292. package/.next/server/chunks/1062.js +1 -0
  293. package/.next/server/chunks/110.js +1 -0
  294. package/.next/server/chunks/1501.js +5 -4
  295. package/.next/server/chunks/1656.js +2 -2
  296. package/.next/server/chunks/1957.js +2 -0
  297. package/.next/server/chunks/2119.js +1 -1
  298. package/.next/server/chunks/2445.js +1 -1
  299. package/.next/server/chunks/2897.js +1 -0
  300. package/.next/server/chunks/3417.js +1 -0
  301. package/.next/server/chunks/3505.js +1 -1
  302. package/.next/server/chunks/3756.js +1 -0
  303. package/.next/server/chunks/3801.js +3 -3
  304. package/.next/server/chunks/4911.js +1 -0
  305. package/.next/server/chunks/4936.js +1 -0
  306. package/.next/server/chunks/5209.js +2 -1
  307. package/.next/server/chunks/5354.js +1 -1
  308. package/.next/server/chunks/6130.js +1 -1
  309. package/.next/server/chunks/6401.js +1 -1
  310. package/.next/server/chunks/7023.js +2 -2
  311. package/.next/server/chunks/7905.js +1 -1
  312. package/.next/server/chunks/8581.js +15 -15
  313. package/.next/server/chunks/8728.js +2 -2
  314. package/.next/server/chunks/8782.js +1 -1
  315. package/.next/server/chunks/9390.js +1 -1
  316. package/.next/server/chunks/9584.js +1 -1
  317. package/.next/server/chunks/9731.js +2 -2
  318. package/.next/server/middleware-manifest.json +5 -5
  319. package/.next/server/pages/500.html +1 -1
  320. package/.next/server/server-reference-manifest.json +1 -1
  321. package/.next/static/chunks/{2407-675ba6b21844dc3b.js → 2407-07a237575e1ceb9e.js} +1 -1
  322. package/.next/static/chunks/3931-61ad1a4fc0208d0e.js +1 -0
  323. package/.next/static/chunks/5794-7975b8e51e731b19.js +1 -0
  324. package/.next/static/chunks/6966-d8dc6032410ffaba.js +1 -0
  325. package/.next/static/chunks/7197-ed3b3d99ac3bd450.js +1 -0
  326. package/.next/static/chunks/7636-a48cf0f7110250c5.js +1 -0
  327. package/.next/static/chunks/app/layout-4f64316957b0a8e5.js +1 -0
  328. package/.next/static/chunks/app/more/page-ff5af5ca48774c89.js +1 -0
  329. package/.next/static/chunks/app/page-b4863bfe0452e09d.js +1 -0
  330. package/.next/static/chunks/app/review/page-ff3efb96fdf9bb4b.js +1 -0
  331. package/.next/static/chunks/app/sessions/{page-890fd50ec9739973.js → page-c6eb7c02db2f4c80.js} +1 -1
  332. package/.next/static/chunks/app/worktrees/[id]/{page-f6d3ab8185d93aae.js → page-33afc6aa96289fb0.js} +1 -1
  333. package/.next/trace +13 -13
  334. package/dist/cli/commands/ask.d.ts.map +1 -1
  335. package/dist/cli/commands/ask.js +56 -5
  336. package/dist/cli/commands/attach.d.ts +4 -1
  337. package/dist/cli/commands/attach.d.ts.map +1 -1
  338. package/dist/cli/commands/attach.js +19 -7
  339. package/dist/cli/commands/command-target.d.ts +7 -0
  340. package/dist/cli/commands/command-target.d.ts.map +1 -1
  341. package/dist/cli/commands/command-target.js +10 -0
  342. package/dist/cli/commands/instances.d.ts.map +1 -1
  343. package/dist/cli/commands/instances.js +38 -2
  344. package/dist/cli/commands/message-dispatch.d.ts +17 -3
  345. package/dist/cli/commands/message-dispatch.d.ts.map +1 -1
  346. package/dist/cli/commands/message-dispatch.js +14 -8
  347. package/dist/cli/commands/relays.d.ts +2 -1
  348. package/dist/cli/commands/relays.d.ts.map +1 -1
  349. package/dist/cli/commands/relays.js +4 -3
  350. package/dist/cli/commands/respond-strict.d.ts.map +1 -1
  351. package/dist/cli/commands/respond-strict.js +22 -5
  352. package/dist/cli/commands/respond.d.ts +2 -2
  353. package/dist/cli/commands/respond.d.ts.map +1 -1
  354. package/dist/cli/commands/respond.js +40 -37
  355. package/dist/cli/commands/send.d.ts.map +1 -1
  356. package/dist/cli/commands/send.js +8 -4
  357. package/dist/cli/commands/wait-instance.d.ts +9 -1
  358. package/dist/cli/commands/wait-instance.d.ts.map +1 -1
  359. package/dist/cli/commands/wait-instance.js +15 -0
  360. package/dist/cli/commands/wait-poll-state.d.ts +18 -0
  361. package/dist/cli/commands/wait-poll-state.d.ts.map +1 -1
  362. package/dist/cli/commands/wait-verify.d.ts +2 -1
  363. package/dist/cli/commands/wait-verify.d.ts.map +1 -1
  364. package/dist/cli/commands/wait-verify.js +5 -1
  365. package/dist/cli/commands/wait.d.ts.map +1 -1
  366. package/dist/cli/commands/wait.js +37 -13
  367. package/dist/cli/commands/whoami.d.ts.map +1 -1
  368. package/dist/cli/commands/whoami.js +3 -1
  369. package/dist/cli/docs/agent-operations.d.ts +1 -1
  370. package/dist/cli/docs/agent-operations.d.ts.map +1 -1
  371. package/dist/cli/docs/agent-operations.js +1 -0
  372. package/dist/cli/types/api-responses.d.ts +3 -1
  373. package/dist/cli/types/api-responses.d.ts.map +1 -1
  374. package/dist/cli/utils/api-client.d.ts +55 -1
  375. package/dist/cli/utils/api-client.d.ts.map +1 -1
  376. package/dist/cli/utils/api-client.js +220 -18
  377. package/dist/cli/utils/follow-up-command.d.ts +38 -0
  378. package/dist/cli/utils/follow-up-command.d.ts.map +1 -0
  379. package/dist/cli/utils/follow-up-command.js +57 -0
  380. package/dist/cli/utils/reply-ledger.d.ts +1 -1
  381. package/dist/cli/utils/reply-ledger.d.ts.map +1 -1
  382. package/dist/cli/utils/reply-ledger.js +7 -2
  383. package/dist/cli/utils/server-capabilities.d.ts +18 -0
  384. package/dist/cli/utils/server-capabilities.d.ts.map +1 -1
  385. package/dist/cli/utils/server-capabilities.js +36 -3
  386. package/dist/cli/utils/session-target.d.ts +1 -1
  387. package/dist/cli/utils/session-target.d.ts.map +1 -1
  388. package/dist/cli/utils/session-target.js +3 -0
  389. package/dist/cli/utils/verify-runner.d.ts +7 -0
  390. package/dist/cli/utils/verify-runner.d.ts.map +1 -1
  391. package/dist/cli/utils/verify-runner.js +51 -15
  392. package/dist/lib/cli-tools/session-name.d.ts.map +1 -1
  393. package/dist/lib/cli-tools/session-name.js +11 -3
  394. package/dist/lib/session/send-attempt-types.d.ts +25 -0
  395. package/dist/lib/session/send-attempt-types.d.ts.map +1 -1
  396. package/dist/lib/session/send-attempt-types.js +10 -1
  397. package/dist/lib/verification/session-kill-ledger.d.ts +110 -0
  398. package/dist/lib/verification/session-kill-ledger.d.ts.map +1 -0
  399. package/dist/lib/verification/session-kill-ledger.js +174 -0
  400. package/dist/server/locales/en/worktree.json +2 -0
  401. package/dist/server/locales/ja/worktree.json +2 -0
  402. package/dist/server/src/config/cli-tool-timing-config.js +1 -7
  403. package/dist/server/src/lib/auto-yes-poller.js +5 -1
  404. package/dist/server/src/lib/cli-tools/antigravity.js +5 -2
  405. package/dist/server/src/lib/cli-tools/base.js +39 -0
  406. package/dist/server/src/lib/cli-tools/codex.js +7 -4
  407. package/dist/server/src/lib/cli-tools/command-code.js +7 -3
  408. package/dist/server/src/lib/cli-tools/copilot.js +5 -3
  409. package/dist/server/src/lib/cli-tools/gemini.js +10 -2
  410. package/dist/server/src/lib/cli-tools/launch-keys.js +39 -0
  411. package/dist/server/src/lib/cli-tools/opencode-v2.js +6 -2
  412. package/dist/server/src/lib/cli-tools/opencode.js +5 -2
  413. package/dist/server/src/lib/cli-tools/session-name.js +11 -3
  414. package/dist/server/src/lib/cli-tools/submit-composer-read.js +16 -6
  415. package/dist/server/src/lib/cli-tools/submit-verified-sender.js +164 -7
  416. package/dist/server/src/lib/cli-tools/vibe-local.js +4 -2
  417. package/dist/server/src/lib/db/db-migration-path.js +63 -2
  418. package/dist/server/src/lib/detection/prompt-detect-multiple-choice.js +5 -4
  419. package/dist/server/src/lib/hooks/sources/copilot/hook-settings.js +2 -3
  420. package/dist/server/src/lib/prompt-answer-errors.js +76 -2
  421. package/dist/server/src/lib/session/agent-event-state.js +4 -0
  422. package/dist/server/src/lib/session/agent-session-lifecycle.js +6 -1
  423. package/dist/server/src/lib/session/claude-session.js +22 -6
  424. package/dist/server/src/lib/session/current-output-builder.js +5 -3
  425. package/dist/server/src/lib/session/current-output-history-writers.js +1 -1
  426. package/dist/server/src/lib/session/prompt-submit-receipt.js +155 -0
  427. package/dist/server/src/lib/session/prompt-waiting-guard.js +10 -3
  428. package/dist/server/src/lib/session/send-attempt-state.js +48 -0
  429. package/dist/server/src/lib/session/send-attempt-types.js +10 -1
  430. package/dist/server/src/lib/session/send-user-message.js +5 -4
  431. package/dist/server/src/lib/session/session-launch-flight.js +243 -0
  432. package/dist/server/src/lib/session/session-starting-state.js +40 -4
  433. package/dist/server/src/lib/session/structured-prompt.js +12 -9
  434. package/dist/server/src/lib/session/waiting-episode-binding.js +4 -2
  435. package/dist/server/src/lib/session-cleanup.js +32 -0
  436. package/dist/server/src/lib/session-key-sender.js +0 -27
  437. package/dist/server/src/lib/verification/env-clean-gate.js +129 -0
  438. package/dist/server/src/lib/verification/env-snapshot.js +11 -2
  439. package/dist/server/src/lib/verification/session-kill-ledger.js +174 -0
  440. package/package.json +5 -1
  441. package/release-notes/0.49.2.json +49 -0
  442. package/.next/server/chunks/3773.js +0 -1
  443. package/.next/server/chunks/5775.js +0 -1
  444. package/.next/server/chunks/7604.js +0 -2
  445. package/.next/static/chunks/3931-1a1abab16248f14d.js +0 -1
  446. package/.next/static/chunks/4768-ad6f82f034f21eae.js +0 -1
  447. package/.next/static/chunks/5794-80ac3f06f098ea29.js +0 -1
  448. package/.next/static/chunks/6654-f3534f35f16644bc.js +0 -1
  449. package/.next/static/chunks/7665-e9ef6e0a85b9fa49.js +0 -1
  450. package/.next/static/chunks/8606-ce17ffa77f39608e.js +0 -1
  451. package/.next/static/chunks/app/layout-8bfac4724277b47f.js +0 -1
  452. package/.next/static/chunks/app/more/page-87c84987b2765213.js +0 -1
  453. package/.next/static/chunks/app/page-1b820c421db48c2c.js +0 -1
  454. package/.next/static/chunks/app/review/page-e2fd4a590646a2d8.js +0 -1
  455. /package/.next/static/{fqfSDqQMweROeHUzOt_m1 → yGatWDsS532awSs51kXyd}/_buildManifest.js +0 -0
  456. /package/.next/static/{fqfSDqQMweROeHUzOt_m1 → yGatWDsS532awSs51kXyd}/_ssgManifest.js +0 -0
@@ -66,6 +66,7 @@ const session_name_1 = require("../../lib/cli-tools/session-name");
66
66
  const types_1 = require("../../lib/cli-tools/types");
67
67
  const env_snapshot_1 = require("./env-snapshot");
68
68
  const verify_config_1 = require("./verify-config");
69
+ const session_kill_ledger_1 = require("./session-kill-ledger");
69
70
  // =============================================================================
70
71
  // Opt-in resolution
71
72
  // =============================================================================
@@ -538,6 +539,71 @@ function readDeadDemoVitestEntries(baseline) {
538
539
  return new Set();
539
540
  return new Set(recorded.filter((name) => typeof name === 'string' && demoVitestPid(name) !== null));
540
541
  }
542
+ // =============================================================================
543
+ // Sibling sessions stopped by someone else (Issue #3993)
544
+ // =============================================================================
545
+ /**
546
+ * Whether a CLI kill was asked for by someone known not to be this task's worker.
547
+ *
548
+ * Known means one of two facts the record carries:
549
+ * - the caller's cwd is a sibling directory of the task's worktree — the
550
+ * primary checkout the orchestrator runs from, or another worktree;
551
+ * - the caller ran inside the tmux session of another worktree.
552
+ * Either is enough unless the other says "this task": a cwd inside the task's
553
+ * worktree, or the task's own session (or one of its worktree's), is the worker
554
+ * whatever else was recorded. A cwd that is nowhere in particular (`/tmp`,
555
+ * `$HOME`, `/`) with no session says nothing and is the worker — the strict
556
+ * answer, because only a kill *not* the worker's excuses.
557
+ *
558
+ * Only `cli` lines name a caller. The route's `browser` (judged from
559
+ * `Sec-Fetch-Site` alone, which a UI-driving worker sends and a header can
560
+ * forge) and `http` lines and the server's `server` cleanup (run after a
561
+ * `commandmate sync` a worker can issue) never excuse.
562
+ */
563
+ function isKillByAnotherWorker(record, context, taskSession) {
564
+ if (record.origin !== 'cli')
565
+ return false;
566
+ const sessionOwner = record.callerSession === null
567
+ ? 'unattributed'
568
+ : taskSession && record.callerSession === taskSession
569
+ ? 'self'
570
+ : attributeSessionName(record.callerSession, context.worktreeId);
571
+ const cwdOwner = attributeAnchor(record.callerCwd, context.worktreePath);
572
+ if (sessionOwner === 'self' || cwdOwner === 'self')
573
+ return false;
574
+ return sessionOwner === 'other' || cwdOwner === 'other';
575
+ }
576
+ /**
577
+ * The recorded kill that explains a vanished `other` session, or undefined.
578
+ *
579
+ * Why this is the third line removals are excused on — the design note for
580
+ * #3993, which keeps #1624's rule rather than loosening it:
581
+ *
582
+ * - #1624 is a worker killing a sibling's session. The two snapshots cannot
583
+ * say who removed a session, so every same-repository removal was counted —
584
+ * including the orchestrator's own cleanup (`instances <wt> kill`, the
585
+ * first step of removing a worktree), which failed every parallel
586
+ * verification on 2026-10-29.
587
+ * - The session-kill ledger records each kill with the tmux sessions it
588
+ * stopped and who asked. A removal is `external` only when a line inside
589
+ * the task window names exactly that session and {@link isKillByAnotherWorker}
590
+ * holds for it.
591
+ * - Matched by the exact session name, never by worktree id: a worktree-wide
592
+ * match let one cleanup line excuse a worker's unrecorded kill of another
593
+ * instance of the same worktree hours earlier, and an id prefix
594
+ * (`commandmate-skills` / `commandmate-skills-3944`) reached into another
595
+ * worktree.
596
+ * - Everything else stays a violation: a worker's own kill, a caller that is
597
+ * nowhere in particular, the UI's and the server's kills, and any kill that
598
+ * went around CommandMate (`tmux kill-session`), which records nothing.
599
+ */
600
+ function findExternalKill(sessionName, kills, context, taskSession) {
601
+ return kills.find((record) => record.sessionNames.includes(sessionName) && isKillByAnotherWorker(record, context, taskSession));
602
+ }
603
+ /** A recorded kill of exactly this session that does not excuse it, for the report. */
604
+ function findRecordedKill(sessionName, kills) {
605
+ return kills.find((record) => record.sessionNames.includes(sessionName));
606
+ }
541
607
  function toChange(entry, owner) {
542
608
  return { key: entry.key, detail: entry.detail, owner };
543
609
  }
@@ -556,6 +622,7 @@ function diffEnvSnapshots(baseline, final, context, options = {}) {
556
622
  const deadDemoVitestEntries = readDeadDemoVitestEntries(baseline);
557
623
  const ignoredHomeEntries = new Set(options.ignoreHomeEntries ?? []);
558
624
  const resolvePidCwd = options.resolvePidCwd ?? exports.readLivePidCwd;
625
+ const sessionKills = (options.sessionKills ?? []).filter((record) => record.at >= baseline.capturedAt && record.at <= final.capturedAt);
559
626
  const probes = env_snapshot_1.ENV_PROBE_IDS.map((probeId) => {
560
627
  const before = baseline.probes[probeId];
561
628
  const after = final.probes[probeId];
@@ -570,6 +637,8 @@ function diffEnvSnapshots(baseline, final, context, options = {}) {
570
637
  removed: [],
571
638
  removedByOtherServer: [],
572
639
  removedByOtherRepository: [],
640
+ removedExternal: [],
641
+ removedKillNotExcused: [],
573
642
  removedStaleDemoVitest: [],
574
643
  ignoredByConfig: [],
575
644
  ignoredBuiltIn: [],
@@ -586,6 +655,8 @@ function diffEnvSnapshots(baseline, final, context, options = {}) {
586
655
  removed: [],
587
656
  removedByOtherServer: [],
588
657
  removedByOtherRepository: [],
658
+ removedExternal: [],
659
+ removedKillNotExcused: [],
589
660
  removedStaleDemoVitest: [],
590
661
  ignoredByConfig: [],
591
662
  ignoredBuiltIn: [],
@@ -631,6 +702,8 @@ function diffEnvSnapshots(baseline, final, context, options = {}) {
631
702
  const removed = [];
632
703
  const removedByOtherServer = [];
633
704
  const removedByOtherRepository = [];
705
+ const removedExternal = [];
706
+ const removedKillNotExcused = [];
634
707
  const removedStaleDemoVitest = [];
635
708
  for (const entry of before.entries) {
636
709
  if (afterKeys.has(entry.key))
@@ -652,6 +725,18 @@ function diffEnvSnapshots(baseline, final, context, options = {}) {
652
725
  otherRepositorySessions.has(entry.key)) {
653
726
  removedByOtherRepository.push(change);
654
727
  }
728
+ else if (probeId === 'tmux-sessions' && tmuxServerSurvived && change.owner === 'other') {
729
+ const killedBy = findExternalKill(entry.key, sessionKills, context, taskSession);
730
+ if (killedBy) {
731
+ removedExternal.push({ ...change, killedBy });
732
+ }
733
+ else {
734
+ removed.push(change);
735
+ const recorded = findRecordedKill(entry.key, sessionKills);
736
+ if (recorded)
737
+ removedKillNotExcused.push({ ...change, killedBy: recorded });
738
+ }
739
+ }
655
740
  else if (probeId === 'home-entries' && deadDemoVitestEntries.has(entry.key)) {
656
741
  removedStaleDemoVitest.push(change);
657
742
  }
@@ -669,6 +754,8 @@ function diffEnvSnapshots(baseline, final, context, options = {}) {
669
754
  removed,
670
755
  removedByOtherServer,
671
756
  removedByOtherRepository,
757
+ removedExternal,
758
+ removedKillNotExcused,
672
759
  removedStaleDemoVitest,
673
760
  ignoredByConfig,
674
761
  ignoredBuiltIn,
@@ -736,6 +823,35 @@ function formatRemovedByOtherServer(changes) {
736
823
  function formatRemovedByOtherRepository(changes) {
737
824
  return changes.map((change) => ` · - ${change.key} (ignored: a worktree of another repository on this server, recorded at task start)`);
738
825
  }
826
+ /** Sibling sessions stopped by someone else's recorded kill (#3993), one line each. */
827
+ function formatRemovedExternal(changes) {
828
+ return changes.map(({ key, killedBy }) => ` · - ${key} [external] (not counted: ${describeKill(killedBy)}, not this task)`);
829
+ }
830
+ /** `<api> for <worktree>[ instance <id>] at <ISO> from <caller>` of one recorded kill. */
831
+ function describeKill(killedBy) {
832
+ const target = killedBy.instanceId
833
+ ? `${killedBy.worktreeId} instance ${killedBy.instanceId}`
834
+ : killedBy.worktreeId;
835
+ const caller = killedBy.origin === 'browser'
836
+ ? 'the UI'
837
+ : killedBy.origin === 'server'
838
+ ? 'the server'
839
+ : killedBy.origin === 'http'
840
+ ? 'an HTTP request with no caller'
841
+ : killedBy.callerSession
842
+ ? `${killedBy.callerCwd ?? 'an unknown cwd'} in ${killedBy.callerSession}`
843
+ : (killedBy.callerCwd ?? 'an unknown cwd');
844
+ return `${killedBy.api} for ${target} at ${new Date(killedBy.at).toISOString()} from ${caller}`;
845
+ }
846
+ /** Counted removals whose kill was recorded but does not excuse them (#3993), one line each. */
847
+ function formatRemovedKillNotExcused(changes) {
848
+ return changes.map(({ key, killedBy }) => {
849
+ const why = killedBy.origin === 'browser' || killedBy.origin === 'server'
850
+ ? `a ${killedBy.origin} kill a worker can also cause`
851
+ : 'the caller is not known to be someone else';
852
+ return ` · ${key}: kill recorded but counted (${describeKill(killedBy)}; not excused: ${why})`;
853
+ });
854
+ }
739
855
  /** Removals excused as leftover demo-vitest directories (#3043), one line each. */
740
856
  function formatRemovedStaleDemoVitest(changes) {
741
857
  return changes.map((change) => ` · - ${change.key} (ignored: its pid was already dead at task start — a leftover swept by the demo-video tests)`);
@@ -788,6 +904,7 @@ function formatEnvCleanReport(diff) {
788
904
  lines.push(...formatTaskSessionChanges(probe.taskSessionAdded));
789
905
  lines.push(...formatRemovedByOtherServer(probe.removedByOtherServer));
790
906
  lines.push(...formatRemovedByOtherRepository(probe.removedByOtherRepository));
907
+ lines.push(...formatRemovedExternal(probe.removedExternal));
791
908
  lines.push(...formatRemovedStaleDemoVitest(probe.removedStaleDemoVitest));
792
909
  lines.push(...formatIgnoredByConfig(probe.ignoredByConfig));
793
910
  lines.push(...formatIgnoredBuiltIn(probe.ignoredBuiltIn));
@@ -797,9 +914,11 @@ function formatEnvCleanReport(diff) {
797
914
  lines.push(` ${probe.probeId} VIOLATED (${label}): +${probe.added.length} -${probe.removed.length}`);
798
915
  lines.push(...formatChanges('+', probe.added));
799
916
  lines.push(...formatChanges('-', probe.removed));
917
+ lines.push(...formatRemovedKillNotExcused(probe.removedKillNotExcused));
800
918
  lines.push(...formatTaskSessionChanges(probe.taskSessionAdded));
801
919
  lines.push(...formatRemovedByOtherServer(probe.removedByOtherServer));
802
920
  lines.push(...formatRemovedByOtherRepository(probe.removedByOtherRepository));
921
+ lines.push(...formatRemovedExternal(probe.removedExternal));
803
922
  lines.push(...formatRemovedStaleDemoVitest(probe.removedStaleDemoVitest));
804
923
  lines.push(...formatIgnoredByConfig(probe.ignoredByConfig));
805
924
  lines.push(...formatIgnoredBuiltIn(probe.ignoredBuiltIn));
@@ -862,9 +981,19 @@ async function evaluateEnvClean(input) {
862
981
  return done('error', `${verify_config_1.ENV_CLEAN_GATE_ID}: UNKNOWN — the current snapshot could not be taken: ` +
863
982
  `${error instanceof Error ? error.message : String(error)}`, null);
864
983
  }
984
+ const readSessionKills = input.readSessionKills ?? ((since, until) => (0, session_kill_ledger_1.readSessionKillRecords)(since, until));
985
+ let sessionKills;
986
+ try {
987
+ sessionKills = readSessionKills(input.baseline.capturedAt, final.capturedAt);
988
+ }
989
+ catch {
990
+ // An unreadable ledger excuses nothing; it is not a reason to withhold a verdict.
991
+ sessionKills = [];
992
+ }
865
993
  const diff = diffEnvSnapshots(input.baseline, final, input, {
866
994
  ignoreHomeEntries: input.ignoreHomeEntries,
867
995
  resolvePidCwd: input.resolvePidCwd,
996
+ sessionKills,
868
997
  });
869
998
  const header = `${verify_config_1.ENV_CLEAN_GATE_ID}: baseline=${new Date(input.baseline.capturedAt).toISOString()} ` +
870
999
  `status=${diff.status} task-session=${describeTaskSession(diff.taskSession)}`;
@@ -40,6 +40,7 @@ const path_1 = require("path");
40
40
  const env_1 = require("../../lib/env");
41
41
  const logger_1 = require("../../lib/logger");
42
42
  const machine_lock_1 = require("./machine-lock");
43
+ const session_kill_ledger_1 = require("./session-kill-ledger");
43
44
  const worktree_index_1 = require("./worktree-index");
44
45
  const logger = (0, logger_1.createLogger)('lib/verification/env-snapshot');
45
46
  /** Bumped only when a stored snapshot stops being readable by this module. */
@@ -329,6 +330,8 @@ exports.MCBD_SESSION_PREFIX = 'mcbd-';
329
330
  * is none of a delegation's business, so watching them would only manufacture
330
331
  * violations. Sessions of *other* worktrees stay in the set on purpose — killing
331
332
  * a sibling worker's session is the #1624 failure this probe is here to catch.
333
+ * A sibling session stopped by someone else through `instances <wt> kill` is set
334
+ * apart at diff time from the session-kill ledger (Issue #3993), not here.
332
335
  *
333
336
  * "No server running" is an answer (zero sessions), which is why it is not
334
337
  * treated as a probe failure. `tmux` being absent, or hanging, is not.
@@ -370,14 +373,20 @@ exports.ENV_SNAPSHOT_DIR_NAME = 'env-snapshots';
370
373
  * `~/.commandmate` (Issue #1771): the gate mutex locks and the worktree index
371
374
  * registry. Neither is a side effect of the delegation — the first mutexed gate
372
375
  * on a machine creates them — so counting them would report the runner's own
373
- * bookkeeping as pollution the agent left behind.
376
+ * bookkeeping as pollution the agent left behind. The session-kill ledger
377
+ * (Issue #3993) is the same kind of bookkeeping: the first recorded
378
+ * `instances <wt> kill` on a machine creates it.
374
379
  *
375
380
  * Scoped to the `~/.commandmate` probe rather than added to
376
381
  * {@link isIgnoredEntry}: a `~/locks` directory in `$HOME` is not ours, and
377
382
  * blanket-ignoring the name would put a hole in the probe that exists to catch
378
383
  * exactly that.
379
384
  */
380
- const COMMANDMATE_RUNTIME_ENTRY_NAMES = [machine_lock_1.MACHINE_LOCK_DIR_NAME, worktree_index_1.WORKTREE_INDEX_DIR_NAME];
385
+ const COMMANDMATE_RUNTIME_ENTRY_NAMES = [
386
+ machine_lock_1.MACHINE_LOCK_DIR_NAME,
387
+ worktree_index_1.WORKTREE_INDEX_DIR_NAME,
388
+ session_kill_ledger_1.SESSION_KILL_LEDGER_DIR_NAME,
389
+ ];
381
390
  function isIgnoredEntry(name) {
382
391
  if (name === exports.ENV_SNAPSHOT_DIR_NAME)
383
392
  return true;
@@ -0,0 +1,174 @@
1
+ "use strict";
2
+ /**
3
+ * Record of `mcbd-*` sessions stopped through CommandMate's kill (Issue #3993).
4
+ *
5
+ * The `env-clean` gate counts every vanished session of a sibling worktree as a
6
+ * violation, because a worker killing its neighbour is the #1624 failure. The
7
+ * orchestrator stops sibling sessions too — `commandmate instances <wt> kill`
8
+ * when it cleans a worktree up (worktree-cleanup Phase 3), the UI's kill
9
+ * button, the server's cleanup after sync or a repository removal — and the two
10
+ * snapshots cannot tell that apart from a worker's kill: on 2026-10-29 four
11
+ * verification runs of #3957 failed on `- mcbd-…-<another worktree> [other]`
12
+ * for a cleanup nobody in the worker's transcript had run.
13
+ *
14
+ * This ledger is the missing fact: one line per kill, naming the API, the
15
+ * tmux sessions it actually stopped, the worktree it was for and who asked
16
+ * (the caller's working directory and tmux session). The gate excuses as little
17
+ * as it can prove is not the worker's (`env-clean-gate.ts`, `findExternalKill`):
18
+ * a vanished sibling session is `external` only when a line inside the task's
19
+ * window names that exact session, was written by the CLI, and its caller is
20
+ * known to be someone else — a cwd in a sibling directory of the task's
21
+ * worktree (the primary checkout, another worktree) or a tmux session of
22
+ * another worktree. Everything else stays a violation, exactly as before:
23
+ * a worker's own kill, a caller that is nowhere in particular (`/tmp`, `$HOME`),
24
+ * the route's and the server's lines (a worker can reach the UI and trigger
25
+ * sync too), and any kill that bypassed CommandMate (`tmux kill-session`), which
26
+ * records nothing. Those lines are still shown next to the violation.
27
+ *
28
+ * Written by the CLI (with its caller), by the kill-session route and by
29
+ * `session-cleanup.ts`. A CLI kill is therefore recorded twice — the CLI's line
30
+ * and the route's `http` line — which changes no verdict: only the CLI's line
31
+ * can excuse anything.
32
+ *
33
+ * Machine-wide, like the gate mutex (`machine-lock.ts`): the CLI and the server
34
+ * write it and the server's gate reads it, so the path is derived from `$HOME` alone —
35
+ * `~/.commandmate/session-kills/<UTC date>.jsonl` — with an override for tests.
36
+ * The `commandmate-entries` probe ignores the directory, like `locks`.
37
+ *
38
+ * Node built-ins only: the CLI imports this module.
39
+ *
40
+ * @module lib/verification/session-kill-ledger
41
+ */
42
+ Object.defineProperty(exports, "__esModule", { value: true });
43
+ exports.SESSION_KILL_LEDGER_RETENTION_MS = exports.SESSION_KILL_LEDGER_VERSION = exports.SESSION_KILL_LEDGER_ROOT_ENV = exports.SESSION_KILL_LEDGER_DIR_NAME = void 0;
44
+ exports.defaultSessionKillLedgerRoot = defaultSessionKillLedgerRoot;
45
+ exports.resolveSessionKillLedgerRoot = resolveSessionKillLedgerRoot;
46
+ exports.appendSessionKillRecord = appendSessionKillRecord;
47
+ exports.isSessionKillRecord = isSessionKillRecord;
48
+ exports.readSessionKillRecords = readSessionKillRecords;
49
+ const fs_1 = require("fs");
50
+ const os_1 = require("os");
51
+ const path_1 = require("path");
52
+ /** Directory under `~/.commandmate`; exported for the `commandmate-entries` probe. */
53
+ exports.SESSION_KILL_LEDGER_DIR_NAME = 'session-kills';
54
+ /** Overrides the ledger directory (tests, isolated environments). */
55
+ exports.SESSION_KILL_LEDGER_ROOT_ENV = 'CM_SESSION_KILL_LEDGER_ROOT';
56
+ /** Bumped only when a line stops being readable by this module. */
57
+ exports.SESSION_KILL_LEDGER_VERSION = 1;
58
+ /** Day files older than this are removed when a new line is written (same as env snapshots). */
59
+ exports.SESSION_KILL_LEDGER_RETENTION_MS = 30 * 24 * 60 * 60 * 1000;
60
+ const DAY_MS = 24 * 60 * 60 * 1000;
61
+ const DAY_FILE_PATTERN = /^(\d{4}-\d{2}-\d{2})\.jsonl$/;
62
+ const SESSION_KILL_APIS = ['kill-session', 'session-cleanup'];
63
+ const SESSION_KILL_ORIGINS = ['cli', 'browser', 'http', 'server'];
64
+ function defaultSessionKillLedgerRoot() {
65
+ return (0, path_1.join)((0, os_1.homedir)(), '.commandmate', exports.SESSION_KILL_LEDGER_DIR_NAME);
66
+ }
67
+ function resolveSessionKillLedgerRoot(env = process.env) {
68
+ const override = env[exports.SESSION_KILL_LEDGER_ROOT_ENV];
69
+ return override && override.trim() !== '' ? override : defaultSessionKillLedgerRoot();
70
+ }
71
+ function dayOf(epochMs) {
72
+ return new Date(epochMs).toISOString().slice(0, 10);
73
+ }
74
+ function pruneOldDays(root, now) {
75
+ const oldest = dayOf(now - exports.SESSION_KILL_LEDGER_RETENTION_MS);
76
+ let names;
77
+ try {
78
+ names = (0, fs_1.readdirSync)(root);
79
+ }
80
+ catch {
81
+ return;
82
+ }
83
+ for (const name of names) {
84
+ const day = DAY_FILE_PATTERN.exec(name)?.[1];
85
+ if (day === undefined || day >= oldest)
86
+ continue;
87
+ try {
88
+ (0, fs_1.rmSync)((0, path_1.join)(root, name), { force: true });
89
+ }
90
+ catch {
91
+ // A day file that cannot be removed is disk use, not a reason to fail a kill.
92
+ }
93
+ }
94
+ }
95
+ /**
96
+ * Append one kill. Never throws: the kill already happened, and failing the
97
+ * command over its bookkeeping would only hide that.
98
+ *
99
+ * @returns true when the line was written
100
+ */
101
+ function appendSessionKillRecord(record, root = resolveSessionKillLedgerRoot()) {
102
+ try {
103
+ (0, fs_1.mkdirSync)(root, { recursive: true, mode: 0o700 });
104
+ // One short line per append; O_APPEND keeps concurrent writers' lines whole.
105
+ (0, fs_1.appendFileSync)((0, path_1.join)(root, `${dayOf(record.at)}.jsonl`), `${JSON.stringify(record)}\n`, {
106
+ encoding: 'utf8',
107
+ mode: 0o600,
108
+ });
109
+ pruneOldDays(root, record.at);
110
+ return true;
111
+ }
112
+ catch {
113
+ return false;
114
+ }
115
+ }
116
+ function isNullableString(value) {
117
+ return value === null || typeof value === 'string';
118
+ }
119
+ /** Whether a parsed line is a record this module can use; anything else is skipped. */
120
+ function isSessionKillRecord(value) {
121
+ if (typeof value !== 'object' || value === null)
122
+ return false;
123
+ const record = value;
124
+ return (record.version === exports.SESSION_KILL_LEDGER_VERSION &&
125
+ typeof record.at === 'number' &&
126
+ typeof record.api === 'string' &&
127
+ SESSION_KILL_APIS.includes(record.api) &&
128
+ typeof record.origin === 'string' &&
129
+ SESSION_KILL_ORIGINS.includes(record.origin) &&
130
+ typeof record.worktreeId === 'string' &&
131
+ record.worktreeId !== '' &&
132
+ isNullableString(record.instanceId) &&
133
+ Array.isArray(record.sessionNames) &&
134
+ record.sessionNames.every((name) => typeof name === 'string') &&
135
+ isNullableString(record.callerCwd) &&
136
+ isNullableString(record.callerSession));
137
+ }
138
+ /**
139
+ * The kills recorded in `[since, until]` (epoch ms, inclusive).
140
+ *
141
+ * A missing directory, an unreadable day file and a malformed line all read as
142
+ * "no record", which only ever excuses less.
143
+ */
144
+ function readSessionKillRecords(since, until, root = resolveSessionKillLedgerRoot()) {
145
+ if (!(since <= until))
146
+ return [];
147
+ // Nothing older than the retention survives, so a stale baseline costs no extra reads.
148
+ since = Math.max(since, until - exports.SESSION_KILL_LEDGER_RETENTION_MS - DAY_MS);
149
+ const records = [];
150
+ for (let day = Date.parse(`${dayOf(since)}T00:00:00.000Z`); day <= until; day += DAY_MS) {
151
+ let text;
152
+ try {
153
+ text = (0, fs_1.readFileSync)((0, path_1.join)(root, `${dayOf(day)}.jsonl`), 'utf8');
154
+ }
155
+ catch {
156
+ continue;
157
+ }
158
+ for (const line of text.split('\n')) {
159
+ if (line.trim() === '')
160
+ continue;
161
+ let parsed;
162
+ try {
163
+ parsed = JSON.parse(line);
164
+ }
165
+ catch {
166
+ continue;
167
+ }
168
+ if (isSessionKillRecord(parsed) && parsed.at >= since && parsed.at <= until) {
169
+ records.push(parsed);
170
+ }
171
+ }
172
+ }
173
+ return records;
174
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "commandmate",
3
- "version": "0.49.1",
3
+ "version": "0.49.2",
4
4
  "description": "No long blocks of time? Run an AI team from your phone. Git worktree sessions, task contracts and verification gates for Claude Code, Codex, Gemini CLI, Copilot, OpenCode, Antigravity and Command Code.",
5
5
  "keywords": [
6
6
  "ai-agents",
@@ -113,8 +113,10 @@
113
113
  "rehype-sanitize": "^6.0.0",
114
114
  "rehype-slug": "^6.0.0",
115
115
  "remark-gfm": "^4.0.1",
116
+ "remark-parse": "^11.0.0",
116
117
  "safe-regex2": "^5.0.0",
117
118
  "tailwind-merge": "^3.6.0",
119
+ "unified": "^11.0.5",
118
120
  "uuid": "^13.0.0",
119
121
  "web-push": "^3.6.7",
120
122
  "ws": "^8.18.3",
@@ -131,7 +133,9 @@
131
133
  "@testing-library/react": "^16.3.2",
132
134
  "@types/better-sqlite3": "^7.6.13",
133
135
  "@types/eslint": "^8.56.12",
136
+ "@types/hast": "^3.0.4",
134
137
  "@types/http-proxy": "^1.17.17",
138
+ "@types/mdast": "^4.0.4",
135
139
  "@types/node": "20.19.35",
136
140
  "@types/react": "^19.2.17",
137
141
  "@types/react-dom": "^19.2.3",
@@ -0,0 +1,49 @@
1
+ {
2
+ "version": "0.49.2",
3
+ "date": "2026-10-31",
4
+ "highlight": {
5
+ "ja": "起動したばかりの Claude への最初のメッセージが、届いていないのに「送信済み」と表示される問題を直しました。送信や回答が失敗したときも、キーが届いたか・送り直してよいかを正しく伝えるようにしました。",
6
+ "en": "Fixed the first message to a just-started Claude being reported as sent when it never arrived. When a send or an answer fails, you are now told whether the keys reached the agent and whether it is safe to send again."
7
+ },
8
+ "added": [],
9
+ "improved": [
10
+ {
11
+ "ja": "Review の承認一覧やリポジトリの帯・パンくずから開いたときも、応答を待っているエージェントが選ばれた状態で開くようになりました。",
12
+ "en": "Opening a worktree from the Review approval list, the repository strip or the breadcrumb now also selects the agent that is waiting for you."
13
+ },
14
+ {
15
+ "ja": "CLI の wait・ask・verify の --timeout が、サーバーが応答しないときも含めてコマンド全体の期限として効くようになりました。",
16
+ "en": "The --timeout of wait, ask and verify in the CLI now limits the whole command, including when the server does not respond."
17
+ },
18
+ {
19
+ "ja": "CLI の respond などが出す次の操作の案内に、対象のエージェントの指定が含まれるようになりました。",
20
+ "en": "The follow-up hints printed by respond and other CLI commands now include the agent they refer to."
21
+ }
22
+ ],
23
+ "fixed": [
24
+ {
25
+ "ja": "起動したばかりの Claude への最初のメッセージが届かず、次の送信が失敗することがある問題を直しました。",
26
+ "en": "Fixed the first message to a just-started Claude sometimes not arriving and making the next send fail."
27
+ },
28
+ {
29
+ "ja": "同じエージェントを同時に起動しようとしたとき、起動が重なって入力が混ざることがある問題を直しました。",
30
+ "en": "Fixed overlapping launches of the same agent sometimes mixing up typed input."
31
+ },
32
+ {
33
+ "ja": "回答の途中で止まったとき、一部のキーが届いた可能性があることを知らせるようにしました(スマホと PC の両方)。",
34
+ "en": "When an answer stops partway, you are now told that some keys may have reached the agent, on both phone and desktop."
35
+ },
36
+ {
37
+ "ja": "スマホで開き直すと、選んでいたエージェントが先頭のエージェントに戻ってしまう問題を直しました。",
38
+ "en": "Fixed the selected agent switching back to the first one when a worktree was reopened on the phone."
39
+ },
40
+ {
41
+ "ja": "送信が失敗したとき、送り直してよいかが CLI に伝わらないことがある問題を直しました。",
42
+ "en": "Fixed the CLI sometimes not being told whether a failed send is safe to retry."
43
+ },
44
+ {
45
+ "ja": "古い場所のデータベースを移すとき、書き込み途中の更新が失われることがある問題を直しました。",
46
+ "en": "Fixed recent changes sometimes being lost when a database was moved from its old location."
47
+ }
48
+ ]
49
+ }
@@ -1 +0,0 @@
1
- "use strict";exports.id=3773,exports.ids=[3773],exports.modules={3421:(a,b,c)=>{Object.defineProperty(b,"I",{enumerable:!0,get:function(){return g}});let d=c(71237),e=c(55088),f=c(17679);async function g(a,b,c,g){if((0,d.isNodeNextResponse)(b)){var h;b.statusCode=c.status,b.statusMessage=c.statusText;let d=["set-cookie","www-authenticate","proxy-authenticate","vary"];null==(h=c.headers)||h.forEach((a,c)=>{if("x-middleware-set-cookie"!==c.toLowerCase())if("set-cookie"===c.toLowerCase())for(let d of(0,f.splitCookiesString)(a))b.appendHeader(c,d);else{let e=void 0!==b.getHeader(c);(d.includes(c.toLowerCase())||!e)&&b.appendHeader(c,a)}});let{originalResponse:i}=b;c.body&&"HEAD"!==a.method?await (0,e.pipeToNodeResponse)(c.body,i,g):i.end()}}},5416:(a,b,c)=>{c.d(b,{H:()=>i});var d=c(95375),e=c(91318),f=c(20029),g=c(39532),h=c(15961);function i(a,b,c,j=Date.now()){let{policy:k,taskId:l}=(0,e.d8)(a,b.cliToolId,b.instanceId),m={worktreeId:a,cliToolId:b.cliToolId,instanceId:b.instanceId??b.cliToolId};return(0,h.Fw)({...m,resolvedBy:b.resolvedBy??null,payload:c,sessionGeneration:(0,d.getAgentEventGenerationStartedAt)(a,b.cliToolId,b.instanceId),contract:{policy:k,taskId:l},appearance:{note:a=>(0,g.HO)(m,a,j),forget:()=>(0,g.mt)(m)},lastSend:(0,f.KF)(m),now:j})}},15961:(a,b,c)=>{c.d(b,{Fw:()=>M,Z1:()=>L});var d=c(48736),e=c(27354),f=c(16402),g=c(41733),h=c(42422),i=c(90166),j=c(15194),k=c(31239),l=c(81254),m=c(28861),n=c(69082);let o=/^\s*Do you trust the contents of this project\?\s*$/,p=/^\s*Accessing workspace:\s*(.*)$/,q=/^\s*>\s+(\S.*)$/,r=/^\s*(?:>\s+)?(\/[\w:.-]+)(?:\s{2,}.*)?$/,s=/^\s*[↓↑]\s*\d+\s+more\s*$/,t=/^\s*Effort\b/,u=/^ {40,}\S/;function v(a,b,c,d){let e=[],f=-1;for(let g=b;g<c;g++){let b=a[g];if(""===b.trim()||d&&d.test(b))break;if(q.test(b)){if(f>=0)return null;f=e.length}e.push(b.replace(/^\s*>\s+/,"").replace(/\s{2,}/g," ").trim())}return e.length<2||f<0?null:{options:e,selectedIndex:f}}let w=/^\s*Keyboard:\s+↑\/↓\s+Navigate\s+←\/→\s+Effort\s+enter\s+Select\s+esc\s+(?:Go Back|Clear search)\s*$/,x=/^\s*Switch Model\s*$/,y=/^\s*Search:(?:\s.*)?$/,z=/^\s*─+\s*$/,A=/^\s*Effort\b/,B=/^\s*>\s+(\S.*)$/,C=/^ {40,}\S/,D=a=>""===a.trim();function E(a,b,c){for(;b<c&&D(a[b]);)b++;return b}let F={trust:"antigravity-trust","model-picker":"antigravity-model-picker","slash-menu":"antigravity-slash-menu"},G={question:null,approvalTarget:null,options:[],selectedIndex:-1};var H=c(29567),I=c(77245),J=c(39532);function K(a,b){return{worktreeId:a.worktreeId,cliToolId:a.cliToolId,instanceId:a.instanceId,sessionName:a.sessionName,sessionGeneration:a.sessionGeneration,screenAppearedAt:a.screenAppearedAt,kind:b.kind,question:b.question,options:b.options,approvalTarget:(0,J.vQ)(b.kind,b.approvalTarget,b.options),selectedPosition:b.selectedIndex>=0?b.selectedIndex+1:null}}function L(a){let{screen:b,target:c,session:d}=a;return null===b||null===b.token||null===b.appearedAt||null===d.generation?null:K({worktreeId:c.worktreeId,cliToolId:c.cliToolId,instanceId:c.instanceId,sessionName:c.sessionName,sessionGeneration:d.generation,screenAppearedAt:b.appearedAt},{kind:b.kind,question:b.question,options:b.options.map(a=>a.label),approvalTarget:b.approvalTarget,selectedIndex:null===b.selectedPosition?-1:b.selectedPosition-1})}function M(a){let{payload:b,now:c}=a,L=a.lastSend??null,M={worktreeId:a.worktreeId,cliToolId:a.cliToolId,instanceId:a.instanceId,sessionName:b.sessionName,resolvedBy:a.resolvedBy},N={running:b.isRunning,starting:"number"==typeof b.startingSince,generation:a.sessionGeneration},O=b.isRunning?function(a){if("antigravity"===a.cliToolId&&a.fullOutput){let b=function(a){let b=(0,h.aJ)(a),c=(0,h._A)(b);if((0,h.bH)(c)){let a=(0,m.g8)(c),b=a?.promptData;return b?.type!=="multiple_choice"?{kind:"unknown",...G}:{kind:"antigravity-permission",question:b.question,approvalTarget:b.approvalTarget??null,options:b.options.map(a=>a.label),selectedIndex:b.options.findIndex(a=>a.isDefault)}}let d=function(a){let b=a.split("\n").map(a=>a.trimEnd()),c=function(a){for(let b=a.length-1;b>=0;b--)if(n.YH.test(a[b])){for(let c=b+1;c<a.length;c++)if(n.lE.test(a[c]))return -1;return b}return -1}(b);return c<0?null:function(a,b){let c=Math.max(0,b-30),d=-1;for(let e=b-1;e>=c;e--)if(o.test(a[e])){d=e;break}if(d<0)return null;for(let c=b+1;c<a.length;c++)if(""!==a[c].trim()&&!u.test(a[c]))return null;let e=-1;for(let c=d+1;c<b;c++)if(q.test(a[c])){e=c;break}if(e<0)return null;let f=e;for(;f-1>d&&""!==a[f-1].trim();)f--;let g=v(a,f,b);if(null===g)return null;let h=null,i=Math.max(0,d-8);for(let b=d-1;b>=i;b--){let c=p.exec(a[b]);if(!c)continue;let e=c[1].trim();if(""!==e)h=e;else for(let c=b+1;c<d;c++)if(""!==a[c].trim()){h=a[c].trim();break}break}return{screen:"trust",question:a[d].trim(),approvalTarget:h,options:g.options,selectedIndex:g.selectedIndex}}(b,c)??function(a,b){let c=Math.max(0,b-30);for(let d=b-1;d>=c;d--){if(!n.d0.test(a[d]))continue;let c=d+1;for(;c<b&&""===a[c].trim();)c++;let e=v(a,c,b,t);if(null===e)break;return{screen:"model-picker",question:a[d].trim(),approvalTarget:null,options:e.options,selectedIndex:e.selectedIndex}}return null}(b,c)??function(a,b){let c=b-1;for(;c>=0&&(""===a[c].trim()||s.test(a[c]));)c--;let d=[],e=Math.max(0,b-30);for(;c>=e&&r.test(a[c]);c--)d.unshift(a[c]);return d.length<2||1!==d.filter(a=>q.test(a)).length?null:{screen:"slash-menu",question:null,approvalTarget:null,options:d.map(a=>r.exec(a)[1]),selectedIndex:d.findIndex(a=>q.test(a))}}(b,c)}(b);if(null===d){let a=function(a){let b,c=a.split("\n").map(a=>a.trimEnd()),d=function(a){for(let b=a.length-1;b>=0;b--)if(!(D(a[b])||C.test(a[b])))return w.test(a[b])?b:-1;return -1}(c);if(d<0)return null;let e=function(a,b){let c=Math.max(0,b-30);for(let d=b-1;d>=c;d--)if(x.test(a[d]))return d;return -1}(c,d);if(e<0)return null;let f=(b=E(c,e+1,d))>=d||!y.test(c[b])||++b>=d||!z.test(c[b])?-1:E(c,b+1,d);if(f<0)return null;let g=function(a,b,c){let d=[],e=-1,f=b;for(;f<c&&!D(a[f]);f++){if(A.test(a[f]))return null;if(B.test(a[f])){if(e>=0)return null;e=d.length}d.push(a[f].replace(/^\s*>\s+/,"").replace(/\s{2,}/g," ").trim())}return 0===d.length||e<0?null:{options:d,selectedIndex:e,end:f}}(c,f,d);return g&&function(a,b,c){let d=E(a,b,c);return!(d>=c)&&!!A.test(a[d])&&c-d<=6}(c,g.end,d)?{question:c[e].trim(),options:g.options,selectedIndex:g.selectedIndex}:null}(b);return null===a?null:{kind:"antigravity-model-picker",question:a.question,approvalTarget:null,options:[...a.options],selectedIndex:a.selectedIndex}}return{kind:F[d.screen],question:d.question,approvalTarget:d.approvalTarget,options:[...d.options],selectedIndex:d.selectedIndex}}(a.fullOutput);if(null!==b)return b}return a.isPromptWaiting||a.isSelectionListActive||a.isPagerActive||a.isDismissablePanelActive||a.isUnclassifiedActive||"waiting"===a.sessionStatus?{kind:"unknown",...function(a){if(!(0,l.XF)(a))return G;let b=a.approvalTarget??null;return"yes_no"===a.type?{question:a.question,approvalTarget:b,options:[...a.options],selectedIndex:a.defaultOption?a.options.indexOf(a.defaultOption):-1}:{question:a.question,approvalTarget:b,options:a.options.map(a=>a.label),selectedIndex:a.options.findIndex(a=>a.isDefault)}}(a.promptData)}:"ready"===a.sessionStatus?{kind:"composer",...G}:{kind:"none",...G}}({cliToolId:a.cliToolId,fullOutput:b.fullOutput,sessionStatus:b.sessionStatus,isPromptWaiting:b.isPromptWaiting,promptData:b.promptData,isSelectionListActive:b.isSelectionListActive,isPagerActive:b.isPagerActive,isDismissablePanelActive:b.isDismissablePanelActive,isUnclassifiedActive:b.isUnclassifiedActive}):null,{token:P,tokenWithheld:Q,appearedAt:R}=function(a,b){var c;let d=null===b?null:(c=a.sessionGeneration,(0,H.PJ)(b.kind)?"unknown"===b.kind?"unknown-screen":null===c?"no-session-generation":null:"no-decision"),e=a.sessionGeneration;if(null===b||null!==d||null===e)return a.appearance.forget(),{token:null,tokenWithheld:d,appearedAt:null};let f=a.payload.sessionName,g=a.appearance.note((0,J.z2)({sessionName:f,sessionGeneration:e,...b})),h=K({...a,sessionName:f,sessionGeneration:e,screenAppearedAt:g},b);return{token:(0,I.hH)(h,a.now),tokenWithheld:null,appearedAt:g}}(a,O),S=null;null!==O&&(S={kind:O.kind,token:P,tokenExpiresAt:null===P?null:(0,I.rk)(c),tokenWithheld:Q,appearedAt:R,question:O.question,approvalTarget:O.approvalTarget,options:O.options.map((a,b)=>({position:b+1,label:a})),selectedPosition:O.selectedIndex>=0?O.selectedIndex+1:null,answerVia:function(a,b){if(!(0,H.PJ)(a.kind))return"none";if("antigravity-trust"===a.kind)return"strict";let c=b.promptView??(0,k.ds)(b.promptData??null);return c?.kind==="screen-choices"?"screen":c?.kind==="api-choices"?"api":"terminal"}(O,b),sessionStatus:b.sessionStatus,sessionStatusReason:b.sessionStatusReason});let T=b.autoYes;return{schemaVersion:H.To,observedAt:c,target:M,session:N,status:null===O?"unavailable":"observed",unavailableReason:null===O?"session-not-running":null,screen:S,autoYes:{enabled:T?T.enabled:null,expiresAt:T?.expiresAt??null,stopReason:T?.stopReason??null,pollerActive:"boolean"==typeof b.serverPollerActive?b.serverPollerActive:null,pollerRecord:null===O?null:function(a,b,c){var d;let e=a.autoYes?.lastSuppression;return e?{reason:e.reason,mode:e.mode,promptType:e.promptType,...void 0!==e.pattern&&{pattern:e.pattern},at:e.at,ageSeconds:Math.max(0,Math.round((c-e.at)/1e3)),screenCorrelation:(d=e.promptType,(0,H.PJ)(b.kind)?(0,l.XF)(a.promptData)&&a.promptData.type!==d?"type-mismatch":"unknown":"no-prompt-on-screen")}:null}(b,O,c),contractEvaluation:function(a,b){let{policy:c,taskId:k}=a.contract,m=c?{taskId:k,mode:c.mode}:null;if(null===b)return{state:"not-evaluated",because:"session-not-running",contract:m};let n=a.payload.promptData;if(!(0,H.PJ)(b.kind)||!(0,l.XF)(n))return{state:"not-evaluated",because:"no-parsed-prompt",contract:m};let o=(0,j.hR)(a.cliToolId)?a.cliToolId:void 0,p=function(a,b,c){if(!(0,l.XF)(b))return;let d=a.autoYesAnswerMode??i.Rb,e=(0,f.Xc)((0,f.j4)(b,void 0,c),d);return"left-to-human"===e?{kind:"left-to-human"}:"base-rules"!==e?{kind:"answered",question:{optionRecommendations:function(a,b){if(!a||void 0===b)return;let c=(0,h._A)((0,h.aJ)(a));return(0,g.$M)(c,b,c.split("\n"),a).optionRecommendations}(a.fullOutput,c)}}:void 0}(a.payload,n,o);if(p?.kind==="left-to-human")return{state:"base-withholds",reason:e.eS,contract:m};let q=(0,d.sD)(n,c,o,p?.kind==="answered"?p.question:void 0);return null!==q.suppressedBy&&(0,e.PP)(q.suppressedBy)?{state:"base-withholds",reason:q.suppressedBy,contract:m}:null!==q.suppressedBy?{state:"policy-withholds",reason:q.suppressedBy,...void 0!==q.pattern&&{pattern:q.pattern},contract:m}:null===q.answer?{state:"no-base-answer",contract:m}:{state:"policy-permits",contract:m}}(a,O)},lastSend:null===L?null:{at:L.at,state:L.state,reason:L.reason}}}},20029:(a,b,c)=>{c.d(b,{C7:()=>r,KF:()=>n,Nq:()=>p,cu:()=>l,m4:()=>s,zE:()=>m});var d=c(55511),e=c(36925),f=c(72626),g=c(2669),h=c(7321);let i=(0,f.h)("session/send-attempt-state"),j=(0,e.v)("__sendAttemptRecords",()=>new Map);function k(a){return JSON.stringify([a.worktreeId,a.cliToolId,a.instanceId])}function l(a){return(0,d.createHash)("sha256").update(a,"utf8").digest("hex").slice(0,16)}function m(a,b,c=Date.now()){try{let d=k(a);for(j.delete(d),j.set(d,{at:Math.floor(c),state:b.state,reason:b.reason,messageDigest:l(b.content)});j.size>1024;){let a=j.keys().next().value;if(void 0===a)break;j.delete(a)}}catch(a){i.warn("send-attempt-record-failed",{error:a instanceof Error?a.message:String(a)})}}function n(a){return j.get(k(a))??null}let o=/Command failed: tmux |Failed to send (?:special )?keys? to tmux session|Failed to send special key:|Failed to paste message into tmux session/;function p(a){if("object"==typeof a&&null!==a&&a.code===g.M7)return{state:"not-sent",reason:"session-starting"};if("object"==typeof a&&null!==a&&a.code===h.Le)return{state:"not-sent",reason:"plan-review"};let b=a instanceof Error?a.message:String(a);return/Enter was not pressed, so nothing was submitted/.test(b)?{state:"indeterminate",reason:"body-not-landed"}:/replaced by a TUI autocompletion/.test(b)?{state:"indeterminate",reason:"replaced-by-completion"}:/submit could not be confirmed/i.test(b)?{state:"indeterminate",reason:"submit-unconfirmed"}:/Could not re-read session \S+ before typing \(.*\); nothing was typed \(Issue #3945\)/s.test(b)?{state:"not-sent",reason:"recheck-failed"}:o.test(b)?{state:"indeterminate",reason:"send-error"}:/prompt not ready/i.test(b)?{state:"not-sent",reason:"prompt-not-ready"}:/input lock not acquired, nothing was typed/.test(b)?/was replaced while this send waited/.test(b)?{state:"not-sent",reason:"session-replaced"}:{state:"not-sent",reason:"input-lock-timeout"}:/\(re-checked under the input lock\); nothing was typed/.test(b)?{state:"not-sent",reason:"prompt-waiting"}:/input lock lost, nothing was typed/.test(b)?{state:"not-sent",reason:"input-lock-lost"}:/still holds unsent text after \d+ clear passes/.test(b)?{state:"not-sent",reason:"composer-not-empty"}:{state:"indeterminate",reason:"send-error"}}function q(a){return a.replace(/\s+/g,"")}function r(a,b){let c=q(b.split("\n").find(a=>""!==a.trim())??"").slice(0,32);return""!==c&&q(a).includes(c)}function s(a){return"not-sent"===a.state?`[send state: not-sent (${a.reason}): the message was not typed. CommandMate does not resend it; send it again once the input prompt is back (\`commandmate prompt <worktree-id> --json\` shows the screen and lastSend).]`:"indeterminate"===a.state?`[send state: indeterminate (${a.reason}): part of the message may have been typed or submitted. CommandMate does not resend it; do not resend before checking the pane (\`commandmate capture <worktree-id> --pane\`), or it may arrive twice.]`:`[send state: sent (${a.reason})]`}},27289:(a,b,c)=>{c.d(b,{t:()=>j,z:()=>i});var d=c(10641),e=c(88807),f=c(56791),g=c(95506),h=c(66007);function i(a){if(!a)return a;try{if(!(0,h.h6)(a))return a;let b=(0,e.getDbInstance)();return(0,g.l0)(b,a)??a}catch{return a}}function j(a){if(!(0,h.h6)(a))return d.NextResponse.json({error:"Invalid worktree ID format"},{status:400});let b=(0,e.getDbInstance)(),c=(0,f.getWorktreeById)(b,i(a));return c||d.NextResponse.json({error:"Worktree not found"},{status:404})}},29567:(a,b,c)=>{c.d(b,{PJ:()=>h,To:()=>d,_Q:()=>k,a:()=>m,fm:()=>j,tq:()=>g});let d=1,e=["antigravity-trust","antigravity-model-picker","antigravity-permission","antigravity-slash-menu","composer","none","unknown"],f=["composer","none"];function g(a){return"string"==typeof a&&e.includes(a)}function h(a){return!f.includes(a)}let i=["antigravity-trust","antigravity-permission"];function j(a){return"string"==typeof a&&i.includes(a)}let k=["antigravity-trust"],l={"antigravity-trust":{position:2,optionCount:2,label:"No, exit"}};function m(a,b,c){let d=l[a];return void 0!==d&&d.position===b&&d.optionCount===c.length&&c[b-1].replace(/\s+/g," ").trim()===d.label}},77245:(a,b,c)=>{c.d(b,{hH:()=>i,iV:()=>k,rk:()=>j});var d=c(55511),e=c(36925);let f=(0,e.v)("__promptObservationTokenSecret",()=>({value:(0,d.randomBytes)(32)})),g=(0,e.v)("__promptObservationConsumedTokens",()=>new Map);function h(a,b){return(0,d.createHmac)("sha256",f.value).update(JSON.stringify(["po1",a.worktreeId,a.cliToolId,a.instanceId,a.sessionName,a.sessionGeneration,a.screenAppearedAt,a.kind,a.question,[...a.options],a.approvalTarget,a.selectedPosition,b])).digest()}function i(a,b){let c=Math.floor(b);return`po1.${c.toString(36)}.${h(a,c).toString("base64url")}`}function j(a){return Math.floor(a)+12e4}function k(a,b,c=Date.now()){let e=function(a,b,c=Date.now()){if("string"!=typeof a||a.length>80)return{ok:!1,reason:"malformed"};let e=a.split(".");if(3!==e.length||"po1"!==e[0]||!/^[0-9a-z]{1,12}$/.test(e[1])||!/^[A-Za-z0-9_-]{43}$/.test(e[2]))return{ok:!1,reason:"malformed"};let f=parseInt(e[1],36);if(!Number.isSafeInteger(f)||f.toString(36)!==e[1])return{ok:!1,reason:"malformed"};let g=Buffer.from(e[2],"base64url");if(g.toString("base64url")!==e[2])return{ok:!1,reason:"malformed"};let i=h(b,f);return g.length===i.length&&(0,d.timingSafeEqual)(g,i)?f-c>5e3?{ok:!1,reason:"not-yet-valid"}:c>=j(f)?{ok:!1,reason:"expired"}:{ok:!0,issuedAt:f}:{ok:!1,reason:"mismatch"}}(a,b,c);if(!e.ok)return e;for(let[a,b]of g)c>=b&&g.delete(a);let f=(0,d.createHash)("sha256").update(JSON.stringify(["po1",b.worktreeId,b.cliToolId,b.instanceId,b.sessionName,b.sessionGeneration,b.screenAppearedAt,b.kind,b.question,[...b.options],b.approvalTarget])).digest("base64url");return g.has(f)?{ok:!1,reason:"consumed"}:g.size>=4096?{ok:!1,reason:"consumed-store-full"}:(g.set(f,Math.floor(c)+12e4),e)}},95736:(a,b,c)=>{a.exports=c(44870)}};
@@ -1 +0,0 @@
1
- "use strict";exports.id=5775,exports.ids=[2839,5220,5775],exports.modules={20029:(a,b,c)=>{c.d(b,{C7:()=>r,KF:()=>n,Nq:()=>p,cu:()=>l,m4:()=>s,zE:()=>m});var d=c(55511),e=c(36925),f=c(72626),g=c(2669),h=c(7321);let i=(0,f.h)("session/send-attempt-state"),j=(0,e.v)("__sendAttemptRecords",()=>new Map);function k(a){return JSON.stringify([a.worktreeId,a.cliToolId,a.instanceId])}function l(a){return(0,d.createHash)("sha256").update(a,"utf8").digest("hex").slice(0,16)}function m(a,b,c=Date.now()){try{let d=k(a);for(j.delete(d),j.set(d,{at:Math.floor(c),state:b.state,reason:b.reason,messageDigest:l(b.content)});j.size>1024;){let a=j.keys().next().value;if(void 0===a)break;j.delete(a)}}catch(a){i.warn("send-attempt-record-failed",{error:a instanceof Error?a.message:String(a)})}}function n(a){return j.get(k(a))??null}let o=/Command failed: tmux |Failed to send (?:special )?keys? to tmux session|Failed to send special key:|Failed to paste message into tmux session/;function p(a){if("object"==typeof a&&null!==a&&a.code===g.M7)return{state:"not-sent",reason:"session-starting"};if("object"==typeof a&&null!==a&&a.code===h.Le)return{state:"not-sent",reason:"plan-review"};let b=a instanceof Error?a.message:String(a);return/Enter was not pressed, so nothing was submitted/.test(b)?{state:"indeterminate",reason:"body-not-landed"}:/replaced by a TUI autocompletion/.test(b)?{state:"indeterminate",reason:"replaced-by-completion"}:/submit could not be confirmed/i.test(b)?{state:"indeterminate",reason:"submit-unconfirmed"}:/Could not re-read session \S+ before typing \(.*\); nothing was typed \(Issue #3945\)/s.test(b)?{state:"not-sent",reason:"recheck-failed"}:o.test(b)?{state:"indeterminate",reason:"send-error"}:/prompt not ready/i.test(b)?{state:"not-sent",reason:"prompt-not-ready"}:/input lock not acquired, nothing was typed/.test(b)?/was replaced while this send waited/.test(b)?{state:"not-sent",reason:"session-replaced"}:{state:"not-sent",reason:"input-lock-timeout"}:/\(re-checked under the input lock\); nothing was typed/.test(b)?{state:"not-sent",reason:"prompt-waiting"}:/input lock lost, nothing was typed/.test(b)?{state:"not-sent",reason:"input-lock-lost"}:/still holds unsent text after \d+ clear passes/.test(b)?{state:"not-sent",reason:"composer-not-empty"}:{state:"indeterminate",reason:"send-error"}}function q(a){return a.replace(/\s+/g,"")}function r(a,b){let c=q(b.split("\n").find(a=>""!==a.trim())??"").slice(0,32);return""!==c&&q(a).includes(c)}function s(a){return"not-sent"===a.state?`[send state: not-sent (${a.reason}): the message was not typed. CommandMate does not resend it; send it again once the input prompt is back (\`commandmate prompt <worktree-id> --json\` shows the screen and lastSend).]`:"indeterminate"===a.state?`[send state: indeterminate (${a.reason}): part of the message may have been typed or submitted. CommandMate does not resend it; do not resend before checking the pane (\`commandmate capture <worktree-id> --pane\`), or it may arrive twice.]`:`[send state: sent (${a.reason})]`}},39687:(a,b,c)=>{c.d(b,{d:()=>A});var d=c(56791),e=c(8360),f=c(15194),g=c(95220),h=c(12462),i=c(43015),j=c(54325),k=c(72626),l=c(34331),m=c(40964),n=c(58707),o=c(2669),p=c(31990),q=c(20029),r=c(7321),s=c(94154),t=c(34405),u=c(49973),v=c(49319);let w=(0,k.h)("session/send-user-message");function x(a){return a instanceof Error?a.message:String(a)}async function y(a,b){let c=`${a}:${b}`,d=Date.now()+5e3;for(;(0,g.getActivePollers)().includes(c);){if(Date.now()>=d)return!1;await new Promise(a=>setTimeout(a,100))}return!0}async function z(a,b,c,d){if(!s.wn.has(b))return!1;try{let e=await (0,p.WD)(a,b,t._,c),f=(0,s.ji)(e,b);return"content"===f.state&&(0,q.C7)(f.text,d)}catch(a){return w.warn("send-composer-residue-read-failed",{error:x(a)}),!1}}async function A(a,b){let{worktreeId:c,content:k,cliToolId:p,instanceId:t,absoluteImagePath:A,copilotModel:B}=b,C=b.messageType??"normal",D=t??p,E=e.CLIToolManager.getInstance().getTool(p),F=(a,d)=>{(0,q.zE)({worktreeId:c,cliToolId:p,instanceId:D},{state:a,reason:d,content:k}),b.onAttempt?.({state:a,reason:d})},G=(0,m.mf)(p,c,t),H=await (0,l.L)(c,G,a);if(null===H||"foreign"===H.verdict)return F("not-sent","foreign-session"),w.warn("send-refused-foreign-session",{worktreeId:c,cliToolId:p,instanceId:D,sessionName:G,sessionPath:H?.sessionPath??null,reason:H?"foreign":"worktree_not_found"}),{ok:!1,stage:"foreign_session",error:H?`tmux session "${G}" belongs to another CommandMate server`:`Worktree '${c}' not found; cannot confirm tmux session "${G}" is this server's`};let I=await (0,n.a3)(c,p,t,{ignoreStructured:b.ignoreStructuredPromptGuard});if(I.waiting)return F("not-sent","prompt-waiting"),w.info("send-refused-prompt-waiting",{worktreeId:c,cliToolId:p,reason:I.reason,blockedBy:I.blockedBy}),{ok:!1,stage:"prompt_waiting",error:(0,n.br)(c,I.blockedBy)};if(B&&"copilot"===p){try{await E.sendModelCommand(c,B,t),w.info("copilot-model-command-sent",{model:B})}catch(b){w.error("failed-to-send-model-command:",{error:x(b)});let a=b?.code;if(a===r.a9)return F("not-sent","prompt-waiting"),{ok:!1,stage:"prompt_waiting",error:(0,n.br)(c)};return F("not-sent",a===r.$_?"recheck-failed":"model-switch-failed"),{ok:!1,stage:"model",error:x(b)}}await y(c,D)||w.warn("previous-turn-poller-still-running",{worktreeId:c,instanceId:D,waitedMs:5e3})}let J=new Date;try{await (0,h.o4)(a,c,p,J,t)}catch(a){w.error("failed-to-save-pending-assistant-response:",{error:x(a)})}let K=null;try{let b=(0,d.getMessages)(a,c,{limit:1,cliToolId:p,instanceId:D,matchResolvedInstance:!0});b.length>0&&"user"===b[0].role&&b[0].content===k&&(K=b[0].id)}catch(a){w.error("failed-to-detect-orphaned-messages:",{error:x(a)})}async function L(){try{let{inputStartedAt:a}=await (0,u.x1)(M,b.onInputStart,b.inputBoundary);return{sent:!0,inputStartedAt:a}}catch(b){if(w.error("failed-to-send-message-to:",{error:x(b)}),(0,u.fi)(b))return{error:b,failure:{state:"not-sent",reason:"relay-reservation-lost"}};let a=(0,q.Nq)(b);return"submit-unconfirmed"===a.reason&&await z(c,p,t,k)&&(a={state:"indeterminate",reason:"composer-residue"}),{error:b,failure:a}}}async function M(){A?(0,f._J)(E)?await E.sendMessageWithImage(c,k,A,t):await E.sendMessage(c,(0,v.TZ)(k,A),t):await E.sendMessage(c,k,t)}let N=s.wn.has(p)?await (0,u.hC)(G,()=>L()).catch(a=>({error:a,failure:(0,q.Nq)(a)})):await L();if(!("sent"in N)){let{error:a,failure:b}=N;return(F(b.state,b.reason),"prompt-waiting"===b.reason)?{ok:!1,stage:"prompt_waiting",error:(0,n.br)(c)}:(0,o.wQ)(a)?{ok:!1,stage:"send",error:a.message,code:o.M7}:{ok:!1,stage:"send",error:x(a)}}F("sent","submitted");let O=N.inputStartedAt,P=null!==O&&O.getTime()>J.getTime()?O:J,Q=(0,d.createMessage)(a,{worktreeId:c,role:"user",content:k,messageType:C,timestamp:P,cliToolId:p,instanceId:t,requestId:b.requestId});try{(0,i.broadcastMessage)("message",{worktreeId:c,message:{...Q,cliToolId:p,instanceId:D}})}catch(a){w.warn("user-message-broadcast-failed",{error:x(a)})}if(K)try{if((0,d.deleteMessageById)(a,K)){w.info("cleaned-up-orphaned-user");try{(0,i.broadcastMessage)(j.dz,{worktreeId:c,cliToolId:p,instanceId:D,reason:"orphan_cleanup"})}catch(a){w.warn("orphan-cleanup-broadcast-failed",{error:x(a)})}}}catch(a){w.error("failed-to-clean-up-orphaned-message:",{error:x(a)})}return(0,d.updateLastUserMessage)(a,c,k,P),(0,d.clearInProgressMessageId)(a,c,p,t),w.info("cleared-in-progress-message"),(0,g.startPolling)(c,p,t),{ok:!0,message:Q}}},58707:(a,b,c)=>{c.d(b,{$n:()=>k,a3:()=>l,br:()=>m});var d=c(8360),e=c(31990),f=c(95595),g=c(34405),h=c(72626),i=c(30008);let j=(0,h.h)("prompt-waiting-guard"),k="PROMPT_WAITING";async function l(a,b,c,h){try{let k=d.CLIToolManager.getInstance().getTool(b);if(!await k.isRunning(a,c))return{waiting:!1};let l=await (0,e.Wh)(a,b,g._,c),m=(0,f.WC)(l,b),n=(0,i._G)({worktreeId:a,cliToolId:b,instanceId:c,scraper:{status:m.status,reason:m.reason,hasActivePrompt:m.hasActivePrompt},ignoreStructured:h?.ignoreStructured});if(!n.blocksSend)return null!==n.structuredSendBlockSuppressed&&j.info("structured-send-guard-not-applied",{worktreeId:a,cliToolId:b,instanceId:c,suppressed:n.structuredSendBlockSuppressed,promptWaitingSince:n.structured?.at??null}),{waiting:!1};return{waiting:!0,reason:n.blockReason??void 0,blockedBy:n.blockedBy??void 0}}catch(c){return j.warn("prompt-waiting-check-failed",{worktreeId:a,cliToolId:b,error:c instanceof Error?c.message:String(c)}),{waiting:!1}}}function m(a,b){let c=`${a} is waiting on a prompt. Sending now would type into the prompt's input line instead of reaching the agent, and would leave that text in place for the next answer. Answer the prompt first: \`commandmate respond ${a} <answer>\`.`;if("structured"!==b)return c;let d=Math.round(i.j0/6e4);return`${c} This dialog was reported by the agent's own hooks and is not visible to the terminal scraper, so if the pane looks idle the record has outlived its dialog: it stops blocking sends ${d} minutes after it was reported, or immediately with \`commandmate send ${a} <message> --ignore-structured-prompt\` (server-wide: ${i.F1}=off).`}},85775:(a,b,c)=>{c.d(b,{Tm:()=>p,x4:()=>n,xJ:()=>o});var d=c(34129),e=c(8360),f=c(88807),g=c(72626),h=c(87374),i=c(39687),j=c(36925);let k=(0,g.h)("timer-manager");function l(){return(0,j.v)("__timerManagerState",()=>({timers:new Map,timerWorktrees:new Map,initialized:!1}))}async function m(a){let b=l(),c=(0,f.getDbInstance)();try{let b=(0,d.kx)(c,a);if(!b||"pending"!==b.status)return;let f=e.CLIToolManager.getInstance().getTool(b.cliToolId),g=b.instanceId,j=await f.isRunning(b.worktreeId,g),l=(0,d.kx)(c,a);if(!l||"pending"!==l.status)return;if(!j){k.warn("timer:no-session",{timerId:a,worktreeId:b.worktreeId,instanceId:g}),(0,d.j2)(c,a,h.HR.NO_SESSION);return}(0,d.j2)(c,a,"sending");let m=await (0,i.d)(c,{worktreeId:b.worktreeId,content:b.message,cliToolId:b.cliToolId,instanceId:g});if(!m.ok){let b=`[${m.stage}] ${m.error}`;(0,d.j2)(c,a,"failed",void 0,b),k.error("timer:send-failed",{timerId:a,stage:m.stage,error:m.error});return}(0,d.j2)(c,a,"sent",Date.now()),k.info("timer:sent",{timerId:a,worktreeId:b.worktreeId})}catch(e){let b=e instanceof Error?e.message:String(e);try{(0,d.j2)(c,a,"failed",void 0,b)}catch{}k.error("timer:send-failed",{timerId:a,error:b})}finally{b.timers.delete(a),b.timerWorktrees.delete(a)}}function n(a,b,c){let d=l(),e=setTimeout(()=>{m(a)},c);d.timers.set(a,e),d.timerWorktrees.set(a,b)}function o(a){let b=l(),c=b.timers.get(a);c&&(clearTimeout(c),b.timers.delete(a),b.timerWorktrees.delete(a));let e=(0,f.getDbInstance)();(0,d.Ud)(e,a)}function p(a){let b=l(),c=(0,f.getDbInstance)();for(let[c,d]of b.timerWorktrees)if(d===a){let a=b.timers.get(c);a&&clearTimeout(a),b.timers.delete(c),b.timerWorktrees.delete(c)}(0,d.$$)(c,a)}},95220:(a,b,c)=>{c.r(b),c.d(b,{accumulateTuiContent:()=>g.IZ,cleanClaudeResponse:()=>f.NN,cleanCopilotResponse:()=>f.LH,cleanGeminiResponse:()=>f.IS,cleanOpenCodeResponse:()=>f.aW,clearPromptHashCache:()=>h.iX,clearTuiAccumulator:()=>g.q1,extractCopilotContentLines:()=>g.o0,extractTuiContentLines:()=>g.K0,findOverlapIndex:()=>g.vQ,getAccumulatedContent:()=>g.Uz,getActivePollers:()=>d.KQ,initTuiAccumulator:()=>g.tb,isDuplicatePrompt:()=>h.gv,isOpenCodeComplete:()=>e.bE,migrateResponsePollerWorktreeIds:()=>d.sR,normalizeCopilotLine:()=>g.IW,normalizePromptForDedup:()=>h.zm,renamePromptHashCacheKey:()=>h.i2,resolveExtractionStartIndex:()=>e.QM,startPolling:()=>d.g8,stopAllPolling:()=>d.fq,stopPolling:()=>d.Et,truncateMessage:()=>f.Sj});var d=c(45146),e=c(60),f=c(82450),g=c(13033),h=c(72457)}};