commandmate 0.29.2 → 0.30.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 (647) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-build-manifest.json +278 -271
  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]/{start-polling → cli-reference}/route_client-reference-manifest.js +1 -1
  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 +12 -12
  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/2827.js +29 -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/5120.js +1 -0
  271. package/.next/server/chunks/6130.js +1 -1
  272. package/.next/server/chunks/6337.js +1 -1
  273. package/.next/server/chunks/663.js +1 -1
  274. package/.next/server/chunks/6894.js +8 -0
  275. package/.next/server/chunks/7685.js +1 -1
  276. package/.next/server/chunks/7836.js +1 -0
  277. package/.next/server/chunks/8356.js +1 -1
  278. package/.next/server/chunks/880.js +1 -1
  279. package/.next/server/chunks/8807.js +1 -1
  280. package/.next/server/chunks/9123.js +2 -2
  281. package/.next/server/chunks/9130.js +3 -3
  282. package/.next/server/chunks/9627.js +48 -26
  283. package/.next/server/chunks/9696.js +3 -0
  284. package/.next/server/chunks/9798.js +1 -1
  285. package/.next/server/middleware-manifest.json +5 -5
  286. package/.next/server/pages/500.html +1 -1
  287. package/.next/server/server-reference-manifest.json +1 -1
  288. package/.next/server/src/middleware.js +1 -1
  289. package/.next/server/src/middleware.js.map +1 -1
  290. package/.next/static/7K0XXFu_ty4wRSkl4X21E/_buildManifest.js +1 -0
  291. package/.next/static/chunks/{4882-388e94fe0a03c2ba.js → 3916-0e929d089282dc5d.js} +1 -1
  292. package/.next/static/chunks/{5229-b2a81bb8fb5c19e9.js → 5229-6c89475b61bd2c8b.js} +1 -1
  293. package/.next/static/chunks/6022-7a7d1760fc9814c7.js +1 -0
  294. package/.next/static/chunks/6381-28d0e95620aa018e.js +1 -0
  295. package/.next/static/chunks/app/api/agents/update/route-ee11f7b8a34cba8c.js +1 -0
  296. package/.next/static/chunks/app/api/agents/versions/route-ee11f7b8a34cba8c.js +1 -0
  297. package/.next/static/chunks/app/api/app/update/route-ee11f7b8a34cba8c.js +1 -0
  298. package/.next/static/chunks/app/api/app/update-check/route-ee11f7b8a34cba8c.js +1 -0
  299. package/.next/static/chunks/app/api/assistant/conversation/route-ee11f7b8a34cba8c.js +1 -0
  300. package/.next/static/chunks/app/api/assistant/current-output/route-ee11f7b8a34cba8c.js +1 -0
  301. package/.next/static/chunks/app/api/assistant/messages/route-ee11f7b8a34cba8c.js +1 -0
  302. package/.next/static/chunks/app/api/assistant/session/route-ee11f7b8a34cba8c.js +1 -0
  303. package/.next/static/chunks/app/api/assistant/start/route-ee11f7b8a34cba8c.js +1 -0
  304. package/.next/static/chunks/app/api/assistant/terminal/route-ee11f7b8a34cba8c.js +1 -0
  305. package/.next/static/chunks/app/api/assistant/tools/route-ee11f7b8a34cba8c.js +1 -0
  306. package/.next/static/chunks/app/api/auth/login/route-ee11f7b8a34cba8c.js +1 -0
  307. package/.next/static/chunks/app/api/auth/logout/route-ee11f7b8a34cba8c.js +1 -0
  308. package/.next/static/chunks/app/api/auth/status/route-ee11f7b8a34cba8c.js +1 -0
  309. package/.next/static/chunks/app/api/capabilities/route-ee11f7b8a34cba8c.js +1 -0
  310. package/.next/static/chunks/app/api/daily-summary/route-ee11f7b8a34cba8c.js +1 -0
  311. package/.next/static/chunks/app/api/daily-summary/status/route-ee11f7b8a34cba8c.js +1 -0
  312. package/.next/static/chunks/app/api/external-apps/[id]/health/route-ee11f7b8a34cba8c.js +1 -0
  313. package/.next/static/chunks/app/api/external-apps/[id]/route-ee11f7b8a34cba8c.js +1 -0
  314. package/.next/static/chunks/app/api/external-apps/route-ee11f7b8a34cba8c.js +1 -0
  315. package/.next/static/chunks/app/api/fs/browse/route-ee11f7b8a34cba8c.js +1 -0
  316. package/.next/static/chunks/app/api/fs/recent-paths/route-ee11f7b8a34cba8c.js +1 -0
  317. package/.next/static/chunks/app/api/hooks/agent-event/route-ee11f7b8a34cba8c.js +1 -0
  318. package/.next/static/chunks/app/api/hooks/claude-done/route-ee11f7b8a34cba8c.js +1 -0
  319. package/.next/static/chunks/app/api/hooks/permission-request/route-ee11f7b8a34cba8c.js +1 -0
  320. package/.next/static/chunks/app/api/metrics/vibe/route-ee11f7b8a34cba8c.js +1 -0
  321. package/.next/static/chunks/app/api/ollama/models/route-ee11f7b8a34cba8c.js +1 -0
  322. package/.next/static/chunks/app/api/push/escalation/route-ee11f7b8a34cba8c.js +1 -0
  323. package/.next/static/chunks/app/api/push/subscriptions/route-ee11f7b8a34cba8c.js +1 -0
  324. package/.next/static/chunks/app/api/push/vapid/route-ee11f7b8a34cba8c.js +1 -0
  325. package/.next/static/chunks/app/api/remote/pair/route-ee11f7b8a34cba8c.js +1 -0
  326. package/.next/static/chunks/app/api/repositories/[id]/route-ee11f7b8a34cba8c.js +1 -0
  327. package/.next/static/chunks/app/api/repositories/[id]/todos/[todoId]/route-ee11f7b8a34cba8c.js +1 -0
  328. package/.next/static/chunks/app/api/repositories/[id]/todos/route-ee11f7b8a34cba8c.js +1 -0
  329. package/.next/static/chunks/app/api/repositories/clone/[jobId]/route-ee11f7b8a34cba8c.js +1 -0
  330. package/.next/static/chunks/app/api/repositories/clone/route-ee11f7b8a34cba8c.js +1 -0
  331. package/.next/static/chunks/app/api/repositories/excluded/route-ee11f7b8a34cba8c.js +1 -0
  332. package/.next/static/chunks/app/api/repositories/restore/route-ee11f7b8a34cba8c.js +1 -0
  333. package/.next/static/chunks/app/api/repositories/route-ee11f7b8a34cba8c.js +1 -0
  334. package/.next/static/chunks/app/api/repositories/scan/route-ee11f7b8a34cba8c.js +1 -0
  335. package/.next/static/chunks/app/api/repositories/sync/route-ee11f7b8a34cba8c.js +1 -0
  336. package/.next/static/chunks/app/api/repositories/validate-path/route-ee11f7b8a34cba8c.js +1 -0
  337. package/.next/static/chunks/app/api/settings/default-agents/route-ee11f7b8a34cba8c.js +1 -0
  338. package/.next/static/chunks/app/api/settings/default-surface-mode/route-ee11f7b8a34cba8c.js +1 -0
  339. package/.next/static/chunks/app/api/sidebar/group-order/route-ee11f7b8a34cba8c.js +1 -0
  340. package/.next/static/chunks/app/api/skills/[id]/route-ee11f7b8a34cba8c.js +1 -0
  341. package/.next/static/chunks/app/api/skills/installations/route-ee11f7b8a34cba8c.js +1 -0
  342. package/.next/static/chunks/app/api/skills/operations/route-ee11f7b8a34cba8c.js +1 -0
  343. package/.next/static/chunks/app/api/skills/reindex/route-ee11f7b8a34cba8c.js +1 -0
  344. package/.next/static/chunks/app/api/skills/route-ee11f7b8a34cba8c.js +1 -0
  345. package/.next/static/chunks/app/api/slash-commands/route-ee11f7b8a34cba8c.js +1 -0
  346. package/.next/static/chunks/app/api/tasks/[taskId]/cancel/route-ee11f7b8a34cba8c.js +1 -0
  347. package/.next/static/chunks/app/api/tasks/[taskId]/route-ee11f7b8a34cba8c.js +1 -0
  348. package/.next/static/chunks/app/api/templates/[id]/route-ee11f7b8a34cba8c.js +1 -0
  349. package/.next/static/chunks/app/api/templates/route-ee11f7b8a34cba8c.js +1 -0
  350. package/.next/static/chunks/app/api/todos/route-ee11f7b8a34cba8c.js +1 -0
  351. package/.next/static/chunks/app/api/verification/runs/[runId]/route-ee11f7b8a34cba8c.js +1 -0
  352. package/.next/static/chunks/app/api/verification/runs/route-ee11f7b8a34cba8c.js +1 -0
  353. package/.next/static/chunks/app/api/worktrees/[id]/auto-yes/route-ee11f7b8a34cba8c.js +1 -0
  354. package/.next/static/chunks/app/api/worktrees/[id]/capture/route-ee11f7b8a34cba8c.js +1 -0
  355. package/.next/static/chunks/app/api/worktrees/[id]/clear-composer/route-ee11f7b8a34cba8c.js +1 -0
  356. package/.next/static/chunks/app/api/worktrees/[id]/cli-reference/route-ee11f7b8a34cba8c.js +1 -0
  357. package/.next/static/chunks/app/api/worktrees/[id]/cli-tool/route-ee11f7b8a34cba8c.js +1 -0
  358. package/.next/static/chunks/app/api/worktrees/[id]/cmate/schedules/route-ee11f7b8a34cba8c.js +1 -0
  359. package/.next/static/chunks/app/api/worktrees/[id]/current-output/route-ee11f7b8a34cba8c.js +1 -0
  360. package/.next/static/chunks/app/api/worktrees/[id]/env/route-ee11f7b8a34cba8c.js +1 -0
  361. package/.next/static/chunks/app/api/worktrees/[id]/execution-logs/[logId]/route-ee11f7b8a34cba8c.js +1 -0
  362. package/.next/static/chunks/app/api/worktrees/[id]/execution-logs/route-ee11f7b8a34cba8c.js +1 -0
  363. package/.next/static/chunks/app/api/worktrees/[id]/files/[...path]/route-ee11f7b8a34cba8c.js +1 -0
  364. package/.next/static/chunks/app/api/worktrees/[id]/git/branch/create/route-ee11f7b8a34cba8c.js +1 -0
  365. package/.next/static/chunks/app/api/worktrees/[id]/git/branch/delete/route-ee11f7b8a34cba8c.js +1 -0
  366. package/.next/static/chunks/app/api/worktrees/[id]/git/branches/route-ee11f7b8a34cba8c.js +1 -0
  367. package/.next/static/chunks/app/api/worktrees/[id]/git/checkout/route-ee11f7b8a34cba8c.js +1 -0
  368. package/.next/static/chunks/app/api/worktrees/[id]/git/commit/route-ee11f7b8a34cba8c.js +1 -0
  369. package/.next/static/chunks/app/api/worktrees/[id]/git/diff/route-ee11f7b8a34cba8c.js +1 -0
  370. package/.next/static/chunks/app/api/worktrees/[id]/git/fetch/route-ee11f7b8a34cba8c.js +1 -0
  371. package/.next/static/chunks/app/api/worktrees/[id]/git/log/route-ee11f7b8a34cba8c.js +1 -0
  372. package/.next/static/chunks/app/api/worktrees/[id]/git/pull/route-ee11f7b8a34cba8c.js +1 -0
  373. package/.next/static/chunks/app/api/worktrees/[id]/git/push/route-ee11f7b8a34cba8c.js +1 -0
  374. package/.next/static/chunks/app/api/worktrees/[id]/git/reset/route-ee11f7b8a34cba8c.js +1 -0
  375. package/.next/static/chunks/app/api/worktrees/[id]/git/revert/route-ee11f7b8a34cba8c.js +1 -0
  376. package/.next/static/chunks/app/api/worktrees/[id]/git/show/[commitHash]/route-ee11f7b8a34cba8c.js +1 -0
  377. package/.next/static/chunks/app/api/worktrees/[id]/git/stage/route-ee11f7b8a34cba8c.js +1 -0
  378. package/.next/static/chunks/app/api/worktrees/[id]/git/staged/route-ee11f7b8a34cba8c.js +1 -0
  379. package/.next/static/chunks/app/api/worktrees/[id]/git/stash/[index]/route-ee11f7b8a34cba8c.js +1 -0
  380. package/.next/static/chunks/app/api/worktrees/[id]/git/stash/apply/route-ee11f7b8a34cba8c.js +1 -0
  381. package/.next/static/chunks/app/api/worktrees/[id]/git/stash/pop/route-ee11f7b8a34cba8c.js +1 -0
  382. package/.next/static/chunks/app/api/worktrees/[id]/git/stash/push/route-ee11f7b8a34cba8c.js +1 -0
  383. package/.next/static/chunks/app/api/worktrees/[id]/git/stash/route-ee11f7b8a34cba8c.js +1 -0
  384. package/.next/static/chunks/app/api/worktrees/[id]/git/status/route-ee11f7b8a34cba8c.js +1 -0
  385. package/.next/static/chunks/app/api/worktrees/[id]/git/unstage/route-ee11f7b8a34cba8c.js +1 -0
  386. package/.next/static/chunks/app/api/worktrees/[id]/git/working-diff/route-ee11f7b8a34cba8c.js +1 -0
  387. package/.next/static/chunks/app/api/worktrees/[id]/instances/opencode/route-ee11f7b8a34cba8c.js +1 -0
  388. package/.next/static/chunks/app/api/worktrees/[id]/interrupt/route-ee11f7b8a34cba8c.js +1 -0
  389. package/.next/static/chunks/app/api/worktrees/[id]/kill-session/route-ee11f7b8a34cba8c.js +1 -0
  390. package/.next/static/chunks/app/api/worktrees/[id]/logs/[filename]/route-ee11f7b8a34cba8c.js +1 -0
  391. package/.next/static/chunks/app/api/worktrees/[id]/logs/route-ee11f7b8a34cba8c.js +1 -0
  392. package/.next/static/chunks/app/api/worktrees/[id]/marp-render/route-ee11f7b8a34cba8c.js +1 -0
  393. package/.next/static/chunks/app/api/worktrees/[id]/memos/[memoId]/route-ee11f7b8a34cba8c.js +1 -0
  394. package/.next/static/chunks/app/api/worktrees/[id]/memos/route-ee11f7b8a34cba8c.js +1 -0
  395. package/.next/static/chunks/app/api/worktrees/[id]/messages/route-ee11f7b8a34cba8c.js +1 -0
  396. package/.next/static/chunks/app/api/worktrees/[id]/opencode/diff/route-ee11f7b8a34cba8c.js +1 -0
  397. package/.next/static/chunks/app/api/worktrees/[id]/opencode/session/route-ee11f7b8a34cba8c.js +1 -0
  398. package/.next/static/chunks/app/api/worktrees/[id]/opencode/share/route-ee11f7b8a34cba8c.js +1 -0
  399. package/.next/static/chunks/app/api/worktrees/[id]/prompt-response/route-ee11f7b8a34cba8c.js +1 -0
  400. package/.next/static/chunks/app/api/worktrees/[id]/resolve-target/route-ee11f7b8a34cba8c.js +1 -0
  401. package/.next/static/chunks/app/api/worktrees/[id]/respond/route-ee11f7b8a34cba8c.js +1 -0
  402. package/.next/static/chunks/app/api/worktrees/[id]/route-ee11f7b8a34cba8c.js +1 -0
  403. package/.next/static/chunks/app/api/worktrees/[id]/schedules/[scheduleId]/route-ee11f7b8a34cba8c.js +1 -0
  404. package/.next/static/chunks/app/api/worktrees/[id]/schedules/active/route-ee11f7b8a34cba8c.js +1 -0
  405. package/.next/static/chunks/app/api/worktrees/[id]/schedules/route-ee11f7b8a34cba8c.js +1 -0
  406. package/.next/static/chunks/app/api/worktrees/[id]/search/route-ee11f7b8a34cba8c.js +1 -0
  407. package/.next/static/chunks/app/api/worktrees/[id]/send/route-ee11f7b8a34cba8c.js +1 -0
  408. package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route-ee11f7b8a34cba8c.js +1 -0
  409. package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/install/route-ee11f7b8a34cba8c.js +1 -0
  410. package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/plan/route-ee11f7b8a34cba8c.js +1 -0
  411. package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/uninstall/route-ee11f7b8a34cba8c.js +1 -0
  412. package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/uninstall-plan/route-ee11f7b8a34cba8c.js +1 -0
  413. package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/update/route-ee11f7b8a34cba8c.js +1 -0
  414. package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/update-plan/route-ee11f7b8a34cba8c.js +1 -0
  415. package/.next/static/chunks/app/api/worktrees/[id]/skills/route-ee11f7b8a34cba8c.js +1 -0
  416. package/.next/static/chunks/app/api/worktrees/[id]/slash-commands/route-ee11f7b8a34cba8c.js +1 -0
  417. package/.next/static/chunks/app/api/worktrees/[id]/special-keys/route-ee11f7b8a34cba8c.js +1 -0
  418. package/.next/static/chunks/app/api/worktrees/[id]/tasks/route-ee11f7b8a34cba8c.js +1 -0
  419. package/.next/static/chunks/app/api/worktrees/[id]/terminal/route-ee11f7b8a34cba8c.js +1 -0
  420. package/.next/static/chunks/app/api/worktrees/[id]/timers/history/route-ee11f7b8a34cba8c.js +1 -0
  421. package/.next/static/chunks/app/api/worktrees/[id]/timers/route-ee11f7b8a34cba8c.js +1 -0
  422. package/.next/static/chunks/app/api/worktrees/[id]/todos/[todoId]/route-ee11f7b8a34cba8c.js +1 -0
  423. package/.next/static/chunks/app/api/worktrees/[id]/todos/route-ee11f7b8a34cba8c.js +1 -0
  424. package/.next/static/chunks/app/api/worktrees/[id]/tree/[...path]/route-ee11f7b8a34cba8c.js +1 -0
  425. package/.next/static/chunks/app/api/worktrees/[id]/tree/route-ee11f7b8a34cba8c.js +1 -0
  426. package/.next/static/chunks/app/api/worktrees/[id]/upload/[...path]/route-ee11f7b8a34cba8c.js +1 -0
  427. package/.next/static/chunks/app/api/worktrees/[id]/verify/config/route-ee11f7b8a34cba8c.js +1 -0
  428. package/.next/static/chunks/app/api/worktrees/[id]/verify/route-ee11f7b8a34cba8c.js +1 -0
  429. package/.next/static/chunks/app/api/worktrees/[id]/verify/runs/[runId]/cancel/route-ee11f7b8a34cba8c.js +1 -0
  430. package/.next/static/chunks/app/api/worktrees/[id]/verify/runs/[runId]/route-ee11f7b8a34cba8c.js +1 -0
  431. package/.next/static/chunks/app/api/worktrees/[id]/verify/runs/route-ee11f7b8a34cba8c.js +1 -0
  432. package/.next/static/chunks/app/api/worktrees/[id]/viewed/route-ee11f7b8a34cba8c.js +1 -0
  433. package/.next/static/chunks/app/api/worktrees/apply-default-agents/route-ee11f7b8a34cba8c.js +1 -0
  434. package/.next/static/chunks/app/api/worktrees/route-ee11f7b8a34cba8c.js +1 -0
  435. package/.next/static/chunks/app/manifest.webmanifest/route-ee11f7b8a34cba8c.js +1 -0
  436. package/.next/static/chunks/app/more/{page-75d3783da0d49a25.js → page-333bba1c8bbc9c11.js} +1 -1
  437. package/.next/static/chunks/app/proxy/[...path]/route-ee11f7b8a34cba8c.js +1 -0
  438. package/.next/static/chunks/app/worktrees/[id]/layout-ee11f7b8a34cba8c.js +1 -0
  439. package/.next/static/chunks/app/worktrees/[id]/page-d48b95ed554bcd13.js +1 -0
  440. package/.next/static/chunks/app/worktrees/[id]/terminal/page-2631bc5c4b0a9fb8.js +1 -0
  441. package/.next/static/css/61e10d4b1b11b193.css +1 -0
  442. package/.next/trace +13 -13
  443. package/.next/types/app/api/settings/default-surface-mode/route.ts +347 -0
  444. package/.next/types/app/api/worktrees/[id]/{start-polling → cli-reference}/route.ts +3 -3
  445. package/.next/types/routes.d.ts +3 -2
  446. package/.next/types/validator.ts +18 -9
  447. package/dist/server/server.js +58 -0
  448. package/dist/server/src/lib/claude-output.js +1 -0
  449. package/dist/server/src/lib/db/app-settings-db.js +60 -0
  450. package/dist/server/src/lib/db/chat-db.js +120 -7
  451. package/dist/server/src/lib/detection/status-detector.js +3 -2
  452. package/dist/server/src/lib/env.js +122 -0
  453. package/dist/server/src/lib/git/worktrees.js +154 -0
  454. package/dist/server/src/lib/history/transcript-tail.js +80 -0
  455. package/dist/server/src/lib/history/user-turn-recorder.js +247 -0
  456. package/dist/server/src/lib/hooks/permission-decision-service.js +85 -1
  457. package/dist/server/src/lib/hooks/sources/antigravity/history.js +519 -0
  458. package/dist/server/src/lib/hooks/sources/antigravity/source.js +7 -0
  459. package/dist/server/src/lib/hooks/sources/antigravity/transcript.js +407 -0
  460. package/dist/server/src/lib/hooks/sources/claude/history.js +654 -0
  461. package/dist/server/src/lib/hooks/sources/claude/source.js +4 -0
  462. package/dist/server/src/lib/hooks/sources/claude/transcript.js +518 -0
  463. package/dist/server/src/lib/hooks/sources/codex/history.js +576 -0
  464. package/dist/server/src/lib/hooks/sources/codex/source.js +4 -0
  465. package/dist/server/src/lib/hooks/sources/codex/transcript.js +448 -0
  466. package/dist/server/src/lib/hooks/sources/copilot/source.js +2 -0
  467. package/dist/server/src/lib/hooks/sources/gemini/source.js +2 -0
  468. package/dist/server/src/lib/hooks/sources/legacy-relay.js +3 -0
  469. package/dist/server/src/lib/hooks/sources/opencode/history.js +57 -0
  470. package/dist/server/src/lib/hooks/sources/opencode/source.js +4 -0
  471. package/dist/server/src/lib/hooks/sources/opencode/transcript.js +10 -28
  472. package/dist/server/src/lib/hooks/sources/turn-body.js +118 -0
  473. package/dist/server/src/lib/polling/prompt-dedup.js +2 -4
  474. package/dist/server/src/lib/polling/response-checker.js +44 -3
  475. package/dist/server/src/lib/polling/response-dedup.js +2 -4
  476. package/dist/server/src/lib/polling/response-poller-core.js +191 -29
  477. package/dist/server/src/lib/polling/structured-history-gate.js +147 -16
  478. package/dist/server/src/lib/push/push-sender.js +21 -1
  479. package/dist/server/src/lib/push/waiting-push-notifier.js +126 -8
  480. package/dist/server/src/lib/realtime/publisher-registry.js +171 -0
  481. package/dist/server/src/lib/realtime/terminal-broadcast.js +14 -1
  482. package/dist/server/src/lib/realtime/types.js +96 -1
  483. package/dist/server/src/lib/session/current-output-builder.js +263 -4
  484. package/dist/server/src/lib/session/send-user-message.js +90 -2
  485. package/dist/server/src/lib/tui-accumulator.js +2 -8
  486. package/dist/server/src/lib/ws-server.js +143 -6
  487. package/dist/server/src/types/agent-transcript.js +241 -5
  488. package/dist/server/src/types/ui-state.js +24 -1
  489. package/package.json +1 -1
  490. package/public/sw.js +15 -1
  491. package/.next/server/app/api/worktrees/[id]/start-polling/route.js +0 -1
  492. package/.next/server/app/api/worktrees/[id]/start-polling/route.js.nft.json +0 -1
  493. package/.next/server/chunks/1714.js +0 -7
  494. package/.next/server/chunks/2198.js +0 -1
  495. package/.next/server/chunks/221.js +0 -25
  496. package/.next/server/chunks/2759.js +0 -8
  497. package/.next/server/chunks/3558.js +0 -1
  498. package/.next/server/chunks/9508.js +0 -1
  499. package/.next/static/0YoRrahue4Vchxg1z83IQ/_buildManifest.js +0 -1
  500. package/.next/static/chunks/1379-af7af9e08f47c979.js +0 -1
  501. package/.next/static/chunks/6381-9ba5198c0a6ff197.js +0 -1
  502. package/.next/static/chunks/app/api/agents/update/route-1c30fb8d4d6fa6ef.js +0 -1
  503. package/.next/static/chunks/app/api/agents/versions/route-1c30fb8d4d6fa6ef.js +0 -1
  504. package/.next/static/chunks/app/api/app/update/route-1c30fb8d4d6fa6ef.js +0 -1
  505. package/.next/static/chunks/app/api/app/update-check/route-1c30fb8d4d6fa6ef.js +0 -1
  506. package/.next/static/chunks/app/api/assistant/conversation/route-1c30fb8d4d6fa6ef.js +0 -1
  507. package/.next/static/chunks/app/api/assistant/current-output/route-1c30fb8d4d6fa6ef.js +0 -1
  508. package/.next/static/chunks/app/api/assistant/messages/route-1c30fb8d4d6fa6ef.js +0 -1
  509. package/.next/static/chunks/app/api/assistant/session/route-1c30fb8d4d6fa6ef.js +0 -1
  510. package/.next/static/chunks/app/api/assistant/start/route-1c30fb8d4d6fa6ef.js +0 -1
  511. package/.next/static/chunks/app/api/assistant/terminal/route-1c30fb8d4d6fa6ef.js +0 -1
  512. package/.next/static/chunks/app/api/assistant/tools/route-1c30fb8d4d6fa6ef.js +0 -1
  513. package/.next/static/chunks/app/api/auth/login/route-1c30fb8d4d6fa6ef.js +0 -1
  514. package/.next/static/chunks/app/api/auth/logout/route-1c30fb8d4d6fa6ef.js +0 -1
  515. package/.next/static/chunks/app/api/auth/status/route-1c30fb8d4d6fa6ef.js +0 -1
  516. package/.next/static/chunks/app/api/capabilities/route-1c30fb8d4d6fa6ef.js +0 -1
  517. package/.next/static/chunks/app/api/daily-summary/route-1c30fb8d4d6fa6ef.js +0 -1
  518. package/.next/static/chunks/app/api/daily-summary/status/route-1c30fb8d4d6fa6ef.js +0 -1
  519. package/.next/static/chunks/app/api/external-apps/[id]/health/route-1c30fb8d4d6fa6ef.js +0 -1
  520. package/.next/static/chunks/app/api/external-apps/[id]/route-1c30fb8d4d6fa6ef.js +0 -1
  521. package/.next/static/chunks/app/api/external-apps/route-1c30fb8d4d6fa6ef.js +0 -1
  522. package/.next/static/chunks/app/api/fs/browse/route-1c30fb8d4d6fa6ef.js +0 -1
  523. package/.next/static/chunks/app/api/fs/recent-paths/route-1c30fb8d4d6fa6ef.js +0 -1
  524. package/.next/static/chunks/app/api/hooks/agent-event/route-1c30fb8d4d6fa6ef.js +0 -1
  525. package/.next/static/chunks/app/api/hooks/claude-done/route-1c30fb8d4d6fa6ef.js +0 -1
  526. package/.next/static/chunks/app/api/hooks/permission-request/route-1c30fb8d4d6fa6ef.js +0 -1
  527. package/.next/static/chunks/app/api/metrics/vibe/route-1c30fb8d4d6fa6ef.js +0 -1
  528. package/.next/static/chunks/app/api/ollama/models/route-1c30fb8d4d6fa6ef.js +0 -1
  529. package/.next/static/chunks/app/api/push/escalation/route-1c30fb8d4d6fa6ef.js +0 -1
  530. package/.next/static/chunks/app/api/push/subscriptions/route-1c30fb8d4d6fa6ef.js +0 -1
  531. package/.next/static/chunks/app/api/push/vapid/route-1c30fb8d4d6fa6ef.js +0 -1
  532. package/.next/static/chunks/app/api/remote/pair/route-1c30fb8d4d6fa6ef.js +0 -1
  533. package/.next/static/chunks/app/api/repositories/[id]/route-1c30fb8d4d6fa6ef.js +0 -1
  534. package/.next/static/chunks/app/api/repositories/[id]/todos/[todoId]/route-1c30fb8d4d6fa6ef.js +0 -1
  535. package/.next/static/chunks/app/api/repositories/[id]/todos/route-1c30fb8d4d6fa6ef.js +0 -1
  536. package/.next/static/chunks/app/api/repositories/clone/[jobId]/route-1c30fb8d4d6fa6ef.js +0 -1
  537. package/.next/static/chunks/app/api/repositories/clone/route-1c30fb8d4d6fa6ef.js +0 -1
  538. package/.next/static/chunks/app/api/repositories/excluded/route-1c30fb8d4d6fa6ef.js +0 -1
  539. package/.next/static/chunks/app/api/repositories/restore/route-1c30fb8d4d6fa6ef.js +0 -1
  540. package/.next/static/chunks/app/api/repositories/route-1c30fb8d4d6fa6ef.js +0 -1
  541. package/.next/static/chunks/app/api/repositories/scan/route-1c30fb8d4d6fa6ef.js +0 -1
  542. package/.next/static/chunks/app/api/repositories/sync/route-1c30fb8d4d6fa6ef.js +0 -1
  543. package/.next/static/chunks/app/api/repositories/validate-path/route-1c30fb8d4d6fa6ef.js +0 -1
  544. package/.next/static/chunks/app/api/settings/default-agents/route-1c30fb8d4d6fa6ef.js +0 -1
  545. package/.next/static/chunks/app/api/sidebar/group-order/route-1c30fb8d4d6fa6ef.js +0 -1
  546. package/.next/static/chunks/app/api/skills/[id]/route-1c30fb8d4d6fa6ef.js +0 -1
  547. package/.next/static/chunks/app/api/skills/installations/route-1c30fb8d4d6fa6ef.js +0 -1
  548. package/.next/static/chunks/app/api/skills/operations/route-1c30fb8d4d6fa6ef.js +0 -1
  549. package/.next/static/chunks/app/api/skills/reindex/route-1c30fb8d4d6fa6ef.js +0 -1
  550. package/.next/static/chunks/app/api/skills/route-1c30fb8d4d6fa6ef.js +0 -1
  551. package/.next/static/chunks/app/api/slash-commands/route-1c30fb8d4d6fa6ef.js +0 -1
  552. package/.next/static/chunks/app/api/tasks/[taskId]/cancel/route-1c30fb8d4d6fa6ef.js +0 -1
  553. package/.next/static/chunks/app/api/tasks/[taskId]/route-1c30fb8d4d6fa6ef.js +0 -1
  554. package/.next/static/chunks/app/api/templates/[id]/route-1c30fb8d4d6fa6ef.js +0 -1
  555. package/.next/static/chunks/app/api/templates/route-1c30fb8d4d6fa6ef.js +0 -1
  556. package/.next/static/chunks/app/api/todos/route-1c30fb8d4d6fa6ef.js +0 -1
  557. package/.next/static/chunks/app/api/verification/runs/[runId]/route-1c30fb8d4d6fa6ef.js +0 -1
  558. package/.next/static/chunks/app/api/verification/runs/route-1c30fb8d4d6fa6ef.js +0 -1
  559. package/.next/static/chunks/app/api/worktrees/[id]/auto-yes/route-1c30fb8d4d6fa6ef.js +0 -1
  560. package/.next/static/chunks/app/api/worktrees/[id]/capture/route-1c30fb8d4d6fa6ef.js +0 -1
  561. package/.next/static/chunks/app/api/worktrees/[id]/clear-composer/route-1c30fb8d4d6fa6ef.js +0 -1
  562. package/.next/static/chunks/app/api/worktrees/[id]/cli-tool/route-1c30fb8d4d6fa6ef.js +0 -1
  563. package/.next/static/chunks/app/api/worktrees/[id]/cmate/schedules/route-1c30fb8d4d6fa6ef.js +0 -1
  564. package/.next/static/chunks/app/api/worktrees/[id]/current-output/route-1c30fb8d4d6fa6ef.js +0 -1
  565. package/.next/static/chunks/app/api/worktrees/[id]/env/route-1c30fb8d4d6fa6ef.js +0 -1
  566. package/.next/static/chunks/app/api/worktrees/[id]/execution-logs/[logId]/route-1c30fb8d4d6fa6ef.js +0 -1
  567. package/.next/static/chunks/app/api/worktrees/[id]/execution-logs/route-1c30fb8d4d6fa6ef.js +0 -1
  568. package/.next/static/chunks/app/api/worktrees/[id]/files/[...path]/route-1c30fb8d4d6fa6ef.js +0 -1
  569. package/.next/static/chunks/app/api/worktrees/[id]/git/branch/create/route-1c30fb8d4d6fa6ef.js +0 -1
  570. package/.next/static/chunks/app/api/worktrees/[id]/git/branch/delete/route-1c30fb8d4d6fa6ef.js +0 -1
  571. package/.next/static/chunks/app/api/worktrees/[id]/git/branches/route-1c30fb8d4d6fa6ef.js +0 -1
  572. package/.next/static/chunks/app/api/worktrees/[id]/git/checkout/route-1c30fb8d4d6fa6ef.js +0 -1
  573. package/.next/static/chunks/app/api/worktrees/[id]/git/commit/route-1c30fb8d4d6fa6ef.js +0 -1
  574. package/.next/static/chunks/app/api/worktrees/[id]/git/diff/route-1c30fb8d4d6fa6ef.js +0 -1
  575. package/.next/static/chunks/app/api/worktrees/[id]/git/fetch/route-1c30fb8d4d6fa6ef.js +0 -1
  576. package/.next/static/chunks/app/api/worktrees/[id]/git/log/route-1c30fb8d4d6fa6ef.js +0 -1
  577. package/.next/static/chunks/app/api/worktrees/[id]/git/pull/route-1c30fb8d4d6fa6ef.js +0 -1
  578. package/.next/static/chunks/app/api/worktrees/[id]/git/push/route-1c30fb8d4d6fa6ef.js +0 -1
  579. package/.next/static/chunks/app/api/worktrees/[id]/git/reset/route-1c30fb8d4d6fa6ef.js +0 -1
  580. package/.next/static/chunks/app/api/worktrees/[id]/git/revert/route-1c30fb8d4d6fa6ef.js +0 -1
  581. package/.next/static/chunks/app/api/worktrees/[id]/git/show/[commitHash]/route-1c30fb8d4d6fa6ef.js +0 -1
  582. package/.next/static/chunks/app/api/worktrees/[id]/git/stage/route-1c30fb8d4d6fa6ef.js +0 -1
  583. package/.next/static/chunks/app/api/worktrees/[id]/git/staged/route-1c30fb8d4d6fa6ef.js +0 -1
  584. package/.next/static/chunks/app/api/worktrees/[id]/git/stash/[index]/route-1c30fb8d4d6fa6ef.js +0 -1
  585. package/.next/static/chunks/app/api/worktrees/[id]/git/stash/apply/route-1c30fb8d4d6fa6ef.js +0 -1
  586. package/.next/static/chunks/app/api/worktrees/[id]/git/stash/pop/route-1c30fb8d4d6fa6ef.js +0 -1
  587. package/.next/static/chunks/app/api/worktrees/[id]/git/stash/push/route-1c30fb8d4d6fa6ef.js +0 -1
  588. package/.next/static/chunks/app/api/worktrees/[id]/git/stash/route-1c30fb8d4d6fa6ef.js +0 -1
  589. package/.next/static/chunks/app/api/worktrees/[id]/git/status/route-1c30fb8d4d6fa6ef.js +0 -1
  590. package/.next/static/chunks/app/api/worktrees/[id]/git/unstage/route-1c30fb8d4d6fa6ef.js +0 -1
  591. package/.next/static/chunks/app/api/worktrees/[id]/git/working-diff/route-1c30fb8d4d6fa6ef.js +0 -1
  592. package/.next/static/chunks/app/api/worktrees/[id]/instances/opencode/route-1c30fb8d4d6fa6ef.js +0 -1
  593. package/.next/static/chunks/app/api/worktrees/[id]/interrupt/route-1c30fb8d4d6fa6ef.js +0 -1
  594. package/.next/static/chunks/app/api/worktrees/[id]/kill-session/route-1c30fb8d4d6fa6ef.js +0 -1
  595. package/.next/static/chunks/app/api/worktrees/[id]/logs/[filename]/route-1c30fb8d4d6fa6ef.js +0 -1
  596. package/.next/static/chunks/app/api/worktrees/[id]/logs/route-1c30fb8d4d6fa6ef.js +0 -1
  597. package/.next/static/chunks/app/api/worktrees/[id]/marp-render/route-1c30fb8d4d6fa6ef.js +0 -1
  598. package/.next/static/chunks/app/api/worktrees/[id]/memos/[memoId]/route-1c30fb8d4d6fa6ef.js +0 -1
  599. package/.next/static/chunks/app/api/worktrees/[id]/memos/route-1c30fb8d4d6fa6ef.js +0 -1
  600. package/.next/static/chunks/app/api/worktrees/[id]/messages/route-1c30fb8d4d6fa6ef.js +0 -1
  601. package/.next/static/chunks/app/api/worktrees/[id]/opencode/diff/route-1c30fb8d4d6fa6ef.js +0 -1
  602. package/.next/static/chunks/app/api/worktrees/[id]/opencode/session/route-1c30fb8d4d6fa6ef.js +0 -1
  603. package/.next/static/chunks/app/api/worktrees/[id]/opencode/share/route-1c30fb8d4d6fa6ef.js +0 -1
  604. package/.next/static/chunks/app/api/worktrees/[id]/prompt-response/route-1c30fb8d4d6fa6ef.js +0 -1
  605. package/.next/static/chunks/app/api/worktrees/[id]/resolve-target/route-1c30fb8d4d6fa6ef.js +0 -1
  606. package/.next/static/chunks/app/api/worktrees/[id]/respond/route-1c30fb8d4d6fa6ef.js +0 -1
  607. package/.next/static/chunks/app/api/worktrees/[id]/route-1c30fb8d4d6fa6ef.js +0 -1
  608. package/.next/static/chunks/app/api/worktrees/[id]/schedules/[scheduleId]/route-1c30fb8d4d6fa6ef.js +0 -1
  609. package/.next/static/chunks/app/api/worktrees/[id]/schedules/active/route-1c30fb8d4d6fa6ef.js +0 -1
  610. package/.next/static/chunks/app/api/worktrees/[id]/schedules/route-1c30fb8d4d6fa6ef.js +0 -1
  611. package/.next/static/chunks/app/api/worktrees/[id]/search/route-1c30fb8d4d6fa6ef.js +0 -1
  612. package/.next/static/chunks/app/api/worktrees/[id]/send/route-1c30fb8d4d6fa6ef.js +0 -1
  613. package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route-1c30fb8d4d6fa6ef.js +0 -1
  614. package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/install/route-1c30fb8d4d6fa6ef.js +0 -1
  615. package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/plan/route-1c30fb8d4d6fa6ef.js +0 -1
  616. package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/uninstall/route-1c30fb8d4d6fa6ef.js +0 -1
  617. package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/uninstall-plan/route-1c30fb8d4d6fa6ef.js +0 -1
  618. package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/update/route-1c30fb8d4d6fa6ef.js +0 -1
  619. package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/update-plan/route-1c30fb8d4d6fa6ef.js +0 -1
  620. package/.next/static/chunks/app/api/worktrees/[id]/skills/route-1c30fb8d4d6fa6ef.js +0 -1
  621. package/.next/static/chunks/app/api/worktrees/[id]/slash-commands/route-1c30fb8d4d6fa6ef.js +0 -1
  622. package/.next/static/chunks/app/api/worktrees/[id]/special-keys/route-1c30fb8d4d6fa6ef.js +0 -1
  623. package/.next/static/chunks/app/api/worktrees/[id]/start-polling/route-1c30fb8d4d6fa6ef.js +0 -1
  624. package/.next/static/chunks/app/api/worktrees/[id]/tasks/route-1c30fb8d4d6fa6ef.js +0 -1
  625. package/.next/static/chunks/app/api/worktrees/[id]/terminal/route-1c30fb8d4d6fa6ef.js +0 -1
  626. package/.next/static/chunks/app/api/worktrees/[id]/timers/history/route-1c30fb8d4d6fa6ef.js +0 -1
  627. package/.next/static/chunks/app/api/worktrees/[id]/timers/route-1c30fb8d4d6fa6ef.js +0 -1
  628. package/.next/static/chunks/app/api/worktrees/[id]/todos/[todoId]/route-1c30fb8d4d6fa6ef.js +0 -1
  629. package/.next/static/chunks/app/api/worktrees/[id]/todos/route-1c30fb8d4d6fa6ef.js +0 -1
  630. package/.next/static/chunks/app/api/worktrees/[id]/tree/[...path]/route-1c30fb8d4d6fa6ef.js +0 -1
  631. package/.next/static/chunks/app/api/worktrees/[id]/tree/route-1c30fb8d4d6fa6ef.js +0 -1
  632. package/.next/static/chunks/app/api/worktrees/[id]/upload/[...path]/route-1c30fb8d4d6fa6ef.js +0 -1
  633. package/.next/static/chunks/app/api/worktrees/[id]/verify/config/route-1c30fb8d4d6fa6ef.js +0 -1
  634. package/.next/static/chunks/app/api/worktrees/[id]/verify/route-1c30fb8d4d6fa6ef.js +0 -1
  635. package/.next/static/chunks/app/api/worktrees/[id]/verify/runs/[runId]/cancel/route-1c30fb8d4d6fa6ef.js +0 -1
  636. package/.next/static/chunks/app/api/worktrees/[id]/verify/runs/[runId]/route-1c30fb8d4d6fa6ef.js +0 -1
  637. package/.next/static/chunks/app/api/worktrees/[id]/verify/runs/route-1c30fb8d4d6fa6ef.js +0 -1
  638. package/.next/static/chunks/app/api/worktrees/[id]/viewed/route-1c30fb8d4d6fa6ef.js +0 -1
  639. package/.next/static/chunks/app/api/worktrees/apply-default-agents/route-1c30fb8d4d6fa6ef.js +0 -1
  640. package/.next/static/chunks/app/api/worktrees/route-1c30fb8d4d6fa6ef.js +0 -1
  641. package/.next/static/chunks/app/manifest.webmanifest/route-1c30fb8d4d6fa6ef.js +0 -1
  642. package/.next/static/chunks/app/proxy/[...path]/route-1c30fb8d4d6fa6ef.js +0 -1
  643. package/.next/static/chunks/app/worktrees/[id]/layout-1c30fb8d4d6fa6ef.js +0 -1
  644. package/.next/static/chunks/app/worktrees/[id]/page-ce6279d581d1df95.js +0 -1
  645. package/.next/static/chunks/app/worktrees/[id]/terminal/page-00ad5d9a62a71cab.js +0 -1
  646. package/.next/static/css/b326c8a734e1928e.css +0 -1
  647. /package/.next/static/{0YoRrahue4Vchxg1z83IQ → 7K0XXFu_ty4wRSkl4X21E}/_ssgManifest.js +0 -0
