commandmate 0.41.0 → 0.42.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 (354) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-build-manifest.json +356 -356
  3. package/.next/app-path-routes-manifest.json +33 -33
  4. package/.next/build-manifest.json +5 -5
  5. package/.next/prerender-manifest.json +9 -9
  6. package/.next/react-loadable-manifest.json +1 -1
  7. package/.next/required-server-files.json +1 -1
  8. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  9. package/.next/server/app/api/agents/update/route.js +1 -1
  10. package/.next/server/app/api/agents/update/route_client-reference-manifest.js +1 -1
  11. package/.next/server/app/api/agents/versions/route.js +1 -1
  12. package/.next/server/app/api/agents/versions/route_client-reference-manifest.js +1 -1
  13. package/.next/server/app/api/app/release-notes/route_client-reference-manifest.js +1 -1
  14. package/.next/server/app/api/app/update/route_client-reference-manifest.js +1 -1
  15. package/.next/server/app/api/app/update-check/route.js +1 -1
  16. package/.next/server/app/api/app/update-check/route_client-reference-manifest.js +1 -1
  17. package/.next/server/app/api/auth/login/route_client-reference-manifest.js +1 -1
  18. package/.next/server/app/api/auth/logout/route_client-reference-manifest.js +1 -1
  19. package/.next/server/app/api/auth/status/route_client-reference-manifest.js +1 -1
  20. package/.next/server/app/api/capabilities/route.js +1 -1
  21. package/.next/server/app/api/capabilities/route_client-reference-manifest.js +1 -1
  22. package/.next/server/app/api/daily-summary/route_client-reference-manifest.js +1 -1
  23. package/.next/server/app/api/daily-summary/status/route_client-reference-manifest.js +1 -1
  24. package/.next/server/app/api/external-apps/[id]/health/route_client-reference-manifest.js +1 -1
  25. package/.next/server/app/api/external-apps/[id]/route_client-reference-manifest.js +1 -1
  26. package/.next/server/app/api/external-apps/route_client-reference-manifest.js +1 -1
  27. package/.next/server/app/api/fs/browse/route_client-reference-manifest.js +1 -1
  28. package/.next/server/app/api/fs/recent-paths/route_client-reference-manifest.js +1 -1
  29. package/.next/server/app/api/hooks/agent-event/route.js +1 -1
  30. package/.next/server/app/api/hooks/agent-event/route.js.nft.json +1 -1
  31. package/.next/server/app/api/hooks/agent-event/route_client-reference-manifest.js +1 -1
  32. package/.next/server/app/api/hooks/claude-done/route.js +2 -2
  33. package/.next/server/app/api/hooks/claude-done/route.js.nft.json +1 -1
  34. package/.next/server/app/api/hooks/claude-done/route_client-reference-manifest.js +1 -1
  35. package/.next/server/app/api/hooks/permission-request/route.js +1 -1
  36. package/.next/server/app/api/hooks/permission-request/route.js.nft.json +1 -1
  37. package/.next/server/app/api/hooks/permission-request/route_client-reference-manifest.js +1 -1
  38. package/.next/server/app/api/metrics/vibe/route_client-reference-manifest.js +1 -1
  39. package/.next/server/app/api/ollama/models/route_client-reference-manifest.js +1 -1
  40. package/.next/server/app/api/push/escalation/route_client-reference-manifest.js +1 -1
  41. package/.next/server/app/api/push/subscriptions/route_client-reference-manifest.js +1 -1
  42. package/.next/server/app/api/push/vapid/route_client-reference-manifest.js +1 -1
  43. package/.next/server/app/api/relays/[relayId]/cancel/route.js +1 -1
  44. package/.next/server/app/api/relays/[relayId]/cancel/route.js.nft.json +1 -1
  45. package/.next/server/app/api/relays/[relayId]/cancel/route_client-reference-manifest.js +1 -1
  46. package/.next/server/app/api/relays/route.js +1 -1
  47. package/.next/server/app/api/relays/route.js.nft.json +1 -1
  48. package/.next/server/app/api/relays/route_client-reference-manifest.js +1 -1
  49. package/.next/server/app/api/remote/pair/route_client-reference-manifest.js +1 -1
  50. package/.next/server/app/api/repositories/[id]/route_client-reference-manifest.js +1 -1
  51. package/.next/server/app/api/repositories/clone/[jobId]/route.js +1 -1
  52. package/.next/server/app/api/repositories/clone/[jobId]/route.js.nft.json +1 -1
  53. package/.next/server/app/api/repositories/clone/[jobId]/route_client-reference-manifest.js +1 -1
  54. package/.next/server/app/api/repositories/clone/route.js +1 -1
  55. package/.next/server/app/api/repositories/clone/route.js.nft.json +1 -1
  56. package/.next/server/app/api/repositories/clone/route_client-reference-manifest.js +1 -1
  57. package/.next/server/app/api/repositories/excluded/route_client-reference-manifest.js +1 -1
  58. package/.next/server/app/api/repositories/restore/route.js +1 -1
  59. package/.next/server/app/api/repositories/restore/route.js.nft.json +1 -1
  60. package/.next/server/app/api/repositories/restore/route_client-reference-manifest.js +1 -1
  61. package/.next/server/app/api/repositories/route.js +1 -1
  62. package/.next/server/app/api/repositories/route.js.nft.json +1 -1
  63. package/.next/server/app/api/repositories/route_client-reference-manifest.js +1 -1
  64. package/.next/server/app/api/repositories/scan/route.js +1 -1
  65. package/.next/server/app/api/repositories/scan/route.js.nft.json +1 -1
  66. package/.next/server/app/api/repositories/scan/route_client-reference-manifest.js +1 -1
  67. package/.next/server/app/api/repositories/sync/route.js +1 -1
  68. package/.next/server/app/api/repositories/sync/route.js.nft.json +1 -1
  69. package/.next/server/app/api/repositories/sync/route_client-reference-manifest.js +1 -1
  70. package/.next/server/app/api/repositories/validate-path/route_client-reference-manifest.js +1 -1
  71. package/.next/server/app/api/settings/default-agents/route.js +1 -1
  72. package/.next/server/app/api/settings/default-agents/route.js.nft.json +1 -1
  73. package/.next/server/app/api/settings/default-agents/route_client-reference-manifest.js +1 -1
  74. package/.next/server/app/api/settings/default-surface-mode/route_client-reference-manifest.js +1 -1
  75. package/.next/server/app/api/sidebar/group-order/route_client-reference-manifest.js +1 -1
  76. package/.next/server/app/api/skills/[id]/route_client-reference-manifest.js +1 -1
  77. package/.next/server/app/api/skills/installations/route_client-reference-manifest.js +1 -1
  78. package/.next/server/app/api/skills/operations/route_client-reference-manifest.js +1 -1
  79. package/.next/server/app/api/skills/reindex/route_client-reference-manifest.js +1 -1
  80. package/.next/server/app/api/skills/route_client-reference-manifest.js +1 -1
  81. package/.next/server/app/api/slash-commands/route.js.nft.json +1 -1
  82. package/.next/server/app/api/slash-commands/route_client-reference-manifest.js +1 -1
  83. package/.next/server/app/api/tasks/[taskId]/cancel/route_client-reference-manifest.js +1 -1
  84. package/.next/server/app/api/tasks/[taskId]/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/verification/runs/[runId]/route_client-reference-manifest.js +1 -1
  88. package/.next/server/app/api/verification/runs/route_client-reference-manifest.js +1 -1
  89. package/.next/server/app/api/worktrees/[id]/auto-yes/route.js +1 -1
  90. package/.next/server/app/api/worktrees/[id]/auto-yes/route.js.nft.json +1 -1
  91. package/.next/server/app/api/worktrees/[id]/auto-yes/route_client-reference-manifest.js +1 -1
  92. package/.next/server/app/api/worktrees/[id]/capture/route.js +1 -1
  93. package/.next/server/app/api/worktrees/[id]/capture/route.js.nft.json +1 -1
  94. package/.next/server/app/api/worktrees/[id]/capture/route_client-reference-manifest.js +1 -1
  95. package/.next/server/app/api/worktrees/[id]/clear-composer/route.js +1 -1
  96. package/.next/server/app/api/worktrees/[id]/clear-composer/route.js.nft.json +1 -1
  97. package/.next/server/app/api/worktrees/[id]/clear-composer/route_client-reference-manifest.js +1 -1
  98. package/.next/server/app/api/worktrees/[id]/cli-reference/route_client-reference-manifest.js +1 -1
  99. package/.next/server/app/api/worktrees/[id]/cli-tool/route_client-reference-manifest.js +1 -1
  100. package/.next/server/app/api/worktrees/[id]/cmate/schedules/route_client-reference-manifest.js +1 -1
  101. package/.next/server/app/api/worktrees/[id]/current-output/route.js +1 -1
  102. package/.next/server/app/api/worktrees/[id]/current-output/route.js.nft.json +1 -1
  103. package/.next/server/app/api/worktrees/[id]/current-output/route_client-reference-manifest.js +1 -1
  104. package/.next/server/app/api/worktrees/[id]/direct-input/route.js +1 -1
  105. package/.next/server/app/api/worktrees/[id]/direct-input/route.js.nft.json +1 -1
  106. package/.next/server/app/api/worktrees/[id]/direct-input/route_client-reference-manifest.js +1 -1
  107. package/.next/server/app/api/worktrees/[id]/env/route_client-reference-manifest.js +1 -1
  108. package/.next/server/app/api/worktrees/[id]/execution-logs/[logId]/route_client-reference-manifest.js +1 -1
  109. package/.next/server/app/api/worktrees/[id]/execution-logs/route_client-reference-manifest.js +1 -1
  110. package/.next/server/app/api/worktrees/[id]/files/[...path]/route_client-reference-manifest.js +1 -1
  111. package/.next/server/app/api/worktrees/[id]/git/branch/create/route_client-reference-manifest.js +1 -1
  112. package/.next/server/app/api/worktrees/[id]/git/branch/delete/route_client-reference-manifest.js +1 -1
  113. package/.next/server/app/api/worktrees/[id]/git/branches/route_client-reference-manifest.js +1 -1
  114. package/.next/server/app/api/worktrees/[id]/git/checkout/route_client-reference-manifest.js +1 -1
  115. package/.next/server/app/api/worktrees/[id]/git/commit/route_client-reference-manifest.js +1 -1
  116. package/.next/server/app/api/worktrees/[id]/git/diff/route_client-reference-manifest.js +1 -1
  117. package/.next/server/app/api/worktrees/[id]/git/fetch/route_client-reference-manifest.js +1 -1
  118. package/.next/server/app/api/worktrees/[id]/git/log/route_client-reference-manifest.js +1 -1
  119. package/.next/server/app/api/worktrees/[id]/git/pull/route_client-reference-manifest.js +1 -1
  120. package/.next/server/app/api/worktrees/[id]/git/push/route_client-reference-manifest.js +1 -1
  121. package/.next/server/app/api/worktrees/[id]/git/reset/route_client-reference-manifest.js +1 -1
  122. package/.next/server/app/api/worktrees/[id]/git/revert/route_client-reference-manifest.js +1 -1
  123. package/.next/server/app/api/worktrees/[id]/git/show/[commitHash]/route_client-reference-manifest.js +1 -1
  124. package/.next/server/app/api/worktrees/[id]/git/stage/route_client-reference-manifest.js +1 -1
  125. package/.next/server/app/api/worktrees/[id]/git/staged/route_client-reference-manifest.js +1 -1
  126. package/.next/server/app/api/worktrees/[id]/git/stash/[index]/route_client-reference-manifest.js +1 -1
  127. package/.next/server/app/api/worktrees/[id]/git/stash/apply/route_client-reference-manifest.js +1 -1
  128. package/.next/server/app/api/worktrees/[id]/git/stash/pop/route_client-reference-manifest.js +1 -1
  129. package/.next/server/app/api/worktrees/[id]/git/stash/push/route_client-reference-manifest.js +1 -1
  130. package/.next/server/app/api/worktrees/[id]/git/stash/route_client-reference-manifest.js +1 -1
  131. package/.next/server/app/api/worktrees/[id]/git/status/route_client-reference-manifest.js +1 -1
  132. package/.next/server/app/api/worktrees/[id]/git/unstage/route_client-reference-manifest.js +1 -1
  133. package/.next/server/app/api/worktrees/[id]/git/working-diff/route_client-reference-manifest.js +1 -1
  134. package/.next/server/app/api/worktrees/[id]/instances/notes/route_client-reference-manifest.js +1 -1
  135. package/.next/server/app/api/worktrees/[id]/instances/opencode/route.js.nft.json +1 -1
  136. package/.next/server/app/api/worktrees/[id]/instances/opencode/route_client-reference-manifest.js +1 -1
  137. package/.next/server/app/api/worktrees/[id]/interrupt/route.js +1 -1
  138. package/.next/server/app/api/worktrees/[id]/interrupt/route.js.nft.json +1 -1
  139. package/.next/server/app/api/worktrees/[id]/interrupt/route_client-reference-manifest.js +1 -1
  140. package/.next/server/app/api/worktrees/[id]/kill-session/route.js +1 -1
  141. package/.next/server/app/api/worktrees/[id]/kill-session/route.js.nft.json +1 -1
  142. package/.next/server/app/api/worktrees/[id]/kill-session/route_client-reference-manifest.js +1 -1
  143. package/.next/server/app/api/worktrees/[id]/logs/[filename]/route_client-reference-manifest.js +1 -1
  144. package/.next/server/app/api/worktrees/[id]/logs/route_client-reference-manifest.js +1 -1
  145. package/.next/server/app/api/worktrees/[id]/marp-render/route_client-reference-manifest.js +1 -1
  146. package/.next/server/app/api/worktrees/[id]/memos/[memoId]/route_client-reference-manifest.js +1 -1
  147. package/.next/server/app/api/worktrees/[id]/memos/route_client-reference-manifest.js +1 -1
  148. package/.next/server/app/api/worktrees/[id]/messages/route_client-reference-manifest.js +1 -1
  149. package/.next/server/app/api/worktrees/[id]/opencode/diff/route_client-reference-manifest.js +1 -1
  150. package/.next/server/app/api/worktrees/[id]/opencode/session/route_client-reference-manifest.js +1 -1
  151. package/.next/server/app/api/worktrees/[id]/opencode/share/route_client-reference-manifest.js +1 -1
  152. package/.next/server/app/api/worktrees/[id]/prompt-response/route.js +1 -1
  153. package/.next/server/app/api/worktrees/[id]/prompt-response/route.js.nft.json +1 -1
  154. package/.next/server/app/api/worktrees/[id]/prompt-response/route_client-reference-manifest.js +1 -1
  155. package/.next/server/app/api/worktrees/[id]/resolve-target/route_client-reference-manifest.js +1 -1
  156. package/.next/server/app/api/worktrees/[id]/respond/route.js +1 -1
  157. package/.next/server/app/api/worktrees/[id]/respond/route.js.nft.json +1 -1
  158. package/.next/server/app/api/worktrees/[id]/respond/route_client-reference-manifest.js +1 -1
  159. package/.next/server/app/api/worktrees/[id]/route.js +103 -1
  160. package/.next/server/app/api/worktrees/[id]/route.js.nft.json +1 -1
  161. package/.next/server/app/api/worktrees/[id]/route_client-reference-manifest.js +1 -1
  162. package/.next/server/app/api/worktrees/[id]/schedules/[scheduleId]/route_client-reference-manifest.js +1 -1
  163. package/.next/server/app/api/worktrees/[id]/schedules/active/route_client-reference-manifest.js +1 -1
  164. package/.next/server/app/api/worktrees/[id]/schedules/route_client-reference-manifest.js +1 -1
  165. package/.next/server/app/api/worktrees/[id]/search/route_client-reference-manifest.js +1 -1
  166. package/.next/server/app/api/worktrees/[id]/send/route.js +103 -1
  167. package/.next/server/app/api/worktrees/[id]/send/route.js.nft.json +1 -1
  168. package/.next/server/app/api/worktrees/[id]/send/route_client-reference-manifest.js +1 -1
  169. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route.js +1 -103
  170. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route.js.nft.json +1 -1
  171. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route_client-reference-manifest.js +1 -1
  172. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/install/route_client-reference-manifest.js +1 -1
  173. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/plan/route_client-reference-manifest.js +1 -1
  174. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall/route_client-reference-manifest.js +1 -1
  175. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall-plan/route_client-reference-manifest.js +1 -1
  176. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/update/route_client-reference-manifest.js +1 -1
  177. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/update-plan/route_client-reference-manifest.js +1 -1
  178. package/.next/server/app/api/worktrees/[id]/skills/route_client-reference-manifest.js +1 -1
  179. package/.next/server/app/api/worktrees/[id]/slash-commands/route.js.nft.json +1 -1
  180. package/.next/server/app/api/worktrees/[id]/slash-commands/route_client-reference-manifest.js +1 -1
  181. package/.next/server/app/api/worktrees/[id]/special-keys/route.js +1 -1
  182. package/.next/server/app/api/worktrees/[id]/special-keys/route.js.nft.json +1 -1
  183. package/.next/server/app/api/worktrees/[id]/special-keys/route_client-reference-manifest.js +1 -1
  184. package/.next/server/app/api/worktrees/[id]/tasks/route.js +2 -2
  185. package/.next/server/app/api/worktrees/[id]/tasks/route_client-reference-manifest.js +1 -1
  186. package/.next/server/app/api/worktrees/[id]/terminal/route.js +1 -103
  187. package/.next/server/app/api/worktrees/[id]/terminal/route.js.nft.json +1 -1
  188. package/.next/server/app/api/worktrees/[id]/terminal/route_client-reference-manifest.js +1 -1
  189. package/.next/server/app/api/worktrees/[id]/timers/history/route_client-reference-manifest.js +1 -1
  190. package/.next/server/app/api/worktrees/[id]/timers/route.js +1 -1
  191. package/.next/server/app/api/worktrees/[id]/timers/route.js.nft.json +1 -1
  192. package/.next/server/app/api/worktrees/[id]/timers/route_client-reference-manifest.js +1 -1
  193. package/.next/server/app/api/worktrees/[id]/todos/[todoId]/route_client-reference-manifest.js +1 -1
  194. package/.next/server/app/api/worktrees/[id]/todos/route_client-reference-manifest.js +1 -1
  195. package/.next/server/app/api/worktrees/[id]/tree/[...path]/route_client-reference-manifest.js +1 -1
  196. package/.next/server/app/api/worktrees/[id]/tree/route_client-reference-manifest.js +1 -1
  197. package/.next/server/app/api/worktrees/[id]/upload/[...path]/route_client-reference-manifest.js +1 -1
  198. package/.next/server/app/api/worktrees/[id]/verify/config/route.js +1 -1
  199. package/.next/server/app/api/worktrees/[id]/verify/config/route_client-reference-manifest.js +1 -1
  200. package/.next/server/app/api/worktrees/[id]/verify/route.js +1 -1
  201. package/.next/server/app/api/worktrees/[id]/verify/route_client-reference-manifest.js +1 -1
  202. package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/cancel/route.js +1 -1
  203. package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/cancel/route_client-reference-manifest.js +1 -1
  204. package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/route_client-reference-manifest.js +1 -1
  205. package/.next/server/app/api/worktrees/[id]/verify/runs/route_client-reference-manifest.js +1 -1
  206. package/.next/server/app/api/worktrees/[id]/viewed/route_client-reference-manifest.js +1 -1
  207. package/.next/server/app/api/worktrees/apply-default-agents/route_client-reference-manifest.js +1 -1
  208. package/.next/server/app/api/worktrees/route.js +1 -1
  209. package/.next/server/app/api/worktrees/route.js.nft.json +1 -1
  210. package/.next/server/app/api/worktrees/route_client-reference-manifest.js +1 -1
  211. package/.next/server/app/login/page_client-reference-manifest.js +1 -1
  212. package/.next/server/app/manifest.webmanifest/route_client-reference-manifest.js +1 -1
  213. package/.next/server/app/more/page_client-reference-manifest.js +1 -1
  214. package/.next/server/app/offline/page_client-reference-manifest.js +1 -1
  215. package/.next/server/app/page_client-reference-manifest.js +1 -1
  216. package/.next/server/app/proxy/[...path]/route_client-reference-manifest.js +1 -1
  217. package/.next/server/app/repositories/page_client-reference-manifest.js +1 -1
  218. package/.next/server/app/review/page_client-reference-manifest.js +1 -1
  219. package/.next/server/app/sessions/page_client-reference-manifest.js +1 -1
  220. package/.next/server/app/skills/[skillId]/page_client-reference-manifest.js +1 -1
  221. package/.next/server/app/skills/installed/page_client-reference-manifest.js +1 -1
  222. package/.next/server/app/skills/page_client-reference-manifest.js +1 -1
  223. package/.next/server/app/worktrees/[id]/files/[...path]/page_client-reference-manifest.js +1 -1
  224. package/.next/server/app/worktrees/[id]/page.js +10 -10
  225. package/.next/server/app/worktrees/[id]/page_client-reference-manifest.js +1 -1
  226. package/.next/server/app/worktrees/[id]/terminal/page_client-reference-manifest.js +1 -1
  227. package/.next/server/app-paths-manifest.json +33 -33
  228. package/.next/server/chunks/1068.js +1 -0
  229. package/.next/server/chunks/1210.js +1 -1
  230. package/.next/server/chunks/1501.js +5 -5
  231. package/.next/server/chunks/1990.js +103 -0
  232. package/.next/server/chunks/2119.js +1 -1
  233. package/.next/server/chunks/2445.js +1 -1
  234. package/.next/server/chunks/3241.js +1 -1
  235. package/.next/server/chunks/3707.js +1 -1
  236. package/.next/server/chunks/3718.js +1 -0
  237. package/.next/server/chunks/434.js +1 -1
  238. package/.next/server/chunks/4443.js +1 -1
  239. package/.next/server/chunks/5164.js +1 -1
  240. package/.next/server/chunks/5775.js +1 -0
  241. package/.next/server/chunks/611.js +1 -0
  242. package/.next/server/chunks/6130.js +1 -1
  243. package/.next/server/chunks/650.js +1 -1
  244. package/.next/server/chunks/6781.js +1 -1
  245. package/.next/server/chunks/7905.js +1 -1
  246. package/.next/server/chunks/8581.js +1 -1
  247. package/.next/server/chunks/8583.js +1 -1
  248. package/.next/server/chunks/8673.js +2 -2
  249. package/.next/server/chunks/8728.js +3 -3
  250. package/.next/server/chunks/8791.js +1 -0
  251. package/.next/server/chunks/8800.js +1 -1
  252. package/.next/server/chunks/8918.js +1 -103
  253. package/.next/server/chunks/9130.js +2 -2
  254. package/.next/server/chunks/964.js +1 -1
  255. package/.next/server/chunks/9731.js +3 -3
  256. package/.next/server/chunks/9882.js +3 -3
  257. package/.next/server/middleware-build-manifest.js +1 -1
  258. package/.next/server/middleware-manifest.json +5 -5
  259. package/.next/server/middleware-react-loadable-manifest.js +1 -1
  260. package/.next/server/pages/500.html +1 -1
  261. package/.next/server/server-reference-manifest.json +1 -1
  262. package/.next/static/chunks/{1642-fb2e176aaadbd137.js → 1642-767aed8e7c61ef7f.js} +1 -1
  263. package/.next/static/chunks/{2407-99799e3c2ff03bae.js → 2407-faae66d204748f7b.js} +1 -1
  264. package/.next/static/chunks/{2619-04bc32f026a0d946.js → 2619-a305ad4810f1393a.js} +1 -1
  265. package/.next/static/chunks/530.578854fdd5d91542.js +1 -0
  266. package/.next/static/chunks/7705-2a2936551b0cf9a3.js +1 -0
  267. package/.next/static/chunks/8165-235859c6930f01b1.js +1 -0
  268. package/.next/static/chunks/app/{layout-1fb647d6df55c498.js → layout-9a715043610e4e27.js} +1 -1
  269. package/.next/static/chunks/app/worktrees/[id]/page-61dd928d635db590.js +1 -0
  270. package/.next/static/chunks/app/worktrees/[id]/terminal/{page-373ea37b16d930c7.js → page-c601f3b3ece6557e.js} +1 -1
  271. package/.next/static/chunks/{webpack-7e5907979c182510.js → webpack-49ade0526854dd4e.js} +1 -1
  272. package/.next/static/css/{974314e796232f53.css → b3f433d52b8ed5c8.css} +1 -1
  273. package/.next/trace +13 -13
  274. package/dist/cli/commands/attach.d.ts +6 -4
  275. package/dist/cli/commands/attach.d.ts.map +1 -1
  276. package/dist/cli/commands/attach.js +36 -5
  277. package/dist/cli/commands/instances.d.ts.map +1 -1
  278. package/dist/cli/commands/instances.js +5 -0
  279. package/dist/cli/commands/ls.d.ts.map +1 -1
  280. package/dist/cli/commands/ls.js +19 -9
  281. package/dist/cli/commands/whoami.d.ts +9 -25
  282. package/dist/cli/commands/whoami.d.ts.map +1 -1
  283. package/dist/cli/commands/whoami.js +18 -42
  284. package/dist/cli/types/api-responses.d.ts +37 -0
  285. package/dist/cli/types/api-responses.d.ts.map +1 -1
  286. package/dist/lib/cli-tools/session-name.d.ts +72 -4
  287. package/dist/lib/cli-tools/session-name.d.ts.map +1 -1
  288. package/dist/lib/cli-tools/session-name.js +115 -12
  289. package/dist/lib/detection/tools/verified-against.d.ts +11 -2
  290. package/dist/lib/detection/tools/verified-against.d.ts.map +1 -1
  291. package/dist/lib/detection/tools/verified-against.js +11 -2
  292. package/dist/lib/session/tmux-session-surface.d.ts +9 -7
  293. package/dist/lib/session/tmux-session-surface.d.ts.map +1 -1
  294. package/dist/lib/session/tmux-session-surface.js +15 -8
  295. package/dist/lib/tmux/legacy-session-alias.d.ts +43 -0
  296. package/dist/lib/tmux/legacy-session-alias.d.ts.map +1 -0
  297. package/dist/lib/tmux/legacy-session-alias.js +64 -0
  298. package/dist/lib/verification/verify-config.d.ts +21 -0
  299. package/dist/lib/verification/verify-config.d.ts.map +1 -1
  300. package/dist/lib/verification/verify-config.js +54 -1
  301. package/dist/server/locales/en/worktree.json +4 -1
  302. package/dist/server/locales/ja/worktree.json +4 -1
  303. package/dist/server/server.js +29 -0
  304. package/dist/server/src/lib/auto-yes-poller.js +15 -0
  305. package/dist/server/src/lib/cli-tools/antigravity.js +1 -1
  306. package/dist/server/src/lib/cli-tools/base.js +10 -1
  307. package/dist/server/src/lib/cli-tools/codex.js +1 -1
  308. package/dist/server/src/lib/cli-tools/command-code.js +1 -1
  309. package/dist/server/src/lib/cli-tools/copilot.js +1 -1
  310. package/dist/server/src/lib/cli-tools/gemini.js +1 -1
  311. package/dist/server/src/lib/cli-tools/legacy-session-adoption.js +19 -0
  312. package/dist/server/src/lib/cli-tools/opencode.js +1 -1
  313. package/dist/server/src/lib/cli-tools/session-name.js +115 -12
  314. package/dist/server/src/lib/cli-tools/session-namespace.js +55 -0
  315. package/dist/server/src/lib/cli-tools/session-ownership.js +21 -0
  316. package/dist/server/src/lib/cli-tools/vibe-local.js +1 -1
  317. package/dist/server/src/lib/cli-tools/worktree-session-ownership.js +28 -0
  318. package/dist/server/src/lib/db/app-settings-db.js +29 -0
  319. package/dist/server/src/lib/detection/cli-patterns.js +46 -8
  320. package/dist/server/src/lib/detection/tools/codex/cli-patterns.js +8 -2
  321. package/dist/server/src/lib/detection/tools/codex/detect.js +8 -1
  322. package/dist/server/src/lib/detection/tools/codex/prompt.js +6 -2
  323. package/dist/server/src/lib/detection/tools/verified-against.js +11 -2
  324. package/dist/server/src/lib/hooks/sources/codex/hooks-config.js +77 -2
  325. package/dist/server/src/lib/polling/auto-yes-dialog-gate.js +77 -1
  326. package/dist/server/src/lib/realtime/terminal-broadcast.js +11 -0
  327. package/dist/server/src/lib/session/adopt-legacy-sessions.js +89 -0
  328. package/dist/server/src/lib/session/claude-session.js +13 -10
  329. package/dist/server/src/lib/session/current-output-builder.js +18 -0
  330. package/dist/server/src/lib/session/send-user-message.js +26 -0
  331. package/dist/server/src/lib/session/session-instance-targets.js +53 -0
  332. package/dist/server/src/lib/session/tmux-session-surface.js +15 -8
  333. package/dist/server/src/lib/session/worktree-session-reconcile.js +101 -56
  334. package/dist/server/src/lib/session-cleanup.js +33 -3
  335. package/dist/server/src/lib/tmux/legacy-session-alias.js +64 -0
  336. package/dist/server/src/lib/tmux/session-hook-scripts.js +12 -4
  337. package/dist/server/src/lib/tmux/session-ownership.js +174 -0
  338. package/dist/server/src/lib/tmux/tmux.js +13 -3
  339. package/dist/server/src/lib/verification/env-clean-gate.js +46 -14
  340. package/dist/server/src/lib/verification/gate-runner.js +1 -0
  341. package/dist/server/src/lib/verification/verify-config.js +54 -1
  342. package/dist/server/src/lib/ws-server.js +11 -0
  343. package/package.json +1 -1
  344. package/release-notes/0.41.1.json +16 -0
  345. package/release-notes/0.42.0.json +62 -0
  346. package/.next/server/chunks/3323.js +0 -1
  347. package/.next/server/chunks/7075.js +0 -1
  348. package/.next/server/chunks/9080.js +0 -1
  349. package/.next/static/chunks/530.e31cc754677fed0f.js +0 -1
  350. package/.next/static/chunks/7705-25076b57224da370.js +0 -1
  351. package/.next/static/chunks/8165-d3b7c8a7aa776bc7.js +0 -1
  352. package/.next/static/chunks/app/worktrees/[id]/page-f24da37453224716.js +0 -1
  353. /package/.next/static/{UoGuvKnR_kGftU9RHtebq → EbTDBXcXRpFNH4eom-HVv}/_buildManifest.js +0 -0
  354. /package/.next/static/{UoGuvKnR_kGftU9RHtebq → EbTDBXcXRpFNH4eom-HVv}/_ssgManifest.js +0 -0
