commandmate 0.10.2 → 0.10.4

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 (383) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-build-manifest.json +149 -149
  3. package/.next/app-path-routes-manifest.json +30 -30
  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/app/update/route.js +3 -3
  9. package/.next/server/app/api/app/update/route_client-reference-manifest.js +1 -1
  10. package/.next/server/app/api/app/update-check/route.js +1 -1
  11. package/.next/server/app/api/app/update-check/route_client-reference-manifest.js +1 -1
  12. package/.next/server/app/api/assistant/conversation/route.js +1 -1
  13. package/.next/server/app/api/assistant/conversation/route.js.nft.json +1 -1
  14. package/.next/server/app/api/assistant/conversation/route_client-reference-manifest.js +1 -1
  15. package/.next/server/app/api/assistant/current-output/route.js +1 -1
  16. package/.next/server/app/api/assistant/current-output/route.js.nft.json +1 -1
  17. package/.next/server/app/api/assistant/current-output/route_client-reference-manifest.js +1 -1
  18. package/.next/server/app/api/assistant/messages/route.js +1 -1
  19. package/.next/server/app/api/assistant/messages/route.js.nft.json +1 -1
  20. package/.next/server/app/api/assistant/messages/route_client-reference-manifest.js +1 -1
  21. package/.next/server/app/api/assistant/session/route.js +1 -1
  22. package/.next/server/app/api/assistant/session/route.js.nft.json +1 -1
  23. package/.next/server/app/api/assistant/session/route_client-reference-manifest.js +1 -1
  24. package/.next/server/app/api/assistant/start/route.js +1 -1
  25. package/.next/server/app/api/assistant/start/route.js.nft.json +1 -1
  26. package/.next/server/app/api/assistant/start/route_client-reference-manifest.js +1 -1
  27. package/.next/server/app/api/assistant/terminal/route.js +3 -2
  28. package/.next/server/app/api/assistant/terminal/route.js.nft.json +1 -1
  29. package/.next/server/app/api/assistant/terminal/route_client-reference-manifest.js +1 -1
  30. package/.next/server/app/api/assistant/tools/route.js +1 -1
  31. package/.next/server/app/api/assistant/tools/route.js.nft.json +1 -1
  32. package/.next/server/app/api/assistant/tools/route_client-reference-manifest.js +1 -1
  33. package/.next/server/app/api/auth/login/route_client-reference-manifest.js +1 -1
  34. package/.next/server/app/api/auth/logout/route_client-reference-manifest.js +1 -1
  35. package/.next/server/app/api/auth/status/route_client-reference-manifest.js +1 -1
  36. package/.next/server/app/api/daily-summary/route.js +1 -1
  37. package/.next/server/app/api/daily-summary/route.js.nft.json +1 -1
  38. package/.next/server/app/api/daily-summary/route_client-reference-manifest.js +1 -1
  39. package/.next/server/app/api/daily-summary/status/route.js +1 -1
  40. package/.next/server/app/api/daily-summary/status/route.js.nft.json +1 -1
  41. package/.next/server/app/api/daily-summary/status/route_client-reference-manifest.js +1 -1
  42. package/.next/server/app/api/external-apps/[id]/health/route_client-reference-manifest.js +1 -1
  43. package/.next/server/app/api/external-apps/[id]/route_client-reference-manifest.js +1 -1
  44. package/.next/server/app/api/external-apps/route_client-reference-manifest.js +1 -1
  45. package/.next/server/app/api/hooks/claude-done/route.js +1 -1
  46. package/.next/server/app/api/hooks/claude-done/route.js.nft.json +1 -1
  47. package/.next/server/app/api/hooks/claude-done/route_client-reference-manifest.js +1 -1
  48. package/.next/server/app/api/ollama/models/route_client-reference-manifest.js +1 -1
  49. package/.next/server/app/api/push/subscriptions/route.js +1 -1
  50. package/.next/server/app/api/push/subscriptions/route.js.nft.json +1 -1
  51. package/.next/server/app/api/push/subscriptions/route_client-reference-manifest.js +1 -1
  52. package/.next/server/app/api/push/vapid/route_client-reference-manifest.js +1 -1
  53. package/.next/server/app/api/repositories/[id]/route.js +1 -47
  54. package/.next/server/app/api/repositories/[id]/route.js.nft.json +1 -1
  55. package/.next/server/app/api/repositories/[id]/route_client-reference-manifest.js +1 -1
  56. package/.next/server/app/api/repositories/[id]/todos/[todoId]/route.js +1 -1
  57. package/.next/server/app/api/repositories/[id]/todos/[todoId]/route.js.nft.json +1 -1
  58. package/.next/server/app/api/repositories/[id]/todos/[todoId]/route_client-reference-manifest.js +1 -1
  59. package/.next/server/app/api/repositories/[id]/todos/route.js +1 -1
  60. package/.next/server/app/api/repositories/[id]/todos/route.js.nft.json +1 -1
  61. package/.next/server/app/api/repositories/[id]/todos/route_client-reference-manifest.js +1 -1
  62. package/.next/server/app/api/repositories/clone/[jobId]/route.js +1 -1
  63. package/.next/server/app/api/repositories/clone/[jobId]/route.js.nft.json +1 -1
  64. package/.next/server/app/api/repositories/clone/[jobId]/route_client-reference-manifest.js +1 -1
  65. package/.next/server/app/api/repositories/clone/route.js +1 -1
  66. package/.next/server/app/api/repositories/clone/route.js.nft.json +1 -1
  67. package/.next/server/app/api/repositories/clone/route_client-reference-manifest.js +1 -1
  68. package/.next/server/app/api/repositories/excluded/route.js +1 -47
  69. package/.next/server/app/api/repositories/excluded/route.js.nft.json +1 -1
  70. package/.next/server/app/api/repositories/excluded/route_client-reference-manifest.js +1 -1
  71. package/.next/server/app/api/repositories/restore/route.js +1 -1
  72. package/.next/server/app/api/repositories/restore/route.js.nft.json +1 -1
  73. package/.next/server/app/api/repositories/restore/route_client-reference-manifest.js +1 -1
  74. package/.next/server/app/api/repositories/route.js +1 -1
  75. package/.next/server/app/api/repositories/route.js.nft.json +1 -1
  76. package/.next/server/app/api/repositories/route_client-reference-manifest.js +1 -1
  77. package/.next/server/app/api/repositories/scan/route.js +1 -1
  78. package/.next/server/app/api/repositories/scan/route.js.nft.json +1 -1
  79. package/.next/server/app/api/repositories/scan/route_client-reference-manifest.js +1 -1
  80. package/.next/server/app/api/repositories/sync/route.js +1 -1
  81. package/.next/server/app/api/repositories/sync/route.js.nft.json +1 -1
  82. package/.next/server/app/api/repositories/sync/route_client-reference-manifest.js +1 -1
  83. package/.next/server/app/api/sidebar/group-order/route_client-reference-manifest.js +1 -1
  84. package/.next/server/app/api/slash-commands/route_client-reference-manifest.js +1 -1
  85. package/.next/server/app/api/templates/[id]/route_client-reference-manifest.js +1 -1
  86. package/.next/server/app/api/templates/route_client-reference-manifest.js +1 -1
  87. package/.next/server/app/api/todos/route.js +1 -1
  88. package/.next/server/app/api/todos/route.js.nft.json +1 -1
  89. package/.next/server/app/api/todos/route_client-reference-manifest.js +1 -1
  90. package/.next/server/app/api/worktrees/[id]/auto-yes/route.js +1 -1
  91. package/.next/server/app/api/worktrees/[id]/auto-yes/route.js.nft.json +1 -1
  92. package/.next/server/app/api/worktrees/[id]/auto-yes/route_client-reference-manifest.js +1 -1
  93. package/.next/server/app/api/worktrees/[id]/capture/route.js +1 -1
  94. package/.next/server/app/api/worktrees/[id]/capture/route.js.nft.json +1 -1
  95. package/.next/server/app/api/worktrees/[id]/capture/route_client-reference-manifest.js +1 -1
  96. package/.next/server/app/api/worktrees/[id]/cli-tool/route.js +1 -1
  97. package/.next/server/app/api/worktrees/[id]/cli-tool/route.js.nft.json +1 -1
  98. package/.next/server/app/api/worktrees/[id]/cli-tool/route_client-reference-manifest.js +1 -1
  99. package/.next/server/app/api/worktrees/[id]/cmate/schedules/route.js +1 -1
  100. package/.next/server/app/api/worktrees/[id]/cmate/schedules/route.js.nft.json +1 -1
  101. package/.next/server/app/api/worktrees/[id]/cmate/schedules/route_client-reference-manifest.js +1 -1
  102. package/.next/server/app/api/worktrees/[id]/current-output/route.js +1 -1
  103. package/.next/server/app/api/worktrees/[id]/current-output/route.js.nft.json +1 -1
  104. package/.next/server/app/api/worktrees/[id]/current-output/route_client-reference-manifest.js +1 -1
  105. package/.next/server/app/api/worktrees/[id]/execution-logs/[logId]/route.js +1 -1
  106. package/.next/server/app/api/worktrees/[id]/execution-logs/[logId]/route.js.nft.json +1 -1
  107. package/.next/server/app/api/worktrees/[id]/execution-logs/[logId]/route_client-reference-manifest.js +1 -1
  108. package/.next/server/app/api/worktrees/[id]/execution-logs/route.js +2 -2
  109. package/.next/server/app/api/worktrees/[id]/execution-logs/route.js.nft.json +1 -1
  110. package/.next/server/app/api/worktrees/[id]/execution-logs/route_client-reference-manifest.js +1 -1
  111. package/.next/server/app/api/worktrees/[id]/files/[...path]/route.js +1 -1
  112. package/.next/server/app/api/worktrees/[id]/files/[...path]/route.js.nft.json +1 -1
  113. package/.next/server/app/api/worktrees/[id]/files/[...path]/route_client-reference-manifest.js +1 -1
  114. package/.next/server/app/api/worktrees/[id]/git/branch/create/route.js +1 -1
  115. package/.next/server/app/api/worktrees/[id]/git/branch/create/route.js.nft.json +1 -1
  116. package/.next/server/app/api/worktrees/[id]/git/branch/create/route_client-reference-manifest.js +1 -1
  117. package/.next/server/app/api/worktrees/[id]/git/branch/delete/route.js +1 -1
  118. package/.next/server/app/api/worktrees/[id]/git/branch/delete/route.js.nft.json +1 -1
  119. package/.next/server/app/api/worktrees/[id]/git/branch/delete/route_client-reference-manifest.js +1 -1
  120. package/.next/server/app/api/worktrees/[id]/git/branches/route.js +1 -1
  121. package/.next/server/app/api/worktrees/[id]/git/branches/route.js.nft.json +1 -1
  122. package/.next/server/app/api/worktrees/[id]/git/branches/route_client-reference-manifest.js +1 -1
  123. package/.next/server/app/api/worktrees/[id]/git/checkout/route.js +1 -1
  124. package/.next/server/app/api/worktrees/[id]/git/checkout/route.js.nft.json +1 -1
  125. package/.next/server/app/api/worktrees/[id]/git/checkout/route_client-reference-manifest.js +1 -1
  126. package/.next/server/app/api/worktrees/[id]/git/commit/route.js +1 -1
  127. package/.next/server/app/api/worktrees/[id]/git/commit/route.js.nft.json +1 -1
  128. package/.next/server/app/api/worktrees/[id]/git/commit/route_client-reference-manifest.js +1 -1
  129. package/.next/server/app/api/worktrees/[id]/git/diff/route.js +1 -1
  130. package/.next/server/app/api/worktrees/[id]/git/diff/route.js.nft.json +1 -1
  131. package/.next/server/app/api/worktrees/[id]/git/diff/route_client-reference-manifest.js +1 -1
  132. package/.next/server/app/api/worktrees/[id]/git/fetch/route.js +1 -1
  133. package/.next/server/app/api/worktrees/[id]/git/fetch/route.js.nft.json +1 -1
  134. package/.next/server/app/api/worktrees/[id]/git/fetch/route_client-reference-manifest.js +1 -1
  135. package/.next/server/app/api/worktrees/[id]/git/log/route.js +1 -1
  136. package/.next/server/app/api/worktrees/[id]/git/log/route.js.nft.json +1 -1
  137. package/.next/server/app/api/worktrees/[id]/git/log/route_client-reference-manifest.js +1 -1
  138. package/.next/server/app/api/worktrees/[id]/git/pull/route.js +1 -1
  139. package/.next/server/app/api/worktrees/[id]/git/pull/route.js.nft.json +1 -1
  140. package/.next/server/app/api/worktrees/[id]/git/pull/route_client-reference-manifest.js +1 -1
  141. package/.next/server/app/api/worktrees/[id]/git/push/route.js +1 -1
  142. package/.next/server/app/api/worktrees/[id]/git/push/route.js.nft.json +1 -1
  143. package/.next/server/app/api/worktrees/[id]/git/push/route_client-reference-manifest.js +1 -1
  144. package/.next/server/app/api/worktrees/[id]/git/reset/route.js +1 -1
  145. package/.next/server/app/api/worktrees/[id]/git/reset/route.js.nft.json +1 -1
  146. package/.next/server/app/api/worktrees/[id]/git/reset/route_client-reference-manifest.js +1 -1
  147. package/.next/server/app/api/worktrees/[id]/git/revert/route.js +1 -1
  148. package/.next/server/app/api/worktrees/[id]/git/revert/route.js.nft.json +1 -1
  149. package/.next/server/app/api/worktrees/[id]/git/revert/route_client-reference-manifest.js +1 -1
  150. package/.next/server/app/api/worktrees/[id]/git/show/[commitHash]/route.js +1 -1
  151. package/.next/server/app/api/worktrees/[id]/git/show/[commitHash]/route.js.nft.json +1 -1
  152. package/.next/server/app/api/worktrees/[id]/git/show/[commitHash]/route_client-reference-manifest.js +1 -1
  153. package/.next/server/app/api/worktrees/[id]/git/stage/route.js +1 -1
  154. package/.next/server/app/api/worktrees/[id]/git/stage/route.js.nft.json +1 -1
  155. package/.next/server/app/api/worktrees/[id]/git/stage/route_client-reference-manifest.js +1 -1
  156. package/.next/server/app/api/worktrees/[id]/git/staged/route.js +1 -1
  157. package/.next/server/app/api/worktrees/[id]/git/staged/route.js.nft.json +1 -1
  158. package/.next/server/app/api/worktrees/[id]/git/staged/route_client-reference-manifest.js +1 -1
  159. package/.next/server/app/api/worktrees/[id]/git/stash/[index]/route.js +1 -1
  160. package/.next/server/app/api/worktrees/[id]/git/stash/[index]/route.js.nft.json +1 -1
  161. package/.next/server/app/api/worktrees/[id]/git/stash/[index]/route_client-reference-manifest.js +1 -1
  162. package/.next/server/app/api/worktrees/[id]/git/stash/apply/route.js +1 -1
  163. package/.next/server/app/api/worktrees/[id]/git/stash/apply/route.js.nft.json +1 -1
  164. package/.next/server/app/api/worktrees/[id]/git/stash/apply/route_client-reference-manifest.js +1 -1
  165. package/.next/server/app/api/worktrees/[id]/git/stash/pop/route.js +1 -1
  166. package/.next/server/app/api/worktrees/[id]/git/stash/pop/route.js.nft.json +1 -1
  167. package/.next/server/app/api/worktrees/[id]/git/stash/pop/route_client-reference-manifest.js +1 -1
  168. package/.next/server/app/api/worktrees/[id]/git/stash/push/route.js +1 -1
  169. package/.next/server/app/api/worktrees/[id]/git/stash/push/route.js.nft.json +1 -1
  170. package/.next/server/app/api/worktrees/[id]/git/stash/push/route_client-reference-manifest.js +1 -1
  171. package/.next/server/app/api/worktrees/[id]/git/stash/route.js +1 -1
  172. package/.next/server/app/api/worktrees/[id]/git/stash/route.js.nft.json +1 -1
  173. package/.next/server/app/api/worktrees/[id]/git/stash/route_client-reference-manifest.js +1 -1
  174. package/.next/server/app/api/worktrees/[id]/git/status/route.js +1 -1
  175. package/.next/server/app/api/worktrees/[id]/git/status/route.js.nft.json +1 -1
  176. package/.next/server/app/api/worktrees/[id]/git/status/route_client-reference-manifest.js +1 -1
  177. package/.next/server/app/api/worktrees/[id]/git/unstage/route.js +1 -1
  178. package/.next/server/app/api/worktrees/[id]/git/unstage/route.js.nft.json +1 -1
  179. package/.next/server/app/api/worktrees/[id]/git/unstage/route_client-reference-manifest.js +1 -1
  180. package/.next/server/app/api/worktrees/[id]/git/working-diff/route.js +1 -1
  181. package/.next/server/app/api/worktrees/[id]/git/working-diff/route.js.nft.json +1 -1
  182. package/.next/server/app/api/worktrees/[id]/git/working-diff/route_client-reference-manifest.js +1 -1
  183. package/.next/server/app/api/worktrees/[id]/interrupt/route.js +1 -1
  184. package/.next/server/app/api/worktrees/[id]/interrupt/route.js.nft.json +1 -1
  185. package/.next/server/app/api/worktrees/[id]/interrupt/route_client-reference-manifest.js +1 -1
  186. package/.next/server/app/api/worktrees/[id]/kill-session/route.js +1 -1
  187. package/.next/server/app/api/worktrees/[id]/kill-session/route.js.nft.json +1 -1
  188. package/.next/server/app/api/worktrees/[id]/kill-session/route_client-reference-manifest.js +1 -1
  189. package/.next/server/app/api/worktrees/[id]/logs/[filename]/route.js +1 -1
  190. package/.next/server/app/api/worktrees/[id]/logs/[filename]/route.js.nft.json +1 -1
  191. package/.next/server/app/api/worktrees/[id]/logs/[filename]/route_client-reference-manifest.js +1 -1
  192. package/.next/server/app/api/worktrees/[id]/logs/route.js +1 -1
  193. package/.next/server/app/api/worktrees/[id]/logs/route.js.nft.json +1 -1
  194. package/.next/server/app/api/worktrees/[id]/logs/route_client-reference-manifest.js +1 -1
  195. package/.next/server/app/api/worktrees/[id]/marp-render/route.js +2 -2
  196. package/.next/server/app/api/worktrees/[id]/marp-render/route.js.nft.json +1 -1
  197. package/.next/server/app/api/worktrees/[id]/marp-render/route_client-reference-manifest.js +1 -1
  198. package/.next/server/app/api/worktrees/[id]/memos/[memoId]/route.js +1 -1
  199. package/.next/server/app/api/worktrees/[id]/memos/[memoId]/route.js.nft.json +1 -1
  200. package/.next/server/app/api/worktrees/[id]/memos/[memoId]/route_client-reference-manifest.js +1 -1
  201. package/.next/server/app/api/worktrees/[id]/memos/route.js +1 -1
  202. package/.next/server/app/api/worktrees/[id]/memos/route.js.nft.json +1 -1
  203. package/.next/server/app/api/worktrees/[id]/memos/route_client-reference-manifest.js +1 -1
  204. package/.next/server/app/api/worktrees/[id]/messages/route.js +1 -1
  205. package/.next/server/app/api/worktrees/[id]/messages/route.js.nft.json +1 -1
  206. package/.next/server/app/api/worktrees/[id]/messages/route_client-reference-manifest.js +1 -1
  207. package/.next/server/app/api/worktrees/[id]/prompt-response/route.js +1 -1
  208. package/.next/server/app/api/worktrees/[id]/prompt-response/route.js.nft.json +1 -1
  209. package/.next/server/app/api/worktrees/[id]/prompt-response/route_client-reference-manifest.js +1 -1
  210. package/.next/server/app/api/worktrees/[id]/respond/route.js +1 -1
  211. package/.next/server/app/api/worktrees/[id]/respond/route.js.nft.json +1 -1
  212. package/.next/server/app/api/worktrees/[id]/respond/route_client-reference-manifest.js +1 -1
  213. package/.next/server/app/api/worktrees/[id]/route.js +1 -1
  214. package/.next/server/app/api/worktrees/[id]/route.js.nft.json +1 -1
  215. package/.next/server/app/api/worktrees/[id]/route_client-reference-manifest.js +1 -1
  216. package/.next/server/app/api/worktrees/[id]/schedules/[scheduleId]/route.js +1 -1
  217. package/.next/server/app/api/worktrees/[id]/schedules/[scheduleId]/route.js.nft.json +1 -1
  218. package/.next/server/app/api/worktrees/[id]/schedules/[scheduleId]/route_client-reference-manifest.js +1 -1
  219. package/.next/server/app/api/worktrees/[id]/schedules/active/route.js +1 -1
  220. package/.next/server/app/api/worktrees/[id]/schedules/active/route.js.nft.json +1 -1
  221. package/.next/server/app/api/worktrees/[id]/schedules/active/route_client-reference-manifest.js +1 -1
  222. package/.next/server/app/api/worktrees/[id]/schedules/route.js +2 -2
  223. package/.next/server/app/api/worktrees/[id]/schedules/route.js.nft.json +1 -1
  224. package/.next/server/app/api/worktrees/[id]/schedules/route_client-reference-manifest.js +1 -1
  225. package/.next/server/app/api/worktrees/[id]/search/route.js +1 -1
  226. package/.next/server/app/api/worktrees/[id]/search/route.js.nft.json +1 -1
  227. package/.next/server/app/api/worktrees/[id]/search/route_client-reference-manifest.js +1 -1
  228. package/.next/server/app/api/worktrees/[id]/send/route.js +1 -1
  229. package/.next/server/app/api/worktrees/[id]/send/route.js.nft.json +1 -1
  230. package/.next/server/app/api/worktrees/[id]/send/route_client-reference-manifest.js +1 -1
  231. package/.next/server/app/api/worktrees/[id]/slash-commands/route.js +1 -1
  232. package/.next/server/app/api/worktrees/[id]/slash-commands/route.js.nft.json +1 -1
  233. package/.next/server/app/api/worktrees/[id]/slash-commands/route_client-reference-manifest.js +1 -1
  234. package/.next/server/app/api/worktrees/[id]/special-keys/route.js +1 -1
  235. package/.next/server/app/api/worktrees/[id]/special-keys/route.js.nft.json +1 -1
  236. package/.next/server/app/api/worktrees/[id]/special-keys/route_client-reference-manifest.js +1 -1
  237. package/.next/server/app/api/worktrees/[id]/start-polling/route.js +1 -1
  238. package/.next/server/app/api/worktrees/[id]/start-polling/route.js.nft.json +1 -1
  239. package/.next/server/app/api/worktrees/[id]/start-polling/route_client-reference-manifest.js +1 -1
  240. package/.next/server/app/api/worktrees/[id]/terminal/route.js +1 -1
  241. package/.next/server/app/api/worktrees/[id]/terminal/route.js.nft.json +1 -1
  242. package/.next/server/app/api/worktrees/[id]/terminal/route_client-reference-manifest.js +1 -1
  243. package/.next/server/app/api/worktrees/[id]/timers/history/route.js +1 -1
  244. package/.next/server/app/api/worktrees/[id]/timers/history/route.js.nft.json +1 -1
  245. package/.next/server/app/api/worktrees/[id]/timers/history/route_client-reference-manifest.js +1 -1
  246. package/.next/server/app/api/worktrees/[id]/timers/route.js +1 -1
  247. package/.next/server/app/api/worktrees/[id]/timers/route.js.nft.json +1 -1
  248. package/.next/server/app/api/worktrees/[id]/timers/route_client-reference-manifest.js +1 -1
  249. package/.next/server/app/api/worktrees/[id]/todos/[todoId]/route.js +1 -1
  250. package/.next/server/app/api/worktrees/[id]/todos/[todoId]/route.js.nft.json +1 -1
  251. package/.next/server/app/api/worktrees/[id]/todos/[todoId]/route_client-reference-manifest.js +1 -1
  252. package/.next/server/app/api/worktrees/[id]/todos/route.js +1 -1
  253. package/.next/server/app/api/worktrees/[id]/todos/route.js.nft.json +1 -1
  254. package/.next/server/app/api/worktrees/[id]/todos/route_client-reference-manifest.js +1 -1
  255. package/.next/server/app/api/worktrees/[id]/tree/[...path]/route.js +1 -1
  256. package/.next/server/app/api/worktrees/[id]/tree/[...path]/route.js.nft.json +1 -1
  257. package/.next/server/app/api/worktrees/[id]/tree/[...path]/route_client-reference-manifest.js +1 -1
  258. package/.next/server/app/api/worktrees/[id]/tree/route.js +1 -1
  259. package/.next/server/app/api/worktrees/[id]/tree/route.js.nft.json +1 -1
  260. package/.next/server/app/api/worktrees/[id]/tree/route_client-reference-manifest.js +1 -1
  261. package/.next/server/app/api/worktrees/[id]/upload/[...path]/route.js +1 -1
  262. package/.next/server/app/api/worktrees/[id]/upload/[...path]/route.js.nft.json +1 -1
  263. package/.next/server/app/api/worktrees/[id]/upload/[...path]/route_client-reference-manifest.js +1 -1
  264. package/.next/server/app/api/worktrees/[id]/viewed/route.js +1 -1
  265. package/.next/server/app/api/worktrees/[id]/viewed/route.js.nft.json +1 -1
  266. package/.next/server/app/api/worktrees/[id]/viewed/route_client-reference-manifest.js +1 -1
  267. package/.next/server/app/api/worktrees/route.js +1 -1
  268. package/.next/server/app/api/worktrees/route.js.nft.json +1 -1
  269. package/.next/server/app/api/worktrees/route_client-reference-manifest.js +1 -1
  270. package/.next/server/app/chat/page.js +1 -1
  271. package/.next/server/app/chat/page.js.nft.json +1 -1
  272. package/.next/server/app/chat/page_client-reference-manifest.js +1 -1
  273. package/.next/server/app/login/page_client-reference-manifest.js +1 -1
  274. package/.next/server/app/manifest.webmanifest/route_client-reference-manifest.js +1 -1
  275. package/.next/server/app/more/page.js +2 -2
  276. package/.next/server/app/more/page.js.nft.json +1 -1
  277. package/.next/server/app/more/page_client-reference-manifest.js +1 -1
  278. package/.next/server/app/offline/page_client-reference-manifest.js +1 -1
  279. package/.next/server/app/page.js +1 -1
  280. package/.next/server/app/page.js.nft.json +1 -1
  281. package/.next/server/app/page_client-reference-manifest.js +1 -1
  282. package/.next/server/app/proxy/[...path]/route_client-reference-manifest.js +1 -1
  283. package/.next/server/app/repositories/page.js +1 -1
  284. package/.next/server/app/repositories/page.js.nft.json +1 -1
  285. package/.next/server/app/repositories/page_client-reference-manifest.js +1 -1
  286. package/.next/server/app/review/page.js +1 -1
  287. package/.next/server/app/review/page.js.nft.json +1 -1
  288. package/.next/server/app/review/page_client-reference-manifest.js +1 -1
  289. package/.next/server/app/sessions/page.js +1 -1
  290. package/.next/server/app/sessions/page.js.nft.json +1 -1
  291. package/.next/server/app/sessions/page_client-reference-manifest.js +1 -1
  292. package/.next/server/app/worktrees/[id]/files/[...path]/page_client-reference-manifest.js +1 -1
  293. package/.next/server/app/worktrees/[id]/page.js +8 -8
  294. package/.next/server/app/worktrees/[id]/page.js.nft.json +1 -1
  295. package/.next/server/app/worktrees/[id]/page_client-reference-manifest.js +1 -1
  296. package/.next/server/app/worktrees/[id]/terminal/page_client-reference-manifest.js +1 -1
  297. package/.next/server/app-paths-manifest.json +30 -30
  298. package/.next/server/chunks/1068.js +1 -1
  299. package/.next/server/chunks/1117.js +1 -0
  300. package/.next/server/chunks/233.js +1 -1
  301. package/.next/server/chunks/2404.js +1 -1
  302. package/.next/server/chunks/3270.js +1 -1
  303. package/.next/server/chunks/3480.js +2 -2
  304. package/.next/server/chunks/3543.js +1 -1
  305. package/.next/server/chunks/3945.js +1 -1
  306. package/.next/server/chunks/406.js +47 -0
  307. package/.next/server/chunks/4444.js +1 -1
  308. package/.next/server/chunks/5381.js +1 -47
  309. package/.next/server/chunks/5959.js +2 -2
  310. package/.next/server/chunks/646.js +33 -0
  311. package/.next/server/chunks/8681.js +1 -0
  312. package/.next/server/chunks/8807.js +305 -300
  313. package/.next/server/chunks/9355.js +1 -1
  314. package/.next/server/chunks/9687.js +1 -1
  315. package/.next/server/middleware-manifest.json +5 -5
  316. package/.next/server/pages/500.html +1 -1
  317. package/.next/server/pages-manifest.json +1 -1
  318. package/.next/server/server-reference-manifest.json +1 -1
  319. package/.next/static/chunks/4560-2bf9cb6504cc4425.js +1 -0
  320. package/.next/static/chunks/7347-a013a163a75030ec.js +1 -0
  321. package/.next/static/chunks/app/chat/page-5d20240f98c07cee.js +1 -0
  322. package/.next/static/chunks/app/layout-fe5857360dfba2b9.js +1 -0
  323. package/.next/static/chunks/app/more/page-af1d2af13ea901d2.js +1 -0
  324. package/.next/static/chunks/app/page-3bbe737ec910d1fb.js +1 -0
  325. package/.next/static/chunks/app/repositories/page-ace9134ac165a6de.js +1 -0
  326. package/.next/static/chunks/app/review/page-331b80f4f58582bc.js +1 -0
  327. package/.next/static/chunks/app/sessions/page-d694149a7e8649b6.js +1 -0
  328. package/.next/static/chunks/app/worktrees/[id]/page-932a52f8d11971f7.js +1 -0
  329. package/.next/static/css/d7e2e8d1b8d69d36.css +1 -0
  330. package/.next/trace +10 -10
  331. package/dist/cli/commands/quickstart.d.ts.map +1 -1
  332. package/dist/cli/commands/quickstart.js +27 -0
  333. package/dist/cli/commands/status.d.ts.map +1 -1
  334. package/dist/cli/commands/status.js +19 -0
  335. package/dist/cli/types/index.d.ts +6 -0
  336. package/dist/cli/types/index.d.ts.map +1 -1
  337. package/dist/cli/utils/agent-instances.d.ts +1 -1
  338. package/dist/cli/utils/agent-instances.d.ts.map +1 -1
  339. package/dist/cli/utils/agent-instances.js +8 -1
  340. package/dist/cli/utils/api-client.d.ts +36 -0
  341. package/dist/cli/utils/api-client.d.ts.map +1 -1
  342. package/dist/cli/utils/api-client.js +82 -0
  343. package/dist/cli/utils/daemon.d.ts.map +1 -1
  344. package/dist/cli/utils/daemon.js +44 -9
  345. package/dist/cli/utils/package-info.d.ts +17 -0
  346. package/dist/cli/utils/package-info.d.ts.map +1 -0
  347. package/dist/cli/utils/package-info.js +31 -0
  348. package/dist/cli/utils/pid-manager.d.ts +65 -9
  349. package/dist/cli/utils/pid-manager.d.ts.map +1 -1
  350. package/dist/cli/utils/pid-manager.js +81 -21
  351. package/dist/cli/utils/process-inspector.d.ts +27 -0
  352. package/dist/cli/utils/process-inspector.d.ts.map +1 -0
  353. package/dist/cli/utils/process-inspector.js +37 -0
  354. package/dist/server/src/config/github-links.js +22 -0
  355. package/dist/server/src/lib/db/db-instance.js +22 -3
  356. package/dist/server/src/lib/db/db-repository.js +107 -19
  357. package/dist/server/src/lib/db/db.js +3 -2
  358. package/dist/server/src/lib/db/memo-db.js +32 -1
  359. package/dist/server/src/lib/db/migrations/index.js +2 -0
  360. package/dist/server/src/lib/db/migrations/runner.js +11 -1
  361. package/dist/server/src/lib/db/migrations/v43-remove-cm-root-dir-ghost-repository.js +126 -0
  362. package/dist/server/src/lib/git/worktrees.js +90 -0
  363. package/dist/server/src/lib/job-executor.js +8 -2
  364. package/dist/server/src/lib/realtime/types.js +76 -0
  365. package/dist/server/src/lib/schedule-manager.js +9 -1
  366. package/dist/server/src/lib/version-checker.js +297 -0
  367. package/dist/server/src/lib/ws-server.js +37 -0
  368. package/package.json +1 -1
  369. package/.next/server/chunks/2464.js +0 -33
  370. package/.next/server/chunks/6791.js +0 -47
  371. package/.next/static/chunks/7347-4a031aecf4664a6d.js +0 -1
  372. package/.next/static/chunks/8954-ce15ee4d0423f1b1.js +0 -1
  373. package/.next/static/chunks/app/chat/page-dee86bdf87516e40.js +0 -1
  374. package/.next/static/chunks/app/layout-d02f4691a4eff86b.js +0 -1
  375. package/.next/static/chunks/app/more/page-39ec8b5f27cf52e7.js +0 -1
  376. package/.next/static/chunks/app/page-ebf1db9826b4065d.js +0 -1
  377. package/.next/static/chunks/app/repositories/page-2be54cae5fcc1f7a.js +0 -1
  378. package/.next/static/chunks/app/review/page-ac4efe6857a0f3bf.js +0 -1
  379. package/.next/static/chunks/app/sessions/page-dc545a3d45374187.js +0 -1
  380. package/.next/static/chunks/app/worktrees/[id]/page-562c763045f66200.js +0 -1
  381. package/.next/static/css/eabd34bf2ab147a4.css +0 -1
  382. /package/.next/static/{SZPCFMNuIVbWNY8xv93Lf → uBCIYS1Hth7V4unroKqGu}/_buildManifest.js +0 -0
  383. /package/.next/static/{SZPCFMNuIVbWNY8xv93Lf → uBCIYS1Hth7V4unroKqGu}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"quickstart.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/quickstart.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAyBH,MAAM,WAAW,iBAAiB;IAChC,gCAAgC;IAChC,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAOD;;GAEG;AACH,wBAAsB,iBAAiB,CAAC,OAAO,GAAE,iBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC,CAGtF"}