@@ -0,0 +1,448 @@
1
+ "use strict";
2
+ /**
3
+ * Turning codex's rollout JSONL back into the reply the agent wrote
4
+ * (Issue #2197).
5
+ *
6
+ * The third of these readers, after `../opencode/transcript` (#2041, push) and
7
+ * `../claude/transcript` (#2121, pull). Same job, same reason: the poller can
8
+ * only ever save a *rendering* of the reply — the agent's Markdown after its TUI
9
+ * has wrapped it to the pane width, drawn `•` bullets in front of it and run a
10
+ * spinner through it — while the agent itself writes the source down as it goes.
11
+ *
12
+ * ## Two parallel streams in one file, and why only one is read
13
+ *
14
+ * A rollout file is a sequence of `{ordinal, timestamp, type, payload}` lines,
15
+ * and it holds the same conversation **twice**:
16
+ *
17
+ * - `type: "response_item"` — what was sent to the model. `message` records
18
+ * with `role: developer | user | assistant`, `reasoning` records whose text
19
+ * is encrypted, `custom_tool_call` / `custom_tool_call_output` pairs.
20
+ * - `type: "event_msg"` with `payload.type: "item_completed"` — what the TUI
21
+ * displayed. One `item` per line: `UserMessage`, `AgentMessage`,
22
+ * `CommandExecution`, `FileChange`, `McpToolCall`, `Reasoning`, …
23
+ *
24
+ * Only the second is read, and that is the load-bearing decision of this module.
25
+ * Three measurements force it (`docs/design/codex-transcript-reader.md` §2,
26
+ * against codex-cli 0.151.0 live and 250 archived sessions on 0.142.0…0.151.0):
27
+ *
28
+ * 1. **`role: "user"` is mostly not the user.** The `response_item` stream
29
+ * carries `<environment_context>`, `<recommended_plugins>` and the AGENTS.md
30
+ * instructions as `role: "user"` records. The item stream carries none of
31
+ * them: a `UserMessage` item is emitted for the operator's own text and for
32
+ * nothing else. That is positive evidence rather than a deny list, which is
33
+ * the discipline #2196 settled on for the same question on claude.
34
+ * 2. **The item stream is the only one with readable tool calls.**
35
+ * `custom_tool_call.input` is a JavaScript snippet
36
+ * (`const r = await tools.exec_command({...})`); the `CommandExecution` item
37
+ * carries the argv and a `parsed_cmd` with the shell line in it.
38
+ * 3. **`content_item_kinds` — the field that marks a `response_item` as the
39
+ * operator's — does not exist before 0.151.0.** It is absent on 0.149.1,
40
+ * where the injected and the real `role: "user"` records are otherwise
41
+ * identical. A reader built on it would have gone quietly wrong one version
42
+ * back.
43
+ *
44
+ * `response_item` lines are therefore counted as duplicates of the item stream
45
+ * and dropped, not reported as unknown. See {@link CodexTurnBuild}.
46
+ *
47
+ * ## The turn boundary is written down
48
+ *
49
+ * codex stamps a `turn_id` on `task_started`, on every `item_completed`, on
50
+ * `turn_context` and on `task_complete`. This is the one place codex is easier
51
+ * to read than claude, which has no link at all from a reply to the prompt it
52
+ * answers and has to infer the boundary from record order (#2121). Here the
53
+ * boundary is a field, and a turn is closed by the `task_complete` that carries
54
+ * its id — measured on 326 of 326 archived turns.
55
+ *
56
+ * ## Pure on purpose
57
+ *
58
+ * No filesystem, no database, no `globalThis` — `./history` owns all three, the
59
+ * same split the other two readers use, so "the saved body equals the
60
+ * transcript's text" is a property a test asserts against a fixture rather than
61
+ * a claim.
62
+ *
63
+ * @module lib/hooks/sources/codex/transcript
64
+ */
65
+ Object.defineProperty(exports, "__esModule", { value: true });
66
+ exports.CODEX_THINKING_LABEL = exports.MAX_CODEX_TOOL_DETAIL_LENGTH = exports.MAX_CODEX_TURN_ITEMS = exports.CODEX_TURN_TRUNCATION_MARKER = exports.MAX_CODEX_TURN_BODY_LENGTH = exports.CODEX_ROLLOUT_EXTENSION = exports.CODEX_SESSIONS_DIR_SEGMENTS = void 0;
67
+ exports.readCodexRolloutItem = readCodexRolloutItem;
68
+ exports.readCodexRolloutRecord = readCodexRolloutRecord;
69
+ exports.parseCodexRollout = parseCodexRollout;
70
+ exports.buildCodexTurns = buildCodexTurns;
71
+ exports.renderCodexTurn = renderCodexTurn;
72
+ const event_mapper_1 = require("../event-mapper");
73
+ const turn_body_1 = require("../turn-body");
74
+ /** `$CODEX_HOME/sessions` — where codex keeps one machine's rollout files. */
75
+ exports.CODEX_SESSIONS_DIR_SEGMENTS = ['sessions'];
76
+ /** `.jsonl`; the only extension this reader will open. */
77
+ exports.CODEX_ROLLOUT_EXTENSION = '.jsonl';
78
+ /** Longest body written for one turn. Same bound and reason as claude's. */
79
+ exports.MAX_CODEX_TURN_BODY_LENGTH = 200_000;
80
+ /** Appended when {@link MAX_CODEX_TURN_BODY_LENGTH} truncates a turn. */
81
+ exports.CODEX_TURN_TRUNCATION_MARKER = '\n\n_(truncated)_';
82
+ /**
83
+ * Cap on items kept for one turn.
84
+ *
85
+ * The same 2048 claude's reader uses, and generous for the same reason: a codex
86
+ * turn on the archived corpus ran to 46 `Reasoning` items and 25
87
+ * `CommandExecution`s, and the overflow is reported rather than hidden.
88
+ */
89
+ exports.MAX_CODEX_TURN_ITEMS = 2048;
90
+ /** Longest tool detail put on a summary line. */
91
+ exports.MAX_CODEX_TOOL_DETAIL_LENGTH = 200;
92
+ /** The label a reasoning summary is folded behind. Same word claude uses. */
93
+ exports.CODEX_THINKING_LABEL = 'Thinking';
94
+ /**
95
+ * Read one `item_completed` item.
96
+ *
97
+ * @returns The item, or null when the value is not an object with a `type`
98
+ */
99
+ function readCodexRolloutItem(value) {
100
+ if (!(0, event_mapper_1.isPlainObject)(value))
101
+ return null;
102
+ const type = (0, event_mapper_1.readStringField)(value, 'type');
103
+ if (!type)
104
+ return null;
105
+ return {
106
+ type,
107
+ id: (0, event_mapper_1.readStringField)(value, 'id'),
108
+ text: readItemText(type, value),
109
+ phase: (0, event_mapper_1.readStringField)(value, 'phase'),
110
+ detail: readItemDetail(type, value),
111
+ };
112
+ }
113
+ /**
114
+ * The prose an item carries, or null.
115
+ *
116
+ * Read per item type rather than by trying every text-shaped field on every
117
+ * item, so that a later codex adding a `text` to a tool item does not silently
118
+ * start rendering tool output as the agent's prose. `content` is a list of
119
+ * `{type, text}` on both message items — spelled `"text"` on `UserMessage` and
120
+ * `"Text"` on `AgentMessage`, which is why the element's own type is not
121
+ * checked.
122
+ */
123
+ function readItemText(type, item) {
124
+ if (type === 'UserMessage' || type === 'AgentMessage') {
125
+ return joinContentText(item.content);
126
+ }
127
+ if (type === 'Reasoning') {
128
+ // `summary_text` is a list of strings. Measured empty on 12,084 of 12,084
129
+ // archived reasoning items — the summaries are not retained on this
130
+ // account — so an empty one is skipped rather than rendered as a blank
131
+ // quote, exactly as #2121 does for claude's empty `thinking` blocks.
132
+ return joinStringList(item.summary_text);
133
+ }
134
+ return null;
135
+ }
136
+ /** Concatenate a `content` array's `text` fields. */
137
+ function joinContentText(content) {
138
+ if (!Array.isArray(content))
139
+ return null;
140
+ let out = '';
141
+ for (const entry of content) {
142
+ if (!(0, event_mapper_1.isPlainObject)(entry))
143
+ continue;
144
+ const text = (0, event_mapper_1.readStringField)(entry, 'text');
145
+ if (text)
146
+ out += text;
147
+ }
148
+ return out.length > 0 ? out : null;
149
+ }
150
+ /** Join a list of strings, dropping anything that is not one. */
151
+ function joinStringList(value) {
152
+ if (!Array.isArray(value))
153
+ return null;
154
+ const parts = value.filter((entry) => typeof entry === 'string' && entry !== '');
155
+ return parts.length > 0 ? parts.join('\n\n') : null;
156
+ }
157
+ /**
158
+ * The one-line summary of a tool item, or null.
159
+ *
160
+ * One rule per measured item type. Every shape below was dumped off a real
161
+ * rollout rather than read out of a schema — see the design doc's §2.3 table —
162
+ * and an item type that is not here produces no detail, which is what puts it in
163
+ * {@link CodexRenderedTurn.unknownBlockTypes} unless it is deliberately silent.
164
+ */
165
+ function readItemDetail(type, item) {
166
+ if (type === 'CommandExecution') {
167
+ // `parsed_cmd[0].cmd` is the shell line codex itself displays; `command` is
168
+ // the argv it ran it with (`["/bin/zsh","-lc","<the line>"]`). Preferring
169
+ // the parsed form keeps the summary readable, and the argv is the fallback
170
+ // for a call codex could not parse.
171
+ const parsed = readParsedCommand(item.parsed_cmd);
172
+ if (parsed)
173
+ return boundDetailText(collapseToLine(parsed));
174
+ const argv = readArgv(item.command);
175
+ return argv ? boundDetailText(collapseToLine(argv)) : null;
176
+ }
177
+ if (type === 'FileChange') {
178
+ const changes = item.changes;
179
+ if (!(0, event_mapper_1.isPlainObject)(changes))
180
+ return null;
181
+ const paths = Object.keys(changes);
182
+ return paths.length > 0 ? boundDetailText(paths.join(', ')) : null;
183
+ }
184
+ if (type === 'McpToolCall') {
185
+ const server = (0, event_mapper_1.readStringField)(item, 'server');
186
+ const tool = (0, event_mapper_1.readStringField)(item, 'tool');
187
+ if (!server && !tool)
188
+ return null;
189
+ return boundDetailText([server, tool].filter(Boolean).join('.'));
190
+ }
191
+ if (type === 'ImageView') {
192
+ const path = (0, event_mapper_1.readStringField)(item, 'path');
193
+ return path ? boundDetailText(path) : null;
194
+ }
195
+ if (type === 'Extension') {
196
+ const query = (0, event_mapper_1.readStringField)(item, 'query') ?? (0, event_mapper_1.readStringField)(item, 'action');
197
+ return query ? boundDetailText(collapseToLine(query)) : null;
198
+ }
199
+ return null;
200
+ }
201
+ /** `parsed_cmd[].cmd`, joined. */
202
+ function readParsedCommand(value) {
203
+ if (!Array.isArray(value))
204
+ return null;
205
+ const parts = [];
206
+ for (const entry of value) {
207
+ if (!(0, event_mapper_1.isPlainObject)(entry))
208
+ continue;
209
+ const cmd = (0, event_mapper_1.readStringField)(entry, 'cmd');
210
+ if (cmd)
211
+ parts.push(cmd);
212
+ }
213
+ return parts.length > 0 ? parts.join(' ; ') : null;
214
+ }
215
+ /** `command`, joined with spaces. */
216
+ function readArgv(value) {
217
+ if (!Array.isArray(value))
218
+ return null;
219
+ const parts = value.filter((entry) => typeof entry === 'string');
220
+ return parts.length > 0 ? parts.join(' ') : null;
221
+ }
222
+ /** A tool detail on one line. A heredoc puts newlines in a shell command. */
223
+ function collapseToLine(value) {
224
+ return value.replace(/\s+/g, ' ').trim();
225
+ }
226
+ function boundDetailText(value) {
227
+ return value.length <= exports.MAX_CODEX_TOOL_DETAIL_LENGTH
228
+ ? value
229
+ : `${value.slice(0, exports.MAX_CODEX_TOOL_DETAIL_LENGTH - 1)}…`;
230
+ }
231
+ /**
232
+ * Read one parsed rollout line.
233
+ *
234
+ * @returns The record, or null when the value is not an object with a `type`
235
+ */
236
+ function readCodexRolloutRecord(value) {
237
+ if (!(0, event_mapper_1.isPlainObject)(value))
238
+ return null;
239
+ const type = (0, event_mapper_1.readStringField)(value, 'type');
240
+ if (!type)
241
+ return null;
242
+ const payload = (0, event_mapper_1.isPlainObject)(value.payload) ? value.payload : null;
243
+ const payloadType = payload ? (0, event_mapper_1.readStringField)(payload, 'type') : null;
244
+ const timestamp = (0, event_mapper_1.readStringField)(value, 'timestamp');
245
+ const parsed = timestamp ? Date.parse(timestamp) : NaN;
246
+ return {
247
+ type,
248
+ payloadType,
249
+ turnId: payload ? (0, event_mapper_1.readStringField)(payload, 'turn_id') : null,
250
+ sessionId: payload
251
+ ? ((0, event_mapper_1.readStringField)(payload, 'session_id') ?? (0, event_mapper_1.readStringField)(payload, 'thread_id'))
252
+ : null,
253
+ timestampMs: Number.isFinite(parsed) ? parsed : null,
254
+ item: payload && payloadType === 'item_completed' ? readCodexRolloutItem(payload.item) : null,
255
+ };
256
+ }
257
+ /**
258
+ * Parse a slice of a rollout file, one line at a time.
259
+ *
260
+ * A line that does not parse is counted and dropped; the rest of the slice is
261
+ * still read. That is the whole answer to "the file is being appended to while
262
+ * we read it" — the only line a concurrent write can damage is the last one, and
263
+ * losing it costs this poll rather than the file.
264
+ *
265
+ * @param text - The bytes read, decoded as UTF-8
266
+ */
267
+ function parseCodexRollout(text) {
268
+ const records = [];
269
+ let malformedLines = 0;
270
+ for (const line of text.split('\n')) {
271
+ if (line.trim().length === 0)
272
+ continue;
273
+ let parsed;
274
+ try {
275
+ parsed = JSON.parse(line);
276
+ }
277
+ catch {
278
+ malformedLines += 1;
279
+ continue;
280
+ }
281
+ const record = readCodexRolloutRecord(parsed);
282
+ if (record)
283
+ records.push(record);
284
+ else
285
+ malformedLines += 1;
286
+ }
287
+ return { records, malformedLines };
288
+ }
289
+ /**
290
+ * Group a rollout's records into turns.
291
+ *
292
+ * Keyed on `turn_id` rather than on file order, which is what lets the
293
+ * `token_count` and `thread_settings_applied` records that codex interleaves
294
+ * between a turn's items sit between them without splitting the turn. The map
295
+ * preserves first-seen order, so the newest turn is still the last one.
296
+ *
297
+ * @param records - In file order
298
+ * @param sessionId - Fallback for records that carry no session id
299
+ */
300
+ function buildCodexTurns(records, sessionId) {
301
+ const turns = new Map();
302
+ let duplicateStreamRecords = 0;
303
+ let turnlessRecords = 0;
304
+ let fileSessionId = null;
305
+ for (const record of records) {
306
+ if (record.type === 'session_meta' && record.sessionId)
307
+ fileSessionId = record.sessionId;
308
+ if (record.type === 'response_item') {
309
+ duplicateStreamRecords += 1;
310
+ continue;
311
+ }
312
+ const turnId = record.turnId;
313
+ if (!turnId) {
314
+ turnlessRecords += 1;
315
+ continue;
316
+ }
317
+ let turn = turns.get(turnId);
318
+ if (!turn) {
319
+ turn = {
320
+ sessionId: record.sessionId ?? fileSessionId ?? sessionId,
321
+ turnId,
322
+ startedAt: record.timestampMs ?? 0,
323
+ prompts: [],
324
+ items: [],
325
+ closed: false,
326
+ overflowed: false,
327
+ };
328
+ turns.set(turnId, turn);
329
+ }
330
+ if (record.payloadType === 'task_complete') {
331
+ turn.closed = true;
332
+ continue;
333
+ }
334
+ const item = record.item;
335
+ if (!item)
336
+ continue;
337
+ if (item.type === 'UserMessage') {
338
+ if (item.id && item.text) {
339
+ turn.prompts.push({
340
+ itemId: item.id,
341
+ text: item.text,
342
+ timestampMs: record.timestampMs ?? turn.startedAt,
343
+ });
344
+ }
345
+ continue;
346
+ }
347
+ if (turn.items.length >= exports.MAX_CODEX_TURN_ITEMS) {
348
+ turn.overflowed = true;
349
+ continue;
350
+ }
351
+ turn.items.push(item);
352
+ }
353
+ return { turns: [...turns.values()], duplicateStreamRecords, turnlessRecords };
354
+ }
355
+ /**
356
+ * Item types that carry nothing a reader wants.
357
+ *
358
+ * A deny set rather than an allow set, for the reason the other two readers
359
+ * give: an item type a later codex adds should surface in the unknown tally
360
+ * instead of being silently equivalent to something that was checked.
361
+ * `ContextCompaction` is on it because its whole payload is `{type, id}` —
362
+ * measured on 53 archived items, every one of them with no other field.
363
+ */
364
+ const CODEX_SILENT_ITEM_TYPES = new Set(['ContextCompaction']);
365
+ /** The word each tool item is labelled with on its summary line. */
366
+ const CODEX_TOOL_LABELS = {
367
+ CommandExecution: 'exec',
368
+ FileChange: 'edit',
369
+ McpToolCall: 'mcp',
370
+ ImageView: 'view',
371
+ Extension: 'extension',
372
+ };
373
+ /** One tool call as a single Markdown line. */
374
+ function renderToolItem(item) {
375
+ const label = CODEX_TOOL_LABELS[item.type] ?? item.type;
376
+ return item.detail ? `- \`${label}\` — ${item.detail}` : `- \`${label}\``;
377
+ }
378
+ /**
379
+ * A reasoning summary, folded.
380
+ *
381
+ * A blockquote and not `<details>`, for the reason `../opencode/transcript`
382
+ * documents: `<details>` would require running raw HTML through the card's
383
+ * sanitiser, and that costs every unfenced `<T>` in ordinary prose.
384
+ */
385
+ function renderReasoningItem(text) {
386
+ const quoted = text
387
+ .trim()
388
+ .split('\n')
389
+ .map((line) => (line.length > 0 ? `> ${line}` : '>'))
390
+ .join('\n');
391
+ return `> **${exports.CODEX_THINKING_LABEL}**\n>\n${quoted}`;
392
+ }
393
+ /**
394
+ * Render one turn to Markdown.
395
+ *
396
+ * Transcript order within each kind — the same decision #2041 and #2121 took,
397
+ * and for the same reason: the order is the only record of what happened when,
398
+ * and this row is the record. Both `commentary` and `final_answer` messages are
399
+ * kept; codex's TUI shows both, and dropping the commentary would remove the
400
+ * sentence that explains what the tool line underneath it is for.
401
+ *
402
+ * The layout — prose first, the calls folded into one labelled section — is
403
+ * `../turn-body`'s and is shared with the other three readers (#2234).
404
+ */
405
+ function renderCodexTurn(turn) {
406
+ const rendered = [];
407
+ const unknown = new Set();
408
+ let textBlocks = 0;
409
+ let toolBlocks = 0;
410
+ for (const item of turn.items) {
411
+ if (item.type === 'AgentMessage') {
412
+ const text = item.text?.trim() ?? '';
413
+ if (text.length === 0)
414
+ continue;
415
+ rendered.push({ kind: 'prose', text });
416
+ textBlocks += 1;
417
+ continue;
418
+ }
419
+ if (item.type === 'Reasoning') {
420
+ const text = item.text?.trim() ?? '';
421
+ if (text.length === 0)
422
+ continue;
423
+ rendered.push({ kind: 'aside', text: renderReasoningItem(text) });
424
+ continue;
425
+ }
426
+ if (item.type in CODEX_TOOL_LABELS) {
427
+ rendered.push({ kind: 'tool', text: renderToolItem(item) });
428
+ toolBlocks += 1;
429
+ continue;
430
+ }
431
+ if (!CODEX_SILENT_ITEM_TYPES.has(item.type))
432
+ unknown.add(item.type);
433
+ }
434
+ let body = (0, turn_body_1.separateTurnBody)(rendered).body;
435
+ if (body.length > exports.MAX_CODEX_TURN_BODY_LENGTH) {
436
+ body =
437
+ body.slice(0, exports.MAX_CODEX_TURN_BODY_LENGTH - exports.CODEX_TURN_TRUNCATION_MARKER.length) +
438
+ exports.CODEX_TURN_TRUNCATION_MARKER;
439
+ }
440
+ return {
441
+ sessionId: turn.sessionId,
442
+ turnId: turn.turnId,
443
+ body,
444
+ textBlocks,
445
+ toolBlocks,
446
+ unknownBlockTypes: [...unknown],
447
+ };
448
+ }
@@ -220,6 +220,8 @@ exports.copilotAgentEventSource = (0, define_source_1.definePushHookSource)({
220
220
  // measured. Default = Claude's fallback, the time window.
221
221
  eventIdentity: null,
222
222
  resync: 'none',
223
+ // Issue #2197. Nobody but the screen scraper records copilot replies.
224
+ transcriptHistory: null,
223
225
  },
224
226
  // The same CamelCase dialect as Claude and codex — measured against six
225
227
  // captured payloads (#1757 §8.1), not assumed from the resemblance. Shared
@@ -132,6 +132,8 @@ exports.geminiAgentEventSource = (0, define_source_1.definePushHookSource)({
132
132
  permissionReplyReleasesPrompt: false,
133
133
  eventIdentity: null,
134
134
  resync: 'none',
135
+ // Issue #2197. Nobody but the screen scraper records gemini replies.
136
+ transcriptHistory: null,
135
137
  },
136
138
  // gemini's own table, kept in gemini's own module: four of the seven are
137
139
  // spelled differently, and merging them into the shared CamelCase table would
@@ -67,6 +67,9 @@ function createLegacyRelaySource(cliToolId) {
67
67
  permissionReplyReleasesPrompt: false,
68
68
  eventIdentity: null,
69
69
  resync: 'none',
70
+ // Issue #2197. A tool on the compatibility relay has no reader, which
71
+ // is the same "nobody has measured this" the empty event list states.
72
+ transcriptHistory: null,
70
73
  },
71
74
  mappers: (0, event_mapper_1.fromNameTable)(hook_event_vocabulary_1.CAMEL_CASE_HOOK_EVENT_NAMES),
72
75
  nativeEventNameFields: ['hook_event_name'],
@@ -254,6 +254,11 @@ function recordOpencodeTranscriptFrame(target, frame, receivedAt) {
254
254
  partType: part.type,
255
255
  });
256
256
  }
