commandmate 0.44.2 → 0.45.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 (621) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-build-manifest.json +289 -289
  3. package/.next/app-path-routes-manifest.json +20 -20
  4. package/.next/build-manifest.json +5 -5
  5. package/.next/next-server.js.nft.json +1 -1
  6. package/.next/prerender-manifest.json +12 -12
  7. package/.next/react-loadable-manifest.json +26 -32
  8. package/.next/required-server-files.json +1 -1
  9. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  10. package/.next/server/app/api/agents/update/route.js +1 -1
  11. package/.next/server/app/api/agents/update/route_client-reference-manifest.js +1 -1
  12. package/.next/server/app/api/agents/versions/route.js +1 -1
  13. package/.next/server/app/api/agents/versions/route_client-reference-manifest.js +1 -1
  14. package/.next/server/app/api/app/release-notes/route_client-reference-manifest.js +1 -1
  15. package/.next/server/app/api/app/update/route.js +2 -2
  16. package/.next/server/app/api/app/update/route_client-reference-manifest.js +1 -1
  17. package/.next/server/app/api/app/update-check/route_client-reference-manifest.js +1 -1
  18. package/.next/server/app/api/auth/login/route.js +1 -1
  19. package/.next/server/app/api/auth/login/route_client-reference-manifest.js +1 -1
  20. package/.next/server/app/api/auth/logout/route_client-reference-manifest.js +1 -1
  21. package/.next/server/app/api/auth/status/route_client-reference-manifest.js +1 -1
  22. package/.next/server/app/api/capabilities/route.js +1 -1
  23. package/.next/server/app/api/capabilities/route_client-reference-manifest.js +1 -1
  24. package/.next/server/app/api/daily-summary/route.js +1 -1
  25. package/.next/server/app/api/daily-summary/route.js.nft.json +1 -1
  26. package/.next/server/app/api/daily-summary/route_client-reference-manifest.js +1 -1
  27. package/.next/server/app/api/daily-summary/status/route.js +1 -1
  28. package/.next/server/app/api/daily-summary/status/route.js.nft.json +1 -1
  29. package/.next/server/app/api/daily-summary/status/route_client-reference-manifest.js +1 -1
  30. package/.next/server/app/api/external-apps/[id]/health/route_client-reference-manifest.js +1 -1
  31. package/.next/server/app/api/external-apps/[id]/route.js +1 -1
  32. package/.next/server/app/api/external-apps/[id]/route_client-reference-manifest.js +1 -1
  33. package/.next/server/app/api/external-apps/route.js +1 -1
  34. package/.next/server/app/api/external-apps/route_client-reference-manifest.js +1 -1
  35. package/.next/server/app/api/fs/browse/route_client-reference-manifest.js +1 -1
  36. package/.next/server/app/api/fs/recent-paths/route_client-reference-manifest.js +1 -1
  37. package/.next/server/app/api/hooks/agent-event/route.js +2 -2
  38. package/.next/server/app/api/hooks/agent-event/route.js.nft.json +1 -1
  39. package/.next/server/app/api/hooks/agent-event/route_client-reference-manifest.js +1 -1
  40. package/.next/server/app/api/hooks/claude-done/route.js +2 -2
  41. package/.next/server/app/api/hooks/claude-done/route.js.nft.json +1 -1
  42. package/.next/server/app/api/hooks/claude-done/route_client-reference-manifest.js +1 -1
  43. package/.next/server/app/api/hooks/permission-request/route.js +1 -1
  44. package/.next/server/app/api/hooks/permission-request/route.js.nft.json +1 -1
  45. package/.next/server/app/api/hooks/permission-request/route_client-reference-manifest.js +1 -1
  46. package/.next/server/app/api/metrics/vibe/route_client-reference-manifest.js +1 -1
  47. package/.next/server/app/api/ollama/models/route_client-reference-manifest.js +1 -1
  48. package/.next/server/app/api/push/escalation/route.js +1 -1
  49. package/.next/server/app/api/push/escalation/route_client-reference-manifest.js +1 -1
  50. package/.next/server/app/api/push/subscriptions/route.js +2 -2
  51. package/.next/server/app/api/push/subscriptions/route_client-reference-manifest.js +1 -1
  52. package/.next/server/app/api/push/vapid/route.js +1 -1
  53. package/.next/server/app/api/push/vapid/route_client-reference-manifest.js +1 -1
  54. package/.next/server/app/api/relays/[relayId]/cancel/route.js +1 -1
  55. package/.next/server/app/api/relays/[relayId]/cancel/route.js.nft.json +1 -1
  56. package/.next/server/app/api/relays/[relayId]/cancel/route_client-reference-manifest.js +1 -1
  57. package/.next/server/app/api/relays/route.js +1 -1
  58. package/.next/server/app/api/relays/route.js.nft.json +1 -1
  59. package/.next/server/app/api/relays/route_client-reference-manifest.js +1 -1
  60. package/.next/server/app/api/remote/pair/route_client-reference-manifest.js +1 -1
  61. package/.next/server/app/api/repositories/[id]/route.js +1 -1
  62. package/.next/server/app/api/repositories/[id]/route_client-reference-manifest.js +1 -1
  63. package/.next/server/app/api/repositories/clone/[jobId]/route.js +1 -1
  64. package/.next/server/app/api/repositories/clone/[jobId]/route.js.nft.json +1 -1
  65. package/.next/server/app/api/repositories/clone/[jobId]/route_client-reference-manifest.js +1 -1
  66. package/.next/server/app/api/repositories/clone/route.js +1 -1
  67. package/.next/server/app/api/repositories/clone/route.js.nft.json +1 -1
  68. package/.next/server/app/api/repositories/clone/route_client-reference-manifest.js +1 -1
  69. package/.next/server/app/api/repositories/excluded/route_client-reference-manifest.js +1 -1
  70. package/.next/server/app/api/repositories/restore/route.js +1 -1
  71. package/.next/server/app/api/repositories/restore/route.js.nft.json +1 -1
  72. package/.next/server/app/api/repositories/restore/route_client-reference-manifest.js +1 -1
  73. package/.next/server/app/api/repositories/route.js +1 -1
  74. package/.next/server/app/api/repositories/route.js.nft.json +1 -1
  75. package/.next/server/app/api/repositories/route_client-reference-manifest.js +1 -1
  76. package/.next/server/app/api/repositories/scan/route.js +1 -1
  77. package/.next/server/app/api/repositories/scan/route.js.nft.json +1 -1
  78. package/.next/server/app/api/repositories/scan/route_client-reference-manifest.js +1 -1
  79. package/.next/server/app/api/repositories/sync/route.js +1 -1
  80. package/.next/server/app/api/repositories/sync/route.js.nft.json +1 -1
  81. package/.next/server/app/api/repositories/sync/route_client-reference-manifest.js +1 -1
  82. package/.next/server/app/api/repositories/validate-path/route_client-reference-manifest.js +1 -1
  83. package/.next/server/app/api/settings/default-agents/route.js +1 -1
  84. package/.next/server/app/api/settings/default-agents/route.js.nft.json +1 -1
  85. package/.next/server/app/api/settings/default-agents/route_client-reference-manifest.js +1 -1
  86. package/.next/server/app/api/settings/default-surface-mode/route_client-reference-manifest.js +1 -1
  87. package/.next/server/app/api/sidebar/group-order/route.js +1 -1
  88. package/.next/server/app/api/sidebar/group-order/route_client-reference-manifest.js +1 -1
  89. package/.next/server/app/api/skills/[id]/route.js +1 -1
  90. package/.next/server/app/api/skills/[id]/route_client-reference-manifest.js +1 -1
  91. package/.next/server/app/api/skills/installations/route_client-reference-manifest.js +1 -1
  92. package/.next/server/app/api/skills/operations/route_client-reference-manifest.js +1 -1
  93. package/.next/server/app/api/skills/reindex/route_client-reference-manifest.js +1 -1
  94. package/.next/server/app/api/skills/route.js +1 -1
  95. package/.next/server/app/api/skills/route_client-reference-manifest.js +1 -1
  96. package/.next/server/app/api/slash-commands/route_client-reference-manifest.js +1 -1
  97. package/.next/server/app/api/tasks/[taskId]/cancel/route_client-reference-manifest.js +1 -1
  98. package/.next/server/app/api/tasks/[taskId]/route_client-reference-manifest.js +1 -1
  99. package/.next/server/app/api/templates/[id]/route.js +2 -2
  100. package/.next/server/app/api/templates/[id]/route_client-reference-manifest.js +1 -1
  101. package/.next/server/app/api/templates/route.js +2 -2
  102. package/.next/server/app/api/templates/route_client-reference-manifest.js +1 -1
  103. package/.next/server/app/api/verification/runs/[runId]/route_client-reference-manifest.js +1 -1
  104. package/.next/server/app/api/verification/runs/route_client-reference-manifest.js +1 -1
  105. package/.next/server/app/api/worktrees/[id]/auto-yes/route.js +1 -1
  106. package/.next/server/app/api/worktrees/[id]/auto-yes/route.js.nft.json +1 -1
  107. package/.next/server/app/api/worktrees/[id]/auto-yes/route_client-reference-manifest.js +1 -1
  108. package/.next/server/app/api/worktrees/[id]/capture/route.js +1 -1
  109. package/.next/server/app/api/worktrees/[id]/capture/route.js.nft.json +1 -1
  110. package/.next/server/app/api/worktrees/[id]/capture/route_client-reference-manifest.js +1 -1
  111. package/.next/server/app/api/worktrees/[id]/clear-composer/route.js +1 -1
  112. package/.next/server/app/api/worktrees/[id]/clear-composer/route.js.nft.json +1 -1
  113. package/.next/server/app/api/worktrees/[id]/clear-composer/route_client-reference-manifest.js +1 -1
  114. package/.next/server/app/api/worktrees/[id]/cli-reference/route_client-reference-manifest.js +1 -1
  115. package/.next/server/app/api/worktrees/[id]/cli-tool/route.js +1 -1
  116. package/.next/server/app/api/worktrees/[id]/cli-tool/route_client-reference-manifest.js +1 -1
  117. package/.next/server/app/api/worktrees/[id]/cmate/schedules/route.js +3 -3
  118. package/.next/server/app/api/worktrees/[id]/cmate/schedules/route.js.nft.json +1 -1
  119. package/.next/server/app/api/worktrees/[id]/cmate/schedules/route_client-reference-manifest.js +1 -1
  120. package/.next/server/app/api/worktrees/[id]/current-output/route.js +1 -1
  121. package/.next/server/app/api/worktrees/[id]/current-output/route.js.nft.json +1 -1
  122. package/.next/server/app/api/worktrees/[id]/current-output/route_client-reference-manifest.js +1 -1
  123. package/.next/server/app/api/worktrees/[id]/direct-input/route.js +1 -1
  124. package/.next/server/app/api/worktrees/[id]/direct-input/route.js.nft.json +1 -1
  125. package/.next/server/app/api/worktrees/[id]/direct-input/route_client-reference-manifest.js +1 -1
  126. package/.next/server/app/api/worktrees/[id]/env/route_client-reference-manifest.js +1 -1
  127. package/.next/server/app/api/worktrees/[id]/execution-logs/[logId]/route_client-reference-manifest.js +1 -1
  128. package/.next/server/app/api/worktrees/[id]/execution-logs/route.js +2 -2
  129. package/.next/server/app/api/worktrees/[id]/execution-logs/route.js.nft.json +1 -1
  130. package/.next/server/app/api/worktrees/[id]/execution-logs/route_client-reference-manifest.js +1 -1
  131. package/.next/server/app/api/worktrees/[id]/files/[...path]/route.js +1 -1
  132. package/.next/server/app/api/worktrees/[id]/files/[...path]/route_client-reference-manifest.js +1 -1
  133. package/.next/server/app/api/worktrees/[id]/git/branch/create/route.js +1 -1
  134. package/.next/server/app/api/worktrees/[id]/git/branch/create/route_client-reference-manifest.js +1 -1
  135. package/.next/server/app/api/worktrees/[id]/git/branch/delete/route.js +1 -1
  136. package/.next/server/app/api/worktrees/[id]/git/branch/delete/route_client-reference-manifest.js +1 -1
  137. package/.next/server/app/api/worktrees/[id]/git/branches/route_client-reference-manifest.js +1 -1
  138. package/.next/server/app/api/worktrees/[id]/git/checkout/route.js +1 -1
  139. package/.next/server/app/api/worktrees/[id]/git/checkout/route_client-reference-manifest.js +1 -1
  140. package/.next/server/app/api/worktrees/[id]/git/commit/route.js +1 -1
  141. package/.next/server/app/api/worktrees/[id]/git/commit/route_client-reference-manifest.js +1 -1
  142. package/.next/server/app/api/worktrees/[id]/git/diff/route_client-reference-manifest.js +1 -1
  143. package/.next/server/app/api/worktrees/[id]/git/fetch/route.js +1 -1
  144. package/.next/server/app/api/worktrees/[id]/git/fetch/route_client-reference-manifest.js +1 -1
  145. package/.next/server/app/api/worktrees/[id]/git/log/route_client-reference-manifest.js +1 -1
  146. package/.next/server/app/api/worktrees/[id]/git/pull/route.js +1 -1
  147. package/.next/server/app/api/worktrees/[id]/git/pull/route_client-reference-manifest.js +1 -1
  148. package/.next/server/app/api/worktrees/[id]/git/push/route.js +1 -1
  149. package/.next/server/app/api/worktrees/[id]/git/push/route_client-reference-manifest.js +1 -1
  150. package/.next/server/app/api/worktrees/[id]/git/reset/route.js +1 -1
  151. package/.next/server/app/api/worktrees/[id]/git/reset/route_client-reference-manifest.js +1 -1
  152. package/.next/server/app/api/worktrees/[id]/git/revert/route.js +1 -1
  153. package/.next/server/app/api/worktrees/[id]/git/revert/route_client-reference-manifest.js +1 -1
  154. package/.next/server/app/api/worktrees/[id]/git/show/[commitHash]/route_client-reference-manifest.js +1 -1
  155. package/.next/server/app/api/worktrees/[id]/git/stage/route.js +1 -1
  156. package/.next/server/app/api/worktrees/[id]/git/stage/route_client-reference-manifest.js +1 -1
  157. package/.next/server/app/api/worktrees/[id]/git/staged/route_client-reference-manifest.js +1 -1
  158. package/.next/server/app/api/worktrees/[id]/git/stash/[index]/route_client-reference-manifest.js +1 -1
  159. package/.next/server/app/api/worktrees/[id]/git/stash/apply/route.js +1 -1
  160. package/.next/server/app/api/worktrees/[id]/git/stash/apply/route_client-reference-manifest.js +1 -1
  161. package/.next/server/app/api/worktrees/[id]/git/stash/pop/route.js +1 -1
  162. package/.next/server/app/api/worktrees/[id]/git/stash/pop/route_client-reference-manifest.js +1 -1
  163. package/.next/server/app/api/worktrees/[id]/git/stash/push/route.js +1 -1
  164. package/.next/server/app/api/worktrees/[id]/git/stash/push/route_client-reference-manifest.js +1 -1
  165. package/.next/server/app/api/worktrees/[id]/git/stash/route_client-reference-manifest.js +1 -1
  166. package/.next/server/app/api/worktrees/[id]/git/status/route_client-reference-manifest.js +1 -1
  167. package/.next/server/app/api/worktrees/[id]/git/unstage/route.js +1 -1
  168. package/.next/server/app/api/worktrees/[id]/git/unstage/route_client-reference-manifest.js +1 -1
  169. package/.next/server/app/api/worktrees/[id]/git/working-diff/route_client-reference-manifest.js +1 -1
  170. package/.next/server/app/api/worktrees/[id]/instances/notes/route.js +1 -1
  171. package/.next/server/app/api/worktrees/[id]/instances/notes/route_client-reference-manifest.js +1 -1
  172. package/.next/server/app/api/worktrees/[id]/instances/opencode/route.js +1 -1
  173. package/.next/server/app/api/worktrees/[id]/instances/opencode/route.js.nft.json +1 -1
  174. package/.next/server/app/api/worktrees/[id]/instances/opencode/route_client-reference-manifest.js +1 -1
  175. package/.next/server/app/api/worktrees/[id]/interrupt/route.js +1 -1
  176. package/.next/server/app/api/worktrees/[id]/interrupt/route.js.nft.json +1 -1
  177. package/.next/server/app/api/worktrees/[id]/interrupt/route_client-reference-manifest.js +1 -1
  178. package/.next/server/app/api/worktrees/[id]/kill-session/route.js +1 -1
  179. package/.next/server/app/api/worktrees/[id]/kill-session/route.js.nft.json +1 -1
  180. package/.next/server/app/api/worktrees/[id]/kill-session/route_client-reference-manifest.js +1 -1
  181. package/.next/server/app/api/worktrees/[id]/logs/[filename]/route_client-reference-manifest.js +1 -1
  182. package/.next/server/app/api/worktrees/[id]/logs/route_client-reference-manifest.js +1 -1
  183. package/.next/server/app/api/worktrees/[id]/marp-render/route.js +3 -3
  184. package/.next/server/app/api/worktrees/[id]/marp-render/route_client-reference-manifest.js +1 -1
  185. package/.next/server/app/api/worktrees/[id]/memos/[memoId]/route.js +1 -1
  186. package/.next/server/app/api/worktrees/[id]/memos/[memoId]/route_client-reference-manifest.js +1 -1
  187. package/.next/server/app/api/worktrees/[id]/memos/route.js +1 -1
  188. package/.next/server/app/api/worktrees/[id]/memos/route_client-reference-manifest.js +1 -1
  189. package/.next/server/app/api/worktrees/[id]/messages/route_client-reference-manifest.js +1 -1
  190. package/.next/server/app/api/worktrees/[id]/opencode/diff/route.js +1 -1
  191. package/.next/server/app/api/worktrees/[id]/opencode/diff/route_client-reference-manifest.js +1 -1
  192. package/.next/server/app/api/worktrees/[id]/opencode/session/route.js +1 -1
  193. package/.next/server/app/api/worktrees/[id]/opencode/session/route.js.nft.json +1 -1
  194. package/.next/server/app/api/worktrees/[id]/opencode/session/route_client-reference-manifest.js +1 -1
  195. package/.next/server/app/api/worktrees/[id]/opencode/share/route.js +1 -1
  196. package/.next/server/app/api/worktrees/[id]/opencode/share/route.js.nft.json +1 -1
  197. package/.next/server/app/api/worktrees/[id]/opencode/share/route_client-reference-manifest.js +1 -1
  198. package/.next/server/app/api/worktrees/[id]/prompt-response/route.js +1 -1
  199. package/.next/server/app/api/worktrees/[id]/prompt-response/route.js.nft.json +1 -1
  200. package/.next/server/app/api/worktrees/[id]/prompt-response/route_client-reference-manifest.js +1 -1
  201. package/.next/server/app/api/worktrees/[id]/resolve-target/route_client-reference-manifest.js +1 -1
  202. package/.next/server/app/api/worktrees/[id]/respond/route.js +1 -1
  203. package/.next/server/app/api/worktrees/[id]/respond/route.js.nft.json +1 -1
  204. package/.next/server/app/api/worktrees/[id]/respond/route_client-reference-manifest.js +1 -1
  205. package/.next/server/app/api/worktrees/[id]/route.js +1 -1
  206. package/.next/server/app/api/worktrees/[id]/route.js.nft.json +1 -1
  207. package/.next/server/app/api/worktrees/[id]/route_client-reference-manifest.js +1 -1
  208. package/.next/server/app/api/worktrees/[id]/schedules/[scheduleId]/route.js +2 -2
  209. package/.next/server/app/api/worktrees/[id]/schedules/[scheduleId]/route.js.nft.json +1 -1
  210. package/.next/server/app/api/worktrees/[id]/schedules/[scheduleId]/route_client-reference-manifest.js +1 -1
  211. package/.next/server/app/api/worktrees/[id]/schedules/active/route.js +2 -2
  212. package/.next/server/app/api/worktrees/[id]/schedules/active/route.js.nft.json +1 -1
  213. package/.next/server/app/api/worktrees/[id]/schedules/active/route_client-reference-manifest.js +1 -1
  214. package/.next/server/app/api/worktrees/[id]/schedules/route.js +3 -3
  215. package/.next/server/app/api/worktrees/[id]/schedules/route.js.nft.json +1 -1
  216. package/.next/server/app/api/worktrees/[id]/schedules/route_client-reference-manifest.js +1 -1
  217. package/.next/server/app/api/worktrees/[id]/search/route_client-reference-manifest.js +1 -1
  218. package/.next/server/app/api/worktrees/[id]/send/route.js +1 -1
  219. package/.next/server/app/api/worktrees/[id]/send/route.js.nft.json +1 -1
  220. package/.next/server/app/api/worktrees/[id]/send/route_client-reference-manifest.js +1 -1
  221. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route.js +2 -2
  222. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route.js.nft.json +1 -1
  223. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route_client-reference-manifest.js +1 -1
  224. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/install/route_client-reference-manifest.js +1 -1
  225. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/plan/route.js +1 -1
  226. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/plan/route_client-reference-manifest.js +1 -1
  227. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall/route_client-reference-manifest.js +1 -1
  228. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall-plan/route_client-reference-manifest.js +1 -1
  229. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/update/route_client-reference-manifest.js +1 -1
  230. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/update-plan/route.js +1 -1
  231. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/update-plan/route_client-reference-manifest.js +1 -1
  232. package/.next/server/app/api/worktrees/[id]/skills/route_client-reference-manifest.js +1 -1
  233. package/.next/server/app/api/worktrees/[id]/slash-commands/route.js +1 -1
  234. package/.next/server/app/api/worktrees/[id]/slash-commands/route_client-reference-manifest.js +1 -1
  235. package/.next/server/app/api/worktrees/[id]/special-keys/route.js +1 -1
  236. package/.next/server/app/api/worktrees/[id]/special-keys/route.js.nft.json +1 -1
  237. package/.next/server/app/api/worktrees/[id]/special-keys/route_client-reference-manifest.js +1 -1
  238. package/.next/server/app/api/worktrees/[id]/tasks/route.js +1 -1
  239. package/.next/server/app/api/worktrees/[id]/tasks/route_client-reference-manifest.js +1 -1
  240. package/.next/server/app/api/worktrees/[id]/terminal/route.js +2 -2
  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_client-reference-manifest.js +1 -1
  244. package/.next/server/app/api/worktrees/[id]/timers/route.js +1 -1
  245. package/.next/server/app/api/worktrees/[id]/timers/route.js.nft.json +1 -1
  246. package/.next/server/app/api/worktrees/[id]/timers/route_client-reference-manifest.js +1 -1
  247. package/.next/server/app/api/worktrees/[id]/todos/[todoId]/route.js +1 -1
  248. package/.next/server/app/api/worktrees/[id]/todos/[todoId]/route_client-reference-manifest.js +1 -1
  249. package/.next/server/app/api/worktrees/[id]/todos/route.js +1 -1
  250. package/.next/server/app/api/worktrees/[id]/todos/route_client-reference-manifest.js +1 -1
  251. package/.next/server/app/api/worktrees/[id]/tree/[...path]/route_client-reference-manifest.js +1 -1
  252. package/.next/server/app/api/worktrees/[id]/tree/route_client-reference-manifest.js +1 -1
  253. package/.next/server/app/api/worktrees/[id]/upload/[...path]/route_client-reference-manifest.js +1 -1
  254. package/.next/server/app/api/worktrees/[id]/verify/config/route.js +1 -1
  255. package/.next/server/app/api/worktrees/[id]/verify/config/route_client-reference-manifest.js +1 -1
  256. package/.next/server/app/api/worktrees/[id]/verify/route.js +1 -1
  257. package/.next/server/app/api/worktrees/[id]/verify/route_client-reference-manifest.js +1 -1
  258. package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/cancel/route.js +1 -1
  259. package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/cancel/route_client-reference-manifest.js +1 -1
  260. package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/route_client-reference-manifest.js +1 -1
  261. package/.next/server/app/api/worktrees/[id]/verify/runs/route_client-reference-manifest.js +1 -1
  262. package/.next/server/app/api/worktrees/[id]/viewed/route_client-reference-manifest.js +1 -1
  263. package/.next/server/app/api/worktrees/apply-default-agents/route_client-reference-manifest.js +1 -1
  264. package/.next/server/app/api/worktrees/route.js +1 -1
  265. package/.next/server/app/api/worktrees/route.js.nft.json +1 -1
  266. package/.next/server/app/api/worktrees/route_client-reference-manifest.js +1 -1
  267. package/.next/server/app/login/page_client-reference-manifest.js +1 -1
  268. package/.next/server/app/manifest.webmanifest/route_client-reference-manifest.js +1 -1
  269. package/.next/server/app/more/page_client-reference-manifest.js +1 -1
  270. package/.next/server/app/offline/page_client-reference-manifest.js +1 -1
  271. package/.next/server/app/page_client-reference-manifest.js +1 -1
  272. package/.next/server/app/proxy/[...path]/route_client-reference-manifest.js +1 -1
  273. package/.next/server/app/repositories/page_client-reference-manifest.js +1 -1
  274. package/.next/server/app/review/page_client-reference-manifest.js +1 -1
  275. package/.next/server/app/sessions/page.js +1 -1
  276. package/.next/server/app/sessions/page.js.nft.json +1 -1
  277. package/.next/server/app/sessions/page_client-reference-manifest.js +1 -1
  278. package/.next/server/app/skills/[skillId]/page_client-reference-manifest.js +1 -1
  279. package/.next/server/app/skills/installed/page_client-reference-manifest.js +1 -1
  280. package/.next/server/app/skills/page_client-reference-manifest.js +1 -1
  281. package/.next/server/app/worktrees/[id]/files/[...path]/page_client-reference-manifest.js +1 -1
  282. package/.next/server/app/worktrees/[id]/page.js +11 -11
  283. package/.next/server/app/worktrees/[id]/page.js.nft.json +1 -1
  284. package/.next/server/app/worktrees/[id]/page_client-reference-manifest.js +1 -1
  285. package/.next/server/app/worktrees/[id]/terminal/page_client-reference-manifest.js +1 -1
  286. package/.next/server/app-paths-manifest.json +20 -20
  287. package/.next/server/chunks/1191.js +2 -2
  288. package/.next/server/chunks/1210.js +1 -1
  289. package/.next/server/chunks/1503.js +2 -2
  290. package/.next/server/chunks/1559.js +2 -0
  291. package/.next/server/chunks/1789.js +1 -0
  292. package/.next/server/chunks/1944.js +1 -1
  293. package/.next/server/chunks/2119.js +1 -1
  294. package/.next/server/chunks/22.js +1 -1
  295. package/.next/server/chunks/2404.js +1 -1
  296. package/.next/server/chunks/2445.js +1 -1
  297. package/.next/server/chunks/2460.js +1 -1
  298. package/.next/server/chunks/2710.js +2 -2
  299. package/.next/server/chunks/2908.js +1 -1
  300. package/.next/server/chunks/2980.js +1 -1
  301. package/.next/server/chunks/3241.js +1 -1
  302. package/.next/server/chunks/3480.js +1 -1
  303. package/.next/server/chunks/3718.js +1 -1
  304. package/.next/server/chunks/4207.js +2 -2
  305. package/.next/server/chunks/450.js +1 -1
  306. package/.next/server/chunks/{9353.js → 4718.js} +2 -2
  307. package/.next/server/chunks/4802.js +1 -1
  308. package/.next/server/chunks/4837.js +14 -0
  309. package/.next/server/chunks/5048.js +1 -1
  310. package/.next/server/chunks/5064.js +1 -1
  311. package/.next/server/chunks/5209.js +1 -0
  312. package/.next/server/chunks/5292.js +7 -0
  313. package/.next/server/chunks/5595.js +1 -1
  314. package/.next/server/chunks/5625.js +25 -0
  315. package/.next/server/chunks/5737.js +1 -1
  316. package/.next/server/chunks/6065.js +1 -1
  317. package/.next/server/chunks/611.js +1 -1
  318. package/.next/server/chunks/6130.js +1 -1
  319. package/.next/server/chunks/6401.js +1 -1
  320. package/.next/server/chunks/6781.js +1 -1
  321. package/.next/server/chunks/6793.js +3 -3
  322. package/.next/server/chunks/7491.js +2 -2
  323. package/.next/server/chunks/7905.js +1 -1
  324. package/.next/server/chunks/850.js +1 -1
  325. package/.next/server/chunks/8728.js +3 -3
  326. package/.next/server/chunks/8791.js +1 -1
  327. package/.next/server/chunks/8800.js +1 -1
  328. package/.next/server/chunks/8918.js +6 -8
  329. package/.next/server/chunks/9051.js +1 -1
  330. package/.next/server/chunks/9130.js +1 -1
  331. package/.next/server/chunks/9390.js +2 -2
  332. package/.next/server/chunks/9584.js +1 -1
  333. package/.next/server/chunks/9627.js +6 -6
  334. package/.next/server/chunks/9731.js +3 -3
  335. package/.next/server/middleware-build-manifest.js +1 -1
  336. package/.next/server/middleware-manifest.json +5 -5
  337. package/.next/server/middleware-react-loadable-manifest.js +1 -1
  338. package/.next/server/pages/500.html +1 -1
  339. package/.next/server/server-reference-manifest.json +1 -1
  340. package/.next/static/chunks/1464.09cd37fee202ec4b.js +1 -0
  341. package/.next/static/chunks/{1642-fb2e176aaadbd137.js → 1642-767aed8e7c61ef7f.js} +1 -1
  342. package/.next/static/chunks/2053-390e77fce43b555c.js +1 -0
  343. package/.next/static/chunks/{2407-051f6f84226a9f2c.js → 2407-dd4a0f04f1349221.js} +1 -1
  344. package/.next/static/chunks/{2619-04bc32f026a0d946.js → 2619-a305ad4810f1393a.js} +1 -1
  345. package/.next/static/chunks/{2751-9ef0f4b450bd4ef0.js → 2751-5f0b2702accd164d.js} +1 -1
  346. package/.next/static/chunks/{282.6b6f2e31a96674dd.js → 282.a1013532fd9a61b4.js} +1 -1
  347. package/.next/static/chunks/3237.94c29281d9ec122e.js +1 -0
  348. package/.next/static/chunks/3480.2e21f62e5e9d3ba5.js +1 -0
  349. package/.next/static/chunks/4290.c06dbe243819fea0.js +66 -0
  350. package/.next/static/chunks/4727-5d695d71e3fdf97b.js +1 -0
  351. package/.next/static/chunks/{5222.305dc0ebba9c0784.js → 5222.39e2034d3fce233c.js} +1 -1
  352. package/.next/static/chunks/{7095.8c869e553133a40e.js → 7095.87323a4fdf426341.js} +1 -1
  353. package/.next/static/chunks/{7485.442b21101fca7257.js → 7485.8a2a9d7c5396aa26.js} +3 -3
  354. package/.next/static/chunks/{8165-3853772f6ae1299b.js → 8165-3525fb42f1b4976e.js} +1 -1
  355. package/.next/static/chunks/app/{layout-9da1ab602bcb3051.js → layout-07d040cb3d3ea657.js} +1 -1
  356. package/.next/static/chunks/app/sessions/page-2af68c63211c751f.js +1 -0
  357. package/.next/static/chunks/app/worktrees/[id]/page-35f0e31a725d1c89.js +1 -0
  358. package/.next/static/chunks/app/worktrees/[id]/terminal/{page-373ea37b16d930c7.js → page-c601f3b3ece6557e.js} +1 -1
  359. package/.next/static/chunks/{webpack-021f0741f22dd16a.js → webpack-165d8df9acd1c5d4.js} +1 -1
  360. package/.next/static/css/057f64a65726c439.css +1 -0
  361. package/.next/trace +13 -13
  362. package/dist/cli/commands/ask.d.ts.map +1 -1
  363. package/dist/cli/commands/ask.js +120 -119
  364. package/dist/cli/commands/attach.d.ts +94 -0
  365. package/dist/cli/commands/attach.d.ts.map +1 -1
  366. package/dist/cli/commands/attach.js +145 -7
  367. package/dist/cli/commands/auto-yes.js +1 -1
  368. package/dist/cli/commands/capture.d.ts.map +1 -1
  369. package/dist/cli/commands/capture.js +3 -5
  370. package/dist/cli/commands/command-target.d.ts +23 -0
  371. package/dist/cli/commands/command-target.d.ts.map +1 -0
  372. package/dist/cli/commands/command-target.js +25 -0
  373. package/dist/cli/commands/instances.d.ts.map +1 -1
  374. package/dist/cli/commands/instances.js +41 -2
  375. package/dist/cli/commands/message-dispatch.d.ts +36 -0
  376. package/dist/cli/commands/message-dispatch.d.ts.map +1 -0
  377. package/dist/cli/commands/message-dispatch.js +63 -0
  378. package/dist/cli/commands/reply.d.ts.map +1 -1
  379. package/dist/cli/commands/reply.js +2 -5
  380. package/dist/cli/commands/respond.d.ts.map +1 -1
  381. package/dist/cli/commands/respond.js +3 -6
  382. package/dist/cli/commands/send.d.ts.map +1 -1
  383. package/dist/cli/commands/send.js +149 -146
  384. package/dist/cli/commands/skill-format.d.ts +8 -0
  385. package/dist/cli/commands/skill-format.d.ts.map +1 -1
  386. package/dist/cli/commands/skill-format.js +13 -3
  387. package/dist/cli/commands/wait.d.ts.map +1 -1
  388. package/dist/cli/commands/wait.js +657 -431
  389. package/dist/cli/types/api-responses.d.ts +156 -27
  390. package/dist/cli/types/api-responses.d.ts.map +1 -1
  391. package/dist/cli/types/api-responses.js +4 -2
  392. package/dist/cli/utils/api-client.d.ts +25 -5
  393. package/dist/cli/utils/api-client.d.ts.map +1 -1
  394. package/dist/cli/utils/api-client.js +87 -55
  395. package/dist/cli/utils/server-url.d.ts +1 -0
  396. package/dist/cli/utils/server-url.d.ts.map +1 -1
  397. package/dist/cli/utils/server-url.js +7 -0
  398. package/dist/cli/utils/verify-runner.d.ts +21 -0
  399. package/dist/cli/utils/verify-runner.d.ts.map +1 -1
  400. package/dist/cli/utils/verify-runner.js +38 -1
  401. package/dist/config/uat-isolation.d.ts +140 -0
  402. package/dist/config/uat-isolation.d.ts.map +1 -0
  403. package/dist/config/uat-isolation.js +246 -0
  404. package/dist/lib/global-state.d.ts +12 -0
  405. package/dist/lib/global-state.d.ts.map +1 -0
  406. package/dist/lib/global-state.js +16 -0
  407. package/dist/lib/polling/auto-yes-suppression-reason.d.ts +33 -0
  408. package/dist/lib/polling/auto-yes-suppression-reason.d.ts.map +1 -0
  409. package/dist/lib/polling/auto-yes-suppression-reason.js +2 -0
  410. package/dist/lib/session/prompt-view.d.ts +26 -3
  411. package/dist/lib/session/prompt-view.d.ts.map +1 -1
  412. package/dist/lib/session/prompt-view.js +26 -3
  413. package/dist/lib/session/status-evidence-type.d.ts +16 -0
  414. package/dist/lib/session/status-evidence-type.d.ts.map +1 -0
  415. package/dist/lib/session/status-evidence-type.js +2 -0
  416. package/dist/lib/tmux/legacy-session-alias.d.ts.map +1 -1
  417. package/dist/lib/tmux/legacy-session-alias.js +2 -1
  418. package/dist/server/locales/en/worktree.json +8 -2
  419. package/dist/server/locales/ja/worktree.json +8 -2
  420. package/dist/server/src/cli/types/api-responses.js +4 -2
  421. package/dist/server/src/config/cli-tool-timing-config.js +1 -6
  422. package/dist/server/src/config/uat-isolation.js +246 -0
  423. package/dist/server/src/lib/assistant-response-saver.js +62 -3
  424. package/dist/server/src/lib/auto-yes-lifecycle.js +6 -0
  425. package/dist/server/src/lib/auto-yes-poller.js +450 -160
  426. package/dist/server/src/lib/auto-yes-state.js +2 -2
  427. package/dist/server/src/lib/cli-tools/antigravity.js +38 -79
  428. package/dist/server/src/lib/cli-tools/base.js +151 -0
  429. package/dist/server/src/lib/cli-tools/codex.js +44 -80
  430. package/dist/server/src/lib/cli-tools/command-code.js +24 -56
  431. package/dist/server/src/lib/cli-tools/copilot.js +25 -67
  432. package/dist/server/src/lib/cli-tools/direct-input.js +8 -0
  433. package/dist/server/src/lib/cli-tools/gemini.js +23 -73
  434. package/dist/server/src/lib/cli-tools/opencode-pane-width.js +53 -0
  435. package/dist/server/src/lib/cli-tools/opencode-v2.js +9 -7
  436. package/dist/server/src/lib/cli-tools/opencode.js +21 -85
  437. package/dist/server/src/lib/cli-tools/submit-verified-sender.js +127 -4
  438. package/dist/server/src/lib/cli-tools/vibe-local.js +21 -66
  439. package/dist/server/src/lib/detection/cli-patterns.js +374 -3065
  440. package/dist/server/src/lib/detection/idle-evidence-observation.js +2 -2
  441. package/dist/server/src/lib/detection/model-info-extractor.js +57 -3
  442. package/dist/server/src/lib/detection/prompt-detect-multiple-choice.js +7 -32
  443. package/dist/server/src/lib/detection/prompt-detector.js +2 -35
  444. package/dist/server/src/lib/detection/selection-shape-patterns.js +69 -0
  445. package/dist/server/src/lib/detection/selection-shape.js +32 -520
  446. package/dist/server/src/lib/detection/shared/pasted-text.js +41 -0
  447. package/dist/server/src/lib/detection/shared/shell-pane-command.js +16 -0
  448. package/dist/server/src/lib/detection/shared/strip-box-drawing.js +25 -0
  449. package/dist/server/src/lib/detection/status-detector.js +1 -1
  450. package/dist/server/src/lib/detection/tools/antigravity/detect.js +5 -29
  451. package/dist/server/src/lib/detection/tools/antigravity/dialog.js +2 -15
  452. package/dist/server/src/lib/detection/tools/antigravity/patterns.js +286 -0
  453. package/dist/server/src/lib/detection/tools/claude/detect.js +3 -14
  454. package/dist/server/src/lib/detection/tools/claude/patterns.js +264 -4
  455. package/dist/server/src/lib/detection/tools/claude/prompt.js +2 -10
  456. package/dist/server/src/lib/detection/tools/codex/detect.js +46 -85
  457. package/dist/server/src/lib/detection/tools/codex/live-region.js +33 -2
  458. package/dist/server/src/lib/detection/tools/codex/patterns.js +855 -0
  459. package/dist/server/src/lib/detection/tools/codex/prompt.js +2 -10
  460. package/dist/server/src/lib/detection/tools/command-code/detect.js +8 -50
  461. package/dist/server/src/lib/detection/tools/command-code/dialog.js +2 -18
  462. package/dist/server/src/lib/detection/tools/command-code/patterns.js +234 -0
  463. package/dist/server/src/lib/detection/tools/command-code/selection-shape.js +461 -0
  464. package/dist/server/src/lib/detection/tools/context-above.js +20 -0
  465. package/dist/server/src/lib/detection/tools/copilot/detect.js +10 -35
  466. package/dist/server/src/lib/detection/tools/copilot/patterns.js +640 -0
  467. package/dist/server/src/lib/detection/tools/copilot/prompt.js +2 -10
  468. package/dist/server/src/lib/detection/tools/gemini/patterns.js +29 -0
  469. package/dist/server/src/lib/detection/tools/live-region-specs.js +1 -1
  470. package/dist/server/src/lib/detection/tools/opencode/detect.js +8 -49
  471. package/dist/server/src/lib/detection/tools/opencode/patterns.js +508 -0
  472. package/dist/server/src/lib/detection/tools/opencode-v2/detect.js +7 -42
  473. package/dist/server/src/lib/detection/tools/opencode-v2/patterns.js +63 -0
  474. package/dist/server/src/lib/detection/tools/run-detection.js +6 -47
  475. package/dist/server/src/lib/detection/tools/verdicts.js +59 -0
  476. package/dist/server/src/lib/detection/tools/vibe-local/patterns.js +20 -0
  477. package/dist/server/src/lib/detection/truncate-raw-content.js +38 -0
  478. package/dist/server/src/lib/detection/turn-abandoned.js +66 -0
  479. package/dist/server/src/lib/detection/unclassified-frame-tracker.js +2 -2
  480. package/dist/server/src/lib/git/git-exec.js +23 -5
  481. package/dist/server/src/lib/global-state.js +16 -0
  482. package/dist/server/src/lib/hooks/agent-session-telemetry.js +4 -6
  483. package/dist/server/src/lib/hooks/permission-decision-state.js +2 -2
  484. package/dist/server/src/lib/hooks/sources/antigravity/history.js +11 -76
  485. package/dist/server/src/lib/hooks/sources/antigravity/hooks-config.js +63 -1
  486. package/dist/server/src/lib/hooks/sources/antigravity/source.js +16 -0
  487. package/dist/server/src/lib/hooks/sources/antigravity/transcript.js +3 -12
  488. package/dist/server/src/lib/hooks/sources/claude/history.js +17 -156
  489. package/dist/server/src/lib/hooks/sources/claude/queued-notice.js +53 -0
  490. package/dist/server/src/lib/hooks/sources/claude/self-resume.js +213 -0
  491. package/dist/server/src/lib/hooks/sources/claude/source.js +57 -10
  492. package/dist/server/src/lib/hooks/sources/claude/transcript.js +3 -13
  493. package/dist/server/src/lib/hooks/sources/codex/history.js +11 -74
  494. package/dist/server/src/lib/hooks/sources/codex/hooks-config.js +147 -11
  495. package/dist/server/src/lib/hooks/sources/codex/relay-install.js +64 -21
  496. package/dist/server/src/lib/hooks/sources/codex/transcript.js +5 -15
  497. package/dist/server/src/lib/hooks/sources/command-code/history.js +20 -121
  498. package/dist/server/src/lib/hooks/sources/command-code/transcript.js +3 -13
  499. package/dist/server/src/lib/hooks/sources/copilot/hook-settings.js +161 -31
  500. package/dist/server/src/lib/hooks/sources/define-source.js +40 -55
  501. package/dist/server/src/lib/hooks/sources/event-mapper.js +2 -1
  502. package/dist/server/src/lib/hooks/sources/opencode/diff.js +3 -4
  503. package/dist/server/src/lib/hooks/sources/opencode/history.js +2 -1
  504. package/dist/server/src/lib/hooks/sources/opencode/launch-settings.js +2 -1
  505. package/dist/server/src/lib/hooks/sources/opencode/payloads.js +2 -1
  506. package/dist/server/src/lib/hooks/sources/opencode/ports.js +2 -1
  507. package/dist/server/src/lib/hooks/sources/opencode/subscription.js +4 -3
  508. package/dist/server/src/lib/hooks/sources/opencode/transcript.js +3 -16
  509. package/dist/server/src/lib/hooks/sources/opencode-v2/history.js +2 -1
  510. package/dist/server/src/lib/hooks/sources/opencode-v2/mappers.js +5 -4
  511. package/dist/server/src/lib/hooks/sources/opencode-v2/ports.js +2 -1
  512. package/dist/server/src/lib/hooks/sources/opencode-v2/subscription.js +3 -7
  513. package/dist/server/src/lib/hooks/sources/opencode-v2/usage.js +2 -1
  514. package/dist/server/src/lib/hooks/sources/pending-decisions.js +2 -1
  515. package/dist/server/src/lib/hooks/sources/registry.js +3 -2
  516. package/dist/server/src/lib/hooks/sources/transcript-history.js +262 -0
  517. package/dist/server/src/lib/hooks/sources/turn-body.js +31 -0
  518. package/dist/server/src/lib/hooks/tool-input-normalization-state.js +2 -2
  519. package/dist/server/src/lib/polling/antigravity-permission-receipts.js +2 -2
  520. package/dist/server/src/lib/polling/auto-yes-enter-fallback-state.js +142 -0
  521. package/dist/server/src/lib/polling/auto-yes-enter-fallback.js +187 -0
  522. package/dist/server/src/lib/polling/auto-yes-resolver.js +9 -3
  523. package/dist/server/src/lib/polling/auto-yes-suppression-reason.js +2 -0
  524. package/dist/server/src/lib/polling/auto-yes-suppression-state.js +2 -2
  525. package/dist/server/src/lib/polling/pending-scraped-response.js +190 -0
  526. package/dist/server/src/lib/polling/prompt-dedup-state.js +2 -2
  527. package/dist/server/src/lib/polling/prompt-dedup.js +2 -2
  528. package/dist/server/src/lib/polling/response-checker-dialog-gate.js +95 -0
  529. package/dist/server/src/lib/polling/response-checker-extraction-result.js +50 -0
  530. package/dist/server/src/lib/polling/response-checker-extraction-steps.js +670 -0
  531. package/dist/server/src/lib/polling/response-checker.js +641 -1142
  532. package/dist/server/src/lib/polling/response-dedup.js +3 -4
  533. package/dist/server/src/lib/polling/response-poller-constants.js +17 -0
  534. package/dist/server/src/lib/polling/response-poller-core.js +54 -20
  535. package/dist/server/src/lib/polling/startup-screen.js +142 -0
  536. package/dist/server/src/lib/polling/structured-history-gate.js +3 -2
  537. package/dist/server/src/lib/prompt-answer-semantic.js +178 -0
  538. package/dist/server/src/lib/prompt-answer-sender.js +5 -4
  539. package/dist/server/src/lib/push/failure-episode-state.js +2 -2
  540. package/dist/server/src/lib/push/notification-dedup.js +3 -4
  541. package/dist/server/src/lib/push/prompt-card-state.js +2 -2
  542. package/dist/server/src/lib/push/waiting-push-notifier.js +3 -4
  543. package/dist/server/src/lib/realtime/publisher-registry.js +3 -2
  544. package/dist/server/src/lib/realtime/terminal-broadcast.js +38 -5
  545. package/dist/server/src/lib/realtime/terminal-session-ownership.js +45 -0
  546. package/dist/server/src/lib/relay/relay-delivery.js +3 -2
  547. package/dist/server/src/lib/relay/relay-readiness.js +38 -1
  548. package/dist/server/src/lib/response-cleaner.js +24 -1
  549. package/dist/server/src/lib/response-extractor.js +16 -0
  550. package/dist/server/src/lib/schedule-manager.js +8 -10
  551. package/dist/server/src/lib/session/agent-event-ask-user-question.js +168 -0
  552. package/dist/server/src/lib/session/agent-event-awaiting-instruction.js +104 -0
  553. package/dist/server/src/lib/session/agent-event-dedup.js +539 -0
  554. package/dist/server/src/lib/session/agent-event-model.js +562 -0
  555. package/dist/server/src/lib/session/agent-event-record.js +10 -0
  556. package/dist/server/src/lib/session/agent-event-state.js +107 -1854
  557. package/dist/server/src/lib/session/agent-event-structured-state.js +109 -0
  558. package/dist/server/src/lib/session/agent-event-turn.js +862 -0
  559. package/dist/server/src/lib/session/agent-session-lifecycle.js +11 -2
  560. package/dist/server/src/lib/session/chat-turn-progress.js +322 -0
  561. package/dist/server/src/lib/session/claude-executor.js +45 -5
  562. package/dist/server/src/lib/session/claude-session.js +21 -65
  563. package/dist/server/src/lib/session/cli-session.js +17 -0
  564. package/dist/server/src/lib/session/current-output-builder.js +449 -1107
  565. package/dist/server/src/lib/session/current-output-history-writers.js +255 -0
  566. package/dist/server/src/lib/session/current-output-types.js +9 -0
  567. package/dist/server/src/lib/session/detection-divergence.js +55 -0
  568. package/dist/server/src/lib/session/global-session-constants.js +2 -13
  569. package/dist/server/src/lib/session/hook-turn-hold.js +102 -0
  570. package/dist/server/src/lib/session/layer-disagreement.js +2 -2
  571. package/dist/server/src/lib/session/opencode-session-store.js +2 -1
  572. package/dist/server/src/lib/session/prompt-view.js +26 -3
  573. package/dist/server/src/lib/session/prompt-waiting-composition.js +3 -2
  574. package/dist/server/src/lib/session/provisional-turn.js +3 -1
  575. package/dist/server/src/lib/session/send-user-message.js +1 -1
  576. package/dist/server/src/lib/session/session-starting-state.js +4 -6
  577. package/dist/server/src/lib/session/status-evidence-type.js +2 -0
  578. package/dist/server/src/lib/session/status-evidence.js +2 -2
  579. package/dist/server/src/lib/session/structured-status-merge.js +335 -0
  580. package/dist/server/src/lib/session/waiting-episode-state.js +3 -4
  581. package/dist/server/src/lib/session-cleanup.js +1 -5
  582. package/dist/server/src/lib/skills/install-plan.js +3 -1
  583. package/dist/server/src/lib/skills/preview-diff.js +24 -3
  584. package/dist/server/src/lib/skills/snapshot-store.js +2 -2
  585. package/dist/server/src/lib/skills/uninstall-plan.js +3 -2
  586. package/dist/server/src/lib/timer-manager.js +6 -8
  587. package/dist/server/src/lib/tmux/geometry-delegation.js +3 -4
  588. package/dist/server/src/lib/tmux/legacy-session-alias.js +2 -1
  589. package/dist/server/src/lib/tmux/session-hooks.js +2 -1
  590. package/dist/server/src/lib/tmux/session-status-options.js +3 -3
  591. package/dist/server/src/lib/tmux/tmux-capture-cache.js +3 -2
  592. package/dist/server/src/lib/tmux/tmux.js +33 -59
  593. package/dist/server/src/lib/tui-accumulator.js +2 -2
  594. package/dist/server/src/lib/verification/env-clean-gate.js +6 -5
  595. package/dist/server/src/lib/version-checker.js +6 -6
  596. package/dist/server/src/lib/ws-server.js +47 -11
  597. package/docs/en/user-guide/commands-guide.md +0 -1
  598. package/docs/en/user-guide/webapp-guide.md +27 -3
  599. package/package.json +3 -2
  600. package/release-notes/0.44.3.json +82 -0
  601. package/release-notes/0.45.0.json +41 -0
  602. package/scripts/hooks/cmate-agent-event.sh +38 -0
  603. package/.next/server/chunks/1068.js +0 -1
  604. package/.next/server/chunks/4372.js +0 -5
  605. package/.next/server/chunks/6474.js +0 -14
  606. package/.next/server/chunks/967.js +0 -1
  607. package/.next/server/chunks/9798.js +0 -2
  608. package/.next/server/chunks/9882.js +0 -25
  609. package/.next/static/chunks/2053-85a974ddfe7498fe.js +0 -1
  610. package/.next/static/chunks/4290.6cf86f68d73b6e77.js +0 -82
  611. package/.next/static/chunks/4459.a94b52985a76509a.js +0 -1
  612. package/.next/static/chunks/591-539fec878c9dec5e.js +0 -1
  613. package/.next/static/chunks/5951.616956b6aa5df63f.js +0 -1
  614. package/.next/static/chunks/9856.15463dd58437e2ac.js +0 -1
  615. package/.next/static/chunks/app/sessions/page-049e06335187aa91.js +0 -1
  616. package/.next/static/chunks/app/worktrees/[id]/page-2a81397e60f17e63.js +0 -1
  617. package/.next/static/css/38070d879efa1371.css +0 -1
  618. package/dist/server/src/lib/cli-tools/index.js +0 -41
  619. package/dist/server/src/lib/polling/global-session-poller.js +0 -140
  620. /package/.next/static/{QlCqLjorauDDBXPa-C7TK → TPWbZB3zBp3Zv_eFEOlmt}/_buildManifest.js +0 -0
  621. /package/.next/static/{QlCqLjorauDDBXPa-C7TK → TPWbZB3zBp3Zv_eFEOlmt}/_ssgManifest.js +0 -0