@@ -4,8 +4,8 @@
4
4
  * Shared between response-poller.ts and API routes
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.COPILOT_USER_ECHO_PATTERN = exports.COPILOT_REASONING_HEADER_PATTERN = exports.COPILOT_BOX_ROW_PATTERN = exports.COPILOT_SEPARATOR_PATTERN = exports.COPILOT_IDLE_STATUS_PATTERN = exports.COPILOT_WORKING_STATUS_PATTERN = exports.COPILOT_THINKING_PATTERN = exports.COPILOT_PROMPT_PATTERN = exports.OPENCODE_SKIP_PATTERNS = exports.OPENCODE_SEPARATOR_PATTERN = exports.CLAUDE_SELECTION_LIST_FOOTER = exports.CLAUDE_MODEL_OVERLAY_FOOTER_PATTERN = exports.OPENCODE_SELECTION_LIST_PATTERN = exports.OPENCODE_FOOTER_STATUS_PATTERN = exports.OPENCODE_USER_ECHO_PATTERN = exports.OPENCODE_GUTTER_ROW_PATTERN = exports.OPENCODE_COMPOSER_BOTTOM_BORDER = exports.OPENCODE_PROCESSING_INDICATOR = exports.OPENCODE_PERMISSION_PATTERN = exports.OPENCODE_TURN_COMPLETE_PATTERN = exports.OPENCODE_RESPONSE_COMPLETE = exports.OPENCODE_LOADING_PATTERN = exports.OPENCODE_THINKING_PATTERN = exports.OPENCODE_PROMPT_AFTER_RESPONSE = exports.OPENCODE_IDLE_COMPOSER_PATTERN = exports.OPENCODE_PROMPT_PATTERN = exports.GEMINI_THINKING_PATTERN = exports.GEMINI_PROMPT_PATTERN = exports.MAX_PASTED_TEXT_RETRIES = exports.PASTED_TEXT_DETECT_DELAY = exports.PASTED_TEXT_PATTERN = exports.CODEX_USER_ECHO_PATTERN = exports.CODEX_TRAILED_STATUS_BAR_PATTERN = exports.CODEX_STATUS_BAR_PATTERN = exports.CODEX_PAGER_FOOTER_PATTERN = exports.CODEX_FORM_SUBMIT_FOOTER_PATTERN = exports.CODEX_APPROVAL_FOOTER_PATTERN = exports.CODEX_SELECTION_LIST_PATTERN = exports.CODEX_SEPARATOR_PATTERN = exports.CODEX_HOOKS_REVIEW_ANCHORS = exports.CODEX_DIALOG_PATTERN = exports.CODEX_PROMPT_PATTERN = exports.CLAUDE_TRUST_DIALOG_PATTERN = exports.CLAUDE_SEPARATOR_PATTERN = exports.CLAUDE_PROMPT_PATTERN = exports.CODEX_INTERRUPT_HINT_PATTERN = exports.CODEX_THINKING_PATTERN = exports.CLAUDE_INTERRUPT_HINT_PATTERN = exports.CLAUDE_THINKING_PATTERN = exports.CLAUDE_SPINNER_CHARS = void 0;
8
- exports.CLAUDE_SESSION_ERROR_REGEX_PATTERNS = exports.CLAUDE_SESSION_ERROR_PATTERNS = exports.extractAnsiSequences = exports.stripAnsi = exports.COMMAND_CODE_SKIP_PATTERNS = exports.COMMAND_CODE_HOOK_NOTICE_PATTERN = exports.COMMAND_CODE_BANNER_PATTERNS = exports.COMMAND_CODE_MODE_INDICATOR_PATTERN = exports.COMMAND_CODE_COMPLETION_PATTERN = exports.COMMAND_CODE_RESPONSE_MARKER_PATTERN = exports.COMMAND_CODE_THINKING_PATTERN = exports.COMMAND_CODE_INTERRUPT_HINT_PATTERN = exports.COMMAND_CODE_SEPARATOR_PATTERN = exports.COMMAND_CODE_PROMPT_PATTERN = exports.COMMAND_CODE_SPINNER_CHARS = exports.ANTIGRAVITY_SKIP_PATTERNS = exports.ANTIGRAVITY_SURVEY_PATTERN = exports.ANTIGRAVITY_DIALOG_MAX_ROWS = exports.ANTIGRAVITY_DIALOG_BOUNDARY_PATTERN = exports.ANTIGRAVITY_SWITCH_MODEL_HEADER_PATTERN = exports.ANTIGRAVITY_NUMBERED_OPTION_PATTERN = exports.ANTIGRAVITY_NAVIGATE_FOOTER_PATTERN = exports.ANTIGRAVITY_SELECTION_LIST_PATTERN = exports.ANTIGRAVITY_SEPARATOR_PATTERN = exports.ANTIGRAVITY_THINKING_PATTERN = exports.ANTIGRAVITY_PROMPT_PATTERN = exports.ANTIGRAVITY_COMPOSER_MODE_BANNER_PATTERN = exports.ANTIGRAVITY_COMPOSER_MODE_BANNER_SOURCE = exports.VIBE_LOCAL_THINKING_PATTERN = exports.VIBE_LOCAL_PROMPT_PATTERN = exports.COPILOT_SKIP_PATTERNS = exports.COPILOT_FOLDER_TRUST_ANSWER_KEY = exports.COPILOT_FOLDER_TRUST_SESSION_OPTION_PATTERN = exports.COPILOT_FOLDER_TRUST_ANCHORS = exports.COPILOT_SELECTION_FOOTER_PATTERN = exports.COPILOT_BOOT_BANNER_ANCHORS = exports.COPILOT_TRANSCRIPT_CONTINUATION_PATTERN = exports.COPILOT_TOOL_ROW_PATTERN = exports.COPILOT_TOOL_VERBS = exports.COPILOT_TRANSCRIPT_DIVIDER_PATTERN = void 0;
7
+ exports.COPILOT_SEPARATOR_PATTERN = exports.COPILOT_IDLE_STATUS_PATTERN = exports.COPILOT_WORKING_STATUS_PATTERN = exports.COPILOT_THINKING_PATTERN = exports.COPILOT_PROMPT_PATTERN = exports.OPENCODE_SKIP_PATTERNS = exports.OPENCODE_SEPARATOR_PATTERN = exports.CLAUDE_SELECTION_LIST_FOOTER = exports.CLAUDE_MODEL_OVERLAY_FOOTER_PATTERN = exports.OPENCODE_SELECTION_LIST_PATTERN = exports.OPENCODE_FOOTER_STATUS_PATTERN = exports.OPENCODE_USER_ECHO_PATTERN = exports.OPENCODE_GUTTER_ROW_PATTERN = exports.OPENCODE_COMPOSER_BOTTOM_BORDER = exports.OPENCODE_PROCESSING_INDICATOR = exports.OPENCODE_PERMISSION_PATTERN = exports.OPENCODE_TURN_COMPLETE_PATTERN = exports.OPENCODE_RESPONSE_COMPLETE = exports.OPENCODE_LOADING_PATTERN = exports.OPENCODE_THINKING_PATTERN = exports.OPENCODE_PROMPT_AFTER_RESPONSE = exports.OPENCODE_IDLE_COMPOSER_PATTERN = exports.OPENCODE_PROMPT_PATTERN = exports.GEMINI_THINKING_PATTERN = exports.GEMINI_PROMPT_PATTERN = exports.MAX_PASTED_TEXT_RETRIES = exports.PASTED_TEXT_DETECT_DELAY = exports.PASTED_TEXT_PATTERN = exports.CODEX_USER_ECHO_PATTERN = exports.CODEX_TRAILED_STATUS_BAR_PATTERN = exports.CODEX_STATUS_BAR_PATTERN = exports.CODEX_PAGER_FOOTER_PATTERN = exports.CODEX_EFFORT_PICKER_FOOTER_PATTERN = exports.CODEX_PICKER_FOOTER_PATTERN = exports.CODEX_FORM_SUBMIT_FOOTER_PATTERN = exports.CODEX_APPROVAL_FOOTER_PATTERN = exports.CODEX_SELECTION_LIST_PATTERN = exports.CODEX_SEPARATOR_PATTERN = exports.CODEX_HOOKS_REVIEW_ANCHORS = exports.CODEX_DIALOG_PATTERN = exports.CODEX_TRUST_QUESTION_PATTERN = exports.CODEX_PROMPT_PATTERN = exports.CLAUDE_TRUST_DIALOG_PATTERN = exports.CLAUDE_SEPARATOR_PATTERN = exports.CLAUDE_PROMPT_PATTERN = exports.CODEX_INTERRUPT_HINT_PATTERN = exports.CODEX_THINKING_PATTERN = exports.CLAUDE_INTERRUPT_HINT_PATTERN = exports.CLAUDE_THINKING_PATTERN = exports.CLAUDE_SPINNER_CHARS = void 0;
8
+ exports.CLAUDE_SESSION_ERROR_REGEX_PATTERNS = exports.CLAUDE_SESSION_ERROR_PATTERNS = exports.extractAnsiSequences = exports.stripAnsi = exports.COMMAND_CODE_SKIP_PATTERNS = exports.COMMAND_CODE_HOOK_NOTICE_PATTERN = exports.COMMAND_CODE_BANNER_PATTERNS = exports.COMMAND_CODE_MODE_INDICATOR_PATTERN = exports.COMMAND_CODE_COMPLETION_PATTERN = exports.COMMAND_CODE_RESPONSE_MARKER_PATTERN = exports.COMMAND_CODE_THINKING_PATTERN = exports.COMMAND_CODE_INTERRUPT_HINT_PATTERN = exports.COMMAND_CODE_SEPARATOR_PATTERN = exports.COMMAND_CODE_PROMPT_PATTERN = exports.COMMAND_CODE_SPINNER_CHARS = exports.ANTIGRAVITY_SKIP_PATTERNS = exports.ANTIGRAVITY_SURVEY_PATTERN = exports.ANTIGRAVITY_DIALOG_MAX_ROWS = exports.ANTIGRAVITY_DIALOG_BOUNDARY_PATTERN = exports.ANTIGRAVITY_SWITCH_MODEL_HEADER_PATTERN = exports.ANTIGRAVITY_NUMBERED_OPTION_PATTERN = exports.ANTIGRAVITY_NAVIGATE_FOOTER_PATTERN = exports.ANTIGRAVITY_SELECTION_LIST_PATTERN = exports.ANTIGRAVITY_SEPARATOR_PATTERN = exports.ANTIGRAVITY_THINKING_PATTERN = exports.ANTIGRAVITY_PROMPT_PATTERN = exports.ANTIGRAVITY_COMPOSER_MODE_BANNER_PATTERN = exports.ANTIGRAVITY_COMPOSER_MODE_BANNER_SOURCE = exports.VIBE_LOCAL_THINKING_PATTERN = exports.VIBE_LOCAL_PROMPT_PATTERN = exports.COPILOT_SKIP_PATTERNS = exports.COPILOT_FOLDER_TRUST_ANSWER_KEY = exports.COPILOT_FOLDER_TRUST_SESSION_OPTION_PATTERN = exports.COPILOT_FOLDER_TRUST_ANCHORS = exports.COPILOT_SELECTION_FOOTER_PATTERN = exports.COPILOT_BOOT_BANNER_ANCHORS = exports.COPILOT_TRANSCRIPT_CONTINUATION_PATTERN = exports.COPILOT_TOOL_ROW_PATTERN = exports.COPILOT_TOOL_VERBS = exports.COPILOT_TRANSCRIPT_DIVIDER_PATTERN = exports.COPILOT_USER_ECHO_PATTERN = exports.COPILOT_REASONING_HEADER_PATTERN = exports.COPILOT_BOX_ROW_PATTERN = void 0;
9
9
  exports.isCodexTurnActive = isCodexTurnActive;
