commandmate 0.30.1 → 0.31.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 (442) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-build-manifest.json +164 -164
  3. package/.next/app-path-routes-manifest.json +28 -28
  4. package/.next/build-manifest.json +2 -2
  5. package/.next/prerender-manifest.json +9 -9
  6. package/.next/required-server-files.json +1 -1
  7. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  8. package/.next/server/app/api/agents/update/route_client-reference-manifest.js +1 -1
  9. package/.next/server/app/api/agents/versions/route_client-reference-manifest.js +1 -1
  10. package/.next/server/app/api/app/update/route_client-reference-manifest.js +1 -1
  11. package/.next/server/app/api/app/update-check/route.js +1 -1
  12. package/.next/server/app/api/app/update-check/route_client-reference-manifest.js +1 -1
  13. package/.next/server/app/api/assistant/conversation/route.js +1 -1
  14. package/.next/server/app/api/assistant/conversation/route.js.nft.json +1 -1
  15. package/.next/server/app/api/assistant/conversation/route_client-reference-manifest.js +1 -1
  16. package/.next/server/app/api/assistant/current-output/route.js +1 -1
  17. package/.next/server/app/api/assistant/current-output/route.js.nft.json +1 -1
  18. package/.next/server/app/api/assistant/current-output/route_client-reference-manifest.js +1 -1
  19. package/.next/server/app/api/assistant/messages/route.js +1 -1
  20. package/.next/server/app/api/assistant/messages/route.js.nft.json +1 -1
  21. package/.next/server/app/api/assistant/messages/route_client-reference-manifest.js +1 -1
  22. package/.next/server/app/api/assistant/session/route.js +1 -1
  23. package/.next/server/app/api/assistant/session/route.js.nft.json +1 -1
  24. package/.next/server/app/api/assistant/session/route_client-reference-manifest.js +1 -1
  25. package/.next/server/app/api/assistant/start/route.js +3 -3
  26. package/.next/server/app/api/assistant/start/route.js.nft.json +1 -1
  27. package/.next/server/app/api/assistant/start/route_client-reference-manifest.js +1 -1
  28. package/.next/server/app/api/assistant/terminal/route.js +4 -4
  29. package/.next/server/app/api/assistant/terminal/route.js.nft.json +1 -1
  30. package/.next/server/app/api/assistant/terminal/route_client-reference-manifest.js +1 -1
  31. package/.next/server/app/api/assistant/tools/route.js +1 -1
  32. package/.next/server/app/api/assistant/tools/route.js.nft.json +1 -1
  33. package/.next/server/app/api/assistant/tools/route_client-reference-manifest.js +1 -1
  34. package/.next/server/app/api/auth/login/route_client-reference-manifest.js +1 -1
  35. package/.next/server/app/api/auth/logout/route_client-reference-manifest.js +1 -1
  36. package/.next/server/app/api/auth/status/route_client-reference-manifest.js +1 -1
  37. package/.next/server/app/api/capabilities/route.js +1 -1
  38. package/.next/server/app/api/capabilities/route_client-reference-manifest.js +1 -1
  39. package/.next/server/app/api/daily-summary/route_client-reference-manifest.js +1 -1
  40. package/.next/server/app/api/daily-summary/status/route_client-reference-manifest.js +1 -1
  41. package/.next/server/app/api/external-apps/[id]/health/route_client-reference-manifest.js +1 -1
  42. package/.next/server/app/api/external-apps/[id]/route_client-reference-manifest.js +1 -1
  43. package/.next/server/app/api/external-apps/route_client-reference-manifest.js +1 -1
  44. package/.next/server/app/api/fs/browse/route_client-reference-manifest.js +1 -1
  45. package/.next/server/app/api/fs/recent-paths/route_client-reference-manifest.js +1 -1
  46. package/.next/server/app/api/hooks/agent-event/route.js +1 -1
  47. package/.next/server/app/api/hooks/agent-event/route.js.nft.json +1 -1
  48. package/.next/server/app/api/hooks/agent-event/route_client-reference-manifest.js +1 -1
  49. package/.next/server/app/api/hooks/claude-done/route.js +1 -1
  50. package/.next/server/app/api/hooks/claude-done/route.js.nft.json +1 -1
  51. package/.next/server/app/api/hooks/claude-done/route_client-reference-manifest.js +1 -1
  52. package/.next/server/app/api/hooks/permission-request/route.js +1 -1
  53. package/.next/server/app/api/hooks/permission-request/route.js.nft.json +1 -1
  54. package/.next/server/app/api/hooks/permission-request/route_client-reference-manifest.js +1 -1
  55. package/.next/server/app/api/metrics/vibe/route_client-reference-manifest.js +1 -1
  56. package/.next/server/app/api/ollama/models/route_client-reference-manifest.js +1 -1
  57. package/.next/server/app/api/push/escalation/route_client-reference-manifest.js +1 -1
  58. package/.next/server/app/api/push/subscriptions/route_client-reference-manifest.js +1 -1
  59. package/.next/server/app/api/push/vapid/route_client-reference-manifest.js +1 -1
  60. package/.next/server/app/api/remote/pair/route_client-reference-manifest.js +1 -1
  61. package/.next/server/app/api/repositories/[id]/route_client-reference-manifest.js +1 -1
  62. package/.next/server/app/api/repositories/[id]/todos/[todoId]/route_client-reference-manifest.js +1 -1
  63. package/.next/server/app/api/repositories/[id]/todos/route_client-reference-manifest.js +1 -1
  64. package/.next/server/app/api/repositories/clone/[jobId]/route.js +1 -1
  65. package/.next/server/app/api/repositories/clone/[jobId]/route.js.nft.json +1 -1
  66. package/.next/server/app/api/repositories/clone/[jobId]/route_client-reference-manifest.js +1 -1
  67. package/.next/server/app/api/repositories/clone/route.js +1 -1
  68. package/.next/server/app/api/repositories/clone/route.js.nft.json +1 -1
  69. package/.next/server/app/api/repositories/clone/route_client-reference-manifest.js +1 -1
  70. package/.next/server/app/api/repositories/excluded/route_client-reference-manifest.js +1 -1
  71. package/.next/server/app/api/repositories/restore/route.js +1 -1
  72. package/.next/server/app/api/repositories/restore/route.js.nft.json +1 -1
  73. package/.next/server/app/api/repositories/restore/route_client-reference-manifest.js +1 -1
  74. package/.next/server/app/api/repositories/route.js +1 -1
  75. package/.next/server/app/api/repositories/route.js.nft.json +1 -1
  76. package/.next/server/app/api/repositories/route_client-reference-manifest.js +1 -1
  77. package/.next/server/app/api/repositories/scan/route.js +1 -1
  78. package/.next/server/app/api/repositories/scan/route.js.nft.json +1 -1
  79. package/.next/server/app/api/repositories/scan/route_client-reference-manifest.js +1 -1
  80. package/.next/server/app/api/repositories/sync/route.js +1 -1
  81. package/.next/server/app/api/repositories/sync/route.js.nft.json +1 -1
  82. package/.next/server/app/api/repositories/sync/route_client-reference-manifest.js +1 -1
  83. package/.next/server/app/api/repositories/validate-path/route_client-reference-manifest.js +1 -1
  84. package/.next/server/app/api/settings/default-agents/route.js +1 -1
  85. package/.next/server/app/api/settings/default-agents/route.js.nft.json +1 -1
  86. package/.next/server/app/api/settings/default-agents/route_client-reference-manifest.js +1 -1
  87. package/.next/server/app/api/settings/default-surface-mode/route_client-reference-manifest.js +1 -1
  88. package/.next/server/app/api/sidebar/group-order/route_client-reference-manifest.js +1 -1
  89. package/.next/server/app/api/skills/[id]/route.js +1 -1
  90. package/.next/server/app/api/skills/[id]/route_client-reference-manifest.js +1 -1
  91. package/.next/server/app/api/skills/installations/route_client-reference-manifest.js +1 -1
  92. package/.next/server/app/api/skills/operations/route_client-reference-manifest.js +1 -1
  93. package/.next/server/app/api/skills/reindex/route_client-reference-manifest.js +1 -1
  94. package/.next/server/app/api/skills/route.js +1 -1
  95. package/.next/server/app/api/skills/route_client-reference-manifest.js +1 -1
  96. package/.next/server/app/api/slash-commands/route.js +1 -1
  97. package/.next/server/app/api/slash-commands/route_client-reference-manifest.js +1 -1
  98. package/.next/server/app/api/tasks/[taskId]/cancel/route_client-reference-manifest.js +1 -1
  99. package/.next/server/app/api/tasks/[taskId]/route_client-reference-manifest.js +1 -1
  100. package/.next/server/app/api/templates/[id]/route_client-reference-manifest.js +1 -1
  101. package/.next/server/app/api/templates/route_client-reference-manifest.js +1 -1
  102. package/.next/server/app/api/todos/route_client-reference-manifest.js +1 -1
  103. package/.next/server/app/api/verification/runs/[runId]/route_client-reference-manifest.js +1 -1
  104. package/.next/server/app/api/verification/runs/route_client-reference-manifest.js +1 -1
  105. package/.next/server/app/api/worktrees/[id]/auto-yes/route.js +1 -1
  106. package/.next/server/app/api/worktrees/[id]/auto-yes/route.js.nft.json +1 -1
  107. package/.next/server/app/api/worktrees/[id]/auto-yes/route_client-reference-manifest.js +1 -1
  108. package/.next/server/app/api/worktrees/[id]/capture/route.js +1 -1
  109. package/.next/server/app/api/worktrees/[id]/capture/route.js.nft.json +1 -1
  110. package/.next/server/app/api/worktrees/[id]/capture/route_client-reference-manifest.js +1 -1
  111. package/.next/server/app/api/worktrees/[id]/clear-composer/route.js +1 -1
  112. package/.next/server/app/api/worktrees/[id]/clear-composer/route.js.nft.json +1 -1
  113. package/.next/server/app/api/worktrees/[id]/clear-composer/route_client-reference-manifest.js +1 -1
  114. package/.next/server/app/api/worktrees/[id]/cli-reference/route_client-reference-manifest.js +1 -1
  115. package/.next/server/app/api/worktrees/[id]/cli-tool/route_client-reference-manifest.js +1 -1
  116. package/.next/server/app/api/worktrees/[id]/cmate/schedules/route_client-reference-manifest.js +1 -1
  117. package/.next/server/app/api/worktrees/[id]/current-output/route.js +1 -1
  118. package/.next/server/app/api/worktrees/[id]/current-output/route.js.nft.json +1 -1
  119. package/.next/server/app/api/worktrees/[id]/current-output/route_client-reference-manifest.js +1 -1
  120. package/.next/server/app/api/worktrees/[id]/env/route_client-reference-manifest.js +1 -1
  121. package/.next/server/app/api/worktrees/[id]/execution-logs/[logId]/route.js +1 -1
  122. package/.next/server/app/api/worktrees/[id]/execution-logs/[logId]/route_client-reference-manifest.js +1 -1
  123. package/.next/server/app/api/worktrees/[id]/execution-logs/route_client-reference-manifest.js +1 -1
  124. package/.next/server/app/api/worktrees/[id]/files/[...path]/route.js +1 -1
  125. package/.next/server/app/api/worktrees/[id]/files/[...path]/route_client-reference-manifest.js +1 -1
  126. package/.next/server/app/api/worktrees/[id]/git/branch/create/route_client-reference-manifest.js +1 -1
  127. package/.next/server/app/api/worktrees/[id]/git/branch/delete/route_client-reference-manifest.js +1 -1
  128. package/.next/server/app/api/worktrees/[id]/git/branches/route_client-reference-manifest.js +1 -1
  129. package/.next/server/app/api/worktrees/[id]/git/checkout/route_client-reference-manifest.js +1 -1
  130. package/.next/server/app/api/worktrees/[id]/git/commit/route_client-reference-manifest.js +1 -1
  131. package/.next/server/app/api/worktrees/[id]/git/diff/route_client-reference-manifest.js +1 -1
  132. package/.next/server/app/api/worktrees/[id]/git/fetch/route_client-reference-manifest.js +1 -1
  133. package/.next/server/app/api/worktrees/[id]/git/log/route_client-reference-manifest.js +1 -1
  134. package/.next/server/app/api/worktrees/[id]/git/pull/route_client-reference-manifest.js +1 -1
  135. package/.next/server/app/api/worktrees/[id]/git/push/route_client-reference-manifest.js +1 -1
  136. package/.next/server/app/api/worktrees/[id]/git/reset/route_client-reference-manifest.js +1 -1
  137. package/.next/server/app/api/worktrees/[id]/git/revert/route_client-reference-manifest.js +1 -1
  138. package/.next/server/app/api/worktrees/[id]/git/show/[commitHash]/route_client-reference-manifest.js +1 -1
  139. package/.next/server/app/api/worktrees/[id]/git/stage/route_client-reference-manifest.js +1 -1
  140. package/.next/server/app/api/worktrees/[id]/git/staged/route_client-reference-manifest.js +1 -1
  141. package/.next/server/app/api/worktrees/[id]/git/stash/[index]/route_client-reference-manifest.js +1 -1
  142. package/.next/server/app/api/worktrees/[id]/git/stash/apply/route_client-reference-manifest.js +1 -1
  143. package/.next/server/app/api/worktrees/[id]/git/stash/pop/route_client-reference-manifest.js +1 -1
  144. package/.next/server/app/api/worktrees/[id]/git/stash/push/route_client-reference-manifest.js +1 -1
  145. package/.next/server/app/api/worktrees/[id]/git/stash/route_client-reference-manifest.js +1 -1
  146. package/.next/server/app/api/worktrees/[id]/git/status/route_client-reference-manifest.js +1 -1
  147. package/.next/server/app/api/worktrees/[id]/git/unstage/route_client-reference-manifest.js +1 -1
  148. package/.next/server/app/api/worktrees/[id]/git/working-diff/route_client-reference-manifest.js +1 -1
  149. package/.next/server/app/api/worktrees/[id]/instances/opencode/route.js.nft.json +1 -1
  150. package/.next/server/app/api/worktrees/[id]/instances/opencode/route_client-reference-manifest.js +1 -1
  151. package/.next/server/app/api/worktrees/[id]/interrupt/route.js +1 -1
  152. package/.next/server/app/api/worktrees/[id]/interrupt/route.js.nft.json +1 -1
  153. package/.next/server/app/api/worktrees/[id]/interrupt/route_client-reference-manifest.js +1 -1
  154. package/.next/server/app/api/worktrees/[id]/kill-session/route.js +1 -1
  155. package/.next/server/app/api/worktrees/[id]/kill-session/route.js.nft.json +1 -1
  156. package/.next/server/app/api/worktrees/[id]/kill-session/route_client-reference-manifest.js +1 -1
  157. package/.next/server/app/api/worktrees/[id]/logs/[filename]/route_client-reference-manifest.js +1 -1
  158. package/.next/server/app/api/worktrees/[id]/logs/route_client-reference-manifest.js +1 -1
  159. package/.next/server/app/api/worktrees/[id]/marp-render/route_client-reference-manifest.js +1 -1
  160. package/.next/server/app/api/worktrees/[id]/memos/[memoId]/route_client-reference-manifest.js +1 -1
  161. package/.next/server/app/api/worktrees/[id]/memos/route_client-reference-manifest.js +1 -1
  162. package/.next/server/app/api/worktrees/[id]/messages/route_client-reference-manifest.js +1 -1
  163. package/.next/server/app/api/worktrees/[id]/opencode/diff/route_client-reference-manifest.js +1 -1
  164. package/.next/server/app/api/worktrees/[id]/opencode/session/route_client-reference-manifest.js +1 -1
  165. package/.next/server/app/api/worktrees/[id]/opencode/share/route_client-reference-manifest.js +1 -1
  166. package/.next/server/app/api/worktrees/[id]/prompt-response/route.js +1 -1
  167. package/.next/server/app/api/worktrees/[id]/prompt-response/route.js.nft.json +1 -1
  168. package/.next/server/app/api/worktrees/[id]/prompt-response/route_client-reference-manifest.js +1 -1
  169. package/.next/server/app/api/worktrees/[id]/resolve-target/route_client-reference-manifest.js +1 -1
  170. package/.next/server/app/api/worktrees/[id]/respond/route.js +1 -1
  171. package/.next/server/app/api/worktrees/[id]/respond/route.js.nft.json +1 -1
  172. package/.next/server/app/api/worktrees/[id]/respond/route_client-reference-manifest.js +1 -1
  173. package/.next/server/app/api/worktrees/[id]/route.js +1 -1
  174. package/.next/server/app/api/worktrees/[id]/route.js.nft.json +1 -1
  175. package/.next/server/app/api/worktrees/[id]/route_client-reference-manifest.js +1 -1
  176. package/.next/server/app/api/worktrees/[id]/schedules/[scheduleId]/route.js +4 -3
  177. package/.next/server/app/api/worktrees/[id]/schedules/[scheduleId]/route_client-reference-manifest.js +1 -1
  178. package/.next/server/app/api/worktrees/[id]/schedules/active/route_client-reference-manifest.js +1 -1
  179. package/.next/server/app/api/worktrees/[id]/schedules/route.js +4 -3
  180. package/.next/server/app/api/worktrees/[id]/schedules/route_client-reference-manifest.js +1 -1
  181. package/.next/server/app/api/worktrees/[id]/search/route_client-reference-manifest.js +1 -1
  182. package/.next/server/app/api/worktrees/[id]/send/route.js +1 -1
  183. package/.next/server/app/api/worktrees/[id]/send/route.js.nft.json +1 -1
  184. package/.next/server/app/api/worktrees/[id]/send/route_client-reference-manifest.js +1 -1
  185. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route.js +2 -2
  186. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route.js.nft.json +1 -1
  187. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route_client-reference-manifest.js +1 -1
  188. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/install/route_client-reference-manifest.js +1 -1
  189. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/plan/route_client-reference-manifest.js +1 -1
  190. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall/route_client-reference-manifest.js +1 -1
  191. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall-plan/route_client-reference-manifest.js +1 -1
  192. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/update/route_client-reference-manifest.js +1 -1
  193. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/update-plan/route_client-reference-manifest.js +1 -1
  194. package/.next/server/app/api/worktrees/[id]/skills/route_client-reference-manifest.js +1 -1
  195. package/.next/server/app/api/worktrees/[id]/slash-commands/route.js +1 -1
  196. package/.next/server/app/api/worktrees/[id]/slash-commands/route_client-reference-manifest.js +1 -1
  197. package/.next/server/app/api/worktrees/[id]/special-keys/route.js +1 -1
  198. package/.next/server/app/api/worktrees/[id]/special-keys/route.js.nft.json +1 -1
  199. package/.next/server/app/api/worktrees/[id]/special-keys/route_client-reference-manifest.js +1 -1
  200. package/.next/server/app/api/worktrees/[id]/tasks/route_client-reference-manifest.js +1 -1
  201. package/.next/server/app/api/worktrees/[id]/terminal/route.js +1 -1
  202. package/.next/server/app/api/worktrees/[id]/terminal/route.js.nft.json +1 -1
  203. package/.next/server/app/api/worktrees/[id]/terminal/route_client-reference-manifest.js +1 -1
  204. package/.next/server/app/api/worktrees/[id]/timers/history/route_client-reference-manifest.js +1 -1
  205. package/.next/server/app/api/worktrees/[id]/timers/route.js +1 -1
  206. package/.next/server/app/api/worktrees/[id]/timers/route.js.nft.json +1 -1
  207. package/.next/server/app/api/worktrees/[id]/timers/route_client-reference-manifest.js +1 -1
  208. package/.next/server/app/api/worktrees/[id]/todos/[todoId]/route_client-reference-manifest.js +1 -1
  209. package/.next/server/app/api/worktrees/[id]/todos/route_client-reference-manifest.js +1 -1
  210. package/.next/server/app/api/worktrees/[id]/tree/[...path]/route_client-reference-manifest.js +1 -1
  211. package/.next/server/app/api/worktrees/[id]/tree/route_client-reference-manifest.js +1 -1
  212. package/.next/server/app/api/worktrees/[id]/upload/[...path]/route_client-reference-manifest.js +1 -1
  213. package/.next/server/app/api/worktrees/[id]/verify/config/route_client-reference-manifest.js +1 -1
  214. package/.next/server/app/api/worktrees/[id]/verify/route_client-reference-manifest.js +1 -1
  215. package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/cancel/route_client-reference-manifest.js +1 -1
  216. package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/route_client-reference-manifest.js +1 -1
  217. package/.next/server/app/api/worktrees/[id]/verify/runs/route_client-reference-manifest.js +1 -1
  218. package/.next/server/app/api/worktrees/[id]/viewed/route_client-reference-manifest.js +1 -1
  219. package/.next/server/app/api/worktrees/apply-default-agents/route_client-reference-manifest.js +1 -1
  220. package/.next/server/app/api/worktrees/route.js +1 -1
  221. package/.next/server/app/api/worktrees/route.js.nft.json +1 -1
  222. package/.next/server/app/api/worktrees/route_client-reference-manifest.js +1 -1
  223. package/.next/server/app/chat/page.js +2 -2
  224. package/.next/server/app/chat/page.js.nft.json +1 -1
  225. package/.next/server/app/chat/page_client-reference-manifest.js +1 -1
  226. package/.next/server/app/login/page_client-reference-manifest.js +1 -1
  227. package/.next/server/app/manifest.webmanifest/route_client-reference-manifest.js +1 -1
  228. package/.next/server/app/more/page.js +2 -2
  229. package/.next/server/app/more/page.js.nft.json +1 -1
  230. package/.next/server/app/more/page_client-reference-manifest.js +1 -1
  231. package/.next/server/app/offline/page_client-reference-manifest.js +1 -1
  232. package/.next/server/app/page.js +1 -1
  233. package/.next/server/app/page.js.nft.json +1 -1
  234. package/.next/server/app/page_client-reference-manifest.js +1 -1
  235. package/.next/server/app/proxy/[...path]/route_client-reference-manifest.js +1 -1
  236. package/.next/server/app/repositories/page.js +2 -2
  237. package/.next/server/app/repositories/page.js.nft.json +1 -1
  238. package/.next/server/app/repositories/page_client-reference-manifest.js +1 -1
  239. package/.next/server/app/review/page.js +1 -1
  240. package/.next/server/app/review/page.js.nft.json +1 -1
  241. package/.next/server/app/review/page_client-reference-manifest.js +1 -1
  242. package/.next/server/app/sessions/page.js +1 -1
  243. package/.next/server/app/sessions/page.js.nft.json +1 -1
  244. package/.next/server/app/sessions/page_client-reference-manifest.js +1 -1
  245. package/.next/server/app/skills/[skillId]/page.js +2 -2
  246. package/.next/server/app/skills/[skillId]/page.js.nft.json +1 -1
  247. package/.next/server/app/skills/[skillId]/page_client-reference-manifest.js +1 -1
  248. package/.next/server/app/skills/installed/page.js +2 -2
  249. package/.next/server/app/skills/installed/page.js.nft.json +1 -1
  250. package/.next/server/app/skills/installed/page_client-reference-manifest.js +1 -1
  251. package/.next/server/app/skills/page.js +1 -1
  252. package/.next/server/app/skills/page.js.nft.json +1 -1
  253. package/.next/server/app/skills/page_client-reference-manifest.js +1 -1
  254. package/.next/server/app/worktrees/[id]/files/[...path]/page_client-reference-manifest.js +1 -1
  255. package/.next/server/app/worktrees/[id]/page.js +10 -10
  256. package/.next/server/app/worktrees/[id]/page.js.nft.json +1 -1
  257. package/.next/server/app/worktrees/[id]/page_client-reference-manifest.js +1 -1
  258. package/.next/server/app/worktrees/[id]/terminal/page_client-reference-manifest.js +1 -1
  259. package/.next/server/app-paths-manifest.json +28 -28
  260. package/.next/server/chunks/1058.js +1 -1
  261. package/.next/server/chunks/1068.js +1 -1
  262. package/.next/server/chunks/1262.js +1 -1
  263. package/.next/server/chunks/1886.js +3 -3
  264. package/.next/server/chunks/1990.js +103 -0
  265. package/.next/server/chunks/2119.js +1 -1
  266. package/.next/server/chunks/2328.js +1 -1
  267. package/.next/server/chunks/2404.js +1 -1
  268. package/.next/server/chunks/2445.js +1 -1
  269. package/.next/server/chunks/261.js +1 -1
  270. package/.next/server/chunks/3123.js +1 -1
  271. package/.next/server/chunks/3241.js +1 -1
  272. package/.next/server/chunks/3480.js +5 -4
  273. package/.next/server/chunks/4299.js +1 -1
  274. package/.next/server/chunks/4393.js +1 -1
  275. package/.next/server/chunks/4443.js +1 -5
  276. package/.next/server/chunks/5017.js +1 -1
  277. package/.next/server/chunks/5043.js +1 -1
  278. package/.next/server/chunks/5164.js +1 -1
  279. package/.next/server/chunks/552.js +2 -2
  280. package/.next/server/chunks/6072.js +1 -1
  281. package/.next/server/chunks/6130.js +1 -1
  282. package/.next/server/chunks/663.js +4 -3
  283. package/.next/server/chunks/6894.js +2 -2
  284. package/.next/server/chunks/7187.js +1 -0
  285. package/.next/server/chunks/7472.js +1 -1
  286. package/.next/server/chunks/{880.js → 7859.js} +6 -6
  287. package/.next/server/chunks/7905.js +1 -1
  288. package/.next/server/chunks/8800.js +2 -2
  289. package/.next/server/chunks/8918.js +7 -0
  290. package/.next/server/chunks/9123.js +2 -2
  291. package/.next/server/chunks/9130.js +4 -4
  292. package/.next/server/chunks/9627.js +1 -1
  293. package/.next/server/chunks/9696.js +2 -2
  294. package/.next/server/chunks/9798.js +1 -1
  295. package/.next/server/middleware-manifest.json +5 -5
  296. package/.next/server/pages/500.html +1 -1
  297. package/.next/server/server-reference-manifest.json +1 -1
  298. package/.next/static/chunks/1783-11c9b4d8a52ebd91.js +1 -0
  299. package/.next/static/chunks/4718-de1224c9e8a6e7fc.js +1 -0
  300. package/.next/static/chunks/6022-2fa0b5a82d4ce7b6.js +1 -0
  301. package/.next/static/chunks/{5229-6c89475b61bd2c8b.js → 6170-951b9f5fe6b4b3b5.js} +1 -1
  302. package/.next/static/chunks/app/chat/{page-9aa2011410895b0d.js → page-37d7615d17d7e2a0.js} +1 -1
  303. package/.next/static/chunks/app/layout-4c2f21e3f653ee4c.js +1 -0
  304. package/.next/static/chunks/app/more/{page-333bba1c8bbc9c11.js → page-353a3924e6d7968e.js} +1 -1
  305. package/.next/static/chunks/app/{page-214f7ffa13a0cf10.js → page-c2bf871d953a1d6f.js} +1 -1
  306. package/.next/static/chunks/app/repositories/{page-4951cac905e50224.js → page-7d0f26df0537254c.js} +1 -1
  307. package/.next/static/chunks/app/review/{page-a0899b2d285318c3.js → page-e3f141b2829973e9.js} +1 -1
  308. package/.next/static/chunks/app/sessions/{page-fb36145ec732092a.js → page-53f188ed9ca49e5f.js} +1 -1
  309. package/.next/static/chunks/app/skills/[skillId]/{page-9099e26b60442873.js → page-80569b720aea59cc.js} +1 -1
  310. package/.next/static/chunks/app/skills/installed/{page-182e32368696d824.js → page-dbd2690ad72da95b.js} +1 -1
  311. package/.next/static/chunks/app/skills/{page-d3fdc88239ebe0ab.js → page-dacd36f9c11aa7da.js} +1 -1
  312. package/.next/static/chunks/app/worktrees/[id]/page-97205088520255a5.js +1 -0
  313. package/.next/static/css/5c13ea243dfdcb66.css +1 -0
  314. package/.next/trace +13 -13
  315. package/README.md +37 -11
  316. package/dist/cli/commands/attach.d.ts +50 -0
  317. package/dist/cli/commands/attach.d.ts.map +1 -0
  318. package/dist/cli/commands/attach.js +204 -0
  319. package/dist/cli/commands/capture.d.ts.map +1 -1
  320. package/dist/cli/commands/capture.js +114 -0
  321. package/dist/cli/commands/instances.d.ts.map +1 -1
  322. package/dist/cli/commands/instances.js +23 -2
  323. package/dist/cli/commands/ls.d.ts.map +1 -1
  324. package/dist/cli/commands/ls.js +41 -1
  325. package/dist/cli/config/cli-dependencies.d.ts.map +1 -1
  326. package/dist/cli/config/cli-dependencies.js +34 -0
  327. package/dist/cli/program.d.ts.map +1 -1
  328. package/dist/cli/program.js +5 -0
  329. package/dist/cli/types/index.d.ts +36 -0
  330. package/dist/cli/types/index.d.ts.map +1 -1
  331. package/dist/config/tmux-pane-config.d.ts +153 -0
  332. package/dist/config/tmux-pane-config.d.ts.map +1 -0
  333. package/dist/config/tmux-pane-config.js +172 -0
  334. package/dist/lib/cli-tools/session-name.d.ts +44 -0
  335. package/dist/lib/cli-tools/session-name.d.ts.map +1 -0
  336. package/dist/lib/cli-tools/session-name.js +57 -0
  337. package/dist/lib/cli-tools/types.d.ts +1 -1
  338. package/dist/lib/cli-tools/types.d.ts.map +1 -1
  339. package/dist/lib/cli-tools/types.js +6 -1
  340. package/dist/lib/cli-tools/validation.d.ts +34 -0
  341. package/dist/lib/cli-tools/validation.d.ts.map +1 -0
  342. package/dist/lib/cli-tools/validation.js +41 -0
  343. package/dist/lib/detection/status-reason.d.ts +18 -0
  344. package/dist/lib/detection/status-reason.d.ts.map +1 -1
  345. package/dist/lib/detection/status-reason.js +18 -0
  346. package/dist/lib/detection/tools/verified-against.d.ts +57 -7
  347. package/dist/lib/detection/tools/verified-against.d.ts.map +1 -1
  348. package/dist/lib/detection/tools/verified-against.js +59 -8
  349. package/dist/lib/detection/version-probes.d.ts +26 -5
  350. package/dist/lib/detection/version-probes.d.ts.map +1 -1
  351. package/dist/lib/detection/version-probes.js +28 -6
  352. package/dist/lib/session/tmux-session-surface.d.ts +369 -0
  353. package/dist/lib/session/tmux-session-surface.d.ts.map +1 -0
  354. package/dist/lib/session/tmux-session-surface.js +525 -0
  355. package/dist/server/src/config/cli-tool-timing-config.js +12 -1
  356. package/dist/server/src/config/detection-evidence-config.js +5 -0
  357. package/dist/server/src/config/schedule-config.js +28 -1
  358. package/dist/server/src/lib/cli-tools/antigravity.js +2 -2
  359. package/dist/server/src/lib/cli-tools/base.js +13 -8
  360. package/dist/server/src/lib/cli-tools/claude.js +20 -0
  361. package/dist/server/src/lib/cli-tools/codex.js +205 -61
  362. package/dist/server/src/lib/cli-tools/command-code.js +349 -0
  363. package/dist/server/src/lib/cli-tools/composer-spec.js +6 -0
  364. package/dist/server/src/lib/cli-tools/copilot.js +2 -2
  365. package/dist/server/src/lib/cli-tools/gemini.js +2 -2
  366. package/dist/server/src/lib/cli-tools/graceful-exit.js +16 -1
  367. package/dist/server/src/lib/cli-tools/index.js +4 -1
  368. package/dist/server/src/lib/cli-tools/install-hints.js +131 -0
  369. package/dist/server/src/lib/cli-tools/liveness-spec.js +18 -0
  370. package/dist/server/src/lib/cli-tools/manager.js +2 -0
  371. package/dist/server/src/lib/cli-tools/opencode.js +2 -2
  372. package/dist/server/src/lib/cli-tools/start-availability.js +18 -11
  373. package/dist/server/src/lib/cli-tools/types.js +6 -1
  374. package/dist/server/src/lib/cli-tools/vibe-local.js +2 -2
  375. package/dist/server/src/lib/cmate-parser.js +6 -0
  376. package/dist/server/src/lib/detection/cli-patterns.js +441 -8
  377. package/dist/server/src/lib/detection/opencode-modal-overlay.js +66 -100
  378. package/dist/server/src/lib/detection/selection-shape.js +341 -0
  379. package/dist/server/src/lib/detection/sgr-background.js +210 -0
  380. package/dist/server/src/lib/detection/status-detector.js +6 -0
  381. package/dist/server/src/lib/detection/status-reason.js +18 -0
  382. package/dist/server/src/lib/detection/tools/antigravity/detect.js +38 -15
  383. package/dist/server/src/lib/detection/tools/codex/cli-patterns.js +392 -0
  384. package/dist/server/src/lib/detection/tools/codex/detect.js +83 -2
  385. package/dist/server/src/lib/detection/tools/command-code/detect.js +159 -0
  386. package/dist/server/src/lib/detection/tools/registry.js +6 -4
  387. package/dist/server/src/lib/detection/tools/verified-against.js +59 -8
  388. package/dist/server/src/lib/detection/version-probes.js +28 -6
  389. package/dist/server/src/lib/hooks/sources/antigravity/history.js +101 -21
  390. package/dist/server/src/lib/hooks/sources/antigravity/transcript.js +39 -0
  391. package/dist/server/src/lib/hooks/sources/claude/history.js +245 -21
  392. package/dist/server/src/lib/hooks/sources/claude/transcript.js +175 -13
  393. package/dist/server/src/lib/hooks/sources/codex/history.js +84 -15
  394. package/dist/server/src/lib/hooks/sources/codex/hooks-config.js +130 -17
  395. package/dist/server/src/lib/hooks/sources/codex/relay-install.js +145 -0
  396. package/dist/server/src/lib/hooks/sources/command-code/history.js +865 -0
  397. package/dist/server/src/lib/hooks/sources/command-code/hooks-config.js +390 -0
  398. package/dist/server/src/lib/hooks/sources/command-code/source.js +290 -0
  399. package/dist/server/src/lib/hooks/sources/command-code/tool-id.js +18 -0
  400. package/dist/server/src/lib/hooks/sources/command-code/transcript.js +604 -0
  401. package/dist/server/src/lib/hooks/sources/index.js +3 -1
  402. package/dist/server/src/lib/hooks/sources/opencode/history.js +57 -3
  403. package/dist/server/src/lib/hooks/sources/opencode/transcript.js +24 -28
  404. package/dist/server/src/lib/hooks/sources/registry.js +4 -0
  405. package/dist/server/src/lib/hooks/sources/turn-body.js +77 -19
  406. package/dist/server/src/lib/hooks/stop-history-capture.js +58 -25
  407. package/dist/server/src/lib/job-executor.js +12 -0
  408. package/dist/server/src/lib/polling/auto-yes-dialog-gate.js +6 -0
  409. package/dist/server/src/lib/polling/response-checker.js +112 -7
  410. package/dist/server/src/lib/polling/structured-history-gate.js +15 -8
  411. package/dist/server/src/lib/realtime/types.js +15 -5
  412. package/dist/server/src/lib/response-cleaner.js +24 -1
  413. package/dist/server/src/lib/response-extractor.js +11 -0
  414. package/dist/server/src/lib/session/claude-executor.js +223 -4
  415. package/dist/server/src/lib/session/cli-session.js +52 -0
  416. package/dist/server/src/lib/session/tmux-session-surface.js +525 -0
  417. package/dist/server/src/lib/skills/compatibility-matrix.js +117 -1
  418. package/dist/server/src/lib/tmux/geometry-delegation.js +143 -0
  419. package/dist/server/src/lib/tmux/read-mode-pager.js +76 -10
  420. package/dist/server/src/lib/tmux/read-mode.js +44 -2
  421. package/dist/server/src/lib/tmux/session-hook-scripts.js +249 -0
  422. package/dist/server/src/lib/tmux/session-hooks.js +122 -0
  423. package/dist/server/src/lib/tmux/session-status-options.js +213 -0
  424. package/dist/server/src/lib/tmux/tmux.js +79 -2
  425. package/dist/server/src/lib/version-checker.js +110 -0
  426. package/dist/server/src/lib/ws-server.js +16 -10
  427. package/dist/server/src/types/agent-transcript.js +73 -1
  428. package/dist/server/src/types/terminal-keys.js +131 -3
  429. package/dist/types/terminal-keys.d.ts +100 -3
  430. package/dist/types/terminal-keys.d.ts.map +1 -1
  431. package/dist/types/terminal-keys.js +131 -3
  432. package/package.json +1 -1
  433. package/.next/server/chunks/3099.js +0 -5
  434. package/.next/server/chunks/7824.js +0 -1
  435. package/.next/static/chunks/3916-0e929d089282dc5d.js +0 -1
  436. package/.next/static/chunks/6022-7a7d1760fc9814c7.js +0 -1
  437. package/.next/static/chunks/6381-dbf04a99647f6018.js +0 -1
  438. package/.next/static/chunks/app/layout-6a26ea22d5cf03dc.js +0 -1
  439. package/.next/static/chunks/app/worktrees/[id]/page-aac399392ec8c273.js +0 -1
  440. package/.next/static/css/23f9c40ecc458c77.css +0 -1
  441. /package/.next/static/{pcpB4K6KreMzu2qbhvuRY → nXW4dPkpE_9xUf_9ySRff}/_buildManifest.js +0 -0
  442. /package/.next/static/{pcpB4K6KreMzu2qbhvuRY → nXW4dPkpE_9xUf_9ySRff}/_ssgManifest.js +0 -0