1
+ {"version":3,"file":"quickstart.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/quickstart.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AA0BH,MAAM,WAAW,iBAAiB;IAChC,gCAAgC;IAChC,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAOD;;GAEG;AACH,wBAAsB,iBAAiB,CAAC,OAAO,GAAE,iBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC,CAGtF"}
@@ -12,6 +12,7 @@ const fs_1 = require("fs");
12
12
  const types_1 = require("../types");
13
13
  const logger_1 = require("../utils/logger");
14
14
  const daemon_1 = require("../utils/daemon");
15
+ const package_info_1 = require("../utils/package-info");
15
16
  const preflight_1 = require("../utils/preflight");
16
17
  const env_setup_1 = require("../utils/env-setup");
17
18
  const prompt_1 = require("../utils/prompt");
@@ -92,6 +93,10 @@ async function ensureServerRunning(daemonManager) {
92
93
  // start.ts reports an already-running server as START_FAILED, so it must not be called here
93
94
  const status = await daemonManager.getStatus();
94
95
  logger.info(`Server is already running (PID: ${status?.pid})`);
96
+ // Issue #1337: this branch returns the existing server's URL without restarting it, so
97
+ // running `npx commandmate@latest` over a still-running old daemon silently never delivers
98
+ // the newer code. Surface that mismatch so the user is not led to believe they are up to date.
99
+ warnOnVersionMismatch(status);
95
100
  // Issue #1266: getStatus() now gives .env precedence over exported variables, so the URL
96
101
  // it reports is the one the server is on; this no longer needs to be re-derived here
97
102
  return { url: status?.url };
@@ -103,6 +108,28 @@ async function ensureServerRunning(daemonManager) {
103
108
  await waitUntilReady(result.url);
104
109
  return { url: result.url };
105
110
  }
111
+ /**
112
+ * Warn when the already-running daemon is a different version than this CLI.
113
+ *
114
+ * Issue #1337: `npx commandmate@latest` over a still-running old daemon returns the existing URL
115
+ * without restarting, so a published fix silently never reaches the user, while `--version`
116
+ * reports the freshly-fetched CLI and hides the discrepancy. #1354 recorded the daemon's version
117
+ * in its state file; getStatus() surfaces it here so the mismatch becomes visible. This only
118
+ * warns — restarting automatically would kill any in-flight sessions the running server holds.
119
+ */
120
+ function warnOnVersionMismatch(status) {
121
+ const runningVersion = status?.version;
122
+ if (!runningVersion) {
123
+ // Legacy daemons (started before #1354) record no version; nothing to compare against.
124
+ return;
125
+ }
126
+ const cliVersion = (0, package_info_1.readPackageVersion)();
127
+ if (cliVersion && cliVersion !== runningVersion) {
128
+ logger.warn(`The running server is v${runningVersion} but this CLI is v${cliVersion}. ` +
129
+ 'This command does not restart it, so the running server stays on the old version. ' +
130
+ 'To update the running server, run "commandmate update".');
131
+ }
132
+ }
106
133
  /**
107
134
  * Poll the server until it accepts connections; a timeout is not fatal
108
135
  */
@@ -1 +1 @@
1
- {"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/status.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAA6B,aAAa,EAAE,MAAM,UAAU,CAAC;AAoFpE;;;;GAIG;AACH,wBAAsB,aAAa,CAAC,OAAO,GAAE,aAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,CAoF9E"}
1
+ {"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/status.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAA2C,aAAa,EAAE,MAAM,UAAU,CAAC;AA4GlF;;;;GAIG;AACH,wBAAsB,aAAa,CAAC,OAAO,GAAE,aAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,CAsF9E"}
@@ -13,8 +13,25 @@ const types_1 = require("../types");
13
13
  const logger_1 = require("../utils/logger");
14
14
  const daemon_1 = require("../utils/daemon");
15
15
  const env_setup_1 = require("../utils/env-setup");
16
+ const package_info_1 = require("../utils/package-info");
16
17
  const input_validators_1 = require("../utils/input-validators");
17
18
  const logger = new logger_1.CLILogger();
19
+ /**
20
+ * Print the running daemon's version and, when it differs from the installed CLI, a warning.
21
+ * Issue #1354: a new CLI over a still-running old daemon otherwise reports only "Running", so
22
+ * users cannot tell the server is not on the latest version.
23
+ */
24
+ function printVersionInfo(status) {
25
+ if (!status.version) {
26
+ return;
27
+ }
28
+ console.log(`Version: ${status.version}`);
29
+ const cliVersion = (0, package_info_1.readPackageVersion)();
30
+ if (cliVersion && cliVersion !== status.version) {
31
+ logger.warn(`Installed CLI is v${cliVersion} but the running server is v${status.version}. ` +
32
+ 'Restart the server ("commandmate stop && commandmate start") to run the current version.');
33
+ }
34
+ }
18
35
  /**
19
36
  * Show status for a single server (main or issue-specific)
20
37
  */
@@ -45,6 +62,7 @@ async function showSingleStatus(issueNo) {
45
62
  return;
46
63
  }
47
64
  console.log(`Status: Running (PID: ${status.pid})`);
65
+ printVersionInfo(status);
48
66
  if (status.port) {
49
67
  console.log(`Port: ${status.port}`);
50
68
  }
@@ -130,6 +148,7 @@ async function statusCommand(options = {}) {
130
148
  return;
131
149
  }
132
150
  console.log(`Status: Running (PID: ${status.pid})`);
151
+ printVersionInfo(status);
133
152
  if (status.port) {
134
153
  console.log(`Port: ${status.port}`);
135
154
  }
@@ -104,6 +104,12 @@ export interface DaemonStatus {
104
104
  uptime?: number;
105
105
  /** URL to access the server (if running) */
106
106
  url?: string;
107
+ /** Package version the running daemon was started with (Issue #1354) */
108
+ version?: string;
109
+ /** Protocol the running server speaks (Issue #1355) */
110
+ protocol?: 'http' | 'https';
111
+ /** Whether the running server has token authentication enabled (Issue #1355) */
112
+ auth?: boolean;
107
113
  }
108
114
  /**
109
115
  * System dependency definition
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cli/types/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;G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rB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,uCAAuC;AACvC,MAAM,WAAW,iBAAiB;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,uCAAuC;AACvC,MAAM,WAAW,iBAAiB;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAKtD"}
@@ -11,7 +11,7 @@
11
11
  * via tsconfig.cli.json set `"paths": {}`. Mirrors the existing pattern in
12
12
  * ../config/cli-tool-ids.ts.
13
13
  */
14
- import type { ApiClient } from './api-client';
14
+ import { type ApiClient } from './api-client';
15
15
  import type { AgentInstance } from '../types/api-responses';
16
16
  import { MAX_AGENT_INSTANCES, MAX_AGENT_ALIAS_LENGTH } from '../../lib/cli-tools/types';
17
17
  import { MIN_AGENT_INSTANCES } from '../../lib/agent-instances-validator';
@@ -1 +1 @@
1
- {"version":3,"file":"agent-instances.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/agent-instances.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,aAAa,EAA0B,MAAM,wBAAwB,CAAC;AACpF,OAAO,EAAE,mBAAmB,EAAE,sBAAsB,EAA2C,MAAM,2BAA2B,CAAC;AACjI,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAE1E,OAAO,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,CAAC;AAE5E;;GAEG;AACH,wBAAsB,mBAAmB,CAAC,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,M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IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC,GAAG,MAAM,CAM/F;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAKhE"}
@@ -18,6 +18,7 @@ exports.fetchAgentInstances = fetchAgentInstances;
18
18
  exports.saveAgentInstances = saveAgentInstances;
19
19
  exports.nextInstanceId = nextInstanceId;
20
20
  exports.defaultAlias = defaultAlias;
21
+ const api_client_1 = require("./api-client");
21
22
  const types_1 = require("../../lib/cli-tools/types");
22
23
  Object.defineProperty(exports, "MAX_AGENT_INSTANCES", { enumerable: true, get: function () { return types_1.MAX_AGENT_INSTANCES; } });
23
24
  Object.defineProperty(exports, "MAX_AGENT_ALIAS_LENGTH", { enumerable: true, get: function () { return types_1.MAX_AGENT_ALIAS_LENGTH; } });
@@ -28,7 +29,13 @@ Object.defineProperty(exports, "MIN_AGENT_INSTANCES", { enumerable: true, get: f
28
29
  */
29
30
  async function fetchAgentInstances(client, worktreeId) {
30
31
  const worktree = await client.get(`/api/worktrees/${worktreeId}`);
31
- return worktree.agentInstances ?? [];
32
+ // Issue #1357: a current daemon always includes agentInstances (an empty array
33
+ // when the worktree has no instances). Its absence means the running daemon
34
+ // predates the roster API, so silently returning [] here would look to the user
35
+ // like "no instances" and mask the real cause. Validate the field's presence so
36
+ // a stale daemon surfaces as an actionable version-skew error instead.
37
+ const validated = (0, api_client_1.assertResponseShape)(worktree, ['agentInstances'], 'GET /api/worktrees/:id (agent-instance roster)');
38
+ return validated.agentInstances;
32
39
  }
33
40
  /**
34
41
  * Persist a full roster replacement. `order` is re-normalized to array
@@ -84,4 +84,40 @@ export declare class ApiError extends Error {
84
84
  readonly statusCode?: number | undefined;
85
85
  constructor(message: string, exitCode: number, statusCode?: number | undefined);
86
86
  }
87
+ /**
88
+ * Assert that a parsed API response contains the given required top-level fields
89
+ * (Issue #1357).
90
+ *
91
+ * get<T>/post<T>/patch<T> cast the parsed body with `as T` and perform no runtime
92
+ * validation, so a response from a stale daemon that omits a field silently
93
+ * degrades to `undefined` downstream (e.g. a missing roster read as an empty
94
+ * roster). Route responses whose fields you depend on through this guard so a
95
+ * missing field surfaces as an actionable version-skew error instead of a silent
96
+ * wrong value.
97
+ *
98
+ * @param value - Parsed response body
99
+ * @param fields - Required top-level field names
100
+ * @param context - Short endpoint/response label included in the error message
101
+ * @returns value, typed as T, when it is an object and every required field is present
102
+ * @throws ApiError when value is not an object or a required field is absent
103
+ */
104
+ export declare function assertResponseShape<T>(value: unknown, fields: ReadonlyArray<keyof T & string>, context: string): T;
105
+ /**
106
+ * Read the version the running daemon reports via GET /api/app/update-check.
107
+ * Issue #1359 made that field a runtime package.json read, so it reflects the
108
+ * daemon's actual running code rather than a build-time constant.
109
+ *
110
+ * Returns undefined when the endpoint is unreachable or omits currentVersion (an
111
+ * older daemon predating the field) — callers treat that as "unknown", never as
112
+ * an error. Never throws.
113
+ */
114
+ export declare function fetchDaemonVersion(client: ApiClient): Promise<string | undefined>;
115
+ /**
116
+ * Compare this CLI's version against the running daemon's and print a stderr
117
+ * warning when they differ (Issue #1357). Advisory only: never throws, and stays
118
+ * silent when either version is unknown. Intended to run once per CLI invocation
119
+ * that connects to the server, so a stale daemon serving an older API is called
120
+ * out before its responses are misread.
121
+ */
122
+ export declare function warnIfVersionSkew(client: ApiClient): Promise<void>;
87
123
  //# sourceMappingURL=api-client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"api-client.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/api-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,4CAA4C;AAC5C,eAAO,MAAM,uBAAuB,MAAM,CAAC;AAK3C;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAErD;AAaD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAErD;AAED;;;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OAAO,EAAE,MAAM,EACC,QAAQ,EAAE,MAAM,EAChB,UAAU,CAAC,EAAE,MAAM,YAAA;CAKtC;AAkBD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EACnC,KAAK,EAAE,OAAO,EACd,MAAM,EAAE,aAAa,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,EACvC,OAAO,EAAE,MAAM,GACd,CAAC,CAiBH;AAOD;;;;;;;;GAQG;AACH,wBAAsB,kBAAkB,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CASvF;AAED;;;;;;GAMG;AACH,wBAAsB,iBAAiB,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CASxE"}
@@ -14,7 +14,11 @@ exports.isValidWorktreeId = isValidWorktreeId;
14
14
  exports.isValidInstanceId = isValidInstanceId;
15
15
  exports.resolveAuthToken = resolveAuthToken;
16
16
  exports.handleApiError = handleApiError;
17
+ exports.assertResponseShape = assertResponseShape;
18
+ exports.fetchDaemonVersion = fetchDaemonVersion;
19
+ exports.warnIfVersionSkew = warnIfVersionSkew;
17
20
  const types_1 = require("../types");
21
+ const package_info_1 = require("./package-info");
18
22
  /** Maximum stop-pattern length [SEC4-06] */
19
23
  exports.MAX_STOP_PATTERN_LENGTH = 500;
20
24
  /** Worktree ID validation pattern [SEC4-04] */
@@ -266,3 +270,81 @@ class ApiError extends Error {
266
270
  }
267
271
  }
268
272
  exports.ApiError = ApiError;
273
+ // =============================================================================
274
+ // Response shape validation & version-skew detection (Issue #1357)
275
+ // =============================================================================
276
+ /**
277
+ * Build the message shown when a daemon response is malformed or the CLI/daemon
278
+ * versions disagree. Always names the most likely cause — a stale daemon still
279
+ * running an older build than the installed CLI — and the concrete recovery.
280
+ */
281
+ function versionSkewMessage(detail) {
282
+ return (`${detail}. The running CommandMate server may be an older version than this CLI. ` +
283
+ `Restart it to pick up the current version: commandmate stop && commandmate start`);
284
+ }
285
+ /**
286
+ * Assert that a parsed API response contains the given required top-level fields
287
+ * (Issue #1357).
288
+ *
289
+ * get<T>/post<T>/patch<T> cast the parsed body with `as T` and perform no runtime
290
+ * validation, so a response from a stale daemon that omits a field silently
291
+ * degrades to `undefined` downstream (e.g. a missing roster read as an empty
292
+ * roster). Route responses whose fields you depend on through this guard so a
293
+ * missing field surfaces as an actionable version-skew error instead of a silent
294
+ * wrong value.
295
+ *
296
+ * @param value - Parsed response body
297
+ * @param fields - Required top-level field names
298
+ * @param context - Short endpoint/response label included in the error message
299
+ * @returns value, typed as T, when it is an object and every required field is present
300
+ * @throws ApiError when value is not an object or a required field is absent
301
+ */
302
+ function assertResponseShape(value, fields, context) {
303
+ if (value === null || typeof value !== 'object') {
304
+ throw new ApiError(versionSkewMessage(`${context}: expected an object from the server`), types_1.ExitCode.UNEXPECTED_ERROR);
305
+ }
306
+ const record = value;
307
+ for (const field of fields) {
308
+ if (!(field in record)) {
309
+ throw new ApiError(versionSkewMessage(`${context}: the server response is missing the "${field}" field`), types_1.ExitCode.UNEXPECTED_ERROR);
310
+ }
311
+ }
312
+ return value;
313
+ }
314
+ /**
315
+ * Read the version the running daemon reports via GET /api/app/update-check.
316
+ * Issue #1359 made that field a runtime package.json read, so it reflects the
317
+ * daemon's actual running code rather than a build-time constant.
318
+ *
319
+ * Returns undefined when the endpoint is unreachable or omits currentVersion (an
320
+ * older daemon predating the field) — callers treat that as "unknown", never as
321
+ * an error. Never throws.
322
+ */
323
+ async function fetchDaemonVersion(client) {
324
+ try {
325
+ const info = await client.get('/api/app/update-check');
326
+ return typeof info?.currentVersion === 'string' && info.currentVersion.length > 0
327
+ ? info.currentVersion
328
+ : undefined;
329
+ }
330
+ catch {
331
+ return undefined;
332
+ }
333
+ }
334
+ /**
335
+ * Compare this CLI's version against the running daemon's and print a stderr
336
+ * warning when they differ (Issue #1357). Advisory only: never throws, and stays
337
+ * silent when either version is unknown. Intended to run once per CLI invocation
338
+ * that connects to the server, so a stale daemon serving an older API is called
339
+ * out before its responses are misread.
340
+ */
341
+ async function warnIfVersionSkew(client) {
342
+ const cliVersion = (0, package_info_1.readPackageVersion)();
343
+ if (!cliVersion)
344
+ return;
345
+ const daemonVersion = await fetchDaemonVersion(client);
346
+ if (!daemonVersion || daemonVersion === cliVersion)
347
+ return;
348
+ console.error(`Warning: this CLI is version ${cliVersion} but the running CommandMate server is version ${daemonVersion}. ` +
349
+ `Restart the server to pick up the current version: commandmate stop && commandmate start`);
350
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"daemon.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/daemon.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAMtD,OAAO,EAA2C,SAAS,EAAE,MAAM,cAAc,CAAC;AAElF;;GAEG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,UAAU,CAAa;IAC/B,OAAO,CAAC,MAAM,CAAY;IAC1B,OAAO,CAAC,OAAO,CAAC,CAAS;IACzB,OAAO,CAAC,YAAY,CAAC,CAAY;IAEjC;;;;OAIG;gBACS,WAAW,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM;IAMjD;;;;;;OAMG;IACH,eAAe,IAAI,SAAS;IAK5B;;;;;OAKG;IACG,KAAK,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC;IAgGnD;;;;OAIG;IACG,IAAI,CAAC,KAAK,GAAE,OAAe,GAAG,OAAO,CAAC,OAAO,CAAC;IA8BpD;;;OAGG;IACG,SAAS,IAAI,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC;IA4B/C;;OAEG;IACG,SAAS,IAAI,OAAO,CAAC,OAAO,CAAC;IAInC;;OAEG;YACW,WAAW;CAiB1B"}
1
+ {"version":3,"file":"daemon.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/daemon.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAOtD,OAAO,EAA2C,SAAS,EAAE,MAAM,cAAc,CAAC;AAElF;;GAEG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,UAAU,CAAa;IAC/B,OAAO,CAAC,MAAM,CAAY;IAC1B,OAAO,CAAC,OAAO,CAAC,CAAS;IACzB,OAAO,CAAC,YAAY,CAAC,CAAY;IAEjC;;;;OAIG;gBACS,WAAW,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM;IAMjD;;;;;;OAMG;IACH,eAAe,IAAI,SAAS;IAK5B;;;;;OAKG;IACG,KAAK,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC;IA+GnD;;;;OAIG;IACG,IAAI,CAAC,KAAK,GAAE,OAAe,GAAG,OAAO,CAAC,OAAO,CAAC;IA8BpD;;;OAGG;IACG,SAAS,IAAI,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC;IAgD/C;;OAEG;IACG,SAAS,IAAI,OAAO,CAAC,OAAO,CAAC;IAInC;;OAEG;YACW,WAAW;CAiB1B"}
@@ -12,6 +12,7 @@ const dotenv_1 = require("dotenv");
12
12
  const pid_manager_1 = require("./pid-manager");
13
13
  const paths_1 = require("./paths");
14
14
  const env_setup_1 = require("./env-setup");
15
+ const package_info_1 = require("./package-info");
15
16
  const security_messages_1 = require("../config/security-messages");
16
17
  const logger_1 = require("./logger");
17
18
  const server_url_1 = require("./server-url");
@@ -116,9 +117,23 @@ class DaemonManager {
116
117
  // Unref to allow parent to exit
117
118
  child.unref();
118
119
  const pid = child.pid;
119
- // Write PID file atomically
120
- if (!this.pidManager.writePid(pid)) {
121
- // Failed to write PID - another process may have started
120
+ // Issue #1354/#1355/#1358: persist the daemon's version, effective settings, and a
121
+ // process-identity signature so status/stop/start can report and verify the actual server,
122
+ // not re-derive it from a possibly-diverged .env. The port/protocol/auth recorded here are
123
+ // exactly what start() handed the child above.
124
+ const state = {
125
+ pid,
126
+ version: (0, package_info_1.readPackageVersion)(),
127
+ port: parseInt(port, 10),
128
+ bind: bindAddress,
129
+ protocol,
130
+ auth: !!env.CM_AUTH_TOKEN_HASH,
131
+ startedAt: new Date().toISOString(),
132
+ startTime: this.pidManager.getStartTime(pid) ?? undefined,
133
+ };
134
+ // Write state file atomically
135
+ if (!this.pidManager.writeState(state)) {
136
+ // Failed to write state - another process may have started
122
137
  try {
123
138
  process.kill(pid, 'SIGTERM');
124
139
  }
@@ -162,24 +177,44 @@ class DaemonManager {
162
177
  * @returns Status object or null if no PID file
163
178
  */
164
179
  async getStatus() {
165
- const pid = this.pidManager.readPid();
166
- if (pid === null) {
180
+ const state = this.pidManager.readState();
181
+ if (state === null) {
167
182
  return null;
168
183
  }
169
184
  const running = this.pidManager.isProcessRunning();
170
185
  if (!running) {
171
186
  return { running: false };
172
187
  }
173
- // Issue #1266: resolve with the same precedence start() hands the child. Reading
174
- // process.env directly reported the shell's CM_PORT, not the port the server is on.
175
- const { port, url } = (0, server_url_1.resolveServerEndpoint)(this.getEffectiveEnv());
188
+ let port;
189
+ let url;
190
+ if (state.port !== undefined) {
191
+ // Issue #1355: report the effective settings the server was started with, recorded in the
192
+ // state file, rather than re-deriving them from a .env that may have changed since.
193
+ port = state.port;
194
+ const protocol = state.protocol ?? 'http';
195
+ const bind = state.bind ?? '127.0.0.1';
196
+ const host = bind === '0.0.0.0' ? '127.0.0.1' : bind;
197
+ url = `${protocol}://${host}:${port}`;
198
+ }
199
+ else {
200
+ // Legacy state file (PID only, e.g. a daemon started before this change): fall back to
201
+ // Issue #1266's .env resolution, which gives .env precedence exactly as start() does.
202
+ const resolved = (0, server_url_1.resolveServerEndpoint)(this.getEffectiveEnv());
203
+ port = resolved.port;
204
+ url = resolved.url;
205
+ }
176
206
  // Note: Getting accurate uptime would require storing start time
177
207
  // For now, we don't track uptime
178
208
  return {
179
209
  running: true,
180
- pid,
210
+ pid: state.pid,
181
211
  port,
182
212
  url,
213
+ // Issue #1354: surface the version the daemon actually runs, so status can flag a stale
214
+ // daemon of a different version than the installed CLI.
215
+ version: state.version,
216
+ protocol: state.protocol,
217
+ auth: state.auth,
183
218
  };
184
219
  }
185
220
  /**
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Package Info
3
+ * Issue #1354: record and report the version the daemon was started with
4
+ *
5
+ * The daemon records this at launch (into the state file) and `status` reads the currently
6
+ * installed version to warn when a stale daemon of a different version is still running.
7
+ */
8
+ /**
9
+ * Read the version from the installed package.json.
10
+ *
11
+ * Reads from disk rather than `require('../../package.json')` so a fresh `npm i -g` is observed
12
+ * without the module cache pinning the version that was current when this process started.
13
+ *
14
+ * @returns The version string, or undefined when package.json cannot be read or has no version
15
+ */
16
+ export declare function readPackageVersion(): string | undefined;
17
+ //# sourceMappingURL=package-info.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"package-info.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/package-info.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,GAAG,SAAS,CASvD"}
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ /**
3
+ * Package Info
4
+ * Issue #1354: record and report the version the daemon was started with
5
+ *
6
+ * The daemon records this at launch (into the state file) and `status` reads the currently
7
+ * installed version to warn when a stale daemon of a different version is still running.
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.readPackageVersion = readPackageVersion;
11
+ const fs_1 = require("fs");
12
+ const paths_1 = require("./paths");
13
+ /**
14
+ * Read the version from the installed package.json.
15
+ *
16
+ * Reads from disk rather than `require('../../package.json')` so a fresh `npm i -g` is observed
17
+ * without the module cache pinning the version that was current when this process started.
18
+ *
19
+ * @returns The version string, or undefined when package.json cannot be read or has no version
20
+ */
21
+ function readPackageVersion() {
22
+ try {
23
+ const parsed = JSON.parse((0, fs_1.readFileSync)((0, paths_1.getPackageJsonPath)(), 'utf-8'));
24
+ return typeof parsed.version === 'string' && parsed.version.length > 0
25
+ ? parsed.version
26
+ : undefined;
27
+ }
28
+ catch {
29
+ return undefined;
30
+ }
31
+ }
@@ -1,42 +1,98 @@
1
1
  /**
2
- * PID File Manager
2
+ * PID / Daemon State File Manager
3
3
  * Issue #96: npm install CLI support
4
4
  * Issue #136: Phase 2 - Task 2.4 - Added factory functions for Issue number support
5
+ * Issue #1354/#1355/#1358: the file now records the daemon's version, effective settings, and
6
+ * a process-identity signature, not just the PID. See DaemonState.
5
7
  * SF-1: SRP - Separated from daemon.ts for single responsibility
6
8
  * MF-SEC-2: TOCTOU protection with O_EXCL atomic writes
7
9
  */
10
+ import { ProcessStartTimeReader } from './process-inspector';
11
+ /**
12
+ * The daemon state persisted alongside the PID.
13
+ *
14
+ * Only `pid` is guaranteed: files written by older versions held just the PID as a bare integer,
15
+ * so every other field is optional and readState() tolerates their absence (backward compat).
16
+ */
17
+ export interface DaemonState {
18
+ /** Process ID of the daemon */
19
+ pid: number;
20
+ /** Package version the daemon was started with (Issue #1354) */
21
+ version?: string;
22
+ /** Effective port the server listens on (Issue #1355) */
23
+ port?: number;
24
+ /** Effective bind address, as configured (Issue #1355) */
25
+ bind?: string;
26
+ /** Effective protocol the server speaks (Issue #1355) */
27
+ protocol?: 'http' | 'https';
28
+ /** Whether token authentication was enabled at startup (Issue #1355) */
29
+ auth?: boolean;
30
+ /** ISO timestamp of when this record was written */
31
+ startedAt?: string;
32
+ /** OS-reported process start time, used to detect PID reuse (Issue #1358) */
33
+ startTime?: string;
34
+ }
8
35
  /**
9
36
  * PID file manager for daemon process tracking
10
37
  */
11
38
  export declare class PidManager {
12
39
  private readonly pidFilePath;
13
- constructor(pidFilePath: string);
40
+ private readonly readStartTime;
14
41
  /**
15
- * Check if PID file exists
42
+ * @param pidFilePath - Path to the state file for this server
43
+ * @param readStartTime - Injectable process-identity reader (Issue #1358); defaults to `ps`.
44
+ * Overridden in tests to avoid spawning a real process.
45
+ */
46
+ constructor(pidFilePath: string, readStartTime?: ProcessStartTimeReader);
47
+ /**
48
+ * Check if the state file exists
16
49
  */
17
50
  exists(): boolean;
18
51
  /**
19
- * Read PID from file
52
+ * Read the daemon state from file.
53
+ *
54
+ * Tolerates the legacy format (a bare integer PID) by returning `{ pid }`, so a state file
55
+ * written by an older running daemon is still understood after a CLI upgrade (Issue #1354).
56
+ *
57
+ * @returns The daemon state, or null when the file is missing or invalid
58
+ */
59
+ readState(): DaemonState | null;
60
+ /**
61
+ * Read PID from the state file
20
62
  * @returns PID number or null if file doesn't exist or is invalid
21
63
  */
22
64
  readPid(): number | null;
23
65
  /**
24
- * Write PID to file atomically
66
+ * Write the daemon state to file atomically
25
67
  * MF-SEC-2: Uses O_EXCL to prevent TOCTOU race conditions
26
68
  *
27
69
  * @returns true if successful, false if file already exists
28
70
  * @throws Error for other filesystem errors
29
71
  */
30
- writePid(pid: number): boolean;
72
+ writeState(state: DaemonState): boolean;
31
73
  /**
32
- * Remove PID file
74
+ * Read a live process's start-time signature via the injected reader.
75
+ * Used by start() to record the daemon's identity at launch (Issue #1358).
76
+ *
77
+ * @param pid - Process ID to inspect
78
+ * @returns The start-time signature, or null when it cannot be read
79
+ */
80
+ getStartTime(pid: number): string | null;
81
+ /**
82
+ * Remove the state file
33
83
  */
34
84
  removePid(): void;
35
85
  /**
36
- * Check if the process recorded in PID file is running
86
+ * Check if the process recorded in the state file is the daemon we started.
37
87
  * NTH-1: ISP - Lightweight process check API
38
88
  *
39
- * @returns true if process is running, false otherwise
89
+ * Issue #1358: `process.kill(pid, 0)` alone only proves the PID is in use. When the state
90
+ * records a start-time signature, the live process's is compared to catch PID reuse; a
91
+ * mismatch is treated as not-running so stop() never kills, and start() never defers to, an
92
+ * unrelated process. EPERM (the PID was reused by a process we don't own) is likewise treated
93
+ * as stale rather than thrown, so a reused PID no longer crashes the command.
94
+ *
95
+ * @returns true if the daemon is running, false otherwise
40
96
  */
41
97
  isProcessRunning(): boolean;
42
98
  }
@@ -1 +1 @@
1
- {"version":3,"file":"pid-manager.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/pid-manager.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAaH;;GAEG;AACH,qBAAa,UAAU;IACT,OAAO,CAAC,QAAQ,CAAC,WAAW;gBAAX,WAAW,EAAE,MAAM;IAEhD;;OAEG;IACH,MAAM,IAAI,OAAO;IAIjB;;;OAGG;IACH,OAAO,IAAI,MAAM,GAAG,IAAI;IAmBxB;;;;;;OAMG;IACH,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAwB9B;;OAEG;IACH,SAAS,IAAI,IAAI;IAUjB;;;;;OAKG;IACH,gBAAgB,IAAI,OAAO;CAmB5B;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,UAAU,CAI7D;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,CAEjE"}
1
+ {"version":3,"file":"pid-manager.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/pid-manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAYH,OAAO,EAAuB,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAElF;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC1B,+BAA+B;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,gEAAgE;IAChE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,yDAAyD;IACzD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,0DAA0D;IAC1D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,yDAAyD;IACzD,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5B,wEAAwE;IACxE,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,oDAAoD;IACpD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6EAA6E;IAC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