10
10
  exports.findClaudeChromeStart = findClaudeChromeStart;
11
11
  exports.isCodexPromptReady = isCodexPromptReady;
@@ -233,6 +233,17 @@ exports.CLAUDE_TRUST_DIALOG_PATTERN = /Yes, I trust this folder/m;
233
233
  * T1.2: Improved to detect empty prompts as well
234
234
  */
235
235
  exports.CODEX_PROMPT_PATTERN = /^›\s*/m;
236
+ /**
237
+ * The directory/folder trust dialog's question line, across codex builds
238
+ * (Issue #2884): `Do you trust the contents of this directory?` (<=0.155.1)
239
+ * and `Trust this folder?` (0.157.1, which dropped the "Do you trust" wording
240
+ * entirely -- `tests/fixtures/codex-dialogs-0157/trust.txt`). The two variants
241
+ * are kept as alternatives of one pattern -- rather than duplicated across
242
+ * {@link CODEX_DIALOG_PATTERN}, `getCodexActiveDialog` and
243
+ * `getCodexLifecycleDialog` -- so those three cannot drift into disagreeing
244
+ * about what counts as the trust dialog.
245
+ */
246
+ exports.CODEX_TRUST_QUESTION_PATTERN = /Do you trust|Trust this folder\?/;
236
247
  /**
237
248
  * Codex INTERACTIVE startup dialog pattern (Issue #890)
238
249
  *
@@ -243,7 +254,7 @@ exports.CODEX_PROMPT_PATTERN = /^›\s*/m;
243
254
  * also confirm no INTERACTIVE dialog is still active. This pattern matches markers
