commandmate 0.29.2 → 0.30.1

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 (653) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-build-manifest.json +271 -264
  3. package/.next/app-path-routes-manifest.json +35 -34
  4. package/.next/build-manifest.json +2 -2
  5. package/.next/prerender-manifest.json +3 -3
  6. package/.next/required-server-files.json +1 -1
  7. package/.next/routes-manifest.json +8 -8
  8. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  9. package/.next/server/app/api/agents/update/route_client-reference-manifest.js +1 -1
  10. package/.next/server/app/api/agents/versions/route_client-reference-manifest.js +1 -1
  11. package/.next/server/app/api/app/update/route_client-reference-manifest.js +1 -1
  12. package/.next/server/app/api/app/update-check/route.js +1 -1
  13. package/.next/server/app/api/app/update-check/route_client-reference-manifest.js +1 -1
  14. package/.next/server/app/api/assistant/conversation/route.js +1 -1
  15. package/.next/server/app/api/assistant/conversation/route.js.nft.json +1 -1
  16. package/.next/server/app/api/assistant/conversation/route_client-reference-manifest.js +1 -1
  17. package/.next/server/app/api/assistant/current-output/route.js +1 -1
  18. package/.next/server/app/api/assistant/current-output/route.js.nft.json +1 -1
  19. package/.next/server/app/api/assistant/current-output/route_client-reference-manifest.js +1 -1
  20. package/.next/server/app/api/assistant/messages/route.js +1 -1
  21. package/.next/server/app/api/assistant/messages/route.js.nft.json +1 -1
  22. package/.next/server/app/api/assistant/messages/route_client-reference-manifest.js +1 -1
  23. package/.next/server/app/api/assistant/session/route.js +1 -1
  24. package/.next/server/app/api/assistant/session/route.js.nft.json +1 -1
  25. package/.next/server/app/api/assistant/session/route_client-reference-manifest.js +1 -1
  26. package/.next/server/app/api/assistant/start/route.js +18 -18
  27. package/.next/server/app/api/assistant/start/route.js.nft.json +1 -1
  28. package/.next/server/app/api/assistant/start/route_client-reference-manifest.js +1 -1
  29. package/.next/server/app/api/assistant/terminal/route.js +19 -19
  30. package/.next/server/app/api/assistant/terminal/route.js.nft.json +1 -1
  31. package/.next/server/app/api/assistant/terminal/route_client-reference-manifest.js +1 -1
  32. package/.next/server/app/api/assistant/tools/route.js +1 -1
  33. package/.next/server/app/api/assistant/tools/route.js.nft.json +1 -1
  34. package/.next/server/app/api/assistant/tools/route_client-reference-manifest.js +1 -1
  35. package/.next/server/app/api/auth/login/route_client-reference-manifest.js +1 -1
  36. package/.next/server/app/api/auth/logout/route_client-reference-manifest.js +1 -1
  37. package/.next/server/app/api/auth/status/route_client-reference-manifest.js +1 -1
  38. package/.next/server/app/api/capabilities/route.js +1 -1
  39. package/.next/server/app/api/capabilities/route_client-reference-manifest.js +1 -1
  40. package/.next/server/app/api/daily-summary/route.js +1 -1
  41. package/.next/server/app/api/daily-summary/route_client-reference-manifest.js +1 -1
  42. package/.next/server/app/api/daily-summary/status/route_client-reference-manifest.js +1 -1
  43. package/.next/server/app/api/external-apps/[id]/health/route_client-reference-manifest.js +1 -1
  44. package/.next/server/app/api/external-apps/[id]/route_client-reference-manifest.js +1 -1
  45. package/.next/server/app/api/external-apps/route_client-reference-manifest.js +1 -1
  46. package/.next/server/app/api/fs/browse/route_client-reference-manifest.js +1 -1
  47. package/.next/server/app/api/fs/recent-paths/route_client-reference-manifest.js +1 -1
  48. package/.next/server/app/api/hooks/agent-event/route.js +1 -1
  49. package/.next/server/app/api/hooks/agent-event/route.js.nft.json +1 -1
  50. package/.next/server/app/api/hooks/agent-event/route_client-reference-manifest.js +1 -1
  51. package/.next/server/app/api/hooks/claude-done/route.js +2 -2
  52. package/.next/server/app/api/hooks/claude-done/route.js.nft.json +1 -1
  53. package/.next/server/app/api/hooks/claude-done/route_client-reference-manifest.js +1 -1
  54. package/.next/server/app/api/hooks/permission-request/route.js +1 -1
  55. package/.next/server/app/api/hooks/permission-request/route.js.nft.json +1 -1
  56. package/.next/server/app/api/hooks/permission-request/route_client-reference-manifest.js +1 -1
  57. package/.next/server/app/api/metrics/vibe/route_client-reference-manifest.js +1 -1
  58. package/.next/server/app/api/ollama/models/route_client-reference-manifest.js +1 -1
  59. package/.next/server/app/api/push/escalation/route.js +1 -1
  60. package/.next/server/app/api/push/escalation/route_client-reference-manifest.js +1 -1
  61. package/.next/server/app/api/push/subscriptions/route_client-reference-manifest.js +1 -1
  62. package/.next/server/app/api/push/vapid/route.js +1 -1
  63. package/.next/server/app/api/push/vapid/route_client-reference-manifest.js +1 -1
  64. package/.next/server/app/api/remote/pair/route_client-reference-manifest.js +1 -1
  65. package/.next/server/app/api/repositories/[id]/route_client-reference-manifest.js +1 -1
  66. package/.next/server/app/api/repositories/[id]/todos/[todoId]/route_client-reference-manifest.js +1 -1
  67. package/.next/server/app/api/repositories/[id]/todos/route_client-reference-manifest.js +1 -1
  68. package/.next/server/app/api/repositories/clone/[jobId]/route.js +1 -1
  69. package/.next/server/app/api/repositories/clone/[jobId]/route.js.nft.json +1 -1
  70. package/.next/server/app/api/repositories/clone/[jobId]/route_client-reference-manifest.js +1 -1
  71. package/.next/server/app/api/repositories/clone/route.js +1 -1
  72. package/.next/server/app/api/repositories/clone/route.js.nft.json +1 -1
  73. package/.next/server/app/api/repositories/clone/route_client-reference-manifest.js +1 -1
  74. package/.next/server/app/api/repositories/excluded/route_client-reference-manifest.js +1 -1
  75. package/.next/server/app/api/repositories/restore/route.js +1 -1
  76. package/.next/server/app/api/repositories/restore/route.js.nft.json +1 -1
  77. package/.next/server/app/api/repositories/restore/route_client-reference-manifest.js +1 -1
  78. package/.next/server/app/api/repositories/route.js +1 -1
  79. package/.next/server/app/api/repositories/route.js.nft.json +1 -1
  80. package/.next/server/app/api/repositories/route_client-reference-manifest.js +1 -1
  81. package/.next/server/app/api/repositories/scan/route.js +1 -1
  82. package/.next/server/app/api/repositories/scan/route.js.nft.json +1 -1
  83. package/.next/server/app/api/repositories/scan/route_client-reference-manifest.js +1 -1
  84. package/.next/server/app/api/repositories/sync/route.js +1 -1
  85. package/.next/server/app/api/repositories/sync/route.js.nft.json +1 -1
  86. package/.next/server/app/api/repositories/sync/route_client-reference-manifest.js +1 -1
  87. package/.next/server/app/api/repositories/validate-path/route_client-reference-manifest.js +1 -1
  88. package/.next/server/app/api/settings/default-agents/route.js +1 -1
  89. package/.next/server/app/api/settings/default-agents/route.js.nft.json +1 -1
  90. package/.next/server/app/api/settings/default-agents/route_client-reference-manifest.js +1 -1
  91. package/.next/server/app/api/settings/default-surface-mode/route.js +1 -0
  92. package/.next/server/app/api/settings/default-surface-mode/route.js.nft.json +1 -0
  93. package/.next/server/app/api/settings/default-surface-mode/route_client-reference-manifest.js +1 -0
  94. package/.next/server/app/api/sidebar/group-order/route_client-reference-manifest.js +1 -1
  95. package/.next/server/app/api/skills/[id]/route_client-reference-manifest.js +1 -1
  96. package/.next/server/app/api/skills/installations/route_client-reference-manifest.js +1 -1
  97. package/.next/server/app/api/skills/operations/route_client-reference-manifest.js +1 -1
  98. package/.next/server/app/api/skills/reindex/route_client-reference-manifest.js +1 -1
  99. package/.next/server/app/api/skills/route_client-reference-manifest.js +1 -1
  100. package/.next/server/app/api/slash-commands/route_client-reference-manifest.js +1 -1
  101. package/.next/server/app/api/tasks/[taskId]/cancel/route_client-reference-manifest.js +1 -1
  102. package/.next/server/app/api/tasks/[taskId]/route_client-reference-manifest.js +1 -1
  103. package/.next/server/app/api/templates/[id]/route_client-reference-manifest.js +1 -1
  104. package/.next/server/app/api/templates/route_client-reference-manifest.js +1 -1
  105. package/.next/server/app/api/todos/route_client-reference-manifest.js +1 -1
  106. package/.next/server/app/api/verification/runs/[runId]/route_client-reference-manifest.js +1 -1
  107. package/.next/server/app/api/verification/runs/route_client-reference-manifest.js +1 -1
  108. package/.next/server/app/api/worktrees/[id]/auto-yes/route.js +1 -1
  109. package/.next/server/app/api/worktrees/[id]/auto-yes/route.js.nft.json +1 -1
  110. package/.next/server/app/api/worktrees/[id]/auto-yes/route_client-reference-manifest.js +1 -1
  111. package/.next/server/app/api/worktrees/[id]/capture/route.js +1 -1
  112. package/.next/server/app/api/worktrees/[id]/capture/route.js.nft.json +1 -1
  113. package/.next/server/app/api/worktrees/[id]/capture/route_client-reference-manifest.js +1 -1
  114. package/.next/server/app/api/worktrees/[id]/clear-composer/route.js +1 -1
  115. package/.next/server/app/api/worktrees/[id]/clear-composer/route.js.nft.json +1 -1
  116. package/.next/server/app/api/worktrees/[id]/clear-composer/route_client-reference-manifest.js +1 -1
  117. package/.next/server/app/api/worktrees/[id]/cli-reference/route.js +1 -0
  118. package/.next/server/app/api/worktrees/[id]/cli-reference/route.js.nft.json +1 -0
  119. package/.next/server/app/api/worktrees/[id]/cli-reference/route_client-reference-manifest.js +1 -0
  120. package/.next/server/app/api/worktrees/[id]/cli-tool/route_client-reference-manifest.js +1 -1
  121. package/.next/server/app/api/worktrees/[id]/cmate/schedules/route_client-reference-manifest.js +1 -1
  122. package/.next/server/app/api/worktrees/[id]/current-output/route.js +1 -1
  123. package/.next/server/app/api/worktrees/[id]/current-output/route.js.nft.json +1 -1
  124. package/.next/server/app/api/worktrees/[id]/current-output/route_client-reference-manifest.js +1 -1
  125. package/.next/server/app/api/worktrees/[id]/env/route_client-reference-manifest.js +1 -1
  126. package/.next/server/app/api/worktrees/[id]/execution-logs/[logId]/route_client-reference-manifest.js +1 -1
  127. package/.next/server/app/api/worktrees/[id]/execution-logs/route_client-reference-manifest.js +1 -1
  128. package/.next/server/app/api/worktrees/[id]/files/[...path]/route_client-reference-manifest.js +1 -1
  129. package/.next/server/app/api/worktrees/[id]/git/branch/create/route_client-reference-manifest.js +1 -1
  130. package/.next/server/app/api/worktrees/[id]/git/branch/delete/route_client-reference-manifest.js +1 -1
  131. package/.next/server/app/api/worktrees/[id]/git/branches/route_client-reference-manifest.js +1 -1
  132. package/.next/server/app/api/worktrees/[id]/git/checkout/route_client-reference-manifest.js +1 -1
  133. package/.next/server/app/api/worktrees/[id]/git/commit/route_client-reference-manifest.js +1 -1
  134. package/.next/server/app/api/worktrees/[id]/git/diff/route_client-reference-manifest.js +1 -1
  135. package/.next/server/app/api/worktrees/[id]/git/fetch/route_client-reference-manifest.js +1 -1
  136. package/.next/server/app/api/worktrees/[id]/git/log/route_client-reference-manifest.js +1 -1
  137. package/.next/server/app/api/worktrees/[id]/git/pull/route_client-reference-manifest.js +1 -1
  138. package/.next/server/app/api/worktrees/[id]/git/push/route_client-reference-manifest.js +1 -1
  139. package/.next/server/app/api/worktrees/[id]/git/reset/route_client-reference-manifest.js +1 -1
  140. package/.next/server/app/api/worktrees/[id]/git/revert/route_client-reference-manifest.js +1 -1
  141. package/.next/server/app/api/worktrees/[id]/git/show/[commitHash]/route_client-reference-manifest.js +1 -1
  142. package/.next/server/app/api/worktrees/[id]/git/stage/route_client-reference-manifest.js +1 -1
  143. package/.next/server/app/api/worktrees/[id]/git/staged/route_client-reference-manifest.js +1 -1
  144. package/.next/server/app/api/worktrees/[id]/git/stash/[index]/route_client-reference-manifest.js +1 -1
  145. package/.next/server/app/api/worktrees/[id]/git/stash/apply/route_client-reference-manifest.js +1 -1
  146. package/.next/server/app/api/worktrees/[id]/git/stash/pop/route_client-reference-manifest.js +1 -1
  147. package/.next/server/app/api/worktrees/[id]/git/stash/push/route_client-reference-manifest.js +1 -1
  148. package/.next/server/app/api/worktrees/[id]/git/stash/route_client-reference-manifest.js +1 -1
  149. package/.next/server/app/api/worktrees/[id]/git/status/route_client-reference-manifest.js +1 -1
  150. package/.next/server/app/api/worktrees/[id]/git/unstage/route_client-reference-manifest.js +1 -1
  151. package/.next/server/app/api/worktrees/[id]/git/working-diff/route_client-reference-manifest.js +1 -1
  152. package/.next/server/app/api/worktrees/[id]/instances/opencode/route.js +1 -1
  153. package/.next/server/app/api/worktrees/[id]/instances/opencode/route.js.nft.json +1 -1
  154. package/.next/server/app/api/worktrees/[id]/instances/opencode/route_client-reference-manifest.js +1 -1
  155. package/.next/server/app/api/worktrees/[id]/interrupt/route.js +1 -1
  156. package/.next/server/app/api/worktrees/[id]/interrupt/route.js.nft.json +1 -1
  157. package/.next/server/app/api/worktrees/[id]/interrupt/route_client-reference-manifest.js +1 -1
  158. package/.next/server/app/api/worktrees/[id]/kill-session/route.js +1 -1
  159. package/.next/server/app/api/worktrees/[id]/kill-session/route.js.nft.json +1 -1
  160. package/.next/server/app/api/worktrees/[id]/kill-session/route_client-reference-manifest.js +1 -1
  161. package/.next/server/app/api/worktrees/[id]/logs/[filename]/route_client-reference-manifest.js +1 -1
  162. package/.next/server/app/api/worktrees/[id]/logs/route_client-reference-manifest.js +1 -1
  163. package/.next/server/app/api/worktrees/[id]/marp-render/route_client-reference-manifest.js +1 -1
  164. package/.next/server/app/api/worktrees/[id]/memos/[memoId]/route_client-reference-manifest.js +1 -1
  165. package/.next/server/app/api/worktrees/[id]/memos/route_client-reference-manifest.js +1 -1
  166. package/.next/server/app/api/worktrees/[id]/messages/route_client-reference-manifest.js +1 -1
  167. package/.next/server/app/api/worktrees/[id]/opencode/diff/route_client-reference-manifest.js +1 -1
  168. package/.next/server/app/api/worktrees/[id]/opencode/session/route.js +1 -1
  169. package/.next/server/app/api/worktrees/[id]/opencode/session/route_client-reference-manifest.js +1 -1
  170. package/.next/server/app/api/worktrees/[id]/opencode/share/route.js +1 -1
  171. package/.next/server/app/api/worktrees/[id]/opencode/share/route_client-reference-manifest.js +1 -1
  172. package/.next/server/app/api/worktrees/[id]/prompt-response/route.js +1 -1
  173. package/.next/server/app/api/worktrees/[id]/prompt-response/route.js.nft.json +1 -1
  174. package/.next/server/app/api/worktrees/[id]/prompt-response/route_client-reference-manifest.js +1 -1
  175. package/.next/server/app/api/worktrees/[id]/resolve-target/route.js +1 -1
  176. package/.next/server/app/api/worktrees/[id]/resolve-target/route_client-reference-manifest.js +1 -1
  177. package/.next/server/app/api/worktrees/[id]/respond/route.js +1 -1
  178. package/.next/server/app/api/worktrees/[id]/respond/route.js.nft.json +1 -1
  179. package/.next/server/app/api/worktrees/[id]/respond/route_client-reference-manifest.js +1 -1
  180. package/.next/server/app/api/worktrees/[id]/route.js +1 -1
  181. package/.next/server/app/api/worktrees/[id]/route.js.nft.json +1 -1
  182. package/.next/server/app/api/worktrees/[id]/route_client-reference-manifest.js +1 -1
  183. package/.next/server/app/api/worktrees/[id]/schedules/[scheduleId]/route_client-reference-manifest.js +1 -1
  184. package/.next/server/app/api/worktrees/[id]/schedules/active/route_client-reference-manifest.js +1 -1
  185. package/.next/server/app/api/worktrees/[id]/schedules/route_client-reference-manifest.js +1 -1
  186. package/.next/server/app/api/worktrees/[id]/search/route_client-reference-manifest.js +1 -1
  187. package/.next/server/app/api/worktrees/[id]/send/route.js +1 -1
  188. package/.next/server/app/api/worktrees/[id]/send/route.js.nft.json +1 -1
  189. package/.next/server/app/api/worktrees/[id]/send/route_client-reference-manifest.js +1 -1
  190. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route.js +1 -1
  191. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route.js.nft.json +1 -1
  192. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route_client-reference-manifest.js +1 -1
  193. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/install/route_client-reference-manifest.js +1 -1
  194. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/plan/route_client-reference-manifest.js +1 -1
  195. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall/route_client-reference-manifest.js +1 -1
  196. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall-plan/route_client-reference-manifest.js +1 -1
  197. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/update/route_client-reference-manifest.js +1 -1
  198. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/update-plan/route_client-reference-manifest.js +1 -1
  199. package/.next/server/app/api/worktrees/[id]/skills/route_client-reference-manifest.js +1 -1
  200. package/.next/server/app/api/worktrees/[id]/slash-commands/route_client-reference-manifest.js +1 -1
  201. package/.next/server/app/api/worktrees/[id]/special-keys/route.js +1 -1
  202. package/.next/server/app/api/worktrees/[id]/special-keys/route.js.nft.json +1 -1
  203. package/.next/server/app/api/worktrees/[id]/special-keys/route_client-reference-manifest.js +1 -1
  204. package/.next/server/app/api/worktrees/[id]/tasks/route_client-reference-manifest.js +1 -1
  205. package/.next/server/app/api/worktrees/[id]/terminal/route.js +1 -1
  206. package/.next/server/app/api/worktrees/[id]/terminal/route.js.nft.json +1 -1
  207. package/.next/server/app/api/worktrees/[id]/terminal/route_client-reference-manifest.js +1 -1
  208. package/.next/server/app/api/worktrees/[id]/timers/history/route_client-reference-manifest.js +1 -1
  209. package/.next/server/app/api/worktrees/[id]/timers/route.js +1 -1
  210. package/.next/server/app/api/worktrees/[id]/timers/route.js.nft.json +1 -1
  211. package/.next/server/app/api/worktrees/[id]/timers/route_client-reference-manifest.js +1 -1
  212. package/.next/server/app/api/worktrees/[id]/todos/[todoId]/route_client-reference-manifest.js +1 -1
  213. package/.next/server/app/api/worktrees/[id]/todos/route_client-reference-manifest.js +1 -1
  214. package/.next/server/app/api/worktrees/[id]/tree/[...path]/route_client-reference-manifest.js +1 -1
  215. package/.next/server/app/api/worktrees/[id]/tree/route_client-reference-manifest.js +1 -1
  216. package/.next/server/app/api/worktrees/[id]/upload/[...path]/route_client-reference-manifest.js +1 -1
  217. package/.next/server/app/api/worktrees/[id]/verify/config/route_client-reference-manifest.js +1 -1
  218. package/.next/server/app/api/worktrees/[id]/verify/route_client-reference-manifest.js +1 -1
  219. package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/cancel/route_client-reference-manifest.js +1 -1
  220. package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/route_client-reference-manifest.js +1 -1
  221. package/.next/server/app/api/worktrees/[id]/verify/runs/route_client-reference-manifest.js +1 -1
  222. package/.next/server/app/api/worktrees/[id]/viewed/route_client-reference-manifest.js +1 -1
  223. package/.next/server/app/api/worktrees/apply-default-agents/route.js +1 -1
  224. package/.next/server/app/api/worktrees/apply-default-agents/route_client-reference-manifest.js +1 -1
  225. package/.next/server/app/api/worktrees/route.js +1 -1
  226. package/.next/server/app/api/worktrees/route.js.nft.json +1 -1
  227. package/.next/server/app/api/worktrees/route_client-reference-manifest.js +1 -1
  228. package/.next/server/app/chat/page_client-reference-manifest.js +1 -1
  229. package/.next/server/app/login/page_client-reference-manifest.js +1 -1
  230. package/.next/server/app/manifest.webmanifest/route_client-reference-manifest.js +1 -1
  231. package/.next/server/app/more/page.js +2 -2
  232. package/.next/server/app/more/page.js.nft.json +1 -1
  233. package/.next/server/app/more/page_client-reference-manifest.js +1 -1
  234. package/.next/server/app/offline/page_client-reference-manifest.js +1 -1
  235. package/.next/server/app/page_client-reference-manifest.js +1 -1
  236. package/.next/server/app/proxy/[...path]/route_client-reference-manifest.js +1 -1
  237. package/.next/server/app/repositories/page_client-reference-manifest.js +1 -1
  238. package/.next/server/app/review/page_client-reference-manifest.js +1 -1
  239. package/.next/server/app/sessions/page_client-reference-manifest.js +1 -1
  240. package/.next/server/app/skills/[skillId]/page_client-reference-manifest.js +1 -1
  241. package/.next/server/app/skills/installed/page_client-reference-manifest.js +1 -1
  242. package/.next/server/app/skills/page_client-reference-manifest.js +1 -1
  243. package/.next/server/app/worktrees/[id]/files/[...path]/page_client-reference-manifest.js +1 -1
  244. package/.next/server/app/worktrees/[id]/page.js +11 -11
  245. package/.next/server/app/worktrees/[id]/page.js.nft.json +1 -1
  246. package/.next/server/app/worktrees/[id]/page_client-reference-manifest.js +1 -1
  247. package/.next/server/app/worktrees/[id]/terminal/page.js +3 -3
  248. package/.next/server/app/worktrees/[id]/terminal/page_client-reference-manifest.js +1 -1
  249. package/.next/server/app-paths-manifest.json +35 -34
  250. package/.next/server/chunks/1058.js +1 -1
  251. package/.next/server/chunks/1068.js +1 -1
  252. package/.next/server/chunks/1191.js +1 -1
  253. package/.next/server/chunks/1341.js +1 -1
  254. package/.next/server/chunks/1886.js +3 -3
  255. package/.next/server/chunks/2119.js +1 -1
  256. package/.next/server/chunks/2445.js +1 -1
  257. package/.next/server/chunks/261.js +1 -0
  258. package/.next/server/chunks/2739.js +1 -0
  259. package/.next/server/chunks/2816.js +1 -1
  260. package/.next/server/chunks/3099.js +5 -0
  261. package/.next/server/chunks/3123.js +1 -0
  262. package/.next/server/chunks/3241.js +1 -1
  263. package/.next/server/chunks/3543.js +1 -1
  264. package/.next/server/chunks/3945.js +1 -1
  265. package/.next/server/chunks/4325.js +1 -0
  266. package/.next/server/chunks/4390.js +1 -1
  267. package/.next/server/chunks/4393.js +1 -1
  268. package/.next/server/chunks/4443.js +6 -0
  269. package/.next/server/chunks/5017.js +1 -1
  270. package/.next/server/chunks/5043.js +1 -0
  271. package/.next/server/chunks/5120.js +1 -0
  272. package/.next/server/chunks/552.js +25 -0
  273. package/.next/server/chunks/6130.js +1 -1
  274. package/.next/server/chunks/6337.js +1 -1
  275. package/.next/server/chunks/663.js +1 -1
  276. package/.next/server/chunks/6894.js +8 -0
  277. package/.next/server/chunks/7685.js +1 -1
  278. package/.next/server/chunks/7836.js +1 -0
  279. package/.next/server/chunks/8356.js +1 -1
  280. package/.next/server/chunks/880.js +1 -1
  281. package/.next/server/chunks/8807.js +1 -1
  282. package/.next/server/chunks/9123.js +2 -2
  283. package/.next/server/chunks/9130.js +3 -3
  284. package/.next/server/chunks/9627.js +48 -26
  285. package/.next/server/chunks/9696.js +3 -0
  286. package/.next/server/chunks/9798.js +1 -1
  287. package/.next/server/middleware-manifest.json +5 -5
  288. package/.next/server/pages/500.html +1 -1
  289. package/.next/server/server-reference-manifest.json +1 -1
  290. package/.next/server/src/middleware.js +1 -1
  291. package/.next/server/src/middleware.js.map +1 -1
  292. package/.next/static/chunks/{4882-388e94fe0a03c2ba.js → 3916-0e929d089282dc5d.js} +1 -1
  293. package/.next/static/chunks/{5229-b2a81bb8fb5c19e9.js → 5229-6c89475b61bd2c8b.js} +1 -1
  294. package/.next/static/chunks/6022-7a7d1760fc9814c7.js +1 -0
  295. package/.next/static/chunks/6381-dbf04a99647f6018.js +1 -0
  296. package/.next/static/chunks/app/api/agents/update/route-ee11f7b8a34cba8c.js +1 -0
  297. package/.next/static/chunks/app/api/agents/versions/route-ee11f7b8a34cba8c.js +1 -0
  298. package/.next/static/chunks/app/api/app/update/route-ee11f7b8a34cba8c.js +1 -0
  299. package/.next/static/chunks/app/api/app/update-check/route-ee11f7b8a34cba8c.js +1 -0
  300. package/.next/static/chunks/app/api/assistant/conversation/route-ee11f7b8a34cba8c.js +1 -0
  301. package/.next/static/chunks/app/api/assistant/current-output/route-ee11f7b8a34cba8c.js +1 -0
  302. package/.next/static/chunks/app/api/assistant/messages/route-ee11f7b8a34cba8c.js +1 -0
  303. package/.next/static/chunks/app/api/assistant/session/route-ee11f7b8a34cba8c.js +1 -0
  304. package/.next/static/chunks/app/api/assistant/start/route-ee11f7b8a34cba8c.js +1 -0
  305. package/.next/static/chunks/app/api/assistant/terminal/route-ee11f7b8a34cba8c.js +1 -0
  306. package/.next/static/chunks/app/api/assistant/tools/route-ee11f7b8a34cba8c.js +1 -0
  307. package/.next/static/chunks/app/api/auth/login/route-ee11f7b8a34cba8c.js +1 -0
  308. package/.next/static/chunks/app/api/auth/logout/route-ee11f7b8a34cba8c.js +1 -0
  309. package/.next/static/chunks/app/api/auth/status/route-ee11f7b8a34cba8c.js +1 -0
  310. package/.next/static/chunks/app/api/capabilities/route-ee11f7b8a34cba8c.js +1 -0
  311. package/.next/static/chunks/app/api/daily-summary/route-ee11f7b8a34cba8c.js +1 -0
  312. package/.next/static/chunks/app/api/daily-summary/status/route-ee11f7b8a34cba8c.js +1 -0
  313. package/.next/static/chunks/app/api/external-apps/[id]/health/route-ee11f7b8a34cba8c.js +1 -0
  314. package/.next/static/chunks/app/api/external-apps/[id]/route-ee11f7b8a34cba8c.js +1 -0
  315. package/.next/static/chunks/app/api/external-apps/route-ee11f7b8a34cba8c.js +1 -0
  316. package/.next/static/chunks/app/api/fs/browse/route-ee11f7b8a34cba8c.js +1 -0
  317. package/.next/static/chunks/app/api/fs/recent-paths/route-ee11f7b8a34cba8c.js +1 -0
  318. package/.next/static/chunks/app/api/hooks/agent-event/route-ee11f7b8a34cba8c.js +1 -0
  319. package/.next/static/chunks/app/api/hooks/claude-done/route-ee11f7b8a34cba8c.js +1 -0
  320. package/.next/static/chunks/app/api/hooks/permission-request/route-ee11f7b8a34cba8c.js +1 -0
  321. package/.next/static/chunks/app/api/metrics/vibe/route-ee11f7b8a34cba8c.js +1 -0
  322. package/.next/static/chunks/app/api/ollama/models/route-ee11f7b8a34cba8c.js +1 -0
  323. package/.next/static/chunks/app/api/push/escalation/route-ee11f7b8a34cba8c.js +1 -0
  324. package/.next/static/chunks/app/api/push/subscriptions/route-ee11f7b8a34cba8c.js +1 -0
  325. package/.next/static/chunks/app/api/push/vapid/route-ee11f7b8a34cba8c.js +1 -0
  326. package/.next/static/chunks/app/api/remote/pair/route-ee11f7b8a34cba8c.js +1 -0
  327. package/.next/static/chunks/app/api/repositories/[id]/route-ee11f7b8a34cba8c.js +1 -0
  328. package/.next/static/chunks/app/api/repositories/[id]/todos/[todoId]/route-ee11f7b8a34cba8c.js +1 -0
  329. package/.next/static/chunks/app/api/repositories/[id]/todos/route-ee11f7b8a34cba8c.js +1 -0
  330. package/.next/static/chunks/app/api/repositories/clone/[jobId]/route-ee11f7b8a34cba8c.js +1 -0
  331. package/.next/static/chunks/app/api/repositories/clone/route-ee11f7b8a34cba8c.js +1 -0
  332. package/.next/static/chunks/app/api/repositories/excluded/route-ee11f7b8a34cba8c.js +1 -0
  333. package/.next/static/chunks/app/api/repositories/restore/route-ee11f7b8a34cba8c.js +1 -0
  334. package/.next/static/chunks/app/api/repositories/route-ee11f7b8a34cba8c.js +1 -0
  335. package/.next/static/chunks/app/api/repositories/scan/route-ee11f7b8a34cba8c.js +1 -0
  336. package/.next/static/chunks/app/api/repositories/sync/route-ee11f7b8a34cba8c.js +1 -0
  337. package/.next/static/chunks/app/api/repositories/validate-path/route-ee11f7b8a34cba8c.js +1 -0
  338. package/.next/static/chunks/app/api/settings/default-agents/route-ee11f7b8a34cba8c.js +1 -0
  339. package/.next/static/chunks/app/api/settings/default-surface-mode/route-ee11f7b8a34cba8c.js +1 -0
  340. package/.next/static/chunks/app/api/sidebar/group-order/route-ee11f7b8a34cba8c.js +1 -0
  341. package/.next/static/chunks/app/api/skills/[id]/route-ee11f7b8a34cba8c.js +1 -0
  342. package/.next/static/chunks/app/api/skills/installations/route-ee11f7b8a34cba8c.js +1 -0
  343. package/.next/static/chunks/app/api/skills/operations/route-ee11f7b8a34cba8c.js +1 -0
  344. package/.next/static/chunks/app/api/skills/reindex/route-ee11f7b8a34cba8c.js +1 -0
  345. package/.next/static/chunks/app/api/skills/route-ee11f7b8a34cba8c.js +1 -0
  346. package/.next/static/chunks/app/api/slash-commands/route-ee11f7b8a34cba8c.js +1 -0
  347. package/.next/static/chunks/app/api/tasks/[taskId]/cancel/route-ee11f7b8a34cba8c.js +1 -0
  348. package/.next/static/chunks/app/api/tasks/[taskId]/route-ee11f7b8a34cba8c.js +1 -0
  349. package/.next/static/chunks/app/api/templates/[id]/route-ee11f7b8a34cba8c.js +1 -0
  350. package/.next/static/chunks/app/api/templates/route-ee11f7b8a34cba8c.js +1 -0
  351. package/.next/static/chunks/app/api/todos/route-ee11f7b8a34cba8c.js +1 -0
  352. package/.next/static/chunks/app/api/verification/runs/[runId]/route-ee11f7b8a34cba8c.js +1 -0
  353. package/.next/static/chunks/app/api/verification/runs/route-ee11f7b8a34cba8c.js +1 -0
  354. package/.next/static/chunks/app/api/worktrees/[id]/auto-yes/route-ee11f7b8a34cba8c.js +1 -0
  355. package/.next/static/chunks/app/api/worktrees/[id]/capture/route-ee11f7b8a34cba8c.js +1 -0
  356. package/.next/static/chunks/app/api/worktrees/[id]/clear-composer/route-ee11f7b8a34cba8c.js +1 -0
  357. package/.next/static/chunks/app/api/worktrees/[id]/cli-reference/route-ee11f7b8a34cba8c.js +1 -0
  358. package/.next/static/chunks/app/api/worktrees/[id]/cli-tool/route-ee11f7b8a34cba8c.js +1 -0
  359. package/.next/static/chunks/app/api/worktrees/[id]/cmate/schedules/route-ee11f7b8a34cba8c.js +1 -0
  360. package/.next/static/chunks/app/api/worktrees/[id]/current-output/route-ee11f7b8a34cba8c.js +1 -0
  361. package/.next/static/chunks/app/api/worktrees/[id]/env/route-ee11f7b8a34cba8c.js +1 -0
  362. package/.next/static/chunks/app/api/worktrees/[id]/execution-logs/[logId]/route-ee11f7b8a34cba8c.js +1 -0
  363. package/.next/static/chunks/app/api/worktrees/[id]/execution-logs/route-ee11f7b8a34cba8c.js +1 -0
  364. package/.next/static/chunks/app/api/worktrees/[id]/files/[...path]/route-ee11f7b8a34cba8c.js +1 -0
  365. package/.next/static/chunks/app/api/worktrees/[id]/git/branch/create/route-ee11f7b8a34cba8c.js +1 -0
  366. package/.next/static/chunks/app/api/worktrees/[id]/git/branch/delete/route-ee11f7b8a34cba8c.js +1 -0
  367. package/.next/static/chunks/app/api/worktrees/[id]/git/branches/route-ee11f7b8a34cba8c.js +1 -0
  368. package/.next/static/chunks/app/api/worktrees/[id]/git/checkout/route-ee11f7b8a34cba8c.js +1 -0
  369. package/.next/static/chunks/app/api/worktrees/[id]/git/commit/route-ee11f7b8a34cba8c.js +1 -0
  370. package/.next/static/chunks/app/api/worktrees/[id]/git/diff/route-ee11f7b8a34cba8c.js +1 -0
  371. package/.next/static/chunks/app/api/worktrees/[id]/git/fetch/route-ee11f7b8a34cba8c.js +1 -0
  372. package/.next/static/chunks/app/api/worktrees/[id]/git/log/route-ee11f7b8a34cba8c.js +1 -0
  373. package/.next/static/chunks/app/api/worktrees/[id]/git/pull/route-ee11f7b8a34cba8c.js +1 -0
  374. package/.next/static/chunks/app/api/worktrees/[id]/git/push/route-ee11f7b8a34cba8c.js +1 -0
  375. package/.next/static/chunks/app/api/worktrees/[id]/git/reset/route-ee11f7b8a34cba8c.js +1 -0
  376. package/.next/static/chunks/app/api/worktrees/[id]/git/revert/route-ee11f7b8a34cba8c.js +1 -0
  377. package/.next/static/chunks/app/api/worktrees/[id]/git/show/[commitHash]/route-ee11f7b8a34cba8c.js +1 -0
  378. package/.next/static/chunks/app/api/worktrees/[id]/git/stage/route-ee11f7b8a34cba8c.js +1 -0
  379. package/.next/static/chunks/app/api/worktrees/[id]/git/staged/route-ee11f7b8a34cba8c.js +1 -0
  380. package/.next/static/chunks/app/api/worktrees/[id]/git/stash/[index]/route-ee11f7b8a34cba8c.js +1 -0
  381. package/.next/static/chunks/app/api/worktrees/[id]/git/stash/apply/route-ee11f7b8a34cba8c.js +1 -0
  382. package/.next/static/chunks/app/api/worktrees/[id]/git/stash/pop/route-ee11f7b8a34cba8c.js +1 -0
  383. package/.next/static/chunks/app/api/worktrees/[id]/git/stash/push/route-ee11f7b8a34cba8c.js +1 -0
  384. package/.next/static/chunks/app/api/worktrees/[id]/git/stash/route-ee11f7b8a34cba8c.js +1 -0
  385. package/.next/static/chunks/app/api/worktrees/[id]/git/status/route-ee11f7b8a34cba8c.js +1 -0
  386. package/.next/static/chunks/app/api/worktrees/[id]/git/unstage/route-ee11f7b8a34cba8c.js +1 -0
  387. package/.next/static/chunks/app/api/worktrees/[id]/git/working-diff/route-ee11f7b8a34cba8c.js +1 -0
  388. package/.next/static/chunks/app/api/worktrees/[id]/instances/opencode/route-ee11f7b8a34cba8c.js +1 -0
  389. package/.next/static/chunks/app/api/worktrees/[id]/interrupt/route-ee11f7b8a34cba8c.js +1 -0
  390. package/.next/static/chunks/app/api/worktrees/[id]/kill-session/route-ee11f7b8a34cba8c.js +1 -0
  391. package/.next/static/chunks/app/api/worktrees/[id]/logs/[filename]/route-ee11f7b8a34cba8c.js +1 -0
  392. package/.next/static/chunks/app/api/worktrees/[id]/logs/route-ee11f7b8a34cba8c.js +1 -0
  393. package/.next/static/chunks/app/api/worktrees/[id]/marp-render/route-ee11f7b8a34cba8c.js +1 -0
  394. package/.next/static/chunks/app/api/worktrees/[id]/memos/[memoId]/route-ee11f7b8a34cba8c.js +1 -0
  395. package/.next/static/chunks/app/api/worktrees/[id]/memos/route-ee11f7b8a34cba8c.js +1 -0
  396. package/.next/static/chunks/app/api/worktrees/[id]/messages/route-ee11f7b8a34cba8c.js +1 -0
  397. package/.next/static/chunks/app/api/worktrees/[id]/opencode/diff/route-ee11f7b8a34cba8c.js +1 -0
  398. package/.next/static/chunks/app/api/worktrees/[id]/opencode/session/route-ee11f7b8a34cba8c.js +1 -0
  399. package/.next/static/chunks/app/api/worktrees/[id]/opencode/share/route-ee11f7b8a34cba8c.js +1 -0
  400. package/.next/static/chunks/app/api/worktrees/[id]/prompt-response/route-ee11f7b8a34cba8c.js +1 -0
  401. package/.next/static/chunks/app/api/worktrees/[id]/resolve-target/route-ee11f7b8a34cba8c.js +1 -0
  402. package/.next/static/chunks/app/api/worktrees/[id]/respond/route-ee11f7b8a34cba8c.js +1 -0
  403. package/.next/static/chunks/app/api/worktrees/[id]/route-ee11f7b8a34cba8c.js +1 -0
  404. package/.next/static/chunks/app/api/worktrees/[id]/schedules/[scheduleId]/route-ee11f7b8a34cba8c.js +1 -0
  405. package/.next/static/chunks/app/api/worktrees/[id]/schedules/active/route-ee11f7b8a34cba8c.js +1 -0
  406. package/.next/static/chunks/app/api/worktrees/[id]/schedules/route-ee11f7b8a34cba8c.js +1 -0
  407. package/.next/static/chunks/app/api/worktrees/[id]/search/route-ee11f7b8a34cba8c.js +1 -0
  408. package/.next/static/chunks/app/api/worktrees/[id]/send/route-ee11f7b8a34cba8c.js +1 -0
  409. package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route-ee11f7b8a34cba8c.js +1 -0
  410. package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/install/route-ee11f7b8a34cba8c.js +1 -0
  411. package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/plan/route-ee11f7b8a34cba8c.js +1 -0
  412. package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/uninstall/route-ee11f7b8a34cba8c.js +1 -0
  413. package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/uninstall-plan/route-ee11f7b8a34cba8c.js +1 -0
  414. package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/update/route-ee11f7b8a34cba8c.js +1 -0
  415. package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/update-plan/route-ee11f7b8a34cba8c.js +1 -0
  416. package/.next/static/chunks/app/api/worktrees/[id]/skills/route-ee11f7b8a34cba8c.js +1 -0
  417. package/.next/static/chunks/app/api/worktrees/[id]/slash-commands/route-ee11f7b8a34cba8c.js +1 -0
  418. package/.next/static/chunks/app/api/worktrees/[id]/special-keys/route-ee11f7b8a34cba8c.js +1 -0
  419. package/.next/static/chunks/app/api/worktrees/[id]/tasks/route-ee11f7b8a34cba8c.js +1 -0
  420. package/.next/static/chunks/app/api/worktrees/[id]/terminal/route-ee11f7b8a34cba8c.js +1 -0
  421. package/.next/static/chunks/app/api/worktrees/[id]/timers/history/route-ee11f7b8a34cba8c.js +1 -0
  422. package/.next/static/chunks/app/api/worktrees/[id]/timers/route-ee11f7b8a34cba8c.js +1 -0
  423. package/.next/static/chunks/app/api/worktrees/[id]/todos/[todoId]/route-ee11f7b8a34cba8c.js +1 -0
  424. package/.next/static/chunks/app/api/worktrees/[id]/todos/route-ee11f7b8a34cba8c.js +1 -0
  425. package/.next/static/chunks/app/api/worktrees/[id]/tree/[...path]/route-ee11f7b8a34cba8c.js +1 -0
  426. package/.next/static/chunks/app/api/worktrees/[id]/tree/route-ee11f7b8a34cba8c.js +1 -0
  427. package/.next/static/chunks/app/api/worktrees/[id]/upload/[...path]/route-ee11f7b8a34cba8c.js +1 -0
  428. package/.next/static/chunks/app/api/worktrees/[id]/verify/config/route-ee11f7b8a34cba8c.js +1 -0
  429. package/.next/static/chunks/app/api/worktrees/[id]/verify/route-ee11f7b8a34cba8c.js +1 -0
  430. package/.next/static/chunks/app/api/worktrees/[id]/verify/runs/[runId]/cancel/route-ee11f7b8a34cba8c.js +1 -0
  431. package/.next/static/chunks/app/api/worktrees/[id]/verify/runs/[runId]/route-ee11f7b8a34cba8c.js +1 -0
  432. package/.next/static/chunks/app/api/worktrees/[id]/verify/runs/route-ee11f7b8a34cba8c.js +1 -0
  433. package/.next/static/chunks/app/api/worktrees/[id]/viewed/route-ee11f7b8a34cba8c.js +1 -0
  434. package/.next/static/chunks/app/api/worktrees/apply-default-agents/route-ee11f7b8a34cba8c.js +1 -0
  435. package/.next/static/chunks/app/api/worktrees/route-ee11f7b8a34cba8c.js +1 -0
  436. package/.next/static/chunks/app/manifest.webmanifest/route-ee11f7b8a34cba8c.js +1 -0
  437. package/.next/static/chunks/app/more/{page-75d3783da0d49a25.js → page-333bba1c8bbc9c11.js} +1 -1
  438. package/.next/static/chunks/app/proxy/[...path]/route-ee11f7b8a34cba8c.js +1 -0
  439. package/.next/static/chunks/app/worktrees/[id]/layout-ee11f7b8a34cba8c.js +1 -0
  440. package/.next/static/chunks/app/worktrees/[id]/page-aac399392ec8c273.js +1 -0
  441. package/.next/static/chunks/app/worktrees/[id]/terminal/page-2631bc5c4b0a9fb8.js +1 -0
  442. package/.next/static/css/23f9c40ecc458c77.css +1 -0
  443. package/.next/static/pcpB4K6KreMzu2qbhvuRY/_buildManifest.js +1 -0
  444. package/.next/trace +13 -13
  445. package/.next/types/app/api/settings/default-surface-mode/route.ts +347 -0
  446. package/.next/types/app/api/worktrees/[id]/{start-polling → cli-reference}/route.ts +3 -3
  447. package/.next/types/routes.d.ts +3 -2
  448. package/.next/types/validator.ts +18 -9
  449. package/dist/server/server.js +58 -0
  450. package/dist/server/src/lib/claude-output.js +1 -0
  451. package/dist/server/src/lib/db/app-settings-db.js +60 -0
  452. package/dist/server/src/lib/db/chat-db.js +120 -7
  453. package/dist/server/src/lib/detection/status-detector.js +3 -2
  454. package/dist/server/src/lib/env.js +122 -0
  455. package/dist/server/src/lib/git/worktrees.js +154 -0
  456. package/dist/server/src/lib/history/transcript-tail.js +80 -0
  457. package/dist/server/src/lib/history/user-turn-recorder.js +252 -0
  458. package/dist/server/src/lib/hooks/agent-event-service.js +40 -6
  459. package/dist/server/src/lib/hooks/permission-decision-service.js +85 -1
  460. package/dist/server/src/lib/hooks/sources/antigravity/history.js +607 -0
  461. package/dist/server/src/lib/hooks/sources/antigravity/source.js +7 -0
  462. package/dist/server/src/lib/hooks/sources/antigravity/transcript.js +407 -0
  463. package/dist/server/src/lib/hooks/sources/claude/history.js +797 -0
  464. package/dist/server/src/lib/hooks/sources/claude/source.js +4 -0
  465. package/dist/server/src/lib/hooks/sources/claude/transcript.js +518 -0
  466. package/dist/server/src/lib/hooks/sources/codex/history.js +663 -0
  467. package/dist/server/src/lib/hooks/sources/codex/source.js +4 -0
  468. package/dist/server/src/lib/hooks/sources/codex/transcript.js +448 -0
  469. package/dist/server/src/lib/hooks/sources/copilot/source.js +2 -0
  470. package/dist/server/src/lib/hooks/sources/gemini/source.js +2 -0
  471. package/dist/server/src/lib/hooks/sources/legacy-relay.js +3 -0
  472. package/dist/server/src/lib/hooks/sources/opencode/history.js +57 -0
  473. package/dist/server/src/lib/hooks/sources/opencode/source.js +4 -0
  474. package/dist/server/src/lib/hooks/sources/opencode/transcript.js +10 -28
  475. package/dist/server/src/lib/hooks/sources/turn-body.js +118 -0
  476. package/dist/server/src/lib/hooks/stop-history-capture.js +161 -0
  477. package/dist/server/src/lib/polling/prompt-dedup.js +2 -4
  478. package/dist/server/src/lib/polling/response-checker.js +87 -6
  479. package/dist/server/src/lib/polling/response-dedup.js +2 -4
  480. package/dist/server/src/lib/polling/response-poller-core.js +191 -29
  481. package/dist/server/src/lib/polling/structured-history-gate.js +272 -16
  482. package/dist/server/src/lib/push/push-sender.js +21 -1
  483. package/dist/server/src/lib/push/waiting-push-notifier.js +126 -8
  484. package/dist/server/src/lib/realtime/publisher-registry.js +171 -0
  485. package/dist/server/src/lib/realtime/terminal-broadcast.js +14 -1
  486. package/dist/server/src/lib/realtime/types.js +96 -1
  487. package/dist/server/src/lib/session/current-output-builder.js +365 -4
  488. package/dist/server/src/lib/session/send-user-message.js +90 -2
  489. package/dist/server/src/lib/tui-accumulator.js +2 -8
  490. package/dist/server/src/lib/ws-server.js +143 -6
  491. package/dist/server/src/types/agent-transcript.js +241 -5
  492. package/dist/server/src/types/ui-state.js +24 -1
  493. package/package.json +1 -1
  494. package/public/sw.js +15 -1
  495. package/.next/server/app/api/worktrees/[id]/start-polling/route.js +0 -1
  496. package/.next/server/app/api/worktrees/[id]/start-polling/route.js.nft.json +0 -1
  497. package/.next/server/app/api/worktrees/[id]/start-polling/route_client-reference-manifest.js +0 -1
  498. package/.next/server/chunks/1714.js +0 -7
  499. package/.next/server/chunks/2198.js +0 -1
  500. package/.next/server/chunks/221.js +0 -25
  501. package/.next/server/chunks/2759.js +0 -8
  502. package/.next/server/chunks/3558.js +0 -1
  503. package/.next/server/chunks/6781.js +0 -1
  504. package/.next/server/chunks/9508.js +0 -1
  505. package/.next/static/0YoRrahue4Vchxg1z83IQ/_buildManifest.js +0 -1
  506. package/.next/static/chunks/1379-af7af9e08f47c979.js +0 -1
  507. package/.next/static/chunks/6381-9ba5198c0a6ff197.js +0 -1
  508. package/.next/static/chunks/app/api/agents/update/route-1c30fb8d4d6fa6ef.js +0 -1
  509. package/.next/static/chunks/app/api/agents/versions/route-1c30fb8d4d6fa6ef.js +0 -1
  510. package/.next/static/chunks/app/api/app/update/route-1c30fb8d4d6fa6ef.js +0 -1
  511. package/.next/static/chunks/app/api/app/update-check/route-1c30fb8d4d6fa6ef.js +0 -1
  512. package/.next/static/chunks/app/api/assistant/conversation/route-1c30fb8d4d6fa6ef.js +0 -1
  513. package/.next/static/chunks/app/api/assistant/current-output/route-1c30fb8d4d6fa6ef.js +0 -1
  514. package/.next/static/chunks/app/api/assistant/messages/route-1c30fb8d4d6fa6ef.js +0 -1
  515. package/.next/static/chunks/app/api/assistant/session/route-1c30fb8d4d6fa6ef.js +0 -1
  516. package/.next/static/chunks/app/api/assistant/start/route-1c30fb8d4d6fa6ef.js +0 -1
  517. package/.next/static/chunks/app/api/assistant/terminal/route-1c30fb8d4d6fa6ef.js +0 -1
  518. package/.next/static/chunks/app/api/assistant/tools/route-1c30fb8d4d6fa6ef.js +0 -1
  519. package/.next/static/chunks/app/api/auth/login/route-1c30fb8d4d6fa6ef.js +0 -1
  520. package/.next/static/chunks/app/api/auth/logout/route-1c30fb8d4d6fa6ef.js +0 -1
  521. package/.next/static/chunks/app/api/auth/status/route-1c30fb8d4d6fa6ef.js +0 -1
  522. package/.next/static/chunks/app/api/capabilities/route-1c30fb8d4d6fa6ef.js +0 -1
  523. package/.next/static/chunks/app/api/daily-summary/route-1c30fb8d4d6fa6ef.js +0 -1
  524. package/.next/static/chunks/app/api/daily-summary/status/route-1c30fb8d4d6fa6ef.js +0 -1
  525. package/.next/static/chunks/app/api/external-apps/[id]/health/route-1c30fb8d4d6fa6ef.js +0 -1
  526. package/.next/static/chunks/app/api/external-apps/[id]/route-1c30fb8d4d6fa6ef.js +0 -1
  527. package/.next/static/chunks/app/api/external-apps/route-1c30fb8d4d6fa6ef.js +0 -1
  528. package/.next/static/chunks/app/api/fs/browse/route-1c30fb8d4d6fa6ef.js +0 -1
  529. package/.next/static/chunks/app/api/fs/recent-paths/route-1c30fb8d4d6fa6ef.js +0 -1
  530. package/.next/static/chunks/app/api/hooks/agent-event/route-1c30fb8d4d6fa6ef.js +0 -1
  531. package/.next/static/chunks/app/api/hooks/claude-done/route-1c30fb8d4d6fa6ef.js +0 -1
  532. package/.next/static/chunks/app/api/hooks/permission-request/route-1c30fb8d4d6fa6ef.js +0 -1
  533. package/.next/static/chunks/app/api/metrics/vibe/route-1c30fb8d4d6fa6ef.js +0 -1
  534. package/.next/static/chunks/app/api/ollama/models/route-1c30fb8d4d6fa6ef.js +0 -1
  535. package/.next/static/chunks/app/api/push/escalation/route-1c30fb8d4d6fa6ef.js +0 -1
  536. package/.next/static/chunks/app/api/push/subscriptions/route-1c30fb8d4d6fa6ef.js +0 -1
  537. package/.next/static/chunks/app/api/push/vapid/route-1c30fb8d4d6fa6ef.js +0 -1
  538. package/.next/static/chunks/app/api/remote/pair/route-1c30fb8d4d6fa6ef.js +0 -1
  539. package/.next/static/chunks/app/api/repositories/[id]/route-1c30fb8d4d6fa6ef.js +0 -1
  540. package/.next/static/chunks/app/api/repositories/[id]/todos/[todoId]/route-1c30fb8d4d6fa6ef.js +0 -1
  541. package/.next/static/chunks/app/api/repositories/[id]/todos/route-1c30fb8d4d6fa6ef.js +0 -1
  542. package/.next/static/chunks/app/api/repositories/clone/[jobId]/route-1c30fb8d4d6fa6ef.js +0 -1
  543. package/.next/static/chunks/app/api/repositories/clone/route-1c30fb8d4d6fa6ef.js +0 -1
  544. package/.next/static/chunks/app/api/repositories/excluded/route-1c30fb8d4d6fa6ef.js +0 -1
  545. package/.next/static/chunks/app/api/repositories/restore/route-1c30fb8d4d6fa6ef.js +0 -1
  546. package/.next/static/chunks/app/api/repositories/route-1c30fb8d4d6fa6ef.js +0 -1
  547. package/.next/static/chunks/app/api/repositories/scan/route-1c30fb8d4d6fa6ef.js +0 -1
  548. package/.next/static/chunks/app/api/repositories/sync/route-1c30fb8d4d6fa6ef.js +0 -1
  549. package/.next/static/chunks/app/api/repositories/validate-path/route-1c30fb8d4d6fa6ef.js +0 -1
  550. package/.next/static/chunks/app/api/settings/default-agents/route-1c30fb8d4d6fa6ef.js +0 -1
  551. package/.next/static/chunks/app/api/sidebar/group-order/route-1c30fb8d4d6fa6ef.js +0 -1
  552. package/.next/static/chunks/app/api/skills/[id]/route-1c30fb8d4d6fa6ef.js +0 -1
  553. package/.next/static/chunks/app/api/skills/installations/route-1c30fb8d4d6fa6ef.js +0 -1
  554. package/.next/static/chunks/app/api/skills/operations/route-1c30fb8d4d6fa6ef.js +0 -1
  555. package/.next/static/chunks/app/api/skills/reindex/route-1c30fb8d4d6fa6ef.js +0 -1
  556. package/.next/static/chunks/app/api/skills/route-1c30fb8d4d6fa6ef.js +0 -1
  557. package/.next/static/chunks/app/api/slash-commands/route-1c30fb8d4d6fa6ef.js +0 -1
  558. package/.next/static/chunks/app/api/tasks/[taskId]/cancel/route-1c30fb8d4d6fa6ef.js +0 -1
  559. package/.next/static/chunks/app/api/tasks/[taskId]/route-1c30fb8d4d6fa6ef.js +0 -1
  560. package/.next/static/chunks/app/api/templates/[id]/route-1c30fb8d4d6fa6ef.js +0 -1
  561. package/.next/static/chunks/app/api/templates/route-1c30fb8d4d6fa6ef.js +0 -1
  562. package/.next/static/chunks/app/api/todos/route-1c30fb8d4d6fa6ef.js +0 -1
  563. package/.next/static/chunks/app/api/verification/runs/[runId]/route-1c30fb8d4d6fa6ef.js +0 -1
  564. package/.next/static/chunks/app/api/verification/runs/route-1c30fb8d4d6fa6ef.js +0 -1
  565. package/.next/static/chunks/app/api/worktrees/[id]/auto-yes/route-1c30fb8d4d6fa6ef.js +0 -1
  566. package/.next/static/chunks/app/api/worktrees/[id]/capture/route-1c30fb8d4d6fa6ef.js +0 -1
  567. package/.next/static/chunks/app/api/worktrees/[id]/clear-composer/route-1c30fb8d4d6fa6ef.js +0 -1
  568. package/.next/static/chunks/app/api/worktrees/[id]/cli-tool/route-1c30fb8d4d6fa6ef.js +0 -1
  569. package/.next/static/chunks/app/api/worktrees/[id]/cmate/schedules/route-1c30fb8d4d6fa6ef.js +0 -1
  570. package/.next/static/chunks/app/api/worktrees/[id]/current-output/route-1c30fb8d4d6fa6ef.js +0 -1
  571. package/.next/static/chunks/app/api/worktrees/[id]/env/route-1c30fb8d4d6fa6ef.js +0 -1
  572. package/.next/static/chunks/app/api/worktrees/[id]/execution-logs/[logId]/route-1c30fb8d4d6fa6ef.js +0 -1
  573. package/.next/static/chunks/app/api/worktrees/[id]/execution-logs/route-1c30fb8d4d6fa6ef.js +0 -1
  574. package/.next/static/chunks/app/api/worktrees/[id]/files/[...path]/route-1c30fb8d4d6fa6ef.js +0 -1
  575. package/.next/static/chunks/app/api/worktrees/[id]/git/branch/create/route-1c30fb8d4d6fa6ef.js +0 -1
  576. package/.next/static/chunks/app/api/worktrees/[id]/git/branch/delete/route-1c30fb8d4d6fa6ef.js +0 -1
  577. package/.next/static/chunks/app/api/worktrees/[id]/git/branches/route-1c30fb8d4d6fa6ef.js +0 -1
  578. package/.next/static/chunks/app/api/worktrees/[id]/git/checkout/route-1c30fb8d4d6fa6ef.js +0 -1
  579. package/.next/static/chunks/app/api/worktrees/[id]/git/commit/route-1c30fb8d4d6fa6ef.js +0 -1
  580. package/.next/static/chunks/app/api/worktrees/[id]/git/diff/route-1c30fb8d4d6fa6ef.js +0 -1
  581. package/.next/static/chunks/app/api/worktrees/[id]/git/fetch/route-1c30fb8d4d6fa6ef.js +0 -1
  582. package/.next/static/chunks/app/api/worktrees/[id]/git/log/route-1c30fb8d4d6fa6ef.js +0 -1
  583. package/.next/static/chunks/app/api/worktrees/[id]/git/pull/route-1c30fb8d4d6fa6ef.js +0 -1
  584. package/.next/static/chunks/app/api/worktrees/[id]/git/push/route-1c30fb8d4d6fa6ef.js +0 -1
  585. package/.next/static/chunks/app/api/worktrees/[id]/git/reset/route-1c30fb8d4d6fa6ef.js +0 -1
  586. package/.next/static/chunks/app/api/worktrees/[id]/git/revert/route-1c30fb8d4d6fa6ef.js +0 -1
  587. package/.next/static/chunks/app/api/worktrees/[id]/git/show/[commitHash]/route-1c30fb8d4d6fa6ef.js +0 -1
  588. package/.next/static/chunks/app/api/worktrees/[id]/git/stage/route-1c30fb8d4d6fa6ef.js +0 -1
  589. package/.next/static/chunks/app/api/worktrees/[id]/git/staged/route-1c30fb8d4d6fa6ef.js +0 -1
  590. package/.next/static/chunks/app/api/worktrees/[id]/git/stash/[index]/route-1c30fb8d4d6fa6ef.js +0 -1
  591. package/.next/static/chunks/app/api/worktrees/[id]/git/stash/apply/route-1c30fb8d4d6fa6ef.js +0 -1
  592. package/.next/static/chunks/app/api/worktrees/[id]/git/stash/pop/route-1c30fb8d4d6fa6ef.js +0 -1
  593. package/.next/static/chunks/app/api/worktrees/[id]/git/stash/push/route-1c30fb8d4d6fa6ef.js +0 -1
  594. package/.next/static/chunks/app/api/worktrees/[id]/git/stash/route-1c30fb8d4d6fa6ef.js +0 -1
  595. package/.next/static/chunks/app/api/worktrees/[id]/git/status/route-1c30fb8d4d6fa6ef.js +0 -1
  596. package/.next/static/chunks/app/api/worktrees/[id]/git/unstage/route-1c30fb8d4d6fa6ef.js +0 -1
  597. package/.next/static/chunks/app/api/worktrees/[id]/git/working-diff/route-1c30fb8d4d6fa6ef.js +0 -1
  598. package/.next/static/chunks/app/api/worktrees/[id]/instances/opencode/route-1c30fb8d4d6fa6ef.js +0 -1
  599. package/.next/static/chunks/app/api/worktrees/[id]/interrupt/route-1c30fb8d4d6fa6ef.js +0 -1
  600. package/.next/static/chunks/app/api/worktrees/[id]/kill-session/route-1c30fb8d4d6fa6ef.js +0 -1
  601. package/.next/static/chunks/app/api/worktrees/[id]/logs/[filename]/route-1c30fb8d4d6fa6ef.js +0 -1
  602. package/.next/static/chunks/app/api/worktrees/[id]/logs/route-1c30fb8d4d6fa6ef.js +0 -1
  603. package/.next/static/chunks/app/api/worktrees/[id]/marp-render/route-1c30fb8d4d6fa6ef.js +0 -1
  604. package/.next/static/chunks/app/api/worktrees/[id]/memos/[memoId]/route-1c30fb8d4d6fa6ef.js +0 -1
  605. package/.next/static/chunks/app/api/worktrees/[id]/memos/route-1c30fb8d4d6fa6ef.js +0 -1
  606. package/.next/static/chunks/app/api/worktrees/[id]/messages/route-1c30fb8d4d6fa6ef.js +0 -1
  607. package/.next/static/chunks/app/api/worktrees/[id]/opencode/diff/route-1c30fb8d4d6fa6ef.js +0 -1
  608. package/.next/static/chunks/app/api/worktrees/[id]/opencode/session/route-1c30fb8d4d6fa6ef.js +0 -1
  609. package/.next/static/chunks/app/api/worktrees/[id]/opencode/share/route-1c30fb8d4d6fa6ef.js +0 -1
  610. package/.next/static/chunks/app/api/worktrees/[id]/prompt-response/route-1c30fb8d4d6fa6ef.js +0 -1
  611. package/.next/static/chunks/app/api/worktrees/[id]/resolve-target/route-1c30fb8d4d6fa6ef.js +0 -1
  612. package/.next/static/chunks/app/api/worktrees/[id]/respond/route-1c30fb8d4d6fa6ef.js +0 -1
  613. package/.next/static/chunks/app/api/worktrees/[id]/route-1c30fb8d4d6fa6ef.js +0 -1
  614. package/.next/static/chunks/app/api/worktrees/[id]/schedules/[scheduleId]/route-1c30fb8d4d6fa6ef.js +0 -1
  615. package/.next/static/chunks/app/api/worktrees/[id]/schedules/active/route-1c30fb8d4d6fa6ef.js +0 -1
  616. package/.next/static/chunks/app/api/worktrees/[id]/schedules/route-1c30fb8d4d6fa6ef.js +0 -1
  617. package/.next/static/chunks/app/api/worktrees/[id]/search/route-1c30fb8d4d6fa6ef.js +0 -1
  618. package/.next/static/chunks/app/api/worktrees/[id]/send/route-1c30fb8d4d6fa6ef.js +0 -1
  619. package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route-1c30fb8d4d6fa6ef.js +0 -1
  620. package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/install/route-1c30fb8d4d6fa6ef.js +0 -1
  621. package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/plan/route-1c30fb8d4d6fa6ef.js +0 -1
  622. package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/uninstall/route-1c30fb8d4d6fa6ef.js +0 -1
  623. package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/uninstall-plan/route-1c30fb8d4d6fa6ef.js +0 -1
  624. package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/update/route-1c30fb8d4d6fa6ef.js +0 -1
  625. package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/update-plan/route-1c30fb8d4d6fa6ef.js +0 -1
  626. package/.next/static/chunks/app/api/worktrees/[id]/skills/route-1c30fb8d4d6fa6ef.js +0 -1
  627. package/.next/static/chunks/app/api/worktrees/[id]/slash-commands/route-1c30fb8d4d6fa6ef.js +0 -1
  628. package/.next/static/chunks/app/api/worktrees/[id]/special-keys/route-1c30fb8d4d6fa6ef.js +0 -1
  629. package/.next/static/chunks/app/api/worktrees/[id]/start-polling/route-1c30fb8d4d6fa6ef.js +0 -1
  630. package/.next/static/chunks/app/api/worktrees/[id]/tasks/route-1c30fb8d4d6fa6ef.js +0 -1
  631. package/.next/static/chunks/app/api/worktrees/[id]/terminal/route-1c30fb8d4d6fa6ef.js +0 -1
  632. package/.next/static/chunks/app/api/worktrees/[id]/timers/history/route-1c30fb8d4d6fa6ef.js +0 -1
  633. package/.next/static/chunks/app/api/worktrees/[id]/timers/route-1c30fb8d4d6fa6ef.js +0 -1
  634. package/.next/static/chunks/app/api/worktrees/[id]/todos/[todoId]/route-1c30fb8d4d6fa6ef.js +0 -1
  635. package/.next/static/chunks/app/api/worktrees/[id]/todos/route-1c30fb8d4d6fa6ef.js +0 -1
  636. package/.next/static/chunks/app/api/worktrees/[id]/tree/[...path]/route-1c30fb8d4d6fa6ef.js +0 -1
  637. package/.next/static/chunks/app/api/worktrees/[id]/tree/route-1c30fb8d4d6fa6ef.js +0 -1
  638. package/.next/static/chunks/app/api/worktrees/[id]/upload/[...path]/route-1c30fb8d4d6fa6ef.js +0 -1
  639. package/.next/static/chunks/app/api/worktrees/[id]/verify/config/route-1c30fb8d4d6fa6ef.js +0 -1
  640. package/.next/static/chunks/app/api/worktrees/[id]/verify/route-1c30fb8d4d6fa6ef.js +0 -1
  641. package/.next/static/chunks/app/api/worktrees/[id]/verify/runs/[runId]/cancel/route-1c30fb8d4d6fa6ef.js +0 -1
  642. package/.next/static/chunks/app/api/worktrees/[id]/verify/runs/[runId]/route-1c30fb8d4d6fa6ef.js +0 -1
  643. package/.next/static/chunks/app/api/worktrees/[id]/verify/runs/route-1c30fb8d4d6fa6ef.js +0 -1
  644. package/.next/static/chunks/app/api/worktrees/[id]/viewed/route-1c30fb8d4d6fa6ef.js +0 -1
  645. package/.next/static/chunks/app/api/worktrees/apply-default-agents/route-1c30fb8d4d6fa6ef.js +0 -1
  646. package/.next/static/chunks/app/api/worktrees/route-1c30fb8d4d6fa6ef.js +0 -1
  647. package/.next/static/chunks/app/manifest.webmanifest/route-1c30fb8d4d6fa6ef.js +0 -1
  648. package/.next/static/chunks/app/proxy/[...path]/route-1c30fb8d4d6fa6ef.js +0 -1
  649. package/.next/static/chunks/app/worktrees/[id]/layout-1c30fb8d4d6fa6ef.js +0 -1
  650. package/.next/static/chunks/app/worktrees/[id]/page-ce6279d581d1df95.js +0 -1
  651. package/.next/static/chunks/app/worktrees/[id]/terminal/page-00ad5d9a62a71cab.js +0 -1
  652. package/.next/static/css/b326c8a734e1928e.css +0 -1
  653. /package/.next/static/{0YoRrahue4Vchxg1z83IQ → pcpB4K6KreMzu2qbhvuRY}/_ssgManifest.js +0 -0