257
+ // Issue #2199: the chat surface's live body. Fire-and-forget — this function
258
+ // is on the SSE reader's hot path and its contract is that a frame is
259
+ // accounted for by the time it returns; awaiting a broadcast would make the
260
+ // accumulator's correctness depend on a WebSocket.
261
+ void publishOpencodeTurnProgress(target, turn);
257
262
  }
258
263
  catch (error) {
259
264
  logger.error('opencode-transcript-record-failed', {
@@ -263,6 +268,58 @@ function recordOpencodeTranscriptFrame(target, frame, receivedAt) {
263
268
  });
264
269
  }
265
270
  }
271
+ /**
272
+ * Push the open turn's body to the chat surface (Issue #2199).
273
+ *
274
+ * The push half of the same fact `flushOpencodeTurn` eventually writes, and
275
+ * deliberately built from the SAME accumulator through the SAME
276
+ * `renderOpencodeTurn`: a live body rendered by a second, "cheaper" path would
277
+ * differ from the row that replaces it, and the replacement would read as the
278
+ * reply changing its mind at the moment it finished.
279
+ *
280
+ * `opencodeTurnRequestId(turn.userMessageId)` is the key on both sides, so the
281
+ * client's swap is a string comparison and needs no notion of ordering. Which is
282
+ * what makes the re-sent boundary frames harmless twice over: the accumulator
283
+ * overwrites a repeat into the same `prt_…` slot (see `./transcript`), so the
284
+ * rendered body is byte-identical and the shared builder's no-change rule drops
285
+ * it before it reaches the wire.
286
+ *
287
+ * The import is dynamic for the reason every database import in this file is:
288
+ * `current-output-builder` statically imports `@/lib/db`, and a static import
289
+ * here would put `better-sqlite3` into the graph of everything that imports
290
+ * `@/lib/hooks/sources`.
291
+ *
292
+ * Never throws.
293
+ */
294
+ async function publishOpencodeTurnProgress(target, turn) {
295
+ try {
296
+ const { emitChatTurnProgress } = await Promise.resolve().then(() => __importStar(require('../../../../lib/session/current-output-builder')));
297
+ await emitChatTurnProgress({
298
+ worktreeId: target.worktreeId,
299
+ cliToolId: target.cliToolId,
300
+ instanceId: target.instanceId ?? target.cliToolId,
301
+ }, () => {
302
+ const rendered = (0, transcript_1.renderOpencodeTurn)(turn);
303
+ if (rendered.body.length === 0)
304
+ return null;
305
+ return {
306
+ turnKey: (0, agent_transcript_1.opencodeTurnRequestId)(rendered.userMessageId),
307
+ body: rendered.body,
308
+ // The stream carries the turn from its first part, so nothing is ever
309
+ // missing from the head. The only cut this body can take is the
310
+ // shared builder's size bound, which reports itself.
311
+ partial: false,
312
+ };
313
+ });
314
+ }
315
+ catch (error) {
316
+ logger.debug('opencode-transcript-progress-failed', {
317
+ worktreeId: target.worktreeId,
318
+ instanceId: target.instanceId ?? target.cliToolId,
319
+ error: error instanceof Error ? error.message : String(error),
320
+ });
321
+ }
322
+ }
266
323
  /**
267
324
  * The turn currently open on this session, for tests and for callers that need
268
325
  * to know whether a flush would do anything.
@@ -321,6 +321,10 @@ exports.opencodeAgentEventSource = (0, define_source_1.definePullEventSource)({
321
321
  // both back to the pre-#1900 behaviour, which is what the mutation case in
322
322
  // `tests/unit/hooks/sources/opencode-resilience-1900.test.ts` asserts.
323
323
  resync: 'session-status-poll',
324
+ // Issue #2197. opencode is the push half: `./history` is already writing
325
+ // the reply out of the SSE stream, so the gate asks whether the
326
+ // subscription is live rather than asking for the turn.
327
+ transcriptHistory: 'push',
324
328
  },
325
329
  // C4. Predicates, not a name table: see ./mappers.
326
330
  mappers: mappers_1.OPENCODE_MAPPERS,
@@ -63,6 +63,7 @@ exports.addOpencodePart = addOpencodePart;
63
63
  exports.renderOpencodeTurn = renderOpencodeTurn;
64
64
  exports.buildOpencodeTurnsFromMessages = buildOpencodeTurnsFromMessages;
65
65
  const event_mapper_1 = require("../event-mapper");
66
+ const turn_body_1 = require("../turn-body");
66
67
  /**
67
68
  * The field that groups assistant messages into one turn.
68
69
  *
@@ -239,10 +240,11 @@ function renderReasoningPart(text) {
239
240
  /**
240
241
  * Render one turn to Markdown.
241
242
  *
242
- * Stream order throughout a tool line sits where the agent called it and
243
- * reasoning sits where the agent thought it. Reordering to put prose first
244
- * would read better in the two-line collapsed preview and is not done: the
245
- * order is the only record of what happened when, and this row is the record.
243
+ * Stream order within each kind reasoning sits where the agent thought it and
244
+ * the calls are in the order they were made. #2041 kept one stream for all of
245
+ * them and #2234 split the tool calls out into a section of their own; the
246
+ * layout is `../turn-body`'s, shared with the other three readers, and
247
+ * {@link separateTurnBody} carries the reasoning for both halves of that.
246
248
  *
247
249
  * @param turn - The accumulator, live or rebuilt from REST
248
250
  */