244
255
  * that appear ONLY in interactive dialogs:
245
256
  * - Interactive update dialog: "Skip until next version" (the option-3 label)
246
- * - Trust dialog: "Do you trust the contents of this directory?"
257
+ * - Trust dialog: {@link CODEX_TRUST_QUESTION_PATTERN}
247
258
  * - Dialog confirm footer: "Press enter to continue"
248
259
  * - Numbered selection option: "› 1. ..." (leading ›, a digit, a dot)
249
260
  *
@@ -259,7 +270,7 @@ exports.CODEX_PROMPT_PATTERN = /^›\s*/m;
259
270
  *
260
271
  * No /g flag (would make .test() stateful); no nested quantifiers (ReDoS-safe).
261
272
  */
262
- exports.CODEX_DIALOG_PATTERN = /Skip until next version|Do you trust|Press enter to continue|^\s*›\s*\d+\.\s/m;
273
+ exports.CODEX_DIALOG_PATTERN = new RegExp(`Skip until next version|${exports.CODEX_TRUST_QUESTION_PATTERN.source}|Press enter to continue|^\\s*›\\s*\\d+\\.\\s`, 'm');
263
274
  /**
264
275
  * Codex genuine input-prompt line (Issue #892).
265
276
  *
@@ -353,7 +364,7 @@ function getCodexActiveDialog(output) {
353
364
  (active.includes('Update') && active.includes('Skip'))) {
354
365
  return 'update';
355
366
  }
356
- if (active.includes('Do you trust')) {
367
+ if (exports.CODEX_TRUST_QUESTION_PATTERN.test(active)) {
357
368
  return 'trust';
358
369
  }
359
370
  if (active.includes('Press enter to continue')) {
@@ -427,8 +438,6 @@ const CODEX_UPDATE_DIALOG_ANCHORS = [
427
438
  /skip until next version/i,
428
439
  /^\s*[›❯]?\s*\d+\.\s*Update now/im,
429
440
  ];
430
- /** The directory-trust dialog's question line. */
431
- const CODEX_TRUST_DIALOG_ANCHOR = /Do you trust/;
432
441
  /**
433
442
  * Classify the bottom-most ACTIVE codex lifecycle screen (Issue #1829).
434
443
  *
@@ -480,7 +489,7 @@ function getCodexLifecycleDialog(output) {
480
489
  return null;
481
490
  if (CODEX_UPDATE_DIALOG_ANCHORS.some((pattern) => pattern.test(line)))
482
491
  return 'update';
483
- if (CODEX_TRUST_DIALOG_ANCHOR.test(line))
492
+ if (exports.CODEX_TRUST_QUESTION_PATTERN.test(line))
484
493
  return 'trust';
485
494
  // Both anchors required, so a stray "hooks" mention cannot claim the screen.
486
495
  if (line.includes(exports.CODEX_HOOKS_REVIEW_ANCHORS[1]) && text.includes(exports.CODEX_HOOKS_REVIEW_ANCHORS[0])) {
@@ -569,6 +578,35 @@ exports.CODEX_APPROVAL_FOOTER_PATTERN = /esc\s+to\s+cancel/i;
569
578
  * No /g flag (keeps .test() stateless), no nested quantifiers (ReDoS-safe).
570
579
  */