@@ -7,18 +7,55 @@
7
7
  * over WebSocket (terminal streaming), keeping the pull (HTTP) and push (WS)
8
8
  * paths byte-for-byte consistent (DRY).
9
9
  */
10
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ var desc = Object.getOwnPropertyDescriptor(m, k);
13
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
14
+ desc = { enumerable: true, get: function() { return m[k]; } };
15
+ }
16
+ Object.defineProperty(o, k2, desc);
17
+ }) : (function(o, m, k, k2) {
18
+ if (k2 === undefined) k2 = k;
19
+ o[k2] = m[k];
20
+ }));
21
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
22
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
23
+ }) : function(o, v) {
24
+ o["default"] = v;
25
+ });
26
+ var __importStar = (this && this.__importStar) || (function () {
27
+ var ownKeys = function(o) {
28
+ ownKeys = Object.getOwnPropertyNames || function (o) {
29
+ var ar = [];
30
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
31
+ return ar;
32
+ };
33
+ return ownKeys(o);
34
+ };
35
+ return function (mod) {
36
+ if (mod && mod.__esModule) return mod;
37
+ var result = {};
38
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
39
+ __setModuleDefault(result, mod);
40
+ return result;
41
+ };
42
+ })();
10
43
  Object.defineProperty(exports, "__esModule", { value: true });
