commandmate 0.42.2 → 0.44.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 (624) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-build-manifest.json +176 -176
  3. package/.next/app-path-routes-manifest.json +34 -34
  4. package/.next/build-manifest.json +2 -2
  5. package/.next/prerender-manifest.json +15 -15
  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.js.nft.json +1 -1
  9. package/.next/server/app/api/agents/update/route_client-reference-manifest.js +1 -1
  10. package/.next/server/app/api/agents/versions/route.js.nft.json +1 -1
  11. package/.next/server/app/api/agents/versions/route_client-reference-manifest.js +1 -1
  12. package/.next/server/app/api/app/release-notes/route_client-reference-manifest.js +1 -1
  13. package/.next/server/app/api/app/update/route.js +2 -2
  14. package/.next/server/app/api/app/update/route.js.nft.json +1 -1
  15. package/.next/server/app/api/app/update/route_client-reference-manifest.js +1 -1
  16. package/.next/server/app/api/app/update-check/route.js +1 -1
  17. package/.next/server/app/api/app/update-check/route.js.nft.json +1 -1
  18. package/.next/server/app/api/app/update-check/route_client-reference-manifest.js +1 -1
  19. package/.next/server/app/api/auth/login/route_client-reference-manifest.js +1 -1
  20. package/.next/server/app/api/auth/logout/route_client-reference-manifest.js +1 -1
  21. package/.next/server/app/api/auth/status/route_client-reference-manifest.js +1 -1
  22. package/.next/server/app/api/capabilities/route.js +1 -1
  23. package/.next/server/app/api/capabilities/route_client-reference-manifest.js +1 -1
  24. package/.next/server/app/api/daily-summary/route.js +1 -1
  25. package/.next/server/app/api/daily-summary/route.js.nft.json +1 -1
  26. package/.next/server/app/api/daily-summary/route_client-reference-manifest.js +1 -1
  27. package/.next/server/app/api/daily-summary/status/route.js +1 -1
  28. package/.next/server/app/api/daily-summary/status/route.js.nft.json +1 -1
  29. package/.next/server/app/api/daily-summary/status/route_client-reference-manifest.js +1 -1
  30. package/.next/server/app/api/external-apps/[id]/health/route.js.nft.json +1 -1
  31. package/.next/server/app/api/external-apps/[id]/health/route_client-reference-manifest.js +1 -1
  32. package/.next/server/app/api/external-apps/[id]/route.js.nft.json +1 -1
  33. package/.next/server/app/api/external-apps/[id]/route_client-reference-manifest.js +1 -1
  34. package/.next/server/app/api/external-apps/route.js.nft.json +1 -1
  35. package/.next/server/app/api/external-apps/route_client-reference-manifest.js +1 -1
  36. package/.next/server/app/api/fs/browse/route.js.nft.json +1 -1
  37. package/.next/server/app/api/fs/browse/route_client-reference-manifest.js +1 -1
  38. package/.next/server/app/api/fs/recent-paths/route.js.nft.json +1 -1
  39. package/.next/server/app/api/fs/recent-paths/route_client-reference-manifest.js +1 -1
  40. package/.next/server/app/api/hooks/agent-event/route.js +103 -1
  41. package/.next/server/app/api/hooks/agent-event/route.js.nft.json +1 -1
  42. package/.next/server/app/api/hooks/agent-event/route_client-reference-manifest.js +1 -1
  43. package/.next/server/app/api/hooks/claude-done/route.js +2 -2
  44. package/.next/server/app/api/hooks/claude-done/route.js.nft.json +1 -1
  45. package/.next/server/app/api/hooks/claude-done/route_client-reference-manifest.js +1 -1
  46. package/.next/server/app/api/hooks/permission-request/route.js +1 -1
  47. package/.next/server/app/api/hooks/permission-request/route.js.nft.json +1 -1
  48. package/.next/server/app/api/hooks/permission-request/route_client-reference-manifest.js +1 -1
  49. package/.next/server/app/api/metrics/vibe/route.js.nft.json +1 -1
  50. package/.next/server/app/api/metrics/vibe/route_client-reference-manifest.js +1 -1
  51. package/.next/server/app/api/ollama/models/route_client-reference-manifest.js +1 -1
  52. package/.next/server/app/api/push/escalation/route.js +1 -1
  53. package/.next/server/app/api/push/escalation/route.js.nft.json +1 -1
  54. package/.next/server/app/api/push/escalation/route_client-reference-manifest.js +1 -1
  55. package/.next/server/app/api/push/subscriptions/route.js.nft.json +1 -1
  56. package/.next/server/app/api/push/subscriptions/route_client-reference-manifest.js +1 -1
  57. package/.next/server/app/api/push/vapid/route.js +1 -1
  58. package/.next/server/app/api/push/vapid/route.js.nft.json +1 -1
  59. package/.next/server/app/api/push/vapid/route_client-reference-manifest.js +1 -1
  60. package/.next/server/app/api/relays/[relayId]/cancel/route.js +1 -1
  61. package/.next/server/app/api/relays/[relayId]/cancel/route.js.nft.json +1 -1
  62. package/.next/server/app/api/relays/[relayId]/cancel/route_client-reference-manifest.js +1 -1
  63. package/.next/server/app/api/relays/route.js +1 -1
  64. package/.next/server/app/api/relays/route.js.nft.json +1 -1
  65. package/.next/server/app/api/relays/route_client-reference-manifest.js +1 -1
  66. package/.next/server/app/api/remote/pair/route_client-reference-manifest.js +1 -1
  67. package/.next/server/app/api/repositories/[id]/route.js.nft.json +1 -1
  68. package/.next/server/app/api/repositories/[id]/route_client-reference-manifest.js +1 -1
  69. package/.next/server/app/api/repositories/clone/[jobId]/route.js +1 -1
  70. package/.next/server/app/api/repositories/clone/[jobId]/route.js.nft.json +1 -1
  71. package/.next/server/app/api/repositories/clone/[jobId]/route_client-reference-manifest.js +1 -1
  72. package/.next/server/app/api/repositories/clone/route.js +1 -1
  73. package/.next/server/app/api/repositories/clone/route.js.nft.json +1 -1
  74. package/.next/server/app/api/repositories/clone/route_client-reference-manifest.js +1 -1
  75. package/.next/server/app/api/repositories/excluded/route.js.nft.json +1 -1
  76. package/.next/server/app/api/repositories/excluded/route_client-reference-manifest.js +1 -1
  77. package/.next/server/app/api/repositories/restore/route.js +1 -1
  78. package/.next/server/app/api/repositories/restore/route.js.nft.json +1 -1
  79. package/.next/server/app/api/repositories/restore/route_client-reference-manifest.js +1 -1
  80. package/.next/server/app/api/repositories/route.js +1 -1
  81. package/.next/server/app/api/repositories/route.js.nft.json +1 -1
  82. package/.next/server/app/api/repositories/route_client-reference-manifest.js +1 -1
  83. package/.next/server/app/api/repositories/scan/route.js +1 -1
  84. package/.next/server/app/api/repositories/scan/route.js.nft.json +1 -1
  85. package/.next/server/app/api/repositories/scan/route_client-reference-manifest.js +1 -1
  86. package/.next/server/app/api/repositories/sync/route.js +1 -1
  87. package/.next/server/app/api/repositories/sync/route.js.nft.json +1 -1
  88. package/.next/server/app/api/repositories/sync/route_client-reference-manifest.js +1 -1
  89. package/.next/server/app/api/repositories/validate-path/route.js.nft.json +1 -1
  90. package/.next/server/app/api/repositories/validate-path/route_client-reference-manifest.js +1 -1
  91. package/.next/server/app/api/settings/default-agents/route.js +1 -1
  92. package/.next/server/app/api/settings/default-agents/route.js.nft.json +1 -1
  93. package/.next/server/app/api/settings/default-agents/route_client-reference-manifest.js +1 -1
  94. package/.next/server/app/api/settings/default-surface-mode/route.js.nft.json +1 -1
  95. package/.next/server/app/api/settings/default-surface-mode/route_client-reference-manifest.js +1 -1
  96. package/.next/server/app/api/sidebar/group-order/route.js.nft.json +1 -1
  97. package/.next/server/app/api/sidebar/group-order/route_client-reference-manifest.js +1 -1
  98. package/.next/server/app/api/skills/[id]/route.js +1 -1
  99. package/.next/server/app/api/skills/[id]/route.js.nft.json +1 -1
  100. package/.next/server/app/api/skills/[id]/route_client-reference-manifest.js +1 -1
  101. package/.next/server/app/api/skills/installations/route.js +1 -1
  102. package/.next/server/app/api/skills/installations/route.js.nft.json +1 -1
  103. package/.next/server/app/api/skills/installations/route_client-reference-manifest.js +1 -1
  104. package/.next/server/app/api/skills/operations/route.js +2 -2
  105. package/.next/server/app/api/skills/operations/route.js.nft.json +1 -1
  106. package/.next/server/app/api/skills/operations/route_client-reference-manifest.js +1 -1
  107. package/.next/server/app/api/skills/reindex/route.js +1 -1
  108. package/.next/server/app/api/skills/reindex/route.js.nft.json +1 -1
  109. package/.next/server/app/api/skills/reindex/route_client-reference-manifest.js +1 -1
  110. package/.next/server/app/api/skills/route.js +1 -1
  111. package/.next/server/app/api/skills/route.js.nft.json +1 -1
  112. package/.next/server/app/api/skills/route_client-reference-manifest.js +1 -1
  113. package/.next/server/app/api/slash-commands/route.js +1 -1
  114. package/.next/server/app/api/slash-commands/route.js.nft.json +1 -1
  115. package/.next/server/app/api/slash-commands/route_client-reference-manifest.js +1 -1
  116. package/.next/server/app/api/tasks/[taskId]/cancel/route.js.nft.json +1 -1
  117. package/.next/server/app/api/tasks/[taskId]/cancel/route_client-reference-manifest.js +1 -1
  118. package/.next/server/app/api/tasks/[taskId]/route.js.nft.json +1 -1
  119. package/.next/server/app/api/tasks/[taskId]/route_client-reference-manifest.js +1 -1
  120. package/.next/server/app/api/templates/[id]/route.js.nft.json +1 -1
  121. package/.next/server/app/api/templates/[id]/route_client-reference-manifest.js +1 -1
  122. package/.next/server/app/api/templates/route.js.nft.json +1 -1
  123. package/.next/server/app/api/templates/route_client-reference-manifest.js +1 -1
  124. package/.next/server/app/api/verification/runs/[runId]/route.js.nft.json +1 -1
  125. package/.next/server/app/api/verification/runs/[runId]/route_client-reference-manifest.js +1 -1
  126. package/.next/server/app/api/verification/runs/route.js.nft.json +1 -1
  127. package/.next/server/app/api/verification/runs/route_client-reference-manifest.js +1 -1
  128. package/.next/server/app/api/worktrees/[id]/auto-yes/route.js +1 -1
  129. package/.next/server/app/api/worktrees/[id]/auto-yes/route.js.nft.json +1 -1
  130. package/.next/server/app/api/worktrees/[id]/auto-yes/route_client-reference-manifest.js +1 -1
  131. package/.next/server/app/api/worktrees/[id]/capture/route.js +1 -1
  132. package/.next/server/app/api/worktrees/[id]/capture/route.js.nft.json +1 -1
  133. package/.next/server/app/api/worktrees/[id]/capture/route_client-reference-manifest.js +1 -1
  134. package/.next/server/app/api/worktrees/[id]/clear-composer/route.js +1 -1
  135. package/.next/server/app/api/worktrees/[id]/clear-composer/route.js.nft.json +1 -1
  136. package/.next/server/app/api/worktrees/[id]/clear-composer/route_client-reference-manifest.js +1 -1
  137. package/.next/server/app/api/worktrees/[id]/cli-reference/route.js.nft.json +1 -1
  138. package/.next/server/app/api/worktrees/[id]/cli-reference/route_client-reference-manifest.js +1 -1
  139. package/.next/server/app/api/worktrees/[id]/cli-tool/route.js.nft.json +1 -1
  140. package/.next/server/app/api/worktrees/[id]/cli-tool/route_client-reference-manifest.js +1 -1
  141. package/.next/server/app/api/worktrees/[id]/cmate/schedules/route.js +3 -1
  142. package/.next/server/app/api/worktrees/[id]/cmate/schedules/route.js.nft.json +1 -1
  143. package/.next/server/app/api/worktrees/[id]/cmate/schedules/route_client-reference-manifest.js +1 -1
  144. package/.next/server/app/api/worktrees/[id]/current-output/route.js +1 -1
  145. package/.next/server/app/api/worktrees/[id]/current-output/route.js.nft.json +1 -1
  146. package/.next/server/app/api/worktrees/[id]/current-output/route_client-reference-manifest.js +1 -1
  147. package/.next/server/app/api/worktrees/[id]/direct-input/route.js +1 -1
  148. package/.next/server/app/api/worktrees/[id]/direct-input/route.js.nft.json +1 -1
  149. package/.next/server/app/api/worktrees/[id]/direct-input/route_client-reference-manifest.js +1 -1
  150. package/.next/server/app/api/worktrees/[id]/env/route.js.nft.json +1 -1
  151. package/.next/server/app/api/worktrees/[id]/env/route_client-reference-manifest.js +1 -1
  152. package/.next/server/app/api/worktrees/[id]/execution-logs/[logId]/route.js +1 -1
  153. package/.next/server/app/api/worktrees/[id]/execution-logs/[logId]/route.js.nft.json +1 -1
  154. package/.next/server/app/api/worktrees/[id]/execution-logs/[logId]/route_client-reference-manifest.js +1 -1
  155. package/.next/server/app/api/worktrees/[id]/execution-logs/route.js +3 -1
  156. package/.next/server/app/api/worktrees/[id]/execution-logs/route.js.nft.json +1 -1
  157. package/.next/server/app/api/worktrees/[id]/execution-logs/route_client-reference-manifest.js +1 -1
  158. package/.next/server/app/api/worktrees/[id]/files/[...path]/route.js +1 -1
  159. package/.next/server/app/api/worktrees/[id]/files/[...path]/route.js.nft.json +1 -1
  160. package/.next/server/app/api/worktrees/[id]/files/[...path]/route_client-reference-manifest.js +1 -1
  161. package/.next/server/app/api/worktrees/[id]/git/branch/create/route.js.nft.json +1 -1
  162. package/.next/server/app/api/worktrees/[id]/git/branch/create/route_client-reference-manifest.js +1 -1
  163. package/.next/server/app/api/worktrees/[id]/git/branch/delete/route.js.nft.json +1 -1
  164. package/.next/server/app/api/worktrees/[id]/git/branch/delete/route_client-reference-manifest.js +1 -1
  165. package/.next/server/app/api/worktrees/[id]/git/branches/route.js.nft.json +1 -1
  166. package/.next/server/app/api/worktrees/[id]/git/branches/route_client-reference-manifest.js +1 -1
  167. package/.next/server/app/api/worktrees/[id]/git/checkout/route.js.nft.json +1 -1
  168. package/.next/server/app/api/worktrees/[id]/git/checkout/route_client-reference-manifest.js +1 -1
  169. package/.next/server/app/api/worktrees/[id]/git/commit/route.js.nft.json +1 -1
  170. package/.next/server/app/api/worktrees/[id]/git/commit/route_client-reference-manifest.js +1 -1
  171. package/.next/server/app/api/worktrees/[id]/git/diff/route.js.nft.json +1 -1
  172. package/.next/server/app/api/worktrees/[id]/git/diff/route_client-reference-manifest.js +1 -1
  173. package/.next/server/app/api/worktrees/[id]/git/fetch/route.js.nft.json +1 -1
  174. package/.next/server/app/api/worktrees/[id]/git/fetch/route_client-reference-manifest.js +1 -1
  175. package/.next/server/app/api/worktrees/[id]/git/log/route.js.nft.json +1 -1
  176. package/.next/server/app/api/worktrees/[id]/git/log/route_client-reference-manifest.js +1 -1
  177. package/.next/server/app/api/worktrees/[id]/git/pull/route.js.nft.json +1 -1
  178. package/.next/server/app/api/worktrees/[id]/git/pull/route_client-reference-manifest.js +1 -1
  179. package/.next/server/app/api/worktrees/[id]/git/push/route.js.nft.json +1 -1
  180. package/.next/server/app/api/worktrees/[id]/git/push/route_client-reference-manifest.js +1 -1
  181. package/.next/server/app/api/worktrees/[id]/git/reset/route.js.nft.json +1 -1
  182. package/.next/server/app/api/worktrees/[id]/git/reset/route_client-reference-manifest.js +1 -1
  183. package/.next/server/app/api/worktrees/[id]/git/revert/route.js.nft.json +1 -1
  184. package/.next/server/app/api/worktrees/[id]/git/revert/route_client-reference-manifest.js +1 -1
  185. package/.next/server/app/api/worktrees/[id]/git/show/[commitHash]/route.js.nft.json +1 -1
  186. package/.next/server/app/api/worktrees/[id]/git/show/[commitHash]/route_client-reference-manifest.js +1 -1
  187. package/.next/server/app/api/worktrees/[id]/git/stage/route.js.nft.json +1 -1
  188. package/.next/server/app/api/worktrees/[id]/git/stage/route_client-reference-manifest.js +1 -1
  189. package/.next/server/app/api/worktrees/[id]/git/staged/route.js.nft.json +1 -1
  190. package/.next/server/app/api/worktrees/[id]/git/staged/route_client-reference-manifest.js +1 -1
  191. package/.next/server/app/api/worktrees/[id]/git/stash/[index]/route.js.nft.json +1 -1
  192. package/.next/server/app/api/worktrees/[id]/git/stash/[index]/route_client-reference-manifest.js +1 -1
  193. package/.next/server/app/api/worktrees/[id]/git/stash/apply/route.js.nft.json +1 -1
  194. package/.next/server/app/api/worktrees/[id]/git/stash/apply/route_client-reference-manifest.js +1 -1
  195. package/.next/server/app/api/worktrees/[id]/git/stash/pop/route.js.nft.json +1 -1
  196. package/.next/server/app/api/worktrees/[id]/git/stash/pop/route_client-reference-manifest.js +1 -1
  197. package/.next/server/app/api/worktrees/[id]/git/stash/push/route.js.nft.json +1 -1
  198. package/.next/server/app/api/worktrees/[id]/git/stash/push/route_client-reference-manifest.js +1 -1
  199. package/.next/server/app/api/worktrees/[id]/git/stash/route.js.nft.json +1 -1
  200. package/.next/server/app/api/worktrees/[id]/git/stash/route_client-reference-manifest.js +1 -1
  201. package/.next/server/app/api/worktrees/[id]/git/status/route.js.nft.json +1 -1
  202. package/.next/server/app/api/worktrees/[id]/git/status/route_client-reference-manifest.js +1 -1
  203. package/.next/server/app/api/worktrees/[id]/git/unstage/route.js.nft.json +1 -1
  204. package/.next/server/app/api/worktrees/[id]/git/unstage/route_client-reference-manifest.js +1 -1
  205. package/.next/server/app/api/worktrees/[id]/git/working-diff/route.js.nft.json +1 -1
  206. package/.next/server/app/api/worktrees/[id]/git/working-diff/route_client-reference-manifest.js +1 -1
  207. package/.next/server/app/api/worktrees/[id]/instances/notes/route.js.nft.json +1 -1
  208. package/.next/server/app/api/worktrees/[id]/instances/notes/route_client-reference-manifest.js +1 -1
  209. package/.next/server/app/api/worktrees/[id]/instances/opencode/route.js +1 -1
  210. package/.next/server/app/api/worktrees/[id]/instances/opencode/route.js.nft.json +1 -1
  211. package/.next/server/app/api/worktrees/[id]/instances/opencode/route_client-reference-manifest.js +1 -1
  212. package/.next/server/app/api/worktrees/[id]/interrupt/route.js +1 -1
  213. package/.next/server/app/api/worktrees/[id]/interrupt/route.js.nft.json +1 -1
  214. package/.next/server/app/api/worktrees/[id]/interrupt/route_client-reference-manifest.js +1 -1
  215. package/.next/server/app/api/worktrees/[id]/kill-session/route.js +1 -1
  216. package/.next/server/app/api/worktrees/[id]/kill-session/route.js.nft.json +1 -1
  217. package/.next/server/app/api/worktrees/[id]/kill-session/route_client-reference-manifest.js +1 -1
  218. package/.next/server/app/api/worktrees/[id]/logs/[filename]/route.js.nft.json +1 -1
  219. package/.next/server/app/api/worktrees/[id]/logs/[filename]/route_client-reference-manifest.js +1 -1
  220. package/.next/server/app/api/worktrees/[id]/logs/route.js.nft.json +1 -1
  221. package/.next/server/app/api/worktrees/[id]/logs/route_client-reference-manifest.js +1 -1
  222. package/.next/server/app/api/worktrees/[id]/marp-render/route.js +7 -7
  223. package/.next/server/app/api/worktrees/[id]/marp-render/route.js.nft.json +1 -1
  224. package/.next/server/app/api/worktrees/[id]/marp-render/route_client-reference-manifest.js +1 -1
  225. package/.next/server/app/api/worktrees/[id]/memos/[memoId]/route.js.nft.json +1 -1
  226. package/.next/server/app/api/worktrees/[id]/memos/[memoId]/route_client-reference-manifest.js +1 -1
  227. package/.next/server/app/api/worktrees/[id]/memos/route.js.nft.json +1 -1
  228. package/.next/server/app/api/worktrees/[id]/memos/route_client-reference-manifest.js +1 -1
  229. package/.next/server/app/api/worktrees/[id]/messages/route.js.nft.json +1 -1
  230. package/.next/server/app/api/worktrees/[id]/messages/route_client-reference-manifest.js +1 -1
  231. package/.next/server/app/api/worktrees/[id]/opencode/diff/route.js.nft.json +1 -1
  232. package/.next/server/app/api/worktrees/[id]/opencode/diff/route_client-reference-manifest.js +1 -1
  233. package/.next/server/app/api/worktrees/[id]/opencode/session/route.js +1 -1
  234. package/.next/server/app/api/worktrees/[id]/opencode/session/route.js.nft.json +1 -1
  235. package/.next/server/app/api/worktrees/[id]/opencode/session/route_client-reference-manifest.js +1 -1
  236. package/.next/server/app/api/worktrees/[id]/opencode/share/route.js +1 -1
  237. package/.next/server/app/api/worktrees/[id]/opencode/share/route.js.nft.json +1 -1
  238. package/.next/server/app/api/worktrees/[id]/opencode/share/route_client-reference-manifest.js +1 -1
  239. package/.next/server/app/api/worktrees/[id]/prompt-response/route.js +1 -1
  240. package/.next/server/app/api/worktrees/[id]/prompt-response/route.js.nft.json +1 -1
  241. package/.next/server/app/api/worktrees/[id]/prompt-response/route_client-reference-manifest.js +1 -1
  242. package/.next/server/app/api/worktrees/[id]/resolve-target/route.js.nft.json +1 -1
  243. package/.next/server/app/api/worktrees/[id]/resolve-target/route_client-reference-manifest.js +1 -1
  244. package/.next/server/app/api/worktrees/[id]/respond/route.js +1 -1
  245. package/.next/server/app/api/worktrees/[id]/respond/route.js.nft.json +1 -1
  246. package/.next/server/app/api/worktrees/[id]/respond/route_client-reference-manifest.js +1 -1
  247. package/.next/server/app/api/worktrees/[id]/route.js +1 -103
  248. package/.next/server/app/api/worktrees/[id]/route.js.nft.json +1 -1
  249. package/.next/server/app/api/worktrees/[id]/route_client-reference-manifest.js +1 -1
  250. package/.next/server/app/api/worktrees/[id]/schedules/[scheduleId]/route.js +3 -1
  251. package/.next/server/app/api/worktrees/[id]/schedules/[scheduleId]/route.js.nft.json +1 -1
  252. package/.next/server/app/api/worktrees/[id]/schedules/[scheduleId]/route_client-reference-manifest.js +1 -1
  253. package/.next/server/app/api/worktrees/[id]/schedules/active/route.js +3 -1
  254. package/.next/server/app/api/worktrees/[id]/schedules/active/route.js.nft.json +1 -1
  255. package/.next/server/app/api/worktrees/[id]/schedules/active/route_client-reference-manifest.js +1 -1
  256. package/.next/server/app/api/worktrees/[id]/schedules/route.js +3 -1
  257. package/.next/server/app/api/worktrees/[id]/schedules/route.js.nft.json +1 -1
  258. package/.next/server/app/api/worktrees/[id]/schedules/route_client-reference-manifest.js +1 -1
  259. package/.next/server/app/api/worktrees/[id]/search/route.js +1 -1
  260. package/.next/server/app/api/worktrees/[id]/search/route.js.nft.json +1 -1
  261. package/.next/server/app/api/worktrees/[id]/search/route_client-reference-manifest.js +1 -1
  262. package/.next/server/app/api/worktrees/[id]/send/route.js +1 -103
  263. package/.next/server/app/api/worktrees/[id]/send/route.js.nft.json +1 -1
  264. package/.next/server/app/api/worktrees/[id]/send/route_client-reference-manifest.js +1 -1
  265. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route.js +103 -1
  266. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route.js.nft.json +1 -1
  267. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route_client-reference-manifest.js +1 -1
  268. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/install/route.js +1 -1
  269. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/install/route.js.nft.json +1 -1
  270. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/install/route_client-reference-manifest.js +1 -1
  271. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/plan/route.js +1 -1
  272. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/plan/route.js.nft.json +1 -1
  273. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/plan/route_client-reference-manifest.js +1 -1
  274. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall/route.js +1 -1
  275. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall/route.js.nft.json +1 -1
  276. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall/route_client-reference-manifest.js +1 -1
  277. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall-plan/route.js +1 -1
  278. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall-plan/route.js.nft.json +1 -1
  279. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall-plan/route_client-reference-manifest.js +1 -1
  280. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/update/route.js +1 -1
  281. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/update/route.js.nft.json +1 -1
  282. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/update/route_client-reference-manifest.js +1 -1
  283. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/update-plan/route.js +1 -1
  284. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/update-plan/route.js.nft.json +1 -1
  285. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/update-plan/route_client-reference-manifest.js +1 -1
  286. package/.next/server/app/api/worktrees/[id]/skills/route.js +1 -1
  287. package/.next/server/app/api/worktrees/[id]/skills/route.js.nft.json +1 -1
  288. package/.next/server/app/api/worktrees/[id]/skills/route_client-reference-manifest.js +1 -1
  289. package/.next/server/app/api/worktrees/[id]/slash-commands/route.js +1 -1
  290. package/.next/server/app/api/worktrees/[id]/slash-commands/route.js.nft.json +1 -1
  291. package/.next/server/app/api/worktrees/[id]/slash-commands/route_client-reference-manifest.js +1 -1
  292. package/.next/server/app/api/worktrees/[id]/special-keys/route.js +1 -1
  293. package/.next/server/app/api/worktrees/[id]/special-keys/route.js.nft.json +1 -1
  294. package/.next/server/app/api/worktrees/[id]/special-keys/route_client-reference-manifest.js +1 -1
  295. package/.next/server/app/api/worktrees/[id]/tasks/route.js.nft.json +1 -1
  296. package/.next/server/app/api/worktrees/[id]/tasks/route_client-reference-manifest.js +1 -1
  297. package/.next/server/app/api/worktrees/[id]/terminal/route.js +103 -1
  298. package/.next/server/app/api/worktrees/[id]/terminal/route.js.nft.json +1 -1
  299. package/.next/server/app/api/worktrees/[id]/terminal/route_client-reference-manifest.js +1 -1
  300. package/.next/server/app/api/worktrees/[id]/timers/history/route.js.nft.json +1 -1
  301. package/.next/server/app/api/worktrees/[id]/timers/history/route_client-reference-manifest.js +1 -1
  302. package/.next/server/app/api/worktrees/[id]/timers/route.js +1 -1
  303. package/.next/server/app/api/worktrees/[id]/timers/route.js.nft.json +1 -1
  304. package/.next/server/app/api/worktrees/[id]/timers/route_client-reference-manifest.js +1 -1
  305. package/.next/server/app/api/worktrees/[id]/todos/[todoId]/route.js.nft.json +1 -1
  306. package/.next/server/app/api/worktrees/[id]/todos/[todoId]/route_client-reference-manifest.js +1 -1
  307. package/.next/server/app/api/worktrees/[id]/todos/route.js.nft.json +1 -1
  308. package/.next/server/app/api/worktrees/[id]/todos/route_client-reference-manifest.js +1 -1
  309. package/.next/server/app/api/worktrees/[id]/tree/[...path]/route.js.nft.json +1 -1
  310. package/.next/server/app/api/worktrees/[id]/tree/[...path]/route_client-reference-manifest.js +1 -1
  311. package/.next/server/app/api/worktrees/[id]/tree/route.js.nft.json +1 -1
  312. package/.next/server/app/api/worktrees/[id]/tree/route_client-reference-manifest.js +1 -1
  313. package/.next/server/app/api/worktrees/[id]/upload/[...path]/route.js.nft.json +1 -1
  314. package/.next/server/app/api/worktrees/[id]/upload/[...path]/route_client-reference-manifest.js +1 -1
  315. package/.next/server/app/api/worktrees/[id]/verify/config/route.js.nft.json +1 -1
  316. package/.next/server/app/api/worktrees/[id]/verify/config/route_client-reference-manifest.js +1 -1
  317. package/.next/server/app/api/worktrees/[id]/verify/route.js +1 -1
  318. package/.next/server/app/api/worktrees/[id]/verify/route.js.nft.json +1 -1
  319. package/.next/server/app/api/worktrees/[id]/verify/route_client-reference-manifest.js +1 -1
  320. package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/cancel/route.js +1 -1
  321. package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/cancel/route.js.nft.json +1 -1
  322. package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/cancel/route_client-reference-manifest.js +1 -1
  323. package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/route.js.nft.json +1 -1
  324. package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/route_client-reference-manifest.js +1 -1
  325. package/.next/server/app/api/worktrees/[id]/verify/runs/route.js.nft.json +1 -1
  326. package/.next/server/app/api/worktrees/[id]/verify/runs/route_client-reference-manifest.js +1 -1
  327. package/.next/server/app/api/worktrees/[id]/viewed/route.js.nft.json +1 -1
  328. package/.next/server/app/api/worktrees/[id]/viewed/route_client-reference-manifest.js +1 -1
  329. package/.next/server/app/api/worktrees/apply-default-agents/route.js.nft.json +1 -1
  330. package/.next/server/app/api/worktrees/apply-default-agents/route_client-reference-manifest.js +1 -1
  331. package/.next/server/app/api/worktrees/route.js +1 -1
  332. package/.next/server/app/api/worktrees/route.js.nft.json +1 -1
  333. package/.next/server/app/api/worktrees/route_client-reference-manifest.js +1 -1
  334. package/.next/server/app/login/page_client-reference-manifest.js +1 -1
  335. package/.next/server/app/manifest.webmanifest/route_client-reference-manifest.js +1 -1
  336. package/.next/server/app/more/page_client-reference-manifest.js +1 -1
  337. package/.next/server/app/offline/page_client-reference-manifest.js +1 -1
  338. package/.next/server/app/page_client-reference-manifest.js +1 -1
  339. package/.next/server/app/proxy/[...path]/route.js.nft.json +1 -1
  340. package/.next/server/app/proxy/[...path]/route_client-reference-manifest.js +1 -1
  341. package/.next/server/app/repositories/page_client-reference-manifest.js +1 -1
  342. package/.next/server/app/review/page_client-reference-manifest.js +1 -1
  343. package/.next/server/app/sessions/page.js +1 -1
  344. package/.next/server/app/sessions/page.js.nft.json +1 -1
  345. package/.next/server/app/sessions/page_client-reference-manifest.js +1 -1
  346. package/.next/server/app/skills/[skillId]/page.js +1 -1
  347. package/.next/server/app/skills/[skillId]/page.js.nft.json +1 -1
  348. package/.next/server/app/skills/[skillId]/page_client-reference-manifest.js +1 -1
  349. package/.next/server/app/skills/installed/page_client-reference-manifest.js +1 -1
  350. package/.next/server/app/skills/page_client-reference-manifest.js +1 -1
  351. package/.next/server/app/worktrees/[id]/files/[...path]/page.js +1 -1
  352. package/.next/server/app/worktrees/[id]/files/[...path]/page.js.nft.json +1 -1
  353. package/.next/server/app/worktrees/[id]/files/[...path]/page_client-reference-manifest.js +1 -1
  354. package/.next/server/app/worktrees/[id]/page.js +9 -9
  355. package/.next/server/app/worktrees/[id]/page.js.nft.json +1 -1
  356. package/.next/server/app/worktrees/[id]/page_client-reference-manifest.js +1 -1
  357. package/.next/server/app/worktrees/[id]/terminal/page.js +1 -1
  358. package/.next/server/app/worktrees/[id]/terminal/page.js.nft.json +1 -1
  359. package/.next/server/app/worktrees/[id]/terminal/page_client-reference-manifest.js +1 -1
  360. package/.next/server/app-paths-manifest.json +34 -34
  361. package/.next/server/chunks/1068.js +1 -1
  362. package/.next/server/chunks/1210.js +1 -1
  363. package/.next/server/chunks/1501.js +3 -3
  364. package/.next/server/chunks/2119.js +1 -1
  365. package/.next/server/chunks/22.js +1 -1
  366. package/.next/server/chunks/2283.js +15 -0
  367. package/.next/server/chunks/2328.js +1 -1
  368. package/.next/server/chunks/2404.js +4 -3
  369. package/.next/server/chunks/2445.js +1 -1
  370. package/.next/server/chunks/252.js +1 -1
  371. package/.next/server/chunks/2816.js +1 -1
  372. package/.next/server/chunks/3543.js +1 -1
  373. package/.next/server/chunks/3730.js +1 -1
  374. package/.next/server/chunks/3945.js +1 -1
  375. package/.next/server/chunks/4207.js +3 -3
  376. package/.next/server/chunks/4802.js +1 -1
  377. package/.next/server/chunks/488.js +1 -0
  378. package/.next/server/chunks/5064.js +1 -1
  379. package/.next/server/chunks/5326.js +1 -1
  380. package/.next/server/chunks/5456.js +1 -1
  381. package/.next/server/chunks/5571.js +1 -1
  382. package/.next/server/chunks/5775.js +1 -1
  383. package/.next/server/chunks/611.js +1 -1
  384. package/.next/server/chunks/6130.js +1 -1
  385. package/.next/server/chunks/6285.js +1 -1
  386. package/.next/server/chunks/6401.js +1 -1
  387. package/.next/server/chunks/6474.js +14 -0
  388. package/.next/server/chunks/650.js +1 -1
  389. package/.next/server/chunks/6661.js +1 -1
  390. package/.next/server/chunks/6781.js +1 -1
  391. package/.next/server/chunks/6793.js +1 -1
  392. package/.next/server/chunks/6927.js +1 -0
  393. package/.next/server/chunks/7491.js +3 -0
  394. package/.next/server/chunks/7506.js +1 -1
  395. package/.next/server/chunks/7685.js +1 -1
  396. package/.next/server/chunks/7905.js +1 -1
  397. package/.next/server/chunks/8543.js +1 -1
  398. package/.next/server/chunks/8581.js +2 -2
  399. package/.next/server/chunks/8728.js +2 -2
  400. package/.next/server/chunks/8782.js +1 -0
  401. package/.next/server/chunks/8791.js +1 -1
  402. package/.next/server/chunks/8800.js +4 -3
  403. package/.next/server/chunks/8918.js +108 -6
  404. package/.next/server/chunks/9130.js +3 -3
  405. package/.next/server/chunks/{8052.js → 9353.js} +4 -2
  406. package/.next/server/chunks/9390.js +3 -0
  407. package/.next/server/chunks/9627.js +3 -3
  408. package/.next/server/chunks/967.js +1 -0
  409. package/.next/server/chunks/9731.js +3 -3
  410. package/.next/server/chunks/9882.js +3 -3
  411. package/.next/server/middleware-manifest.json +5 -5
  412. package/.next/server/pages/500.html +1 -1
  413. package/.next/server/pages-manifest.json +1 -1
  414. package/.next/server/server-reference-manifest.json +1 -1
  415. package/.next/server/src/middleware.js +2 -2
  416. package/.next/server/src/middleware.js.map +1 -1
  417. package/.next/static/chunks/2053-85a974ddfe7498fe.js +1 -0
  418. package/.next/static/chunks/{2407-6b9e12c099fa598c.js → 2407-340774f1a24f2b45.js} +1 -1
  419. package/.next/static/chunks/5449-6cb80bab2bd06b79.js +1 -0
  420. package/.next/static/chunks/5521-c358c31f60e5e689.js +1 -0
  421. package/.next/static/chunks/591-0a45801e83f26f24.js +1 -0
  422. package/.next/static/chunks/8165-3853772f6ae1299b.js +1 -0
  423. package/.next/static/chunks/{8566-a6a7c70558927410.js → 8566-aeda747542072ace.js} +1 -1
  424. package/.next/static/chunks/8811-29eaa24237f48558.js +1 -0
  425. package/.next/static/chunks/{9619-22adf5367c4b7080.js → 9619-84aced0846cbe3ac.js} +1 -1
  426. package/.next/static/chunks/app/{layout-5b95e1236dcd9ef6.js → layout-0fc249fb7de75a27.js} +1 -1
  427. package/.next/static/chunks/app/review/page-ff9efae3f86eb840.js +1 -0
  428. package/.next/static/chunks/app/sessions/page-55297155e7bf01b9.js +1 -0
  429. package/.next/static/chunks/app/skills/[skillId]/page-9ee7a381636e60cb.js +1 -0
  430. package/.next/static/chunks/app/skills/page-182e16168b2fc098.js +1 -0
  431. package/.next/static/chunks/app/worktrees/[id]/page-d2103e0c25be83c8.js +1 -0
  432. package/.next/static/css/38070d879efa1371.css +1 -0
  433. package/.next/trace +13 -13
  434. package/README.md +58 -620
  435. package/dist/cli/commands/ask.d.ts.map +1 -1
  436. package/dist/cli/commands/ask.js +23 -149
  437. package/dist/cli/commands/capture.d.ts.map +1 -1
  438. package/dist/cli/commands/capture.js +11 -1
  439. package/dist/cli/commands/docs.d.ts.map +1 -1
  440. package/dist/cli/commands/docs.js +5 -0
  441. package/dist/cli/commands/remote.d.ts +24 -1
  442. package/dist/cli/commands/remote.d.ts.map +1 -1
  443. package/dist/cli/commands/remote.js +155 -6
  444. package/dist/cli/commands/reply.d.ts +40 -0
  445. package/dist/cli/commands/reply.d.ts.map +1 -0
  446. package/dist/cli/commands/reply.js +133 -0
  447. package/dist/cli/commands/respond.d.ts.map +1 -1
  448. package/dist/cli/commands/respond.js +255 -112
  449. package/dist/cli/commands/stop.d.ts.map +1 -1
  450. package/dist/cli/commands/stop.js +53 -1
  451. package/dist/cli/commands/sync.js +3 -3
  452. package/dist/cli/commands/wait.d.ts +5 -0
  453. package/dist/cli/commands/wait.d.ts.map +1 -1
  454. package/dist/cli/commands/wait.js +10 -1
  455. package/dist/cli/docs/agent-operations.d.ts +2 -2
  456. package/dist/cli/docs/agent-operations.d.ts.map +1 -1
  457. package/dist/cli/docs/agent-operations.js +13 -0
  458. package/dist/cli/docs/setup-guide.d.ts +14 -0
  459. package/dist/cli/docs/setup-guide.d.ts.map +1 -0
  460. package/dist/cli/docs/setup-guide.js +366 -0
  461. package/dist/cli/program.d.ts.map +1 -1
  462. package/dist/cli/program.js +4 -0
  463. package/dist/cli/types/api-responses.d.ts +11 -0
  464. package/dist/cli/types/api-responses.d.ts.map +1 -1
  465. package/dist/cli/types/index.d.ts +2 -0
  466. package/dist/cli/types/index.d.ts.map +1 -1
  467. package/dist/cli/utils/daemon.d.ts +42 -2
  468. package/dist/cli/utils/daemon.d.ts.map +1 -1
  469. package/dist/cli/utils/daemon.js +222 -40
  470. package/dist/cli/utils/docs-reader.d.ts +6 -0
  471. package/dist/cli/utils/docs-reader.d.ts.map +1 -1
  472. package/dist/cli/utils/docs-reader.js +14 -13
  473. package/dist/cli/utils/npm-runner.d.ts +12 -0
  474. package/dist/cli/utils/npm-runner.d.ts.map +1 -1
  475. package/dist/cli/utils/npm-runner.js +36 -0
  476. package/dist/cli/utils/process-inspect.d.ts +55 -0
  477. package/dist/cli/utils/process-inspect.d.ts.map +1 -0
  478. package/dist/cli/utils/process-inspect.js +214 -0
  479. package/dist/cli/utils/remote-pairing.d.ts +68 -0
  480. package/dist/cli/utils/remote-pairing.d.ts.map +1 -0
  481. package/dist/cli/utils/remote-pairing.js +117 -0
  482. package/dist/cli/utils/reply-ledger.d.ts +95 -0
  483. package/dist/cli/utils/reply-ledger.d.ts.map +1 -0
  484. package/dist/cli/utils/reply-ledger.js +187 -0
  485. package/dist/cli/utils/server-identity.d.ts +50 -0
  486. package/dist/cli/utils/server-identity.d.ts.map +1 -0
  487. package/dist/cli/utils/server-identity.js +118 -0
  488. package/dist/cli/utils/server-ready.d.ts +13 -0
  489. package/dist/cli/utils/server-ready.d.ts.map +1 -1
  490. package/dist/cli/utils/server-ready.js +16 -0
  491. package/dist/lib/cli-tools/copilot-executable.d.ts +9 -0
  492. package/dist/lib/cli-tools/copilot-executable.d.ts.map +1 -1
  493. package/dist/lib/cli-tools/copilot-executable.js +21 -5
  494. package/dist/lib/cli-tools/opencode-executable.d.ts +103 -0
  495. package/dist/lib/cli-tools/opencode-executable.d.ts.map +1 -0
  496. package/dist/lib/cli-tools/opencode-executable.js +179 -0
  497. package/dist/lib/cli-tools/types.d.ts +1 -1
  498. package/dist/lib/cli-tools/types.d.ts.map +1 -1
  499. package/dist/lib/cli-tools/types.js +5 -1
  500. package/dist/lib/detection/tools/verified-against.d.ts +15 -0
  501. package/dist/lib/detection/tools/verified-against.d.ts.map +1 -1
  502. package/dist/lib/detection/tools/verified-against.js +17 -1
  503. package/dist/lib/detection/version-probes.d.ts.map +1 -1
  504. package/dist/lib/detection/version-probes.js +14 -1
  505. package/dist/lib/security/pairing-code.d.ts +2 -1
  506. package/dist/lib/security/pairing-code.d.ts.map +1 -1
  507. package/dist/lib/session/tmux-session-surface.d.ts.map +1 -1
  508. package/dist/lib/session/tmux-session-surface.js +1 -1
  509. package/dist/server/locales/en/worktree.json +72 -20
  510. package/dist/server/locales/ja/worktree.json +72 -20
  511. package/dist/server/server.js +23 -0
  512. package/dist/server/src/config/cli-tool-timing-config.js +19 -1
  513. package/dist/server/src/config/detection-evidence-config.js +3 -0
  514. package/dist/server/src/config/image-extensions.js +1 -0
  515. package/dist/server/src/config/schedule-config.js +55 -1
  516. package/dist/server/src/lib/auto-yes-poller.js +69 -4
  517. package/dist/server/src/lib/cli-tools/agent-mode-spec.js +54 -2
  518. package/dist/server/src/lib/cli-tools/base.js +6 -2
  519. package/dist/server/src/lib/cli-tools/command-code-plan-review.js +175 -0
  520. package/dist/server/src/lib/cli-tools/command-code.js +81 -2
  521. package/dist/server/src/lib/cli-tools/composer-spec.js +10 -0
  522. package/dist/server/src/lib/cli-tools/copilot-executable.js +21 -5
  523. package/dist/server/src/lib/cli-tools/graceful-exit.js +15 -1
  524. package/dist/server/src/lib/cli-tools/index.js +3 -1
  525. package/dist/server/src/lib/cli-tools/install-hints.js +9 -3
  526. package/dist/server/src/lib/cli-tools/liveness-spec.js +19 -0
  527. package/dist/server/src/lib/cli-tools/manager.js +2 -0
  528. package/dist/server/src/lib/cli-tools/opencode-executable.js +179 -0
  529. package/dist/server/src/lib/cli-tools/opencode-v2.js +369 -0
  530. package/dist/server/src/lib/cli-tools/opencode.js +29 -5
  531. package/dist/server/src/lib/cli-tools/types.js +5 -1
  532. package/dist/server/src/lib/cmate-cli-tool-parser.js +65 -7
  533. package/dist/server/src/lib/cmate-parser.js +12 -0
  534. package/dist/server/src/lib/cmate-validator.js +13 -1
  535. package/dist/server/src/lib/detection/cli-patterns.js +172 -3
  536. package/dist/server/src/lib/detection/model-info-extractor.js +79 -7
  537. package/dist/server/src/lib/detection/status-detector.js +10 -1
  538. package/dist/server/src/lib/detection/tools/codex/cli-patterns.js +2 -1
  539. package/dist/server/src/lib/detection/tools/codex/detect.js +26 -0
  540. package/dist/server/src/lib/detection/tools/command-code/plan-review-state.js +75 -0
  541. package/dist/server/src/lib/detection/tools/opencode-v2/detect.js +253 -0
  542. package/dist/server/src/lib/detection/tools/opencode-v2/dialog-title.js +48 -0
  543. package/dist/server/src/lib/detection/tools/registry.js +2 -0
  544. package/dist/server/src/lib/detection/tools/run-detection.js +9 -0
  545. package/dist/server/src/lib/detection/tools/verified-against.js +17 -1
  546. package/dist/server/src/lib/detection/upstream-faults.js +8 -0
  547. package/dist/server/src/lib/detection/version-probes.js +14 -1
  548. package/dist/server/src/lib/hooks/agent-session-telemetry.js +36 -1
  549. package/dist/server/src/lib/hooks/sources/claude/transcript.js +33 -1
  550. package/dist/server/src/lib/hooks/sources/opencode/log-diagnosis.js +105 -0
  551. package/dist/server/src/lib/hooks/sources/opencode/source.js +7 -1
  552. package/dist/server/src/lib/hooks/sources/opencode-v2/client.js +422 -0
  553. package/dist/server/src/lib/hooks/sources/opencode-v2/decision-labels.js +24 -0
  554. package/dist/server/src/lib/hooks/sources/opencode-v2/history.js +421 -0
  555. package/dist/server/src/lib/hooks/sources/opencode-v2/ingest.js +271 -0
  556. package/dist/server/src/lib/hooks/sources/opencode-v2/mappers.js +165 -0
  557. package/dist/server/src/lib/hooks/sources/opencode-v2/payloads.js +351 -0
  558. package/dist/server/src/lib/hooks/sources/opencode-v2/ports.js +230 -0
  559. package/dist/server/src/lib/hooks/sources/opencode-v2/reattach.js +149 -0
  560. package/dist/server/src/lib/hooks/sources/opencode-v2/runtime.js +180 -0
  561. package/dist/server/src/lib/hooks/sources/opencode-v2/secrets.js +182 -0
  562. package/dist/server/src/lib/hooks/sources/opencode-v2/source.js +295 -0
  563. package/dist/server/src/lib/hooks/sources/opencode-v2/subscription.js +455 -0
  564. package/dist/server/src/lib/hooks/sources/opencode-v2/tool-id.js +18 -0
  565. package/dist/server/src/lib/hooks/sources/opencode-v2/usage.js +214 -0
  566. package/dist/server/src/lib/hooks/sources/registry.js +2 -0
  567. package/dist/server/src/lib/hooks/structured-decision-response.js +14 -5
  568. package/dist/server/src/lib/job-executor.js +2 -1
  569. package/dist/server/src/lib/polling/auto-yes-dialog-gate.js +15 -1
  570. package/dist/server/src/lib/polling/structured-history-gate.js +19 -5
  571. package/dist/server/src/lib/relay/relay-delivery.js +4 -1
  572. package/dist/server/src/lib/session/agent-event-state.js +24 -0
  573. package/dist/server/src/lib/session/claude-executor.js +186 -12
  574. package/dist/server/src/lib/session/claude-session.js +131 -15
  575. package/dist/server/src/lib/session/current-output-builder.js +27 -3
  576. package/dist/server/src/lib/session/send-user-message.js +4 -0
  577. package/dist/server/src/lib/session/session-start-error.js +20 -0
  578. package/dist/server/src/lib/session/structured-prompt.js +54 -0
  579. package/dist/server/src/lib/session/tmux-session-surface.js +1 -1
  580. package/dist/server/src/lib/skills/agent-state-paths.js +39 -0
  581. package/dist/server/src/lib/skills/compatibility-matrix.js +65 -0
  582. package/dist/server/src/lib/skills/receipt-owned-paths.js +118 -0
  583. package/dist/server/src/lib/tmux/tmux.js +73 -2
  584. package/dist/server/src/lib/verification/env-clean-gate.js +281 -10
  585. package/dist/server/src/lib/verification/gate-runner.js +29 -2
  586. package/dist/server/src/lib/verification/scope-gate.js +58 -4
  587. package/dist/server/src/types/cli-tool-contracts.js +10 -2
  588. package/dist/types/cli-tool-contracts.d.ts +16 -5
  589. package/dist/types/cli-tool-contracts.d.ts.map +1 -1
  590. package/dist/types/cli-tool-contracts.js +10 -2
  591. package/docs/en/architecture.md +722 -0
  592. package/docs/en/user-guide/agents-guide.md +306 -0
  593. package/docs/en/user-guide/cli-setup-guide.md +676 -0
  594. package/docs/en/user-guide/cmate-schedules-guide.md +388 -0
  595. package/docs/en/user-guide/commands-guide.md +467 -0
  596. package/docs/en/user-guide/quick-start.md +231 -0
  597. package/docs/en/user-guide/webapp-guide.md +1020 -0
  598. package/docs/en/user-guide/workflow-examples.md +463 -0
  599. package/package.json +19 -7
  600. package/release-notes/0.43.0.json +130 -0
  601. package/release-notes/0.44.0.json +82 -0
  602. package/scripts/hooks/cmate-agent-event.sh +14 -0
  603. package/scripts/opencode-v2/launch.sh +226 -0
  604. package/.next/server/chunks/1990.js +0 -103
  605. package/.next/server/chunks/3707.js +0 -15
  606. package/.next/server/chunks/4443.js +0 -3
  607. package/.next/server/chunks/5164.js +0 -1
  608. package/.next/server/chunks/5742.js +0 -1
  609. package/.next/server/chunks/7004.js +0 -1
  610. package/.next/server/chunks/8673.js +0 -14
  611. package/.next/static/chunks/2039-117a361f795ddc4b.js +0 -1
  612. package/.next/static/chunks/2053-611dd27d42721b79.js +0 -1
  613. package/.next/static/chunks/3778-56f41fc2cecb8c43.js +0 -1
  614. package/.next/static/chunks/5449-550bd273dccc3ae4.js +0 -1
  615. package/.next/static/chunks/7705-2a2936551b0cf9a3.js +0 -1
  616. package/.next/static/chunks/8165-934ee7ff3b4ddfd4.js +0 -1
  617. package/.next/static/chunks/app/review/page-30616daa1dc595c2.js +0 -1
  618. package/.next/static/chunks/app/sessions/page-1a8ba152bbcb9efb.js +0 -1
  619. package/.next/static/chunks/app/skills/[skillId]/page-ab7e432b69fccb3b.js +0 -1
  620. package/.next/static/chunks/app/skills/page-56b4fa11223e0cbd.js +0 -1
  621. package/.next/static/chunks/app/worktrees/[id]/page-59f5337e031518c6.js +0 -1
  622. package/.next/static/css/b3f433d52b8ed5c8.css +0 -1
  623. /package/.next/static/{MXZXkcFAnpELZnxxHB4iJ → wu7SUiHTirFcrpo5teyZ3}/_buildManifest.js +0 -0
  624. /package/.next/static/{MXZXkcFAnpELZnxxHB4iJ → wu7SUiHTirFcrpo5teyZ3}/_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;AAsVpC,wBAAgB,gBAAgB,IAAI,OAAO,CA6N1C"}
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;AA4LpC,wBAAgB,gBAAgB,IAAI,OAAO,CA0O1C"}
@@ -36,6 +36,7 @@ const commander_1 = require("commander");
36
36
  const types_1 = require("../types");