@@ -0,0 +1,213 @@
1
+ "use strict";
2
+ /**
3
+ * Whether a Claude Code `Stop` leaves background work behind that will wake the
4
+ * agent again (Issue #3430) — the Claude half of #2614.
5
+ *
6
+ * Claude Code ends a turn with work still running in two measured ways: a
7
+ * `Bash` call that outlived its timeout (or was started with
8
+ * `run_in_background`) and a `Monitor`. When that work finishes Claude queues a
9
+ * `<task-notification>` and, if the session is idle, opens a new turn on it by
10
+ * itself. Measured on 2026-10-08 (worktree commandmate-issue-3423): a worker
11
+ * ended its turn at 23:37:53 "waiting for the related-tests run to finish",
12
+ * `wait --verify` read that `Stop` as the end and verified an uncommitted
13
+ * worktree, and the notification opened the turn that committed at 23:38:32.
14
+ *
15
+ * ## What is read, and why not the `Stop` payload
16
+ *
17
+ * The payload carries `background_tasks`, but only its empty form has ever been
18
+ * captured (`tests/fixtures/hooks/claude/stop.json`), so its shape is a guess.
19
+ * The transcript names the same work in structured fields, measured on the
20
+ * transcripts under `~/.claude/projects` written in the four days to 2026-10-08:
21
+ *
22
+ * - a background `Bash`: `toolUseResult.backgroundTaskId` (1,008 results);
23
+ * - a `Monitor`: `toolUseResult.taskId` beside a boolean `persistent`
24
+ * (115 results);
25
+ * - a background subagent: `toolUseResult.isAsync: true` and `agentId`
26
+ * (30 results);
27
+ * - a `TaskStop`: `toolUseResult.task_id` (39 results). A stopped task is never
28
+ * notified, so this is what retires it.
29
+ *
30
+ * and each finished task is retired by the notification Claude delivers for it:
31
+ * a `type: "user"` prompt or a `queued_command` attachment whose text begins
32
+ * with `<task-notification>` and carries `<task-id>…</task-id>` — the id above.
33
+ * A notice that is only enqueued is not yet delivered, and the session will open
34
+ * a turn on it, so its task still counts as pending.
35
+ *
36
+ * ## Erring towards "finished"
37
+ *
38
+ * Every doubt answers "nothing pending", which is what every Claude `Stop` meant
39
+ * before this Issue: no transcript path, a path outside `~/.claude/projects`, a
40
+ * file that cannot be read, a line that does not parse. A persistent `Monitor`
41
+ * (a watch for the whole session, never notified on its own) is not counted
42
+ * either. A task that really is never notified — a process that died with its
43
+ * session — is bounded by `commandmate wait`'s `SELF_RESUME_HOLD_MS`.
44
+ *
45
+ * @module lib/hooks/sources/claude/self-resume
46
+ */
47
+ Object.defineProperty(exports, "__esModule", { value: true });
48
+ exports.CLAUDE_SELF_RESUME_TAIL_BYTES = exports.CLAUDE_TRANSCRIPT_PATH_FIELD = void 0;
49
+ exports.pendingClaudeBackgroundTasks = pendingClaudeBackgroundTasks;
50
+ exports.claudeStopLeavesBackgroundWork = claudeStopLeavesBackgroundWork;
51
+ const fs_1 = require("fs");
52
+ const os_1 = require("os");
53
+ const path_1 = require("path");
54
+ const transcript_history_1 = require("../transcript-history");
55
+ const queued_notice_1 = require("./queued-notice");
56
+ const transcript_1 = require("./transcript");
57
+ /** The `Stop` payload field naming the session's transcript. */
58
+ exports.CLAUDE_TRANSCRIPT_PATH_FIELD = 'transcript_path';
59
+ /**
60
+ * How much of the transcript's tail is read on a `Stop`.
61
+ *
62
+ * A task is started before it is notified, so a window that holds the start
63
+ * holds the notification too; a start older than the window is simply not seen
64
+ * (the "finished" direction). 4 MiB is `CLAUDE_TRANSCRIPT_TAIL_BYTES`, the first
65
+ * read of `./history`, which holds 99% of turns whole (#2470).
66
+ */
67
+ exports.CLAUDE_SELF_RESUME_TAIL_BYTES = 4 * 1024 * 1024;
68
+ const TASK_ID_PATTERN = /<task-id>([^<]+)<\/task-id>/;
69
+ function isRecord(value) {
70
+ return typeof value === 'object' && value !== null && !Array.isArray(value);
71
+ }
72
+ function nonEmptyString(value) {
73
+ return typeof value === 'string' && value.length > 0 ? value : null;
74
+ }
75
+ /** The background task a tool result started, or null. */
76
+ function startedTaskId(result) {
77
+ const bash = nonEmptyString(result.backgroundTaskId);
78
+ if (bash)
79
+ return bash;
80
+ // Monitor. `persistent: true` watches for the life of the session and is not
81
+ // work the turn is waiting on.
82
+ const monitor = nonEmptyString(result.taskId);
83
+ if (monitor && result.persistent === false)
84
+ return monitor;
85
+ const agent = nonEmptyString(result.agentId);
86
+ if (agent && result.isAsync === true)
87
+ return agent;
88
+ return null;
89
+ }
90
+ /** The task a `<task-notification>` text retires, or null. */
91
+ function notifiedTaskId(text) {
92
+ if (typeof text !== 'string')
93
+ return null;
94
+ if (!text.trimStart().startsWith(queued_notice_1.CLAUDE_TASK_NOTIFICATION_PREFIX))
95
+ return null;
96
+ return TASK_ID_PATTERN.exec(text)?.[1] ?? null;
97
+ }
98
+ /** Every text a delivered `type: "user"` record carries. */
99
+ function userTexts(record) {
100
+ const message = record.message;
101
+ if (!isRecord(message))
102
+ return [];
103
+ const content = message.content;
104
+ if (typeof content === 'string')
105
+ return [content];
106
+ if (!Array.isArray(content))
107
+ return [];
108
+ return content.filter(isRecord).filter((b) => b.type === 'text').map((b) => b.text);
109
+ }
110
+ /**
111
+ * The ids of background tasks started in `text` (transcript JSONL) and not yet
112
+ * delivered a notification or stopped, in the order they were started.
113
+ *
114
+ * Pure. Lines that do not parse are skipped, as is everything a subagent wrote
115
+ * into the parent's file (`isSidechain: true`).
116
+ */
117
+ function pendingClaudeBackgroundTasks(text) {
118
+ const started = [];
119
+ const retired = new Set();
120
+ for (const line of text.split('\n')) {
121
+ if (line.trim() === '')
122
+ continue;
123
+ let record;
124
+ try {
125
+ record = JSON.parse(line);
126
+ }
127
+ catch {
128
+ continue;
129
+ }
130
+ if (!isRecord(record) || record.isSidechain === true)
131
+ continue;
132
+ if (record.type === 'user') {
133
+ const result = record.toolUseResult;
134
+ if (isRecord(result)) {
135
+ const id = startedTaskId(result);
136
+ if (id)
137
+ started.push(id);
138
+ const stopped = nonEmptyString(result.task_id);
139
+ if (stopped)
140
+ retired.add(stopped);
141
+ }
142
+ for (const t of userTexts(record)) {
143
+ const id = notifiedTaskId(t);
144
+ if (id)
145
+ retired.add(id);
146
+ }
147
+ }
148
+ else if (record.type === 'attachment' && isRecord(record.attachment)) {
149
+ if (record.attachment.type !== 'queued_command')
150
+ continue;
151
+ const id = notifiedTaskId(record.attachment.prompt);
152
+ if (id)
153
+ retired.add(id);
154
+ }
155
+ }
156
+ return [...new Set(started)].filter((id) => !retired.has(id));
157
+ }
158
+ /**
159
+ * The last `maxBytes` of a file, starting at a line boundary; null when it
160
+ * cannot be read.
161
+ */
162
+ function readTail(path, maxBytes) {
163
+ let fd = null;
164
+ try {
165
+ fd = (0, fs_1.openSync)(path, 'r');
166
+ const size = (0, fs_1.fstatSync)(fd).size;
167
+ const start = Math.max(0, size - maxBytes);
168
+ const buffer = Buffer.alloc(size - start);
169
+ let read = 0;
170
+ while (read < buffer.length) {
171
+ const n = (0, fs_1.readSync)(fd, buffer, read, buffer.length - read, start + read);
172
+ if (n === 0)
173
+ break;
174
+ read += n;
175
+ }
176
+ const text = buffer.subarray(0, read).toString('utf8');
177
+ // A window opened mid-file starts mid-line; that line is dropped.
178
+ return start === 0 ? text : text.slice(text.indexOf('\n') + 1);
179
+ }
180
+ catch {
181
+ return null;
182
+ }
183
+ finally {
184
+ if (fd !== null) {
185
+ try {
186
+ (0, fs_1.closeSync)(fd);
187
+ }
188
+ catch {
189
+ // Nothing to do: the answer is already decided.
190
+ }
191
+ }
192
+ }
193
+ }
194
+ /**
195
+ * Whether this `Stop` payload's session still has background work that has not
196
+ * been notified — i.e. whether Claude will open another turn by itself.
197
+ *
198
+ * Synchronous: it runs inside event normalization. `false` for every case it
199
+ * cannot vouch for (see the module comment).
200
+ */
201
+ function claudeStopLeavesBackgroundWork(payload, options = {}) {
202
+ const hint = nonEmptyString(payload[exports.CLAUDE_TRANSCRIPT_PATH_FIELD]);
203
+ if (!hint)
204
+ return false;
205
+ const root = (0, path_1.join)(options.homeDir ?? (0, os_1.homedir)(), ...transcript_1.CLAUDE_PROJECTS_DIR_SEGMENTS);
206
+ const path = (0, transcript_history_1.acceptPathUnderRoot)(root, '.jsonl', hint);
207
+ if (!path)
208
+ return false;
209
+ const text = readTail(path, options.tailBytes ?? exports.CLAUDE_SELF_RESUME_TAIL_BYTES);
210
+ if (text === null)
211
+ return false;
212
+ return pendingClaudeBackgroundTasks(text).length > 0;
213
+ }
@@ -34,6 +34,8 @@
34
34
  Object.defineProperty(exports, "__esModule", { value: true });