11
44
  exports.mergeStructuredStatus = mergeStructuredStatus;
12
45
  exports.buildCurrentOutput = buildCurrentOutput;
46
+ exports.resetChatTurnProgressState = resetChatTurnProgressState;
47
+ exports.buildChatTurnProgress = buildChatTurnProgress;
48
+ exports.emitChatTurnProgress = emitChatTurnProgress;
13
49
  const db_1 = require("../../lib/db");
14
50
  const unclassified_frame_tracker_1 = require("../../lib/detection/unclassified-frame-tracker");
15
51
  const composer_text_1 = require("../../lib/detection/composer-text");
16
52
  const upstream_faults_1 = require("../../lib/detection/upstream-faults");
17
53
  const opencode_pane_obstruction_1 = require("../../lib/detection/opencode-pane-obstruction");
54
+ const types_1 = require("../../lib/realtime/types");
18
55
  const models_1 = require("../../types/models");
19
56
  const logger_1 = require("../../lib/logger");
20
57
  const manager_1 = require("../../lib/cli-tools/manager");
21
- const types_1 = require("../../lib/cli-tools/types");
58
+ const types_2 = require("../../lib/cli-tools/types");
22
59
  const registry_1 = require("../../lib/hooks/sources/registry");
23
60
  const define_source_1 = require("../../lib/hooks/sources/define-source");