@@ -258,7 +260,7 @@ function renderOpencodeTurn(turn) {
258
260
  const text = part.text?.trim() ?? '';
259
261
  if (text.length === 0)
260
262
  continue;
261
- blocks.push(text);
263
+ blocks.push({ kind: 'prose', text });
262
264
  textParts += 1;
263
265
  continue;
264
266
  }
@@ -266,7 +268,7 @@ function renderOpencodeTurn(turn) {
266
268
  const text = part.text?.trim() ?? '';
267
269
  if (text.length === 0)
268
270
  continue;
269
- blocks.push(renderReasoningPart(text));
271
+ blocks.push({ kind: 'aside', text: renderReasoningPart(text) });
270
272
  continue;
271
273
  }
272
274
  if (part.type === 'tool') {
@@ -275,14 +277,14 @@ function renderOpencodeTurn(turn) {
275
277
  // a call was still running has nothing to summarise but its name.
276
278
  if (part.status === 'pending')
277
279
  continue;
278
- blocks.push(renderToolPart(part));
280
+ blocks.push({ kind: 'tool', text: renderToolPart(part) });
279
281
  toolParts += 1;
280
282
  continue;
281
283
  }
282
284
  if (!OPENCODE_SILENT_PART_TYPES.has(part.type))
283
285
  unknown.add(part.type);
284
286
  }
