commandmate 0.42.1 → 0.43.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (435) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-build-manifest.json +144 -144
  3. package/.next/app-path-routes-manifest.json +23 -23
  4. package/.next/build-manifest.json +2 -2
  5. package/.next/prerender-manifest.json +9 -9
  6. package/.next/required-server-files.json +1 -1
  7. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  8. package/.next/server/app/api/agents/update/route_client-reference-manifest.js +1 -1
  9. package/.next/server/app/api/agents/versions/route_client-reference-manifest.js +1 -1
  10. package/.next/server/app/api/app/release-notes/route_client-reference-manifest.js +1 -1
  11. package/.next/server/app/api/app/update/route_client-reference-manifest.js +1 -1
  12. package/.next/server/app/api/app/update-check/route.js +1 -1
  13. package/.next/server/app/api/app/update-check/route_client-reference-manifest.js +1 -1
  14. package/.next/server/app/api/auth/login/route_client-reference-manifest.js +1 -1
  15. package/.next/server/app/api/auth/logout/route_client-reference-manifest.js +1 -1
  16. package/.next/server/app/api/auth/status/route_client-reference-manifest.js +1 -1
  17. package/.next/server/app/api/capabilities/route.js +1 -1
  18. package/.next/server/app/api/capabilities/route_client-reference-manifest.js +1 -1
  19. package/.next/server/app/api/daily-summary/route.js +1 -1
  20. package/.next/server/app/api/daily-summary/route.js.nft.json +1 -1
  21. package/.next/server/app/api/daily-summary/route_client-reference-manifest.js +1 -1
  22. package/.next/server/app/api/daily-summary/status/route.js +1 -1
  23. package/.next/server/app/api/daily-summary/status/route.js.nft.json +1 -1
  24. package/.next/server/app/api/daily-summary/status/route_client-reference-manifest.js +1 -1
  25. package/.next/server/app/api/external-apps/[id]/health/route_client-reference-manifest.js +1 -1
  26. package/.next/server/app/api/external-apps/[id]/route_client-reference-manifest.js +1 -1
  27. package/.next/server/app/api/external-apps/route_client-reference-manifest.js +1 -1
  28. package/.next/server/app/api/fs/browse/route_client-reference-manifest.js +1 -1
  29. package/.next/server/app/api/fs/recent-paths/route_client-reference-manifest.js +1 -1
  30. package/.next/server/app/api/hooks/agent-event/route.js +103 -1
  31. package/.next/server/app/api/hooks/agent-event/route.js.nft.json +1 -1
  32. package/.next/server/app/api/hooks/agent-event/route_client-reference-manifest.js +1 -1
  33. package/.next/server/app/api/hooks/claude-done/route.js +2 -2
  34. package/.next/server/app/api/hooks/claude-done/route.js.nft.json +1 -1
  35. package/.next/server/app/api/hooks/claude-done/route_client-reference-manifest.js +1 -1
  36. package/.next/server/app/api/hooks/permission-request/route.js +1 -1
  37. package/.next/server/app/api/hooks/permission-request/route.js.nft.json +1 -1
  38. package/.next/server/app/api/hooks/permission-request/route_client-reference-manifest.js +1 -1
  39. package/.next/server/app/api/metrics/vibe/route_client-reference-manifest.js +1 -1
  40. package/.next/server/app/api/ollama/models/route_client-reference-manifest.js +1 -1
  41. package/.next/server/app/api/push/escalation/route_client-reference-manifest.js +1 -1
  42. package/.next/server/app/api/push/subscriptions/route_client-reference-manifest.js +1 -1
  43. package/.next/server/app/api/push/vapid/route_client-reference-manifest.js +1 -1
  44. package/.next/server/app/api/relays/[relayId]/cancel/route.js +1 -1
  45. package/.next/server/app/api/relays/[relayId]/cancel/route.js.nft.json +1 -1
  46. package/.next/server/app/api/relays/[relayId]/cancel/route_client-reference-manifest.js +1 -1
  47. package/.next/server/app/api/relays/route.js +1 -1
  48. package/.next/server/app/api/relays/route.js.nft.json +1 -1
  49. package/.next/server/app/api/relays/route_client-reference-manifest.js +1 -1
  50. package/.next/server/app/api/remote/pair/route_client-reference-manifest.js +1 -1
  51. package/.next/server/app/api/repositories/[id]/route_client-reference-manifest.js +1 -1
  52. package/.next/server/app/api/repositories/clone/[jobId]/route.js +1 -1
  53. package/.next/server/app/api/repositories/clone/[jobId]/route.js.nft.json +1 -1
  54. package/.next/server/app/api/repositories/clone/[jobId]/route_client-reference-manifest.js +1 -1
  55. package/.next/server/app/api/repositories/clone/route.js +1 -1
  56. package/.next/server/app/api/repositories/clone/route.js.nft.json +1 -1
  57. package/.next/server/app/api/repositories/clone/route_client-reference-manifest.js +1 -1
  58. package/.next/server/app/api/repositories/excluded/route_client-reference-manifest.js +1 -1
  59. package/.next/server/app/api/repositories/restore/route.js +1 -1
  60. package/.next/server/app/api/repositories/restore/route.js.nft.json +1 -1
  61. package/.next/server/app/api/repositories/restore/route_client-reference-manifest.js +1 -1
  62. package/.next/server/app/api/repositories/route.js +1 -1
  63. package/.next/server/app/api/repositories/route.js.nft.json +1 -1
  64. package/.next/server/app/api/repositories/route_client-reference-manifest.js +1 -1
  65. package/.next/server/app/api/repositories/scan/route.js +1 -1
  66. package/.next/server/app/api/repositories/scan/route.js.nft.json +1 -1
  67. package/.next/server/app/api/repositories/scan/route_client-reference-manifest.js +1 -1
  68. package/.next/server/app/api/repositories/sync/route.js +1 -1
  69. package/.next/server/app/api/repositories/sync/route.js.nft.json +1 -1
  70. package/.next/server/app/api/repositories/sync/route_client-reference-manifest.js +1 -1
  71. package/.next/server/app/api/repositories/validate-path/route_client-reference-manifest.js +1 -1
  72. package/.next/server/app/api/settings/default-agents/route.js +1 -1
  73. package/.next/server/app/api/settings/default-agents/route.js.nft.json +1 -1
  74. package/.next/server/app/api/settings/default-agents/route_client-reference-manifest.js +1 -1
  75. package/.next/server/app/api/settings/default-surface-mode/route_client-reference-manifest.js +1 -1
  76. package/.next/server/app/api/sidebar/group-order/route_client-reference-manifest.js +1 -1
  77. package/.next/server/app/api/skills/[id]/route.js +1 -1
  78. package/.next/server/app/api/skills/[id]/route_client-reference-manifest.js +1 -1
  79. package/.next/server/app/api/skills/installations/route_client-reference-manifest.js +1 -1
  80. package/.next/server/app/api/skills/operations/route_client-reference-manifest.js +1 -1
  81. package/.next/server/app/api/skills/reindex/route_client-reference-manifest.js +1 -1
  82. package/.next/server/app/api/skills/route.js +1 -1
  83. package/.next/server/app/api/skills/route_client-reference-manifest.js +1 -1
  84. package/.next/server/app/api/slash-commands/route.js +1 -1
  85. package/.next/server/app/api/slash-commands/route_client-reference-manifest.js +1 -1
  86. package/.next/server/app/api/tasks/[taskId]/cancel/route_client-reference-manifest.js +1 -1
  87. package/.next/server/app/api/tasks/[taskId]/route_client-reference-manifest.js +1 -1
  88. package/.next/server/app/api/templates/[id]/route_client-reference-manifest.js +1 -1
  89. package/.next/server/app/api/templates/route_client-reference-manifest.js +1 -1
  90. package/.next/server/app/api/verification/runs/[runId]/route_client-reference-manifest.js +1 -1
  91. package/.next/server/app/api/verification/runs/route_client-reference-manifest.js +1 -1
  92. package/.next/server/app/api/worktrees/[id]/auto-yes/route.js +1 -1
  93. package/.next/server/app/api/worktrees/[id]/auto-yes/route.js.nft.json +1 -1
  94. package/.next/server/app/api/worktrees/[id]/auto-yes/route_client-reference-manifest.js +1 -1
  95. package/.next/server/app/api/worktrees/[id]/capture/route.js +1 -1
  96. package/.next/server/app/api/worktrees/[id]/capture/route.js.nft.json +1 -1
  97. package/.next/server/app/api/worktrees/[id]/capture/route_client-reference-manifest.js +1 -1
  98. package/.next/server/app/api/worktrees/[id]/clear-composer/route.js +1 -1
  99. package/.next/server/app/api/worktrees/[id]/clear-composer/route.js.nft.json +1 -1
  100. package/.next/server/app/api/worktrees/[id]/clear-composer/route_client-reference-manifest.js +1 -1
  101. package/.next/server/app/api/worktrees/[id]/cli-reference/route_client-reference-manifest.js +1 -1
  102. package/.next/server/app/api/worktrees/[id]/cli-tool/route_client-reference-manifest.js +1 -1
  103. package/.next/server/app/api/worktrees/[id]/cmate/schedules/route.js +3 -1
  104. package/.next/server/app/api/worktrees/[id]/cmate/schedules/route.js.nft.json +1 -1
  105. package/.next/server/app/api/worktrees/[id]/cmate/schedules/route_client-reference-manifest.js +1 -1
  106. package/.next/server/app/api/worktrees/[id]/current-output/route.js +1 -1
  107. package/.next/server/app/api/worktrees/[id]/current-output/route.js.nft.json +1 -1
  108. package/.next/server/app/api/worktrees/[id]/current-output/route_client-reference-manifest.js +1 -1
  109. package/.next/server/app/api/worktrees/[id]/direct-input/route.js +1 -1
  110. package/.next/server/app/api/worktrees/[id]/direct-input/route.js.nft.json +1 -1
  111. package/.next/server/app/api/worktrees/[id]/direct-input/route_client-reference-manifest.js +1 -1
  112. package/.next/server/app/api/worktrees/[id]/env/route_client-reference-manifest.js +1 -1
  113. package/.next/server/app/api/worktrees/[id]/execution-logs/[logId]/route.js +1 -1
  114. package/.next/server/app/api/worktrees/[id]/execution-logs/[logId]/route_client-reference-manifest.js +1 -1
  115. package/.next/server/app/api/worktrees/[id]/execution-logs/route.js +3 -1
  116. package/.next/server/app/api/worktrees/[id]/execution-logs/route.js.nft.json +1 -1
  117. package/.next/server/app/api/worktrees/[id]/execution-logs/route_client-reference-manifest.js +1 -1
  118. package/.next/server/app/api/worktrees/[id]/files/[...path]/route_client-reference-manifest.js +1 -1
  119. package/.next/server/app/api/worktrees/[id]/git/branch/create/route_client-reference-manifest.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_client-reference-manifest.js +1 -1
  122. package/.next/server/app/api/worktrees/[id]/git/checkout/route_client-reference-manifest.js +1 -1
  123. package/.next/server/app/api/worktrees/[id]/git/commit/route_client-reference-manifest.js +1 -1
  124. package/.next/server/app/api/worktrees/[id]/git/diff/route_client-reference-manifest.js +1 -1
  125. package/.next/server/app/api/worktrees/[id]/git/fetch/route_client-reference-manifest.js +1 -1
  126. package/.next/server/app/api/worktrees/[id]/git/log/route_client-reference-manifest.js +1 -1
  127. package/.next/server/app/api/worktrees/[id]/git/pull/route_client-reference-manifest.js +1 -1
  128. package/.next/server/app/api/worktrees/[id]/git/push/route_client-reference-manifest.js +1 -1
  129. package/.next/server/app/api/worktrees/[id]/git/reset/route_client-reference-manifest.js +1 -1
  130. package/.next/server/app/api/worktrees/[id]/git/revert/route_client-reference-manifest.js +1 -1
  131. package/.next/server/app/api/worktrees/[id]/git/show/[commitHash]/route_client-reference-manifest.js +1 -1
  132. package/.next/server/app/api/worktrees/[id]/git/stage/route_client-reference-manifest.js +1 -1
  133. package/.next/server/app/api/worktrees/[id]/git/staged/route_client-reference-manifest.js +1 -1
  134. package/.next/server/app/api/worktrees/[id]/git/stash/[index]/route_client-reference-manifest.js +1 -1
  135. package/.next/server/app/api/worktrees/[id]/git/stash/apply/route_client-reference-manifest.js +1 -1
  136. package/.next/server/app/api/worktrees/[id]/git/stash/pop/route_client-reference-manifest.js +1 -1
  137. package/.next/server/app/api/worktrees/[id]/git/stash/push/route_client-reference-manifest.js +1 -1
  138. package/.next/server/app/api/worktrees/[id]/git/stash/route_client-reference-manifest.js +1 -1
  139. package/.next/server/app/api/worktrees/[id]/git/status/route_client-reference-manifest.js +1 -1
  140. package/.next/server/app/api/worktrees/[id]/git/unstage/route_client-reference-manifest.js +1 -1
  141. package/.next/server/app/api/worktrees/[id]/git/working-diff/route_client-reference-manifest.js +1 -1
  142. package/.next/server/app/api/worktrees/[id]/instances/notes/route_client-reference-manifest.js +1 -1
  143. package/.next/server/app/api/worktrees/[id]/instances/opencode/route.js +1 -1
  144. package/.next/server/app/api/worktrees/[id]/instances/opencode/route.js.nft.json +1 -1
  145. package/.next/server/app/api/worktrees/[id]/instances/opencode/route_client-reference-manifest.js +1 -1
  146. package/.next/server/app/api/worktrees/[id]/interrupt/route.js +1 -1
  147. package/.next/server/app/api/worktrees/[id]/interrupt/route.js.nft.json +1 -1
  148. package/.next/server/app/api/worktrees/[id]/interrupt/route_client-reference-manifest.js +1 -1
  149. package/.next/server/app/api/worktrees/[id]/kill-session/route.js +1 -1
  150. package/.next/server/app/api/worktrees/[id]/kill-session/route.js.nft.json +1 -1
  151. package/.next/server/app/api/worktrees/[id]/kill-session/route_client-reference-manifest.js +1 -1
  152. package/.next/server/app/api/worktrees/[id]/logs/[filename]/route_client-reference-manifest.js +1 -1
  153. package/.next/server/app/api/worktrees/[id]/logs/route_client-reference-manifest.js +1 -1
  154. package/.next/server/app/api/worktrees/[id]/marp-render/route_client-reference-manifest.js +1 -1
  155. package/.next/server/app/api/worktrees/[id]/memos/[memoId]/route_client-reference-manifest.js +1 -1
  156. package/.next/server/app/api/worktrees/[id]/memos/route_client-reference-manifest.js +1 -1
  157. package/.next/server/app/api/worktrees/[id]/messages/route_client-reference-manifest.js +1 -1
  158. package/.next/server/app/api/worktrees/[id]/opencode/diff/route_client-reference-manifest.js +1 -1
  159. package/.next/server/app/api/worktrees/[id]/opencode/session/route.js +1 -1
  160. package/.next/server/app/api/worktrees/[id]/opencode/session/route.js.nft.json +1 -1
  161. package/.next/server/app/api/worktrees/[id]/opencode/session/route_client-reference-manifest.js +1 -1
  162. package/.next/server/app/api/worktrees/[id]/opencode/share/route.js +1 -1
  163. package/.next/server/app/api/worktrees/[id]/opencode/share/route.js.nft.json +1 -1
  164. package/.next/server/app/api/worktrees/[id]/opencode/share/route_client-reference-manifest.js +1 -1
  165. package/.next/server/app/api/worktrees/[id]/prompt-response/route.js +1 -1
  166. package/.next/server/app/api/worktrees/[id]/prompt-response/route.js.nft.json +1 -1
  167. package/.next/server/app/api/worktrees/[id]/prompt-response/route_client-reference-manifest.js +1 -1
  168. package/.next/server/app/api/worktrees/[id]/resolve-target/route_client-reference-manifest.js +1 -1
  169. package/.next/server/app/api/worktrees/[id]/respond/route.js +1 -1
  170. package/.next/server/app/api/worktrees/[id]/respond/route.js.nft.json +1 -1
  171. package/.next/server/app/api/worktrees/[id]/respond/route_client-reference-manifest.js +1 -1
  172. package/.next/server/app/api/worktrees/[id]/route.js +1 -103
  173. package/.next/server/app/api/worktrees/[id]/route.js.nft.json +1 -1
  174. package/.next/server/app/api/worktrees/[id]/route_client-reference-manifest.js +1 -1
  175. package/.next/server/app/api/worktrees/[id]/schedules/[scheduleId]/route.js +3 -1
  176. package/.next/server/app/api/worktrees/[id]/schedules/[scheduleId]/route.js.nft.json +1 -1
  177. package/.next/server/app/api/worktrees/[id]/schedules/[scheduleId]/route_client-reference-manifest.js +1 -1
  178. package/.next/server/app/api/worktrees/[id]/schedules/active/route.js +3 -1
  179. package/.next/server/app/api/worktrees/[id]/schedules/active/route.js.nft.json +1 -1
  180. package/.next/server/app/api/worktrees/[id]/schedules/active/route_client-reference-manifest.js +1 -1
  181. package/.next/server/app/api/worktrees/[id]/schedules/route.js +3 -1
  182. package/.next/server/app/api/worktrees/[id]/schedules/route.js.nft.json +1 -1
  183. package/.next/server/app/api/worktrees/[id]/schedules/route_client-reference-manifest.js +1 -1
  184. package/.next/server/app/api/worktrees/[id]/search/route_client-reference-manifest.js +1 -1
  185. package/.next/server/app/api/worktrees/[id]/send/route.js +1 -103
  186. package/.next/server/app/api/worktrees/[id]/send/route.js.nft.json +1 -1
  187. package/.next/server/app/api/worktrees/[id]/send/route_client-reference-manifest.js +1 -1
  188. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route.js +104 -2
  189. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route.js.nft.json +1 -1
  190. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route_client-reference-manifest.js +1 -1
  191. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/install/route_client-reference-manifest.js +1 -1
  192. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/plan/route_client-reference-manifest.js +1 -1
  193. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall/route_client-reference-manifest.js +1 -1
  194. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall-plan/route_client-reference-manifest.js +1 -1
  195. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/update/route_client-reference-manifest.js +1 -1
  196. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/update-plan/route_client-reference-manifest.js +1 -1
  197. package/.next/server/app/api/worktrees/[id]/skills/route_client-reference-manifest.js +1 -1
  198. package/.next/server/app/api/worktrees/[id]/slash-commands/route.js +1 -1
  199. package/.next/server/app/api/worktrees/[id]/slash-commands/route.js.nft.json +1 -1
  200. package/.next/server/app/api/worktrees/[id]/slash-commands/route_client-reference-manifest.js +1 -1
  201. package/.next/server/app/api/worktrees/[id]/special-keys/route.js +1 -1
  202. package/.next/server/app/api/worktrees/[id]/special-keys/route.js.nft.json +1 -1
  203. package/.next/server/app/api/worktrees/[id]/special-keys/route_client-reference-manifest.js +1 -1
  204. package/.next/server/app/api/worktrees/[id]/tasks/route.js +1 -1
  205. package/.next/server/app/api/worktrees/[id]/tasks/route_client-reference-manifest.js +1 -1
  206. package/.next/server/app/api/worktrees/[id]/terminal/route.js +1 -1
  207. package/.next/server/app/api/worktrees/[id]/terminal/route.js.nft.json +1 -1
  208. package/.next/server/app/api/worktrees/[id]/terminal/route_client-reference-manifest.js +1 -1
  209. package/.next/server/app/api/worktrees/[id]/timers/history/route_client-reference-manifest.js +1 -1
  210. package/.next/server/app/api/worktrees/[id]/timers/route.js +1 -1
  211. package/.next/server/app/api/worktrees/[id]/timers/route.js.nft.json +1 -1
  212. package/.next/server/app/api/worktrees/[id]/timers/route_client-reference-manifest.js +1 -1
  213. package/.next/server/app/api/worktrees/[id]/todos/[todoId]/route_client-reference-manifest.js +1 -1
  214. package/.next/server/app/api/worktrees/[id]/todos/route_client-reference-manifest.js +1 -1
  215. package/.next/server/app/api/worktrees/[id]/tree/[...path]/route_client-reference-manifest.js +1 -1
  216. package/.next/server/app/api/worktrees/[id]/tree/route_client-reference-manifest.js +1 -1
  217. package/.next/server/app/api/worktrees/[id]/upload/[...path]/route_client-reference-manifest.js +1 -1
  218. package/.next/server/app/api/worktrees/[id]/verify/config/route.js +1 -1
  219. package/.next/server/app/api/worktrees/[id]/verify/config/route_client-reference-manifest.js +1 -1
  220. package/.next/server/app/api/worktrees/[id]/verify/route.js +1 -1
  221. package/.next/server/app/api/worktrees/[id]/verify/route_client-reference-manifest.js +1 -1
  222. package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/cancel/route.js +1 -1
  223. package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/cancel/route_client-reference-manifest.js +1 -1
  224. package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/route_client-reference-manifest.js +1 -1
  225. package/.next/server/app/api/worktrees/[id]/verify/runs/route_client-reference-manifest.js +1 -1
  226. package/.next/server/app/api/worktrees/[id]/viewed/route_client-reference-manifest.js +1 -1
  227. package/.next/server/app/api/worktrees/apply-default-agents/route_client-reference-manifest.js +1 -1
  228. package/.next/server/app/api/worktrees/route.js +1 -1
  229. package/.next/server/app/api/worktrees/route.js.nft.json +1 -1
  230. package/.next/server/app/api/worktrees/route_client-reference-manifest.js +1 -1
  231. package/.next/server/app/login/page_client-reference-manifest.js +1 -1
  232. package/.next/server/app/manifest.webmanifest/route_client-reference-manifest.js +1 -1
  233. package/.next/server/app/more/page_client-reference-manifest.js +1 -1
  234. package/.next/server/app/offline/page_client-reference-manifest.js +1 -1
  235. package/.next/server/app/page_client-reference-manifest.js +1 -1
  236. package/.next/server/app/proxy/[...path]/route_client-reference-manifest.js +1 -1
  237. package/.next/server/app/repositories/page_client-reference-manifest.js +1 -1
  238. package/.next/server/app/review/page_client-reference-manifest.js +1 -1
  239. package/.next/server/app/sessions/page_client-reference-manifest.js +1 -1
  240. package/.next/server/app/skills/[skillId]/page_client-reference-manifest.js +1 -1
  241. package/.next/server/app/skills/installed/page_client-reference-manifest.js +1 -1
  242. package/.next/server/app/skills/page_client-reference-manifest.js +1 -1
  243. package/.next/server/app/worktrees/[id]/files/[...path]/page_client-reference-manifest.js +1 -1
  244. package/.next/server/app/worktrees/[id]/page.js +9 -9
  245. package/.next/server/app/worktrees/[id]/page_client-reference-manifest.js +1 -1
  246. package/.next/server/app/worktrees/[id]/terminal/page_client-reference-manifest.js +1 -1
  247. package/.next/server/app-paths-manifest.json +23 -23
  248. package/.next/server/chunks/1068.js +1 -1
  249. package/.next/server/chunks/1210.js +1 -1
  250. package/.next/server/chunks/1501.js +4 -4
  251. package/.next/server/chunks/1990.js +1 -1
  252. package/.next/server/chunks/2119.js +1 -1
  253. package/.next/server/chunks/22.js +1 -1
  254. package/.next/server/chunks/2328.js +1 -1
  255. package/.next/server/chunks/2404.js +4 -3
  256. package/.next/server/chunks/2445.js +1 -1
  257. package/.next/server/chunks/252.js +1 -1
  258. package/.next/server/chunks/2816.js +1 -1
  259. package/.next/server/chunks/3543.js +1 -1
  260. package/.next/server/chunks/3730.js +1 -1
  261. package/.next/server/chunks/3945.js +1 -1
  262. package/.next/server/chunks/4207.js +3 -3
  263. package/.next/server/chunks/434.js +1 -1
  264. package/.next/server/chunks/5064.js +1 -1
  265. package/.next/server/chunks/5571.js +1 -1
  266. package/.next/server/chunks/5742.js +1 -1
  267. package/.next/server/chunks/5775.js +1 -1
  268. package/.next/server/chunks/611.js +1 -1
  269. package/.next/server/chunks/6130.js +1 -1
  270. package/.next/server/chunks/6285.js +1 -1
  271. package/.next/server/chunks/6491.js +103 -0
  272. package/.next/server/chunks/6661.js +1 -1
  273. package/.next/server/chunks/6781.js +1 -1
  274. package/.next/server/chunks/6793.js +1 -1
  275. package/.next/server/chunks/7491.js +3 -0
  276. package/.next/server/chunks/7685.js +1 -1
  277. package/.next/server/chunks/7905.js +1 -1
  278. package/.next/server/chunks/8581.js +2 -2
  279. package/.next/server/chunks/8583.js +1 -1
  280. package/.next/server/chunks/8673.js +6 -6
  281. package/.next/server/chunks/8728.js +2 -2
  282. package/.next/server/chunks/8791.js +1 -1
  283. package/.next/server/chunks/8800.js +4 -3
  284. package/.next/server/chunks/8918.js +5 -5
  285. package/.next/server/chunks/9130.js +3 -3
  286. package/.next/server/chunks/{8052.js → 9353.js} +4 -2
  287. package/.next/server/chunks/9390.js +3 -0
  288. package/.next/server/chunks/9627.js +4 -4
  289. package/.next/server/chunks/964.js +1 -1
  290. package/.next/server/chunks/967.js +1 -0
  291. package/.next/server/chunks/9731.js +3 -3
  292. package/.next/server/chunks/9882.js +3 -3
  293. package/.next/server/middleware-manifest.json +5 -5
  294. package/.next/server/pages/500.html +1 -1
  295. package/.next/server/server-reference-manifest.json +1 -1
  296. package/.next/static/chunks/{1642-fb2e176aaadbd137.js → 1642-767aed8e7c61ef7f.js} +1 -1
  297. package/.next/static/chunks/{2407-21fbf12d753b8d4d.js → 2407-940df9b11fadafc6.js} +1 -1
  298. package/.next/static/chunks/{2619-04bc32f026a0d946.js → 2619-a305ad4810f1393a.js} +1 -1
  299. package/.next/static/chunks/5449-6cb80bab2bd06b79.js +1 -0
  300. package/.next/static/chunks/7705-1f58d4c03d991fcf.js +1 -0
  301. package/.next/static/chunks/8165-3525fb42f1b4976e.js +1 -0
  302. package/.next/static/chunks/app/{layout-8ff4c7c08ef1f621.js → layout-057c850cd0df978e.js} +1 -1
  303. package/.next/static/chunks/app/review/page-ff9efae3f86eb840.js +1 -0
  304. package/.next/static/chunks/app/skills/[skillId]/page-74aac15286504ef4.js +1 -0
  305. package/.next/static/chunks/app/skills/page-182e16168b2fc098.js +1 -0
  306. package/.next/static/chunks/app/worktrees/[id]/page-eab0bf7564d3f9e2.js +1 -0
  307. package/.next/static/chunks/app/worktrees/[id]/terminal/{page-373ea37b16d930c7.js → page-c601f3b3ece6557e.js} +1 -1
  308. package/.next/trace +13 -13
  309. package/README.md +3 -3
  310. package/dist/cli/commands/ask.d.ts.map +1 -1
  311. package/dist/cli/commands/ask.js +23 -149
  312. package/dist/cli/commands/reply.d.ts +40 -0
  313. package/dist/cli/commands/reply.d.ts.map +1 -0
  314. package/dist/cli/commands/reply.js +133 -0
  315. package/dist/cli/commands/verify.d.ts.map +1 -1
  316. package/dist/cli/commands/verify.js +9 -0
  317. package/dist/cli/commands/wait.d.ts +5 -0
  318. package/dist/cli/commands/wait.d.ts.map +1 -1
  319. package/dist/cli/commands/wait.js +10 -1
  320. package/dist/cli/docs/agent-operations.d.ts +2 -2
  321. package/dist/cli/docs/agent-operations.d.ts.map +1 -1
  322. package/dist/cli/docs/agent-operations.js +13 -0
  323. package/dist/cli/program.d.ts.map +1 -1
  324. package/dist/cli/program.js +4 -0
  325. package/dist/cli/types/index.d.ts +2 -0
  326. package/dist/cli/types/index.d.ts.map +1 -1
  327. package/dist/cli/utils/reply-ledger.d.ts +95 -0
  328. package/dist/cli/utils/reply-ledger.d.ts.map +1 -0
  329. package/dist/cli/utils/reply-ledger.js +187 -0
  330. package/dist/lib/cli-tools/copilot-executable.d.ts +9 -0
  331. package/dist/lib/cli-tools/copilot-executable.d.ts.map +1 -1
  332. package/dist/lib/cli-tools/copilot-executable.js +21 -5
  333. package/dist/lib/cli-tools/opencode-executable.d.ts +103 -0
  334. package/dist/lib/cli-tools/opencode-executable.d.ts.map +1 -0
  335. package/dist/lib/cli-tools/opencode-executable.js +179 -0
  336. package/dist/lib/cli-tools/types.d.ts +1 -1
  337. package/dist/lib/cli-tools/types.d.ts.map +1 -1
  338. package/dist/lib/cli-tools/types.js +5 -1
  339. package/dist/lib/detection/tools/verified-against.d.ts +15 -0
  340. package/dist/lib/detection/tools/verified-against.d.ts.map +1 -1
  341. package/dist/lib/detection/tools/verified-against.js +17 -1
  342. package/dist/lib/detection/version-probes.d.ts.map +1 -1
  343. package/dist/lib/detection/version-probes.js +14 -1
  344. package/dist/lib/session/tmux-session-surface.d.ts.map +1 -1
  345. package/dist/lib/session/tmux-session-surface.js +1 -1
  346. package/dist/server/locales/en/worktree.json +44 -14
  347. package/dist/server/locales/ja/worktree.json +44 -14
  348. package/dist/server/server.js +23 -0
  349. package/dist/server/src/config/cli-tool-timing-config.js +19 -1
  350. package/dist/server/src/config/detection-evidence-config.js +3 -0
  351. package/dist/server/src/config/schedule-config.js +55 -1
  352. package/dist/server/src/lib/auto-yes-poller.js +47 -4
  353. package/dist/server/src/lib/cli-tools/agent-mode-spec.js +54 -2
  354. package/dist/server/src/lib/cli-tools/base.js +6 -2
  355. package/dist/server/src/lib/cli-tools/command-code.js +55 -1
  356. package/dist/server/src/lib/cli-tools/composer-spec.js +10 -0
  357. package/dist/server/src/lib/cli-tools/copilot-executable.js +21 -5
  358. package/dist/server/src/lib/cli-tools/graceful-exit.js +15 -1
  359. package/dist/server/src/lib/cli-tools/index.js +3 -1
  360. package/dist/server/src/lib/cli-tools/install-hints.js +9 -3
  361. package/dist/server/src/lib/cli-tools/liveness-spec.js +19 -0
  362. package/dist/server/src/lib/cli-tools/manager.js +2 -0
  363. package/dist/server/src/lib/cli-tools/opencode-executable.js +179 -0
  364. package/dist/server/src/lib/cli-tools/opencode-v2.js +369 -0
  365. package/dist/server/src/lib/cli-tools/opencode.js +29 -5
  366. package/dist/server/src/lib/cli-tools/types.js +5 -1
  367. package/dist/server/src/lib/cmate-cli-tool-parser.js +65 -7
  368. package/dist/server/src/lib/cmate-parser.js +12 -0
  369. package/dist/server/src/lib/cmate-validator.js +13 -1
  370. package/dist/server/src/lib/db/worktree-db.js +1 -1
  371. package/dist/server/src/lib/detection/cli-patterns.js +78 -2
  372. package/dist/server/src/lib/detection/model-info-extractor.js +79 -7
  373. package/dist/server/src/lib/detection/status-detector.js +10 -1
  374. package/dist/server/src/lib/detection/tools/codex/cli-patterns.js +2 -1
  375. package/dist/server/src/lib/detection/tools/opencode-v2/detect.js +253 -0
  376. package/dist/server/src/lib/detection/tools/opencode-v2/dialog-title.js +48 -0
  377. package/dist/server/src/lib/detection/tools/registry.js +2 -0
  378. package/dist/server/src/lib/detection/tools/run-detection.js +9 -0
  379. package/dist/server/src/lib/detection/tools/verified-against.js +17 -1
  380. package/dist/server/src/lib/detection/upstream-faults.js +8 -0
  381. package/dist/server/src/lib/detection/version-probes.js +14 -1
  382. package/dist/server/src/lib/hooks/agent-session-telemetry.js +36 -1
  383. package/dist/server/src/lib/hooks/sources/opencode/log-diagnosis.js +105 -0
  384. package/dist/server/src/lib/hooks/sources/opencode/source.js +7 -1
  385. package/dist/server/src/lib/hooks/sources/opencode-v2/client.js +422 -0
  386. package/dist/server/src/lib/hooks/sources/opencode-v2/decision-labels.js +24 -0
  387. package/dist/server/src/lib/hooks/sources/opencode-v2/history.js +421 -0
  388. package/dist/server/src/lib/hooks/sources/opencode-v2/ingest.js +271 -0
  389. package/dist/server/src/lib/hooks/sources/opencode-v2/mappers.js +165 -0
  390. package/dist/server/src/lib/hooks/sources/opencode-v2/payloads.js +351 -0
  391. package/dist/server/src/lib/hooks/sources/opencode-v2/ports.js +230 -0
  392. package/dist/server/src/lib/hooks/sources/opencode-v2/reattach.js +149 -0
  393. package/dist/server/src/lib/hooks/sources/opencode-v2/runtime.js +180 -0
  394. package/dist/server/src/lib/hooks/sources/opencode-v2/secrets.js +182 -0
  395. package/dist/server/src/lib/hooks/sources/opencode-v2/source.js +295 -0
  396. package/dist/server/src/lib/hooks/sources/opencode-v2/subscription.js +455 -0
  397. package/dist/server/src/lib/hooks/sources/opencode-v2/tool-id.js +18 -0
  398. package/dist/server/src/lib/hooks/sources/opencode-v2/usage.js +214 -0
  399. package/dist/server/src/lib/hooks/sources/registry.js +2 -0
  400. package/dist/server/src/lib/hooks/structured-decision-response.js +14 -5
  401. package/dist/server/src/lib/job-executor.js +2 -1
  402. package/dist/server/src/lib/polling/auto-yes-dialog-gate.js +15 -1
  403. package/dist/server/src/lib/polling/structured-history-gate.js +19 -5
  404. package/dist/server/src/lib/relay/relay-delivery.js +4 -1
  405. package/dist/server/src/lib/session/agent-event-state.js +24 -0
  406. package/dist/server/src/lib/session/claude-executor.js +184 -10
  407. package/dist/server/src/lib/session/current-output-builder.js +27 -3
  408. package/dist/server/src/lib/session/send-user-message.js +4 -0
  409. package/dist/server/src/lib/session/structured-prompt.js +54 -0
  410. package/dist/server/src/lib/session/tmux-session-surface.js +1 -1
  411. package/dist/server/src/lib/skills/compatibility-matrix.js +65 -0
  412. package/dist/server/src/lib/tmux/tmux.js +48 -2
  413. package/dist/server/src/lib/verification/env-clean-gate.js +228 -9
  414. package/dist/server/src/lib/verification/env-snapshot.js +65 -1
  415. package/dist/server/src/types/cli-tool-contracts.js +10 -2
  416. package/dist/types/cli-tool-contracts.d.ts +16 -5
  417. package/dist/types/cli-tool-contracts.d.ts.map +1 -1
  418. package/dist/types/cli-tool-contracts.js +10 -2
  419. package/package.json +2 -1
  420. package/release-notes/0.42.2.json +20 -0
  421. package/release-notes/0.43.0.json +130 -0
  422. package/scripts/hooks/cmate-agent-event.sh +14 -0
  423. package/scripts/opencode-v2/launch.sh +226 -0
  424. package/.next/server/chunks/4443.js +0 -3
  425. package/.next/server/chunks/5164.js +0 -1
  426. package/.next/server/chunks/650.js +0 -1
  427. package/.next/static/chunks/5449-550bd273dccc3ae4.js +0 -1
  428. package/.next/static/chunks/7705-2a2936551b0cf9a3.js +0 -1
  429. package/.next/static/chunks/8165-934ee7ff3b4ddfd4.js +0 -1
  430. package/.next/static/chunks/app/review/page-30616daa1dc595c2.js +0 -1
  431. package/.next/static/chunks/app/skills/[skillId]/page-ab7e432b69fccb3b.js +0 -1
  432. package/.next/static/chunks/app/skills/page-56b4fa11223e0cbd.js +0 -1
  433. package/.next/static/chunks/app/worktrees/[id]/page-3c946bd2875391fd.js +0 -1
  434. /package/.next/static/{3M_S0B7dhEDdVE2XSJz1Y → BVkBYdceLRvMROqQIqeBx}/_buildManifest.js +0 -0
  435. /package/.next/static/{3M_S0B7dhEDdVE2XSJz1Y → BVkBYdceLRvMROqQIqeBx}/_ssgManifest.js +0 -0