24
61
  const subscription_1 = require("../../lib/hooks/sources/opencode/subscription");
@@ -93,6 +130,44 @@ function describePaneObstruction(obstruction) {
93
130
  `${JSON.stringify(obstruction.matchedText)}), which covers the marker that ends a ` +
94
131
  `turn. Press \`${opencode_pane_obstruction_1.OPENCODE_SIDEBAR_RECOVERY_CHORD}\` in the pane to close it.`);
95
132
  }
133
+ /**
134
+ * Push a history row this module just wrote to the worktree room (Issue #2214).
135
+ *
136
+ * Always `'message'`: both callers INSERT a brand-new row, so nothing has been
137
+ * delivered for it before and the client appends rather than replaces.
138
+ *
139
+ * Detached on purpose, and for two reasons that both matter here:
140
+ *
141
+ * - the `ws-server` import stays dynamic, which is the same bargain
142
+ * {@link emitChatTurnProgress} strikes — this module's *other* callers (the
143
+ * `/current-output` route and the terminal push) must not pull the WebSocket
144
+ * server into their graph just by building a payload;
145
+ * - the row is already committed when this runs, so a socket write can never
146
+ * turn a written row into a failed one. The two record functions below are
147
+ * best-effort by contract and their callers are waiting on a payload.
148
+ *
149
+ * #2214 recorded a limitation here — a route bundle holding its own empty copy
150
+ * of `ws-server`'s `rooms` under `next dev` — and added that "production runs
151
+ * one custom-server bundle and is unaffected". **That last clause was wrong.**
152
+ * `npm run dev` and `npm start` run the *same* custom server (`tsx server.ts`
153
+ * vs `node dist/server/server.js`); what differs is only whether Next evaluates
154
+ * a route handler from a dev compilation or from `.next/server`. Either way the
155
+ * route handler's copy of this module and of `ws-server` is not the custom
156
+ * server's, so this push was silent in production too. #2220 bridged it: the
157
+ * `broadcastMessage` below now reaches the socket owner through
158
+ * `lib/realtime/publisher-registry` regardless of which graph called it.
159
+ */
160
+ function broadcastRecordedRow(worktreeId, message) {
161
+ void Promise.resolve().then(() => __importStar(require('../../lib/ws-server'))).then(({ broadcastMessage }) => {
162
+ broadcastMessage('message', { worktreeId, message });
163
+ })
164
+ .catch((error) => {
165
+ logger.warn('history-row-broadcast-failed', {
166
+ worktreeId,
167
+ error: error instanceof Error ? error.message : String(error),
168
+ });
169
+ });
170
+ }
96
171
  function recordUnclassifiedFrame(db, params) {
97
172
  const dwellSeconds = Math.round(params.dwellMs / 1000);
98
173
  const statusReason = `${params.sessionStatus}/${params.sessionStatusReason}`;
@@ -114,7 +189,7 @@ function recordUnclassifiedFrame(db, params) {
114
189
  sessionStatusReason: statusReason,
115
190
  };
116
191
  try {
117
- (0, db_1.createMessage)(db, {
192
+ const message = (0, db_1.createMessage)(db, {
118
193
  worktreeId: params.worktreeId,
119
194
  role: 'assistant',
120
195
  content: question,
@@ -133,6 +208,10 @@ function recordUnclassifiedFrame(db, params) {
133
208
  dwellSeconds,
134
209
  statusReason,
135
210
  });
211
+ // `cliToolId` / `instanceId` are already the explicit values passed above —
212
+ // `createMessage` hands back the caller's own object — so the published row
213
+ // addresses the same instance the column does.
214
+ broadcastRecordedRow(params.worktreeId, message);
136
215
  }
137
216
  catch (error) {
138
217
  logger.warn('unclassified-frame-record-failed', {
@@ -166,7 +245,7 @@ function recordUnclassifiedFrame(db, params) {
166
245
  function recordStructuredPrompt(db, params) {
167
246
  const record = (0, structured_prompt_1.buildStructuredPromptHistoryRecord)(params.worktreeId, params.facts);
168
247
  try {
169
- (0, db_1.createMessage)(db, {
248
+ const message = (0, db_1.createMessage)(db, {
170
249
  worktreeId: params.worktreeId,
171
250
  role: 'assistant',
172
251
  content: record.question,
@@ -187,6 +266,7 @@ function recordStructuredPrompt(db, params) {
187
266
  source: params.state.source,
188
267
  toolName: params.state.toolName,
189
268
  });
269
+ broadcastRecordedRow(params.worktreeId, message);
190
270
  }
191
271
  catch (error) {
192
272
  logger.warn('structured-prompt-record-failed', {
@@ -371,6 +451,22 @@ function hookClosedTurn(turn) {
371
451
  */
372
452
  async function buildCurrentOutput(db, worktreeId, cliToolId, instanceId, resolution) {
373
453
  const payload = await buildPayload(db, worktreeId, cliToolId, instanceId);
454
+ // Issue #2199. Fire-and-forget, and placed HERE rather than in the poller for
455
+ // one reason: this is the function both live paths run through. The WebSocket
456
+ // push calls it from `broadcastTerminalSnapshot` on every generating poller
457
+ // tick, and the HTTP `/current-output` poll calls it at the same cadence when
458
+ // the push is down — so the progress frames appear at whatever rate the
459
+ // surface is actually being watched at, which is exactly the property the
460
+ // terminal snapshot already has. Gated on the merged verdict (`'running'`, not
461
+ // the tmux-session-exists `isRunning`) so an idle pane reads no transcript.
462
+ if (payload.isRunning && payload.sessionStatus === 'running') {
463
+ // Issue #2248 made this an `await`, and it buys less than it looks like: the
464
+ // expensive half — the transcript read and the broadcast — is detached
465
+ // inside, so what is waited for is a worktree row and a Map lookup. What it
466
+ // buys is that the frame's outcome is logged against the tick that produced
467
+ // it rather than whenever the event loop got round to the detached tail.
468
+ await publishChatTurnProgress(db, worktreeId, cliToolId, instanceId);
469
+ }
374
470
  if (!resolution)
375
471
  return payload;
376
472
  return {
@@ -573,7 +669,7 @@ async function buildPayload(db, worktreeId, cliToolId, instanceId) {
573
669
  // value is the pane height, `slice()` starts past the last row, and `content`
574
670
  // — the field `commandmate capture <id>` prints — was an empty string.
575
671
  // `capturedLineCountIsCursor` states both conditions in one place.
576
- const lineCountIsCursor = (0, types_1.capturedLineCountIsCursor)(cliToolId, captureWindowSaturated);
672
+ const lineCountIsCursor = (0, types_2.capturedLineCountIsCursor)(cliToolId, captureWindowSaturated);
577
673
  const newLines = lineCountIsCursor ? lines.slice(Math.max(0, lastCapturedLine)) : lines;
578
674
  const newContent = newLines.join('\n');
579
675
  const compositeKey = (0, auto_yes_manager_1.buildCompositeKey)(worktreeId, cliToolId, instanceId);
@@ -946,3 +1042,268 @@ async function buildPayload(db, worktreeId, cliToolId, instanceId) {
946
1042
  composerState: composer.state,
947
1043
  };
948
1044
  }
1045
+ function newChatTurnProgressState() {
1046
+ return {
1047
+ version: 0,
1048
+ askedAt: Number.NEGATIVE_INFINITY,
1049
+ turnKey: null,
1050
+ body: null,
1051
+ loggedOutcome: null,
1052
+ loggedTurnKey: null,
1053
+ };
1054
+ }
1055
+ /**
1056
+ * On `globalThis` for the reason every shared map in this subsystem is (#1736):
1057
+ * under `next dev` the poller's bundle and the opencode subscription's bundle
1058
+ * would each get a private copy, and two producers throttling against two
1059
+ * different maps is no throttle at all.
1060
+ */
1061
+ const chatTurnProgressState = (globalThis.__chatTurnProgressState ??= new Map());
1062
+ function chatTurnProgressKey(target) {
1063
+ return `${target.worktreeId}:${target.cliToolId}:${target.instanceId ?? target.cliToolId}`;
1064
+ }
1065
+ /** Forget every instance's progress bookkeeping. Test seam. */
1066
+ function resetChatTurnProgressState() {
1067
+ chatTurnProgressState.clear();
1068
+ }
1069
+ /**
1070
+ * Say once, at info, what happened to this instance's progress frames (Issue #2248).
1071
+ *
1072
+ * ## Why info, and why this file had none
1073
+ *
1074
+ * Every outcome here was `logger.debug`, including the two that mean the reader
1075
+ * is watching a blank space: a push that threw, and a room with no subscribers.
1076
+ * Issue #2248 was opened after a live session where the body reached the browser
1077
+ * — or did not — and the server logs could not answer which, because debug is
1078
+ * off in the builds people run. An unobservable push is a feature that can only
1079
+ * be debugged by reproducing it.
1080
+ *
1081
+ * ## Why once
1082
+ *
1083
+ * The publisher runs on EVERY poll tick of a generating session. Logging each
1084
+ * tick at info would put a line per second per agent into the operator's log and
1085
+ * make the level useless, so this collapses a run of identical ticks into its
1086
+ * first: the outcome and the turn it happened on are the identity, and a repeat
1087
+ * of the pair says nothing the first line did not.
1088
+ *
1089
+ * The consequences of that identity, both deliberate:
1090
+ *
1091
+ * - **a new turn always logs**, because `turnKey` is part of the pair. That is
1092
+ * the acceptance criterion — one info line per turn — and the reason
1093
+ * `loggedTurnKey` exists at all rather than a bare boolean;
1094
+ * - **a CHANGE of outcome always logs**, so "the subscriber left" and "it
1095
+ * started failing" are both visible the tick they happen, without the
1096
+ * steady state that follows repeating them.
1097
+ *
1098
+ * `no-subscribers` and `failed` carry no turn key — neither knows one; the first
1099
+ * returns before the source is asked and the second is why there is no frame —
1100
+ * so for them the pair is `(outcome, null)` and the run collapses to one line
1101
+ * until something else happens.
1102
+ */
1103
+ function logChatTurnProgressOutcome(target, outcome, turnKey, extra = {}) {
1104
+ const key = chatTurnProgressKey(target);
1105
+ const state = chatTurnProgressState.get(key) ?? newChatTurnProgressState();
1106
+ chatTurnProgressState.set(key, state);
1107
+ if (state.loggedOutcome === outcome && state.loggedTurnKey === turnKey)
1108
+ return;
1109
+ state.loggedOutcome = outcome;
1110
+ state.loggedTurnKey = turnKey;
1111
+ // Written out rather than interpolated: these strings are what an operator
1112
+ // greps the log for, and an interpolated name cannot be found in the source.
1113
+ const message = outcome === 'published'
1114
+ ? 'chat-turn-progress-published'
1115
+ : outcome === 'no-subscribers'
1116
+ ? 'chat-turn-progress-no-subscribers'
1117
+ : 'chat-turn-progress-failed';
1118
+ logger.info(message, {
1119
+ worktreeId: target.worktreeId,
1120
+ cliToolId: target.cliToolId,
1121
+ instanceId: target.instanceId ?? target.cliToolId,
1122
+ turnKey,
1123
+ ...extra,
1124
+ });
1125
+ }
1126
+ /**
1127
+ * Decide whether this instance has a new progress frame, and build it.
1128
+ *
1129
+ * The single generator both tools go through, on the same argument
1130
+ * {@link buildCurrentOutput} makes for the terminal payload: two producers of one
1131
+ * wire shape drift, and the drift is invisible because each of them is
1132
+ * individually correct. Three rules, in this order, and each of them is a way
1133
+ * this feature goes wrong if it is missing:
1134
+ *
1135
+ * 1. **Throttle.** At most one *ask* per {@link CHAT_TURN_PROGRESS_MIN_INTERVAL_MS}
1136
+ * per instance. It gates the ask rather than the send because the source is
1137
+ * the expensive half (see {@link ChatTurnProgressSource}); a gate on the send
1138
+ * alone would re-read a 4 MiB transcript to discover it had not changed.
1139
+ * 2. **No-change suppression.** Same turn, same body → no frame. A reply that
1140
+ * has stopped growing must not keep waking every subscribed browser.
1141
+ * 3. **Monotonic version**, per instance and NOT per turn. A client drops
1142
+ * anything at or below what it has already rendered, and restarting the
1143
+ * counter on a new turn would make the first frame of turn N+1 look stale
1144
+ * against the last frame of turn N.
1145
+ *
1146
+ * The body is bounded by {@link truncateChatTurnProgressBody}, whose cut is
1147
+ * folded into `partial` together with the reader's own — see
1148
+ * {@link ChatTurnProgressEvent.partial} for why one flag answers both.
1149
+ *
1150
+ * Never throws: a source that throws is a turn with nothing to show, not a
1151
+ * broken poll tick.
1152
+ *
1153
+ * @param target - The instance
1154
+ * @param source - Asked only when the throttle allows it
1155
+ * @param now - Epoch ms; injected by the tests
1156
+ * @returns The frame to broadcast, or null when there is nothing new to say
1157
+ */
1158
+ async function buildChatTurnProgress(target, source, now = Date.now()) {
1159
+ const key = chatTurnProgressKey(target);
1160
+ const state = chatTurnProgressState.get(key) ?? newChatTurnProgressState();
1161
+ if (now - state.askedAt < types_1.CHAT_TURN_PROGRESS_MIN_INTERVAL_MS)
1162
+ return null;
1163
+ state.askedAt = now;
1164
+ chatTurnProgressState.set(key, state);
1165
+ let draft;
1166
+ try {
1167
+ draft = await source();
1168
+ }
1169
+ catch {
1170
+ // The readers already promise never to throw; this is the belt for the
1171
+ // dynamic import that reaches them.
1172
+ return null;
1173
+ }
1174
+ if (!draft || draft.body.length === 0)
1175
+ return null;
1176
+ const bounded = (0, types_1.truncateChatTurnProgressBody)(draft.body);
1177
+ if (draft.turnKey === state.turnKey && bounded.body === state.body)
1178
+ return null;
1179
+ state.turnKey = draft.turnKey;
1180
+ state.body = bounded.body;
1181
+ state.version += 1;
1182
+ return {
1183
+ type: types_1.CHAT_TURN_PROGRESS_EVENT_TYPE,
1184
+ worktreeId: target.worktreeId,
1185
+ cliToolId: target.cliToolId,
1186
+ instanceId: target.instanceId ?? target.cliToolId,
1187
+ turnKey: draft.turnKey,
1188
+ body: bounded.body,
1189
+ partial: bounded.truncated || draft.partial === true,
1190
+ version: state.version,
1191
+ done: false,
1192
+ };
1193
+ }
1194
+ /**
1195
+ * Build a progress frame and push it to the worktree room.
1196
+ *
1197
+ * Subscribers are checked FIRST, before the throttle state is touched and long
1198
+ * before the source is asked, so a session nobody is watching costs one map
1199
+ * lookup per tick — the same bargain `broadcastTerminalSnapshot` strikes, and
1200
+ * the reason a 4 MiB transcript read does not happen for every claude session on
1201
+ * the machine.
1202
+ *
1203
+ * The `ws-server` import is dynamic so this module's *other* callers — the
1204
+ * `/current-output` route and `commandmate capture` — do not pull the WebSocket
1205
+ * server into their graph just by building a payload.
1206
+ *
1207
+ * Never throws; a failed push is a moment of staleness on a surface that has the
1208
+ * settled row coming anyway.
1209
+ *
1210
+ * @returns Whether a frame was broadcast
1211
+ */
1212
+ async function emitChatTurnProgress(target, source, now = Date.now()) {
1213
+ try {
1214
+ const { broadcast, hasRoomSubscribers } = await Promise.resolve().then(() => __importStar(require('../../lib/ws-server')));
1215
+ if (!hasRoomSubscribers(target.worktreeId)) {
1216
+ // Issue #2248. Reported, not silent: "the body never reached the browser"
1217
+ // and "nobody was listening" look identical from a screenshot, and this is
1218
+ // the only place that can tell them apart.
1219
+ logChatTurnProgressOutcome(target, 'no-subscribers', null);
1220
+ return false;
1221
+ }
1222
+ const event = await buildChatTurnProgress(target, source, now);
1223
+ // Not logged: null is the throttle, an unchanged body, or a turn with no
1224
+ // text yet — the quiet, correct majority of ticks.
1225
+ if (!event)
1226
+ return false;
1227
+ broadcast(target.worktreeId, event);
1228
+ logChatTurnProgressOutcome(target, 'published', event.turnKey, {
1229
+ version: event.version,
1230
+ bodyLength: event.body.length,
1231
+ partial: event.partial,
1232
+ });
1233
+ return true;
1234
+ }
1235
+ catch (error) {
1236
+ logChatTurnProgressOutcome(target, 'failed', null, {
1237
+ error: error instanceof Error ? error.message : String(error),
1238
+ });
1239
+ return false;
1240
+ }
1241
+ }
1242
+ /**
1243
+ * Ask the tool that has a transcript for the body of its open turn (Issue #2199).
1244
+ *
1245
+ * claude only, and that is a statement about which tools have a *pull* reader
1246
+ * rather than a list to extend by hand. opencode's body arrives on its own SSE
1247
+ * stream and is published from `sources/opencode/history` at the moment a part
1248
+ * lands — polling for it here would be a second producer of the same frames.
1249
+ * codex and antigravity have neither, and stay on the indicator (#2197 / #2198).
1250
+ *
1251
+ * The reader is imported dynamically so `sources/claude/history` — and through
1252
+ * it `fs/promises`, the session-pointer latch and `user-turn-recorder` — stays
1253
+ * out of the module graph of the `/current-output` route and of `commandmate
1254
+ * capture`, both of which reach this file for a payload and nothing else.
1255
+ *
1256
+ * ## Which half the caller waits for (Issue #2248)
1257
+ *
1258
+ * The caller awaits the CHEAP half — the worktree row and "is anybody watching"
1259
+ * — and not the expensive one. That split is what `void` was protecting in the
1260
+ * first place: the 4 MiB transcript read, the JSONL parse, the render and the
1261
+ * broadcast still run detached, so no poll tick and no WebSocket snapshot waits
1262
+ * on them.
1263
+ *
1264
+ * What awaiting the prelude buys is the reason this Issue exists: the line that
1265
+ * says whether anybody received the frame is written while the tick it belongs
1266
+ * to is still the tick in progress. Left inside the detached half it landed
1267
+ * wherever the event loop happened to get to it, next to some unrelated
1268
+ * request's output, which is not a log an operator can read backwards.
1269
+ *
1270
+ * Never throws: `emitChatTurnProgress` swallows, and so does this.
1271
+ */
1272
+ async function publishChatTurnProgress(db, worktreeId, cliToolId, instanceId) {
1273
+ if (cliToolId !== 'claude')
1274
+ return;
1275
+ const target = { worktreeId, cliToolId, instanceId };
1276
+ try {
1277
+ // The slug the transcript directory is named after is a function of the
1278
+ // worktree's path, so the row is what makes the file findable at all. Read
1279
+ // before the throttle only because it is a single indexed lookup against a
1280
+ // connection this function was handed; everything expensive is behind the
1281
+ // gate.
1282
+ const { getWorktreeById } = await Promise.resolve().then(() => __importStar(require('../../lib/db/worktree-db')));
1283
+ const worktreePath = getWorktreeById(db, worktreeId)?.path;
1284
+ if (!worktreePath)
1285
+ return;
1286
+ // Issue #2248. Hoisted out of `emitChatTurnProgress` — which still makes the
1287
+ // same check for its other caller — so the answer, and the line that reports
1288
+ // it, are settled before this function returns. Costs one Map lookup on the
1289
+ // sessions nobody is watching, which is the bargain that was already being
1290
+ // struck one frame later.
1291
+ const { hasRoomSubscribers } = await Promise.resolve().then(() => __importStar(require('../../lib/ws-server')));
1292
+ if (!hasRoomSubscribers(worktreeId)) {
1293
+ logChatTurnProgressOutcome(target, 'no-subscribers', null);
1294
+ return;
1295
+ }
1296
+ // Detached on purpose: everything past this point is the transcript read.
1297
+ void emitChatTurnProgress(target, async () => {
1298
+ const { readClaudeTurnProgress } = await Promise.resolve().then(() => __importStar(require('../../lib/hooks/sources/claude/history')));
1299
+ return readClaudeTurnProgress({ worktreeId, cliToolId, instanceId: instanceId ?? cliToolId }, { worktreePath });
1300
+ });
1301
+ }
1302
+ catch (error) {
1303
+ // Issue #2248: the reader's half of the same failure — the worktree row or
1304
+ // one of the dynamic imports — on the same once-per-run gate as the push's.
1305
+ logChatTurnProgressOutcome(target, 'failed', null, {
1306
+ error: error instanceof Error ? error.message : String(error),
1307
+ });
1308
+ }
1309
+ }
@@ -14,7 +14,13 @@
14
14
  * 3. copilot /model command — Issue #576 (copilot only)
15
15
  * 4. send to CLI tool — image branch / ICLITool.sendMessage
16
16
  * 5. createMessage (role: 'user') — INSERT INTO chat_messages (History source)
17
+ * 5b. broadcastMessage('message') — Issue #2195, push the user row to every
18
+ * open pane (the send that produced it is
19
+ * not necessarily on this device)
17
20
  * 6. orphan deletion — remove prior duplicate after persist
21
+ * 6b. broadcastMessage( — Issue #2219, tell every open pane for
22
+ * 'messages_invalidated') this instance to re-read its history:
23
+ * a delete has no row to publish
18
24
  * 7. updateLastUserMessage
19
25
  * 8. clearInProgressMessageId
20
26
  * 9. startPolling — record the assistant response afterwards
@@ -30,6 +36,8 @@ const manager_1 = require("../../lib/cli-tools/manager");
30
36
  const types_1 = require("../../lib/cli-tools/types");
31
37
  const response_poller_1 = require("../../lib/polling/response-poller");
32
38
  const assistant_response_saver_1 = require("../../lib/assistant-response-saver");
39
+ const ws_server_1 = require("../../lib/ws-server");
40
+ const types_2 = require("../../lib/realtime/types");
33
41
  const logger_1 = require("../../lib/logger");
34
42
  const prompt_waiting_guard_1 = require("../../lib/session/prompt-waiting-guard");
35
43
  const opencode_1 = require("../../lib/cli-tools/opencode");
@@ -47,6 +55,14 @@ function getErrorMessage(error) {
47
55
  async function sendUserMessage(db, params) {
48
56
  const { worktreeId, content, cliToolId, instanceId, absoluteImagePath, copilotModel } = params;
49
57
  const messageType = params.messageType ?? 'normal';
58
+ /**
59
+ * The instance this send belongs to, resolved the way `createMessage` and
60
+ * `mapChatMessage` resolve it (Issue #868: the primary instance's id *is* the
61
+ * tool's id). Callers omit `instanceId` for the primary instance — the UI and
62
+ * the send API both do — so every scope decision below has to resolve it
63
+ * first or it is not scoped at all.
64
+ */
65
+ const resolvedInstanceId = instanceId ?? cliToolId;
50
66
  const cliTool = manager_1.CLIToolManager.getInstance().getTool(cliToolId);
51
67
  // Issue #1708: refuse before the first side effect. A prompt dialog does not
52
68
  // forward keystrokes to the agent — they accumulate in its own input line — so
@@ -94,12 +110,31 @@ async function sendUserMessage(db, params) {
94
110
  logger.error('failed-to-save-pending-assistant-response:', { error: getErrorMessage(error) });
95
111
  }
96
112
  // 2. Clean up orphaned user messages (Issue #379: duplicate message prevention).
97
- // If the most recent message for this cliToolId is a user message with the same
113
+ // If the most recent message for THIS INSTANCE is a user message with the same
98
114
  // content, the assistant never responded and the user is retrying. Remove it
99
115
  // (only after the retry message is persisted) to prevent duplicates.
116
+ //
117
+ // Issue #2219: the scope is `resolvedInstanceId`, not the caller's raw
118
+ // `instanceId`. `getMessages` filters on the instance *or* the tool, never
119
+ // both, so passing an omitted `instanceId` through fell back to the tool
120
+ // filter and made this search read the newest row of **every instance of that
121
+ // tool**. A primary-instance re-send whose text matched `claude-2`'s last user
122
+ // row therefore deleted a row belonging to another session — data loss, not a
123
+ // display delay, and invisible because the delete is best-effort and silent.
124
+ //
125
+ // `matchResolvedInstance` is what makes the fix safe rather than merely
126
+ // narrow: a bare `instance_id = ?` would hide every pre-#868 row (they carry
127
+ // NULL and read back as the primary instance), so the orphan they are would
128
+ // survive as a visible duplicate. Same expression as #2196's
129
+ // `findUnkeyedUserMessages`.
100
130
  let orphanedMessageIdToDelete = null;
101
131
  try {
102
- const recentMessages = (0, db_1.getMessages)(db, worktreeId, { limit: 1, cliToolId, instanceId });
132
+ const recentMessages = (0, db_1.getMessages)(db, worktreeId, {
133
+ limit: 1,
134
+ cliToolId,
135
+ instanceId: resolvedInstanceId,
136
+ matchResolvedInstance: true,
137
+ });
103
138
  if (recentMessages.length > 0 &&
104
139
  recentMessages[0].role === 'user' &&
105
140
  recentMessages[0].content === content) {
@@ -169,6 +204,31 @@ async function sendUserMessage(db, params) {
169
204
  cliToolId,
170
205
  instanceId,
171
206
  });
207
+ // 5b. Broadcast the user row (Issue #2195).
208
+ //
209
+ // Every other history writer already does this; this one did not, so a second
210
+ // device (or a second pane on the same device) saw a message it did not send
211
+ // only on its next poll — and #2195 stretches that poll to 15s while a socket
212
+ // is up, which would have made the omission three times as visible.
213
+ //
214
+ // `createMessage` hands back the caller's own object rather than re-reading
215
+ // the row, so `instanceId` here would be `undefined` whenever the caller
216
+ // omitted it. It is resolved to the primary instance (=== cliToolId) exactly
217
+ // as `createMessage` resolves it for the column, so the client's
218
+ // (worktreeId, cliToolId, instanceId) match cannot miss.
219
+ //
220
+ // Wrapped because the message is already sent and already persisted by this
221
+ // point: a socket write that throws must not turn a successful send into a
222
+ // failure the caller reports to the user.
223
+ try {
224
+ (0, ws_server_1.broadcastMessage)('message', {
225
+ worktreeId,
226
+ message: { ...message, cliToolId, instanceId: resolvedInstanceId },
227
+ });
228
+ }
229
+ catch (error) {
230
+ logger.warn('user-message-broadcast-failed', { error: getErrorMessage(error) });
231
+ }
172
232
  // 6. Remove the prior orphan only after the retry message is persisted.
173
233
  // This avoids data loss if send/create fails partway through.
174
234
  if (orphanedMessageIdToDelete) {
@@ -176,6 +236,34 @@ async function sendUserMessage(db, params) {
176
236
  const deleted = (0, db_1.deleteMessageById)(db, orphanedMessageIdToDelete);
177
237
  if (deleted) {
178
238
  logger.info('cleaned-up-orphaned-user');
239
+ // 6b. Issue #2219: publish the delete.
240
+ //
241
+ // The `message` frame above told every pane about the row that was
242
+ // added; nothing told them about the row that went away, because the
243
+ // event contract has no shape for a deletion — `message_updated` can
244
+ // only say what a row now looks like. A second device therefore kept
245
+ // showing the old copy next to the new one until its own poll, which
246
+ // #2195 demoted to a 15s fallback while a socket is up.
247
+ //
248
+ // A scope rather than an id: the receiver re-reads its history, so it
249
+ // lands on the settled DB state and a `message` frame that was dropped
250
+ // on the way is repaired by the same round trip. See
251
+ // MESSAGES_INVALIDATED_EVENT_TYPE.
252
+ //
253
+ // Wrapped separately from the delete: the row is already gone by now,
254
+ // and #379's cleanup has always been best-effort — a socket write that
255
+ // throws must not turn a completed send into a reported failure.
256
+ try {
257
+ (0, ws_server_1.broadcastMessage)(types_2.MESSAGES_INVALIDATED_EVENT_TYPE, {
258
+ worktreeId,
259
+ cliToolId,
260
+ instanceId: resolvedInstanceId,
261
+ reason: 'orphan_cleanup',
262
+ });
263
+ }
264
+ catch (error) {
265
+ logger.warn('orphan-cleanup-broadcast-failed', { error: getErrorMessage(error) });
266
+ }
179
267
  }
180
268
  }
181
269
  catch (error) {
@@ -26,14 +26,8 @@ const cli_patterns_1 = require("./detection/cli-patterns");
26
26
  * fingerprint for overlap detection with the next capture.
27
27
  */
28
28
  const OVERLAP_FINGERPRINT_SIZE = 10;
29
- /**
30
- * Per-session TUI response accumulator storage.
31
- * Key: pollerKey ("worktreeId:cliToolId")
32
- *
33
- * Module-scope variable (not globalThis). Node.js module cache ensures
34
- * singleton behavior. See D3-004 in design policy for details.
35
- */
36
- const tuiResponseAccumulator = new Map();
29
+ const tuiResponseAccumulator = globalThis.__tuiResponseAccumulator ??
30
+ (globalThis.__tuiResponseAccumulator = new Map());
37
31
  /**
38
32
  * Normalize a single OpenCode TUI line by removing ANSI codes and border glyphs.
39
33
  * Returns an empty string when the line has no meaningful content after cleanup.