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
@@ -1 +1 @@
1
- {"version":3,"file":"ask.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/ask.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA8cpC,wBAAgB,gBAAgB,IAAI,OAAO,CA4L1C"}
1
+ {"version":3,"file":"ask.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/ask.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAuepC,wBAAgB,gBAAgB,IAAI,OAAO,CA6N1C"}
@@ -62,6 +62,11 @@ const PANE_FALLBACK_TAIL = 80;
62
62
  * marked yet — a session that already answered returns on the first read. When
63
63
  * it does elapse the existing pane fallback takes over, so the cost of guessing
64
64
  * this too low is a screen scrape, never a lost turn.
65
+ *
66
+ * Issue #3983: also the bound of each read after the turn ended (the ledger,
67
+ * the overlap pages, the pane). Those are outside `--timeout` — the turn has
68
+ * already completed in time — so a read that does not answer within the grace
69
+ * moves on to the next fallback rather than ending the ask with 124.
65
70
  */
66
71
  const REPLY_TURN_ROW_GRACE_MS = 15_000;
67
72
  /** How often the grace above re-reads the ledger. */
@@ -130,8 +135,19 @@ function parseTimeout(raw) {
130
135
  async function readLatestReply(client, worktreeId, instanceId, since, cliToolId) {
131
136
  const requireTurnRow = cliToolId !== undefined && reply_ledger_1.TRANSCRIPT_READER_TOOLS.has(cliToolId);
132
137
  const deadline = Date.now() + (requireTurnRow ? REPLY_TURN_ROW_GRACE_MS : 0);
138
+ // Issue #3983: every read is bounded by the grace, with or without a turn row
139
+ // to wait for; one that runs out falls back to the pane like an empty ledger.
140
+ const graceClient = client.withDeadline(Date.now() + REPLY_TURN_ROW_GRACE_MS);
133
141
  for (;;) {
134
- const messages = await (0, reply_ledger_1.fetchRecentMessages)(client, worktreeId, instanceId);
142
+ let messages;
143
+ try {
144
+ messages = await (0, reply_ledger_1.fetchRecentMessages)(graceClient, worktreeId, instanceId);
145
+ }
146
+ catch (error) {
147
+ if (!(0, api_client_1.isDeadlineExceeded)(error))
148
+ throw error;
149
+ return { content: null, messages: null };
150
+ }
135
151
  // The rules are `reply`'s too (Issue #3039). A tool with no transcript
136
152
  // takes the newest row after the send, marker or not, with no wait.
137
153
  const reply = (0, reply_ledger_1.pickLatestReply)((0, reply_ledger_1.replyCandidates)(messages ?? [], since), requireTurnRow);
@@ -158,7 +174,10 @@ async function readLatestReply(client, worktreeId, instanceId, since, cliToolId)
158
174
  * @param instanceId - Resolved instance ID
159
175
  */
160
176
  async function readPaneTail(client, worktreeId, cliToolId, instanceId) {
161
- return (0, capture_1.readSqueezedPaneTail)(client, worktreeId, cliToolId, instanceId, PANE_FALLBACK_TAIL);
177
+ // Issue #3983: bounded like the ledger reads; a pane that does not answer is
178
+ // "no readable pane" (readSqueezedPaneTail never throws).
179
+ const graceClient = client.withDeadline(Date.now() + REPLY_TURN_ROW_GRACE_MS);
180
+ return (0, capture_1.readSqueezedPaneTail)(graceClient, worktreeId, cliToolId, instanceId, PANE_FALLBACK_TAIL);
162
181
  }
163
182
  /** Argument checks. A mocked `process.exit` returns, so nothing here stops early. */
164
183
  function validateAskArgs(worktreeId, message, options) {
@@ -329,7 +348,14 @@ function overlapWindowEnd(askedAt, turnEndedAt, closedAt) {
329
348
  async function readOverlapLedger(client, worktreeId, instanceId, message, askedAt, until, messages) {
330
349
  let rows = messages;
331
350
  if (rows && (0, reply_ledger_1.mayHaveDroppedRowsSince)(rows, askedAt)) {
332
- const since = await (0, reply_ledger_1.fetchPromptRowsSince)(client, worktreeId, instanceId, askedAt);
351
+ // Issue #3983: bounded by the reply grace; a page that does not answer in
352
+ // it is read like one that failed — the rows already read stand.
353
+ const graceClient = client.withDeadline(Date.now() + REPLY_TURN_ROW_GRACE_MS);
354
+ const since = await (0, reply_ledger_1.fetchPromptRowsSince)(graceClient, worktreeId, instanceId, askedAt).catch((error) => {
355
+ if ((0, api_client_1.isDeadlineExceeded)(error))
356
+ return null;
357
+ throw error;
358
+ });
333
359
  if (since)
334
360
  rows = [...rows, ...since];
335
361
  }
@@ -401,7 +427,9 @@ Exit codes (wait's, unchanged; --async always exits 0 once the relay exists):
401
427
  name it (id=...). id=context-limit: the conversation is over the model's
402
428
  limit; \`instances <id> kill <instance>\` and ask again in a fresh session
403
429
  21 nothing was running to ask
404
- 124 timed out. Look with \`capture <id> --instance <id> --pane --tail 60\`
430
+ 124 timed out. Look with \`capture <id> --instance <id> --pane --tail 60\`.
431
+ When the send itself returned past the deadline, the message WAS sent
432
+ (stderr says so); do not send it again
405
433
 
406
434
  Send one ask at a time to an instance (Issue #3955). A message sent while the
407
435
  instance is mid-turn can be folded into that turn (codex does), and the two
@@ -416,10 +444,14 @@ There is deliberately no --auto-yes: turning another session's Auto-Yes on is
416
444
  a decision about that session's guard rails, not part of asking it a question.
417
445
  `)
418
446
  .action(async (worktreeId, message, options) => {
447
+ // Issue #3983: `--timeout` counts from here, the resolution and the send
448
+ // included.
449
+ const commandStartedAt = Date.now();
419
450
  try {
420
451
  validateAskArgs(worktreeId, message, options);
421
452
  const timeout = parseTimeout(options.timeout);
422
453
  const client = new api_client_1.ApiClient({ token: options.token });
454
+ const deadlineAt = commandStartedAt + timeout * 1000;
423
455
  // Resolved once, before the send, and reused for the wait and both
424
456
  // reads: the alias-to-id mapping and the roster's tool are the same
425
457
  // facts for all four requests, and asking twice is how two of them end
@@ -433,7 +465,10 @@ a decision about that session's guard rails, not part of asking it a question.
433
465
  // worktree default: exit 21 while the default was not running, and the
434
466
  // default's turn instead of <tool>'s while it was.
435
467
  const selector = options.instance ?? options.agent;
436
- const { agent, instanceId } = await (0, command_target_1.resolveCommandTarget)(client, worktreeId, selector, options.agent);
468
+ //
469
+ // Issue #3983: bounded by `--timeout`; running out is exit 124, nothing sent.
470
+ const commandTarget = await (0, command_target_1.resolveCommandTarget)(client.withDeadline(deadlineAt), worktreeId, selector, options.agent);
471
+ const { agent, instanceId } = commandTarget;
437
472
  // Taken BEFORE the send so a reply written by the previous turn cannot
438
473
  // be read as this one's. Milliseconds, compared against the row's own
439
474
  // timestamp rather than against a re-derived clock.
@@ -441,6 +476,9 @@ a decision about that session's guard rails, not part of asking it a question.
441
476
  // Issue #2377: registered BEFORE the send, so a session that answers
442
477
  // immediately cannot finish its turn in the window between the message
443
478
  // and the ledger row. A refusal exits 2 having sent nothing.
479
+ //
480
+ // Issue #3983: the endpoint resolution is bounded by `--timeout` (exit
481
+ // 124, nothing registered or sent); the relay POST is not cut, like `/send`.
444
482
  let relay;
445
483
  if (options.async) {
446
484
  relay = await (0, message_dispatch_1.registerRelayForMessage)(client, {
@@ -449,6 +487,7 @@ a decision about that session's guard rails, not part of asking it a question.
449
487
  instance: options.instance,
450
488
  agent: options.agent,
451
489
  allowRelayChain: options.allowRelayChain,
490
+ resolveClient: client.withDeadline(deadlineAt),
452
491
  });
453
492
  }
454
493
  const sendBody = { content: message };
@@ -465,6 +504,7 @@ a decision about that session's guard rails, not part of asking it a question.
465
504
  const sent = await (0, message_dispatch_1.postMessage)(client, worktreeId, sendBody, {
466
505
  relay,
467
506
  promptWaitingFallback: `${worktreeId} is waiting on a prompt; the message was not sent.`,
507
+ target: commandTarget,
468
508
  });
469
509
  // Issue #2377: the whole point of `--async`. Nothing is waited on, so
470
510
  // the caller's own turn ends here and the answer arrives later, in their
@@ -473,6 +513,16 @@ a decision about that session's guard rails, not part of asking it a question.
473
513
  printAsyncAck(worktreeId, instanceId, agent, relay.id, options);
474
514
  return;
475
515
  }
516
+ // Issue #3983: the send itself is not cut by `--timeout` — aborting it
517
+ // would leave "was it sent?" unanswered — but its time counts. Past the
518
+ // deadline once it returns, the ask ends here, saying the message went in.
519
+ if (Date.now() >= deadlineAt) {
520
+ console.error(`Timeout: ${worktreeId} exceeded ${timeout}s while the message was being sent. `
521
+ + 'The message was sent; not waiting for the reply. '
522
+ + `Look with \`capture ${worktreeId}${instanceId ? ` --instance ${instanceId}` : ''} --pane --tail 60\`.`);
523
+ process.exit(types_1.WaitExitCode.TIMEOUT);
524
+ return;
525
+ }
476
526
  console.error('Message sent. Waiting for the reply...');
477
527
  // `wait`'s own poller, with `wait`'s own defaults: --on-prompt is left
478
528
  // at `agent`, so a prompt ends this ask with exit 10 and the payload
@@ -484,6 +534,7 @@ a decision about that session's guard rails, not part of asking it a question.
484
534
  const record = { openAtSend: false, closedAt: null };
485
535
  const result = await (0, wait_1.pollWorktree)(client, worktreeId, {
486
536
  timeout,
537
+ timeoutStartedAt: commandStartedAt,
487
538
  instance: instanceId,
488
539
  token: options.token,
489
540
  // Always on (Issue #3011): a turn that never ran must not read as a reply.
@@ -32,6 +32,7 @@
32
32
  import { Command } from 'commander';
33
33
  import { ApiClient } from '../utils/api-client';
34
34
  import type { ApiErrorPayload } from '../utils/api-client';
35
+ import { type CommandTarget } from './command-target';
35
36
  /** The name `attach` will connect to, and whether the server published it. */
36
37
  export interface AttachSessionTarget {
37
38
  sessionName: string;
@@ -136,11 +137,13 @@ export declare function planGuardedAttach(ownership: Extract<AttachOwnership, {
136
137
  * @param cliToolId - Resolved CLI tool
137
138
  * @param worktreeId - Worktree id, so the hint's commands are copy-pasteable
138
139
  * @param sessionName - Resolved tmux session name
139
- * @param options - The flags as given
140
+ * @param options - The flags as given; `target` is the resolved target the
141
+ * `capture` hints name (Issue #3982), none when absent
140
142
  */
141
143
  export declare function buildAttachHints(cliToolId: string, worktreeId: string, sessionName: string, options: {
142
144
  readOnly?: boolean;
143
145
  live?: boolean;
146
+ target?: CommandTarget;
144
147
  }): string[];
145
148
  export declare function createAttachCommand(): Command;
146
149
  //# sourceMappingURL=attach.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"attach.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/attach.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAGH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,OAAO,EACL,SAAS,EAMV,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAsD3D,8EAA8E;AAC9E,MAAM,WAAW,mBAAmB;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB;;;;;OAKG;IACH,SAAS,EAAE,OAAO,CAAC;CACpB;AAqCD;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,eAAe,GACvB;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,GACpB;IAAE,OAAO,EAAE,SAAS,CAAC;IAAC,OAAO,EAAE,eAAe,CAAA;CAAE,GAChD;IAAE,OAAO,EAAE,aAAa,CAAC;IAAC,GAAG,EAAE,YAAY,GAAG,WAAW,CAAC;IAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAC;AAE5F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,SAAS,EACjB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OAAO,CAqF7C"}
@@ -44,6 +44,8 @@ const cli_tool_ids_1 = require("../config/cli-tool-ids");
44
44
  const agent_target_options_1 = require("../config/agent-target-options");
45
45
  const session_target_1 = require("../utils/session-target");
46
46
  const agent_instances_1 = require("../utils/agent-instances");
47
+ const follow_up_command_1 = require("../utils/follow-up-command");
48
+ const command_target_1 = require("./command-target");
47
49
  const session_name_1 = require("../../lib/cli-tools/session-name");
48
50
  const validation_1 = require("../../lib/cli-tools/validation");
49
51
  const tmux_session_surface_1 = require("../../lib/session/tmux-session-surface");
@@ -71,9 +73,14 @@ async function resolveTarget(client, worktreeId, options) {
71
73
  console.error(`Error: ${(0, session_target_1.describeSessionTargetConflict)(target.conflict)}`);
72
74
  process.exit(types_1.ExitCode.CONFIG_ERROR);
73
75
  }
76
+ const cliToolId = target.cliToolId ?? options.agent ?? cli_tool_ids_1.DEFAULT_CLI_TOOL_ID;
77
+ const instanceId = target.instanceId ?? options.instance;
74
78
  return {
75
- cliToolId: target.cliToolId ?? options.agent ?? cli_tool_ids_1.DEFAULT_CLI_TOOL_ID,
76
- instanceId: target.instanceId ?? options.instance,
79
+ cliToolId,
80
+ instanceId,
81
+ // Issue #3982: what the hints name — the instance only when one was asked
82
+ // for (the server echoes the default instance otherwise), as `resolveCommandTarget`.
83
+ commandTarget: (0, command_target_1.commandTargetOf)(options.instance ? { cliToolId, instanceId } : null, options.agent),
77
84
  };
78
85
  }
79
86
  /**
@@ -233,18 +240,22 @@ function planGuardedAttach(ownership, sessionName, options) {
233
240
  * @param cliToolId - Resolved CLI tool
234
241
  * @param worktreeId - Worktree id, so the hint's commands are copy-pasteable
235
242
  * @param sessionName - Resolved tmux session name
236
- * @param options - The flags as given
243
+ * @param options - The flags as given; `target` is the resolved target the
244
+ * `capture` hints name (Issue #3982), none when absent
237
245
  */
238
246
  function buildAttachHints(cliToolId, worktreeId, sessionName, options) {
247
+ const capture = (flags) => options.target
248
+ ? (0, follow_up_command_1.followUpCommand)('capture', worktreeId, options.target, undefined, flags)
249
+ : `commandmate capture ${worktreeId} ${flags}`;
239
250
  const hints = [`Attaching to ${sessionName} (${cliToolId}). Detach with Ctrl+b then d.`];
240
251
  if ((0, tmux_session_surface_1.usesAltScreen)(cliToolId) && !options.live) {
241
- hints.push(`${cliToolId} draws its transcript at the top of a 200x1000 canvas and its composer at the`, 'bottom, and tmux follows the cursor — so this attach shows the composer and blank rows,', 'not the conversation. To read it:', ` prefix + g popup, in this terminal`, ` commandmate capture ${worktreeId} --pane --tail 60 without attaching`, ` commandmate capture ${worktreeId} --pane --follow live, without attaching`);
252
+ hints.push(`${cliToolId} draws its transcript at the top of a 200x1000 canvas and its composer at the`, 'bottom, and tmux follows the cursor — so this attach shows the composer and blank rows,', 'not the conversation. To read it:', ` prefix + g popup, in this terminal`, ` ${capture('--pane --tail 60')} without attaching`, ` ${capture('--pane --follow')} live, without attaching`);
242
253
  if ((0, tmux_session_surface_1.isLiveAttachSupported)(cliToolId)) {
243
254
  hints.push(` commandmate attach ${worktreeId} --live re-lay-out to this terminal`);
244
255
  }
245
256
  }
246
257
  if (options.readOnly) {
247
- hints.push('Read-only attach: tmux delivers no keys but the detach one, so prefix + g does NOT open', 'the popup here. Read with `commandmate capture <id> --pane --follow` in another terminal.');
258
+ hints.push('Read-only attach: tmux delivers no keys but the detach one, so prefix + g does NOT open', `the popup here. Read with \`${capture('--pane --follow')}\` in another terminal.`);
248
259
  }
249
260
  if (options.live) {
250
261
  hints.push('Live attach: this session follows THIS terminal until you detach, then goes back to', '200x1000. The web terminal shows the smaller frame while you are attached.');
@@ -322,11 +333,11 @@ function createAttachCommand() {
322
333
  process.exit(types_1.ExitCode.CONFIG_ERROR);
323
334
  }
324
335
  const client = new api_client_1.ApiClient({ token: options.token });
325
- const { cliToolId, instanceId } = await resolveTarget(client, worktreeId, options);
336
+ const { cliToolId, instanceId, commandTarget } = await resolveTarget(client, worktreeId, options);
326
337
  if (options.live && !(0, tmux_session_surface_1.isLiveAttachSupported)(cliToolId)) {
327
338
  console.error(`Error: --live is not supported for ${cliToolId}. It is claude-only until each other `
328
339
  + "agent's detection rules are re-measured at a terminal-sized pane (Issue #2317). "
329
- + `Attach without it, or read with: commandmate capture ${worktreeId} --pane --follow`);
340
+ + `Attach without it, or read with: ${(0, follow_up_command_1.followUpCommand)('capture', worktreeId, commandTarget, undefined, '--pane --follow')}`);
330
341
  process.exit(types_1.ExitCode.CONFIG_ERROR);
331
342
  }
332
343
  const target = await resolveAttachSessionName(client, worktreeId, cliToolId, instanceId);
@@ -357,6 +368,7 @@ function createAttachCommand() {
357
368
  for (const line of buildAttachHints(cliToolId, worktreeId, sessionName, {
358
369
  readOnly,
359
370
  live: options.live,
371
+ target: commandTarget,
360
372
  })) {
361
373
  console.error(line);
362
374
  }
@@ -20,4 +20,11 @@ export interface CommandTarget {
20
20
  * @param mode - Passed on only when given, so the call shape stays as it was
21
21
  */
22
22
  export declare function resolveCommandTarget(client: ApiClient, worktreeId: string, selector: string | undefined, requestedAgent: string | undefined, mode?: InstanceConflictMode): Promise<CommandTarget>;
23
+ /**
24
+ * The {@link CommandTarget} for a target resolved some other way (Issue #3982:
25
+ * `attach` and `wait` resolve their own), by the same rule as above.
26
+ *
27
+ * @param target - The resolved instance, or null when no selector was given
28
+ */
29
+ export declare function commandTargetOf(target: ResolvedInstanceTarget | null, requestedAgent: string | undefined): CommandTarget;
23
30
  //# sourceMappingURL=command-target.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"command-target.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/command-target.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,KAAK,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAEhF,MAAM,WAAW,aAAa;IAC5B,4DAA4D;IAC5D,MAAM,EAAE,sBAAsB,GAAG,IAAI,CAAC;IACtC,0EAA0E;IAC1E,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,gEAAgE;IAChE,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;CAChC;AAED;;;GAGG;AACH,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,SAAS,EACjB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,cAAc,EAAE,MAAM,GAAG,SAAS,EAClC,IAAI,CAAC,EAAE,oBAAoB,GAC1B,OAAO,CAAC,aAAa,CAAC,CASxB"}
1
+ {"version":3,"file":"command-target.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/command-target.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,KAAK,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAEhF,MAAM,WAAW,aAAa;IAC5B,4DAA4D;IAC5D,MAAM,EAAE,sBAAsB,GAAG,IAAI,CAAC;IACtC,0EAA0E;IAC1E,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,gEAAgE;IAChE,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;CAChC;AAED;;;GAGG;AACH,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,SAAS,EACjB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,cAAc,EAAE,MAAM,GAAG,SAAS,EAClC,IAAI,CAAC,EAAE,oBAAoB,GAC1B,OAAO,CAAC,aAAa,CAAC,CAOxB;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,sBAAsB,GAAG,IAAI,EACrC,cAAc,EAAE,MAAM,GAAG,SAAS,GACjC,aAAa,CAIf"}
@@ -8,6 +8,7 @@
8
8
  */
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.resolveCommandTarget = resolveCommandTarget;
11
+ exports.commandTargetOf = commandTargetOf;
11
12
  const instances_1 = require("./instances");
12
13
  /**
13
14
  * @param selector - Falsy means "no instance": nothing is requested of the server
@@ -19,6 +20,15 @@ async function resolveCommandTarget(client, worktreeId, selector, requestedAgent
19
20
  ? await (0, instances_1.resolveInstanceTarget)(client, worktreeId, selector, requestedAgent)
20
21
  : await (0, instances_1.resolveInstanceTarget)(client, worktreeId, selector, requestedAgent, mode)
21
22
  : null;
23
+ return commandTargetOf(target, requestedAgent);
24
+ }
25
+ /**
26
+ * The {@link CommandTarget} for a target resolved some other way (Issue #3982:
27
+ * `attach` and `wait` resolve their own), by the same rule as above.
28
+ *
29
+ * @param target - The resolved instance, or null when no selector was given
30
+ */
31
+ function commandTargetOf(target, requestedAgent) {
22
32
  const agent = target ? target.cliToolId : requestedAgent;
23
33
  const instanceId = target?.instanceId;
24
34
  return { target, agent, instanceId };
@@ -1 +1 @@
1
- {"version":3,"file":"instances.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/instances.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,OAAO,EAAE,SAAS,EAAkD,MAAM,qBAAqB,CAAC;AAsKhG;;;;;;;;;;GAUG;AACH,MAAM,MAAM,oBAAoB,GAAG,QAAQ,GAAG,WAAW,CAAC;AAE1D;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAsB,sBAAsB,CAC1C,MAAM,EAAE,SAAS,EACjB,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,EAClB,cAAc,EAAE,MAAM,GAAG,SAAS,EAClC,IAAI,GAAE,oBAA+B,GACpC,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAG7B;AAiBD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAKzD;AAED;;;;;;GAMG;AACH,eAAO,MAAM,0BAA0B,QAE6D,CAAC;AAErG,4E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AE0B,CAAC;AAE/D,8EAA8E;AAC9E,MAAM,WAAW,sBAAsB;IACrC,wEAAwE;IACxE,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B;;;;;;;;;;;;OAYG;IACH,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;CAChC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,SAAS,EACjB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,cAAc,EAAE,MAAM,GAAG,SAAS,EAClC,IAAI,GAAE,oBAA+B,GACpC,OAAO,CAAC,sBAAsB,CAAC,CAmCjC;AAsWD,wBAAgB,sBAAsB,IAAI,OAAO,CAgFhD"}
@@ -26,6 +26,9 @@ const session_target_1 = require("../utils/session-target");
26
26
  // "the worktree id is wrong", and only the session's own identity can tell them
27
27
  // apart.
28
28
  const whoami_1 = require("./whoami");
29
+ // Issue #3993: each kill is recorded so the env-clean gate can tell a sibling
30
+ // session the orchestrator stopped from one a worker killed.
31
+ const session_kill_ledger_1 = require("../../lib/verification/session-kill-ledger");
29
32
  // Issue #2317: the tmux session name each instance runs in, so `commandmate
30
33
  // attach` / `tmux attach` need no hand-assembly of `mcbd-<tool>-<wt>[-<suffix>]`.
31
34
  const session_name_1 = require("../../lib/cli-tools/session-name");
@@ -388,6 +391,37 @@ async function addInstance(client, worktreeId, options) {
388
391
  console.log(JSON.stringify(next, null, 2));
389
392
  }
390
393
  }
394
+ /**
395
+ * Record a successful kill in the session-kill ledger (Issue #3993): which
396
+ * worktree and instance, the tmux sessions the server says it stopped
397
+ * (`killedSessions` of the kill-session response), and who asked — this
398
+ * process's cwd and tmux session. A response without `killedSessions` (an
399
+ * older server) records no session, which excuses nothing.
400
+ * Best effort: the ledger never fails the command, the kill already happened.
401
+ */
402
+ function recordSessionKill(worktreeId, instanceId, response) {
403
+ let callerCwd;
404
+ try {
405
+ callerCwd = process.cwd();
406
+ }
407
+ catch {
408
+ callerCwd = null;
409
+ }
410
+ const killed = response?.killedSessions;
411
+ (0, session_kill_ledger_1.appendSessionKillRecord)({
412
+ version: session_kill_ledger_1.SESSION_KILL_LEDGER_VERSION,
413
+ at: Date.now(),
414
+ api: 'kill-session',
415
+ origin: 'cli',
416
+ worktreeId,
417
+ instanceId,
418
+ sessionNames: Array.isArray(killed)
419
+ ? killed.filter((name) => typeof name === 'string')
420
+ : [],
421
+ callerCwd,
422
+ callerSession: (0, whoami_1.readTmuxSessionName)(),
423
+ });
424
+ }
391
425
  /**
392
426
  * Remove action: drop an instance from the roster. Kills the session first
393
427
  * (when --kill) so the server can still resolve its CLI tool from the roster.
@@ -408,7 +442,8 @@ async function removeInstance(client, worktreeId, instanceId, options) {
408
442
  }
409
443
  if (options.kill) {
410
444
  try {
411
- await client.post(`/api/worktrees/${worktreeId}/kill-session?instance=${encodeURIComponent(instanceId)}`);
445
+ const killResponse = await client.post(`/api/worktrees/${worktreeId}/kill-session?instance=${encodeURIComponent(instanceId)}`);
446
+ recordSessionKill(worktreeId, instanceId, killResponse);
412
447
  console.error(`Session killed: ${instanceId}`);
413
448
  }
414
449
  catch (killError) {
@@ -451,7 +486,8 @@ async function killInstance(client, worktreeId, instanceId) {
451
486
  console.error('Error: Invalid instance id. Must be an alphanumeric/underscore/hyphen identifier (max 64 chars).');
452
487
  process.exit(types_1.ExitCode.CONFIG_ERROR);
453
488
  }
454
- await client.post(`/api/worktrees/${worktreeId}/kill-session?instance=${encodeURIComponent(instanceId)}`);
489
+ const killResponse = await client.post(`/api/worktrees/${worktreeId}/kill-session?instance=${encodeURIComponent(instanceId)}`);
490
+ recordSessionKill(worktreeId, instanceId, killResponse);
455
491
  console.error(`Session killed: ${instanceId}`);
456
492
  }
457
493
  /**
@@ -8,6 +8,7 @@
8
8
  */
9
9
  import type { ChatMessage } from '../types/api-responses';
10
10
  import { ApiClient } from '../utils/api-client';
11
+ import type { CommandTarget } from './command-target';
11
12
  import { type RegisteredRelay } from './relays';
12
13
  /**
13
14
  * Code the send API returns when the session is blocked on a prompt (Issue
@@ -23,6 +24,13 @@ export interface RegisterRelayForMessageInput {
23
24
  instance?: string;
24
25
  agent?: string;
25
26
  allowRelayChain?: boolean;
27
+ /**
28
+ * Issue #3983: the client the two endpoints are resolved with (`ask` passes
29
+ * its `--timeout`-bounded one). Defaults to `client`. The relay POST itself
30
+ * always goes through `client`: it creates state, and cutting it would leave
31
+ * "was the relay opened?" unanswered — the same reason `/send` is not cut.
32
+ */
33
+ resolveClient?: ApiClient;
26
34
  }
27
35
  /** Resolve both endpoints and open the relay; returns its id and whether it is bound. */
28
36
  export declare function registerRelayForMessage(client: ApiClient, input: RegisterRelayForMessageInput): Promise<RegisteredRelay>;
@@ -36,13 +44,19 @@ export interface PostMessageOptions {
36
44
  onFailure?: () => Promise<void>;
37
45
  /** Printed (after `Error: `) when PROMPT_WAITING carried no message body. */
38
46
  promptWaitingFallback: string;
47
+ /** The resolved target the send addressed; the hints name it (Issue #3982). */
48
+ target: CommandTarget;
39
49
  }
40
50
  /**
41
51
  * What to tell the sender about resending a failed send, from the server's
42
- * `sendOutcome` on the error (Issue #3992). Null when the error carries none
43
- * (a send that named no bound relay, an older server) or says `sent`.
52
+ * `sendOutcome` on the error (Issue #3992). Issue #4011: the route puts it on
53
+ * every failure recorded as the send's attempt, bound relay or not. Null when
54
+ * the error carries none (a 400, an older server) or says `sent`.
55
+ *
56
+ * @param target - The resolved target, so the `capture` reads the pane the
57
+ * message went to (Issue #3982); omitted, the hint names no target
44
58
  */
45
- export declare function describeFailedSendOutcome(error: unknown, worktreeId: string): string | null;
59
+ export declare function describeFailedSendOutcome(error: unknown, worktreeId: string, target?: CommandTarget): string | null;
46
60
  /**
47
61
  * Post the message; on failure cancel the relay and report PROMPT_WAITING.
48
62
  *
@@ -1 +1 @@
1
- {"version":3,"file":"message-dispatch.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/message-dispatch.ts"],"names":[],"mappings":"AAAA;;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,GAC1B,OAAO,CAAC,WAAW,CAAC,CA+CtB"}
@@ -14,6 +14,7 @@ exports.describeFailedSendOutcome = describeFailedSendOutcome;
14
14
  exports.postMessage = postMessage;
15
15
  const types_1 = require("../types");
16
16
  const api_client_1 = require("../utils/api-client");
17
+ const follow_up_command_1 = require("../utils/follow-up-command");
17
18
  const relays_1 = require("./relays");
18
19
  /**
19
20
  * Code the send API returns when the session is blocked on a prompt (Issue
@@ -24,8 +25,9 @@ const relays_1 = require("./relays");
24
25
  exports.PROMPT_WAITING_CODE = 'PROMPT_WAITING';
25
26
  /** Resolve both endpoints and open the relay; returns its id and whether it is bound. */
26
27
  async function registerRelayForMessage(client, input) {
27
- const replyEndpoint = await (0, relays_1.resolveRelayEndpoint)(client, input.replyTo);
28
- const workerEndpoint = await (0, relays_1.resolveEndpointForWorktree)(client, input.worktreeId, input.instance, input.agent);
28
+ const resolveClient = input.resolveClient ?? client;
29
+ const replyEndpoint = await (0, relays_1.resolveRelayEndpoint)(resolveClient, input.replyTo);
30
+ const workerEndpoint = await (0, relays_1.resolveEndpointForWorktree)(resolveClient, input.worktreeId, input.instance, input.agent);
29
31
  return (0, relays_1.registerRelay)(client, {
30
32
  from: replyEndpoint,
31
33
  to: workerEndpoint,
@@ -69,10 +71,14 @@ async function resolveBoundSendOutcome(client, relayId, error) {
69
71
  }
70
72
  /**
71
73
  * What to tell the sender about resending a failed send, from the server's
72
- * `sendOutcome` on the error (Issue #3992). Null when the error carries none
73
- * (a send that named no bound relay, an older server) or says `sent`.
74
+ * `sendOutcome` on the error (Issue #3992). Issue #4011: the route puts it on
75
+ * every failure recorded as the send's attempt, bound relay or not. Null when
76
+ * the error carries none (a 400, an older server) or says `sent`.
77
+ *
78
+ * @param target - The resolved target, so the `capture` reads the pane the
79
+ * message went to (Issue #3982); omitted, the hint names no target
74
80
  */
75
- function describeFailedSendOutcome(error, worktreeId) {
81
+ function describeFailedSendOutcome(error, worktreeId, target) {
76
82
  if (!(error instanceof api_client_1.ApiError))
77
83
  return null;
78
84
  const outcome = error.payload?.sendOutcome;
@@ -81,7 +87,7 @@ function describeFailedSendOutcome(error, worktreeId) {
81
87
  }
82
88
  if (outcome === 'unknown') {
83
89
  return ('Note: whether the message was sent is not known (sendOutcome=unknown); '
84
- + `check the pane first (\`commandmate capture ${worktreeId} --pane\`) and do not resend before that, `
90
+ + `check the pane first (\`${(0, follow_up_command_1.paneCaptureCommand)(worktreeId, target)}\`) and do not resend before that, `
85
91
  + 'or it may arrive twice.');
86
92
  }
87
93
  return null;
@@ -122,14 +128,14 @@ async function postMessage(client, worktreeId, sendBody, options) {
122
128
  }
123
129
  else if (relayId && outcome === 'unknown') {
124
130
  // Issue #3992: the relay notice carries the "look before resending" hint.
125
- (0, relays_1.printRelayUnconfirmedNotice)(relayId, worktreeId);
131
+ (0, relays_1.printRelayUnconfirmedNotice)(relayId, worktreeId, options.target);
126
132
  }
127
133
  const promptWaiting = error instanceof api_client_1.ApiError && error.apiCode === exports.PROMPT_WAITING_CODE;
128
134
  // Issue #3992: whether it may be sent again, as the server said — not on
129
135
  // PROMPT_WAITING, whose own line says to answer the prompt first, and not
130
136
  // when the relay notice above already said it.
131
137
  if (!promptWaiting && !(relayId && outcome === 'unknown')) {
132
- const resendNote = describeFailedSendOutcome(error, worktreeId);
138
+ const resendNote = describeFailedSendOutcome(error, worktreeId, options.target);
133
139
  if (resendNote !== null)
134
140
  console.error(resendNote);
135
141
  }
@@ -27,6 +27,7 @@
27
27
  */
28
28
  import { Command } from 'commander';
29
29
  import { ApiClient } from '../utils/api-client';
30
+ import type { CommandTarget } from './command-target';
30
31
  /**
31
32
  * The codes `POST /api/relays` refuses with.
32
33
  *
@@ -110,6 +111,6 @@ export declare function cancelRelayQuietly(client: ApiClient, relayId: string):
110
111
  * The relay is left open — withdrawing it would drop a reply that may well be
111
112
  * on its way — and the message is not resent, which could make it arrive twice.
112
113
  */
113
- export declare function printRelayUnconfirmedNotice(relayId: string, worktreeId?: string): void;
114
+ export declare function printRelayUnconfirmedNotice(relayId: string, worktreeId?: string, target?: CommandTarget): void;
114
115
  export declare function createRelaysCommand(): Command;
115
116
  //# sourceMappingURL=relays.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"relays.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/relays.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AASpC,OAAO,EAAE,SAAS,EAA+B,MAAM,qBAAqB,CAAC;AAgB7E;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,aAM9B,CAAC;AAEH,+CAA+C;AAC/C,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,4EAA4E;AAC5E,eAAO,MAAM,2BAA2B,QAEiD,CAAC;AAE1F,yDAAyD;AACzD,eAAO,MAAM,6BAA6B,QAER,CAAC;AAEnC;;;;;;;;;GASG;AACH,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,SAAS,EACjB,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,gBAAgB,CAAC,CAyB3B;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,0BAA0B,CAC9C,MAAM,EAAE,SAAS,EACjB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,cAAc,CAAC,EAAE,MAAM,GACtB,OAAO,CAAC,gBAAgB,CAAC,CA0B3B;AAED,wCAAwC;AACxC,MAAM,WAAW,kBAAkB;IACjC,+CAA+C;IAC/C,IAAI,EAAE,gBAAgB,CAAC;IACvB,+BAA+B;IAC/B,EAAE,EAAE,gBAAgB,CAAC;IACrB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,0DAA0D;AAC1D,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX;;;OAGG;IACH,KAAK,EAAE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E,SAAS,EACjB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,cAAc,CAAC,EAAE,MAAM,GACtB,OAAO,CAAC,gBAAgB,CAAC,CA0B3B;AAED,wCAAwC;AACxC,MAAM,WAAW,kBAAkB;IACjC,+CAA+C;IAC/C,IAAI,EAAE,gBAAgB,CAAC;IACvB,+BAA+B;IAC/B,EAAE,EAAE,gBAAgB,CAAC;IACrB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,0DAA0D;AAC1D,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX;;;OAGG;IACH,KAAK,EAAE,OAAO,CAAC;CAChB;AAED,yEAAyE;AACzE,eAAO,MAAM,mBAAmB,QAEkD,CAAC;AAEnF;;;;;;;;;;;;GAYG;AACH,wBAAsB,aAAa,CACjC,MAAM,EAAE,SAAS,EACjB,KAAK,EAAE,kBAAkB,GACxB,OAAO,CAAC,eAAe,CAAC,CAkB1B;AAED,+EAA+E;AAC/E,wBAAsB,kBAAkB,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAY1F;AAED;;;;;GAKG;AACH,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,aAAa,GAAG,IAAI,CAW9G;AAwCD,wBAAgB,mBAAmB,IAAI,OAAO,CAuJ7C"}
@@ -39,6 +39,7 @@ const types_1 = require("../types");
39
39
  const api_client_1 = require("../utils/api-client");
40
40
  const command_helpers_1 = require("../utils/command-helpers");
41
41
  const session_target_1 = require("../utils/session-target");
42
+ const follow_up_command_1 = require("../utils/follow-up-command");
42
43
  const instances_1 = require("./instances");
43
44
  const whoami_1 = require("./whoami");
44
45
  /** crypto.randomUUID() output; mirrors RELAY_ID_PATTERN in the API route. */
@@ -193,12 +194,12 @@ async function cancelRelayQuietly(client, relayId) {
193
194
  * The relay is left open — withdrawing it would drop a reply that may well be
194
195
  * on its way — and the message is not resent, which could make it arrive twice.
195
196
  */
196
- function printRelayUnconfirmedNotice(relayId, worktreeId) {
197
+ function printRelayUnconfirmedNotice(relayId, worktreeId, target) {
197
198
  // Issue #3992: a failed send names the pane to look at before any resend, in
198
- // the same line rather than a second notice.
199
+ // the same line rather than a second notice. Issue #3982: the target's pane.
199
200
  const resend = worktreeId === undefined
200
201
  ? ''
201
- : ` Do not resend before checking the pane (\`commandmate capture ${worktreeId} --pane\`), or it may arrive twice.`;
202
+ : ` Do not resend before checking the pane (\`${(0, follow_up_command_1.paneCaptureCommand)(worktreeId, target)}\`), or it may arrive twice.`;
202
203
  console.error(`Warning: whether the message reached the session is not known; relay ${relayId} was left open `
203
204
  + 'and the message was not resent. '
204
205
  + `Check it with \`commandmate relays --id ${relayId}\`.${resend}`);
@@ -1 +1 @@
1
- {"version":3,"file":"respond-strict.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/respond-strict.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAe/C,oEAAoE;AACpE,wBAAgB,eAAe,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAOhE;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,EAAE,OAAO,EAAE,cAAc,GAAG,MAAM,GAAG,IAAI,CA2B7G;AAED,8FAA8F;AAC9F,wBAAgB,kBAAkB,CAAC,GAAG,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAe,GAAG,MAAM,CAMhG;AA0CD,oEAAoE;AACpE,wBAAgB,cAAc,CAAC,cAAc,EAAE,OAAO,GAAG,OAAO,CAS/D;AAuED,kDAAkD;AAClD,wBAAsB,gBAAgB,CACpC,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,OAAO,EAAE,cAAc,GACtB,OAAO,CAAC,IAAI,CAAC,CAyCf"}
1
+ {"version":3,"file":"respond-strict.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/respond-strict.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAgB/C,oEAAoE;AACpE,wBAAgB,eAAe,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAOhE;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,EAAE,OAAO,EAAE,cAAc,GAAG,MAAM,GAAG,IAAI,CA2B7G;AAED,8FAA8F;AAC9F,wBAAgB,kBAAkB,CAAC,GAAG,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAe,GAAG,MAAM,CAMhG;AA0CD,oEAAoE;AACpE,wBAAgB,cAAc,CAAC,cAAc,EAAE,OAAO,GAAG,OAAO,CAS/D;AA+FD,kDAAkD;AAClD,wBAAsB,gBAAgB,CACpC,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,OAAO,EAAE,cAAc,GACtB,OAAO,CAAC,IAAI,CAAC,CA0Cf"}
@@ -25,6 +25,7 @@ const types_1 = require("../types");
25
25
  const api_client_1 = require("../utils/api-client");
26
26
  const kinds_1 = require("../../lib/prompt-observation/kinds");
27
27
  const command_target_1 = require("./command-target");
28
+ const follow_up_command_1 = require("../utils/follow-up-command");
28
29
  /** Mirrors the server's check. */
29
30
  const OPERATION_ID_PATTERN = /^[A-Za-z0-9_-]{8,64}$/;
30
31
  const ANSWERED_BY_PATTERN = /^[A-Za-z0-9_:/.@-]{1,160}$/;
@@ -143,7 +144,22 @@ function verdictOfApiError(error, options, operationId) {
143
144
  return localResult(options, operationId, 41, 'response_unknown', `The server's answer was lost (${error.message}); keys may have been sent. Do not answer again blindly: ` +
144
145
  `re-run with --operation-id ${operationId} to read the result of this one.`);
145
146
  }
146
- function printResult(result, options) {
147
+ /**
148
+ * The commands the strict respond's failure hints name (Issue #4031), aimed at
149
+ * the target the request resolved to (#3982's `followUpCommand`). A request
150
+ * that named no target keeps the hints as they were.
151
+ */
152
+ function strictRespondHints(worktreeId, target) {
153
+ if ((0, follow_up_command_1.targetFlags)(target) === '') {
154
+ return { prompt: '`commandmate prompt`', look: '`commandmate prompt` / `capture --pane`' };
155
+ }
156
+ // `prompt` takes `--instance` only; `capture` takes either flag.
157
+ const prompt = target.instanceId
158
+ ? `\`commandmate prompt ${worktreeId} --instance ${target.instanceId}\``
159
+ : `\`commandmate prompt ${worktreeId}\``;
160
+ return { prompt, look: `${prompt} / \`${(0, follow_up_command_1.paneCaptureCommand)(worktreeId, target)}\`` };
161
+ }
162
+ function printResult(result, options, worktreeId, commandTarget) {
147
163
  if (options.json) {
148
164
  console.log(JSON.stringify(result));
149
165
  return;
@@ -157,12 +173,12 @@ function printResult(result, options) {
157
173
  const target = result.observedTarget === null ? '' : ` Observed target: ${result.observedTarget}.`;
158
174
  if (result.code === types_1.StrictRespondExitCode.NOT_SENT) {
159
175
  console.error(`Error: Answer was not sent. Reason: ${result.reason} — ${result.message}${observed}${target}`);
160
- console.error('Observe the screen again with `commandmate prompt` before answering.');
176
+ console.error(`Observe the screen again with ${strictRespondHints(worktreeId, commandTarget).prompt} before answering.`);
161
177
  }
162
178
  else {
163
179
  console.error(`Error: Keys were sent (${result.keysSent}, delivery ${result.delivery}) and the answer is not confirmed. ` +
164
180
  `Reason: ${result.reason} — ${result.message}${observed}`);
165
- console.error('Do not send it again: look at the pane (`commandmate prompt` / `capture --pane`) first.');
181
+ console.error(`Do not send it again: look at the pane (${strictRespondHints(worktreeId, commandTarget).look}) first.`);
166
182
  }
167
183
  }
168
184
  /** Run the strict respond; sets the exit code. */
@@ -175,7 +191,8 @@ async function runStrictRespond(worktreeId, answer, options) {
175
191
  }
176
192
  const operationId = options.operationId ?? (0, crypto_1.randomUUID)();
177
193
  const client = new api_client_1.ApiClient({ token: options.token });
178
- const { agent, instanceId } = await (0, command_target_1.resolveCommandTarget)(client, worktreeId, options.instance, options.agent);
194
+ const commandTarget = await (0, command_target_1.resolveCommandTarget)(client, worktreeId, options.instance, options.agent);
195
+ const { agent, instanceId } = commandTarget;
179
196
  const body = {
180
197
  expectScreen: options.expectScreen,
181
198
  observation: options.observation,
@@ -208,7 +225,7 @@ async function runStrictRespond(worktreeId, answer, options) {
208
225
  // Not this endpoint's answer: whatever served it, nothing says what happened.
209
226
  result = localResult(options, operationId, 41, 'response_unknown', 'The server answered with something that is not a strict respond result.');
210
227
  }
211
- printResult(result, options);
228
+ printResult(result, options, worktreeId, commandTarget);
212
229
  if (result.code !== types_1.StrictRespondExitCode.SUCCESS)
213
230
  process.exit(result.code);
214
231
  }