@@ -17,6 +17,70 @@
17
17
  *
18
18
  * Values only — no tmux process access — so this module is safe from any layer.
19
19
  */
20
+ /**
21
+ * The characters a dialog is answered WITH rather than navigated by (Issue #2254).
22
+ *
23
+ * `1`–`9` are the option numbers every numbered TUI dialog in this repository
24
+ * offers (codex's trust / `/model` pickers, claude's `PermissionRequest`
25
+ * screens, the hooks-review flow), and `y` / `n` are the two letters a bare
26
+ * `[y/n]` accepts. They are LITERAL characters on the wire, exactly like the
27
+ * codex pager's `q` has been since #1017 and opencode's chord letters since
28
+ * #2046 — `tmux send-keys -- 1` types a `1`.
29
+ *
30
+ * WHY THEY ARE IN THE BASE VOCABULARY, i.e. offered to every tool
31
+ * ---------------------------------------------------------------
32
+ * The state this exists for is "a wait is on screen and nothing could read it"
33
+ * (`ChatSurface`'s `promptUnreadable`). By construction nobody knows which tool
34
+ * drew that dialog *shape*, so there is no per-tool declaration to hang these
35
+ * off; what IS known is that the dialog is waiting for an answer, and that the
36
+ * chat surface had no way to send one before this Issue — the `/send` route
37
+ * refuses with `prompt_waiting`, and `/special-keys` published only arrows.
38
+ *
39
+ * The cost is the same one #2046 weighed for opencode's letters: a caller may
40
+ * POST `{cliToolId:"claude", keys:["y"]}` at an IDLE pane and type a `y` into
41
+ * the composer. That is a typo, not an escalation — the route has always been
42
+ * able to type `q` into any composer, sending a character is what the route is
43
+ * FOR, and the UI only draws these buttons while a wait is unreadable. What is
44
+ * deliberately still refused is a free string: `/send`'s `prompt_waiting` guard
45
+ * is untouched, `MAX_KEYS_LENGTH` is 10, and every other letter stays a 400.
46
+ *
47
+ * Note the overlap with {@link OPENCODE_LEADER_CHORD_VALUES}: `n` is in both,
48
+ * and `tests/unit/cli-tools/navigation-keys-declaration-2046.test.ts` pins the
49
+ * intersection to exactly `['n']` so a future widening of either list cannot
50
+ * quietly hand another tool an opencode chord letter.
51
+ */
52
+ export declare const ANSWER_KEY_VALUES: readonly ["1", "2", "3", "4", "5", "6", "7", "8", "9", "y", "n"];
53
+ /**
54
+ * claude's "use this session only" key (Issue #2297).
55
+ *
56
+ * MEASURED on claude 2.1.259 / 2.1.260 (`tests/fixtures/chat-dialog-card-2254/
57
+ * claude-model-2-1-259.txt`, and a live 200x1000 probe re-run for #2297): the
58
+ * `/model` overlay's footer reads
59
+ *
60
+ * Enter to set as default · s to use this session only · Esc to cancel
61
+ *
62
+ * so on that ONE screen `Enter` is not "confirm" — it rewrites `model` in
63
+ * `~/.claude/settings.json` (Issue #1495), and `s` is the only key that takes
64
+ * the highlighted model for the current session and leaves the file alone.
65
+ * Neither the shared pad nor the transport carried `s`, so the chat surface
66
+ * could offer the destructive half of that footer and not the safe half.
67
+ *
68
+ * A LITERAL character on the wire, exactly like the codex pager's `q` (#1017),
69
+ * opencode's chord letters (#2046) and the answer characters (#2254):
70
+ * `tmux send-keys -- s` types an `s`.
71
+ *
72
+ * WHY IT IS **NOT** IN {@link NAVIGATION_KEY_VALUES}
73
+ * -------------------------------------------------
74
+ * Unlike #2254's answer characters, this one has a named owner. `s` is a live
75
+ * binding on other tools' screens — copilot's session picker footer reads
76
+ * `s sort:relevance` (measured on 1.0.82), and opencode types a bare letter
77
+ * into its composer whenever a leader chord is not in flight. Publishing `s` to
78
+ * every tool would hand those screens a button that does something else. So it
79
+ * is declared by the claude-family tools alone, through
80
+ * {@link CLAUDE_NAVIGATION_KEY_VALUES}, and the route's per-tool check
81
+ * (Issue #2046) answers 400 for everyone else.
82
+ */
83
+ export declare const SESSION_SCOPE_KEY = "s";
20
84
  /**
21
85
  * Navigation keys accepted by the special-keys API and the terminal UI.
22
86
  *
@@ -26,11 +90,44 @@
26
90
  * [DR3-001] Named NAVIGATION_KEY_VALUES to avoid collision with existing SPECIAL_KEY_VALUES.
27
91
  * [DR2-004] Exported as an `as const` array + type guard (not a Set) for immutability.
28
92
  */