37
37
  const api_client_1 = require("../utils/api-client");
38
38
  const command_helpers_1 = require("../utils/command-helpers");
39
+ const reply_ledger_1 = require("../utils/reply-ledger");
39
40
  const cli_tool_ids_1 = require("../config/cli-tool-ids");
40
41
  const agent_target_options_1 = require("../config/agent-target-options");
41
42
  const instances_1 = require("./instances");
@@ -52,60 +53,8 @@ const relays_1 = require("./relays");
52
53
  const PROMPT_WAITING_CODE = 'PROMPT_WAITING';
53
54
  /** Default `--timeout`, in seconds. Matches the GUI's delegation brief. */
54
55
  const DEFAULT_ASK_TIMEOUT_SECONDS = 1800;
55
- /**
56
- * Chat rows read back after the turn.
57
- *
58
- * Bounded because only the tail matters and an unbounded read of a long-running
59
- * worktree's history is a large response for one line of answer. Generous
60
- * enough that a turn which wrote several assistant rows (a tool-use narration
61
- * followed by the summary) still has its last one inside the window.
62
- */
63
- const REPLY_LOOKBACK_MESSAGES = 30;
64
56
  /** Squeezed pane lines kept for the fallback reply. */
65
57
  const PANE_FALLBACK_TAIL = 80;
