commandmate 0.10.3 → 0.11.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 (396) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-build-manifest.json +155 -155
  3. package/.next/app-path-routes-manifest.json +30 -30
  4. package/.next/build-manifest.json +2 -2
  5. package/.next/prerender-manifest.json +12 -12
  6. package/.next/required-server-files.json +1 -1
  7. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  8. package/.next/server/app/api/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/2119.js +1 -1
  301. package/.next/server/chunks/233.js +1 -1
  302. package/.next/server/chunks/2404.js +1 -1
  303. package/.next/server/chunks/2445.js +1 -1
  304. package/.next/server/chunks/3270.js +1 -1
  305. package/.next/server/chunks/3480.js +2 -2
  306. package/.next/server/chunks/3543.js +1 -1
  307. package/.next/server/chunks/3945.js +1 -1
  308. package/.next/server/chunks/406.js +47 -0
  309. package/.next/server/chunks/4444.js +1 -1
  310. package/.next/server/chunks/5381.js +1 -47
  311. package/.next/server/chunks/5959.js +2 -2
  312. package/.next/server/chunks/646.js +33 -0
  313. package/.next/server/chunks/8681.js +1 -0
  314. package/.next/server/chunks/8807.js +305 -300
  315. package/.next/server/chunks/9067.js +1 -1
  316. package/.next/server/chunks/9355.js +1 -1
  317. package/.next/server/chunks/9687.js +1 -1
  318. package/.next/server/middleware-manifest.json +5 -5
  319. package/.next/server/pages/500.html +1 -1
  320. package/.next/server/pages-manifest.json +1 -1
  321. package/.next/server/server-reference-manifest.json +1 -1
  322. package/.next/static/chunks/4560-2bf9cb6504cc4425.js +1 -0
  323. package/.next/static/chunks/7347-7ee39e14be89e508.js +1 -0
  324. package/.next/static/chunks/app/chat/page-5d20240f98c07cee.js +1 -0
  325. package/.next/static/chunks/app/layout-fe5857360dfba2b9.js +1 -0
  326. package/.next/static/chunks/app/more/page-af1d2af13ea901d2.js +1 -0
  327. package/.next/static/chunks/app/page-3bbe737ec910d1fb.js +1 -0
  328. package/.next/static/chunks/app/repositories/page-ace9134ac165a6de.js +1 -0
  329. package/.next/static/chunks/app/review/page-331b80f4f58582bc.js +1 -0
  330. package/.next/static/chunks/app/sessions/page-d694149a7e8649b6.js +1 -0
  331. package/.next/static/chunks/app/worktrees/[id]/page-1c311aaa0950db1e.js +1 -0
  332. package/.next/static/css/d7e2e8d1b8d69d36.css +1 -0
  333. package/.next/trace +10 -10
  334. package/dist/cli/commands/quickstart.d.ts.map +1 -1
  335. package/dist/cli/commands/quickstart.js +27 -0
  336. package/dist/cli/commands/status.d.ts.map +1 -1
  337. package/dist/cli/commands/status.js +19 -0
  338. package/dist/cli/commands/update.d.ts.map +1 -1
  339. package/dist/cli/commands/update.js +178 -1
  340. package/dist/cli/program.d.ts.map +1 -1
  341. package/dist/cli/program.js +6 -0
  342. package/dist/cli/types/index.d.ts +13 -0
  343. package/dist/cli/types/index.d.ts.map +1 -1
  344. package/dist/cli/utils/agent-instances.d.ts +1 -1
  345. package/dist/cli/utils/agent-instances.d.ts.map +1 -1
  346. package/dist/cli/utils/agent-instances.js +8 -1
  347. package/dist/cli/utils/api-client.d.ts +36 -0
  348. package/dist/cli/utils/api-client.d.ts.map +1 -1
  349. package/dist/cli/utils/api-client.js +82 -0
  350. package/dist/cli/utils/daemon.d.ts.map +1 -1
  351. package/dist/cli/utils/daemon.js +44 -9
  352. package/dist/cli/utils/npx-runner.d.ts +88 -0
  353. package/dist/cli/utils/npx-runner.d.ts.map +1 -0
  354. package/dist/cli/utils/npx-runner.js +165 -0
  355. package/dist/cli/utils/package-info.d.ts +17 -0
  356. package/dist/cli/utils/package-info.d.ts.map +1 -0
  357. package/dist/cli/utils/package-info.js +31 -0
  358. package/dist/cli/utils/pid-manager.d.ts +65 -9
  359. package/dist/cli/utils/pid-manager.d.ts.map +1 -1
  360. package/dist/cli/utils/pid-manager.js +81 -21
  361. package/dist/cli/utils/process-inspector.d.ts +27 -0
  362. package/dist/cli/utils/process-inspector.d.ts.map +1 -0
  363. package/dist/cli/utils/process-inspector.js +37 -0
  364. package/dist/lib/app-update/update-lock.d.ts +39 -0
  365. package/dist/lib/app-update/update-lock.d.ts.map +1 -0
  366. package/dist/lib/app-update/update-lock.js +116 -0
  367. package/dist/server/src/config/github-links.js +22 -0
  368. package/dist/server/src/lib/db/db-instance.js +22 -3
  369. package/dist/server/src/lib/db/db-repository.js +107 -19
  370. package/dist/server/src/lib/db/db.js +3 -2
  371. package/dist/server/src/lib/db/memo-db.js +32 -1
  372. package/dist/server/src/lib/db/migrations/index.js +2 -0
  373. package/dist/server/src/lib/db/migrations/runner.js +11 -1
  374. package/dist/server/src/lib/db/migrations/v43-remove-cm-root-dir-ghost-repository.js +126 -0
  375. package/dist/server/src/lib/git/worktrees.js +90 -0
  376. package/dist/server/src/lib/job-executor.js +8 -2
  377. package/dist/server/src/lib/realtime/types.js +76 -0
  378. package/dist/server/src/lib/schedule-manager.js +9 -1
  379. package/dist/server/src/lib/version-checker.js +297 -0
  380. package/dist/server/src/lib/ws-server.js +37 -0
  381. package/package.json +1 -1
  382. package/.next/server/chunks/2464.js +0 -33
  383. package/.next/server/chunks/6791.js +0 -47
  384. package/.next/static/chunks/7347-4a031aecf4664a6d.js +0 -1
  385. package/.next/static/chunks/8954-ce15ee4d0423f1b1.js +0 -1
  386. package/.next/static/chunks/app/chat/page-dee86bdf87516e40.js +0 -1
  387. package/.next/static/chunks/app/layout-d02f4691a4eff86b.js +0 -1
  388. package/.next/static/chunks/app/more/page-39ec8b5f27cf52e7.js +0 -1
  389. package/.next/static/chunks/app/page-ebf1db9826b4065d.js +0 -1
  390. package/.next/static/chunks/app/repositories/page-2be54cae5fcc1f7a.js +0 -1
  391. package/.next/static/chunks/app/review/page-ac4efe6857a0f3bf.js +0 -1
  392. package/.next/static/chunks/app/sessions/page-dc545a3d45374187.js +0 -1
  393. package/.next/static/chunks/app/worktrees/[id]/page-9eb2f37809919531.js +0 -1
  394. package/.next/static/css/eabd34bf2ab147a4.css +0 -1
  395. /package/.next/static/{Ndx_NzkoP54cD0UCmjUlu → 8yp8SRJ9h3Uj75SpHLYpl}/_buildManifest.js +0 -0
  396. /package/.next/static/{Ndx_NzkoP54cD0UCmjUlu → 8yp8SRJ9h3Uj75SpHLYpl}/_ssgManifest.js +0 -0