29
- export declare const NAVIGATION_KEY_VALUES: readonly ["Up", "Down", "Left", "Right", "Enter", "Escape", "Tab", "BTab", "PageUp", "PageDown", "Home", "End", "q"];
93
+ export declare const NAVIGATION_KEY_VALUES: readonly ["Up", "Down", "Left", "Right", "Enter", "Escape", "Tab", "BTab", "PageUp", "PageDown", "Home", "End", "q", "1", "2", "3", "4", "5", "6", "7", "8", "9", "y", "n"];
30
94
  /**
31
95
  * Navigation key type derived from NAVIGATION_KEY_VALUES.
32
96
  */
33
97
  export type NavigationKey = typeof NAVIGATION_KEY_VALUES[number];
98
+ /**
99
+ * What a claude-family pane may be sent: the base pad plus
100
+ * {@link SESSION_SCOPE_KEY} (Issue #2297).
101
+ *
102
+ * Returned by `ClaudeTool.navigationKeys()` and `CommandCodeTool.navigationKeys()`
103
+ * — the two tools whose TUI is claude's inline overlay renderer. Command Code
104
+ * takes it for kinship rather than for a measured `/model` footer of its own:
105
+ * its own picker (v1.40.1, measured for this Issue) is a name list with a search
106
+ * box and an `enter to select · esc to cancel` footer and offers no session
107
+ * scope at all, so nothing DRAWS the `s` button there — see
108
+ * `readSelectionListShape()`, which gates the button on the footer being on
109
+ * screen rather than on the tool id. Declaring the key for both keeps the two
110
+ * halves of the claude family from drifting apart the day Command Code grows the
111
+ * footer, and costs nothing while it has not: an undrawn button sends nothing.
112
+ *
113
+ * `tests/unit/lib/cli-tools/session-scope-key-2297.test.ts` pins the membership
114
+ * in both directions, and the #2046 suite still pins every OTHER tool to the
115
+ * base pad exactly.
116
+ */
117
+ export declare const CLAUDE_NAVIGATION_KEY_VALUES: readonly ["Up", "Down", "Left", "Right", "Enter", "Escape", "Tab", "BTab", "PageUp", "PageDown", "Home", "End", "q", "1", "2", "3", "4", "5", "6", "7", "8", "9", "y", "n", "s"];
118
+ /**
119
+ * The tool ids whose `navigationKeys()` carry {@link SESSION_SCOPE_KEY}.
120
+ *
121
+ * Read by the chat surface, which cannot call `navigationKeys()` — that lives
122
+ * behind the CLITool gateway on the server — but must not draw a button whose
123
+ * key the route would answer 400 for. Pinned against the real registry by
124
+ * `tests/unit/lib/cli-tools/session-scope-key-2297.test.ts`, so this list and
125
+ * the declarations cannot disagree.
126
+ *
127
+ * Typed as a plain string tuple rather than `CLIToolType[]` so this module keeps
128
+ * the "values only, safe from any layer" property its header depends on.
129
+ */
130
+ export declare const SESSION_SCOPE_KEY_TOOL_IDS: readonly ["claude", "command-code"];
34
131
  /**
35
132
  * opencode's leader prefix — the first half of a two-step chord.
36
133
  *
@@ -69,7 +166,7 @@ export declare const OPENCODE_DIRECT_KEY_VALUES: readonly ["C-p", "C-t"];
69
166
  * Everything an opencode pane may be sent — the base navigation pad plus this
70
167
  * tool's own chords. Returned by `OpenCodeTool.navigationKeys()`.
71
168
  */
72
- export declare const OPENCODE_NAVIGATION_KEY_VALUES: readonly ["Up", "Down", "Left", "Right", "Enter", "Escape", "Tab", "BTab", "PageUp", "PageDown", "Home", "End", "q", "C-x", "C-p", "C-t", "a", "l", "n", "t", "m", "g", "u", "r", "c"];
169
+ export declare const OPENCODE_NAVIGATION_KEY_VALUES: readonly ["Up", "Down", "Left", "Right", "Enter", "Escape", "Tab", "BTab", "PageUp", "PageDown", "Home", "End", "q", "1", "2", "3", "4", "5", "6", "7", "8", "9", "y", "n", "C-x", "C-p", "C-t", "a", "l", "t", "m", "g", "u", "r", "c"];
73
170
  /**
74
171
  * The union of every tool's vocabulary — what the tmux transport must be able to
75
172
  * deliver.
@@ -83,7 +180,7 @@ export declare const OPENCODE_NAVIGATION_KEY_VALUES: readonly ["Up", "Down", "Le
83
180
  * `tests/unit/cli-tools/navigation-keys-declaration-2046.test.ts` pin both
84
181
  * halves.
85
182
  */