66
- /**
67
- * The `request_id` namespace every transcript reader mints for a turn.
68
- *
69
- * `codex-turn:<turn_id>`, `claude-turn:<uuid>`, `antigravity-turn:<id>`,
70
- * `command-code-turn:<id>` and opencode's `oc-turn:<msg id>` — mirrored here as
71
- * a shape rather than imported, for the reason {@link PROMPT_WAITING_CODE}
72
- * gives: the CLI bundle keeps its own copies of API strings instead of pulling
73
- * `src/types/agent-transcript.ts` and its dependents into `build:cli`. Matching
74
- * the shape rather than a list of five literals is also what stops the sixth
75
- * reader from silently landing outside the filter.
76
- *
77
- * A `:` cannot appear in any of the ids themselves, so this cannot match a row
78
- * that merely CONTAINS the text.
79
- */
80
- const TURN_REQUEST_ID_PATTERN = /-turn:/;
81
- /**
82
- * Request-id namespaces CommandMate writes about a session, not for it.
83
- *
84
- * `chat_messages` has no `system` role, so "the model changed" (Issue #2357)
85
- * and "reply from X" (Issue #2377) are both stored as ASSISTANT rows and told
86
- * apart by their request id. Neither is anything the other session said, and
87
- * delivering the relay notice back as an answer is the smallest possible loop —
88
- * `findWorkerReply` steps over the same rows for the same reason.
89
- */
90
- const SYSTEM_ROW_REQUEST_ID_PREFIXES = ['relay-sys:', 'model-changed:'];
91
- /**
92
- * Tools whose reply CommandMate reads out of a transcript rather than a screen.
93
- *
94
- * For these five the ledger is authoritative and a row with no turn marker is
95
- * by definition not the answer, so `ask` may hold out for a marked one. For
96
- * every other tool (copilot / gemini / vibe-local) the scraper's row is the
97
- * only record there will ever be, and demanding a marker would throw away a
98
- * cleaned reply in favour of the raw pane.
99
- *
100
- * Mirrors the five readers that live under `src/lib/hooks/sources/`.
101
- */
102
- const TRANSCRIPT_READER_TOOLS = new Set([
103
- 'claude',
104
- 'codex',
105
- 'antigravity',
106
- 'command-code',
107
- 'opencode',
108
- ]);
109
58
  /**
110
59
  * How long `ask` will hold out for the turn row after the turn ends.
111
60
  *
@@ -123,90 +72,10 @@ const TRANSCRIPT_READER_TOOLS = new Set([
123
72
  const REPLY_TURN_ROW_GRACE_MS = 15_000;
124
73
  /** How often the grace above re-reads the ledger. */