571
580
  exports.CODEX_FORM_SUBMIT_FOOTER_PATTERN = /^enter\s+to\s+submit\s*\|\s*esc\s+to\s+cancel$/im;
581
+ /**
582
+ * Codex CLI 0.157 picker footer pattern (Issue #2868).
583
+ *
584
+ * codex-cli 0.157.1 retitled `/model` ("Select Model and Effort") and replaced
585
+ * its "Press enter to confirm or esc to go back" footer with the terse
586
+ * `enter select · esc back` row (measured: `tests/fixtures/codex-dialogs-0157/`).
587
+ * CODEX_SELECTION_LIST_PATTERN no longer matched, so branch 0.8 missed the
588
+ * picker and the dialog entry gate refused the answer (`prompt_no_longer_active`).
589
+ *
590
+ * Same construction as CODEX_FORM_SUBMIT_FOOTER_PATTERN: the whole measured row
591
+ * (`/m` + `^…$`), tested only against a trimmed single footer row — never a
592
+ * window — so a transcript quoting the words does not vouch for anything.
593
+ * CODEX_SELECTION_LIST_PATTERN is deliberately left as is (#2774 / #2841).
594
+ *
595
+ * No /g flag (keeps .test() stateless), no nested quantifiers (ReDoS-safe).
596
+ */
597
+ exports.CODEX_PICKER_FOOTER_PATTERN = /^enter\s+select\s*·\s*esc\s+back$/im;
598
+ /**
599
+ * Codex CLI 0.157 effort-picker footer pattern (Issue #2868).
600
+ *
601
+ * The second `/model` step ("Select Reasoning Level for …") closes with
602
+ * `enter default · s session · esc back` (measured:
603
+ * `tests/fixtures/codex-dialogs-0157/model-picker-effort.txt`). Same
604
+ * construction and rules as CODEX_PICKER_FOOTER_PATTERN: the whole row, tested
605
+ * only against a single trimmed footer row.
606
+ *
607
+ * No /g flag (keeps .test() stateless), no nested quantifiers (ReDoS-safe).
608
+ */
609
+ exports.CODEX_EFFORT_PICKER_FOOTER_PATTERN = /^enter\s+default\s*·\s*s\s+session\s*·\s*esc\s+back$/im;
572
610
  /**
573
611
  * Codex CLI pager / edit-previous (transcript) mode footer pattern (Issue #1017)
574
612
  *
@@ -121,10 +121,16 @@ exports.CODEX_GLYPH = '›';
121
121
  * the command approval, `/model`, `/experimental`, `/keymap` and the
122
122
  * directory-trust screen are `waiting`, and every highlighted row is the
123
123
  * one-span shape these rules key on. The rules were first read off 0.153.2.
124
+ *
125
+ * Advanced to 0.157.1 by Issue #2884: the 0.157.1 dialog screens
126
+ * (`codex-dialogs-0157/`) read correctly too, including the directory-trust
127
+ * screen once its WORDING anchor (`CODEX_TRUST_QUESTION_PATTERN` in
128
+ * `../../cli-patterns`) learned that build's reworded question line
129
+ * (`Trust this folder?`) -- see `tests/unit/lib/detection/codex-dialogs-0157.test.ts`.
124
130
  */
125
131
  exports.CODEX_DIALOG_RULES_VERIFIED_AGAINST = {
126
- version: '0.155.1',
127
- capturedAt: '2026-09-21',
132
+ version: '0.157.1',
133
+ capturedAt: '2026-09-27',
128
134
  paneGeometry: '200x1000',
129
135
  };
130
136
  /**
@@ -245,7 +245,14 @@ exports.codexStatusDetector = (0, run_detection_1.createToolStatusDetector)({
245
245
  const codexSelectionWindow = contentLines
246
246
  .slice(Math.max(0, codexContentEnd - frame_1.STATUS_CHECK_LINE_COUNT + 1), codexContentEnd + 1)
247
247
  .join('\n');
248
- if (cli_patterns_1.CODEX_SELECTION_LIST_PATTERN.test(codexSelectionWindow)) {
248
+ // Issue #2868: codex 0.157's `/model` steps close with `enter select · esc
249
+ // back` and `enter default · s session · esc back`. Only the window's LAST
250
+ // non-blank row is tested against them (never the whole window), so the
251
+ // same words quoted in a transcript do not count.
252
+ const codexLastRow = contentLines[codexContentEnd].trim();
253
+ if (cli_patterns_1.CODEX_SELECTION_LIST_PATTERN.test(codexSelectionWindow) ||
254
+ cli_patterns_1.CODEX_PICKER_FOOTER_PATTERN.test(codexLastRow) ||
255
+ cli_patterns_1.CODEX_EFFORT_PICKER_FOOTER_PATTERN.test(codexLastRow)) {
249
256
  const codexPromptDetection = (0, prompt_detector_1.detectPrompt)((0, cli_patterns_1.stripBoxDrawing)(frame.clean), (0, cli_patterns_1.buildDetectPromptOptions)('codex'));
250
257
  // Issue #1628: an approval request wears the same footer as a menu but is the
251
258
  // agent blocked on the human, so it must surface as an active prompt (exit 10
@@ -96,9 +96,13 @@ function detectCodexDialog(frame, context) {
96
96
  //
97
97
  // Issue #2609: the approval form's footer is admitted as its own measured row,
98
98
  // not by widening the list pattern — an `esc to cancel` alone still vouches
99
- // for nothing.
99
+ // for nothing. Issue #2868: 0.157's two `/model` footers (`enter select ·
100
+ // esc back`, then `enter default · s session · esc back`) are admitted the
101
+ // same way.
100
102
  if (!cli_patterns_1.CODEX_SELECTION_LIST_PATTERN.test(block.footer) &&
101
- !cli_patterns_1.CODEX_FORM_SUBMIT_FOOTER_PATTERN.test(block.footer)) {
103
+ !cli_patterns_1.CODEX_FORM_SUBMIT_FOOTER_PATTERN.test(block.footer) &&
104
+ !cli_patterns_1.CODEX_PICKER_FOOTER_PATTERN.test(block.footer) &&
105
+ !cli_patterns_1.CODEX_EFFORT_PICKER_FOOTER_PATTERN.test(block.footer)) {
102
106
  return null;
103
107
  }
104
108
  // Issue #1160: an already-answered block still inside the window is not a
@@ -60,10 +60,19 @@ exports.CLAUDE_VERIFIED_AGAINST = {
60
60
  * verdict. **The stamp moved to 0.155.1 because every 0.155.1 frame now reads
61
61
  * correctly** (`codex-thread-title-bar-2818.test.ts`,
62
62
  * `codex-dialogs-0155-2808.test.ts`).
63
+ *
64
+ * ## Advanced to 0.157.1 by Issue #2868
65
+ *
66
+ * 0.157.1 reworded the `/model` picker's footer to `enter select · esc back`, so
67
+ * the picker read `prompt_detected` and `/prompt-response` refused its answers.
68
+ * #2868 ran the #2842 probe (`tests/fixtures/codex-dialogs-0157/`, 2026-09-27):
69
+ * of the six standard screens only `model-picker.txt` failed, and it reads
70
+ * `codex_selection_list` again via `CODEX_PICKER_FOOTER_PATTERN`
71
+ * (`codex-dialogs-0157.test.ts`).
63
72
  */