285
- let body = joinTurnBlocks(blocks);
287
+ let body = (0, turn_body_1.separateTurnBody)(blocks).body;
286
288
  if (body.length > exports.MAX_OPENCODE_TURN_BODY_LENGTH) {
287
289
  body =
288
290
  body.slice(0, exports.MAX_OPENCODE_TURN_BODY_LENGTH - exports.OPENCODE_TURN_TRUNCATION_MARKER.length) +
@@ -297,26 +299,6 @@ function renderOpencodeTurn(turn) {
297
299
  unknownPartTypes: [...unknown],
298
300
  };
299
301
  }
300
- /**
301
- * Join the rendered blocks.
302
- *
303
- * Consecutive tool lines are joined with a single newline so they stay one
304
- * Markdown list; everything else is separated by a blank line, which is what
305
- * makes a paragraph a paragraph and stops a heading being absorbed into the
306
- * text above it.
307
- */
308
- function joinTurnBlocks(blocks) {
309
- let out = '';
310
- for (let i = 0; i < blocks.length; i += 1) {
311
- if (i === 0) {
312
- out = blocks[i];
313
- continue;
314
- }
315
- const bothToolLines = blocks[i].startsWith('- `') && blocks[i - 1].startsWith('- `');
316
- out += bothToolLines ? `\n${blocks[i]}` : `\n\n${blocks[i]}`;
317
- }
318
- return out;
319
- }
320
302
  /**
321
303
  * Rebuild every turn of a session from `GET /session/:id/message`.
322
304
  *