@@ -41,6 +41,7 @@ const source_4 = require("./antigravity/source");
41
41
  const source_5 = require("./codex/source");
42
42
  const source_6 = require("./opencode/source");
43
43
  const source_7 = require("./command-code/source");
44
+ const source_8 = require("./opencode-v2/source");
44
45
  const registered = (globalThis.__agentEventSources ??= new Map());
45
46
  /** Memoised compatibility sources, so repeated lookups return one object. */
46
47
  const legacy = (globalThis.__agentEventLegacySources ??= new Map());
@@ -113,3 +114,4 @@ registerAgentEventSource(source_6.opencodeAgentEventSource);
113
114
  // Issue #2251, Epic #2249 Phase B. The seventh, and the last line of "adding a
114
115
  // tool" — its own directory plus this.
115
116
  registerAgentEventSource(source_7.commandCodeAgentEventSource);
117
+ registerAgentEventSource(source_8.opencodeV2AgentEventSource);
@@ -157,13 +157,22 @@ function verdictFor(optionNumber) {
157
157
  /**
158
158
  * Resolve an answer against the option list.
159
159
  *
160
+ * Issue #2951: with `cliToolId`, the labels matched are the tool's own
161
+ * (`structuredDecisionOptionsFor`) — OpenCode V2's `Always allow` — and the
162
+ * option returned carries that label. The shared spelling (`Allow always`) is
163
+ * still accepted there as an alias of the same number, so nothing that
164
+ * resolved before stops resolving.
165
+ *
166
+ * @param answer - An option number, a label, a `reply` word or an alias
167
+ * @param cliToolId - The tool the approval belongs to; omitted = the shared list
160
168
  * @returns The option, or null when nothing matched
161
169
  */
162
- function resolveStructuredDecisionOption(answer) {
170
+ function resolveStructuredDecisionOption(answer, cliToolId) {
163
171
  const normalized = answer.trim().toLowerCase();
164
172
  if (normalized === '')
165
173
  return null;
166
- for (const option of structured_prompt_1.STRUCTURED_DECISION_OPTIONS) {
174
+ const options = cliToolId === undefined ? structured_prompt_1.STRUCTURED_DECISION_OPTIONS : (0, structured_prompt_1.structuredDecisionOptionsFor)(cliToolId);
175
+ for (const option of options) {
167
176
  if (normalized === String(option.number))
168
177
  return option;
169
178
  if (normalized === option.label.toLowerCase())
@@ -407,16 +416,16 @@ async function answerStructuredDecision({ worktreeId, cliToolId, instanceId, ans
407
416
  kind: 'refused',
408
417
  reason: 'unresolvable_answer',
409
418
  message: '--default cannot answer a structured approval: the agent publishes no default verdict. ' +
410
- `Send a number instead — ${structured_prompt_1.STRUCTURED_DECISION_OPTIONS.map((option) => `${option.number} = ${option.label}`).join(', ')}.`,
419
+ `Send a number instead — ${(0, structured_prompt_1.structuredDecisionOptionsFor)(cliToolId).map((option) => `${option.number} = ${option.label}`).join(', ')}.`,
411
420
  };
412
421
  }
413
- const option = answer === undefined ? null : resolveStructuredDecisionOption(answer);
422
+ const option = answer === undefined ? null : resolveStructuredDecisionOption(answer, cliToolId);
414
423
  if (!option) {
415
424
  return {
416
425
  kind: 'refused',
417
426
  reason: 'answer_out_of_range',
418
427
  message: `'${answer ?? ''}' is not one of the verdicts this approval accepts. ` +
419
- structured_prompt_1.STRUCTURED_DECISION_OPTIONS.map((each) => `${each.number} = ${each.label} (${each.reply})`).join(', ') +
428
+ (0, structured_prompt_1.structuredDecisionOptionsFor)(cliToolId).map((each) => `${each.number} = ${each.label} (${each.reply})`).join(', ') +
420
429
  '.',
421
430
  };
422
431
  }
@@ -116,7 +116,8 @@ function recoverRunningLogs() {
116
116
  * - **the CMATE.md CLI Tool column**, read by
117
117
  * {@link resolveScheduleCommandOptions} — `--model` for every tool in
118
118
  * `TOOLS_WITH_MODEL_SUPPORT`, plus opencode's `--agent` / `--variant` /
119
- * `--continue` / `--title` for the ids in `TOOLS_WITH_RUN_OPTIONS`;
119
+ * `--continue` / `--title` for the ids in `TOOLS_WITH_RUN_OPTIONS`
120
+ * (opencode and, since Issue #2982, opencode-v2);
120
121
  * - **the DB** (`worktree.vibe_local_model`), for vibe-local, whose model is
121
122
  * chosen in the worktree's Agent settings rather than written in the file.
122
123
  *
@@ -71,7 +71,7 @@ exports.AUTO_YES_DIALOG_GATE_MODES = ['enforce', 'legacy'];
71
71
  /**
72
72
  * The rollout state each tool ships in.
73
73
  *
74
- * `enforce` is set only for the four tools with a dialog rule measured from
74
+ * `enforce` is set only for the five tools with a dialog rule measured from
75
75
  * their own live captures, each with a positive fixture and a mutation fixture
76
76
  * (`tests/unit/detection/tools/dialogs.test.ts`):
77
77
  *
@@ -81,6 +81,7 @@ exports.AUTO_YES_DIALOG_GATE_MODES = ['enforce', 'legacy'];
81
81
  * | codex | `Press enter to confirm …` under the options, above the status bar, not stale | #1628 / #1160 |
82
82
  * | copilot | the bottom status bar is GONE and the option run carries a picker footer | #1885 / #1895 |
83
83
  * | opencode | the `Allow once / Allow always / Reject` strip, or a picker header | #1893 / #1896 |
84
+ * | opencode-v2 | the `Allow once / Always allow / Reject` strip, the question form's key hints, or a dialog title row | #2984 |
84
85
  *
85
86
  * The rest are `legacy` because nobody has measured them:
86
87
  *
@@ -125,6 +126,19 @@ exports.AUTO_YES_DIALOG_GATE_DEFAULT_MODE = {
125
126
  // Promote only once both dialogs are recognised on both spellings, with a
126
127
  // `/prompt-response` test pinning that the question is still answered.
127
128
  'command-code': 'legacy',
129
+ // Issue #2984: enforced. The screen path DOES run for OpenCode V2 — nothing
130
+ // in `startAutoYesPolling` / `pollAutoYes` (`auto-yes-poller.ts`) excludes a
131
+ // tool, and `buildDetectPromptOptions` gives v2 the default options
132
+ // (`cli-patterns.ts`), so any `❯ 1.`-shaped rows in the last 50 read as
133
+ // `multiple_choice`. Measured on 2.0.18 (`tests/fixtures/opencode-v2-dialogs-2984/`):
134
+ // a reply that quotes a Claude dialog (`❯ 1. Yes / 2. No`) is exactly such a
135
+ // candidate, and under `legacy` Auto-Yes would have typed `1` + Enter into
136
+ // the composer — #1896 again. v2's own dialogs never are: the approval strip
137
+ // and the question form draw no `❯`, so the generic parser finds nothing on
138
+ // them, and they are answered over the API (#2945 / #2951,
139
+ // `sources/opencode-v2/ingest`) as before. Enforcing therefore takes nothing
140
+ // away from Auto-Yes and refuses the quoted list.
141
+ 'opencode-v2': 'enforce',
128
142
  };
129
143
  /**
130
144
  * The kill switch (§13.1 DR3-016).
@@ -72,6 +72,7 @@ exports.captureStructuredHistoryTurn = captureStructuredHistoryTurn;
72
72
  exports.hasStructuredHistoryTranscript = hasStructuredHistoryTranscript;
73
73
  const logger_1 = require("../../lib/logger");
74
74
  const subscription_1 = require("../../lib/hooks/sources/opencode/subscription");
75
+ const subscription_2 = require("../../lib/hooks/sources/opencode-v2/subscription");
75
76
  const history_1 = require("../../lib/hooks/sources/claude/history");
76
77
  const history_2 = require("../../lib/hooks/sources/codex/history");
77
78
  const history_3 = require("../../lib/hooks/sources/antigravity/history");
@@ -239,11 +240,24 @@ function transcriptHistoryModeOf(cliToolId) {
239
240
  function isPullTranscriptHistory(cliToolId) {
240
241
  return transcriptHistoryModeOf(cliToolId) === 'pull';
241
242
  }
243
+ /**
244
+ * The push-mode writers' liveness probes, by tool (Issue #2940).
245
+ *
246
+ * The counterpart of {@link PULL_TRANSCRIPT_READERS}: a push source declares
247
+ * `transcriptHistory: 'push'` in its own `source.ts` and adds its probe here.
248
+ * A push source with no row of its own is asked opencode's probe, which is
249
+ * what every push declaration was asked before this table existed — the
250
+ * branch follows the declaration, not the tool name (#2197).
251
+ */
252
+ const PUSH_TRANSCRIPT_WRITERS = {
253
+ opencode: (target) => (0, subscription_1.isOpencodeStructuredHistoryLive)(target),
254
+ 'opencode-v2': (target) => (0, subscription_2.isOpencodeV2StructuredHistoryLive)(target),
255
+ };
242
256
  /**
243
257
  * Whether the agent's own server is recording this instance's replies.
244
258
  *
245
259
  * False for every tool whose source does not declare `transcriptHistory: 'push'`
246
- * — today that is all of them but opencode — and false for an opencode instance
260
+ * — today that is all of them but opencode and opencode-v2 — and false for an instance
247
261
  * whose subscription is anything other than `live`; see
248
262
  * {@link isOpencodeStructuredHistoryLive} for why `lost` counts as "nobody is
249
263
  * writing this down" rather than as "somebody will". The fallback direction is
@@ -259,10 +273,10 @@ function isStructuredHistoryWriterLive(worktreeId, cliToolId, instanceId) {
259
273
  if (transcriptHistoryModeOf(cliToolId) !== 'push')
260
274
  return false;
261
275
  try {
262
- // One probe, because there is one push source. A second one adds a table
263
- // here of the shape `PULL_TRANSCRIPT_READERS` already has; it does not add
264
- // another `cliToolId ===`.
265
- return (0, subscription_1.isOpencodeStructuredHistoryLive)({
276
+ // Issue #2940 added the second push source, and with it the table the
277
+ // single probe used to stand in for.
278
+ const probe = PUSH_TRANSCRIPT_WRITERS[cliToolId] ?? subscription_1.isOpencodeStructuredHistoryLive;
279
+ return probe({
266
280
  worktreeId,
267
281
  cliToolId,
268
282
  instanceId: instanceId ?? cliToolId,
@@ -103,7 +103,7 @@ const SYSTEM_ROW_REQUEST_ID_PREFIXES = [
103
103
  /**
104
104
  * Whether this tool's reply is read out of a transcript rather than off a screen.
105
105
  *
106
- * For the five that answer `true` the ledger is authoritative: a row with no
106
+ * For the six that answer `true` the ledger is authoritative: a row with no
107
107
  * turn marker was written by the SCRAPER, and for these tools a scraped row is
108
108
  * never the answer — it is a footer line, a half-drawn frame or the ANSI dump
109
109
  * the send path flushes (Issues #2398 / #2400). The relay may therefore hold
@@ -130,6 +130,9 @@ const TRANSCRIPT_READER_TOOLS = {
130
130
  copilot: false,
131
131
  gemini: false,
132
132
  'vibe-local': false,
133
+ // Issue #2940: OpenCode V2's replies are written from its server
134
+ // (`GET /api/session/{id}/message`) under `oc-turn:`, like opencode's.
135
+ 'opencode-v2': true,
133
136
  };
134
137
  /**
135
138
  * How long the scrape path holds out for the transcript row.
@@ -56,6 +56,7 @@ exports.getAwaitingInstruction = getAwaitingInstruction;
56
56
  exports.isAwaitingInstruction = isAwaitingInstruction;
57
57
  exports.getLastAgentEvent = getLastAgentEvent;
58
58
  exports.getLastKnownAgentModel = getLastKnownAgentModel;
59
+ exports.recordAgentReportedModel = recordAgentReportedModel;
59
60
  exports.recordCapturedModelInfo = recordCapturedModelInfo;
60
61
  exports.getLastCapturedModelInfo = getLastCapturedModelInfo;
61
62
  exports.getResolvedAgentModelInfo = getResolvedAgentModelInfo;
@@ -1348,6 +1349,29 @@ function getLastAgentEvent(worktreeId, cliToolId, instanceId) {
1348
1349
  function getLastKnownAgentModel(worktreeId, cliToolId, instanceId) {
1349
1350
  return lastAgentModel.get((0, auto_yes_state_1.buildCompositeKey)(worktreeId, cliToolId, instanceId)) ?? null;
1350
1351
  }
1352
+ /**
1353
+ * Latch the model the agent named for itself outside an agent event
1354
+ * (Issue #2964).
1355
+ *
1356
+ * The hook channel's latch — the one {@link recordAgentEvent} writes from
1357
+ * `record.model` — for a source whose model arrives on something that is not
1358
+ * one of the seven event words. OpenCode V2 is that source: its `session.*`
1359
+ * frames carry no model, and the model it actually answered with is read off
1360
+ * the assistant messages of `GET /api/session/{id}/message` after the turn.
1361
+ *
1362
+ * Latch, never clear ({@link latchAgentModel}'s rule), and judged for a change
1363
+ * exactly as a hook-borne model is, so #2357's broadcast and push fire for it.
1364
+ *
1365
+ * @param model - The model name, or null/empty to leave the latch alone
1366
+ */
1367
+ function recordAgentReportedModel(worktreeId, cliToolId, instanceId, model, at = Date.now()) {
1368
+ if (typeof model !== 'string' || model === '')
1369
+ return;
1370
+ const key = (0, auto_yes_state_1.buildCompositeKey)(worktreeId, cliToolId, instanceId);
1371
+ lastAgentModel.set(key, model.slice(0, agent_event_types_1.MAX_EVENT_DETAIL_LENGTH));
1372
+ lastAgentModelAt.set(key, at);
1373
+ observeAgentModel(worktreeId, cliToolId, instanceId, 'hook', at);
1374
+ }
1351
1375
  /**
1352
1376
  * Latch what a terminal capture showed for this instance (Issue #1784).
1353
1377
  *
@@ -3,8 +3,10 @@
3
3
  * CLI Command Executor (non-interactive mode)
4
4
  * Issue #294: Executes CLI tool commands for scheduled executions
5
5
  * Issue #379: Added OpenCode support (opencode run)
6
+ * Issue #2974: Added OpenCode V2 support (opencode2 run --standalone)
6
7
  *
7
- * Supported tools: claude, codex, gemini, vibe-local, opencode, copilot, antigravity, command-code
8
+ * Supported tools: claude, codex, gemini, vibe-local, opencode, copilot, antigravity, command-code,
9
+ * opencode-v2
8
10
  *
9
11
  * Security:
10
12
  * - Uses execFile (not exec) to prevent shell injection
@@ -19,6 +21,8 @@ exports.getCommandForTool = getCommandForTool;
19
21
  exports.truncateOutput = truncateOutput;
20
22
  exports.buildCliArgs = buildCliArgs;
21
23
  exports.extractOpencodeFinalText = extractOpencodeFinalText;
24
+ exports.findOpencodeTrailingError = findOpencodeTrailingError;
25
+ exports.describeOpencodeV2Failure = describeOpencodeV2Failure;
22
26
  exports.extractCommandCodeResult = extractCommandCodeResult;
23
27
  exports.readCommandCodeStream = readCommandCodeStream;
24
28
  exports.describeCommandCodeBlockedToolCalls = describeCommandCodeBlockedToolCalls;
@@ -31,6 +35,7 @@ const env_sanitizer_1 = require("../../lib/security/env-sanitizer");
31
35
  const cli_patterns_1 = require("../../lib/detection/cli-patterns");
32
36
  const types_1 = require("../../lib/cli-tools/types");
33
37
  const schedule_config_1 = require("../../config/schedule-config");
38
+ const opencode_executable_1 = require("../../lib/cli-tools/opencode-executable");
34
39
  // =============================================================================
35
40
  // Constants
36
41
  // =============================================================================
@@ -77,6 +82,11 @@ function getCommandForTool(cliToolId) {
77
82
  // cannot drift.
78
83
  case 'command-code':
79
84
  return 'commandcode';
85
+ // Issue #2974: the name only. `executeClaudeCommand` runs the path
86
+ // `resolveOpencodeV2Executable` answers, which also accepts an `opencode`
87
+ // that reports `opencode v2.x`.
88
+ case 'opencode-v2':
89
+ return opencode_executable_1.OPENCODE_V2_BINARY_NAME;
80
90
  default:
81
91
  return cliToolId;
82
92
  }
@@ -108,6 +118,7 @@ function truncateOutput(output) {
108
118
  * - gemini: -p <message>
109
119
  * - vibe-local: [-p <message> -y] or [--model <model> -p <message> -y]
110
120
  * - opencode: run --format json [-m <model>] [--agent <a>] [--variant <v>] [-c] [--title <t>] <message>
121
+ * - opencode-v2: run --standalone --format json [--auto] [-m <model>[#<variant>]] [--agent <a>] [-c] [--title <t>] -- <message>
111
122
  * - antigravity: -p <message> --dangerously-skip-permissions
112
123
  * - command-code: -p <message> --output-format json [--yolo | --permission-mode <permission>] --no-auto-update
113
124
  * - others: -p <message> (fallback)
@@ -175,6 +186,63 @@ function buildCliArgs(message, cliToolId, permission, options) {
175
186
  args.push(message);
176
187
  return args;
177
188
  }
189
+ case 'opencode-v2': {
190
+ // Issue #2974 (Epic #2370 Phase 4). Measured on OpenCode V2 2.0.18 in an
191
+ // isolated `HOME` / `XDG_*` (`tests/fixtures/opencode-v2-schedule-2974/`).
192
+ //
193
+ // ## `--standalone` is unconditional
194
+ //
195
+ // Without it `opencode2 run` connects to the *background service* — a
196
+ // shared `opencode serve --service` recorded in
197
+ // `~/.local/state/opencode/service.json`, starting one when there is
198
+ // none. That service is the operator's (their own TUI talks to it), it is
199
+ // not the schedule's child, and it outlives the run: in the isolated
200
+ // measurement the run spawned a detached `serve --service` (PPID 1) and
201
+ // then failed with "Timed out waiting for the background service to
202
+ // start" (exit 1). `--standalone` runs a private server for this one run;
203
+ // after it no `opencode2` process was left.
204
+ //
205
+ // ## `--format json` is unconditional
206
+ //
207
+ // For v1's reason (see the `opencode` case): the stream is the same NDJSON
208
+ // shape, so {@link extractOpencodeFinalText} reads both.
209
+ //
210
+ // ## `--auto`
211
+ //
212
+ // `auto` is the only Permission value that adds a flag. Without it an
213
+ // `ask` rule is auto-rejected and the run exits 1 (so the schedule is
214
+ // recorded as failed); with it the rule is approved. See
215
+ // OPENCODE_V2_PERMISSIONS for why the flag-less run is the default.
216
+ //
217
+ // ## Options, and `--` before the message
218
+ //
219
+ // `-m`, `--agent`, `-c` and `--title` exist with v1's meaning. There is
220
+ // no `--variant`: `opencode2 run --help` documents `-m` as
221
+ // `provider/model#variant` and `--variant` is "Unrecognized flag" (exit
222
+ // 1), so a variant rides on the model. A variant without a model has
223
+ // nothing to ride on and is not sent. Since Issue #2982 the CMATE.md
224
+ // column carries these options for opencode-v2 too, and the column parser
225
+ // and `cmate-writer` refuse a variant without a model before it gets here
226
+ // (`validateVariantHasModel`); the guard below stays for direct callers.
227
+ //
228
+ // Unlike v1, a message that begins with `-` is read as a flag ("-x reply"
229
+ // printed the usage; "--- list" was "Unrecognized flag"), so the message
230
+ // follows `--`, which v2 accepts.
231
+ const args = ['run', '--standalone', '--format', 'json'];
232
+ if (permission === schedule_config_1.OPENCODE_V2_AUTO_PERMISSION)
233
+ args.push('--auto');
234
+ if (options?.model) {
235
+ args.push('-m', options.variant ? `${options.model}#${options.variant}` : options.model);
236
+ }
237
+ if (options?.agent)
238
+ args.push('--agent', options.agent);
239
+ if (options?.continueSession)
240
+ args.push('-c');
241
+ if (options?.title)
242
+ args.push('--title', options.title);
243
+ args.push('--', message);
244
+ return args;
245
+ }
178
246
  case 'command-code': {
179
247
  // Issue #2253 (Epic #2249 Phase D): `commandcode -p <message>` runs one
180
248
  // prompt non-interactively. `--output-format json` is unconditional for
@@ -316,6 +384,12 @@ function buildCliArgs(message, cliToolId, permission, options) {
316
384
  * whole extraction, because `--print-logs` and a plugin's stray `console.log`
317
385
  * both land on the same stdout.
318
386
  *
387
+ * ## OpenCode V2 (Issue #2974)
388
+ *
389
+ * `opencode2 run --format json` (2.0.18) writes the same frames with the same
390
+ * `part.messageID` / `part.text`, so this reads it unchanged. Only the `error`
391
+ * frame differs — see {@link renderOpencodeErrorFrame}.
392
+ *
319
393
  * @param stdout - Raw stdout from `opencode run --format json`
320
394
  * @returns The assistant's final text, a one-line rendering of an `error`
321
395
  * frame, or null when the stream carried neither
@@ -363,22 +437,76 @@ function extractOpencodeFinalText(stdout) {
363
437
  /**
364
438
  * One line describing an `{"type":"error"}` frame.
365
439
  *
366
- * The measured shape is `error: { name, data: { message, ref } }`; every field
367
- * is treated as optional because the only thing this layer knows for certain is
368
- * the `type`. Rendered rather than dropped so a failed opencode run says
369
- * something in the execution log instead of nothing.
440
+ * The measured v1 shape is `error: { name, data: { message, ref } }`; OpenCode
441
+ * V2 2.0.18 writes `error: { type, message }` (`{"type":"aborted","message":
442
+ * "Step interrupted"}` after an auto-rejected `ask`, `{"type":"unknown",
443
+ * "message":"Agent not found: …"}`, `{"type":"provider.no-route",…}`). Both are
444
+ * read; v1's fields win when present. Every field is treated as optional
445
+ * because the only thing this layer knows for certain is the `type`. Rendered
446
+ * rather than dropped so a failed opencode run says something in the execution
447
+ * log instead of nothing.
370
448
  */
371
449
  function renderOpencodeErrorFrame(record) {
372
450
  const error = typeof record.error === 'object' && record.error !== null
373
451
  ? record.error
374
452
  : {};
375
- const name = typeof error.name === 'string' ? error.name : 'error';
453
+ const name = typeof error.name === 'string' ? error.name
454
+ : typeof error.type === 'string' ? error.type
455
+ : 'error';
376
456
  const data = typeof error.data === 'object' && error.data !== null
377
457
  ? error.data
378
458
  : {};
379
- const message = typeof data.message === 'string' ? data.message : '';
459
+ const message = typeof data.message === 'string' ? data.message
460
+ : typeof error.message === 'string' ? error.message
461
+ : '';
380
462
  return message ? `opencode error: ${name}: ${message}` : `opencode error: ${name}`;
381
463
  }
464
+ /**
465
+ * The `error` frame an opencode stream *ends* with, rendered, or null.
466
+ *
467
+ * Issue #2974: the measured OpenCode V2 failures (an auto-rejected `ask`, an
468
+ * unknown agent, an unavailable model) all end the stream in an `error` frame
469
+ * and exit 1. The exit code is what fails the schedule; this is the second
470
+ * half, so a run that ever exits 0 after an `error` frame is not recorded as
471
+ * completed either. "Ends with" rather than "contains": a stream whose last
472
+ * word is the assistant's answer did finish.
473
+ *
474
+ * @param stdout - Raw stdout from `opencode2 run --format json`
475
+ * @returns The rendered error, or null when the last frame is not an error
476
+ */
477
+ function findOpencodeTrailingError(stdout) {
478
+ let last = null;
479
+ for (const line of stdout.split('\n')) {
480
+ const trimmed = line.trim();
481
+ if (!trimmed.startsWith('{'))
482
+ continue;
483
+ try {
484
+ const frame = JSON.parse(trimmed);
485
+ if (typeof frame === 'object' && frame !== null)
486
+ last = frame;
487
+ }
488
+ catch {
489
+ continue;
490
+ }
491
+ }
492
+ return last && last.type === 'error' ? renderOpencodeErrorFrame(last) : null;
493
+ }
494
+ /**
495
+ * The `Reason:` line for a failed OpenCode V2 run, or null.
496
+ *
497
+ * Measured on 2.0.18: an `ask` rule without `--auto` prints
498
+ * `! permission requested: <permission> (<target>); auto-rejecting` on stderr
499
+ * and exits 1. That line is the one that says what to change, so it is named;
500
+ * any other failure is described by its trailing `error` frame.
501
+ */
502
+ function describeOpencodeV2Failure(stdout, stderr) {
503
+ if (/permission requested: .*auto-rejecting/.test((0, cli_patterns_1.stripAnsi)(stderr))) {
504
+ return 'Reason: opencode-v2 auto-rejected a permission request (an `ask` rule);'
505
+ + ' set the schedule\'s Permission to `auto` to approve it unattended';
506
+ }
507
+ const trailing = findOpencodeTrailingError(stdout);
508
+ return trailing ? `Reason: ${trailing}` : null;
509
+ }
382
510
  // =============================================================================
383
511
  // command-code `--output-format json` extraction (Issue #2253)
384
512
  // =============================================================================
@@ -679,11 +807,35 @@ async function executeClaudeCommand(message, cwd, cliToolId = 'claude', permissi
679
807
  ? message.substring(0, exports.MAX_MESSAGE_LENGTH)
680
808
  : message;
681
809
  const args = buildCliArgs(truncatedMessage, cliToolId, permission, options);
810
+ // Issue #2974: OpenCode V2 runs the binary `resolveOpencodeV2Executable`
811
+ // answers for (`opencode2`, or an `opencode` that reports v2) — the same
812
+ // resolution the interactive launch uses, so a v1 `opencode` is never handed
813
+ // v2's flags.
814
+ let command = getCommandForTool(cliToolId);
815
+ if (cliToolId === 'opencode-v2') {
816
+ const resolution = await (0, opencode_executable_1.resolveOpencodeV2Executable)();
817
+ if (!resolution.executable) {
818
+ const error = 'OpenCode V2 not found: no `opencode2` (or `opencode` reporting v2) on PATH';
819
+ return { output: error, exitCode: null, status: 'failed', error };
820
+ }
821
+ command = resolution.executable.path;
822
+ }
823
+ // Issue #2979: `execFile`'s `cwd` does not touch `PWD`, so the child inherits
824
+ // the server's (the main checkout it was started from). OpenCode V2 takes its
825
+ // project directory from `PWD`, not `process.cwd()`: measured on 2.0.18 in a
826
+ // throwaway repo + `git worktree`, the write landed wherever `PWD` pointed
827
+ // (cwd=worktree / PWD=main → main; cwd=main / PWD=worktree → worktree;
828
+ // PWD unset → cwd), for a plain repo and a worktree alike, and the
829
+ // `opencode.json` read was the one under `PWD`. `opencode2 run` has no `--dir`
830
+ // (v1 has), so the child's `PWD` is set to `cwd`. Other tools keep the
831
+ // environment they had.
832
+ const env = cliToolId === 'opencode-v2'
833
+ ? { ...(0, env_sanitizer_1.sanitizeEnvForChildProcess)(), PWD: cwd }
834
+ : (0, env_sanitizer_1.sanitizeEnvForChildProcess)();
682
835
  return new Promise((resolve) => {
683
- const command = getCommandForTool(cliToolId);
684
836
  const child = (0, child_process_1.execFile)(command, args, {
685
837
  cwd,
686
- env: (0, env_sanitizer_1.sanitizeEnvForChildProcess)(),
838
+ env,
687
839
  maxBuffer: exports.MAX_OUTPUT_SIZE,
688
840
  timeout: options?.timeoutMs ?? exports.EXECUTION_TIMEOUT_MS,
689
841
  }, (error, stdout, stderr) => {
@@ -713,6 +865,7 @@ async function executeClaudeCommand(message, cwd, cliToolId = 'claude', permissi
713
865
  ? describeCommandCodeBlockedToolCalls(commandCodeStream)
714
866
  : null;
715
867
  const exitCodeNumber = typeof errCode === 'number' ? errCode : null;
868
+ const isOpencodeV2 = cliToolId === 'opencode-v2';
716
869
  const errorSummary = [
717
870
  ...(blockedWarning ?? []),
718
871
  `Error: ${error.message}`,
@@ -722,6 +875,7 @@ async function executeClaudeCommand(message, cwd, cliToolId = 'claude', permissi
722
875
  cliToolId === 'command-code'
723
876
  ? describeCommandCodeFailure(exitCodeNumber, commandCodeResult)
724
877
  : null,
878
+ isOpencodeV2 ? describeOpencodeV2Failure(stdout || '', stderr || '') : null,
725
879
  ]
726
880
  .filter((line) => line !== null)
727
881
  .join('\n');
@@ -729,9 +883,14 @@ async function executeClaudeCommand(message, cwd, cliToolId = 'claude', permissi
729
883
  // before it could write a result line (an unknown `--model` exits 1
730
884
  // with empty stdout and the message on stderr) reports what it did
731
885
  // write rather than an empty body.
886
+ //
887
+ // Issue #2974: OpenCode V2 likewise decodes its NDJSON, so the body is
888
+ // the answer (or the rendered `error` frame), not the event dump.
732
889
  const decodedStdout = commandCodeResult
733
890
  ? commandCodeResult.finalText
734
- : (stdout || '');
891
+ : isOpencodeV2
892
+ ? extractOpencodeFinalText(stdout || '') ?? (stdout || '')
893
+ : (stdout || '');
735
894
  const rawOutput = (0, cli_patterns_1.stripAnsi)([
736
895
  errorSummary,
737
896
  decodedStdout ? `\n--- stdout ---\n${decodedStdout}` : '',
@@ -781,6 +940,21 @@ async function executeClaudeCommand(message, cwd, cliToolId = 'claude', permissi
781
940
  });
782
941
  return;
783
942
  }
943
+ // Issue #2974: exit 0 is not the whole verdict for OpenCode V2 — a
944
+ // stream that ends in an `error` frame did not finish, whatever the
945
+ // exit code says (see findOpencodeTrailingError).
946
+ if (cliToolId === 'opencode-v2') {
947
+ const trailingError = findOpencodeTrailingError(stdout || '');
948
+ const body = extractOpencodeFinalText(stdout || '') ?? (stdout || '');
949
+ const head = trailingError ? [`Reason: ${trailingError}`] : [];
950
+ resolve({
951
+ output: truncateOutput((0, cli_patterns_1.stripAnsi)([...head, body].join('\n'))),
952
+ exitCode: 0,
953
+ status: trailingError ? 'failed' : 'completed',
954
+ ...(trailingError ? { error: trailingError } : {}),
955
+ });
956
+ return;
957
+ }
784
958
  const decoded = cliToolId === 'opencode'
785
959
  ? extractOpencodeFinalText(stdout || '') ?? stdout ?? ''
786
960
  : stdout || '';
@@ -301,6 +301,9 @@ function summarizeAskUserQuestion(episode) {
301
301
  question: first.question,
302
302
  labels: first.choices.map((choice) => choice.label),
303
303
  questionCount: episode.spec.questions.length,
304
+ // Issue #2951: a question that takes a typed answer, so the panel and the
305
+ // phone sheet can offer an input for it.
306
+ ...(first.custom ? { custom: true } : {}),
304
307
  };
305
308
  }
306
309
  /**
@@ -999,7 +1002,10 @@ async function buildPayload(db, worktreeId, cliToolId, instanceId) {
999
1002
  // same way `structuredEvents.pendingDecisions[].kind` is, through the one
1000
1003
  // reader in `pending-decision-kind`.
1001
1004
  const addressesQuestion = promptWaiting !== null && (0, pending_decision_kind_1.pendingDecisionKind)(promptWaiting.toolName) === 'question';
1002
- const decisionOptions = addressableDecisionId !== null && !addressesQuestion ? structured_prompt_1.STRUCTURED_DECISION_OPTIONS : null;
1005
+ const decisionOptions = addressableDecisionId !== null && !addressesQuestion
1006
+ ? // Issue #2951: in the tool's own words (OpenCode V2: `Always allow`).
1007
+ (0, structured_prompt_1.structuredDecisionOptionsFor)(cliToolId)
1008
+ : null;
1003
1009
  const structuredFacts = promptWaiting === null
1004
1010
  ? null
1005
1011
  : {
@@ -1096,7 +1102,16 @@ async function buildPayload(db, worktreeId, cliToolId, instanceId) {
1096
1102
  // an unclassified frame, and writing a "detection failed" row for a turn the
1097
1103
  // agent itself told us had ended would put a false stall into the audit trail
1098
1104
  // `capture --prompts` prints.
1099
- const unclassifiedVerdict = (0, unclassified_frame_tracker_1.observeUnclassifiedFrame)(compositeKey, merged.isUnclassifiedActive);
1105
+ //
1106
+ // Issue #2965: not while the agent holds a decision this server can answer by
1107
+ // id (OpenCode V2 / opencode approvals and questions). The frame may still be
1108
+ // one the scraper cannot read, but "nothing could answer it" is false then,
1109
+ // and the row landed in the chat as a meaningless assistant line. Fed to the
1110
+ // tracker as "not unclassified" rather than merely not written, so the run —
1111
+ // and the 60 seconds — start afresh if the frame is still unreadable once the
1112
+ // decision is gone (answered, expired, or the source dropped).
1113
+ const answerableOverAgentApi = (0, structured_prompt_1.hasApiAnswerableDecision)(eventSource.capabilities.eventIdentity, structuredEvents.pendingDecisions ?? []);
1114
+ const unclassifiedVerdict = (0, unclassified_frame_tracker_1.observeUnclassifiedFrame)(compositeKey, merged.isUnclassifiedActive && !answerableOverAgentApi);
1100
1115
  if (unclassifiedVerdict.shouldRecord) {
1101
1116
  recordUnclassifiedFrame(db, {
1102
1117
  worktreeId,
@@ -1136,7 +1151,16 @@ async function buildPayload(db, worktreeId, cliToolId, instanceId) {
1136
1151
  }
1137
1152
  // Issue #1725: the structured layer saw a dialog the scraper did not. That
1138
1153
  // gap is the fact worth keeping — see recordStructuredPrompt.
1139
- if (promptWaiting !== null && structuredFacts !== null && !scraperPromptWaiting && !promptWaiting.recorded) {
1154
+ //
1155
+ // Issue #2965: except while that dialog can be answered over the agent's API
1156
+ // — the live payload already carries its id and replies, so the row says
1157
+ // nothing true. Not marked recorded either: should the decision expire with
1158
+ // the dialog still open, the row is written then (the safe side).
1159
+ if (promptWaiting !== null &&
1160
+ structuredFacts !== null &&
1161
+ !scraperPromptWaiting &&
1162
+ !promptWaiting.recorded &&
1163
+ !answerableOverAgentApi) {
1140
1164
  (0, agent_event_state_1.markStructuredPromptRecorded)(worktreeId, cliToolId, instanceId);
1141
1165
  recordStructuredPrompt(db, {
1142
1166
  worktreeId,
@@ -47,6 +47,7 @@ const logger_1 = require("../../lib/logger");
47
47
  const worktree_session_ownership_1 = require("../../lib/cli-tools/worktree-session-ownership");
48
48
  const session_name_1 = require("../../lib/cli-tools/session-name");
49
49
  const prompt_waiting_guard_1 = require("../../lib/session/prompt-waiting-guard");
50
+ const session_start_error_1 = require("../../lib/session/session-start-error");
50
51
  const opencode_1 = require("../../lib/cli-tools/opencode");
51
52
  const logger = (0, logger_1.createLogger)('session/send-user-message');
52
53
  function getErrorMessage(error) {
@@ -313,6 +314,9 @@ async function sendUserMessage(db, params) {
313
314
  }
314
315
  catch (error) {
315
316
  logger.error('failed-to-send-message-to:', { error: getErrorMessage(error) });
317
+ if ((0, session_start_error_1.isSessionStartTimeoutError)(error)) {
318
+ return { ok: false, stage: 'send', error: error.message, code: session_start_error_1.SESSION_STARTING_CODE };
319
+ }
316
320
  return { ok: false, stage: 'send', error: getErrorMessage(error) };
317
321
  }
318
322
  // 5. Create user message in database (History source: chat_messages).