64
73
  exports.CODEX_VERIFIED_AGAINST = {
65
- version: '0.155.1',
66
- capturedAt: '2026-09-21',
74
+ version: '0.157.1',
75
+ capturedAt: '2026-09-27',
67
76
  paneGeometry: '200x1000',
68
77
  };
69
78
  /**
@@ -65,10 +65,26 @@
65
65
  * resolving the worktree from `cwd`, which is exactly the hand-configured
66
66
  * behaviour of Issue #1549. `CM_AGENT_HOOKS_INJECT=0` turns the whole thing off.
67
67
  *
68
+ * ## The shared app-server daemon (Issue #2874)
69
+ *
70
+ * From codex **0.157** the TUI attaches by default (`features.daemon_auto_start`)
71
+ * to one machine-wide `codex app-server --managed-daemon`, and hooks run inside
72
+ * *that* process, so they see the daemon's environment — the first instance that
73
+ * started it — not the launching session's. Every later instance was reported as
74
+ * that first one.
75
+ *
76
+ * `-c features.daemon_auto_start=false` ({@link CODEX_EMBEDDED_MODE_ARGS}) only stops
77
+ * codex *starting* a daemon; one already running is still attached to (Issue #2891 —
78
+ * #2874 was observed with none up). `--no-daemon` ({@link CODEX_NO_DAEMON_FLAG}) stays
79
+ * off it even then, when {@link codexSupportsNoDaemon}; both are kept.
80
+ * Measured 2026-09-27 on codex-cli 0.157.1.
81
+ *
68
82
  * @module lib/hooks/sources/codex/hooks-config
69
83
  */
70
84
  Object.defineProperty(exports, "__esModule", { value: true });
71
- exports.CODEX_HOOK_TRUST_POLICY_DEFAULT = exports.CODEX_SUPPORTED_EVENTS = exports.CODEX_PERMISSION_REQUEST_EVENT = exports.CODEX_REGISTERED_EVENTS = exports.CODEX_SESSION_END_TIMEOUT_SECONDS = exports.CODEX_HOOK_TRUST_BYPASS_FLAG = exports.CODEX_HOOK_TRUST_ENV_VAR = exports.CODEX_PERMISSION_URL_ENV_VAR = exports.CODEX_EVENT_URL_ENV_VAR = exports.CODEX_INSTANCE_ID_ENV_VAR = exports.CODEX_WORKTREE_ID_ENV_VAR = exports.CODEX_TOOL_ENV_VAR = exports.CODEX_HOME_ENV_VAR = exports.CODEX_HOOK_MARKER = void 0;
85
+ exports.CODEX_HOOK_TRUST_POLICY_DEFAULT = exports.CODEX_SUPPORTED_EVENTS = exports.CODEX_PERMISSION_REQUEST_EVENT = exports.CODEX_REGISTERED_EVENTS = exports.CODEX_SESSION_END_TIMEOUT_SECONDS = exports.CODEX_NO_DAEMON_FLAG = exports.CODEX_EMBEDDED_MODE_ARGS = exports.CODEX_HOOK_TRUST_BYPASS_FLAG = exports.CODEX_HOOK_TRUST_ENV_VAR = exports.CODEX_PERMISSION_URL_ENV_VAR = exports.CODEX_EVENT_URL_ENV_VAR = exports.CODEX_INSTANCE_ID_ENV_VAR = exports.CODEX_WORKTREE_ID_ENV_VAR = exports.CODEX_TOOL_ENV_VAR = exports.CODEX_HOME_ENV_VAR = exports.CODEX_HOOK_MARKER = void 0;
86
+ exports.codexSupportsNoDaemon = codexSupportsNoDaemon;
87
+ exports.resetCodexNoDaemonSupportCacheForTests = resetCodexNoDaemonSupportCacheForTests;
72
88
  exports.resolveCodexHookTrustPolicy = resolveCodexHookTrustPolicy;
73
89
  exports.isCodexHookTrustBypassEnabled = isCodexHookTrustBypassEnabled;
74
90
  exports.shouldTrustCodexHooks = shouldTrustCodexHooks;
@@ -81,6 +97,7 @@ exports.buildCodexHookSettings = buildCodexHookSettings;
81
97
  exports.mergeCodexHookSettings = mergeCodexHookSettings;
82
98
  exports.writeCodexHookSettings = writeCodexHookSettings;
83
99
  exports.buildCodexLaunchPlan = buildCodexLaunchPlan;
100
+ const child_process_1 = require("child_process");
84
101
  const fs_1 = require("fs");
85
102
  const os_1 = require("os");
86
103
  const path_1 = require("path");
@@ -89,6 +106,7 @@ const types_1 = require("../../../../lib/cli-tools/types");
89
106
  const env_1 = require("../../../../lib/env");
90
107
  const hook_settings_generator_1 = require("../../../../lib/hooks/hook-settings-generator");
91
108
  const logger_1 = require("../../../../lib/logger");
109
+ const env_sanitizer_1 = require("../../../../lib/security/env-sanitizer");
92
110
  const path_validator_1 = require("../../../../lib/security/path-validator");
93
111
  const event_mapper_1 = require("../event-mapper");
94
112
  const relay_install_1 = require("./relay-install");
@@ -134,6 +152,56 @@ exports.CODEX_PERMISSION_URL_ENV_VAR = 'CM_PERMISSION_HOOK_URL';
134
152
  exports.CODEX_HOOK_TRUST_ENV_VAR = 'CM_CODEX_HOOK_TRUST';
135
153
  /** codex's own flag for running unreviewed hooks, for one invocation. */
136
154
  exports.CODEX_HOOK_TRUST_BYPASS_FLAG = '--dangerously-bypass-hook-trust';
155
+ /** codex 0.157+: keep the TUI off the shared app-server daemon so hooks run with this session's env. */
156
+ exports.CODEX_EMBEDDED_MODE_ARGS = '-c features.daemon_auto_start=false';
157
+ /** codex 0.157+: stay off the shared app-server daemon even when one is already running. */
158
+ exports.CODEX_NO_DAEMON_FLAG = '--no-daemon';
159
+ /** How long `codex --help` may take before {@link codexSupportsNoDaemon} gives up. */
160
+ const CODEX_HELP_PROBE_TIMEOUT_MS = 5000;
161
+ /** `--no-daemon` as a whole option name, not the prefix of a longer one. */
162
+ const CODEX_NO_DAEMON_HELP_PATTERN = new RegExp(`${exports.CODEX_NO_DAEMON_FLAG}(?![\\w-])`);
163
+ const noDaemonSupportCache = new Map();
164
+ /**
165
+ * Whether `executablePath --help` lists `--no-daemon`. Cached per executable path for the
166
+ * life of the process. Any failure (spawn error, non-zero exit, timeout) → false.
167
+ *
168
+ * Decided from the help text, not from a version number: a version that was
169
+ * read wrongly, or a build that backported or dropped the option, still gets
170
+ * the answer the binary itself gives. The failure direction is the safe one — an
171
+ * unrecognised option would stop codex starting at all, whereas a missing flag
172
+ * only leaves the #2874 behaviour in place. Failures are cached too, so a codex
173
+ * that hangs on `--help` costs one timeout, not one per launch.
174
+ *
175
+ * Synchronous because `prepareLaunch` is. The child gets the sanitised
176
+ * environment: `executablePath` may be a bare name resolved off the server's
177
+ * `PATH`, and a `--help` probe has no use for CommandMate's credentials.
178
+ */
179
+ function codexSupportsNoDaemon(executablePath) {
180
+ const cached = noDaemonSupportCache.get(executablePath);
181
+ if (cached !== undefined)
182
+ return cached;
183
+ let supported = false;
184
+ try {
185
+ const result = (0, child_process_1.spawnSync)(executablePath, ['--help'], {
186
+ encoding: 'utf8',
187
+ timeout: CODEX_HELP_PROBE_TIMEOUT_MS,
188
+ env: (0, env_sanitizer_1.sanitizeEnvForChildProcess)(),
189
+ });
190
+ supported =
191
+ !result.error &&
192
+ result.status === 0 &&
193
+ CODEX_NO_DAEMON_HELP_PATTERN.test(String(result.stdout ?? ''));
194
+ }
195
+ catch {
196
+ supported = false;
197
+ }
198
+ noDaemonSupportCache.set(executablePath, supported);
199
+ return supported;
200
+ }
201
+ /** Forget what {@link codexSupportsNoDaemon} has learned. Tests only. */
202
+ function resetCodexNoDaemonSupportCacheForTests() {
203
+ noDaemonSupportCache.clear();
204
+ }
137
205
  /**
138
206
  * `SessionEnd`'s budget, in seconds.
139
207
  *
@@ -573,8 +641,15 @@ function buildCodexLaunchPlan(executablePath, target, options = {}) {
573
641
  [exports.CODEX_EVENT_URL_ENV_VAR]: `http://${CODEX_HOOK_HOST}:${port}${hook_settings_generator_1.AGENT_EVENT_PATH}`,
574
642
  [exports.CODEX_PERMISSION_URL_ENV_VAR]: `http://${CODEX_HOOK_HOST}:${port}${hook_settings_generator_1.PERMISSION_REQUEST_PATH}?${query.toString()}`,
575
643
  };
644
+ const noDaemon = (options.supportsNoDaemon ?? codexSupportsNoDaemon(executablePath))
645
+ ? ` ${exports.CODEX_NO_DAEMON_FLAG}`
646
+ : '';
576
647
  const trust = isCodexHookTrustBypassEnabled() ? ` ${exports.CODEX_HOOK_TRUST_BYPASS_FLAG}` : '';
577
- return { command: `${(0, hook_settings_generator_1.shellQuote)(executablePath)}${trust}`, settingsPath, env };
648
+ return {
649
+ command: `${(0, hook_settings_generator_1.shellQuote)(executablePath)} ${exports.CODEX_EMBEDDED_MODE_ARGS}${noDaemon}${trust}`,
650
+ settingsPath,
651
+ env,
652
+ };
578
653
  }
579
654
  catch (error) {
580
655
  logger.warn('codex-hooks-config-write-failed', {
@@ -54,13 +54,18 @@
54
54
  * @module lib/polling/auto-yes-dialog-gate
55
55
  */