35
35
  exports.claudeAgentEventSource = void 0;
36
36
  exports.encodeClaudeVerdict = encodeClaudeVerdict;
37
+ exports.extractClaudeEventDetail = extractClaudeEventDetail;
38
+ const uat_isolation_1 = require("../../../../config/uat-isolation");
37
39
  const agent_event_types_1 = require("../../../../lib/hooks/agent-event-types");
38
40
  const ask_user_question_payload_1 = require("../../../../lib/hooks/ask-user-question-payload");
39
41
  const hook_settings_generator_1 = require("../../../../lib/hooks/hook-settings-generator");
@@ -42,6 +44,8 @@ const define_source_1 = require("../define-source");
42
44
  const event_mapper_1 = require("../event-mapper");
43
45
  const hook_event_vocabulary_1 = require("../hook-event-vocabulary");
44
46
  const model_switch_1 = require("./model-switch");
47
+ const queued_notice_1 = require("./queued-notice");
48
+ const self_resume_1 = require("./self-resume");
45
49
  const tool_id_1 = require("./tool-id");
46
50
  /**
47
51
  * The no-decision body, byte for byte what the #1721 spike returned for D5.
@@ -83,6 +87,20 @@ function encodeClaudeVerdict(verdict) {
83
87
  },
84
88
  };
85
89
  }
90
+ /**
91
+ * The subtype of one Claude event.
92
+ *
93
+ * Every event but `stop` is the shared snake_case reading (S2). A `stop` is
94
+ * {@link SELF_RESUME_PENDING_DETAIL} when the session's transcript shows
95
+ * background work that has not been notified yet (Issue #3430), and has no
96
+ * subtype otherwise — which is what every Claude `stop` had before.
97
+ */
98
+ function extractClaudeEventDetail(event, payload) {
99
+ if (event === 'stop' && (0, self_resume_1.claudeStopLeavesBackgroundWork)(payload)) {
100
+ return agent_event_types_1.SELF_RESUME_PENDING_DETAIL;
101
+ }
102
+ return (0, hook_event_vocabulary_1.extractSnakeCaseEventDetail)(event, payload);
103
+ }
86
104
  /**
87
105
  * Claude Code as an event source.
88
106
  *
@@ -125,11 +143,12 @@ exports.claudeAgentEventSource = (0, define_source_1.definePushHookSource)({
125
143
  // JSONL when the poller asks (#2121); the gate dispatches on this word
126
144
  // rather than on the tool id.
127
145
  transcriptHistory: 'pull',
128
- // Issue #2614. Claude Code does resume itself (background tasks, session
129
- // crons), and its `Stop` payload carries `background_tasks` /
130
- // `session_crons` — but only the empty form has been captured, so nothing
131
- // reads them yet and this stays false until a non-empty one is measured.
132
- stopReportsSelfResume: false,
146
+ // Issue #3430 (#2614 for Claude). A `Stop` whose transcript shows a
147
+ // background `Bash` / `Monitor` / subagent not yet notified carries
148
+ // `SELF_RESUME_PENDING_DETAIL`: the notification opens the next turn by
149
+ // itself. The payload's `background_tasks` is still unread — only its empty
150
+ // form has been captured. See `./self-resume` and `extractDetail` below.
151
+ stopReportsSelfResume: true,
133
152
  },
134
153
  // S1. A plain name table is enough *for this tool* — one native name, one
135
154
  // word, no predicates — so it is expressed as rules built from the table
@@ -158,8 +177,11 @@ exports.claudeAgentEventSource = (0, define_source_1.definePushHookSource)({
158
177
  // the latch. `extractModel` runs before `modelFields`, and answers null for
159
178
  // every other event so the flat lookup above is unchanged for them.
160
179
  extractModel: model_switch_1.extractClaudeSwitchedModel,
161
- // S2.
162
- extractDetail: hook_event_vocabulary_1.extractSnakeCaseEventDetail,
180
+ // Issue #3330. A background-task notice attached to the running turn fires
181
+ // `UserPromptSubmit` too, and continues that turn rather than opening one.
182
+ promptJoinsOpenTurn: queued_notice_1.isClaudeQueuedNoticePrompt,
183
+ // S2, plus the `Stop` that leaves background work behind (Issue #3430).
184
+ extractDetail: extractClaudeEventDetail,
163
185
  // S7. Both parsers are strict and answer null for anything they cannot vouch
164
186
  // for; the callers turn null into "no structured data", which degrades to the
165
187
  // behaviour of a machine without hooks rather than into a guess.
@@ -171,22 +193,47 @@ exports.claudeAgentEventSource = (0, define_source_1.definePushHookSource)({
171
193
  // writes the settings file, falls back to the bare path on any failure, and is
172
194
  // covered byte-for-byte by `tests/unit/hooks/hook-settings-generator.test.ts`.
173
195
  prepareLaunch: ({ target, executablePath }) => {
174
- const command = (0, hook_settings_generator_1.buildClaudeLaunchCommand)(executablePath, {
196
+ // Issue #3312: under `own-home` the settings file goes in only once its
197
+ // directory and the file itself check out inside the dedicated user's
198
+ // HOME; else the launch is refused.
199
+ const ownHome = (0, uat_isolation_1.getUatIsolationMode)() === 'own-home';
200
+ const hookTarget = {
175
201
  worktreeId: target.worktreeId,
176
202
  instanceId: target.instanceId,
177
203
  cliToolId: target.cliToolId,
178
- });
204
+ };
205
+ if ((0, hook_settings_generator_1.isHookInjectionEnabled)()) {
206
+ (0, uat_isolation_1.assertUatOwnHomeWriteTargets)(tool_id_1.CLAUDE_CLI_TOOL_ID, [
207
+ (0, hook_settings_generator_1.getHookSettingsDirectory)(),
208
+ (0, hook_settings_generator_1.getHookSettingsPath)(hookTarget),
209
+ ]);
210
+ }
211
+ const baseCommand = (0, hook_settings_generator_1.buildClaudeLaunchCommand)(executablePath, hookTarget);
212
+ // Issue #3312: under `own-home` a claude without its settings file is a
213
+ // check that cannot see `hook_stop`, so injection switched off or a file
214
+ // that could not be written refuses the launch. `1` and normal mode keep
215
+ // starting the bare executable.
216
+ if (ownHome && baseCommand === executablePath) {
217
+ throw new uat_isolation_1.UatIsolationLaunchRefusedError(tool_id_1.CLAUDE_CLI_TOOL_ID, (0, hook_settings_generator_1.isHookInjectionEnabled)() ? 'the hook settings file could not be written' : 'CM_AGENT_HOOKS_INJECT=0', (0, hook_settings_generator_1.isHookInjectionEnabled)()
218
+ ? 'Make CM_AGENT_HOOKS_DIR writable by the dedicated user.'
219
+ : 'Do not combine CM_AGENT_HOOKS_INJECT=0 with own-home.');
220
+ }
179
221
  // The path is reported only when the command actually names it. Injection
180
222
  // can be switched off (`CM_AGENT_HOOKS_INJECT=0`) or fail to write, and both
181
223
  // return the bare executable — claiming a settings file in that case would
182
224
  // be telling the caller about a file that is not there.
183
- const settingsPath = (0, hook_settings_generator_1.isHookInjectionEnabled)() && command !== executablePath
225
+ const settingsPath = (0, hook_settings_generator_1.isHookInjectionEnabled)() && baseCommand !== executablePath
184
226
  ? (0, hook_settings_generator_1.getHookSettingsPath)({
185
227
  worktreeId: target.worktreeId,
186
228
  instanceId: target.instanceId,
187
229
  cliToolId: target.cliToolId,
188
230
  })
189
231
  : null;
232
+ // Issue #3360: in UAT isolation the user's own `~/.claude/settings.json`
233
+ // (whose hooks post to production) is not loaded; `--settings` still is.
234
+ const command = (0, uat_isolation_1.isUatIsolationEnabled)()
235
+ ? `${baseCommand} --setting-sources ${uat_isolation_1.CLAUDE_UAT_SETTING_SOURCES}`
236
+ : baseCommand;
190
237
  // Empty, and the only source for which that is uninteresting: `--settings`
191
238
  // carries the correlation keys inside the file, so Claude never needed the
192
239
  // environment prefix the other four sources reached for (#1846).
@@ -297,18 +297,12 @@ function readToolDetail(input) {
297
297
  for (const field of CLAUDE_TOOL_DETAIL_FIELDS) {
298
298
  const value = (0, event_mapper_1.readStringField)(input, field);
299
299
  if (value)
300
- return boundToolDetail(collapseToLine(value));
300
+ return boundToolDetail((0, turn_body_1.collapseToLine)(value));
301
301
  }
302
302
  return null;
303
303
  }
304
- /** A tool detail on one line. A heredoc `command` puts newlines in it. */
305
- function collapseToLine(value) {
306
- return value.replace(/\s+/g, ' ').trim();
307
- }
308
304
  function boundToolDetail(value) {
309
- return value.length <= exports.MAX_CLAUDE_TOOL_DETAIL_LENGTH
310
- ? value
311
- : `${value.slice(0, exports.MAX_CLAUDE_TOOL_DETAIL_LENGTH - 1)}…`;
305
+ return (0, turn_body_1.boundDetail)(value, exports.MAX_CLAUDE_TOOL_DETAIL_LENGTH);
312
306
  }