86
- export declare const TERMINAL_KEY_VALUES: readonly ["Up", "Down", "Left", "Right", "Enter", "Escape", "Tab", "BTab", "PageUp", "PageDown", "Home", "End", "q", "C-x", "C-p", "C-t", "a", "l", "n", "t", "m", "g", "u", "r", "c"];
183
+ export declare const TERMINAL_KEY_VALUES: readonly ["Up", "Down", "Left", "Right", "Enter", "Escape", "Tab", "BTab", "PageUp", "PageDown", "Home", "End", "q", "1", "2", "3", "4", "5", "6", "7", "8", "9", "y", "n", "s", "C-x", "C-p", "C-t", "a", "l", "t", "m", "g", "u", "r", "c"];
87
184
  /** Any key name a tool may declare in its {@link NavigationKeySpec}. */
88
185
  export type TerminalKey = typeof TERMINAL_KEY_VALUES[number];
89
186
  //# sourceMappingURL=terminal-keys.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"terminal-keys.d.ts","sourceRoot":"","sources":["../../src/types/terminal-keys.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH;;;;;;;;GAQG;AACH,eAAO,MAAM,qBAAqB,sHAKxB,CAAC;AAEX;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,OAAO,qBAAqB,CAAC,MAAM,CAAC,CAAC;AAMjE;;;;;;;;GAQG;AACH,eAAO,MAAM,mBAAmB,QAAQ,CAAC;AAEzC;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,4BAA4B,wDAE/B,CAAC;AAEX;;;;;;GAMG;AACH,eAAO,MAAM,0BAA0B,yBAA0B,CAAC;AAElE;;;GAGG;AACH,eAAO,MAAM,8BAA8B,wLAKjC,CAAC;AAEX;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,mBAAmB,wLAKtB,CAAC;AAEX,wEAAwE;AACxE,MAAM,MAAM,WAAW,GAAG,OAAO,mBAAmB,CAAC,MAAM,CAAC,CAAC"}