125
74
  const REPLY_TURN_ROW_POLL_MS = 1_000;
126
- /**
127
- * ANSI escape sequences, as a pattern built from escapes rather than literals.
128
- *
129
- * `scripts/check-control-chars.mjs` fails the build on a raw C0 byte in `src/`
130
- * (Issue #1432), and a raw ESC here would be one.
131
- */
132
- const ANSI_ESCAPE_PATTERN = /[\u001B\u009B][[\]()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-PR-TZcf-nqry=><]/g;
133
- /** Remaining C0/C1 control bytes, once the sequences above are gone. */
134
- const CONTROL_CHAR_PATTERN = /[\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F-\u009F]/g;
135
75
  /** Sleep, for the grace window above. */
136
76
  function sleep(ms) {
137
77
  return new Promise((resolve) => setTimeout(resolve, ms));
138
78
  }
139
- /**
140
- * A reply body fit to print, or `''` if nothing survived.
141
- *
142
- * Issue #2386 asked for this as a belt to the braces: the row the junk came
143
- * from held RAW ANSI, and a caller that pipes `ask` into a report or a commit
144
- * message should never have to strip escape codes out of an agent's sentence.
145
- * Applied to the pane fallback as well as to the ledger, because the pane is
146
- * the more likely of the two to carry them.
147
- *
148
- * @param raw - Reply text as it arrived
149
- */
150
- function sanitizeReply(raw) {
151
- return raw.replace(ANSI_ESCAPE_PATTERN, '').replace(CONTROL_CHAR_PATTERN, '').trim();
152
- }
153
- /** Whether a row's `request_id` says a transcript reader wrote it. */
154
- function isTurnRow(requestId) {
155
- return typeof requestId === 'string' && TURN_REQUEST_ID_PATTERN.test(requestId);
156
- }
157
- /** Whether a row is CommandMate's own furniture rather than the agent's words. */
158
- function isSystemRow(requestId) {
159
- return typeof requestId === 'string'
160
- && SYSTEM_ROW_REQUEST_ID_PREFIXES.some((prefix) => requestId.startsWith(prefix));
161
- }
162
- /**
163
- * The rows that could be this turn's reply, oldest first.
164
- *
165
- * @param messages - Rows as the messages route serialized them
166
- * @param since - Epoch ms taken immediately before the send
167
- */
168
- function replyCandidates(messages, since) {
169
- const candidates = [];
170
- for (const m of messages) {
171
- if (m.role !== 'assistant')
172
- continue;
173
- if (m.messageType === 'prompt')
174
- continue;
175
- if (typeof m.content !== 'string')
176
- continue;
177
- if (!(Date.parse(m.timestamp) >= since))
178
- continue;
179
- if (isSystemRow(m.requestId))
180
- continue;
181
- const content = sanitizeReply(m.content);
182
- if (content === '')
183
- continue;
184
- candidates.push({ content, fromTranscript: isTurnRow(m.requestId) });
185
- }
186
- return candidates;
187
- }
188
- /**
189
- * The recent chat rows for this instance, or null if they cannot be read.
190
- *
191
- * @param client - API client
192
- * @param worktreeId - Worktree ID
193
- * @param instanceId - Resolved instance ID
194
- */
195
- async function fetchRecentMessages(client, worktreeId, instanceId) {
196
- const query = new URLSearchParams({ limit: String(REPLY_LOOKBACK_MESSAGES) });
197
- if (instanceId)
198
- query.set('instance', instanceId);
199
- try {
200
- // PromptMessageResponse is the CLI's mirror of a serialized chat row; the
201
- // `messageType: 'prompt'` filter is the caller's, not the type's, so it is
202
- // the right shape for reading normal rows too.
203
- const messages = await client.get(`/api/worktrees/${worktreeId}/messages?${query.toString()}`);
204
- return Array.isArray(messages) ? messages : null;
205
- }
206
- catch {
207
- return null;
208
- }
209
- }
210
79
  /**
211
80
  * Parse and validate `--timeout <seconds>`.
212
81
  *
@@ -265,24 +134,16 @@ function parseTimeout(raw) {
265
134
  * @param cliToolId - Resolved CLI tool, when one is known
266
135
  */