313
307
  /**
314
308
  * Read one parsed transcript line.
@@ -787,11 +781,7 @@ function renderClaudeTurn(turn) {
787
781
  unknown.add(block.type);
788
782
  }
789
783
  let body = (0, turn_body_1.separateTurnBody)(rendered).body;
790
- if (body.length > exports.MAX_CLAUDE_TURN_BODY_LENGTH) {
791
- body =
792
- body.slice(0, exports.MAX_CLAUDE_TURN_BODY_LENGTH - exports.CLAUDE_TURN_TRUNCATION_MARKER.length) +
793
- exports.CLAUDE_TURN_TRUNCATION_MARKER;
794
- }
784
+ body = (0, turn_body_1.truncateTurnBody)(body, exports.MAX_CLAUDE_TURN_BODY_LENGTH, exports.CLAUDE_TURN_TRUNCATION_MARKER);
795
785
  return {
796
786
  sessionId: turn.sessionId,
797
787
  promptUuid: turn.promptUuid,
@@ -95,6 +95,7 @@ exports.isCodexRolloutFileFor = isCodexRolloutFileFor;
95
95
  exports.findCodexRolloutPath = findCodexRolloutPath;
96
96
  exports.captureCodexTranscriptTurn = captureCodexTranscriptTurn;
97
97
  exports.resolveCodexTranscriptPath = resolveCodexTranscriptPath;
98
+ const global_state_1 = require("../../../../lib/global-state");
98
99
  const promises_1 = require("fs/promises");
99
100
  const os_1 = require("os");
100
101
  const path_1 = require("path");
@@ -104,6 +105,7 @@ const user_turn_recorder_1 = require("../../../../lib/history/user-turn-recorder
104
105
  const assistant_response_saver_1 = require("../../../../lib/assistant-response-saver");
105
106
  const logger_1 = require("../../../../lib/logger");
106
107
  const agent_transcript_1 = require("../../../../types/agent-transcript");
108
+ const transcript_history_1 = require("../transcript-history");
107
109
  const transcript_1 = require("./transcript");
108
110
  const logger = (0, logger_1.createLogger)('lib/hooks/sources/codex/history');
109
111
  /**
@@ -151,7 +153,7 @@ const CODEX_SESSION_ID_PATTERN = /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-
151
153
  * codex sends `session_id` on every event it delivers — but a future one that
152
154
  * did not would otherwise blank the pointer mid-session.
153
155
  */