1
+ {"version":3,"file":"terminal-keys.d.ts","sourceRoot":"","sources":["../../src/types/terminal-keys.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,eAAO,MAAM,iBAAiB,kEAGpB,CAAC;AAEX;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,eAAO,MAAM,iBAAiB,MAAM,CAAC;AAErC;;;;;;;;GAQG;AACH,eAAO,MAAM,qBAAqB,6KAQxB,CAAC;AAEX;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,OAAO,qBAAqB,CAAC,MAAM,CAAC,CAAC;AAEjE;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,4BAA4B,kLAG/B,CAAC;AAEX;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,0BAA0B,qCAAsC,CAAC;AAM9E;;;;;;;;GAQG;AACH,eAAO,MAAM,mBAAmB,QAAQ,CAAC;AAEzC;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,4BAA4B,wDAE/B,CAAC;AAEX;;;;;;GAMG;AACH,eAAO,MAAM,0BAA0B,yBAA0B,CAAC;AAsBlE;;;GAGG;AACH,eAAO,MAAM,8BAA8B,0OAKjC,CAAC;AAEX;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,mBAAmB,+OAQtB,CAAC;AAEX,wEAAwE;AACxE,MAAM,MAAM,WAAW,GAAG,OAAO,mBAAmB,CAAC,MAAM,CAAC,CAAC"}
@@ -19,7 +19,74 @@
19
19
  * Values only — no tmux process access — so this module is safe from any layer.
20
20
  */
21
21
  Object.defineProperty(exports, "__esModule", { value: true });
22
- exports.TERMINAL_KEY_VALUES = exports.OPENCODE_NAVIGATION_KEY_VALUES = exports.OPENCODE_DIRECT_KEY_VALUES = exports.OPENCODE_LEADER_CHORD_VALUES = exports.OPENCODE_LEADER_KEY = exports.NAVIGATION_KEY_VALUES = void 0;
22
+ exports.TERMINAL_KEY_VALUES = exports.OPENCODE_NAVIGATION_KEY_VALUES = exports.OPENCODE_DIRECT_KEY_VALUES = exports.OPENCODE_LEADER_CHORD_VALUES = exports.OPENCODE_LEADER_KEY = exports.SESSION_SCOPE_KEY_TOOL_IDS = exports.CLAUDE_NAVIGATION_KEY_VALUES = exports.NAVIGATION_KEY_VALUES = exports.SESSION_SCOPE_KEY = exports.ANSWER_KEY_VALUES = void 0;
23
+ /**
24
+ * The characters a dialog is answered WITH rather than navigated by (Issue #2254).
25
+ *
26
+ * `1`–`9` are the option numbers every numbered TUI dialog in this repository
27
+ * offers (codex's trust / `/model` pickers, claude's `PermissionRequest`
28
+ * screens, the hooks-review flow), and `y` / `n` are the two letters a bare
29
+ * `[y/n]` accepts. They are LITERAL characters on the wire, exactly like the
30
+ * codex pager's `q` has been since #1017 and opencode's chord letters since
31
+ * #2046 — `tmux send-keys -- 1` types a `1`.
32
+ *
33
+ * WHY THEY ARE IN THE BASE VOCABULARY, i.e. offered to every tool
34
+ * ---------------------------------------------------------------
35
+ * The state this exists for is "a wait is on screen and nothing could read it"
36
+ * (`ChatSurface`'s `promptUnreadable`). By construction nobody knows which tool
37
+ * drew that dialog *shape*, so there is no per-tool declaration to hang these
38
+ * off; what IS known is that the dialog is waiting for an answer, and that the
39
+ * chat surface had no way to send one before this Issue — the `/send` route
40
+ * refuses with `prompt_waiting`, and `/special-keys` published only arrows.
41
+ *
42
+ * The cost is the same one #2046 weighed for opencode's letters: a caller may
43
+ * POST `{cliToolId:"claude", keys:["y"]}` at an IDLE pane and type a `y` into
44
+ * the composer. That is a typo, not an escalation — the route has always been
45
+ * able to type `q` into any composer, sending a character is what the route is
46
+ * FOR, and the UI only draws these buttons while a wait is unreadable. What is
47
+ * deliberately still refused is a free string: `/send`'s `prompt_waiting` guard
48
+ * is untouched, `MAX_KEYS_LENGTH` is 10, and every other letter stays a 400.
49
+ *
50
+ * Note the overlap with {@link OPENCODE_LEADER_CHORD_VALUES}: `n` is in both,
51
+ * and `tests/unit/cli-tools/navigation-keys-declaration-2046.test.ts` pins the
52
+ * intersection to exactly `['n']` so a future widening of either list cannot
53
+ * quietly hand another tool an opencode chord letter.
54
+ */
55
+ exports.ANSWER_KEY_VALUES = [
56
+ '1', '2', '3', '4', '5', '6', '7', '8', '9',
57
+ 'y', 'n',
58
+ ];
59
+ /**
60
+ * claude's "use this session only" key (Issue #2297).
61
+ *
62
+ * MEASURED on claude 2.1.259 / 2.1.260 (`tests/fixtures/chat-dialog-card-2254/
63
+ * claude-model-2-1-259.txt`, and a live 200x1000 probe re-run for #2297): the
64
+ * `/model` overlay's footer reads
65
+ *
66
+ * Enter to set as default · s to use this session only · Esc to cancel
67
+ *
68
+ * so on that ONE screen `Enter` is not "confirm" — it rewrites `model` in
69
+ * `~/.claude/settings.json` (Issue #1495), and `s` is the only key that takes
70
+ * the highlighted model for the current session and leaves the file alone.
71
+ * Neither the shared pad nor the transport carried `s`, so the chat surface
72
+ * could offer the destructive half of that footer and not the safe half.
73
+ *
74
+ * A LITERAL character on the wire, exactly like the codex pager's `q` (#1017),
75
+ * opencode's chord letters (#2046) and the answer characters (#2254):
76
+ * `tmux send-keys -- s` types an `s`.
77
+ *
78
+ * WHY IT IS **NOT** IN {@link NAVIGATION_KEY_VALUES}
79
+ * -------------------------------------------------
80
+ * Unlike #2254's answer characters, this one has a named owner. `s` is a live
81
+ * binding on other tools' screens — copilot's session picker footer reads
82
+ * `s sort:relevance` (measured on 1.0.82), and opencode types a bare letter
83
+ * into its composer whenever a leader chord is not in flight. Publishing `s` to
84
+ * every tool would hand those screens a button that does something else. So it
85
+ * is declared by the claude-family tools alone, through
86
+ * {@link CLAUDE_NAVIGATION_KEY_VALUES}, and the route's per-tool check
87
+ * (Issue #2046) answers 400 for everyone else.
88
+ */
89
+ exports.SESSION_SCOPE_KEY = 's';
23
90
  /**
24
91
  * Navigation keys accepted by the special-keys API and the terminal UI.
25
92
  *
@@ -34,7 +101,46 @@ exports.NAVIGATION_KEY_VALUES = [
34
101
  // Issue #1017: Codex pager / edit-previous mode keys surfaced by NavigationButtons.
35
102
  // 'q' is the pager quit key (literal char). PageUp/PageDown/Home/End are tmux named keys.
36
103
  'PageUp', 'PageDown', 'Home', 'End', 'q',
104
+ // Issue #2254: the answer characters. Appended rather than interleaved so the
105
+ // pre-#2254 prefix of this list is still readable as one line in a diff.
106
+ ...exports.ANSWER_KEY_VALUES,
37
107
  ];
108
+ /**
109
+ * What a claude-family pane may be sent: the base pad plus
110
+ * {@link SESSION_SCOPE_KEY} (Issue #2297).
111
+ *
112
+ * Returned by `ClaudeTool.navigationKeys()` and `CommandCodeTool.navigationKeys()`
113
+ * — the two tools whose TUI is claude's inline overlay renderer. Command Code
114
+ * takes it for kinship rather than for a measured `/model` footer of its own:
115
+ * its own picker (v1.40.1, measured for this Issue) is a name list with a search
116
+ * box and an `enter to select · esc to cancel` footer and offers no session
117
+ * scope at all, so nothing DRAWS the `s` button there — see
118
+ * `readSelectionListShape()`, which gates the button on the footer being on
119
+ * screen rather than on the tool id. Declaring the key for both keeps the two
120
+ * halves of the claude family from drifting apart the day Command Code grows the
121
+ * footer, and costs nothing while it has not: an undrawn button sends nothing.
122
+ *
123
+ * `tests/unit/lib/cli-tools/session-scope-key-2297.test.ts` pins the membership
124
+ * in both directions, and the #2046 suite still pins every OTHER tool to the
125
+ * base pad exactly.
126
+ */
127
+ exports.CLAUDE_NAVIGATION_KEY_VALUES = [
128
+ ...exports.NAVIGATION_KEY_VALUES,
129
+ exports.SESSION_SCOPE_KEY,
130
+ ];
131
+ /**
132
+ * The tool ids whose `navigationKeys()` carry {@link SESSION_SCOPE_KEY}.
133
+ *
134
+ * Read by the chat surface, which cannot call `navigationKeys()` — that lives
135
+ * behind the CLITool gateway on the server — but must not draw a button whose
136
+ * key the route would answer 400 for. Pinned against the real registry by
137
+ * `tests/unit/lib/cli-tools/session-scope-key-2297.test.ts`, so this list and
138
+ * the declarations cannot disagree.
139
+ *
140
+ * Typed as a plain string tuple rather than `CLIToolType[]` so this module keeps
141
+ * the "values only, safe from any layer" property its header depends on.
142
+ */
143
+ exports.SESSION_SCOPE_KEY_TOOL_IDS = ['claude', 'command-code'];
38
144
  // ---------------------------------------------------------------------------
39
145
  // Per-tool vocabularies (Issue #2046)
40
146
  // ---------------------------------------------------------------------------
@@ -74,6 +180,25 @@ exports.OPENCODE_LEADER_CHORD_VALUES = [
74
180
  * `Tab` / `BTab` cycle the agent and are already in {@link NAVIGATION_KEY_VALUES}.
75
181
  */
76
182
  exports.OPENCODE_DIRECT_KEY_VALUES = ['C-p', 'C-t'];
183
+ /**
184
+ * {@link OPENCODE_LEADER_CHORD_VALUES} minus what the base pad already carries.
185
+ *
186
+ * Issue #2254 moved `n` into {@link ANSWER_KEY_VALUES}, and therefore into
187
+ * {@link NAVIGATION_KEY_VALUES}, which every tool's declaration starts from —
188
+ * so spreading the full chord list into the two unions below would list `n`
189
+ * twice. A duplicate is harmless to `Array.prototype.includes`, which is all the
190
+ * route does with these, and that is exactly why it needs its own guard: the
191
+ * only thing that would notice is the "no duplicate entries" assertion in
192
+ * `tests/unit/cli-tools/navigation-keys-declaration-2046.test.ts`.
193
+ *
194
+ * Written out rather than filtered at runtime because both unions are `as const`
195
+ * tuples whose LITERAL member types are the `TerminalKey` union — a
196
+ * `.filter()` would collapse them to `string[]` and take the compile-time check
197
+ * with it. The same suite pins this list to
198
+ * `OPENCODE_LEADER_CHORD_VALUES \ NAVIGATION_KEY_VALUES` so it cannot drift out
199
+ * of step with either side.
200
+ */
201
+ const OPENCODE_CHORD_ONLY_VALUES = ['a', 'l', 't', 'm', 'g', 'u', 'r', 'c'];
77
202
  /**
78
203
  * Everything an opencode pane may be sent — the base navigation pad plus this
79
204
  * tool's own chords. Returned by `OpenCodeTool.navigationKeys()`.
@@ -82,7 +207,7 @@ exports.OPENCODE_NAVIGATION_KEY_VALUES = [
82
207
  ...exports.NAVIGATION_KEY_VALUES,
83
208
  exports.OPENCODE_LEADER_KEY,
84
209
  ...exports.OPENCODE_DIRECT_KEY_VALUES,
85
- ...exports.OPENCODE_LEADER_CHORD_VALUES,
210
+ ...OPENCODE_CHORD_ONLY_VALUES,
86
211
  ];
87
212
  /**
88
213
  * The union of every tool's vocabulary — what the tmux transport must be able to
@@ -99,7 +224,10 @@ exports.OPENCODE_NAVIGATION_KEY_VALUES = [
99
224
  */
100
225
  exports.TERMINAL_KEY_VALUES = [
101
226
  ...exports.NAVIGATION_KEY_VALUES,
227
+ // Issue #2297: claude / Command Code declare it; nothing else does.
228
+ exports.SESSION_SCOPE_KEY,
102
229
  exports.OPENCODE_LEADER_KEY,
103
230
  ...exports.OPENCODE_DIRECT_KEY_VALUES,
104
- ...exports.OPENCODE_LEADER_CHORD_VALUES,
231
+ // Issue #2254: `n` is in the base pad now — see OPENCODE_CHORD_ONLY_VALUES.
232
+ ...OPENCODE_CHORD_ONLY_VALUES,
105
233
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "commandmate",
3
- "version": "0.30.1",
3
+ "version": "0.31.0",
4
4
  "description": "A local control plane for agent CLIs — orchestration and visibility for Claude Code, Codex, Gemini CLI, and more across Git worktrees",
5
5
  "keywords": [
6
6
  "claude-code",
@@ -1,5 +0,0 @@
1
- "use strict";exports.id=3099,exports.ids=[3099],exports.modules={63099:(a,b,c)=>{c.d(b,{captureStructuredHistoryTurn:()=>ao,hasStructuredHistoryTranscript:()=>ap,isPullTranscriptHistory:()=>am,H:()=>an});var d=c(72626),e=c(53163),f=c(79696),g=c(79748),h=c(21820),i=c(33873),j=c(24455);let k=(0,d.h)("lib/history/transcript-tail");async function l(a){let b;try{b=await (0,g.open)(a,"r");let{size:c}=await b.stat(),d=Math.max(0,c-4194304),e=c-d;if(e<=0)return"";let f=Buffer.alloc(e),{bytesRead:h}=await b.read(f,0,e,d),i=f.subarray(0,h).toString("utf8");if(0===d)return i;let j=i.indexOf("\n");return -1===j?"":i.slice(j+1)}catch(b){return k.warn("transcript-tail-read-failed",{path:a,error:b instanceof Error?b.message:String(b)}),null}finally{await b?.close().catch(()=>{})}}var m=c(18201),n=c(86594),o=c(57510),p=c(27128);let q=["sessions"],r=".jsonl",s="\n\n_(truncated)_";function t(a){return a.replace(/\s+/g," ").trim()}function u(a){return a.length<=200?a:`${a.slice(0,199)}…`}let v=new Set(["ContextCompaction"]),w={CommandExecution:"exec",FileChange:"edit",McpToolCall:"mcp",ImageView:"view",Extension:"extension"},x=(0,d.h)("lib/hooks/sources/codex/history"),y=/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,z=globalThis.__codexTranscriptSessions??=new Map,A=globalThis.__codexTranscriptPaths??=new Map;async function B(a){let b=(0,j.v7)(a.worktreeId,a.cliToolId,a.instanceId);try{let{getLastAgentEvent:d}=await Promise.resolve().then(c.bind(c,48083)),e=d(a.worktreeId,a.cliToolId,a.instanceId)?.sessionId;if("string"==typeof e&&e.length>0)return z.set(b,e),e}catch(b){x.debug("codex-transcript-session-lookup-failed",{worktreeId:a.worktreeId,instanceId:a.instanceId??a.cliToolId,error:b instanceof Error?b.message:String(b)})}return z.get(b)??null}function C(a=process.env){let b=a.CODEX_HOME;return"string"==typeof b&&b.length>0?b:(0,i.join)((0,h.homedir)(),".codex")}function D(a){return(0,i.join)(a,...q)}async function E(a,b,c=4){return y.test(b)?F(D(a),b,c):null}async function F(a,b,c){let d;if(c<=0)return null;try{d=await (0,g.readdir)(a,{withFileTypes:!0})}catch{return null}let e=[];for(let c of d){if(c.isFile()){var f;if(f=c.name,f.startsWith("rollout-")&&f.endsWith(`-${b}${r}`))return(0,i.join)(a,c.name);continue}c.isDirectory()&&e.push(c.name)}for(let d of(e.sort((a,b)=>a<b?1:a>b?-1:0),e)){let e=await F((0,i.join)(a,d),b,c-1);if(e)return e}return null}async function G(a,b={}){let c=a.instanceId??a.cliToolId;try{let f=b.codexHome??C(),g=await B(a);if(!g)return x.debug("codex-transcript-unavailable",{worktreeId:a.worktreeId,instanceId:c,reason:"no-session-pointer"}),!1;let h=await J(f,g);if(!h)return x.debug("codex-transcript-unavailable",{worktreeId:a.worktreeId,instanceId:c,sessionId:g,reason:"no-file"}),!1;let i=await l(h);if(null===i)return!1;let j=function(a){let b=[],c=0;for(let d of a.split("\n")){let a;if(0===d.trim().length)continue;try{a=JSON.parse(d)}catch{c+=1;continue}let e=function(a){if(!(0,o.Qd)(a))return null;let b=(0,o.O2)(a,"type");if(!b)return null;let c=(0,o.Qd)(a.payload)?a.payload:null,d=c?(0,o.O2)(c,"type"):null,e=(0,o.O2)(a,"timestamp"),f=e?Date.parse(e):NaN;return{type:b,payloadType:d,turnId:c?(0,o.O2)(c,"turn_id"):null,sessionId:c?(0,o.O2)(c,"session_id")??(0,o.O2)(c,"thread_id"):null,timestampMs:Number.isFinite(f)?f:null,item:c&&"item_completed"===d?function(a){var b,c;if(!(0,o.Qd)(a))return null;let d=(0,o.O2)(a,"type");return d?{type:d,id:(0,o.O2)(a,"id"),text:(b=d,c=a,"UserMessage"===b||"AgentMessage"===b?function(a){if(!Array.isArray(a))return null;let b="";for(let c of a){if(!(0,o.Qd)(c))continue;let a=(0,o.O2)(c,"text");a&&(b+=a)}return b.length>0?b:null}(c.content):"Reasoning"===b?function(a){if(!Array.isArray(a))return null;let b=a.filter(a=>"string"==typeof a&&""!==a);return b.length>0?b.join("\n\n"):null}(c.summary_text):null),phase:(0,o.O2)(a,"phase"),detail:function(a,b){if("CommandExecution"===a){let a=function(a){if(!Array.isArray(a))return null;let b=[];for(let c of a){if(!(0,o.Qd)(c))continue;let a=(0,o.O2)(c,"cmd");a&&b.push(a)}return b.length>0?b.join(" ; "):null}(b.parsed_cmd);if(a)return u(t(a));let c=function(a){if(!Array.isArray(a))return null;let b=a.filter(a=>"string"==typeof a);return b.length>0?b.join(" "):null}(b.command);return c?u(t(c)):null}if("FileChange"===a){let a=b.changes;if(!(0,o.Qd)(a))return null;let c=Object.keys(a);return c.length>0?u(c.join(", ")):null}if("McpToolCall"===a){let a=(0,o.O2)(b,"server"),c=(0,o.O2)(b,"tool");return a||c?u([a,c].filter(Boolean).join(".")):null}if("ImageView"===a){let a=(0,o.O2)(b,"path");return a?u(a):null}if("Extension"===a){let a=(0,o.O2)(b,"query")??(0,o.O2)(b,"action");return a?u(t(a)):null}return null}(d,a)}:null}(c.item):null}}(a);e?b.push(e):c+=1}return{records:b,malformedLines:c}}(i),k=function(a,b){let c=new Map,d=0,e=0,f=null;for(let g of a){if("session_meta"===g.type&&g.sessionId&&(f=g.sessionId),"response_item"===g.type){d+=1;continue}let a=g.turnId;if(!a){e+=1;continue}let h=c.get(a);if(h||(h={sessionId:g.sessionId??f??b,turnId:a,startedAt:g.timestampMs??0,prompts:[],items:[],closed:!1,overflowed:!1},c.set(a,h)),"task_complete"===g.payloadType){h.closed=!0;continue}let i=g.item;if(i){if("UserMessage"===i.type){i.id&&i.text&&h.prompts.push({itemId:i.id,text:i.text,timestampMs:g.timestampMs??h.startedAt});continue}if(h.items.length>=2048){h.overflowed=!0;continue}h.items.push(i)}}return{turns:[...c.values()],duplicateStreamRecords:d,turnlessRecords:e}}(j.records,g);if(0===k.turns.length)return x.info("codex-transcript-no-turn",{worktreeId:a.worktreeId,instanceId:c,path:h,records:j.records.length,malformedLines:j.malformedLines,duplicateStreamRecords:k.duplicateStreamRecords}),!1;j.malformedLines>0&&x.info("codex-transcript-partial-read",{worktreeId:a.worktreeId,instanceId:c,path:h,malformedLines:j.malformedLines,turnlessRecords:k.turnlessRecords,duplicateStreamRecords:k.duplicateStreamRecords});let m=await I(a,k.turns);if(0===m.turns.length)return x.debug("codex-transcript-turns-already-saved",{worktreeId:a.worktreeId,instanceId:c,turnsInWindow:k.turns.length}),!0;m.turns.length>1&&x.info("codex-transcript-backfilling-turns",{worktreeId:a.worktreeId,instanceId:c,path:h,pendingTurns:m.turns.length,turnsInWindow:k.turns.length,anchored:m.anchored});let n=!1;for(let b=0;b<m.turns.length;b+=1){var d,e;let c=m.turns[b],f=0===b?m.previousStartedAt:m.turns[b-1].startedAt,g=await L(a,c,f);n=await M(a,c,function(a){let b=[],c=new Set,d=0,e=0;for(let f of a.items){if("AgentMessage"===f.type){let a=f.text?.trim()??"";if(0===a.length)continue;b.push({kind:"prose",text:a}),d+=1;continue}if("Reasoning"===f.type){let a=f.text?.trim()??"";if(0===a.length)continue;b.push({kind:"aside",text:function(a){let b=a.trim().split("\n").map(a=>a.length>0?`> ${a}`:">").join("\n");return`> **Thinking**
2
- >
3
- ${b}`}(a)});continue}if(f.type in w){b.push({kind:"tool",text:function(a){let b=w[a.type]??a.type;return a.detail?`- \`${b}\` — ${a.detail}`:`- \`${b}\``}(f)}),e+=1;continue}v.has(f.type)||c.add(f.type)}let f=(0,p.t)(b).body;return f.length>2e5&&(f=f.slice(0,2e5-s.length)+s),{sessionId:a.sessionId,turnId:a.turnId,body:f,textBlocks:d,toolBlocks:e,unknownBlockTypes:[...c]}}(c),(d=c,e=g,null===e.timestampMs?d.startedAt:Math.max(d.startedAt,e.timestampMs+1)),h)}return n}catch(b){return x.error("codex-transcript-capture-failed",{worktreeId:a.worktreeId,instanceId:c,error:b instanceof Error?b.message:String(b)}),!1}}async function H(a,b={}){try{let c=await B(a);if(!c)return null;return await J(b.codexHome??C(),c)}catch{return null}}async function I(a,b){let[{getDbInstance:d},{findMessageByRequestId:e}]=await Promise.all([Promise.resolve().then(c.bind(c,88807)),Promise.resolve().then(c.bind(c,56791))]),f=d();for(let c=b.length-1;c>=0;c-=1){let d=(0,n.ZS)(b[c].turnId);if(e(f,a.worktreeId,d))return{turns:b.slice(c+1),previousStartedAt:b[c].startedAt,anchored:!0}}return{turns:b.slice(-1),previousStartedAt:b.length>1?b[b.length-2].startedAt:0,anchored:!1}}async function J(a,b){let c=`${a}\0${b}`,d=A.get(c);if(d&&await K(d))return d;d&&A.delete(c);let e=await E(a,b);if(!e)return null;let f=function(a,b){if(!b.endsWith(r)||b.includes("\0"))return null;let c=(0,i.resolve)(D(a)),d=(0,i.resolve)(b);return d===c||d.startsWith(c+i.sep)?d:null}(a,e);return f?(A.set(c,f),f):null}async function K(a){try{return(await (0,g.stat)(a)).isFile()}catch{return!1}}async function L(a,b,c=0){let d=a.instanceId??a.cliToolId,e={outcome:"skipped",messageId:null,timestampMs:null},f=c>0?{adoptionFromMs:c}:{};for(let c of b.prompts){let g=await (0,m.Ce)(a,(0,n.Ac)(c.itemId),c.text,c.timestampMs,f);if("failed"===g.outcome){x.warn("codex-transcript-user-turn-failed",{worktreeId:a.worktreeId,instanceId:d,sessionId:b.sessionId,turnId:b.turnId,promptItemId:c.itemId});continue}e=g}return e}async function M(a,b,d,e,f){let g=a.instanceId??a.cliToolId;if(!b.closed)return x.info("codex-transcript-turn-open",{worktreeId:a.worktreeId,instanceId:g,sessionId:d.sessionId,turnId:d.turnId,items:b.items.length}),!1;if(0===d.body.length)return x.info("codex-transcript-turn-empty",{worktreeId:a.worktreeId,instanceId:g,sessionId:d.sessionId,turnId:d.turnId}),!1;d.unknownBlockTypes.length>0&&x.info("codex-transcript-unknown-items",{worktreeId:a.worktreeId,instanceId:g,sessionId:d.sessionId,turnId:d.turnId,itemTypes:d.unknownBlockTypes}),b.overflowed&&x.info("codex-transcript-turn-overflowed",{worktreeId:a.worktreeId,instanceId:g,sessionId:d.sessionId,turnId:d.turnId});let h=(0,n.ZS)(d.turnId),[{getDbInstance:i},{createMessage:j,findMessageByRequestId:k},{broadcastMessage:l}]=await Promise.all([Promise.resolve().then(c.bind(c,88807)),Promise.resolve().then(c.bind(c,56791)),Promise.all([c.e(1503),c.e(4299),c.e(1719),c.e(6894),c.e(5120)]).then(c.bind(c,79129))]),m=i();if(k(m,a.worktreeId,h))return x.debug("codex-transcript-turn-already-saved",{worktreeId:a.worktreeId,instanceId:g,requestId:h}),!0;let o=j(m,{worktreeId:a.worktreeId,role:"assistant",content:d.body,messageType:"normal",timestamp:new Date(e>0?e:Date.now()),cliToolId:a.cliToolId,instanceId:g,requestId:h});return l("message",{worktreeId:a.worktreeId,message:o}),x.info("codex-transcript-turn-saved",{worktreeId:a.worktreeId,instanceId:g,sessionId:d.sessionId,requestId:h,path:f,bodyLength:d.body.length,textBlocks:d.textBlocks,toolBlocks:d.toolBlocks,prompts:b.prompts.length}),!0}let N=[".system_generated","logs","transcript_full.jsonl"],O="\n\n_(truncated)_",P="MODEL",Q=new Set(["RUN_COMMAND","VIEW_FILE","LIST_DIRECTORY","GREP_SEARCH","SEARCH_WEB","CODE_ACTION","GENERATE_IMAGE","GENERIC"]),R=new Set(["CHECKPOINT","CONVERSATION_HISTORY","SYSTEM_MESSAGE","EPHEMERAL_MESSAGE","ERROR_MESSAGE"]),S=(0,d.h)("lib/hooks/sources/antigravity/history"),T=[".gemini","antigravity-cli"],U=/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,V=globalThis.__antigravityTranscriptConversations??=new Map;async function W(a){let b=(0,j.v7)(a.worktreeId,a.cliToolId,a.instanceId);try{let{getLastAgentEvent:d}=await Promise.resolve().then(c.bind(c,48083)),e=d(a.worktreeId,a.cliToolId,a.instanceId)?.sessionId;if("string"==typeof e&&e.length>0)return V.set(b,e),e}catch(b){S.debug("antigravity-transcript-conversation-lookup-failed",{worktreeId:a.worktreeId,instanceId:a.instanceId??a.cliToolId,error:b instanceof Error?b.message:String(b)})}return V.get(b)??null}function X(a=(0,h.homedir)()){return(0,i.join)(a,...T)}function Y(a){return(0,i.join)(a,"brain")}async function Z(a,b={}){let c=a.instanceId??a.cliToolId;try{let f=b.antigravityHome??X(),g=await W(a);if(!g)return S.debug("antigravity-transcript-unavailable",{worktreeId:a.worktreeId,instanceId:c,reason:"no-conversation-pointer"}),!1;let h=await aa(f,g);if(!h)return S.debug("antigravity-transcript-unavailable",{worktreeId:a.worktreeId,instanceId:c,conversationId:g,reason:"no-file"}),!1;let i=await l(h);if(null===i)return!1;let j=function(a){let b=[],c=0;for(let d of a.split("\n")){let a;if(0===d.trim().length)continue;try{a=JSON.parse(d)}catch{c+=1;continue}let e=function(a){if(!(0,o.Qd)(a))return null;let b=a.step_index;if("number"!=typeof b||!Number.isInteger(b)||b<0)return null;let c=(0,o.O2)(a,"source"),d=(0,o.O2)(a,"type");if(!c||!d)return null;let e=(0,o.O2)(a,"created_at"),f=e?Date.parse(e):NaN,g=[];if(Array.isArray(a.tool_calls))for(let b of a.tool_calls){let a=function(a){var b;if(!(0,o.Qd)(a))return null;let c=(0,o.O2)(a,"name");if(!c)return null;let d=(0,o.Qd)(a.args)?a.args:null,e=d?(0,o.O2)(d,"toolAction")??(0,o.O2)(d,"toolSummary"):null;return{name:c,detail:e?(b=e.replace(/\s+/g," ").trim()).length<=200?b:`${b.slice(0,199)}…`:null}}(b);a&&g.push(a)}return{stepIndex:b,source:c,type:d,status:(0,o.O2)(a,"status"),timestampMs:Number.isFinite(f)?f:null,content:(0,o.O2)(a,"content"),thinking:(0,o.O2)(a,"thinking"),toolCalls:g}}(a);e?b.push(e):c+=1}return{records:b,malformedLines:c}}(i),k=function(a,b){let c=[],d=0;for(let f of a){var e;if(e=f,"USER_EXPLICIT"===e.source&&"USER_INPUT"===e.type){let a=f.content?function(a){let b=a.indexOf("<USER_REQUEST>");if(-1===b)return null;let c=b+14,d=a.indexOf("</USER_REQUEST>",c);if(-1===d)return null;let e=a.slice(c,d).trim();return e.length>0?e:null}(f.content):null,d=f.timestampMs??0;c.push({conversationId:b,stepIndex:f.stepIndex,startedAt:d,prompt:a?{stepIndex:f.stepIndex,text:a,timestampMs:f.timestampMs??d}:null,records:[],overflowed:!1});continue}let a=c.at(-1);if(!a){d+=1;continue}if(a.records.length>=2048){a.overflowed=!0;continue}a.records.push(f)}return{turns:c,preludeRecords:d}}(j.records,g);if(0===k.turns.length)return S.info("antigravity-transcript-no-turn",{worktreeId:a.worktreeId,instanceId:c,path:h,records:j.records.length,malformedLines:j.malformedLines,preludeRecords:k.preludeRecords}),!1;j.malformedLines>0&&S.info("antigravity-transcript-partial-read",{worktreeId:a.worktreeId,instanceId:c,path:h,malformedLines:j.malformedLines,preludeRecords:k.preludeRecords});let m=await _(a,k.turns);if(0===m.turns.length)return S.debug("antigravity-transcript-turns-already-saved",{worktreeId:a.worktreeId,instanceId:c,turnsInWindow:k.turns.length}),!0;m.turns.length>1&&S.info("antigravity-transcript-backfilling-turns",{worktreeId:a.worktreeId,instanceId:c,path:h,pendingTurns:m.turns.length,turnsInWindow:k.turns.length,anchored:m.anchored});let n=!1;for(let b=0;b<m.turns.length;b+=1){var d,e;let c=m.turns[b],f=0===b?m.previousStartedAt:m.turns[b-1].startedAt,g=await ac(a,c,f);n=await ad(a,c,function(a){let b=[],c=new Set,d=0,e=0;for(let f of a.records){if(f.source===P&&"PLANNER_RESPONSE"===f.type){let a=f.thinking?.trim()??"";a.length>0&&b.push({kind:"aside",text:function(a){let b=a.trim().split("\n").map(a=>a.length>0?`> ${a}`:">").join("\n");return`> **Thinking**
4
- >
5
- ${b}`}(a)});let c=f.content?.trim()??"";for(let a of(c.length>0&&(b.push({kind:"prose",text:c}),d+=1),f.toolCalls))b.push({kind:"tool",text:a.detail?`- \`${a.name}\` — ${a.detail}`:`- \`${a.name}\``}),e+=1;continue}if(f.source===P){Q.has(f.type)||c.add(f.type);continue}R.has(f.type)||c.add(f.type)}let f=(0,p.t)(b).body;return f.length>2e5&&(f=f.slice(0,2e5-O.length)+O),{conversationId:a.conversationId,stepIndex:a.stepIndex,body:f,textBlocks:d,toolBlocks:e,unknownRecordTypes:[...c]}}(c),(d=c,e=g,null===e.timestampMs?d.startedAt:Math.max(d.startedAt,e.timestampMs+1)),h)}return n}catch(b){return S.error("antigravity-transcript-capture-failed",{worktreeId:a.worktreeId,instanceId:c,error:b instanceof Error?b.message:String(b)}),!1}}async function $(a,b={}){try{let c=await W(a);if(!c)return null;return await aa(b.antigravityHome??X(),c)}catch{return null}}async function _(a,b){let[{getDbInstance:d},{findMessageByRequestId:e}]=await Promise.all([Promise.resolve().then(c.bind(c,88807)),Promise.resolve().then(c.bind(c,56791))]),f=d();for(let c=b.length-1;c>=0;c-=1){let d=b[c],g=(0,n.O1)(d.conversationId,d.stepIndex);if(e(f,a.worktreeId,g))return{turns:b.slice(c+1),previousStartedAt:d.startedAt,anchored:!0}}return{turns:b.slice(-1),previousStartedAt:b.length>1?b[b.length-2].startedAt:0,anchored:!1}}async function aa(a,b){let c=U.test(b)?(0,i.join)(Y(a),b,...N):null;if(!c)return null;let d=function(a,b){if(!b.endsWith(".jsonl")||b.includes("\0"))return null;let c=(0,i.resolve)(Y(a)),d=(0,i.resolve)(b);return d===c||d.startsWith(c+i.sep)?d:null}(a,c);return d&&await ab(d)?d:null}async function ab(a){try{return(await (0,g.stat)(a)).isFile()}catch{return!1}}async function ac(a,b,c=0){let d={outcome:"skipped",messageId:null,timestampMs:null},e=b.prompt;if(!e)return d;let f=await (0,m.Ce)(a,(0,n.jN)(b.conversationId,e.stepIndex),e.text,e.timestampMs,c>0?{adoptionFromMs:c}:{});return"failed"===f.outcome?(S.warn("antigravity-transcript-user-turn-failed",{worktreeId:a.worktreeId,instanceId:a.instanceId??a.cliToolId,conversationId:b.conversationId,stepIndex:e.stepIndex}),d):f}async function ad(a,b,d,e,f){let g=a.instanceId??a.cliToolId;if(0===d.body.length)return S.info("antigravity-transcript-turn-empty",{worktreeId:a.worktreeId,instanceId:g,conversationId:d.conversationId,stepIndex:d.stepIndex,records:b.records.length}),!1;d.unknownRecordTypes.length>0&&S.info("antigravity-transcript-unknown-records",{worktreeId:a.worktreeId,instanceId:g,conversationId:d.conversationId,stepIndex:d.stepIndex,recordTypes:d.unknownRecordTypes}),b.overflowed&&S.info("antigravity-transcript-turn-overflowed",{worktreeId:a.worktreeId,instanceId:g,conversationId:d.conversationId,stepIndex:d.stepIndex});let h=(0,n.O1)(d.conversationId,d.stepIndex),[{getDbInstance:i},{createMessage:j,findMessageByRequestId:k},{broadcastMessage:l}]=await Promise.all([Promise.resolve().then(c.bind(c,88807)),Promise.resolve().then(c.bind(c,56791)),Promise.all([c.e(1503),c.e(4299),c.e(1719),c.e(6894),c.e(5120)]).then(c.bind(c,79129))]),m=i();if(k(m,a.worktreeId,h))return S.debug("antigravity-transcript-turn-already-saved",{worktreeId:a.worktreeId,instanceId:g,requestId:h}),!0;let o=j(m,{worktreeId:a.worktreeId,role:"assistant",content:d.body,messageType:"normal",timestamp:new Date(e>0?e:Date.now()),cliToolId:a.cliToolId,instanceId:g,requestId:h});return l("message",{worktreeId:a.worktreeId,message:o}),S.info("antigravity-transcript-turn-saved",{worktreeId:a.worktreeId,instanceId:g,conversationId:d.conversationId,requestId:h,path:f,bodyLength:d.body.length,textBlocks:d.textBlocks,toolBlocks:d.toolBlocks}),!0}var ae=c(70997),af=c(2734),ag=c(76835),ah=c(97709);let ai=(0,d.h)("lib/polling/structured-history-gate"),aj=globalThis.__structuredHistoryCaptureQueue??=new Map,ak={[ae.v]:{capture:(a,b)=>(0,f.K$)(a,b),locate:(a,b)=>(0,f.Oi)(a,b)},[af.c]:{capture:(a,b)=>G(a,b),locate:(a,b)=>H(a,b)},[ag.F]:{capture:(a,b)=>Z(a,b),locate:(a,b)=>$(a,b)}};function al(a){try{return(0,ah.VM)(a).capabilities.transcriptHistory??null}catch(b){return ai.warn("structured-history-capability-unavailable",{cliToolId:a,error:b instanceof Error?b.message:String(b)}),null}}function am(a){return"pull"===al(a)}function an(a,b,c){if("push"!==al(b))return!1;try{return(0,e.f4)({worktreeId:a,cliToolId:b,instanceId:c??b})}catch(d){return ai.warn("structured-history-gate-unavailable",{worktreeId:a,cliToolId:b,instanceId:c??b,error:d instanceof Error?d.message:String(d)}),!1}}async function ao(a,b,c,d){if(!am(b))return!1;let e=ak[b];if(!e)return ai.warn("structured-history-reader-missing",{worktreeId:a,cliToolId:b,instanceId:c??b}),!1;let f=c??b;return function(a,b){let c=(aj.get(a)??Promise.resolve()).then(b,b),d=c.then(()=>void 0,()=>void 0);return aj.set(a,d),d.then(()=>{aj.get(a)===d&&aj.delete(a)}),c}(`${a}\u0000${b}\u0000${f}`,async()=>{try{return await e.capture({worktreeId:a,cliToolId:b,instanceId:f},d)}catch(c){return ai.warn("structured-history-capture-unavailable",{worktreeId:a,cliToolId:b,instanceId:f,error:c instanceof Error?c.message:String(c)}),!1}})}async function ap(a,b,c,d){let e=am(b)?ak[b]:void 0;if(!e)return!1;try{let f=await e.locate({worktreeId:a,cliToolId:b,instanceId:c??b},d);return null!==f}catch(d){return ai.warn("structured-history-locate-unavailable",{worktreeId:a,cliToolId:b,instanceId:c??b,error:d instanceof Error?d.message:String(d)}),!1}}}};
@@ -1 +0,0 @@
1
- "use strict";exports.id=7824,exports.ids=[7824],exports.modules={26895:(a,b,c)=>{c.d(b,{gF:()=>n,xn:()=>g});var d=c(72626),e=c(69119),f=c(68652);function g(a,b="yes_no"){let c=a.toLowerCase().trim();if("multiple_choice"===b){if(/^\d+$/.test(c))return c;throw Error("Invalid answer for multiple choice prompt. Expected a number.")}if("yes"===c||"y"===c)return"y";if("no"===c||"n"===c)return"n";throw Error("Invalid answer for yes/no prompt. Expected 'yes', 'no', 'y', or 'n'.")}let h=(0,d.h)("prompt-detector"),i=null;function j(a){let b=a.split("\n"),c=(b.length>200?b.slice(-200):b).join("\n");return c.length>5e3&&(c=c.slice(-5e3)),c}let k=[{regex:/^(.+)\s+\(y\/n\)\s*$/m},{regex:/^(.+)\s+\[y\/N\]\s*$/m,defaultOption:"no"},{regex:/^(.+)\s+\[Y\/n\]\s*$/m,defaultOption:"yes"},{regex:/^(.+)\s+\(yes\/no\)\s*$/m}];function l(a,b,c,d){let{startLine:f,endLine:g}=function(a,b,c){let d=c.index??0,e=a=>a.split("\n").length-1,f=b+e(a.slice(0,d));return{startLine:f,endLine:f+e(c[0])}}(b,c,d);return(0,e.ZH)(a,(0,e.wf)(a,f),g+1)}function m(a,b,c,d,e){return{isPrompt:!0,promptData:{type:"yes_no",question:a,options:["yes","no"],status:"pending",...void 0!==e&&{defaultOption:e},instructionText:c,...void 0!==d&&{approvalTarget:d}},cleanContent:b,rawContent:c}}function n(a,b){let c=(0,f.N)(a),d=c===a&&b?.precomputedLines?b.precomputedLines:c.split("\n"),g=d.slice(-50).join("\n"),n=g===i;n||h.debug("detectPrompt:start",{outputLength:c.length}),i=g;let o=d.slice(-20).join("\n"),p=Math.max(0,d.length-20),q=(0,e.rS)(c,b,j);if(q.isPrompt)return n||h.info("detectPrompt:multipleChoice",{isPrompt:!0,question:q.promptData?.question,optionsCount:q.promptData?.options?.length}),q;let r=o.trim();for(let a of k){let b=o.match(a.regex);if(b){let c=b[1].trim();return m(c,c,r,l(d,o,p,b),a.defaultOption)}}let s=o.match(/^(.*?)Approve\?\s*$/m);if(s){let a=s[1].trim();return m(a?`${a} Approve?`:"Approve?",a||"Approve?",r,l(d,o,p,s))}return n||h.debug("detectPrompt:complete",{isPrompt:!1}),{isPrompt:!1,cleanContent:c.trim()}}},31766:(a,b,c)=>{c.d(b,{Wh:()=>p,WD:()=>q,K1:()=>o});var d=c(83468),e=c(72626),f=c(79892);let g={streamingOutput:!1,explicitResize:!1,snapshotFallback:!0};class h{async unsubscribe(){}}class i{async ensureSession(a,b){await (0,f.N)(a)||await (0,f.jw)(a,b)}async sessionExists(a){return(0,f.N)(a)}async sendInput(a,b){await (0,f.V1)(a,b)}async sendSpecialKey(a,b){if("Escape"!==b&&"C-c"!==b&&"C-d"!==b&&"C-m"!==b&&"Enter"!==b)throw Error(`Unsupported special key for PollingTmuxTransport: ${b}`);await (0,f.ds)(a,b)}async resize(){throw Error("PollingTmuxTransport does not support explicit resize")}async captureSnapshot(a,b){return(0,f.Xg)(a,b)}async subscribe(){return new h}getCapabilities(){return g}async killSession(a){return(0,f.fY)(a)}}let j=null;var k=c(93997);let l=(0,e.h)("cli-session");function m(){return j||(j=new i),j}function n(a,b,c){let e=d.CLIToolManager.getInstance().getTool(b),f=e.getSessionName(a,c);return{cliTool:e,sessionName:f}}async function o(a,b,c){let{sessionName:d}=n(a,b,c);return m().sessionExists(d)}async function p(a,b,c=1e3,d){let e=l.withContext({worktreeId:a,cliToolId:b});e.debug("captureSessionOutput:start",{requestedLines:c});let{cliTool:f,sessionName:g}=n(a,b,d),h=m();try{let a=await (0,k.aq)(g,c,async()=>{if(!await h.sessionExists(g))throw Error(`${f.name} session ${g} does not exist`);return await h.captureSnapshot(g,{startLine:-k.xE})});return e.debug("captureSessionOutput:success",{actualLines:a.split("\n").length,lastFewLines:a.split("\n").slice(-3).join(" | ")}),a}catch(b){let a=b instanceof Error?b.message:String(b);if(a.includes("does not exist"))throw e.debug("captureSessionOutput:sessionNotFound",{sessionName:g}),b;throw e.error("captureSessionOutput:failed",{error:a}),Error(`Failed to capture ${f.name} output: ${a}`)}}async function q(a,b,c=5e3,d){let e=l.withContext({worktreeId:a,cliToolId:b});e.debug("captureSessionOutputFresh:start",{requestedLines:c});let{cliTool:f,sessionName:g}=n(a,b,d),h=m();try{let a=await h.captureSnapshot(g,{startLine:-c});return a.length>0?(0,k.vF)(g,a,c):(0,k.gm)(g),(0,k.wd)(a,c)}catch(b){(0,k.gm)(g);let a=b instanceof Error?b.message:String(b);throw e.error("captureSessionOutputFresh:failed",{error:a}),Error(`Failed to capture ${f.name} output: ${a}`)}}},32759:(a,b,c)=>{c.d(b,{bN:()=>ab});var d=c(85164),e=c(37717),f=c(26895);let g=["enforce","observe","legacy"],h={claude:"observe",copilot:"enforce",opencode:"enforce",codex:"legacy",gemini:"legacy",antigravity:"legacy","vibe-local":"legacy"},i=globalThis.__idleEvidenceObservations??(globalThis.__idleEvidenceObservations=new Map),j=new Set(["opencode","codex","claude","copilot"]);function k(a){return{...a,detect:(b,c)=>(function(a,b,c={}){let k=a.beforePrompt?.(b)??null;if(k)return k;let l=(0,d.KO)(a.tool),m=j.has(a.tool)?(0,d._A)(b.clean):(0,d._A)(b.lastLines),n=(0,f.gF)(m,l);if(n.isPrompt)if(!a.isStalePrompt?.(b,n))return{status:"waiting",confidence:"high",reason:e.g.PROMPT_DETECTED,hasActivePrompt:!0,evidence:"positive",promptDetection:n};else n={...n,isPrompt:!1,promptData:void 0};let o=a.afterPrompt?.(b,n)??null;if(o)return{...o,promptDetection:o.promptDetection??n};if((0,d.ut)(a.tool,b.thinkingLines))return{status:"running",confidence:"high",reason:e.g.THINKING_INDICATOR,hasActivePrompt:!1,evidence:"positive",promptDetection:n};let p=a.afterThinking?.(b,n)??null;if(p)return{...p,promptDetection:p.promptDetection??n};if(!a.skipGenericInputPrompt){let{promptPattern:c}=(0,d._X)(a.tool);if(c.test(b.lastLines))return{status:"ready",confidence:"high",reason:e.g.INPUT_PROMPT,hasActivePrompt:!1,evidence:function(a,b){if(void 0===a.readIdleEvidence)return"positive";let c=function(a,b=process.env){let c=b.CM_DETECTION_IDLE_EVIDENCE,d=null,e=null;if("string"==typeof c&&""!==c.trim())for(let b of c.split(",")){let[c,f]=b.split("=");if(void 0===f)continue;let h=c.trim(),i=f.trim();g.includes(i)&&("*"===h?d=i:h===a&&(e=i))}return e??d??h[a]??"legacy"}(a.tool);if("legacy"===c)return"positive";let d=a.readIdleEvidence(b);var e=a.tool;let f=i.get(e)??{mode:c,positive:0,none:0};return f.mode=c,"positive"===d?f.positive+=1:f.none+=1,i.set(e,f),"observe"===c?"positive":d}(a,b),promptDetection:n}}return c.lastOutputTimestamp&&Date.now()-c.lastOutputTimestamp.getTime()>5e3?{status:"running",confidence:"low",reason:e.g.NO_RECENT_OUTPUT,hasActivePrompt:!1,evidence:"none",promptDetection:n}:{status:"running",confidence:"low",reason:a.unreadableReason??e.g.DEFAULT,hasActivePrompt:!1,evidence:"none",promptDetection:n}})(a,b,c),detectDialog:a.detectDialog??(()=>null),hasDialogRules:void 0!==a.detectDialog}}var l=c(1804);let m=k({tool:"antigravity",verifiedAgainst:l.yh,beforePrompt:a=>d.kT.test(a.lastLines)?{status:"waiting",confidence:"high",reason:e.g.ANTIGRAVITY_SELECTION_LIST,hasActivePrompt:!1,evidence:"positive"}:null,afterThinking(a){if((0,d.ut)("antigravity",a.lastLines))return{status:"running",confidence:"high",reason:e.g.THINKING_INDICATOR,hasActivePrompt:!1,evidence:"positive"};let{promptPattern:b}=(0,d._X)("antigravity");return b.test(a.lastLines)?{status:"ready",confidence:"high",reason:e.g.INPUT_PROMPT,hasActivePrompt:!1,evidence:"positive"}:null}});var n=c(94154),o=c(69119);let p=/^[^\S\n]*[│┃]?[^\S\n]*([❯›●>])?[^\S\n]*(\d{1,2})[.)][^\S\n]+(\S.*?)[^\S\n]*[│┃]?$/;function q(a){let b=p.exec(a);if(!b)return null;let c=Number(b[2]);return!Number.isInteger(c)||c<1?null:{glyph:b[1],number:c,label:b[3].trim()}}function r(a,b,c=8){let d=Math.min(b,a.length)-1,e=0,f=[],g=null;for(;d>=0&&e<=c;){let b=a[d];if(""===b.trim()){d--;continue}if(e++,g=q(b))break;f.unshift(b.trim()),d--}if(!g)return null;let h=d,i=[g],j=g.number-1,k=d-1,l=1,m=[];for(;j>=1&&k>=0&&l<=60;){let b=a[k];if(l++,""===b.trim()){k--;continue}let c=q(b);if(c&&c.number===j){i.unshift({...c,label:[c.label,...m].join(" ").trim()}),m=[],j--,k--;continue}if(c)break;m.unshift(b.trim()),k--}if(0!==j||i.length<2)return null;let n=i.findIndex(a=>void 0!==a.glyph);return{options:i.map(a=>a.label),selectedIndex:n,selectedGlyph:n<0?null:i[n].glyph??null,firstRow:k+1,lastRow:h,footer:f.join("\n")}}let s=/esc\s+to\s+cancel|enter\s+to\s+(?:select|confirm|set\s+as\s+default)/i,t=new Set(["❯",">"]),u=/do you want to\b|allow\b.*\?$/i,v=/ready to submit your answers\?|review your answers/i,w=/set\s+as\s+default/i,x=/^\s*[✻✽✶✢✳⦿◉●·⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏]\s+\S+\s+for\s+(?:\d+m\s*)?\d+(?:\.\d+)?s(?:\s|$|\s*·)/,y=/^\s*╭─+\s*Claude Code v/,z=/^\s*[>❯]\s+\S/,A=/·\s*\/effort\s*$/;function B(a){let b=(0,n.p4)(a),c=b?b.openingSeparator:a.length,d=(0,o.oT)(a,0,c),e=c-1;for(;e>=0&&(""===a[e].trim()||d.has(e)||A.test(a[e]));)e--;return e}let C=k({tool:"claude",verifiedAgainst:l.iE,afterPrompt:a=>d.XY.test(a.lastLines)?{status:"waiting",confidence:"high",reason:e.g.CLAUDE_SELECTION_LIST,hasActivePrompt:!1,evidence:"positive"}:null,afterThinking:a=>d.aU.test(a.lastLines)?{status:"running",confidence:"high",reason:e.g.THINKING_INDICATOR,hasActivePrompt:!1,evidence:"positive"}:null,readIdleEvidence:function(a){let b=B(a.contentLines);if(b>=0&&x.test(a.contentLines[b]))return"positive";let c=(0,n.p4)(a.contentLines),d=a.contentLines.slice(0,c?c.openingSeparator:void 0),e=d.some(a=>y.test(a)),f=d.some(a=>z.test(a));return e&&!f?"positive":"none"},detectDialog:a=>(function(a,b){var c;if(b.transcriptTail<0)return null;let e=(0,d._A)(a.clean).split("\n"),f=r(e,b.transcriptTail+1);if(!f||null===f.selectedGlyph||!t.has(f.selectedGlyph))return null;let g=f.footer.trim();return""===g||s.test(g)?{kind:(c=function(a,b){let c=[];for(let d=b-1;d>=0&&c.length<4;d--){let b=a[d].trim();""!==b&&c.push(b)}return c.join("\n")}(e,f.firstRow),v.test(c)?"ask_user":w.test(g)?"picker":u.test(c)?"permission":"dialog"),options:f.options,answerMode:"numbered"}:null})(a,{transcriptTail:B(a.contentLines)})}),D={"hooks-review":"permission","hooks-list":"picker","hooks-detail":"picker",update:"update",trust:"trust"};var E=c(74258),F=c(46423);let G=l.jP,H=/press\s+(?:number|enter)\s+to\s+confirm/i,I=/^\s*[❯›●]?\s*\d{1,2}[.)]\s/;function J(a){for(let b=a.length-1;b>=Math.max(0,a.length-10);b--)if(d.aW.test(a[b]))return b;return -1}function K(a){let b=J(a),c=b>=0?b:a.length,e=-1,f=-1;for(let b=0;b<c;b++){let c=a[b],g=c.trim();""!==g&&((H.test(g)||I.test(g))&&(e=b),(0,d.ut)("codex",c)&&(f=b))}return e>=0&&f>e}let L=k({tool:"codex",verifiedAgainst:G,beforePrompt(a){let{contentLines:b}=a;if(d.pn.test(a.lastLines))return{status:"waiting",confidence:"high",reason:e.g.CODEX_PAGER,hasActivePrompt:!1,evidence:"positive",promptDetection:(0,f.gF)((0,d._A)(a.clean),(0,d.KO)("codex"))};let c=(0,d.E6)(a.clean);if("hooks-list"===c||"hooks-detail"===c)return{status:"waiting",confidence:"high",reason:e.g.CODEX_HOOKS_REVIEW,hasActivePrompt:!1,evidence:"positive",promptDetection:(0,f.gF)((0,d._A)(a.clean),(0,d.KO)("codex"))};let g=J(b),h=g>=0?g-1:b.length-1;for(;h>=0&&""===b[h].trim();)h--;if(h>=0){let c=b.slice(Math.max(0,h-E.h+1),h+1).join("\n");if(d.Jn.test(c)){let g=(0,f.gF)((0,d._A)(a.clean),(0,d.KO)("codex"));return g.isPrompt&&((g.promptData?.question?.trim()??"").endsWith("?")||d.Dd.test(c))&&!K(b)?{status:"waiting",confidence:"high",reason:e.g.PROMPT_DETECTED,hasActivePrompt:!0,evidence:"positive",promptDetection:g}:{status:"waiting",confidence:"high",reason:e.g.CODEX_SELECTION_LIST,hasActivePrompt:!1,evidence:"positive",promptDetection:g}}}return null},isStalePrompt:a=>K(a.contentLines),detectDialog:a=>(function(a,b){let c=(0,d._A)(a.clean).split("\n"),e=r(c,b.contentEnd);if(b.lifecycleDialog)return{kind:D[b.lifecycleDialog],options:e?.options??[],answerMode:"numbered"};if(!e||!d.Jn.test(e.footer)||b.stalePrompt)return null;let f=function(a,b){let c=[];for(let d=b-1;d>=0&&c.length<4;d--){let b=a[d].trim();""!==b&&c.push(b)}return c.join("\n")}(c,e.firstRow);return{kind:d.Dd.test(e.footer)||f.split("\n")[0]?.endsWith("?")?"permission":"picker",options:e.options,answerMode:"numbered"}})(a,{contentEnd:function(a){let b=J(a),c=b>=0?b-1:a.length-1;for(;c>=0&&""===a[c].trim();)c--;return c+1}(a.contentLines),stalePrompt:K(a.contentLines),lifecycleDialog:(0,d.E6)(a.clean)}),afterThinking(a){let{contentLines:b}=a,c=J(b);if(c>=0){let a=c-1;for(;a>=0&&""===b[a].trim();)a--;if(a>=0){let c=b.slice(Math.max(0,a-F.$+1),a+1).join("\n");return(0,d.ut)("codex",c)?{status:"running",confidence:"high",reason:e.g.THINKING_INDICATOR,hasActivePrompt:!1,evidence:"positive"}:d.gm.test(b[a].trim())?{status:"ready",confidence:"high",reason:e.g.INPUT_PROMPT,hasActivePrompt:!1,evidence:"positive"}:{status:"running",confidence:"high",reason:e.g.THINKING_INDICATOR,hasActivePrompt:!1,evidence:"positive"}}}else{let c=b.length-1;for(;c>=0&&""===b[c].trim();)c--;if(!(c>=0&&d.gm.test(b[c].trim()))&&(0,d.ut)("codex",a.lastLines))return{status:"running",confidence:"high",reason:e.g.THINKING_INDICATOR,hasActivePrompt:!1,evidence:"positive"}}return null}}),M=/do you want to\b/i,N=k({tool:"copilot",verifiedAgainst:l.MJ,beforePrompt(a){if((0,d.gT)(a.contentLines)){let b=(0,d.KO)("copilot"),c=(0,f.gF)((0,d._A)(a.clean),b);return c.isPrompt&&(c.promptData?.options?.length??0)<=3?{status:"waiting",confidence:"high",reason:e.g.PROMPT_DETECTED,hasActivePrompt:!0,evidence:"positive",promptDetection:c}:{status:"waiting",confidence:"high",reason:e.g.COPILOT_SELECTION_LIST,hasActivePrompt:!1,evidence:"positive",promptDetection:c}}if("working"===(0,d.Wn)(a.contentLines)){let b=(0,d.KO)("copilot"),c=(0,f.gF)((0,d._A)(a.clean),b);return{status:"running",confidence:"high",reason:e.g.THINKING_INDICATOR,hasActivePrompt:!1,evidence:"positive",promptDetection:c}}return null},afterThinking:a=>"idle"===(0,d.Wn)(a.contentLines)?{status:"ready",confidence:"high",reason:e.g.INPUT_PROMPT,hasActivePrompt:!1,evidence:"positive"}:null,skipGenericInputPrompt:!0,readIdleEvidence:function(a){return"idle"===(0,d.Wn)(a.contentLines)?"positive":"none"},detectDialog:a=>(function(a,b){if(null!==b.statusBar)return null;let c=(0,d._A)(a.clean).split("\n"),e=r(c,b.contentEnd);if(e&&d.V.test(e.footer)){let a=function(a,b){let c=[];for(let d=b-1;d>=0&&c.length<4;d--){let b=a[d].trim();""!==b&&c.push(b)}return c.join("\n")}(c,e.firstRow);return{kind:d.Ki.some(b=>a.includes(b))?"trust":M.test(a)?"permission":"picker",options:e.options,answerMode:"numbered"}}return b.selectionFrame?{kind:"picker",options:[],answerMode:"keys"}:null})(a,{statusBar:(0,d.Wn)(a.contentLines),selectionFrame:(0,d.gT)(a.contentLines),contentEnd:a.contentLines.length}),unreadableReason:e.g.UNKNOWN_FRAME});var O=c(76777),P=c(50524);let Q=/\S[^\S\n]{2,}esc[^\S\n]*$/,R=/^[│┃╹]/,S=/\x1b\[[0-9;]*[a-zA-Z]|\x1b\][^\x07\x1b]*(?:\x07|\x1b\\)|\[[0-9;]*m/g,T=/^(?:\x1b\[|\[)([0-9;]*)m$/;function U(a){let b;S.lastIndex=0;let c=[],d="",e=null,f=0,g=0,h=0;for(;null!==(b=S.exec(a));){let i=a.slice(h,b.index);d+=i,f+=(0,P.LQ)(i),h=b.index+b[0].length;let j=T.exec(b[0]);if(null===j)continue;let k=function(a,b){let c=(""===b?"0":b).split(";"),d=a;for(let a=0;a<c.length;a++){let b=Number(""===c[a]?"0":c[a]);Number.isFinite(b)&&(0===b||49===b?d=null:b>=40&&b<=47||b>=100&&b<=107?d=c[a]:48===b&&("2"===c[a+1]?(d=c.slice(a,a+5).join(";"),a+=4):"5"===c[a+1]&&(d=c.slice(a,a+3).join(";"),a+=2)))}return d}(e,j[1]);k!==e&&(f>g&&c.push({bg:e,start:g,end:f}),e=k,g=f)}let i=a.slice(h);d+=i,(f+=(0,P.LQ)(i))>g&&c.push({bg:e,start:g,end:f});let j=new Set(c.map(a=>a.start));return c.length>0&&j.add(c[c.length-1].end),{text:d,segments:c,edges:j,width:f}}function V(a,b){for(let c of a.segments)if(c.start<=b&&b<c.end)return c.bg;return null}function W(a,b,c){if(!a.edges.has(b)||!a.edges.has(c))return!1;for(let d of a.segments)if(!(d.end<=b)&&!(d.start>=c)&&null===d.bg)return!1;return!(V(a,b-1)===V(a,b)||c<a.width&&V(a,c)===V(a,c-1)||R.test((0,P.Ml)(a.text,b-1,b)))&&!R.test((0,P.Ml)(a.text,b,c))}function X(a){let b=a.split("\n").map(U),c=new Set,d=null;for(let a of b){if(!a.text.includes("esc"))continue;let e=[...a.edges].sort((a,b)=>a-b);for(let f of e)if(!(f<1))for(let g of e){if(g-f<16)continue;let e=`${f}:${g}`;if(c.has(e)||!W(a,f,g))continue;let h=(0,P.Ml)(a.text,f,g);if(!Q.test(h))continue;c.add(e);let i=b.filter(a=>W(a,f,g));if(i.length<3)continue;let j=i.indexOf(a);j<0||j>=3||(null===d||i.length>d.rows)&&(d={id:"opencode_modal_overlay",headerText:(0,O.D)(h.trim(),200,"…[truncated]"),left:f,right:g,rows:i.length,headerRow:j})}}return d}let Y=/\s{2,}/;function Z(a){let b=(0,d._A)(a.clean).split("\n"),c=Math.max(0,b.length-7);for(let a=b.length-1;a>=Math.max(0,b.length-10);a--)if(/ctrl\+[tp]/.test(b[a])){c=Math.max(0,a-2);break}let e=b.slice(0,c),f=e.length-1;for(;f>=0&&""===e[f].trim();)f--;return{candidates:e,lastIndex:f}}let $=k({tool:"opencode",verifiedAgainst:l.BG,afterThinking(a){if(d.Ty.test(a.lastLines))return{status:"waiting",confidence:"high",reason:e.g.OPENCODE_PERMISSION_PROMPT,hasActivePrompt:!1,evidence:"positive"};if(d.kD.test(a.lastLines))return{status:"running",confidence:"high",reason:e.g.OPENCODE_PROCESSING_INDICATOR,hasActivePrompt:!1,evidence:"positive"};let{candidates:b,lastIndex:c}=Z(a);if(c<0)return null;let f=b.slice(Math.max(0,c-F.$+1),c+1).join("\n");if((0,d.ut)("opencode",f))return{status:"running",confidence:"high",reason:e.g.THINKING_INDICATOR,hasActivePrompt:!1,evidence:"positive"};let g=b.slice(Math.max(0,c-E.h+1),c+1).join("\n");if(d.LO.test(b.join("\n")))return{status:"waiting",confidence:"high",reason:e.g.OPENCODE_SELECTION_LIST,hasActivePrompt:!1,evidence:"positive"};if(null!==X(a.raw))return{status:"waiting",confidence:"high",reason:e.g.OPENCODE_MODAL_OVERLAY,hasActivePrompt:!1,evidence:"positive"};if(d.$t.test(g))return{status:"ready",confidence:"high",reason:e.g.OPENCODE_RESPONSE_COMPLETE,hasActivePrompt:!1,evidence:"positive"};let h=a.lines.slice(Math.max(0,c-E.h+1),c+1).join("\n");return d.vU.test(h)?{status:"ready",confidence:"high",reason:e.g.INPUT_PROMPT,hasActivePrompt:!1,evidence:"positive"}:null},skipGenericInputPrompt:!0,readIdleEvidence:function(a){let{candidates:b,lastIndex:c}=Z(a);if(c<0)return"none";let e=b.slice(Math.max(0,c-E.h+1),c+1).join("\n");if(d.$t.test(e))return"positive";let f=a.lines.slice(Math.max(0,c-E.h+1),c+1).join("\n");return d.vU.test(f)?"positive":"none"},detectDialog(a){var b;let{candidates:c}=Z(a);return b={contentWindow:c.join("\n")},d.Ty.test(a.lastLines)?{kind:"permission",options:function(a){for(let b of a.lines){let a=d.Ty.exec(b);if(a)return a[0].replace(/^[^\S\n]*[│┃][^\S\n]*/,"").trim().split(Y).map(a=>a.trim()).filter(a=>""!==a)}return[]}(a),answerMode:"keys"}:d.LO.test(b.contentWindow)||null!==X(a.raw)?{kind:"picker",options:[],answerMode:"keys"}:null},unreadableReason:e.g.UNKNOWN_FRAME});function _(a){return k({tool:a,verifiedAgainst:l.hB})}let aa={claude:C,codex:L,copilot:N,opencode:$,antigravity:m,gemini:_("gemini"),"vibe-local":_("vibe-local")};function ab(a){return aa[a]??_(a)}Object.values(aa)},37717:(a,b,c)=>{c.d(b,{g:()=>d});let d={PROMPT_DETECTED:"prompt_detected",THINKING_INDICATOR:"thinking_indicator",OPENCODE_PROCESSING_INDICATOR:"opencode_processing_indicator",OPENCODE_SELECTION_LIST:"opencode_selection_list",OPENCODE_MODAL_OVERLAY:"opencode_modal_overlay",OPENCODE_PERMISSION_PROMPT:"opencode_permission_prompt",CLAUDE_SELECTION_LIST:"claude_selection_list",COPILOT_SELECTION_LIST:"copilot_selection_list",CODEX_SELECTION_LIST:"codex_selection_list",CODEX_PAGER:"codex_pager",CODEX_HOOKS_REVIEW:"codex_hooks_review",ANTIGRAVITY_SELECTION_LIST:"antigravity_selection_list",OPENCODE_RESPONSE_COMPLETE:"opencode_response_complete",INPUT_PROMPT:"input_prompt",NO_RECENT_OUTPUT:"no_recent_output",EXITED:"exited",UNKNOWN_FRAME:"unknown_frame",DEFAULT:"default"}},50524:(a,b,c)=>{c.d(b,{LQ:()=>g,Ml:()=>f,sh:()=>e});let d=/^\p{M}$/u;function e(a,b){if(a.length<=b)return a.length;let c=0,e=0;for(let f of a){let a=+!d.test(f);if(1===a&&c>=b)break;c+=a,e+=f.length}return e}function f(a,b,c){return a.slice(e(a,b),e(a,c))}function g(a){let b=0;for(let c of a)d.test(c)||(b+=1);return b}},68652:(a,b,c)=>{c.d(b,{N:()=>g});let d=/Esc\s+to\s+cancel\s*[·•]\s*Tab\s+to\s+amend/i,e=/Enter\s+to\s+select\b.*\bnavigate\b/i,f=/^\s*[>❯]\s*(?:\d{1,2}[.)])?|esc\s+to\s+interrupt|[✻✽✶✢✳⦿◉●⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏]\s+.+…/i;function g(a){if(""===a)return"";let b=a.split("\n"),c=-1;for(let a=b.length-1;a>=0;a--){var g;if(g=b[a],d.test(g)||e.test(g)){c=a;break}}let h=b;return c>=0&&(h=b.slice(c+1).some(a=>f.test(a))?b.slice(c+1):b.slice(0,c+1)),(function(a){let b=[],c=!1;for(let d of a){let a=""===d.trim();a&&c||(b.push(d),c=a)}for(;b.length>0&&""===b[b.length-1].trim();)b.pop();return b})(h).join("\n")}},69119:(a,b,c)=>{c.d(b,{ZH:()=>z,oT:()=>j,rS:()=>A,wf:()=>y});var d=c(68652),e=c(85164);let f=/^\s*[\u276F\u25CF\u203A][^\d]*(\d+)(?:\.(?!\d)|\s{2,})\s*(.+)$/,g=/^\s*[^\d]{0,3}(\d+)(?:\.(?!\d)|\s+)\s*(.+)$/,h=/^\s*\d{1,3}\s+tasks?\s+\(\d+\s+done\b/i,i=/^\s*[◼◻]\s/;function j(a,b,c){let d=new Set;for(let e=Math.max(0,b);e<Math.min(c,a.length);e++)if(h.test(a[e])){d.add(e);for(let b=e+1;b<Math.min(c,a.length);b++){let c=a[b];if(!i.test(c)&&!m.test(c))break;d.add(b)}}return d}let k=/^[-─]+$/,l=/^\s*\[[^\]]*\d+\s+lines?\]/i,m=/^\s*[…]?\s*[+\-↑↓⏵⏷]?\s*\d+\s+(?:pending|more|completed)\b/i,n=/Esc\s+to\s+cancel\s*[·•]\s*Tab\s+to\s+amend/i,o=/Enter\s+to\s+select\b.*\bnavigate\b/i,p=/press\s+(?:enter|number)\s+to\s+confirm/i,q=/press\s+number\s+to\s+confirm/i,r=/(?:select|choose|pick|which|what|how|where|enter|type|specify|confirm|approve|accept|reject|decide|preference|option)/i,s=[/type\s+here/i,/tell\s+(me|claude)/i,/enter\s+/i,/custom/i,/differently/i];function t(a,b){if(0===b.length)return!0;let c=b[0].number;return a<c&&a>=c-2}function u(a){return{isPrompt:!1,cleanContent:a.trim()}}function v(a){return 0!==a.length&&!!(a.includes("?")||a.includes("?")||r.test(a))}function w(a,b){let c=b.endsWith("?")||b.endsWith("?");return!!(!c&&/^\s{2,}[^\d]/.test(a)&&!/^\s*\d+\./.test(a)||!c&&/^\s{4,}/.test(a)&&!/^\s*\d+\.\s/.test(a)||b.length<5&&!c||/^[\/~]/.test(b)||b.length>=2&&/^[a-zA-Z0-9_-]+$/.test(b))}let x=/^[⏺⎿●○•✔✓✖✗✘›»❯└├>]/;function y(a,b){let c=Math.max(0,b-12);for(let d=b-1;d>=c;d--)if(function(a){if(void 0===a)return!1;let b=a.trim();return""!==b&&(x.test(b)||k.test(b))}(a[d]))return d+1;return c}function z(a,b,c){let d=a.slice(b,c).map(a=>a.trimEnd()).join("\n").trim();return d.length>0?d:void 0}function A(a,b,c){if(a=(0,d.N)(a),b?.hasNumberedDialogs===!1)return u(a);let h=b?.requireDefaultIndicator??!0,i=a.split("\n"),r=i.length;for(;r>0&&""===i[r-1].trim();)r--;let x=Math.max(0,r-50),A=!1;for(let a=r-1;a>=x;a--){let b=o.test(i[a]);if(n.test(i[a])||b){r=a,A=b;break}}let B=i.slice(x,r);for(let b of B)if(e.l8.test(b))return u(a);let C=!1,D=!1;for(let a of B){let b=a.trim();if(!C&&p.test(b)){C=!0,q.test(b)&&(D=!0);break}}if(h){let b=!1;for(let a of B){let c=a.trim();if(f.test(c)){b=!0;break}}if(!b&&!C)return u(a)}let E=[],F=-1,G=0,H=j(i,x,r);for(let b=r-1;b>=x;b--){let c=i[b].trim();if(H.has(b)||l.test(c)||m.test(c)){G++;continue}let d=c.match(f);if(d){let a=parseInt(d[1],10);if(a<=20&&t(a,E)){let b=d[2].trim();E.unshift({number:a,label:b,isDefault:!0}),G=0;continue}}let e=c.match(g);if(e){let a=parseInt(e[1],10);if(a>20);else if(t(a,E)){let b=e[2].trim();E.unshift({number:a,label:b,isDefault:!1}),G=0;continue}}if(0===E.length&&(c.startsWith("❯")||c.startsWith("●")||c.startsWith("›")))return u(a);if(E.length>0&&c&&!k.test(c)){let a=i[b];if(/^\s{4,}/.test(a)&&w(a,c)){if(++G>25){F=b;break}continue}if(v(c)){F=b;break}if(w(a,c)){if(++G>(/^\s{4,}/.test(a)?25:5)){F=b;break}continue}F=b;break}}if(!function(a){if(0===a.length||1!==a[0])return!1;let b=0;for(let c=1;c<a.length;c++){let d=a[c]-a[c-1];if(d<1||d>2||(2===d&&b++,b>1))return!1}return!0}(E.map(a=>a.number)))return u(a);let I=E.some(a=>a.isDefault),J=h&&C;if(E.length<2||h&&!I&&!J||!h&&!I&&(-1===F||!v(i[F]?.trim()??"")&&!function(a,b,c,d){let e=Math.max(d,b-3);for(let c=b-1;c>=e;c--){let b=a[c]?.trim()??"";if(!(!b||k.test(b))&&v(b))return!0}return!1}(i,F,0,x)))return u(a);let K=function(a,b){if(b<0)return"Please select an option:";let c=[];for(let d=Math.max(0,b-5);d<=b;d++){let b=a[d].trim();b&&!k.test(b)&&c.push(b)}return c.join(" ")}(i,F),L=function(a,b,c){if(b<0)return;let d=Math.max(0,b-19),e=a.slice(d,c).map(a=>a.trimEnd()).join("\n").trim();return e.length>0?e:void 0}(i,F,r),M=function(a,b,c){if(!(b<0))return z(a,y(a,b),c)}(i,F,r);var N=a,O=C?D?"answer_only":"answer_then_enter":void 0,P=A;let{instructionText:Q,approvalTarget:R}={instructionText:L,approvalTarget:M}??{};return{isPrompt:!0,promptData:{type:"multiple_choice",question:K.trim(),options:E.map(a=>{let b=s.some(b=>b.test(a.label));return{number:a.number,label:a.label,isDefault:a.isDefault,requiresTextInput:b}}),status:"pending",instructionText:Q,...void 0!==R?{approvalTarget:R}:{},...O?{submitMode:O}:{},...P?{isAskUserQuestion:!0}:{}},cleanContent:K.trim(),rawContent:c(N.trim())}}},74258:(a,b,c)=>{c.d(b,{h:()=>g,z:()=>h});var d=c(85164),e=c(68652),f=c(46423);let g=15;function h(a){let b=(0,e.N)((0,d.aJ)(a)),c=b.split("\n"),h=c.length-1;for(;h>=0&&""===c[h].trim();)h--;let i=c.slice(0,h+1);return{raw:a,clean:b,lines:c,contentLines:i,lastLines:i.slice(-g).join("\n"),thinkingLines:i.slice(-f.$).join("\n")}}},76777:(a,b,c)=>{c.d(b,{D:()=>d});function d(a,b,c){let d=new TextEncoder;if(d.encode(a).length<=b)return a;let e=b-d.encode(c).length,f=0,g="";for(let b of a){let a=d.encode(b).length;if(f+a>e)break;f+=a,g+=b}return`${g}${c}`}}};