56
56
  Object.defineProperty(exports, "__esModule", { value: true });
57
- exports.UNSUPPORTED_DIALOG_LAYOUT_REASON = exports.PROMPT_NO_LONGER_ACTIVE_REASON = exports.AUTO_YES_DIALOG_GATE_ENV_VAR = exports.AUTO_YES_DIALOG_GATE_DEFAULT_MODE = exports.AUTO_YES_DIALOG_GATE_MODES = void 0;
57
+ exports.COMMAND_CODE_UNSUPPORTED_QUESTION_MESSAGE = exports.UNSUPPORTED_DIALOG_LAYOUT_REASON = exports.PROMPT_NO_LONGER_ACTIVE_REASON = exports.AUTO_YES_DIALOG_GATE_ENV_VAR = exports.AUTO_YES_DIALOG_GATE_DEFAULT_MODE = exports.AUTO_YES_DIALOG_GATE_MODES = void 0;
58
58
  exports.resolveAutoYesDialogGateMode = resolveAutoYesDialogGateMode;
59
59
  exports.evaluateAutoYesDialogGate = evaluateAutoYesDialogGate;
60
60
  exports.evaluateDialogPresence = evaluateDialogPresence;
61
61
  exports.judgePromptResponse = judgePromptResponse;
62
+ exports.assessPromptAnswerability = assessPromptAnswerability;
62
63
  const frame_1 = require("../../lib/detection/tools/frame");
63
64
  const registry_1 = require("../../lib/detection/tools/registry");
65
+ const prompt_detector_1 = require("../../lib/detection/prompt-detector");
66
+ const cli_patterns_1 = require("../../lib/detection/cli-patterns");
67
+ const dialog_1 = require("../../lib/detection/tools/antigravity/dialog");
68
+ const dialog_2 = require("../../lib/detection/tools/command-code/dialog");
64
69
  /** Every accepted value of {@link AutoYesDialogGateMode}, for parsing and tests. */
65
70
  exports.AUTO_YES_DIALOG_GATE_MODES = ['enforce', 'legacy'];