154
- const sessionPointers = (globalThis.__codexTranscriptSessions ??= new Map());
156
+ const sessionPointers = (0, global_state_1.getOrInitGlobal)('__codexTranscriptSessions', () => new Map());
155
157
  /**
156
158
  * Where each session id's rollout file was found.
157
159
  *
@@ -161,7 +163,7 @@ const sessionPointers = (globalThis.__codexTranscriptSessions ??= new Map());
161
163
  * session started, which is not derivable from the id — and a scan of 1,791
162
164
  * files on every finished turn is not something to do twice.
163
165
  */
164
- const rolloutPaths = (globalThis.__codexTranscriptPaths ??= new Map());
166
+ const rolloutPaths = (0, global_state_1.getOrInitGlobal)('__codexTranscriptPaths', () => new Map());
165
167
  function keyOf(target) {
166
168
  return (0, auto_yes_state_1.buildCompositeKey)(target.worktreeId, target.cliToolId, target.instanceId);
167
169
  }
@@ -185,24 +187,7 @@ function resetCodexTranscriptSessions() {
185
187
  * keeps being the only record, which is merely the status quo.
186
188
  */
187
189
  async function resolveCodexSessionId(target) {
188
- const key = keyOf(target);
189
- try {
190
- const { getLastAgentEvent } = await Promise.resolve().then(() => __importStar(require('../../../../lib/session/agent-event-state')));
191
- const sessionId = getLastAgentEvent(target.worktreeId, target.cliToolId, target.instanceId)?.sessionId;
192
- if (typeof sessionId === 'string' && sessionId.length > 0) {
193
- sessionPointers.set(key, sessionId);
194
- return sessionId;
195
- }
196
- }
197
- catch (error) {
198
- // A state module that cannot be reached is one that knows no session id.
199
- logger.debug('codex-transcript-session-lookup-failed', {
200
- worktreeId: target.worktreeId,
201
- instanceId: target.instanceId ?? target.cliToolId,
202
- error: error instanceof Error ? error.message : String(error),
203
- });
204
- }
205
- return sessionPointers.get(key) ?? null;
190
+ return (0, transcript_history_1.resolveSessionIdFromEvents)(target, sessionPointers, keyOf(target), logger, 'codex-transcript-session-lookup-failed');
206
191
  }
207
192
  /**
208
193
  * `$CODEX_HOME`, or `~/.codex`.
@@ -234,15 +219,7 @@ function codexSessionsRoot(codexHome) {
234
219
  * @returns The resolved path, or null when it is not acceptable
235
220
  */
236
221
  function acceptCodexRolloutPath(codexHome, candidate) {
237
- if (!candidate.endsWith(transcript_1.CODEX_ROLLOUT_EXTENSION))
238
- return null;
239
- if (candidate.includes('\0'))
240
- return null;
241
- const root = (0, path_1.resolve)(codexSessionsRoot(codexHome));
242
- const resolved = (0, path_1.resolve)(candidate);
243
- if (resolved !== root && !resolved.startsWith(root + path_1.sep))
244
- return null;
245
- return resolved;
222
+ return (0, transcript_history_1.acceptPathUnderRoot)(codexSessionsRoot(codexHome), transcript_1.CODEX_ROLLOUT_EXTENSION, candidate);
246
223
  }
247
224
  /** Whether a file name is the rollout of this session. */
248
225
  function isCodexRolloutFileFor(name, sessionId) {
@@ -440,7 +417,7 @@ async function captureCodexTranscriptTurn(target, capture = {}, report) {
440
417
  let captured = false;
441
418
  for (let index = 0; index < pending.turns.length; index += 1) {
442
419
  const turn = pending.turns[index];
443
- captured = await writeCodexTurn(target, turn, (0, transcript_1.renderCodexTurn)(turn), resolveAssistantTimestampMs(turn, userRows[index], lastRecordAt.get(turn.turnId) ?? 0, nextTurnOpensAt(pending.turns, userRows, index)), windowFacts, report);
420
+ captured = await writeCodexTurn(target, turn, (0, transcript_1.renderCodexTurn)(turn), (0, transcript_history_1.resolveAssistantTimestampMs)(turn, userRows[index], lastRecordAt.get(turn.turnId) ?? 0, (0, transcript_history_1.nextTurnOpensAt)(pending.turns, userRows, index)), windowFacts, report);
444
421
  }
445
422
  if (captured) {
446
423
  // Issue #2437: History now holds this turn as the agent's own Markdown.
@@ -506,26 +483,7 @@ function firstCodexRecordAt(records) {
506
483
  * @param turns - Every turn in the window, oldest first
507
484
  */
508
485
  async function selectUnwrittenCodexTurns(target, turns) {
509
- const [{ getDbInstance }, { findMessageByRequestId }] = await Promise.all([
510
- Promise.resolve().then(() => __importStar(require('../../../../lib/db/db-instance'))),
511
- Promise.resolve().then(() => __importStar(require('../../../../lib/db'))),
512
- ]);
513
- const db = getDbInstance();
514
- for (let index = turns.length - 1; index >= 0; index -= 1) {
515
- const requestId = (0, agent_transcript_1.codexTurnRequestId)(turns[index].turnId);
516
- if (!findMessageByRequestId(db, target.worktreeId, requestId))
517
- continue;
518
- return {
519
- turns: turns.slice(index + 1),
520
- previousStartedAt: turns[index].startedAt,
521
- anchored: true,
522
- };
523
- }
524
- return {
525
- turns: turns.slice(-1),
526
- previousStartedAt: turns.length > 1 ? turns[turns.length - 2].startedAt : 0,
527
- anchored: false,
528
- };
486
+ return (0, transcript_history_1.selectUnwrittenTurns)(target, turns, (turn) => (0, agent_transcript_1.codexTurnRequestId)(turn.turnId));
529
487
  }
530
488
  /**
531
489
  * The rollout file for this session, or null.
@@ -537,7 +495,7 @@ async function selectUnwrittenCodexTurns(target, turns) {
537
495
  async function locateCodexRollout(codexHome, sessionId) {
538
496
  const memoKey = `${codexHome}\0${sessionId}`;
539
497
  const memoised = rolloutPaths.get(memoKey);
540
- if (memoised && (await isReadableFile(memoised)))
498
+ if (memoised && (await (0, transcript_history_1.isReadableFile)(memoised)))
541
499
  return memoised;
542
500
  if (memoised)
543
501
  rolloutPaths.delete(memoKey);
@@ -550,14 +508,6 @@ async function locateCodexRollout(codexHome, sessionId) {
550
508
  rolloutPaths.set(memoKey, accepted);
551
509
  return accepted;
552
510
  }
553
- async function isReadableFile(path) {
554
- try {
555
- return (await (0, promises_1.stat)(path)).isFile();
556
- }
557
- catch {
558
- return false;
559
- }
560
- }
561
511
  /**
562
512
  * Record every prompt this turn answers, before the reply is written (#2196).
563
513
  *
@@ -598,7 +548,7 @@ async function recordCodexUserTurns(target, turn, previousStartedAt = 0) {
598
548
  }
599
549
  return last;
600
550
  }
601
- /**
551
+ /*
602
552
  * When the assistant row for this turn is dated.
603
553
  *
604
554
  * **The turn's LAST record, not its first (Issue #2273).** #2197 dated the reply
@@ -626,13 +576,6 @@ async function recordCodexUserTurns(target, turn, previousStartedAt = 0) {
626
576
  * @param nextTurnOpensAt - Epoch ms of the next turn's user row, or null when
627
577
  * this is the newest turn in the window
628
578
  */
629
- function resolveAssistantTimestampMs(turn, userRow, lastRecordAt = 0, nextTurnOpensAt = null) {
630
- const earliest = userRow.timestampMs === null
631
- ? turn.startedAt
632
- : Math.max(turn.startedAt, userRow.timestampMs + 1);
633
- const latest = nextTurnOpensAt === null ? Number.POSITIVE_INFINITY : nextTurnOpensAt - 1;
634
- return Math.max(earliest, Math.min(lastRecordAt, latest));
635
- }
636
579
  /**
637
580
  * When each turn's last record was written (Issue #2273).
638
581
  *
@@ -660,7 +603,7 @@ function lastCodexRecordAt(records) {
660
603
  }
661
604
  return at;
662
605
  }
663
- /**
606
+ /*
664
607
  * The instant the next pending turn's prompt row carries, or null (Issue #2273).
665
608
  *
666
609
  * The user row's own timestamp when there is one, because that is what History
@@ -669,12 +612,6 @@ function lastCodexRecordAt(records) {
669
612
  * prompt is while the previous turn was still running. The turn's start is the
670
613
  * fallback for a turn that produced no row at all.
671
614
  */
672
- function nextTurnOpensAt(turns, userRows, index) {
673
- const next = turns[index + 1];
674
- if (!next)
675
- return null;
676
- return userRows[index + 1]?.timestampMs ?? next.startedAt;
677
- }
678
615
  /**
679
616
  * Write one rendered turn, unless it is already there.
680
617
  *