@@ -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,88 @@
1
+ /**
2
+ * npx Execution Wrapper
3
+ * Issue #1395: GUI one-click self-update for npx-launched servers.
4
+ *
5
+ * The npx self-update fetches a fresh npx cache and relaunches the daemon from
6
+ * it (design §2.1), rather than mutating a global install (rejected Alt C). This
7
+ * module owns the two npx spawns and the env hygiene they need:
8
+ *
9
+ * - `warmNpxLatest` — force-download the latest and read back its version, so
10
+ * staleness can be caught *before* the old daemon is stopped (design §4.2).
11
+ * - `spawnNpxDaemon` — relaunch the server from the freshly-cached version.
12
+ * - `sanitizeNpxEnv` — strip the `npm_*` env a `npm run start` parent leaks, so
13
+ * it cannot skew npx's registry/cache/prefix resolution (design §7.3).
14
+ *
15
+ * MF-SEC-1 (mirrors npm-runner): every command uses spawnSync with array args,
16
+ * never a shell string. `packageName` is always a literal constant supplied by
17
+ * the caller (update.ts PACKAGE_NAME) — never built from request input (§5).
18
+ *
19
+ * @module npx-runner
20
+ */
21
+ /**
22
+ * Upper bound for the warmup download.
23
+ *
24
+ * The warmup runs *before* the old daemon is stopped, so hitting this bound
25
+ * aborts with zero downtime (design §4.2). Kept comfortably under the banner's
26
+ * UPDATE_TIMEOUT_MS (5 min, UpdateNotificationBanner.tsx) so a stalled download
27
+ * aborts and logs before the GUI gives up (design §8.2 / §9-8).
28
+ */
29
+ export declare const NPX_WARMUP_TIMEOUT_MS: number;
30
+ /** Result of the warmup + version query */
31
+ export interface NpxWarmResult {
32
+ /** Whether the warmup succeeded and a version was read */
33
+ success: boolean;
34
+ /** Version reported by `<pkg> --version` (only when success) */
35
+ version?: string;
36
+ /** Human readable failure reason (only when !success) */
37
+ error?: string;
38
+ }
39
+ /** Result of the daemon relaunch */
40
+ export interface NpxDaemonResult {
41
+ /** Whether the relaunch exited 0 */
42
+ success: boolean;
43
+ /** Exit status of the npx process (null when it never ran) */
44
+ status: number | null;
45
+ /** Human readable failure reason (only when !success) */
46
+ error?: string;
47
+ }
48
+ /**
49
+ * Build an env for an npx spawn with the leaked `npm_*` variables removed.
50
+ *
51
+ * A server started by `npm run start` carries `npm_config_*` / `npm_lifecycle_*`
52
+ * / `npm_package_*` in its env; those flow down the inherit chain into the npx
53
+ * call and npx reads `npm_config_*` as configuration, which would silently
54
+ * redirect its registry/cache/prefix (design §7.3). Everything else — notably
55
+ * `CM_*` (config continuity) and `PATH` (needed to locate npx) — passes through.
56
+ *
57
+ * @param env - Source env (defaults to the current process env)
58
+ * @returns A fresh env object with all `npm_*` keys removed
59
+ */
60
+ export declare function sanitizeNpxEnv(env?: Record<string, string | undefined>): NodeJS.ProcessEnv;
61
+ /**
62
+ * Force-fetch the latest published version via npx and read back its version.
63
+ *
64
+ * `npx --yes <pkg>@latest --version` downloads the latest into the npx cache
65
+ * (`--yes` suppresses the install prompt) and prints the package version;
66
+ * commander's `.version()` short-circuits before any command runs, so this has
67
+ * no side effects and starts no server (design §2.1). Running it before the
68
+ * stop lets a stale/failed fetch abort with zero downtime (design §4.2).
69
+ *
70
+ * @param packageName - Package name (a literal constant, e.g. `commandmate`)
71
+ * @returns The fetched version, or a classified failure
72
+ */
73
+ export declare function warmNpxLatest(packageName: string): NpxWarmResult;
74
+ /**
75
+ * Relaunch the server as a daemon from the freshly-cached npx version.
76
+ *
77
+ * `npx --yes <pkg>@latest start --daemon` runs the just-warmed package (so no
78
+ * new download) and spawns `npm run start` from the new cache dir; the npx
79
+ * process exits once the daemon is detached. `start --daemon` is used rather
80
+ * than the bare quickstart, which bails in a non-interactive process (design
81
+ * §2.1). The call blocks until npx exits, so the exit status is the relaunch
82
+ * outcome. Output is echoed so it lands in the update log.
83
+ *
84
+ * @param packageName - Package name (a literal constant, e.g. `commandmate`)
85
+ * @returns Success, or a classified failure carrying the exit status
86
+ */
87
+ export declare function spawnNpxDaemon(packageName: string): NpxDaemonResult;
88
+ //# sourceMappingURL=npx-runner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"npx-runner.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/npx-runner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAIH;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,QAAgB,CAAC;AAEnD,2CAA2C;AAC3C,MAAM,WAAW,aAAa;IAC5B,0DAA0D;IAC1D,OAAO,EAAE,OAAO,CAAC;IACjB,gEAAgE;IAChE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,yDAAyD;IACzD,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,oCAAoC;AACpC,MAAM,WAAW,eAAe;IAC9B,oCAAoC;IACpC,OAAO,EAAE,OAAO,CAAC;IACjB,8DAA8D;IAC9D,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,yDAAyD;IACzD,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,cAAc,CAC5B,GAAG,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAe,GACpD,MAAM,CAAC,UAAU,CAWnB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAAC,WAAW,EAAE,MAAM,GAAG,aAAa,CAoChE;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,eAAe,CAyCnE"}
@@ -0,0 +1,165 @@
1
+ "use strict";
2
+ /**
3
+ * npx Execution Wrapper
4
+ * Issue #1395: GUI one-click self-update for npx-launched servers.
5
+ *
6
+ * The npx self-update fetches a fresh npx cache and relaunches the daemon from
7
+ * it (design §2.1), rather than mutating a global install (rejected Alt C). This
8
+ * module owns the two npx spawns and the env hygiene they need:
9
+ *
10
+ * - `warmNpxLatest` — force-download the latest and read back its version, so
11
+ * staleness can be caught *before* the old daemon is stopped (design §4.2).
12
+ * - `spawnNpxDaemon` — relaunch the server from the freshly-cached version.
13
+ * - `sanitizeNpxEnv` — strip the `npm_*` env a `npm run start` parent leaks, so
14
+ * it cannot skew npx's registry/cache/prefix resolution (design §7.3).
15
+ *
16
+ * MF-SEC-1 (mirrors npm-runner): every command uses spawnSync with array args,
17
+ * never a shell string. `packageName` is always a literal constant supplied by
18
+ * the caller (update.ts PACKAGE_NAME) — never built from request input (§5).
19
+ *
20
+ * @module npx-runner
21
+ */
22
+ Object.defineProperty(exports, "__esModule", { value: true });
23
+ exports.NPX_WARMUP_TIMEOUT_MS = void 0;
24
+ exports.sanitizeNpxEnv = sanitizeNpxEnv;
25
+ exports.warmNpxLatest = warmNpxLatest;
26
+ exports.spawnNpxDaemon = spawnNpxDaemon;
27
+ const child_process_1 = require("child_process");
28
+ /**
29
+ * Upper bound for the warmup download.
30
+ *
31
+ * The warmup runs *before* the old daemon is stopped, so hitting this bound
32
+ * aborts with zero downtime (design §4.2). Kept comfortably under the banner's
33
+ * UPDATE_TIMEOUT_MS (5 min, UpdateNotificationBanner.tsx) so a stalled download
34
+ * aborts and logs before the GUI gives up (design §8.2 / §9-8).
35
+ */
36
+ exports.NPX_WARMUP_TIMEOUT_MS = 3 * 60 * 1000;
37
+ /**
38
+ * Build an env for an npx spawn with the leaked `npm_*` variables removed.
39
+ *
40
+ * A server started by `npm run start` carries `npm_config_*` / `npm_lifecycle_*`
41
+ * / `npm_package_*` in its env; those flow down the inherit chain into the npx
42
+ * call and npx reads `npm_config_*` as configuration, which would silently
43
+ * redirect its registry/cache/prefix (design §7.3). Everything else — notably
44
+ * `CM_*` (config continuity) and `PATH` (needed to locate npx) — passes through.
45
+ *
46
+ * @param env - Source env (defaults to the current process env)
47
+ * @returns A fresh env object with all `npm_*` keys removed
48
+ */
49
+ function sanitizeNpxEnv(env = process.env) {
50
+ // Built as a plain record: the project augments ProcessEnv with a required
51
+ // NODE_ENV, so an empty ProcessEnv literal would not typecheck.
52
+ const clean = {};
53
+ for (const [key, value] of Object.entries(env)) {
54
+ if (/^npm_/i.test(key)) {
55
+ continue;
56
+ }
57
+ clean[key] = value;
58
+ }
59
+ return clean;
60
+ }
61
+ /**
62
+ * Force-fetch the latest published version via npx and read back its version.
63
+ *
64
+ * `npx --yes <pkg>@latest --version` downloads the latest into the npx cache
65
+ * (`--yes` suppresses the install prompt) and prints the package version;
66
+ * commander's `.version()` short-circuits before any command runs, so this has
67
+ * no side effects and starts no server (design §2.1). Running it before the
68
+ * stop lets a stale/failed fetch abort with zero downtime (design §4.2).
69
+ *
70
+ * @param packageName - Package name (a literal constant, e.g. `commandmate`)
71
+ * @returns The fetched version, or a classified failure
72
+ */
73
+ function warmNpxLatest(packageName) {
74
+ const result = (0, child_process_1.spawnSync)('npx', ['--yes', `${packageName}@latest`, '--version'], {
75
+ encoding: 'utf-8',
76
+ timeout: exports.NPX_WARMUP_TIMEOUT_MS,
77
+ env: sanitizeNpxEnv(),
78
+ });
79
+ if (result.error) {
80
+ const errnoError = result.error;
81
+ if (errnoError.code === 'ENOENT') {
82
+ return {
83
+ success: false,
84
+ error: 'npx command not found. Install Node.js/npm and try again.',
85
+ };
86
+ }
87
+ return { success: false, error: errnoError.message };
88
+ }
89
+ if (result.status !== 0) {
90
+ const stderr = readStream(result.stderr);
91
+ return {
92
+ success: false,
93
+ error: stderr || `npx exited with status ${String(result.status)}`,
94
+ };
95
+ }
96
+ const version = parseVersion(readStream(result.stdout));
97
+ if (!version) {
98
+ return { success: false, error: 'npx did not report a version' };
99
+ }
100
+ return { success: true, version };
101
+ }
102
+ /**
103
+ * Relaunch the server as a daemon from the freshly-cached npx version.
104
+ *
105
+ * `npx --yes <pkg>@latest start --daemon` runs the just-warmed package (so no
106
+ * new download) and spawns `npm run start` from the new cache dir; the npx
107
+ * process exits once the daemon is detached. `start --daemon` is used rather
108
+ * than the bare quickstart, which bails in a non-interactive process (design
109
+ * §2.1). The call blocks until npx exits, so the exit status is the relaunch
110
+ * outcome. Output is echoed so it lands in the update log.
111
+ *
112
+ * @param packageName - Package name (a literal constant, e.g. `commandmate`)
113
+ * @returns Success, or a classified failure carrying the exit status
114
+ */
115
+ function spawnNpxDaemon(packageName) {
116
+ const result = (0, child_process_1.spawnSync)('npx', ['--yes', `${packageName}@latest`, 'start', '--daemon'], {
117
+ encoding: 'utf-8',
118
+ env: sanitizeNpxEnv(),
119
+ });
120
+ const stdout = readStream(result.stdout);
121
+ const stderr = readStream(result.stderr);
122
+ if (stdout) {
123
+ console.log(stdout);
124
+ }
125
+ if (stderr) {
126
+ console.error(stderr);
127
+ }
128
+ if (result.error) {
129
+ const errnoError = result.error;
130
+ if (errnoError.code === 'ENOENT') {
131
+ return {
132
+ success: false,
133
+ status: null,
134
+ error: 'npx command not found. Install Node.js/npm and try again.',
135
+ };
136
+ }
137
+ return { success: false, status: result.status, error: errnoError.message };
138
+ }
139
+ if (result.status !== 0) {
140
+ return {
141
+ success: false,
142
+ status: result.status,
143
+ error: stderr || `npx start exited with status ${String(result.status)}`,
144
+ };
145
+ }
146
+ return { success: true, status: 0 };
147
+ }
148
+ /**
149
+ * Extract the first semver-looking token from `--version` output.
150
+ * Robust against npx warning noise that may share the stream.
151
+ */
152
+ function parseVersion(output) {
153
+ const match = output.match(/\b(\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?)\b/);
154
+ return match ? match[1] : null;
155
+ }
156
+ /**
157
+ * Read a spawnSync stream as a trimmed string.
158
+ * `encoding: 'utf-8'` yields strings, but mocks/edge cases may yield null.
159
+ */
160
+ function readStream(stream) {
161
+ if (typeof stream === 'string') {
162
+ return stream.trim();
163
+ }
164
+ return '';
165
+ }
@@ -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;IAC7E,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,qBAAa,UAAU;IAOnB,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,aAAa;IAPhC;;;;OAIG;gBAEgB,WAAW,EAAE,MAAM,EACnB,aAAa,GAAE,sBAA4C;IAG9E;;OAEG;IACH,MAAM,IAAI,OAAO;IAIjB;;;;;;;OAOG;IACH,SAAS,IAAI,WAAW,GAAG,IAAI;IA2B/B;;;OAGG;IACH,OAAO,IAAI,MAAM,GAAG,IAAI;IAIxB;;;;;;OAMG;IACH,UAAU,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO;IAwBvC;;;;;;OAMG;IACH,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAIxC;;OAEG;IACH,SAAS,IAAI,IAAI;IAUjB;;;;;;;;;;;OAWG;IACH,gBAAgB,IAAI,OAAO;CAoC5B;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"}