66
71
  /**
@@ -309,3 +314,74 @@ function judgePromptResponse(promptCheck, presence) {
309
314
  }
310
315
  return { reason: exports.PROMPT_NO_LONGER_ACTIVE_REASON };
311
316
  }
317
+ /**
318
+ * The refusal text for a Command Code question screen that is plainly up and
319
+ * could not be read (Issue #2522 確定仕様 B).
320
+ *
321
+ * Shares {@link UNSUPPORTED_DIALOG_LAYOUT_REASON} with Issue #2486's refusal —
322
+ * the reason code is what `respond --json` and the CLI branch on, and both cases
323
+ * are the same thing: a picker is on screen whose layout no rule could verify.
324
+ * The SENTENCE is its own because the next step differs in one respect worth
325
+ * saying out loud: this screen's LIST is what could not be read, so retrying
326
+ * once the pane has repainted is genuinely worth a try before walking over to it.
327
+ *
328
+ * Fixed text that never quotes the answer or the frame (SEC-003), so it is safe
329
+ * to return to a client verbatim.
330
+ */
331
+ exports.COMMAND_CODE_UNSUPPORTED_QUESTION_MESSAGE = 'A Command Code question is on screen, but its option list could not be read, so no key was ' +
332
+ 'sent. Answer it in the terminal, or retry once the screen has settled.';
333
+ /**
334
+ * May this frame be answered from CommandMate? (Issue #2870)
335
+ *
336
+ * The ONE reading both `/prompt-response` (before it sends a key) and the status
337
+ * API (`promptAnswerable`, before the UI offers Send) use, so the two can no
338
+ * longer disagree: in #2868 the status API published a prompt off the generic
339
+ * parser alone while `/prompt-response` refused it, and Send did nothing.
340
+ *
341
+ * The order is the route's (#161, #2364, #2457, #2486, #2522): the tool's own
342
+ * reader (agy's `↑/↓ Navigate` dialog, Command Code's question) → the generic
343
+ * parser → {@link evaluateDialogPresence} → {@link judgePromptResponse}.
344
+ *
345
+ * @param cliToolId - CLI tool the frame came from
346
+ * @param frame - The capture itself (ANSI and box drawing intact). It is cleaned
347
+ * here for the parsers; Command Code's reader and the presence gate read it as
348
+ * captured (see {@link evaluateDialogPresence}).
349
+ */
350
+ function assessPromptAnswerability(cliToolId, frame) {
351
+ const cleanOutput = (0, cli_patterns_1.stripBoxDrawing)((0, cli_patterns_1.stripAnsi)(frame));
352
+ const toolDialog = cliToolId === 'antigravity'
353
+ ? (0, dialog_1.detectAntigravityNumberedDialogPrompt)(cleanOutput)
354
+ : null;
355
+ const commandCodeQuestion = cliToolId === 'command-code'
356
+ ? (0, dialog_2.readCommandCodeQuestionDialog)(frame)
357
+ : { kind: 'none' };
358
+ // Plainly up and unreadable: refuse before the generic parser, whose partial
359
+ // list is exactly what must not reach a keystroke.
360
+ if (commandCodeQuestion.kind === 'unsupported') {
361
+ return {
362
+ promptCheck: { isPrompt: false, cleanContent: cleanOutput },
363
+ isCommandCodeQuestion: false,
364
+ refusal: {
365
+ reason: exports.UNSUPPORTED_DIALOG_LAYOUT_REASON,
366
+ message: exports.COMMAND_CODE_UNSUPPORTED_QUESTION_MESSAGE,
367
+ },
368
+ presence: {
369
+ present: false,
370
+ dialog: null,
371
+ mode: exports.AUTO_YES_DIALOG_GATE_DEFAULT_MODE[cliToolId] ?? 'legacy',
372
+ gated: false,
373
+ },
374
+ };
375
+ }
376
+ const isCommandCodeQuestion = commandCodeQuestion.kind === 'prompt';
377
+ const promptCheck = (commandCodeQuestion.kind === 'prompt' ? commandCodeQuestion.prompt : null)
378
+ ?? toolDialog
379
+ ?? (0, prompt_detector_1.detectPrompt)(cleanOutput, (0, cli_patterns_1.buildDetectPromptOptions)(cliToolId));
380
+ const presence = evaluateDialogPresence(cliToolId, promptCheck.promptData?.type, frame);
381
+ return {
382
+ promptCheck,
383
+ isCommandCodeQuestion,
384
+ refusal: judgePromptResponse(promptCheck, presence),
385
+ presence,
386
+ };
387
+ }
@@ -63,6 +63,11 @@ function snapshotFingerprint(payload) {
63
63
  payload.sessionStatus,
64
64
  payload.thinking ?? false,
65
65
  payload.isPromptWaiting ?? false,
66
+ // Issue #2887: so a redraw whose only change is this verdict (a dialog's
67
+ // answerability flipping between `#2870`'s judgement calls) still reaches
68
+ // the push, the same reason `sessionStatus` and the two dismiss-panel
69
+ // fields above are here.
70
+ payload.promptAnswerable ?? null,
66
71
  payload.isSelectionListActive ?? false,
67
72
  payload.isPagerActive ?? false,
68
73
  // Issue #2369: in the fingerprint for the same reason `sessionStatus` is —
@@ -96,6 +101,12 @@ function emitTerminalSnapshot(worktreeId, cliToolId, payload, instanceId) {
96
101
  thinking: payload.thinking ?? false,
97
102
  isPromptWaiting: payload.isPromptWaiting ?? false,
98
103
  promptData: payload.promptData ?? null,
104
+ // Issue #2887: straight through, unlike its neighbours above — not
105
+ // `?? false`. `buildCurrentOutput` publishes this only when it judged the
106
+ // prompt (#2870), and `undefined` here means "no verdict", which
107
+ // `JSON.stringify` (in `broadcast`) already drops from the wire on its own.
108
+ // Defaulting it would turn "not judged" into a judgement.
109
+ promptAnswerable: payload.promptAnswerable,
99
110
  isSelectionListActive: payload.isSelectionListActive ?? false,
100
111
  isPagerActive: payload.isPagerActive ?? false,
101
112
  isDismissablePanelActive: payload.isDismissablePanelActive ?? false,
@@ -0,0 +1,89 @@
1
+ "use strict";
2
+ /**
3
+ * Keep using this server's pre-namespace tmux sessions (Issue #2866).
4
+ *
5
+ * Once a namespace is set, `resolveSessionName` names a session
6
+ * `mcbd-{ns}-{cli}-{worktreeId}[-{suffix}]`. A session the same server started
7
+ * before that is still running under `mcbd-{cli}-{worktreeId}[-{suffix}]`, and
8
+ * would vanish from the UI while its agent keeps running. It is NOT renamed —
9
+ * an older CommandMate running beside this one, or this one after a downgrade,
10
+ * must still find it — but adopted: the new-format name is aliased to the
11
+ * legacy one (`legacy-session-alias.ts`), and the alias is dropped once the
12
+ * legacy session is killed or found gone.
13
+ *
14
+ * Only a session whose `#{session_path}` is the worktree's own directory is
15
+ * adopted (Issue #2865): the same legacy name may be another server's session.
16
+ *
17
+ * Runs once at startup, after `initSessionNamespace` and the worktree-ID
18
+ * session reconcile.
19
+ */
20
+ Object.defineProperty(exports, "__esModule", { value: true });
21
+ exports.adoptLegacySessions = adoptLegacySessions;
22
+ const session_name_1 = require("../../lib/cli-tools/session-name");
23
+ const session_namespace_1 = require("../../lib/cli-tools/session-namespace");
24
+ const session_ownership_1 = require("../../lib/cli-tools/session-ownership");
25
+ const legacy_session_adoption_1 = require("../../lib/cli-tools/legacy-session-adoption");
26
+ const logger_1 = require("../../lib/logger");
27
+ const session_instance_targets_1 = require("./session-instance-targets");
28
+ const logger = (0, logger_1.createLogger)('adopt-legacy-sessions');
29
+ /**
30
+ * Every worktree row. Queried directly rather than through `worktree-db`, for
31
+ * the same reason `worktree-session-reconcile.ts` does: suites mock that module.
32
+ */
33
+ function readWorktrees(db) {
34
+ return db.prepare('SELECT id, path FROM worktrees').all();
35
+ }
36
+ /**
37
+ * Alias each worktree instance's new-format session name to its live legacy
38
+ * session, when the legacy session is this worktree's own and no new-format
39
+ * session exists yet.
40
+ *
41
+ * Never throws — a startup pass must not be able to stop the server.
42
+ *
43
+ * @param db - Database instance (worktrees and the agent roster)
44
+ */
45
+ async function adoptLegacySessions(db, options) {
46
+ const result = { adopted: [], errors: [] };
47
+ const namespace = options?.namespace !== undefined ? options.namespace : (0, session_namespace_1.getSessionNamespace)();
48
+ // No namespace: the current name IS the legacy name, nothing to adopt.
49
+ if (namespace === null)
50
+ return result;
51
+ const list = options?.tmux?.listSessions ?? legacy_session_adoption_1.listSessions;
52
+ const isOwnedBy = options?.tmux?.isSessionOwnedBy ?? session_ownership_1.isSessionPathOwnedBy;
53
+ let livePaths;
54
+ let worktrees;
55
+ try {
56
+ const sessions = await list();
57
+ livePaths = new Map(sessions.map((session) => [session.name, session.path]));
58
+ worktrees = livePaths.size === 0 ? [] : readWorktrees(db);
59
+ }
60
+ catch (error) {
61
+ result.errors.push(error instanceof Error ? error.message : String(error));
62
+ logger.warn('adopt-legacy:failed', { error: result.errors[0] });
63
+ return result;
64
+ }
65
+ for (const worktree of worktrees) {
66
+ for (const { cliToolId, instanceId } of (0, session_instance_targets_1.collectInstanceTargets)(db, [worktree.id])) {
67
+ try {
68
+ const legacyName = (0, session_name_1.resolveLegacySessionName)(cliToolId, worktree.id, instanceId);
69
+ if (!livePaths.has(legacyName))
70
+ continue;
71
+ const newName = (0, session_name_1.resolveNamespacedSessionName)(namespace, cliToolId, worktree.id, instanceId);
72
+ if (livePaths.has(newName))
73
+ continue;
74
+ if (!isOwnedBy(livePaths.get(legacyName) ?? null, worktree.path))
75
+ continue;
76
+ (0, legacy_session_adoption_1.registerLegacyAlias)(newName, legacyName);
77
+ result.adopted.push({ worktreeId: worktree.id, newName, legacyName });
78
+ }
79
+ catch (error) {
80
+ result.errors.push(`${worktree.id}/${instanceId}: ${error instanceof Error ? error.message : String(error)}`);
81
+ }
82
+ }
83
+ }
84
+ logger.info('adopt-legacy:complete', {
85
+ adopted: result.adopted.length,
86
+ errors: result.errors.length,
87
+ });
88
+ return result;
89
+ }
@@ -27,8 +27,9 @@ const child_process_1 = require("child_process");
27
27
  const util_1 = require("util");
28
28
  const promises_1 = require("fs/promises");
29
29
  const logger_1 = require("../../lib/logger");
30
+ const session_ownership_1 = require("../../lib/cli-tools/session-ownership");
30
31
  const cli_tool_timing_config_1 = require("../../config/cli-tool-timing-config");
31
- const types_1 = require("../../lib/cli-tools/types");
32
+ const session_name_1 = require("../../lib/cli-tools/session-name");
32
33
  const sources_1 = require("../../lib/hooks/sources");
33
34
  const hook_settings_generator_1 = require("../../lib/hooks/hook-settings-generator");
34
35
  const cmate_cli_tool_parser_1 = require("../../lib/cmate-cli-tool-parser");
@@ -340,9 +341,9 @@ async function ensureHealthySession(sessionName) {
340
341
  * Get tmux session name for a worktree
341
342
  *
342
343
  * Issue #868: Supports additional agent instances. The primary instance
343
- * (instanceId omitted or equal to 'claude') keeps the original
344
- * `mcbd-claude-{worktreeId}` name for backward compatibility. Additional
345
- * instances append a suffix derived from the instance ID.
344
+ * (instanceId omitted or equal to 'claude') carries no suffix; additional
345
+ * instances append a suffix derived from the instance ID. Issue #2866: the
346
+ * rule is `resolveSessionName`'s (server namespace included).
346
347
  *
347
348
  * @param worktreeId - Worktree ID
348
349
  * @param instanceId - Optional agent instance ID (defaults to primary)
@@ -355,12 +356,11 @@ async function ensureHealthySession(sessionName) {
355
356
  * ```
356
357
  */
357
358
  function getSessionName(worktreeId, instanceId) {
358
- const base = `mcbd-claude-${worktreeId}`;
359
- if (!instanceId || instanceId === 'claude') {
360
- return base;
361
- }
362
- const suffix = (0, types_1.deriveSessionSuffix)(instanceId, 'claude');
363
- return suffix ? `${base}-${suffix}` : base;
359
+ // Issue #2866: delegated so the server namespace and adopted legacy sessions
360
+ // apply to Claude exactly as to every other tool. A local copy of the rule
361
+ // would start, send to and stop `mcbd-claude-*` while capture and the UI
362
+ // address `mcbd-{ns}-claude-*`.
363
+ return (0, session_name_1.resolveSessionName)('claude', worktreeId, instanceId);
364
364
  }
365
365
  /**
366
366
  * Check if Claude is installed and available
@@ -486,6 +486,9 @@ async function startClaudeSession(options) {
486
486
  // Check if session already exists
487
487
  const exists = await (0, tmux_1.hasSession)(sessionName);
488
488
  if (exists) {
489
+ // Issue #2865: a same-named session another CommandMate server created is
490
+ // refused before the health check can kill or reuse it.
491
+ await (0, session_ownership_1.assertSessionNotForeign)(sessionName, worktreePath);
489
492
  // SF-S2-004: Health check on existing session
490
493
  const healthy = await ensureHealthySession(sessionName);
491
494
  if (healthy) {
@@ -85,6 +85,7 @@ const prompt_waiting_composition_1 = require("../../lib/session/prompt-waiting-c
85
85
  const provisional_turn_1 = require("../../lib/session/provisional-turn");
86
86
  const status_evidence_1 = require("../../lib/session/status-evidence");
87
87
  const ask_user_question_prompt_1 = require("../../lib/session/ask-user-question-prompt");
88
+ const auto_yes_dialog_gate_1 = require("../../lib/polling/auto-yes-dialog-gate");
88
89
  const layer_disagreement_1 = require("../../lib/session/layer-disagreement");
89
90
  const structured_prompt_1 = require("../../lib/session/structured-prompt");
90
91
  const logger = (0, logger_1.createLogger)('current-output-builder');
@@ -632,6 +633,9 @@ async function buildPayload(db, worktreeId, cliToolId, instanceId) {
632
633
  const resolvedInstanceId = instanceId ?? cliToolId;
633
634
  const manager = manager_1.CLIToolManager.getInstance();
634
635
  const cliTool = manager.getTool(cliToolId);
636
+ // Issue #2886: read once, independent of `isRunning`, so both return paths
637
+ // below publish the same value the pane is (or would be) reached at.
638
+ const sessionName = cliTool.getSessionName(worktreeId, instanceId);
635
639
  const stopEventAt = (0, agent_event_state_1.getLastStopEventAt)(worktreeId, cliToolId, instanceId);
636
640
  const lastEvent = (0, agent_event_state_1.getLastAgentEvent)(worktreeId, cliToolId, instanceId);
637
641
  // Issue #1924: the registry answers for every tool — a real implementation
@@ -743,6 +747,7 @@ async function buildPayload(db, worktreeId, cliToolId, instanceId) {
743
747
  (0, status_evidence_1.forgetLastKnownStatus)((0, auto_yes_manager_1.buildCompositeKey)(worktreeId, cliToolId, instanceId));
744
748
  return {
745
749
  isRunning: false,
750
+ sessionName,
746
751
  content: '',
747
752
  lineCount: 0,
748
753
  cliToolId,
@@ -1029,6 +1034,17 @@ async function buildPayload(db, worktreeId, cliToolId, instanceId) {
1029
1034
  : structuredFacts
1030
1035
  ? (0, structured_prompt_1.buildStructuredPromptData)(worktreeId, structuredFacts)
1031
1036
  : null;
1037
+ // Issue #2870: whether `/prompt-response` would answer the prompt published
1038
+ // above, read by the SAME function it re-verifies with. In #2868 `promptData`
1039
+ // came off the generic parser alone, the route refused it, and the UI's Send
1040
+ // did nothing. Only for a parser-read prompt: the structured form (hook
1041
+ // `decisionId`, degraded) is answered by id or not by number at all, so the
1042
+ // key is left out there, as it is when no prompt is up. `isPromptWaiting` /
1043
+ // `promptData` / `sessionStatus` are untouched — `wait`'s exit 10, Auto-Yes
1044
+ // and push notifications keep reading exactly what they read before.
1045
+ const promptAnswerable = scraperPromptWaiting && (correctedPromptData ?? scraperPromptData)
1046
+ ? (0, auto_yes_dialog_gate_1.assessPromptAnswerability)(cliToolId, output).refusal === null
1047
+ : undefined;
1032
1048
  // Issue #1723 §3: the field data this Epic is being built on. Every line is
1033
1049
  // one poll where the screen and the agent disagreed about what the agent was
1034
1050
  // doing, which is the only way to answer "how wrong was the scraper?" with a
@@ -1165,6 +1181,7 @@ async function buildPayload(db, worktreeId, cliToolId, instanceId) {
1165
1181
  const lastKnown = (0, status_evidence_1.getLastKnownStatus)(compositeKey);
1166
1182
  return {
1167
1183
  isRunning: true,
1184
+ sessionName,
1168
1185
  cliToolId,
1169
1186
  sessionStatus: merged.status,
1170
1187
  sessionStatusReason: merged.reason,
@@ -1181,6 +1198,7 @@ async function buildPayload(db, worktreeId, cliToolId, instanceId) {
1181
1198
  thinkingMessage: merged.thinking ? `${(0, types_2.getCliToolDisplayName)(cliToolId)} is thinking...` : null,
1182
1199
  isPromptWaiting,
1183
1200
  promptData,
1201
+ ...(promptAnswerable !== undefined ? { promptAnswerable } : {}),
1184
1202
  autoYes: {
1185
1203
  enabled: autoYesState?.enabled ?? false,
1186
1204
  expiresAt: autoYesState?.enabled ? autoYesState.expiresAt : null,