267
136
  async function readLatestReply(client, worktreeId, instanceId, since, cliToolId) {
268
- const requireTurnRow = cliToolId !== undefined && TRANSCRIPT_READER_TOOLS.has(cliToolId);
137
+ const requireTurnRow = cliToolId !== undefined && reply_ledger_1.TRANSCRIPT_READER_TOOLS.has(cliToolId);
269
138
  const deadline = Date.now() + (requireTurnRow ? REPLY_TURN_ROW_GRACE_MS : 0);
270
139
  for (;;) {
271
- const messages = await fetchRecentMessages(client, worktreeId, instanceId);
272
- const candidates = replyCandidates(messages ?? [], since);
273
- // Newest first among the rows a reader wrote. A turn that emitted several
274
- // assistant rows (a narration then the summary) still ends on its summary.
275
- for (let i = candidates.length - 1; i >= 0; i -= 1) {
276
- if (candidates[i].fromTranscript)
277
- return candidates[i].content;
278
- }
279
- if (!requireTurnRow) {
280
- // Unchanged behaviour for a tool with no transcript: the newest row after
281
- // the send, marker or not.
282
- const newest = candidates[candidates.length - 1];
283
- return newest ? newest.content : null;
284
- }
285
- if (Date.now() >= deadline)
140
+ const messages = await (0, reply_ledger_1.fetchRecentMessages)(client, worktreeId, instanceId);
141
+ // The rules are `reply`'s too (Issue #3039). A tool with no transcript
142
+ // takes the newest row after the send, marker or not, with no wait.
143
+ const reply = (0, reply_ledger_1.pickLatestReply)((0, reply_ledger_1.replyCandidates)(messages ?? [], since), requireTurnRow);
144
+ if (reply)
145
+ return reply.content;
146
+ if (!requireTurnRow || Date.now() >= deadline)
286
147
  return null;
287
148
  await sleep(REPLY_TURN_ROW_POLL_MS);
288
149
  }
@@ -332,6 +193,9 @@ Exit codes (wait's, unchanged; --async always exits 0 once the relay exists):
332
193
  (same shape as \`wait --on-prompt agent\`). Report it; do NOT answer it
333
194
  with \`respond\` on the other session's behalf — the number that resolves
334
195
  a dialog is the dialog's own, and a wrong one picks the default (#1681).
196
+ 11 the turn never ran: an upstream fault is on the screen. stderr and --json
197
+ name it (id=...). id=context-limit: the conversation is over the model's
198
+ limit; \`instances <id> kill <instance>\` and ask again in a fresh session
335
199
  21 nothing was running to ask
336
200
  124 timed out. Look with \`capture <id> --instance <id> --pane --tail 60\`
337
201
 
@@ -453,6 +317,8 @@ a decision about that session's guard rails, not part of asking it a question.
453
317
  timeout,
454
318
  instance: instanceId,
455
319
  token: options.token,
320
+ // Always on (Issue #3011): a turn that never ran must not read as a reply.
321
+ failOnUpstreamFault: true,
456
322
  });
457
323
  if (result.exitCode !== types_1.WaitExitCode.SUCCESS) {
458
324
  // Same stdout contract as `wait`: the prompt payload, and nothing
@@ -460,6 +326,14 @@ a decision about that session's guard rails, not part of asking it a question.
460
326
  if (result.output) {
461
327
  console.log(JSON.stringify(result.output));
462
328
  }
329
+ if (result.upstreamFault && options.json) {
330
+ console.log(JSON.stringify({
331
+ worktreeId,
332
+ instanceId: instanceId ?? null,
333
+ cliToolId: agent ?? null,
334
+ upstreamFault: result.upstreamFault,
335
+ }, null, 2));
336
+ }
463
337
  process.exit(result.exitCode);
464
338
  return;
465
339
  }
@@ -468,7 +342,7 @@ a decision about that session's guard rails, not part of asking it a question.
468
342
  if (reply === null && agent) {
469
343
  source = 'pane';
470
344
  const pane = await readPaneTail(client, worktreeId, agent, instanceId);
471
- const cleaned = pane === null ? '' : sanitizeReply(pane);
345
+ const cleaned = pane === null ? '' : (0, reply_ledger_1.sanitizeReply)(pane);
472
346
  reply = cleaned === '' ? null : cleaned;
473
347
  }
474
348
  if (reply === null) {
@@ -1 +1 @@
1
- {"version":3,"file":"capture.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/capture.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,OAAO,EAAE,SAAS,EAAqB,MAAM,qBAAqB,CAAC;AAmVnE;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,SAAS,EACjB,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAexB;AA2ED,wBAAgB,oBAAoB,IAAI,OAAO,CA8H9C"}
1
+ {"version":3,"file":"capture.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/capture.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,OAAO,EAAE,SAAS,EAAqB,MAAM,qBAAqB,CAAC;AAwVnE;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,SAAS,EACjB,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAexB;AA2ED,wBAAgB,oBAAoB,IAAI,OAAO,CAoI9C"}
@@ -46,6 +46,9 @@ const MAX_FOLLOW_INTERVAL_MS = 60_000;
46
46
  * keeps its own copy of the API shapes (see api-responses.ts).
47
47
  */
48
48
  const UNCLASSIFIED_FRAME_TYPE = 'unclassified';
49
+ /** Shown by the default text mode when there is no transcript to print (Issue #3128). */
50
+ const EMPTY_TRANSCRIPT_HINT = 'No transcript yet. A prompt (e.g. "Trust this folder?") may be waiting on screen; '
51
+ + 'read it with `commandmate capture <worktree-id> --instance <instance> --pane --tail 40`.';
49
52
  /**
50
53
  * Format capture output as JSON (excluding fullOutput for size).
51
54
  *
@@ -493,7 +496,14 @@ function createCaptureCommand() {
493
496
  }
494
497
  else {
495
498
  // Default: plain text output (content field)
496
- console.log(data.content);
499
+ // Issue #3128: no transcript yet (e.g. a trust-folder dialog before the
500
+ // first turn) reads as a dead session. Point at the pane, where it shows.
501
+ if (data.content.trim() === '') {
502
+ console.log(EMPTY_TRANSCRIPT_HINT);
503
+ }
504
+ else {
505
+ console.log(data.content);
506
+ }
497
507
  }
498
508
  }
499
509
  catch (error) {
@@ -1 +1 @@
1
- {"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/docs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAiDpC;;;GAGG;AACH,wBAAgB,iBAAiB,IAAI,OAAO,CA8E3C"}
1
+ {"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/docs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAsDpC;;;GAGG;AACH,wBAAgB,iBAAiB,IAAI,OAAO,CA8E3C"}
@@ -20,6 +20,7 @@ const commander_1 = require("commander");
20
20
  const types_1 = require("../types");
21
21
  const docs_reader_1 = require("../utils/docs-reader");
22
22
  const agent_operations_1 = require("../docs/agent-operations");
23
+ const setup_guide_1 = require("../docs/setup-guide");
23
24
  /**
24
25
  * Sections this command carries itself (Issue #2376).
25
26
  *
@@ -32,9 +33,13 @@ const agent_operations_1 = require("../docs/agent-operations");
32
33
  *
33
34
  * The next change to touch `docs-reader.ts` should fold this into
34
35
  * `EMBEDDED_SECTIONS` and delete the three branches below.
36
+ *
37
+ * `setup` (Issue #3059) is the agent-facing setup guide, served on the site as
38
+ * `website/setup.md`; registered here for the same reason as `delegation`.
35
39
  */
36
40
  const LOCAL_SECTIONS = {
37
41
  delegation: agent_operations_1.AGENT_DELEGATION_GUIDE,
42
+ setup: setup_guide_1.SETUP_GUIDE,
38
43
  };
39
44
  /** Every section name, the reader's plus {@link LOCAL_SECTIONS}. */
40
45
  function allSectionNames() {
@@ -5,6 +5,7 @@
5
5
  * commandmate remote # up (default): start, publish, show the QR
6
6
  * commandmate remote status # Provider / URL / expiry / pairing state
7
7
  * commandmate remote stop # close the door, keeping the server running
8
+ * commandmate remote pair # show a new pairing link, same URL (Issue #3127)
8
9
  *
9
10
  * commandmate remote --auth remote-only # only the phone's route authenticates
10
11
  *
@@ -301,6 +302,28 @@ export declare function formatRemaining(ms: number): string;
301
302
  * @returns The exit code the caller should terminate with
302
303
  */
303
304
  export declare function runRemoteStatus(options: RemoteOptions): Promise<ExitCode>;
305
+ /**
306
+ * Printed with every re-issued link (Issue #3127). The link may stay behind in
307
+ * an agent's chat history, so its limits are said next to it.
308
+ */
309
+ export declare const PAIRING_LINK_NOTICE: string;
310
+ /**
311
+ * `remote pair`: show a new pairing link for the live session (Issue #3127).
312
+ *
313
+ * The plaintext code from `remote up` is never stored, so "show it again"
314
+ * means minting a replacement and swapping its hash into the existing handoff
315
+ * file (`reissuePairingCode`). The server, the Provider and the published URL
316
+ * are left exactly as they are — no new way in is opened — and the session
317
+ * token is never printed: the only secret in the output is the one-time code.
318
+ *
319
+ * Refused unless the code is still unused: a consumed code means a device
320
+ * already holds the token, and an expired one closed its window on purpose.
321
+ * Both are answered with the `remote stop` -> `remote` route instead.
322
+ *
323
+ * @param options - Parsed command options (`--json`)
324
+ * @returns SUCCESS with a link, CONFIG_ERROR without one
325
+ */
326
+ export declare function runRemotePair(options: RemoteOptions): Promise<ExitCode>;
304
327
  /**
305
328
  * Run the `stop` flow (§6.3-4).
306
329
  *
@@ -321,7 +344,7 @@ export declare function runRemoteStop(options: RemoteOptions): Promise<ExitCode>
321
344
  * future caller (a `quickstart --remote`, say) would compose, exactly as
322
345
  * `runStart` / `startCommand` are split (#1195).
323
346
  *
324
- * @param action - `up` (default), `status` or `stop`
347
+ * @param action - `up` (default), `status`, `stop` or `pair`
325
348
  * @param options - Parsed command options
326
349
  */
327
350
  export declare function remoteCommand(action: string | undefined, options: RemoteOptions): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"remote.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/remote.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,QAAQ,EAAmB,MAAM,UAAU,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAW9C,OAAO,EAKL,KAAK,eAAe,EAErB,MAAM,uBAAuB,CAAC;AAI/B,OAAO,EAIL,KAAK,iBAAiB,EAEtB,KAAK,gBAAgB,EAEtB,MAAM,kBAAkB,CAAC;AAQ1B,iFAAiF;AACjF,eAAO,MAAM,sBAAsB,OAAO,CAAC;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BAAsB,aAAa,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,QAAQ,CAAC,CAkD7E;AAED;;;;;;;;;GASG;AACH,wBAAsB,aAAa,CACjC,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,OAAO,EAAE,aAAa,GACrB,OAAO,CAAC,IAAI,CAAC,CAiCf;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,IAAI,OAAO,CAwB7C"}
@@ -6,6 +6,7 @@
6
6
  * commandmate remote # up (default): start, publish, show the QR
7
7
  * commandmate remote status # Provider / URL / expiry / pairing state
8
8
  * commandmate remote stop # close the door, keeping the server running
9
+ * commandmate remote pair # show a new pairing link, same URL (Issue #3127)
9
10
  *
10
11
  * commandmate remote --auth remote-only # only the phone's route authenticates
11
12
  *
@@ -47,7 +48,7 @@
47
48
  * local session down along with the remote one (§5.3).
48
49
  */
49
50
  Object.defineProperty(exports, "__esModule", { value: true });
50
- exports.REMOTE_INGRESS_HOST = exports.DEFAULT_REMOTE_AUTH_SCOPE = exports.REMOTE_AUTH_SCOPES = exports.REMOTE_ONLY_LAUNCH_ENV_KEYS = exports.REMOTE_LAUNCH_ENV_KEYS = exports.PUBLIC_TUNNEL_PROVIDERS = exports.REMOTE_PROVIDER_ALIASES = exports.MAX_PAIRING_TTL_MS = exports.MIN_PAIRING_TTL_MS = exports.DEFAULT_PAIRING_EXPIRES = exports.DEFAULT_REMOTE_EXPIRES = void 0;
51
+ exports.PAIRING_LINK_NOTICE = exports.REMOTE_INGRESS_HOST = exports.DEFAULT_REMOTE_AUTH_SCOPE = exports.REMOTE_AUTH_SCOPES = exports.REMOTE_ONLY_LAUNCH_ENV_KEYS = exports.REMOTE_LAUNCH_ENV_KEYS = exports.PUBLIC_TUNNEL_PROVIDERS = exports.REMOTE_PROVIDER_ALIASES = exports.MAX_PAIRING_TTL_MS = exports.MIN_PAIRING_TTL_MS = exports.DEFAULT_PAIRING_EXPIRES = exports.DEFAULT_REMOTE_EXPIRES = void 0;
51
52
  exports.buildRemoteLaunchEnv = buildRemoteLaunchEnv;
52
53
  exports.applyRemoteLaunchEnv = applyRemoteLaunchEnv;
53
54
  exports.parsePairingDuration = parsePairingDuration;
@@ -60,6 +61,7 @@ exports.buildPairingUrl = buildPairingUrl;
60
61
  exports.derivePairingState = derivePairingState;
61
62
  exports.formatRemaining = formatRemaining;
62
63
  exports.runRemoteStatus = runRemoteStatus;
64
+ exports.runRemotePair = runRemotePair;
63
65
  exports.runRemoteStop = runRemoteStop;
64
66
  exports.remoteCommand = remoteCommand;
65
67
  exports.createRemoteCommand = createRemoteCommand;
@@ -72,9 +74,11 @@ const logger_1 = require("../utils/logger");
72
74
  const prompt_1 = require("../utils/prompt");
73
75
  const qr_terminal_1 = require("../utils/qr-terminal");
74
76
  const remote_state_1 = require("../utils/remote-state");
77
+ const remote_pairing_1 = require("../utils/remote-pairing");
75
78
  const server_url_1 = require("../utils/server-url");
76
79
  const security_logger_1 = require("../utils/security-logger");
77
80
  const server_ready_1 = require("../utils/server-ready");
81
+ const server_identity_1 = require("../utils/server-identity");
78
82
  const remote_1 = require("../../lib/remote");
79
83
  const auth_1 = require("../../lib/security/auth");
80
84
  const pairing_code_1 = require("../../lib/security/pairing-code");
@@ -410,7 +414,7 @@ function parseEndpoint(url) {
410
414
  const port = parsed.port ? parseInt(parsed.port, 10) : parsed.protocol === 'https:' ? 443 : 80;
411
415
  if (Number.isNaN(port))
412
416
  return null;
413
- return { host: parsed.hostname, port };
417
+ return { host: parsed.hostname, port, protocol: parsed.protocol === 'https:' ? 'https' : 'http' };
414
418
  }
415
419
  catch {
416
420
  return null;
@@ -619,6 +623,33 @@ async function runRemoteUp(options) {
619
623
  }
620
624
  logger.success(`Remote listener: ${exports.REMOTE_INGRESS_HOST}:${remoteIngressPort} (authentication required)`);
621
625
  }
626
+ // 6c. Issue #3087: a listening port is not proof that it is OUR server. An
627
+ // orphan from an earlier `start --daemon` (no authentication) can hold the
628
+ // port while the server started above dies on EADDRINUSE, and every TCP
629
+ // check passes against it. Before the irreversible step, the exact port to
630
+ // be published must refuse an unknown token (authentication is on) and
631
+ // accept the token minted above (only the server launched with its hash
632
+ // can). Anything short of both is a refusal: nothing is published.
633
+ const publishedHost = remoteIngressPort !== undefined ? exports.REMOTE_INGRESS_HOST : endpoint.host;
634
+ const identity = await (0, server_identity_1.verifyLaunchedServer)({
635
+ protocol: endpoint.protocol,
636
+ host: publishedHost,
637
+ port: remoteIngressPort ?? endpoint.port,
638
+ sessionToken,
639
+ });
640
+ if (!identity.ok) {
641
+ logger.error(`Refusing to publish: ${identity.reason}.`);
642
+ logger.info('Nothing was published. Another process may be holding the port (for example an earlier ' +
643
+ 'CommandMate server that was not stopped). Stop it and re-run "commandmate remote".');
644
+ await rollback(daemonManager, pairing.filePath, restoreEnv);
645
+ (0, security_logger_1.logSecurityEvent)({
646
+ timestamp: new Date().toISOString(),
647
+ command: 'remote',
648
+ action: 'failure',
649
+ details: `up: listener identity not verified, nothing published (${provider.id})`,
650
+ });
651
+ return types_1.ExitCode.START_FAILED;
652
+ }
622
653
  // 7. Open the outside door. The Provider is handed 127.0.0.1 explicitly; it
623
654
  // never reads CM_BIND (§9.1).
624
655
  //
@@ -748,7 +779,7 @@ function buildPairingUrl(url, code) {
748
779
  *
749
780
  * @param pairingUrl - The `/login#code=` URL
750
781
  */
751
- function announcePairing(pairingUrl) {
782
+ function announcePairing(pairingUrl, alwaysShowUrl = false) {
752
783
  const qr = (0, qr_terminal_1.formatQrForTerminal)(pairingUrl, {
753
784
  columns: process.stdout.columns,
754
785
  color: process.stdout.isTTY === true,
@@ -761,6 +792,12 @@ function announcePairing(pairingUrl) {
761
792
  else {
762
793
  console.log(qr);
763
794
  logger.info('Scan this with your phone. The code works once, and only until it expires.');
795
+ // Issue #3127: an agent's chat pane folds long output and cuts the QR off,
796
+ // so `remote pair` prints the link as text too.
797
+ if (alwaysShowUrl) {
798
+ logger.info('Or open this URL on the phone:');
799
+ logger.info(` ${pairingUrl}`);
800
+ }
764
801
  }
765
802
  logger.blank();
766
803
  }
@@ -908,6 +945,9 @@ async function runRemoteStatus(options) {
908
945
  logger.info(`Remote expires: ${new Date(state.expiresAt).toISOString()} (${formatRemaining(state.expiresAt - now)})`);
909
946
  logger.info(`Pairing: ${pairing}`);
910
947
  logger.info(`Server: ${describeServer(server)}`);
948
+ if (!expired) {
949
+ logger.info(describePairingNextStep(pairing));
950
+ }
911
951
  }
912
952
  if (closed !== null && !options.json) {
913
953
  if (closed.ok) {
@@ -931,6 +971,112 @@ async function runRemoteStatus(options) {
931
971
  * @param state - The recorded session
932
972
  * @returns The text after `Auth scope:`
933
973
  */
974
+ /**
975
+ * One line telling the user how to get a pairing link from this state
976
+ * (Issue #3127). `status` itself never prints a link or a code (§5.4).
977
+ *
978
+ * @param pairing - Derived pairing state
979
+ * @returns The hint line
980
+ */
981
+ function describePairingNextStep(pairing) {
982
+ if (pairing === 'unused') {
983
+ return 'Lost the QR code? "commandmate remote pair" shows a new pairing link for the same URL.';
984
+ }
985
+ return PAIRING_RESTART_HINT;
986
+ }
987
+ /** What to do when no unused pairing code is left (Issue #3127). */
988
+ const PAIRING_RESTART_HINT = 'To pair a device now, run "commandmate remote stop", then "commandmate remote" for a new QR code.';
989
+ /**
990
+ * Printed with every re-issued link (Issue #3127). The link may stay behind in
991
+ * an agent's chat history, so its limits are said next to it.
992
+ */
993
+ exports.PAIRING_LINK_NOTICE = 'This link works once and expires at the time shown. Any earlier pairing link no longer works. ' +
994
+ 'When you are done with remote access, run "commandmate remote stop".';
995
+ /**
996
+ * @param reason - Why no code was issued
997
+ * @returns The pairing state to report for it
998
+ */
999
+ function failureToPairingState(reason) {
1000
+ if (reason === 'consumed' || reason === 'expired')
1001
+ return reason;
1002
+ return 'unavailable';
1003
+ }
1004
+ /**
1005
+ * `remote pair`: show a new pairing link for the live session (Issue #3127).
1006
+ *
1007
+ * The plaintext code from `remote up` is never stored, so "show it again"
1008
+ * means minting a replacement and swapping its hash into the existing handoff
1009
+ * file (`reissuePairingCode`). The server, the Provider and the published URL
1010
+ * are left exactly as they are — no new way in is opened — and the session
1011
+ * token is never printed: the only secret in the output is the one-time code.
1012
+ *
1013
+ * Refused unless the code is still unused: a consumed code means a device
1014
+ * already holds the token, and an expired one closed its window on purpose.
1015
+ * Both are answered with the `remote stop` -> `remote` route instead.
1016
+ *
1017
+ * @param options - Parsed command options (`--json`)
1018
+ * @returns SUCCESS with a link, CONFIG_ERROR without one
1019
+ */
1020
+ async function runRemotePair(options) {
1021
+ const state = (0, remote_state_1.readRemoteState)();
1022
+ const now = Date.now();
1023
+ const refuse = (pairing, message) => {
1024
+ if (options.json) {
1025
+ console.log(JSON.stringify({ action: 'pair', pairingUrl: null, pairing: { state: pairing }, error: message, hint: PAIRING_RESTART_HINT }, null, 2));
1026
+ }
1027
+ else {
1028
+ logger.error(message);
1029
+ logger.info(PAIRING_RESTART_HINT);
1030
+ }
1031
+ (0, security_logger_1.logSecurityEvent)({
1032
+ timestamp: new Date().toISOString(),
1033
+ command: 'remote',
1034
+ action: 'failure',
1035
+ details: `pair: not reissued (${pairing ?? 'no-remote-state'})`,
1036
+ });
1037
+ return types_1.ExitCode.CONFIG_ERROR;
1038
+ };
1039
+ if (state === null) {
1040
+ return refuse(null, 'No remote session is recorded, so there is no pairing to show.');
1041
+ }
1042
+ if (now > state.expiresAt) {
1043
+ return refuse(null, 'The remote session has expired.');
1044
+ }
1045
+ const pairing = derivePairingState((0, fs_1.existsSync)(state.pairing.filePath), state.pairing.expiresAt, now);
1046
+ if (pairing !== 'unused') {
1047
+ return refuse(pairing, pairing === 'consumed'
1048
+ ? 'The pairing code has already been used.'
1049
+ : 'The pairing code has expired.');
1050
+ }
1051
+ const reissued = (0, remote_pairing_1.reissuePairingCode)(state.pairing.filePath, now);
1052
+ if (!reissued.ok) {
1053
+ return refuse(failureToPairingState(reissued.reason), `Could not issue a new pairing code (${reissued.reason}).`);
1054
+ }
1055
+ const pairingUrl = buildPairingUrl(state.url, reissued.code);
1056
+ const expiresAt = new Date(reissued.expiresAt).toISOString();
1057
+ (0, security_logger_1.logSecurityEvent)({
1058
+ timestamp: new Date().toISOString(),
1059
+ command: 'remote',
1060
+ action: 'success',
1061
+ // Neither the pairing code nor the token appears here (§5.2).
1062
+ details: `pair: reissued provider=${state.provider}`,
1063
+ });
1064
+ if (options.json) {
1065
+ console.log(JSON.stringify({
1066
+ action: 'pair',
1067
+ url: state.url,
1068
+ pairingUrl,
1069
+ pairing: { state: 'unused', expiresAt },
1070
+ notice: exports.PAIRING_LINK_NOTICE,
1071
+ }, null, 2));
1072
+ }
1073
+ else {
1074
+ announcePairing(pairingUrl, true);
1075
+ logger.info(`Pairing expires: ${expiresAt} (${formatRemaining(reissued.expiresAt - now)})`);
1076
+ logger.info(exports.PAIRING_LINK_NOTICE);
1077
+ }
1078
+ return types_1.ExitCode.SUCCESS;
1079
+ }
934
1080
  function describeAuthScope(state) {
935
1081
  const scope = state.authScope ?? exports.DEFAULT_REMOTE_AUTH_SCOPE;
936
1082
  if (scope !== 'remote-only') {
@@ -1009,7 +1155,7 @@ async function runRemoteStop(options) {
1009
1155
  * future caller (a `quickstart --remote`, say) would compose, exactly as
1010
1156
  * `runStart` / `startCommand` are split (#1195).
1011
1157
  *
1012
- * @param action - `up` (default), `status` or `stop`
1158
+ * @param action - `up` (default), `status`, `stop` or `pair`
1013
1159
  * @param options - Parsed command options
1014
1160
  */
1015
1161
  async function remoteCommand(action, options) {
@@ -1025,8 +1171,11 @@ async function remoteCommand(action, options) {
1025
1171
  case 'stop':
1026
1172
  exitCode = await runRemoteStop(options);
1027
1173
  break;
1174
+ case 'pair':
1175
+ exitCode = await runRemotePair(options);
1176
+ break;
1028
1177
  default:
1029
- logger.error(`Unknown action '${action}'. Valid actions: up, status, stop.`);
1178
+ logger.error(`Unknown action '${action}'. Valid actions: up, status, stop, pair.`);
1030
1179
  exitCode = types_1.ExitCode.CONFIG_ERROR;
1031
1180
  }
1032
1181
  }
@@ -1055,7 +1204,7 @@ function createRemoteCommand() {
1055
1204
  const cmd = new commander_1.Command('remote');
1056
1205
  cmd
1057
1206
  .description('Expose this server to your phone over a provider tunnel and pair it with a QR code')
1058
- .argument('[action]', 'up (default), status, or stop')
1207
+ .argument('[action]', 'up (default), status, stop, or pair (show a new pairing link)')
1059
1208
  .option('--provider <name>', 'Force a provider instead of choosing one (tailscale or cloudflare)')
1060
1209
  .option('--expires <duration>', `Remote session TTL, 1h-30d (default: ${exports.DEFAULT_REMOTE_EXPIRES})`)
1061
1210
  .option('--pairing-expires <duration>', `Pairing code TTL, 1m-24h (default: ${exports.DEFAULT_PAIRING_EXPIRES})`)
@@ -0,0 +1,40 @@
1
+ /**
2
+ * reply Command - read an agent session's latest reply (Issue #3039)
3
+ *
4
+ * commandmate reply <worktree-id> [--instance <id|alias>] [--agent <tool>]
5
+ * [--since <iso8601>] [--json]
6
+ *
7
+ * ## Why this exists next to ask / capture
8
+ *
9
+ * `ask` reads the reply to the turn IT sent. A supervisor that nudged a worker
10
+ * with a plain `send` ("stop and report") had no way to read the answer short
11
+ * of opening the tool's transcript file itself — which works for Claude, whose
12
+ * path is computable from the cwd, and not for Command Code, whose project slug
13
+ * is not. `capture` is no substitute: the pane also holds the nudge's own echo,
14
+ * and a pane line cannot be attributed to a turn.
15
+ *
16
+ * The server already has the reply: the transcript readers write each turn into
17
+ * the chat ledger keyed `<tool>-turn:<id>`, and `ask` reads it from there. This
18
+ * command is that read on its own, through the same shared rules
19
+ * (`utils/reply-ledger`), so the two can never disagree about what a reply is.
20
+ *
21
+ * ## What it deliberately does not do
22
+ *
23
+ * - No pane fallback. A row off the screen is exactly what cannot be attributed
24
+ * to a turn; returning it would re-introduce the problem this command solves.
25
+ * Only transcript-reader rows count, for every tool.
26
+ * - No wait. It is one read; "no reply yet" is an answer (exit 0, empty stdout,
27
+ * `reply: null`), not an error, so a caller can poll or give up on its terms.
28
+ */
29
+ import { Command } from 'commander';
30
+ /** The `--json` payload. `reply` is null when there is no reply yet. */
31
+ export interface ReplyJsonPayload {
32
+ worktreeId: string;
33
+ instanceId: string | null;
34
+ cliToolId: string | null;
35
+ reply: string | null;
36
+ requestId: string | null;
37
+ at: string | null;
38
+ }
39
+ export declare function createReplyCommand(): Command;
40
+ //# sourceMappingURL=reply.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reply.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/reply.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAuBpC,wEAAwE;AACxE,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;CACnB;AAuBD,wBAAgB,kBAAkB,IAAI,OAAO,CA8E5C"}