commandmate 0.33.3 → 0.34.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 (335) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-build-manifest.json +146 -146
  3. package/.next/app-path-routes-manifest.json +29 -29
  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 +2 -2
  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 +3 -3
  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 +2 -2
  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/relays/[relayId]/cancel/route.js +1 -1
  61. package/.next/server/app/api/relays/[relayId]/cancel/route.js.nft.json +1 -1
  62. package/.next/server/app/api/relays/[relayId]/cancel/route_client-reference-manifest.js +1 -1
  63. package/.next/server/app/api/relays/route.js +1 -1
  64. package/.next/server/app/api/relays/route.js.nft.json +1 -1
  65. package/.next/server/app/api/relays/route_client-reference-manifest.js +1 -1
  66. package/.next/server/app/api/remote/pair/route_client-reference-manifest.js +1 -1
  67. package/.next/server/app/api/repositories/[id]/route_client-reference-manifest.js +1 -1
  68. package/.next/server/app/api/repositories/[id]/todos/[todoId]/route_client-reference-manifest.js +1 -1
  69. package/.next/server/app/api/repositories/[id]/todos/route_client-reference-manifest.js +1 -1
  70. package/.next/server/app/api/repositories/clone/[jobId]/route.js +1 -1
  71. package/.next/server/app/api/repositories/clone/[jobId]/route.js.nft.json +1 -1
  72. package/.next/server/app/api/repositories/clone/[jobId]/route_client-reference-manifest.js +1 -1
  73. package/.next/server/app/api/repositories/clone/route.js +1 -1
  74. package/.next/server/app/api/repositories/clone/route.js.nft.json +1 -1
  75. package/.next/server/app/api/repositories/clone/route_client-reference-manifest.js +1 -1
  76. package/.next/server/app/api/repositories/excluded/route_client-reference-manifest.js +1 -1
  77. package/.next/server/app/api/repositories/restore/route.js +1 -1
  78. package/.next/server/app/api/repositories/restore/route.js.nft.json +1 -1
  79. package/.next/server/app/api/repositories/restore/route_client-reference-manifest.js +1 -1
  80. package/.next/server/app/api/repositories/route.js +1 -1
  81. package/.next/server/app/api/repositories/route.js.nft.json +1 -1
  82. package/.next/server/app/api/repositories/route_client-reference-manifest.js +1 -1
  83. package/.next/server/app/api/repositories/scan/route.js +1 -1
  84. package/.next/server/app/api/repositories/scan/route.js.nft.json +1 -1
  85. package/.next/server/app/api/repositories/scan/route_client-reference-manifest.js +1 -1
  86. package/.next/server/app/api/repositories/sync/route.js +1 -1
  87. package/.next/server/app/api/repositories/sync/route.js.nft.json +1 -1
  88. package/.next/server/app/api/repositories/sync/route_client-reference-manifest.js +1 -1
  89. package/.next/server/app/api/repositories/validate-path/route_client-reference-manifest.js +1 -1
  90. package/.next/server/app/api/settings/default-agents/route.js +1 -1
  91. package/.next/server/app/api/settings/default-agents/route.js.nft.json +1 -1
  92. package/.next/server/app/api/settings/default-agents/route_client-reference-manifest.js +1 -1
  93. package/.next/server/app/api/settings/default-surface-mode/route_client-reference-manifest.js +1 -1
  94. package/.next/server/app/api/sidebar/group-order/route_client-reference-manifest.js +1 -1
  95. package/.next/server/app/api/skills/[id]/route_client-reference-manifest.js +1 -1
  96. package/.next/server/app/api/skills/installations/route_client-reference-manifest.js +1 -1
  97. package/.next/server/app/api/skills/operations/route_client-reference-manifest.js +1 -1
  98. package/.next/server/app/api/skills/reindex/route_client-reference-manifest.js +1 -1
  99. package/.next/server/app/api/skills/route_client-reference-manifest.js +1 -1
  100. package/.next/server/app/api/slash-commands/route_client-reference-manifest.js +1 -1
  101. package/.next/server/app/api/tasks/[taskId]/cancel/route_client-reference-manifest.js +1 -1
  102. package/.next/server/app/api/tasks/[taskId]/route_client-reference-manifest.js +1 -1
  103. package/.next/server/app/api/templates/[id]/route_client-reference-manifest.js +1 -1
  104. package/.next/server/app/api/templates/route_client-reference-manifest.js +1 -1
  105. package/.next/server/app/api/todos/route_client-reference-manifest.js +1 -1
  106. package/.next/server/app/api/verification/runs/[runId]/route_client-reference-manifest.js +1 -1
  107. package/.next/server/app/api/verification/runs/route_client-reference-manifest.js +1 -1
  108. package/.next/server/app/api/worktrees/[id]/auto-yes/route.js +1 -1
  109. package/.next/server/app/api/worktrees/[id]/auto-yes/route.js.nft.json +1 -1
  110. package/.next/server/app/api/worktrees/[id]/auto-yes/route_client-reference-manifest.js +1 -1
  111. package/.next/server/app/api/worktrees/[id]/capture/route.js +1 -1
  112. package/.next/server/app/api/worktrees/[id]/capture/route.js.nft.json +1 -1
  113. package/.next/server/app/api/worktrees/[id]/capture/route_client-reference-manifest.js +1 -1
  114. package/.next/server/app/api/worktrees/[id]/clear-composer/route.js +1 -1
  115. package/.next/server/app/api/worktrees/[id]/clear-composer/route.js.nft.json +1 -1
  116. package/.next/server/app/api/worktrees/[id]/clear-composer/route_client-reference-manifest.js +1 -1
  117. package/.next/server/app/api/worktrees/[id]/cli-reference/route_client-reference-manifest.js +1 -1
  118. package/.next/server/app/api/worktrees/[id]/cli-tool/route_client-reference-manifest.js +1 -1
  119. package/.next/server/app/api/worktrees/[id]/cmate/schedules/route_client-reference-manifest.js +1 -1
  120. package/.next/server/app/api/worktrees/[id]/current-output/route.js +1 -1
  121. package/.next/server/app/api/worktrees/[id]/current-output/route.js.nft.json +1 -1
  122. package/.next/server/app/api/worktrees/[id]/current-output/route_client-reference-manifest.js +1 -1
  123. package/.next/server/app/api/worktrees/[id]/env/route_client-reference-manifest.js +1 -1
  124. package/.next/server/app/api/worktrees/[id]/execution-logs/[logId]/route.js +1 -1
  125. package/.next/server/app/api/worktrees/[id]/execution-logs/[logId]/route_client-reference-manifest.js +1 -1
  126. package/.next/server/app/api/worktrees/[id]/execution-logs/route_client-reference-manifest.js +1 -1
  127. package/.next/server/app/api/worktrees/[id]/files/[...path]/route_client-reference-manifest.js +1 -1
  128. package/.next/server/app/api/worktrees/[id]/git/branch/create/route_client-reference-manifest.js +1 -1
  129. package/.next/server/app/api/worktrees/[id]/git/branch/delete/route_client-reference-manifest.js +1 -1
  130. package/.next/server/app/api/worktrees/[id]/git/branches/route_client-reference-manifest.js +1 -1
  131. package/.next/server/app/api/worktrees/[id]/git/checkout/route_client-reference-manifest.js +1 -1
  132. package/.next/server/app/api/worktrees/[id]/git/commit/route_client-reference-manifest.js +1 -1
  133. package/.next/server/app/api/worktrees/[id]/git/diff/route_client-reference-manifest.js +1 -1
  134. package/.next/server/app/api/worktrees/[id]/git/fetch/route_client-reference-manifest.js +1 -1
  135. package/.next/server/app/api/worktrees/[id]/git/log/route_client-reference-manifest.js +1 -1
  136. package/.next/server/app/api/worktrees/[id]/git/pull/route_client-reference-manifest.js +1 -1
  137. package/.next/server/app/api/worktrees/[id]/git/push/route_client-reference-manifest.js +1 -1
  138. package/.next/server/app/api/worktrees/[id]/git/reset/route_client-reference-manifest.js +1 -1
  139. package/.next/server/app/api/worktrees/[id]/git/revert/route_client-reference-manifest.js +1 -1
  140. package/.next/server/app/api/worktrees/[id]/git/show/[commitHash]/route_client-reference-manifest.js +1 -1
  141. package/.next/server/app/api/worktrees/[id]/git/stage/route_client-reference-manifest.js +1 -1
  142. package/.next/server/app/api/worktrees/[id]/git/staged/route_client-reference-manifest.js +1 -1
  143. package/.next/server/app/api/worktrees/[id]/git/stash/[index]/route_client-reference-manifest.js +1 -1
  144. package/.next/server/app/api/worktrees/[id]/git/stash/apply/route_client-reference-manifest.js +1 -1
  145. package/.next/server/app/api/worktrees/[id]/git/stash/pop/route_client-reference-manifest.js +1 -1
  146. package/.next/server/app/api/worktrees/[id]/git/stash/push/route_client-reference-manifest.js +1 -1
  147. package/.next/server/app/api/worktrees/[id]/git/stash/route_client-reference-manifest.js +1 -1
  148. package/.next/server/app/api/worktrees/[id]/git/status/route_client-reference-manifest.js +1 -1
  149. package/.next/server/app/api/worktrees/[id]/git/unstage/route_client-reference-manifest.js +1 -1
  150. package/.next/server/app/api/worktrees/[id]/git/working-diff/route_client-reference-manifest.js +1 -1
  151. package/.next/server/app/api/worktrees/[id]/instances/notes/route_client-reference-manifest.js +1 -1
  152. package/.next/server/app/api/worktrees/[id]/instances/opencode/route.js.nft.json +1 -1
  153. package/.next/server/app/api/worktrees/[id]/instances/opencode/route_client-reference-manifest.js +1 -1
  154. package/.next/server/app/api/worktrees/[id]/interrupt/route.js +1 -1
  155. package/.next/server/app/api/worktrees/[id]/interrupt/route.js.nft.json +1 -1
  156. package/.next/server/app/api/worktrees/[id]/interrupt/route_client-reference-manifest.js +1 -1
  157. package/.next/server/app/api/worktrees/[id]/kill-session/route.js +1 -1
  158. package/.next/server/app/api/worktrees/[id]/kill-session/route.js.nft.json +1 -1
  159. package/.next/server/app/api/worktrees/[id]/kill-session/route_client-reference-manifest.js +1 -1
  160. package/.next/server/app/api/worktrees/[id]/logs/[filename]/route_client-reference-manifest.js +1 -1
  161. package/.next/server/app/api/worktrees/[id]/logs/route_client-reference-manifest.js +1 -1
  162. package/.next/server/app/api/worktrees/[id]/marp-render/route_client-reference-manifest.js +1 -1
  163. package/.next/server/app/api/worktrees/[id]/memos/[memoId]/route_client-reference-manifest.js +1 -1
  164. package/.next/server/app/api/worktrees/[id]/memos/route_client-reference-manifest.js +1 -1
  165. package/.next/server/app/api/worktrees/[id]/messages/route_client-reference-manifest.js +1 -1
  166. package/.next/server/app/api/worktrees/[id]/opencode/diff/route_client-reference-manifest.js +1 -1
  167. package/.next/server/app/api/worktrees/[id]/opencode/session/route_client-reference-manifest.js +1 -1
  168. package/.next/server/app/api/worktrees/[id]/opencode/share/route_client-reference-manifest.js +1 -1
  169. package/.next/server/app/api/worktrees/[id]/prompt-response/route.js +1 -1
  170. package/.next/server/app/api/worktrees/[id]/prompt-response/route.js.nft.json +1 -1
  171. package/.next/server/app/api/worktrees/[id]/prompt-response/route_client-reference-manifest.js +1 -1
  172. package/.next/server/app/api/worktrees/[id]/resolve-target/route.js +1 -1
  173. package/.next/server/app/api/worktrees/[id]/resolve-target/route_client-reference-manifest.js +1 -1
  174. package/.next/server/app/api/worktrees/[id]/respond/route.js +1 -1
  175. package/.next/server/app/api/worktrees/[id]/respond/route.js.nft.json +1 -1
  176. package/.next/server/app/api/worktrees/[id]/respond/route_client-reference-manifest.js +1 -1
  177. package/.next/server/app/api/worktrees/[id]/route.js +1 -1
  178. package/.next/server/app/api/worktrees/[id]/route.js.nft.json +1 -1
  179. package/.next/server/app/api/worktrees/[id]/route_client-reference-manifest.js +1 -1
  180. package/.next/server/app/api/worktrees/[id]/schedules/[scheduleId]/route.js +1 -1
  181. package/.next/server/app/api/worktrees/[id]/schedules/[scheduleId]/route_client-reference-manifest.js +1 -1
  182. package/.next/server/app/api/worktrees/[id]/schedules/active/route_client-reference-manifest.js +1 -1
  183. package/.next/server/app/api/worktrees/[id]/schedules/route.js +1 -1
  184. package/.next/server/app/api/worktrees/[id]/schedules/route_client-reference-manifest.js +1 -1
  185. package/.next/server/app/api/worktrees/[id]/search/route_client-reference-manifest.js +1 -1
  186. package/.next/server/app/api/worktrees/[id]/send/route.js +1 -1
  187. package/.next/server/app/api/worktrees/[id]/send/route.js.nft.json +1 -1
  188. package/.next/server/app/api/worktrees/[id]/send/route_client-reference-manifest.js +1 -1
  189. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route.js +2 -2
  190. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route.js.nft.json +1 -1
  191. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route_client-reference-manifest.js +1 -1
  192. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/install/route_client-reference-manifest.js +1 -1
  193. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/plan/route_client-reference-manifest.js +1 -1
  194. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall/route_client-reference-manifest.js +1 -1
  195. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall-plan/route_client-reference-manifest.js +1 -1
  196. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/update/route_client-reference-manifest.js +1 -1
  197. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/update-plan/route_client-reference-manifest.js +1 -1
  198. package/.next/server/app/api/worktrees/[id]/skills/route_client-reference-manifest.js +1 -1
  199. package/.next/server/app/api/worktrees/[id]/slash-commands/route_client-reference-manifest.js +1 -1
  200. package/.next/server/app/api/worktrees/[id]/special-keys/route.js +1 -1
  201. package/.next/server/app/api/worktrees/[id]/special-keys/route.js.nft.json +1 -1
  202. package/.next/server/app/api/worktrees/[id]/special-keys/route_client-reference-manifest.js +1 -1
  203. package/.next/server/app/api/worktrees/[id]/tasks/route.js +2 -2
  204. package/.next/server/app/api/worktrees/[id]/tasks/route_client-reference-manifest.js +1 -1
  205. package/.next/server/app/api/worktrees/[id]/terminal/route.js +2 -2
  206. package/.next/server/app/api/worktrees/[id]/terminal/route.js.nft.json +1 -1
  207. package/.next/server/app/api/worktrees/[id]/terminal/route_client-reference-manifest.js +1 -1
  208. package/.next/server/app/api/worktrees/[id]/timers/history/route_client-reference-manifest.js +1 -1
  209. package/.next/server/app/api/worktrees/[id]/timers/route.js +1 -1
  210. package/.next/server/app/api/worktrees/[id]/timers/route.js.nft.json +1 -1
  211. package/.next/server/app/api/worktrees/[id]/timers/route_client-reference-manifest.js +1 -1
  212. package/.next/server/app/api/worktrees/[id]/todos/[todoId]/route_client-reference-manifest.js +1 -1
  213. package/.next/server/app/api/worktrees/[id]/todos/route_client-reference-manifest.js +1 -1
  214. package/.next/server/app/api/worktrees/[id]/tree/[...path]/route_client-reference-manifest.js +1 -1
  215. package/.next/server/app/api/worktrees/[id]/tree/route_client-reference-manifest.js +1 -1
  216. package/.next/server/app/api/worktrees/[id]/upload/[...path]/route_client-reference-manifest.js +1 -1
  217. package/.next/server/app/api/worktrees/[id]/verify/config/route.js +1 -1
  218. package/.next/server/app/api/worktrees/[id]/verify/config/route_client-reference-manifest.js +1 -1
  219. package/.next/server/app/api/worktrees/[id]/verify/route.js +1 -1
  220. package/.next/server/app/api/worktrees/[id]/verify/route_client-reference-manifest.js +1 -1
  221. package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/cancel/route.js +1 -1
  222. package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/cancel/route_client-reference-manifest.js +1 -1
  223. package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/route_client-reference-manifest.js +1 -1
  224. package/.next/server/app/api/worktrees/[id]/verify/runs/route_client-reference-manifest.js +1 -1
  225. package/.next/server/app/api/worktrees/[id]/viewed/route_client-reference-manifest.js +1 -1
  226. package/.next/server/app/api/worktrees/apply-default-agents/route_client-reference-manifest.js +1 -1
  227. package/.next/server/app/api/worktrees/route.js +1 -1
  228. package/.next/server/app/api/worktrees/route.js.nft.json +1 -1
  229. package/.next/server/app/api/worktrees/route_client-reference-manifest.js +1 -1
  230. package/.next/server/app/chat/page_client-reference-manifest.js +1 -1
  231. package/.next/server/app/login/page_client-reference-manifest.js +1 -1
  232. package/.next/server/app/manifest.webmanifest/route_client-reference-manifest.js +1 -1
  233. package/.next/server/app/more/page_client-reference-manifest.js +1 -1
  234. package/.next/server/app/offline/page_client-reference-manifest.js +1 -1
  235. package/.next/server/app/page.js +1 -1
  236. package/.next/server/app/page_client-reference-manifest.js +1 -1
  237. package/.next/server/app/proxy/[...path]/route_client-reference-manifest.js +1 -1
  238. package/.next/server/app/repositories/page_client-reference-manifest.js +1 -1
  239. package/.next/server/app/review/page_client-reference-manifest.js +1 -1
  240. package/.next/server/app/sessions/page.js +1 -1
  241. package/.next/server/app/sessions/page_client-reference-manifest.js +1 -1
  242. package/.next/server/app/skills/[skillId]/page_client-reference-manifest.js +1 -1
  243. package/.next/server/app/skills/installed/page_client-reference-manifest.js +1 -1
  244. package/.next/server/app/skills/page_client-reference-manifest.js +1 -1
  245. package/.next/server/app/worktrees/[id]/files/[...path]/page_client-reference-manifest.js +1 -1
  246. package/.next/server/app/worktrees/[id]/page.js +8 -8
  247. package/.next/server/app/worktrees/[id]/page_client-reference-manifest.js +1 -1
  248. package/.next/server/app/worktrees/[id]/terminal/page_client-reference-manifest.js +1 -1
  249. package/.next/server/app-paths-manifest.json +29 -29
  250. package/.next/server/chunks/1049.js +1 -0
  251. package/.next/server/chunks/1501.js +4 -4
  252. package/.next/server/chunks/1886.js +2 -2
  253. package/.next/server/chunks/2119.js +1 -1
  254. package/.next/server/chunks/2404.js +1 -1
  255. package/.next/server/chunks/2445.js +1 -1
  256. package/.next/server/chunks/3241.js +1 -1
  257. package/.next/server/chunks/3323.js +1 -1
  258. package/.next/server/chunks/3480.js +2 -2
  259. package/.next/server/chunks/4443.js +1 -1
  260. package/.next/server/chunks/4802.js +1 -1
  261. package/.next/server/chunks/5164.js +1 -1
  262. package/.next/server/chunks/5571.js +1 -1
  263. package/.next/server/chunks/595.js +1 -1
  264. package/.next/server/chunks/6130.js +1 -1
  265. package/.next/server/chunks/6285.js +1 -1
  266. package/.next/server/chunks/6286.js +7 -7
  267. package/.next/server/chunks/6337.js +1 -1
  268. package/.next/server/chunks/650.js +1 -1
  269. package/.next/server/chunks/663.js +1 -1
  270. package/.next/server/chunks/6677.js +25 -0
  271. package/.next/server/chunks/7075.js +1 -0
  272. package/.next/server/chunks/7905.js +1 -1
  273. package/.next/server/chunks/8583.js +1 -0
  274. package/.next/server/chunks/8918.js +4 -2
  275. package/.next/server/chunks/9080.js +1 -0
  276. package/.next/server/chunks/964.js +1 -0
  277. package/.next/server/middleware-manifest.json +5 -5
  278. package/.next/server/pages/500.html +1 -1
  279. package/.next/server/server-reference-manifest.json +1 -1
  280. package/.next/static/chunks/2053-9ac860ab4e92ac89.js +1 -0
  281. package/.next/static/chunks/2652-18b8fea64413467e.js +1 -0
  282. package/.next/static/chunks/{4718-814f4ecfd7fcc513.js → 4718-2d9f0397a8f931c4.js} +1 -1
  283. package/.next/static/chunks/{8361-9bb887203c456edb.js → 8361-0142beb59be2abf3.js} +1 -1
  284. package/.next/static/chunks/app/{page-022090bf6f932818.js → page-26a42881c8648cd3.js} +1 -1
  285. package/.next/static/chunks/app/sessions/page-a3ab6f122ec60d5a.js +1 -0
  286. package/.next/static/chunks/app/worktrees/[id]/page-a39ec2a0732d11a6.js +1 -0
  287. package/.next/static/css/b09bede85744e1cf.css +1 -0
  288. package/.next/trace +13 -13
  289. package/dist/cli/commands/ask.d.ts.map +1 -1
  290. package/dist/cli/commands/ask.js +11 -2
  291. package/dist/cli/commands/respond.d.ts.map +1 -1
  292. package/dist/cli/commands/respond.js +8 -4
  293. package/dist/cli/commands/send.d.ts.map +1 -1
  294. package/dist/cli/commands/send.js +18 -0
  295. package/dist/cli/commands/wait.d.ts +18 -3
  296. package/dist/cli/commands/wait.d.ts.map +1 -1
  297. package/dist/cli/commands/wait.js +137 -2
  298. package/dist/cli/docs/agent-operations.d.ts +2 -2
  299. package/dist/cli/docs/agent-operations.d.ts.map +1 -1
  300. package/dist/cli/docs/agent-operations.js +41 -1
  301. package/dist/cli/utils/session-target.d.ts +23 -6
  302. package/dist/cli/utils/session-target.d.ts.map +1 -1
  303. package/dist/cli/utils/session-target.js +33 -5
  304. package/dist/server/locales/en/worktree.json +21 -2
  305. package/dist/server/locales/ja/worktree.json +21 -2
  306. package/dist/server/src/config/schedule-config.js +45 -3
  307. package/dist/server/src/lib/cli-tools/antigravity.js +95 -10
  308. package/dist/server/src/lib/cli-tools/submit-verified-sender.js +377 -16
  309. package/dist/server/src/lib/cmate-parser.js +8 -1
  310. package/dist/server/src/lib/detection/prompt-detect-multiple-choice.js +140 -19
  311. package/dist/server/src/lib/detection/tools/claude/detect.js +13 -2
  312. package/dist/server/src/lib/detection/tools/claude/picker-chrome.js +239 -0
  313. package/dist/server/src/lib/detection/tools/claude/prompt.js +74 -6
  314. package/dist/server/src/lib/hooks/sources/claude/history.js +391 -34
  315. package/dist/server/src/lib/hooks/sources/claude/transcript.js +91 -0
  316. package/dist/server/src/lib/polling/auto-yes-dialog-gate.js +114 -11
  317. package/dist/server/src/lib/polling/response-checker.js +82 -3
  318. package/dist/server/src/lib/schedule-manager.js +178 -19
  319. package/dist/server/src/lib/session/ask-user-question-prompt.js +4 -2
  320. package/dist/server/src/lib/session/claude-executor.js +33 -2
  321. package/dist/server/src/lib/session/resolve-session-target.js +37 -9
  322. package/dist/server/src/lib/verification/env-clean-gate.js +81 -4
  323. package/dist/server/src/types/agent-transcript.js +143 -1
  324. package/package.json +1 -1
  325. package/.next/server/chunks/1068.js +0 -1
  326. package/.next/server/chunks/6808.js +0 -1
  327. package/.next/server/chunks/7875.js +0 -25
  328. package/.next/server/chunks/9553.js +0 -1
  329. package/.next/static/chunks/2053-3f299a7a2c7d6767.js +0 -1
  330. package/.next/static/chunks/8772-9be53a530950d804.js +0 -1
  331. package/.next/static/chunks/app/sessions/page-584adf11ae51df10.js +0 -1
  332. package/.next/static/chunks/app/worktrees/[id]/page-3af707e74a75172b.js +0 -1
  333. package/.next/static/css/acd46e25427a2080.css +0 -1
  334. /package/.next/static/{9x6U1h52hH_r6pOsGwI_p → gniPBCKoXtbIOQey8kNcx}/_buildManifest.js +0 -0
  335. /package/.next/static/{9x6U1h52hH_r6pOsGwI_p → gniPBCKoXtbIOQey8kNcx}/_ssgManifest.js +0 -0
@@ -106,6 +106,8 @@ if [ -n "$CLIENT" ]; then
106
106
  else
107
107
  tmux display-popup -w 90% -h 85% -E "sh \\"$PAGER_SCRIPT\\" --follow \\"$SESSION\\"" 2>/dev/null || true
108
108
  fi
109
- `;function y(a,b){let c,d=(0,q.join)((0,q.join)((0,p.homedir)(),".commandmate","bin"),a);if((0,o.mkdirSync)((0,q.dirname)(d),{recursive:!0}),(0,o.existsSync)(d))try{c=(0,o.readFileSync)(d,"utf-8")}catch{c=void 0}return c!==b&&(0,o.writeFileSync)(d,b,{mode:493}),(0,o.chmodSync)(d,493),d}var z=c(83598);let A=(0,m.promisify)(l.execFile),B=(0,e.h)("tmux-session-hooks"),C=globalThis.__cmEnsuredSessionHooks??(globalThis.__cmEnsuredSessionHooks=new Set);async function D(a){if((0,n.N_)(a)&&!C.has(a)){C.add(a);try{if((0,n.gM)()&&(0,n.n9)(a)){y(s,v);let b=(0,n.Rr)(a,y(t,w));b&&await A("tmux",b,{timeout:5e3})}else await A("tmux",(0,n.g4)(a),{timeout:5e3});if((0,n.jx)()){let b=(0,n.Ls)(a,y(u,x));b&&await A("tmux",b,{timeout:5e3})}else await A("tmux",(0,n.sL)(a),{timeout:5e3})}catch(b){B.debug("session-hooks:reconcile-failed",{sessionName:a,error:b instanceof Error?b.message:String(b)})}}}async function E(a){try{if(!await (0,z.Us)(a)||await (0,z.Fh)(a))return!1;for(let b of(0,n.RS)(a))await A("tmux",b,{timeout:5e3});return B.info("session-hooks:geometry-restored",{sessionName:a}),!0}catch(b){return B.debug("session-hooks:geometry-restore-failed",{sessionName:a,error:b instanceof Error?b.message:String(b)}),!1}}let F=(0,m.promisify)(l.execFile),G=(0,e.h)("tmux-session-status"),H=globalThis.__cmPublishedTmuxStatus??(globalThis.__cmPublishedTmuxStatus=new Map),I=globalThis.__cmClearedTmuxStatus??(globalThis.__cmClearedTmuxStatus=new Set);async function J(a){let{sessionName:b,worktreeId:c,cliToolId:d,instanceId:e,status:f}=a;if(!(0,n.om)())return I.has(b)||(I.add(b),await L(b)),"disabled";let g=H.get(b);if(g&&g.status===f&&g.worktreeId===c&&g.cliToolId===d&&g.instanceId===e)return"unchanged";let h=(a.now??new Date).toISOString(),i=[[n.eC,f],[n.jp,c],[n.wv,d],[n.L0,e],[n.tx,h]];try{for(let[a,c]of i)await F("tmux",(0,n.ND)(b,a,c),{timeout:5e3});return H.set(b,{status:f,worktreeId:c,cliToolId:d,instanceId:e}),await K(b),"written"}catch(a){return H.delete(b),G.debug("session-status:write-failed",{sessionName:b,error:a instanceof Error?a.message:String(a)}),"error"}}async function K(a){try{let{stdout:b}=await F("tmux",(0,n.Ys)(a,"status-right"),{timeout:5e3}),c=b.trim();if(""!==c&&!c.includes(n.lY))return G.debug("session-status:status-right-user-owned",{sessionName:a,existing:c}),!1;return""===c&&await F("tmux",(0,n.KB)(a,n.lY),{timeout:5e3}),!0}catch(b){return G.debug("session-status:status-right-failed",{sessionName:a,error:b instanceof Error?b.message:String(b)}),!1}}async function L(a){for(let b of(H.delete(a),n.bq))try{await F("tmux",(0,n.cD)(a,b),{timeout:5e3})}catch{}try{let{stdout:b}=await F("tmux",(0,n.Ys)(a,"status-right"),{timeout:5e3});b.includes(n.lY)&&await F("tmux",(0,n.$D)(a),{timeout:5e3})}catch{}}let M=(0,e.h)("cli-session");function N(){return j||(j=new i),j}function O(a,b,c){let e=d.CLIToolManager.getInstance().getTool(b),f=e.getSessionName(a,c);return{cliTool:e,sessionName:f}}async function P(a,b,c){let{sessionName:d}=O(a,b,c);return N().sessionExists(d)}async function Q(a,b,c=1e3,d){let e=M.withContext({worktreeId:a,cliToolId:b});e.debug("captureSessionOutput:start",{requestedLines:c});let{cliTool:f,sessionName:g}=O(a,b,d),h=N();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 R(a,b,c=5e3,d){let e=M.withContext({worktreeId:a,cliToolId:b});e.debug("captureSessionOutputFresh:start",{requestedLines:c});let{cliTool:f,sessionName:g}=O(a,b,d),h=N();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}`)}}async function S(a){await D(a.sessionName),(0,n.n9)(a.sessionName)&&await E(a.sessionName),await J(a)}function T(a){H.delete(a),I.delete(a),C.delete(a),(0,z.G9)(a)}},79696:(a,b,c)=>{c.d(b,{K$:()=>H,readClaudeTurnProgress:()=>K,Oi:()=>J});var d=c(79748),e=c(21820),f=c(33873),g=c(24455),h=c(18201),i=c(12462),j=c(72626),k=c(86594),l=c(57510),m=c(27128);let n=[".claude","projects"],o="\n\n_(truncated)_",p=["<local-command-caveat>","<local-command-stdout>","<command-name>"],q="<command-message>",r=/<command-name>([\s\S]*?)<\/command-name>/,s=/<command-args>([\s\S]*?)<\/command-args>/;function t(a){let b=a.trim();if(!b.startsWith(q))return null;let c=r.exec(b)?.[1].trim()??"";if(0===c.length)return null;let d=s.exec(b)?.[1].trim()??"";return 0===d.length?c:`${c} ${d}`}let u=["command","file_path","notebook_path","path","pattern","query","url","description"];function v(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,l.Qd)(a))return null;let b=(0,l.O2)(a,"type");if(!b)return null;let c=(0,l.Qd)(a.message)?a.message:null,d=c?.content,e=[],f="";if("string"==typeof d)f=d;else if(Array.isArray(d))for(let a of d){let b=function(a){if(!(0,l.Qd)(a))return null;let b=(0,l.O2)(a,"type");if(!b)return null;if("tool_use"===b)return{type:b,text:null,toolName:(0,l.O2)(a,"name"),toolDetail:function(a){if(!(0,l.Qd)(a))return null;for(let c of u){let d=(0,l.O2)(a,c);if(d){var b;return(b=d.replace(/\s+/g," ").trim()).length<=200?b:`${b.slice(0,199)}…`}}return null}(a.input)};let c="text"===b?(0,l.O2)(a,"text")??"":"thinking"===b?(0,l.O2)(a,"thinking")??"":null;return{type:b,text:c,toolName:null,toolDetail:null}}(a);b&&(e.push(b),b.text&&(f+=b.text))}let g=(0,l.O2)(a,"timestamp"),h=g?Date.parse(g):NaN,i=(0,l.Qd)(a.origin)?a.origin:null;return{type:b,uuid:(0,l.O2)(a,"uuid"),sessionId:(0,l.O2)(a,"sessionId")??(0,l.O2)(a,"session_id"),cwd:(0,l.O2)(a,"cwd"),isSidechain:!0===a.isSidechain,isMeta:!0===a.isMeta,originKind:i?(0,l.O2)(i,"kind"):null,promptSource:(0,l.O2)(a,"promptSource"),isCompactSummary:!0===a.isCompactSummary,isInterruption:null!==(0,l.O2)(a,"interruptedMessageId"),timestampMs:Number.isFinite(h)?h:null,stopReason:c?(0,l.O2)(c,"stop_reason"):null,blocks:e,text:f}}(a);e?b.push(e):c+=1}return{records:b,malformedLines:c}}function w(a){if("user"!==a.type||a.isMeta||!a.uuid||a.blocks.some(a=>"tool_result"===a.type))return!1;let b=a.text.trim();return 0!==b.length&&(b.startsWith(q)?null!==t(b):!p.some(a=>b.startsWith(a)))}let x=["typed","queued"];function y(a){return!!a.closed||!!a.superseded||!a.stopReasonObserved}function z(a,b){let c=[],d=null,e=0,f=0;for(let g of a){if(g.isSidechain){f+=1;continue}if(w(g)){d=function(a,b){return{sessionId:a.sessionId??b,promptUuid:a.uuid,startedAt:a.timestampMs??0,promptText:t(a.text)??a.text,promptIsOperatorInput:!!w(a)&&!a.isCompactSummary&&!a.isInterruption&&(null!==a.originKind?"human"===a.originKind:null!==a.promptSource&&x.includes(a.promptSource)),blocks:[],assistantRecords:0,closed:!1,superseded:!1,stopReasonObserved:!1,overflowed:!1}}(g,b),c.push(d);continue}if("assistant"===g.type){if(!d){e+=1;continue}for(let a of(d.assistantRecords+=1,d.closed="assistant"===g.type&&"end_turn"===g.stopReason&&g.blocks.some(a=>"text"===a.type&&(a.text??"").trim().length>0),null!==g.stopReason&&(d.stopReasonObserved=!0),g.blocks)){if(d.blocks.length>=2048){d.overflowed=!0;break}d.blocks.push(a)}}}for(let a=0;a<c.length-1;a+=1)c[a].superseded=!0;return{turns:c,orphanedAssistantRecords:e,sidechainRecords:f}}let A=new Set(["tool_result"]);function B(a){let b=[],c=new Set,d=0,e=0;for(let f of a.blocks){if("text"===f.type){let a=f.text?.trim()??"";if(0===a.length)continue;b.push({kind:"prose",text:a}),d+=1;continue}if("thinking"===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**
109
+ `;function y(a,b){let c,d=(0,q.join)((0,q.join)((0,p.homedir)(),".commandmate","bin"),a);if((0,o.mkdirSync)((0,q.dirname)(d),{recursive:!0}),(0,o.existsSync)(d))try{c=(0,o.readFileSync)(d,"utf-8")}catch{c=void 0}return c!==b&&(0,o.writeFileSync)(d,b,{mode:493}),(0,o.chmodSync)(d,493),d}var z=c(83598);let A=(0,m.promisify)(l.execFile),B=(0,e.h)("tmux-session-hooks"),C=globalThis.__cmEnsuredSessionHooks??(globalThis.__cmEnsuredSessionHooks=new Set);async function D(a){if((0,n.N_)(a)&&!C.has(a)){C.add(a);try{if((0,n.gM)()&&(0,n.n9)(a)){y(s,v);let b=(0,n.Rr)(a,y(t,w));b&&await A("tmux",b,{timeout:5e3})}else await A("tmux",(0,n.g4)(a),{timeout:5e3});if((0,n.jx)()){let b=(0,n.Ls)(a,y(u,x));b&&await A("tmux",b,{timeout:5e3})}else await A("tmux",(0,n.sL)(a),{timeout:5e3})}catch(b){B.debug("session-hooks:reconcile-failed",{sessionName:a,error:b instanceof Error?b.message:String(b)})}}}async function E(a){try{if(!await (0,z.Us)(a)||await (0,z.Fh)(a))return!1;for(let b of(0,n.RS)(a))await A("tmux",b,{timeout:5e3});return B.info("session-hooks:geometry-restored",{sessionName:a}),!0}catch(b){return B.debug("session-hooks:geometry-restore-failed",{sessionName:a,error:b instanceof Error?b.message:String(b)}),!1}}let F=(0,m.promisify)(l.execFile),G=(0,e.h)("tmux-session-status"),H=globalThis.__cmPublishedTmuxStatus??(globalThis.__cmPublishedTmuxStatus=new Map),I=globalThis.__cmClearedTmuxStatus??(globalThis.__cmClearedTmuxStatus=new Set);async function J(a){let{sessionName:b,worktreeId:c,cliToolId:d,instanceId:e,status:f}=a;if(!(0,n.om)())return I.has(b)||(I.add(b),await L(b)),"disabled";let g=H.get(b);if(g&&g.status===f&&g.worktreeId===c&&g.cliToolId===d&&g.instanceId===e)return"unchanged";let h=(a.now??new Date).toISOString(),i=[[n.eC,f],[n.jp,c],[n.wv,d],[n.L0,e],[n.tx,h]];try{for(let[a,c]of i)await F("tmux",(0,n.ND)(b,a,c),{timeout:5e3});return H.set(b,{status:f,worktreeId:c,cliToolId:d,instanceId:e}),await K(b),"written"}catch(a){return H.delete(b),G.debug("session-status:write-failed",{sessionName:b,error:a instanceof Error?a.message:String(a)}),"error"}}async function K(a){try{let{stdout:b}=await F("tmux",(0,n.Ys)(a,"status-right"),{timeout:5e3}),c=b.trim();if(""!==c&&!c.includes(n.lY))return G.debug("session-status:status-right-user-owned",{sessionName:a,existing:c}),!1;return""===c&&await F("tmux",(0,n.KB)(a,n.lY),{timeout:5e3}),!0}catch(b){return G.debug("session-status:status-right-failed",{sessionName:a,error:b instanceof Error?b.message:String(b)}),!1}}async function L(a){for(let b of(H.delete(a),n.bq))try{await F("tmux",(0,n.cD)(a,b),{timeout:5e3})}catch{}try{let{stdout:b}=await F("tmux",(0,n.Ys)(a,"status-right"),{timeout:5e3});b.includes(n.lY)&&await F("tmux",(0,n.$D)(a),{timeout:5e3})}catch{}}let M=(0,e.h)("cli-session");function N(){return j||(j=new i),j}function O(a,b,c){let e=d.CLIToolManager.getInstance().getTool(b),f=e.getSessionName(a,c);return{cliTool:e,sessionName:f}}async function P(a,b,c){let{sessionName:d}=O(a,b,c);return N().sessionExists(d)}async function Q(a,b,c=1e3,d){let e=M.withContext({worktreeId:a,cliToolId:b});e.debug("captureSessionOutput:start",{requestedLines:c});let{cliTool:f,sessionName:g}=O(a,b,d),h=N();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 R(a,b,c=5e3,d){let e=M.withContext({worktreeId:a,cliToolId:b});e.debug("captureSessionOutputFresh:start",{requestedLines:c});let{cliTool:f,sessionName:g}=O(a,b,d),h=N();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}`)}}async function S(a){await D(a.sessionName),(0,n.n9)(a.sessionName)&&await E(a.sessionName),await J(a)}function T(a){H.delete(a),I.delete(a),C.delete(a),(0,z.G9)(a)}},79696:(a,b,c)=>{c.d(b,{K$:()=>K,readClaudeTurnProgress:()=>N,Oi:()=>M});var d=c(79748),e=c(21820),f=c(33873),g=c(24455),h=c(18201),i=c(12462),j=c(72626),k=c(86594),l=c(57510),m=c(27128);let n=[".claude","projects"],o="\n\n_(truncated)_",p=["<local-command-caveat>","<local-command-stdout>","<command-name>"],q="<command-message>",r=/<command-name>([\s\S]*?)<\/command-name>/,s=/<command-args>([\s\S]*?)<\/command-args>/;function t(a){let b=a.trim();if(!b.startsWith(q))return null;let c=r.exec(b)?.[1].trim()??"";if(0===c.length)return null;let d=s.exec(b)?.[1].trim()??"";return 0===d.length?c:`${c} ${d}`}let u=["command","file_path","notebook_path","path","pattern","query","url","description"];function v(a){if(!(0,l.Qd)(a))return null;let b=(0,l.O2)(a,"type");if(!b)return null;let c=(0,l.Qd)(a.message)?a.message:null,d=c?.content,e=[],f="";if("string"==typeof d)f=d;else if(Array.isArray(d))for(let a of d){let b=function(a){if(!(0,l.Qd)(a))return null;let b=(0,l.O2)(a,"type");if(!b)return null;if("tool_use"===b)return{type:b,text:null,toolName:(0,l.O2)(a,"name"),toolDetail:function(a){if(!(0,l.Qd)(a))return null;for(let c of u){let d=(0,l.O2)(a,c);if(d){var b;return(b=d.replace(/\s+/g," ").trim()).length<=200?b:`${b.slice(0,199)}…`}}return null}(a.input)};let c="text"===b?(0,l.O2)(a,"text")??"":"thinking"===b?(0,l.O2)(a,"thinking")??"":null;return{type:b,text:c,toolName:null,toolDetail:null}}(a);b&&(e.push(b),b.text&&(f+=b.text))}let g=(0,l.O2)(a,"timestamp"),h=g?Date.parse(g):NaN,i=(0,l.Qd)(a.origin)?a.origin:null;return{type:b,uuid:(0,l.O2)(a,"uuid"),sessionId:(0,l.O2)(a,"sessionId")??(0,l.O2)(a,"session_id"),cwd:(0,l.O2)(a,"cwd"),isSidechain:!0===a.isSidechain,isMeta:!0===a.isMeta,originKind:i?(0,l.O2)(i,"kind"):null,promptSource:(0,l.O2)(a,"promptSource"),isCompactSummary:!0===a.isCompactSummary,isInterruption:null!==(0,l.O2)(a,"interruptedMessageId"),timestampMs:Number.isFinite(h)?h:null,stopReason:c?(0,l.O2)(c,"stop_reason"):null,blocks:e,text:f}}function w(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=v(a);e?b.push(e):c+=1}return{records:b,malformedLines:c}}function x(a){if("user"!==a.type||a.isMeta||!a.uuid||a.blocks.some(a=>"tool_result"===a.type))return!1;let b=a.text.trim();return 0!==b.length&&(b.startsWith(q)?null!==t(b):!p.some(a=>b.startsWith(a)))}let y=["typed","queued"];function z(a){return"assistant"===a.type&&"end_turn"===a.stopReason&&a.blocks.some(a=>"text"===a.type&&(a.text??"").trim().length>0)}function A(a){return!!a.closed||!!a.superseded||!a.stopReasonObserved}function B(a,b){let c=[],d=null,e=0,f=0;for(let g of a){if(g.isSidechain){f+=1;continue}if(x(g)){d=function(a,b){return{sessionId:a.sessionId??b,promptUuid:a.uuid,startedAt:a.timestampMs??0,promptText:t(a.text)??a.text,promptIsOperatorInput:!!x(a)&&!a.isCompactSummary&&!a.isInterruption&&(null!==a.originKind?"human"===a.originKind:null!==a.promptSource&&y.includes(a.promptSource)),blocks:[],assistantRecords:0,closed:!1,superseded:!1,stopReasonObserved:!1,overflowed:!1}}(g,b),c.push(d);continue}if("assistant"===g.type){if(!d){e+=1;continue}for(let a of(d.assistantRecords+=1,d.closed=z(g),null!==g.stopReason&&(d.stopReasonObserved=!0),g.blocks)){if(d.blocks.length>=2048){d.overflowed=!0;break}d.blocks.push(a)}}}for(let a=0;a<c.length-1;a+=1)c[a].superseded=!0;return{turns:c,orphanedAssistantRecords:e,sidechainRecords:f}}let C=new Set(["tool_result"]);function D(a){let b=[],c=new Set,d=0,e=0;for(let f of a.blocks){if("text"===f.type){let a=f.text?.trim()??"";if(0===a.length)continue;b.push({kind:"prose",text:a}),d+=1;continue}if("thinking"===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**
110
110
  >
111
- ${b}`}(a)});continue}if("tool_use"===f.type){b.push({kind:"tool",text:function(a){let b=a.toolName??"tool";return a.toolDetail?`- \`${b}\` — ${a.toolDetail}`:`- \`${b}\``}(f)}),e+=1;continue}A.has(f.type)||c.add(f.type)}let f=(0,m.t3)(b).body;return f.length>2e5&&(f=f.slice(0,2e5-o.length)+o),{sessionId:a.sessionId,promptUuid:a.promptUuid,body:f,textBlocks:d,toolBlocks:e,unknownBlockTypes:[...c]}}let C=(0,j.h)("lib/hooks/sources/claude/history"),D=".jsonl",E=globalThis.__claudeTranscriptSessions??=new Map;async function F(a){let b=(0,g.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 E.set(b,e),e}catch(b){C.debug("claude-transcript-session-lookup-failed",{worktreeId:a.worktreeId,instanceId:a.instanceId??a.cliToolId,error:b instanceof Error?b.message:String(b)})}return E.get(b)??null}function G(a){return(0,f.join)(a,...n)}async function H(a,b,c){let d=a.instanceId??a.cliToolId;try{let f=b.homeDir??(0,e.homedir)();if("string"!=typeof b.worktreePath||0===b.worktreePath.length)return!1;let g=await F(a),h=await M(f,b,g);if(!h)return C.debug("claude-transcript-unavailable",{worktreeId:a.worktreeId,instanceId:d,sessionId:g,reason:g?"no-file":"no-session-pointer"}),!1;let j=await O(h);if(null===j)return!1;let k=v(j),l=z(k.records,g??"");if(0===l.turns.length)return C.info("claude-transcript-no-turn",{worktreeId:a.worktreeId,instanceId:d,path:h,records:k.records.length,malformedLines:k.malformedLines,orphanedAssistantRecords:l.orphanedAssistantRecords}),!1;(k.malformedLines>0||l.orphanedAssistantRecords>0)&&C.info("claude-transcript-partial-read",{worktreeId:a.worktreeId,instanceId:d,path:h,malformedLines:k.malformedLines,orphanedAssistantRecords:l.orphanedAssistantRecords,sidechainRecords:l.sidechainRecords});let m=await I(a,l.turns);if(await R(a,l.turns.slice(0,l.turns.length-m.turns.length).slice(-P),h),0===m.turns.length)return C.debug("claude-transcript-turns-already-saved",{worktreeId:a.worktreeId,instanceId:d,turnsInWindow:l.turns.length}),await (0,i.fT)(a),!0;m.turns.length>1&&C.info("claude-transcript-backfilling-turns",{worktreeId:a.worktreeId,instanceId:d,path:h,pendingTurns:m.turns.length,turnsInWindow:l.turns.length,anchored:m.anchored});let n=[];for(let b=0;b<m.turns.length;b+=1){let c=0===b?m.previousStartedAt:m.turns[b-1].startedAt;n.push(await L(a,m.turns[b],c))}let o=function(a){let b=new Map,c=null;for(let d of a)if(!d.isSidechain){if(w(d)){c=d.uuid;continue}"assistant"===d.type&&null!==c&&null!==d.timestampMs&&d.timestampMs>(b.get(c)??0)&&b.set(c,d.timestampMs)}return b}(k.records),p=!1;for(let b=0;b<m.turns.length;b+=1){let d=m.turns[b];p=await S(a,d,B(d),function(a,b,c=0,d=null){let e=null===b.timestampMs?a.startedAt:Math.max(a.startedAt,b.timestampMs+1);return Math.max(e,Math.min(c,null===d?1/0:d-1))}(d,n[b],o.get(d.promptUuid)??0,function(a,b,c){let d=a[c+1];return d?b[c+1]?.timestampMs??d.startedAt:null}(m.turns,n,b)),h,c)}return p&&await (0,i.fT)(a),p}catch(b){return C.error("claude-transcript-capture-failed",{worktreeId:a.worktreeId,instanceId:d,error:b instanceof Error?b.message:String(b)}),!1}}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,k.qe)(b[c].promptUuid);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){try{let c=b.homeDir??(0,e.homedir)();if("string"!=typeof b.worktreePath||0===b.worktreePath.length)return null;return await M(c,b,await F(a))}catch{return null}}async function K(a,b){let c=a.instanceId??a.cliToolId;try{var d;let f=b.homeDir??(0,e.homedir)();if("string"!=typeof b.worktreePath||0===b.worktreePath.length)return null;let g=await F(a),h=await M(f,b,g);if(!h)return null;let i=await O(h);if(null===i)return null;let j=v(i),l=z(j.records,g??""),m=l.turns.at(-1);if(m){let a=B(m);if(0===a.body.length)return null;return{turnKey:(0,k.qe)(a.promptUuid),body:a.body,partial:!1}}if(0===l.orphanedAssistantRecords)return null;let n=function(a,b){let c=[],d=0,e=!1;for(let b of a){if(w(b))break;if(!b.isSidechain&&"assistant"===b.type)for(let a of(d+=1,b.blocks)){if(c.length>=2048){e=!0;break}c.push(a)}}return{sessionId:b,promptUuid:`partial:${b}`,startedAt:0,promptText:"",promptIsOperatorInput:!1,blocks:c,assistantRecords:d,closed:!1,superseded:!1,stopReasonObserved:!1,overflowed:e}}(j.records,g??""),o=B(n);if(0===o.body.length)return null;return C.info("claude-transcript-progress-headless",{worktreeId:a.worktreeId,instanceId:c,path:h,orphanedAssistantRecords:l.orphanedAssistantRecords,malformedLines:j.malformedLines}),{turnKey:(d=g??"",(0,k.qe)(`partial:${d}`)),body:o.body,partial:!0}}catch(b){return C.debug("claude-transcript-progress-failed",{worktreeId:a.worktreeId,instanceId:c,error:b instanceof Error?b.message:String(b)}),null}}async function L(a,b,c=0){let d=a.instanceId??a.cliToolId;if(!b.promptIsOperatorInput)return C.debug("claude-transcript-user-turn-skipped",{worktreeId:a.worktreeId,instanceId:d,promptUuid:b.promptUuid,reason:"not-operator-input"}),{outcome:"skipped",messageId:null,timestampMs:null};let e=await (0,h.Ce)(a,(0,k.H_)(b.promptUuid),b.promptText,b.startedAt,c>0?{adoptionFromMs:c}:{});return"failed"===e.outcome&&C.warn("claude-transcript-user-turn-failed",{worktreeId:a.worktreeId,instanceId:d,sessionId:b.sessionId,promptUuid:b.promptUuid}),e}async function M(a,b,c){if(c){var d,e,g;let h=(d=a,e=b.worktreePath,g=c,(0,f.join)(G(d),e.replace(/[^a-zA-Z0-9]/g,"-"),`${g}${D}`));if(await N(h))return h}let h=b.transcriptPathHint;if("string"==typeof h&&h.length>0){let b=function(a,b){if(!b.endsWith(D)||b.includes("\0"))return null;let c=(0,f.resolve)(G(a)),d=(0,f.resolve)(b);return d===c||d.startsWith(c+f.sep)?d:null}(a,h);if(b&&await N(b))return b}return null}async function N(a){try{return(await (0,d.stat)(a)).isFile()}catch{return!1}}async function O(a){let b;try{b=await (0,d.open)(a,"r");let{size:c}=await b.stat(),e=Math.max(0,c-4194304),f=c-e;if(f<=0)return"";let g=Buffer.alloc(f),{bytesRead:h}=await b.read(g,0,f,e),i=g.subarray(0,h).toString("utf8");if(0===e)return i;let j=i.indexOf("\n");return -1===j?"":i.slice(j+1)}catch(b){return C.warn("claude-transcript-read-failed",{path:a,error:b instanceof Error?b.message:String(b)}),null}finally{await b?.close().catch(()=>{})}}let P=3;async function Q(a,b,d,e){let f=a.instanceId??a.cliToolId,g=b.content.length;if(d.body.length<=g)return!1;let[{getDbInstance:h},{updateMessageContent:i},{broadcastMessage:j}]=await Promise.all([Promise.resolve().then(c.bind(c,88807)),Promise.resolve().then(c.bind(c,56791)),Promise.resolve().then(c.bind(c,49640))]);return i(h(),b.id,d.body),j("message_updated",{worktreeId:a.worktreeId,message:{...b,content:d.body}}),C.info("claude-transcript-turn-updated",{worktreeId:a.worktreeId,instanceId:f,sessionId:d.sessionId,requestId:b.requestId,path:e,previousLength:g,bodyLength:d.body.length,textBlocks:d.textBlocks,toolBlocks:d.toolBlocks}),!0}async function R(a,b,d){if(0===b.length)return 0;let[{getDbInstance:e},{findMessageByRequestId:f}]=await Promise.all([Promise.resolve().then(c.bind(c,88807)),Promise.resolve().then(c.bind(c,56791))]),g=e(),h=0;for(let c of b){if(!y(c))continue;let b=f(g,a.worktreeId,(0,k.qe)(c.promptUuid));b&&await Q(a,b,B(c),d)&&(h+=1)}return h}async function S(a,b,d,e,f,g){let h=a.instanceId??a.cliToolId;if(g&&(g.outcome=void 0),!y(b))return g&&(g.outcome="not_yet_closed"),C.info("claude-transcript-turn-open",{worktreeId:a.worktreeId,instanceId:h,sessionId:d.sessionId,promptUuid:d.promptUuid,assistantRecords:b.assistantRecords,textBlocks:d.textBlocks,toolBlocks:d.toolBlocks}),!1;if(0===d.body.length)return C.info("claude-transcript-turn-empty",{worktreeId:a.worktreeId,instanceId:h,sessionId:d.sessionId,promptUuid:d.promptUuid}),!1;d.unknownBlockTypes.length>0&&C.info("claude-transcript-unknown-blocks",{worktreeId:a.worktreeId,instanceId:h,sessionId:d.sessionId,blockTypes:d.unknownBlockTypes});let i=(0,k.qe)(d.promptUuid),[{getDbInstance:j},{createMessage:l,findMessageByRequestId:m},{broadcastMessage:n}]=await Promise.all([Promise.resolve().then(c.bind(c,88807)),Promise.resolve().then(c.bind(c,56791)),Promise.resolve().then(c.bind(c,49640))]),o=j(),p=m(o,a.worktreeId,i);if(p)return C.debug("claude-transcript-turn-already-saved",{worktreeId:a.worktreeId,instanceId:h,requestId:i}),await Q(a,p,d,f),!0;let q=l(o,{worktreeId:a.worktreeId,role:"assistant",content:d.body,messageType:"normal",timestamp:new Date(e>0?e:Date.now()),cliToolId:a.cliToolId,instanceId:h,requestId:i});return n("message",{worktreeId:a.worktreeId,message:q}),C.info("claude-transcript-turn-saved",{worktreeId:a.worktreeId,instanceId:h,sessionId:d.sessionId,requestId:i,path:f,bodyLength:d.body.length,textBlocks:d.textBlocks,toolBlocks:d.toolBlocks}),!0}},82450:(a,b,c)=>{c.d(b,{IS:()=>h,LH:()=>n,NN:()=>g,Sj:()=>q,Te:()=>p,aW:()=>o});var d=c(85164),e=c(13033),f=c(56263);function g(a){let b=(0,d.aJ)(a).split("\n"),c=(0,d.GT)(b),e=c>=0?b.slice(0,c):b,f=-1;for(let a=e.length-1;a>=0;a--)if(/^❯\s+\S/.test(e[a])){f=a;break}let g=f>=0?f+1:0,h=e.slice(g),i=[/CLAUDE_HOOKS_/,/\/bin\/claude/,/^claude\s*$/,/@.*\s+%\s*$/,/^[^⏺]*curl.*POST/,/^[^⏺]*Content-Type/,/^[^⏺]*export\s+CLAUDE_/,/^\s*$/,/^[╭╮╰╯│─\s]+$/,/^[│╭╮╰╯].*[│╭╮╰╯]$/,/Claude Code v[\d.]+/,/^Tips for getting started/,/^Welcome back/,/Run \/init to create/,/^Recent activity/,/^No recent activity/,/▐▛███▜▌|▝▜█████▛▘|▘▘ ▝▝/,/^\s*Opus \d+\.\d+\s*·\s*Claude Max/,/\.com's Organization/,/\?\s*for shortcuts\s*$/,/^─{10,}$/,/^❯\s*$/,d.fW],j=[];for(let a of h)!i.some(b=>b.test(a))&&a.trim()&&j.push(a);return j.join("\n").trim()}function h(a){let b=(0,d.aJ)(a).split("\n"),c=[],e=[/^maenokota@.*%/,/^zsh:/,/^feature-issue-\d+/,/^\s*$/],f=!1,g=[];for(let a of b){if(a.includes("✦")){f=!0;let b=a.indexOf("✦"),c=a.substring(b+1).trim();c&&g.push(c);continue}if(f){if(e.some(b=>b.test(a)))continue;g.push(a)}}if(g.length>0)return g.join("\n").trim();for(let a of b)e.some(b=>b.test(a))||c.push(a);return c.join("\n").trim()}let i=RegExp(`^●\\s+(?:${d.Jr})[\\s:]`),j=/^\$\s+[A-Z][A-Za-z]*(?:\s|$)/,k=/^\d+\s+lines\.\.\.$/,l=/^[◐◑◒◓]/,m=/^(?:git\s+--no-pager|git\s+(?:log|diff|show|status|branch|remote|fetch|pull|push|merge|rebase|checkout|reset|stash|tag|config|clone|init|add|commit|rm|mv|bisect|grep|ls-files|rev-parse|describe|shortlog|blame|reflog|cherry-pick|revert|submodule|worktree)\b|npm\s+|npx\s+|yarn\s+|pnpm\s+|cargo\s+|pip\s+|rustc\s+|cmake\s+|docker\s+|kubectl\s+|aws\s+|gcloud\s+|az\s+|terraform\s+|ansible\s+|curl\s+|wget\s+|ssh\s+|scp\s+|rsync\s+|grep\s+|sed\s+|awk\s+|mkdir\s+|rm\s+|cp\s+|mv\s+|chmod\s+|chown\s+)/;function n(a){let b=(0,d.aJ)(a).split("\n"),c=(0,d.wv)(b),f=c>=0?b.slice(0,c):b,g=-1;for(let a=f.length-1;a>=0;a--){let b=(0,e.IW)(f[a]);if(b&&/^❯\s+\S/.test(b)){g=a;break}}let h=g>=0?g+1:0;if(g>=0)for(;h<f.length&&d.Fg.test(f[h]);)h++;let n=f.slice(h),o=[],p=!1,q=!1;for(let a of n){if(d.JN.test(a))continue;let b=(0,e.IW)(a);if(!b){p=!1,q=!1;continue}if(d.J7.some(a=>a.test(b)))continue;if(j.test(b)){q=!0,p=!1;continue}if(i.test(b))continue;if(l.test(b)){p=!0,q=!1;continue}if(!(k.test(b)||m.test(b))){if(/^❯\s*/.test(b)){p=!1,q=!1;continue}if(!/^[│└]/.test(b)){if(/^●/.test(b)){p=!1,q=!1,o.push(b.replace(/^●\s*/,""));continue}p||q||o.push(b)}}}return o.join("\n").trim()}function o(a){let b=a.split("\n"),c=[];for(let a=0;a<b.length;a++){let f=(0,e.l1)(b[a]);f&&d.Md.test(f)&&c.push(a)}let f=0;c.length>=2&&(f=c[c.length-2]+1);let g=[];for(let a=f;a<b.length;a++){let c=(0,e.l1)(b[a]);!(!c||d.sx.some(a=>a.test(c)))&&(d.Md.test(c)||g.push(c))}return g.join("\n").trim()}function p(a,b){let c=a.split("\n"),e=function(a,b){switch(b){case"codex":return(0,d.Zu)(a);case"command-code":return(0,d.I$)(a);default:return -1}}(c,b),f=e>=0?c.slice(0,e):c,{skipPatterns:g}=(0,d._X)(b),h=[];for(let a of f){let b=(0,d.aJ)(a);b.trim()&&(g.some(a=>a.test(b))||h.push(b))}return h.join("\n").trim()}function q(a,b=f.Rf,c=f.ky){if(!a||a.length<=b)return a;let d=c+"\n",e=b-d.length;if(e<=0)return c.slice(0,b);let g=a.length-e;if(g>0&&g<a.length){let b=a.charCodeAt(g);b>=56320&&b<=57343&&(g+=1)}return d+a.slice(g)}}};
111
+ ${b}`}(a)});continue}if("tool_use"===f.type){b.push({kind:"tool",text:function(a){let b=a.toolName??"tool";return a.toolDetail?`- \`${b}\` — ${a.toolDetail}`:`- \`${b}\``}(f)}),e+=1;continue}C.has(f.type)||c.add(f.type)}let f=(0,m.t3)(b).body;return f.length>2e5&&(f=f.slice(0,2e5-o.length)+o),{sessionId:a.sessionId,promptUuid:a.promptUuid,body:f,textBlocks:d,toolBlocks:e,unknownBlockTypes:[...c]}}let E=(0,j.h)("lib/hooks/sources/claude/history"),F="_(The beginning of this reply is not shown: the turn runs further back than the 64 MiB of transcript that is read.)_",G=".jsonl",H=globalThis.__claudeTranscriptSessions??=new Map;async function I(a){let b=(0,g.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 H.set(b,e),e}catch(b){E.debug("claude-transcript-session-lookup-failed",{worktreeId:a.worktreeId,instanceId:a.instanceId??a.cliToolId,error:b instanceof Error?b.message:String(b)})}return H.get(b)??null}function J(a){return(0,f.join)(a,...n)}async function K(a,b,c){let d=a.instanceId??a.cliToolId;try{let f=b.homeDir??(0,e.homedir)();if("string"!=typeof b.worktreePath||0===b.worktreePath.length)return!1;let g=await I(a),h=await Q(f,b,g);if(!h)return E.debug("claude-transcript-unavailable",{worktreeId:a.worktreeId,instanceId:d,sessionId:g,reason:g?"no-file":"no-session-pointer"}),!1;let j=await U(a,h,g??"");if(null===j)return!1;let{parsed:k,built:l}=j;if(0===l.turns.length){let b=l.orphanedAssistantRecords;if(E.warn("claude-transcript-no-turn",{worktreeId:a.worktreeId,instanceId:d,path:h,records:k.records.length,malformedLines:k.malformedLines,orphanedAssistantRecords:b,...b>0?{readBytes:j.size-j.startByte,size:j.size}:{}}),b>0&&j.reachedLimit)return await X(a,k.records,g??"",h,c);return!1}(k.malformedLines>0||l.orphanedAssistantRecords>0)&&E.info("claude-transcript-partial-read",{worktreeId:a.worktreeId,instanceId:d,path:h,malformedLines:k.malformedLines,orphanedAssistantRecords:l.orphanedAssistantRecords,sidechainRecords:l.sidechainRecords});let m=await L(a,l.turns);if(await $(a,l.turns.slice(0,l.turns.length-m.turns.length).slice(-Y),h),0===m.turns.length)return E.debug("claude-transcript-turns-already-saved",{worktreeId:a.worktreeId,instanceId:d,turnsInWindow:l.turns.length}),await (0,i.fT)(a),!0;m.turns.length>1&&E.info("claude-transcript-backfilling-turns",{worktreeId:a.worktreeId,instanceId:d,path:h,pendingTurns:m.turns.length,turnsInWindow:l.turns.length,anchored:m.anchored});let n=[];for(let b=0;b<m.turns.length;b+=1){let c=0===b?m.previousStartedAt:m.turns[b-1].startedAt;n.push(await O(a,m.turns[b],c))}let o=function(a){let b=new Map,c=null;for(let d of a)if(!d.isSidechain){if(x(d)){c=d.uuid;continue}"assistant"===d.type&&null!==c&&null!==d.timestampMs&&d.timestampMs>(b.get(c)??0)&&b.set(c,d.timestampMs)}return b}(k.records),p=!1;for(let b=0;b<m.turns.length;b+=1){let d=m.turns[b];p=await _(a,d,D(d),P(d,n[b],o.get(d.promptUuid)??0,function(a,b,c){let d=a[c+1];return d?b[c+1]?.timestampMs??d.startedAt:null}(m.turns,n,b)),h,c)}return p&&await (0,i.fT)(a),p}catch(b){return E.error("claude-transcript-capture-failed",{worktreeId:a.worktreeId,instanceId:d,error:b instanceof Error?b.message:String(b)}),!1}}async function L(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,k.qe)(b[c].promptUuid);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 M(a,b){try{let c=b.homeDir??(0,e.homedir)();if("string"!=typeof b.worktreePath||0===b.worktreePath.length)return null;return await Q(c,b,await I(a))}catch{return null}}async function N(a,b){let c=a.instanceId??a.cliToolId;try{var d;let f=b.homeDir??(0,e.homedir)();if("string"!=typeof b.worktreePath||0===b.worktreePath.length)return null;let g=await I(a),h=await Q(f,b,g);if(!h)return null;let i=await S(h);if(null===i)return null;let j=w(i.text),l=B(j.records,g??""),m=l.turns.at(-1);if(m){let a=D(m);if(0===a.body.length)return null;return{turnKey:(0,k.qe)(a.promptUuid),body:a.body,partial:!1}}if(0===l.orphanedAssistantRecords)return null;let n=function(a,b){let c=[],d=0,e=!1;for(let b of a){if(x(b))break;if(!b.isSidechain&&"assistant"===b.type)for(let a of(d+=1,b.blocks)){if(c.length>=2048){e=!0;break}c.push(a)}}return{sessionId:b,promptUuid:`partial:${b}`,startedAt:0,promptText:"",promptIsOperatorInput:!1,blocks:c,assistantRecords:d,closed:!1,superseded:!1,stopReasonObserved:!1,overflowed:e}}(j.records,g??""),o=D(n);if(0===o.body.length)return null;return E.info("claude-transcript-progress-headless",{worktreeId:a.worktreeId,instanceId:c,path:h,orphanedAssistantRecords:l.orphanedAssistantRecords,malformedLines:j.malformedLines}),{turnKey:(d=g??"",(0,k.qe)(`${k.ST}${d}`)),body:o.body,partial:!0}}catch(b){return E.debug("claude-transcript-progress-failed",{worktreeId:a.worktreeId,instanceId:c,error:b instanceof Error?b.message:String(b)}),null}}async function O(a,b,c=0){let d=a.instanceId??a.cliToolId;if(!b.promptIsOperatorInput)return E.debug("claude-transcript-user-turn-skipped",{worktreeId:a.worktreeId,instanceId:d,promptUuid:b.promptUuid,reason:"not-operator-input"}),{outcome:"skipped",messageId:null,timestampMs:null};let e=await (0,h.Ce)(a,(0,k.H_)(b.promptUuid),b.promptText,b.startedAt,c>0?{adoptionFromMs:c}:{});return"failed"===e.outcome&&E.warn("claude-transcript-user-turn-failed",{worktreeId:a.worktreeId,instanceId:d,sessionId:b.sessionId,promptUuid:b.promptUuid}),e}function P(a,b,c=0,d=null){return Math.max(null===b.timestampMs?a.startedAt:Math.max(a.startedAt,b.timestampMs+1),Math.min(c,null===d?1/0:d-1))}async function Q(a,b,c){if(c){var d,e,g;let h=(d=a,e=b.worktreePath,g=c,(0,f.join)(J(d),e.replace(/[^a-zA-Z0-9]/g,"-"),`${g}${G}`));if(await R(h))return h}let h=b.transcriptPathHint;if("string"==typeof h&&h.length>0){let b=function(a,b){if(!b.endsWith(G)||b.includes("\0"))return null;let c=(0,f.resolve)(J(a)),d=(0,f.resolve)(b);return d===c||d.startsWith(c+f.sep)?d:null}(a,h);if(b&&await R(b))return b}return null}async function R(a){try{return(await (0,d.stat)(a)).isFile()}catch{return!1}}async function S(a){let b;try{b=await (0,d.open)(a,"r");let{size:c}=await b.stat(),e=Math.max(0,c-4194304),f=c-e;if(f<=0)return{text:"",size:c,startByte:0};let g=Buffer.alloc(f),{bytesRead:h}=await b.read(g,0,f,e),i=g.subarray(0,h);if(0===e)return{text:i.toString("utf8"),size:c,startByte:0};let j=i.indexOf(10);if(-1===j)return{text:"",size:c,startByte:c};return{text:i.subarray(j+1).toString("utf8"),size:c,startByte:e+j+1}}catch(b){return E.warn("claude-transcript-read-failed",{path:a,error:b instanceof Error?b.message:String(b)}),null}finally{await b?.close().catch(()=>{})}}async function T(a,b,c){let d=c-b,e=Buffer.alloc(d),{bytesRead:f}=await a.read(e,0,d,b);if(f!==d)return null;if(0===b)return{text:e.toString("utf8"),startByte:0};let g=e.indexOf(10);return -1===g?{text:"",startByte:c}:{text:e.subarray(g+1).toString("utf8"),startByte:b+g+1}}async function U(a,b,c){let d=await S(b);if(null===d)return null;let e=w(d.text),f=B(e.records,c),g={parsed:e,built:f,size:d.size,startByte:d.startByte,reachedLimit:!1};return f.turns.length>0||0===f.orphanedAssistantRecords||0===d.startByte?g:await V(a,b,c,g)??g}async function V(a,b,c,e){let f,{size:g}=e;try{f=await (0,d.open)(b,"r");let h=e.parsed.records,i=e.parsed.malformedLines,j=e.built,k=e.startByte,l=4194304,m=null;for(;0===j.turns.length&&k>0&&l<0x4000000;){l*=2;let a=await T(f,Math.max(0,g-l),k);if(null===a)return null;let b=w(a.text);h=[...b.records,...h],i+=b.malformedLines,k=a.startByte;let d=(j=B(h,c)).turns.at(-1);d&&(m=function(a,b,c){let{text:d}=a;for(let e=d.indexOf(b);-1!==e;e=d.indexOf(b,e+b.length)){let f=d.lastIndexOf("\n",e)+1,g=d.indexOf("\n",e),h=null;try{h=v(JSON.parse(d.slice(f,-1===g?d.length:g)))}catch{}if(h?.uuid===b)return c-a.startByte-Buffer.byteLength(d.slice(0,f),"utf8")}return null}(a,d.promptUuid,g))}return E.info("claude-transcript-window-extended",{worktreeId:a.worktreeId,instanceId:a.instanceId??a.cliToolId,path:b,fromBytes:4194304,toBytes:l,size:g,promptOffsetFromEnd:m,records:h.length}),{parsed:{records:h,malformedLines:i},built:j,size:g,startByte:k,reachedLimit:0===j.turns.length&&k>0}}catch(a){return E.warn("claude-transcript-read-failed",{path:b,error:a instanceof Error?a.message:String(a)}),null}finally{await f?.close().catch(()=>{})}}let W={outcome:"skipped",messageId:null,timestampMs:null};async function X(a,b,c,d,e){var f;let g,h=a.instanceId??a.cliToolId,j=function(a,b){let c=[],d=0,e=!1,f=!1,g=!1,h=0,i=0,j=null;for(let b of a)if(!b.isSidechain){if(x(b)){g=!0;break}if("assistant"===b.type){for(let a of(d+=1,e=z(b),null!==b.stopReason&&(f=!0),null!==b.timestampMs&&(0===h&&(h=b.timestampMs),i=Math.max(i,b.timestampMs)),b.blocks))c.push(a);j=b}}if(null===j||!j.uuid)return null;let l=j.sessionId??b,m=c.length>2048;return{turn:{sessionId:l,promptUuid:(0,k.Wr)(l,j.uuid),startedAt:h,promptText:"",promptIsOperatorInput:!1,blocks:m?c.slice(-2048):c,assistantRecords:d,closed:e,superseded:g,stopReasonObserved:f,overflowed:m},lastRecordAt:i}}(b,c);if(null===j)return E.debug("claude-transcript-headless-unkeyed",{worktreeId:a.worktreeId,instanceId:h,path:d}),!1;let{turn:l}=j,m=D(l);E.info("claude-transcript-headless-turn",{worktreeId:a.worktreeId,instanceId:h,sessionId:l.sessionId,requestId:(0,k.qe)(l.promptUuid),path:d,assistantRecords:l.assistantRecords,overflowed:l.overflowed});let n=await _(a,l,0===m.body.length?m:(f=m,(g=`${F}
112
+
113
+ ${f.body}`).length>2e5&&(g=g.slice(0,2e5-o.length)+o),{...f,body:g}),P(l,W,j.lastRecordAt,null),d,e);return n&&await (0,i.fT)(a),n}let Y=3;async function Z(a,b,d,e){let f=a.instanceId??a.cliToolId,g=b.content.length;if(d.body.length<=g)return!1;let[{getDbInstance:h},{updateMessageContent:i},{broadcastMessage:j}]=await Promise.all([Promise.resolve().then(c.bind(c,88807)),Promise.resolve().then(c.bind(c,56791)),Promise.resolve().then(c.bind(c,49640))]);return i(h(),b.id,d.body),j("message_updated",{worktreeId:a.worktreeId,message:{...b,content:d.body}}),E.info("claude-transcript-turn-updated",{worktreeId:a.worktreeId,instanceId:f,sessionId:d.sessionId,requestId:b.requestId,path:e,previousLength:g,bodyLength:d.body.length,textBlocks:d.textBlocks,toolBlocks:d.toolBlocks}),!0}async function $(a,b,d){if(0===b.length)return 0;let[{getDbInstance:e},{findMessageByRequestId:f}]=await Promise.all([Promise.resolve().then(c.bind(c,88807)),Promise.resolve().then(c.bind(c,56791))]),g=e(),h=0;for(let c of b){if(!A(c))continue;let b=f(g,a.worktreeId,(0,k.qe)(c.promptUuid));b&&await Z(a,b,D(c),d)&&(h+=1)}return h}async function _(a,b,d,e,f,g){let h=a.instanceId??a.cliToolId;if(g&&(g.outcome=void 0),!A(b))return g&&(g.outcome="not_yet_closed"),E.info("claude-transcript-turn-open",{worktreeId:a.worktreeId,instanceId:h,sessionId:d.sessionId,promptUuid:d.promptUuid,assistantRecords:b.assistantRecords,textBlocks:d.textBlocks,toolBlocks:d.toolBlocks}),!1;if(0===d.body.length)return E.info("claude-transcript-turn-empty",{worktreeId:a.worktreeId,instanceId:h,sessionId:d.sessionId,promptUuid:d.promptUuid}),!1;d.unknownBlockTypes.length>0&&E.info("claude-transcript-unknown-blocks",{worktreeId:a.worktreeId,instanceId:h,sessionId:d.sessionId,blockTypes:d.unknownBlockTypes});let i=(0,k.qe)(d.promptUuid),[{getDbInstance:j},{createMessage:l,findMessageByRequestId:m},{broadcastMessage:n}]=await Promise.all([Promise.resolve().then(c.bind(c,88807)),Promise.resolve().then(c.bind(c,56791)),Promise.resolve().then(c.bind(c,49640))]),o=j(),p=m(o,a.worktreeId,i);if(p)return E.debug("claude-transcript-turn-already-saved",{worktreeId:a.worktreeId,instanceId:h,requestId:i}),await Z(a,p,d,f),!0;let q=l(o,{worktreeId:a.worktreeId,role:"assistant",content:d.body,messageType:"normal",timestamp:new Date(e>0?e:Date.now()),cliToolId:a.cliToolId,instanceId:h,requestId:i});return n("message",{worktreeId:a.worktreeId,message:q}),E.info("claude-transcript-turn-saved",{worktreeId:a.worktreeId,instanceId:h,sessionId:d.sessionId,requestId:i,path:f,bodyLength:d.body.length,textBlocks:d.textBlocks,toolBlocks:d.toolBlocks}),!0}},82450:(a,b,c)=>{c.d(b,{IS:()=>h,LH:()=>n,NN:()=>g,Sj:()=>q,Te:()=>p,aW:()=>o});var d=c(85164),e=c(13033),f=c(56263);function g(a){let b=(0,d.aJ)(a).split("\n"),c=(0,d.GT)(b),e=c>=0?b.slice(0,c):b,f=-1;for(let a=e.length-1;a>=0;a--)if(/^❯\s+\S/.test(e[a])){f=a;break}let g=f>=0?f+1:0,h=e.slice(g),i=[/CLAUDE_HOOKS_/,/\/bin\/claude/,/^claude\s*$/,/@.*\s+%\s*$/,/^[^⏺]*curl.*POST/,/^[^⏺]*Content-Type/,/^[^⏺]*export\s+CLAUDE_/,/^\s*$/,/^[╭╮╰╯│─\s]+$/,/^[│╭╮╰╯].*[│╭╮╰╯]$/,/Claude Code v[\d.]+/,/^Tips for getting started/,/^Welcome back/,/Run \/init to create/,/^Recent activity/,/^No recent activity/,/▐▛███▜▌|▝▜█████▛▘|▘▘ ▝▝/,/^\s*Opus \d+\.\d+\s*·\s*Claude Max/,/\.com's Organization/,/\?\s*for shortcuts\s*$/,/^─{10,}$/,/^❯\s*$/,d.fW],j=[];for(let a of h)!i.some(b=>b.test(a))&&a.trim()&&j.push(a);return j.join("\n").trim()}function h(a){let b=(0,d.aJ)(a).split("\n"),c=[],e=[/^maenokota@.*%/,/^zsh:/,/^feature-issue-\d+/,/^\s*$/],f=!1,g=[];for(let a of b){if(a.includes("✦")){f=!0;let b=a.indexOf("✦"),c=a.substring(b+1).trim();c&&g.push(c);continue}if(f){if(e.some(b=>b.test(a)))continue;g.push(a)}}if(g.length>0)return g.join("\n").trim();for(let a of b)e.some(b=>b.test(a))||c.push(a);return c.join("\n").trim()}let i=RegExp(`^●\\s+(?:${d.Jr})[\\s:]`),j=/^\$\s+[A-Z][A-Za-z]*(?:\s|$)/,k=/^\d+\s+lines\.\.\.$/,l=/^[◐◑◒◓]/,m=/^(?:git\s+--no-pager|git\s+(?:log|diff|show|status|branch|remote|fetch|pull|push|merge|rebase|checkout|reset|stash|tag|config|clone|init|add|commit|rm|mv|bisect|grep|ls-files|rev-parse|describe|shortlog|blame|reflog|cherry-pick|revert|submodule|worktree)\b|npm\s+|npx\s+|yarn\s+|pnpm\s+|cargo\s+|pip\s+|rustc\s+|cmake\s+|docker\s+|kubectl\s+|aws\s+|gcloud\s+|az\s+|terraform\s+|ansible\s+|curl\s+|wget\s+|ssh\s+|scp\s+|rsync\s+|grep\s+|sed\s+|awk\s+|mkdir\s+|rm\s+|cp\s+|mv\s+|chmod\s+|chown\s+)/;function n(a){let b=(0,d.aJ)(a).split("\n"),c=(0,d.wv)(b),f=c>=0?b.slice(0,c):b,g=-1;for(let a=f.length-1;a>=0;a--){let b=(0,e.IW)(f[a]);if(b&&/^❯\s+\S/.test(b)){g=a;break}}let h=g>=0?g+1:0;if(g>=0)for(;h<f.length&&d.Fg.test(f[h]);)h++;let n=f.slice(h),o=[],p=!1,q=!1;for(let a of n){if(d.JN.test(a))continue;let b=(0,e.IW)(a);if(!b){p=!1,q=!1;continue}if(d.J7.some(a=>a.test(b)))continue;if(j.test(b)){q=!0,p=!1;continue}if(i.test(b))continue;if(l.test(b)){p=!0,q=!1;continue}if(!(k.test(b)||m.test(b))){if(/^❯\s*/.test(b)){p=!1,q=!1;continue}if(!/^[│└]/.test(b)){if(/^●/.test(b)){p=!1,q=!1,o.push(b.replace(/^●\s*/,""));continue}p||q||o.push(b)}}}return o.join("\n").trim()}function o(a){let b=a.split("\n"),c=[];for(let a=0;a<b.length;a++){let f=(0,e.l1)(b[a]);f&&d.Md.test(f)&&c.push(a)}let f=0;c.length>=2&&(f=c[c.length-2]+1);let g=[];for(let a=f;a<b.length;a++){let c=(0,e.l1)(b[a]);!(!c||d.sx.some(a=>a.test(c)))&&(d.Md.test(c)||g.push(c))}return g.join("\n").trim()}function p(a,b){let c=a.split("\n"),e=function(a,b){switch(b){case"codex":return(0,d.Zu)(a);case"command-code":return(0,d.I$)(a);default:return -1}}(c,b),f=e>=0?c.slice(0,e):c,{skipPatterns:g}=(0,d._X)(b),h=[];for(let a of f){let b=(0,d.aJ)(a);b.trim()&&(g.some(a=>a.test(b))||h.push(b))}return h.join("\n").trim()}function q(a,b=f.Rf,c=f.ky){if(!a||a.length<=b)return a;let d=c+"\n",e=b-d.length;if(e<=0)return c.slice(0,b);let g=a.length-e;if(g>0&&g<a.length){let b=a.charCodeAt(g);b>=56320&&b<=57343&&(g+=1)}return d+a.slice(g)}}};
@@ -0,0 +1 @@
1
+ "use strict";exports.id=9080,exports.ids=[9080],exports.modules={8953:(a,b,c)=>{c.d(b,{Mx:()=>f,pU:()=>e,qD:()=>d,sM:()=>i});let d=["Up","Down","Left","Right","Enter","Escape","Tab","BTab","PageUp","PageDown","Home","End","q","1","2","3","4","5","6","7","8","9","y","n"],e=[...d,"s"],f="C-x",g=["C-p","C-t"],h=["a","l","t","m","g","u","r","c"],i=[...d,f,...g,...h];[...d,...g,...h]},31442:(a,b,c)=>{c.d(b,{$D:()=>u,Bl:()=>z,Fk:()=>s,HL:()=>e,Ix:()=>y,KB:()=>t,L0:()=>k,Ls:()=>L,N2:()=>m,ND:()=>p,N_:()=>g,RS:()=>N,Rr:()=>J,Ys:()=>r,bq:()=>n,cD:()=>q,eC:()=>h,g4:()=>K,gM:()=>E,jp:()=>i,jx:()=>F,lY:()=>o,n9:()=>B,om:()=>v,sL:()=>M,tx:()=>l,wv:()=>j});var d=c(16983);let e="mcbd-";function f(a){return`=${a}:`}function g(a){return a.startsWith(e)}let h="@cm_status",i="@cm_worktree",j="@cm_tool",k="@cm_instance",l="@cm_updated",m="@cm_delegated",n=[h,i,j,k,l,m],o="[CommandMate #{@cm_tool}/#{@cm_instance} #{@cm_status}] #{window_width}x#{window_height}";function p(a,b,c){return["set-option","-t",f(a),b,c]}function q(a,b){return["set-option","-u","-t",f(a),b]}function r(a,b){return["show-options","-t",f(a),b]}function s(a,b){return["show-options","-v","-t",f(a),b]}function t(a,b){return p(a,"status-right",b)}function u(a){return q(a,"status-right")}function v(a=process.env){let b=(a.CM_TMUX_STATUS??"").trim().toLowerCase();return"off"!==b&&"0"!==b&&"false"!==b}function w(a,b,c){return["set-hook","-t",f(a),b,c]}function x(a,b){return["set-hook","-u","-t",f(a),b]}function y(a){return["list-clients","-t",f(a),"-F","#{client_control_mode}"]}function z(a){return a.split("\n").map(a=>a.trim()).filter(a=>"0"===a).length}let A=["claude"];function B(a){return!!g(a)&&A.some(b=>a.startsWith(`${e}${b}-`))}let C="client-attached[0]",D="client-attached[1]";function E(a=process.env){return"on"===(a.CM_LIVE_ATTACH_HOOK??"").trim().toLowerCase()}function F(a=process.env){return"on"===(a.CM_READ_MODE_AUTO_POPUP??"").trim().toLowerCase()}function G(a){if(!/["$`\\\n\r]/.test(a))return`"${a}"`}function H(a,b,c=[]){let d=[a,...b,...c].join(" ");return`run-shell -b '${d}'`}let I=["#{session_name}","#{client_control_mode}","#{client_name}"];function J(a,b){let c=G(b);if(void 0!==c)return w(a,C,H(c,I))}function K(a){return x(a,C)}function L(a,b){let c=G(b);if(void 0!==c)return w(a,D,H(c,I))}function M(a){return x(a,D)}function N(a,b=d.Jn,c=d.sO){return[["set-window-option","-t",f(a),"window-size","manual"],["resize-window","-t",f(a),"-x",String(b),"-y",String(c)],q(a,m)]}},54325:(a,b,c)=>{c.d(b,{LE:()=>f,Oo:()=>e,ST:()=>d,T4:()=>k,dz:()=>j,r9:()=>h,rx:()=>i,rz:()=>g});let d="client_version",e="version_mismatch";function f(a,b){return!!a&&!!b&&"0.0.0"!==a&&"0.0.0"!==b&&a!==b}let g="chat_turn_progress",h=1e3;function i(a,b=65536){return b<=0?{body:"",truncated:a.length>0}:a.length<=b?{body:a,truncated:!1}:{body:a.slice(a.length-b),truncated:!0}}let j="messages_invalidated",k="model_changed"},79892:(a,b,c)=>{c.d(b,{Xg:()=>w,ou:()=>B,Ce:()=>A,jw:()=>s,lA:()=>n,nS:()=>q,N:()=>p,N6:()=>C,fY:()=>x,GW:()=>r,zT:()=>o,V1:()=>t,ds:()=>z,KB:()=>v,Sb:()=>D});var d=c(79646),e=c(28354),f=c(93997),g=c(83598),h=c(16983),i=c(72626),j=c(8953),k=c(86069);let l=(0,e.promisify)(d.execFile),m=(0,i.h)("tmux");function n(a){return`=${a}:`}async function o(a,b={}){let c,d,e,f=b.windowWidth??h.Jn,i=b.windowHeight??h.sO,j=n(a);try{c=(await l("tmux",["show-window-options","-v","-t",j,"window-size"],{timeout:5e3})).stdout.trim();let[a,b]=(await l("tmux",["display-message","-p","-t",j,"#{window_width}|#{window_height}"],{timeout:5e3})).stdout.trim().split("|").map(Number);Number.isFinite(a)&&(d=a),Number.isFinite(b)&&(e=b)}catch{}let k="manual"===c,p=d===f&&e===i;if(k&&p)return!1;if((b.respectAttachedClient??!0)&&await (0,g.Fh)(a))return m.info("session-geometry:delegated-to-client",{sessionName:a}),!1;try{return k||await l("tmux",["set-window-option","-t",j,"window-size","manual"],{timeout:5e3}),p||await l("tmux",["resize-window","-t",j,"-x",String(f),"-y",String(i)],{timeout:5e3}),!0}catch(b){return m.warn("session-geometry:reconcile-failed",{sessionName:a,error:b instanceof Error?b.message:String(b)}),!1}}async function p(a){try{return await l("tmux",["has-session","-t",n(a)],{timeout:5e3}),!0}catch{return!1}}async function q(a){try{let{stdout:b}=await l("tmux",["display-message","-p","-t",n(a),"#{session_path}"],{timeout:5e3}),c=b.trim();return""===c?null:c}catch{return null}}async function r(){try{let{stdout:a}=await l("tmux",["list-sessions","-F","#{session_name}|#{session_windows}|#{session_attached}"],{timeout:5e3});if(!a||""===a.trim())return[];return a.trim().split("\n").map(a=>{let[b,c,d]=a.split("|");return{name:b,windows:parseInt(c,10)||0,attached:"1"===d}})}catch{return[]}}async function s(a,b){let c,d,e,f,g;"string"==typeof a?(c=a,d=b,e=h.eu,f=h.Jn,g=h.sO):(c=a.sessionName,d=a.workingDirectory,e=a.historyLimit||h.eu,f=a.windowWidth||h.Jn,g=a.windowHeight||h.sO);try{await l("tmux",["new-session","-d","-s",c,"-c",d,"-x",String(f),"-y",String(g)],{timeout:5e3}),await l("tmux",["set-option","-t",n(c),"history-limit",String(e)],{timeout:5e3});try{await l("tmux",["new-window","-k","-t",`${n(c)}0`,"-c",d],{timeout:5e3})}catch(a){m.warn("session-history-limit:window-rebuild-failed",{sessionName:c,historyLimit:e,error:a instanceof Error?a.message:String(a)})}await o(c,{windowWidth:f,windowHeight:g,respectAttachedClient:!1})}catch(b){let a=b instanceof Error?b.message:String(b);throw Error(`Failed to create tmux session: ${a}`)}}async function t(a,b,c=!0,d){if(d?.literal&&c)throw Error("sendKeys: { literal: true } cannot be combined with sendEnter — a trailing C-m would be typed as text. Send Enter as a separate key.");let e=d?.literal?function(a,b){if("literal"===b.kind)return["send-keys","-t",a,"-l","--",b.text];if(!(0,k.vY)(b.name))throw Error(`Invalid key sequence key name: ${b.name}`);return["send-keys","-t",a,"--",b.name]}(n(a),{kind:"literal",text:b}):c?["send-keys","-t",n(a),b,"C-m"]:["send-keys","-t",n(a),b];try{await l("tmux",e,{timeout:5e3})}catch(b){let a=b instanceof Error?b.message:String(b);throw Error(`Failed to send keys to tmux session: ${a}`)}}let u=new Set(["Up","Down","Left","Right","Enter","Space","Tab","Escape","BTab","BSpace","DC","PageUp","PageDown","Home","End","q","1","2","3","4","5","6","7","8","9","y","s","C-x","C-p","C-t","a","l","n","t","m","g","u","r","c"]);async function v(a,b){if(0!==b.length){for(let a of b)if(!u.has(a))throw Error(`Invalid special key: ${a}`);try{for(let c=0;c<b.length;c++)await l("tmux",["send-keys","-t",n(a),b[c]],{timeout:5e3}),c<b.length-1&&await new Promise(a=>setTimeout(a,100))}catch(b){let a=b instanceof Error?b.message:String(b);throw Error(`Failed to send special keys to tmux session: ${a}`)}}}async function w(a,b){let c,d;"number"==typeof b?(c=-b,d="-"):b?(c=b.startLine??-1e4,d=b.endLine??"-"):(c=-1e3,d="-");try{let{stdout:b}=await l("tmux",["capture-pane","-t",n(a),"-p","-e","-S",String(c),"-E",String(d)],{timeout:5e3,maxBuffer:0xa00000});return b}catch(b){let a=b instanceof Error?b.message:String(b);throw Error(`Failed to capture pane: ${a}`)}}async function x(a){try{return await l("tmux",["kill-session","-t",n(a)],{timeout:5e3}),!0}catch(b){let a=b instanceof Error?b.message:String(b);if(a?.includes("no server running")||a?.includes("can't find session"))return!1;throw Error(`Failed to kill tmux session: ${a}`)}}let y=new Set(["Escape","C-c","C-d","C-m","Enter"]);async function z(a,b){if(!y.has(b))throw Error(`Invalid special key: ${b}`);try{await l("tmux",["send-keys","-t",n(a),b],{timeout:5e3})}catch(b){let a=b instanceof Error?b.message:String(b);throw Error(`Failed to send special key: ${a}`)}}async function A(a){try{await l("tmux",["send-keys","-t",n(a),"C-u"],{timeout:5e3})}catch(b){let a=b instanceof Error?b.message:String(b);throw Error(`Failed to clear tmux input line: ${a}`)}}async function B(a){try{await l("tmux",["send-keys","-t",n(a),"C-e","C-u"],{timeout:5e3})}catch(b){let a=b instanceof Error?b.message:String(b);throw Error(`Failed to clear tmux composer line: ${a}`)}}function C(a,b=j.qD){return b.includes(a)&&u.has(a)}async function D(a,b){await v(a,b),(0,f.gm)(a);let c=setTimeout(()=>(0,f.gm)(a),250);c.unref?.()}},83598:(a,b,c)=>{c.d(b,{Fh:()=>l,G9:()=>m,Us:()=>j,zQ:()=>k});var d=c(79646),e=c(28354),f=c(31442);let g=(0,e.promisify)(d.execFile),h=globalThis.__cmGeometryDelegationCache??(globalThis.__cmGeometryDelegationCache=new Map),i=globalThis.__cmGeometryDelegationEdge??(globalThis.__cmGeometryDelegationEdge=new Map);async function j(a,b=Date.now()){let c=h.get(a);if(c&&b-c.readAt<1e3)return c.delegated;let d=!1;try{let{stdout:b}=await g("tmux",(0,f.Fk)(a,f.N2),{timeout:5e3});d="1"===b.trim()}catch{d=!1}return h.set(a,{delegated:d,readAt:b}),d}async function k(a,b=Date.now()){let c=await j(a,b),d=i.get(a)??!1;return i.set(a,c),{delegated:c,released:d&&!c}}async function l(a){try{let{stdout:b}=await g("tmux",(0,f.Ix)(a),{timeout:5e3});return(0,f.Bl)(b)>0}catch{return!1}}function m(a){h.delete(a),i.delete(a)}},86069:(a,b,c)=>{c.d(b,{IS:()=>e,iF:()=>f,vY:()=>g});let d=["Escape","C-c","C-d","C-m","Enter"];function e(a,b){return void 0===b?{kind:"key",name:a}:{kind:"key",name:a,delayAfterMs:b}}function f(a,b){return void 0===b?{kind:"literal",text:a}:{kind:"literal",text:a,delayAfterMs:b}}function g(a){return d.includes(a)}},93997:(a,b,c)=>{c.d(b,{aq:()=>m,gm:()=>k,pc:()=>l,sl:()=>f,vF:()=>j,wd:()=>i,xE:()=>e});let d=(0,c(72626).h)("tmux-capture-cache"),e=1e4;function f(a,b=e){return b>0&&a>=b}function g(){return globalThis.__tmuxCaptureCache??=new Map}function h(){return globalThis.__tmuxCaptureCacheInflight??=new Map}function i(a,b){if(""===a)return"";let c=a.split("\n");return b>=c.length?a:c.slice(-b).join("\n")}function j(a,b,c){let d=g(),e=Date.now();for(let[a,b]of d)e-b.timestamp>5e3&&d.delete(a);if(d.size>=100&&!d.has(a)){let a=null,b=1/0;for(let[c,e]of d)e.timestamp<b&&(b=e.timestamp,a=c);a&&d.delete(a)}d.set(a,{output:b,capturedLines:c,timestamp:e})}function k(a){g().delete(a),d.debug("cache:invalidate",{sessionName:a})}function l(){g().clear(),h().clear()}async function m(a,b,c){let d=function(a,b){let c=g(),d=c.get(a);return d?Date.now()-d.timestamp>5e3?(c.delete(a),null):b>d.capturedLines?null:i(d.output,b):null}(a,b);if(null!==d)return d;let f=h(),k=f.get(a);if(k)return i(await k,b);let l=c();f.set(a,l);try{let c=await l;return c.length>0&&j(a,c,e),i(c,b)}finally{f.delete(a)}}}};
@@ -0,0 +1 @@
1
+ "use strict";exports.id=964,exports.ids=[964,8583],exports.modules={40964:(a,b,c)=>{c.d(b,{m:()=>g});var d=c(15194);let e=/^[a-zA-Z0-9_-]+$/;function f(a){if(!e.test(a))throw Error(`Invalid session name format: ${a}`)}function g(a,b,c){let e=`mcbd-${a}-${b}`;if(!c||c===a)return f(e),e;let g=(0,d.pL)(c,a),h=g?`${e}-${g}`:e;return f(h),h}}};
@@ -17,11 +17,11 @@
17
17
  "wasm": [],
18
18
  "assets": [],
19
19
  "env": {
20
- "__NEXT_BUILD_ID": "9x6U1h52hH_r6pOsGwI_p",
21
- "NEXT_SERVER_ACTIONS_ENCRYPTION_KEY": "HqaRbpV2n22WqFiXZEwWNBJ0SglKhMFN4JPAKywcH2w=",
22
- "__NEXT_PREVIEW_MODE_ID": "a58bbff6a117a6edf4f44fcbfc4a8c71",
23
- "__NEXT_PREVIEW_MODE_SIGNING_KEY": "969baa3ca8b15c5ad4cb0c8b106c7050b45bd49b60a2a3de8942181e503f9d44",
24
- "__NEXT_PREVIEW_MODE_ENCRYPTION_KEY": "ae7ea321996e996afe15bc8eb88c3dda83c277950f38d51f391b5d4ce06707cc"
20
+ "__NEXT_BUILD_ID": "gniPBCKoXtbIOQey8kNcx",
21
+ "NEXT_SERVER_ACTIONS_ENCRYPTION_KEY": "+htYQ9hIF8RpE0hGWsXMiyTab8hxOwmREekAMx9J6/w=",
22
+ "__NEXT_PREVIEW_MODE_ID": "ac0c22779a474de5dc3fdbddefc404b0",
23
+ "__NEXT_PREVIEW_MODE_SIGNING_KEY": "d3594b529d5f7f38941ee26873625bf5b28017886b2b7f2a0170dd723aeb5c6c",
24
+ "__NEXT_PREVIEW_MODE_ENCRYPTION_KEY": "0c77dd9c37f184a5bbbbd288fcf6327a46785993b44d124b87c820dd35a0db07"
25
25
  }
26
26
  }
27
27
  },
@@ -1 +1 @@
1
- <!DOCTYPE html><html><head><meta charSet="utf-8" data-next-head=""/><meta name="viewport" content="width=device-width" data-next-head=""/><title data-next-head="">500: Internal Server Error</title><noscript data-n-css=""></noscript><script defer="" noModule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-1dc9eb5ebb4fa5ff.js" defer=""></script><script src="/_next/static/chunks/framework-eaf13c96191cb608.js" defer=""></script><script src="/_next/static/chunks/main-ac91ed6e71380841.js" defer=""></script><script src="/_next/static/chunks/pages/_app-4b3fb5e477a0267f.js" defer=""></script><script src="/_next/static/chunks/pages/_error-c970d8b55ace1b48.js" defer=""></script><script src="/_next/static/9x6U1h52hH_r6pOsGwI_p/_buildManifest.js" defer=""></script><script src="/_next/static/9x6U1h52hH_r6pOsGwI_p/_ssgManifest.js" defer=""></script></head><body><div id="__next"><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div style="line-height:48px"><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding-right:23px;font-size:24px;font-weight:500;vertical-align:top">500</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:28px">Internal Server Error<!-- -->.</h2></div></div></div></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":500}},"page":"/_error","query":{},"buildId":"9x6U1h52hH_r6pOsGwI_p","nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>
1
+ <!DOCTYPE html><html><head><meta charSet="utf-8" data-next-head=""/><meta name="viewport" content="width=device-width" data-next-head=""/><title data-next-head="">500: Internal Server Error</title><noscript data-n-css=""></noscript><script defer="" noModule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-1dc9eb5ebb4fa5ff.js" defer=""></script><script src="/_next/static/chunks/framework-eaf13c96191cb608.js" defer=""></script><script src="/_next/static/chunks/main-ac91ed6e71380841.js" defer=""></script><script src="/_next/static/chunks/pages/_app-4b3fb5e477a0267f.js" defer=""></script><script src="/_next/static/chunks/pages/_error-c970d8b55ace1b48.js" defer=""></script><script src="/_next/static/gniPBCKoXtbIOQey8kNcx/_buildManifest.js" defer=""></script><script src="/_next/static/gniPBCKoXtbIOQey8kNcx/_ssgManifest.js" defer=""></script></head><body><div id="__next"><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div style="line-height:48px"><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding-right:23px;font-size:24px;font-weight:500;vertical-align:top">500</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:28px">Internal Server Error<!-- -->.</h2></div></div></div></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":500}},"page":"/_error","query":{},"buildId":"gniPBCKoXtbIOQey8kNcx","nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>
@@ -1 +1 @@
1
- {"node":{},"edge":{},"encryptionKey":"HqaRbpV2n22WqFiXZEwWNBJ0SglKhMFN4JPAKywcH2w="}
1
+ {"node":{},"edge":{},"encryptionKey":"+htYQ9hIF8RpE0hGWsXMiyTab8hxOwmREekAMx9J6/w="}
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2053],{24027:(e,t,l)=>{l.d(t,{Uc:()=>C,G8:()=>w,OJ:()=>A,RF:()=>R});var n=l(95155),s=l(12115),a=l(18955),r=l(51238),i=l(89451),o=l(10934),d=l(92254),c=l(5225);l(1226);var u=l(89715),x=l(57828),m=l(52056),p=l(65229),g=l(67909),h=l(3005);let f=(0,g.default)(()=>Promise.all([l.e(221),l.e(7485),l.e(953)]).then(l.bind(l,90953)).then(e=>({default:e.MermaidDiagram})),{loadableGenerated:{webpack:()=>[90953]},ssr:!1,loading:function(){let e=(0,a.c)("worktree");return(0,n.jsxs)("div",{className:"mermaid-loading flex items-center gap-2 text-muted-foreground p-4",children:[(0,n.jsx)(h.y,{size:"sm"}),(0,n.jsx)("span",{children:e("mermaid.loading")})]})}});function k(e){let{className:t,children:l}=e;if(t&&t.split(" ").includes("language-mermaid")){let e=null==l?"":"string"==typeof l?l:Array.isArray(l)?l.map(e=>"string"==typeof e?e:"").join(""):String(l);return(0,n.jsx)(f,{code:e})}return(0,n.jsx)("code",{className:t,children:l})}var j=l(50666),b=l(69352),y=l(76246),N=l(99112);function v(e){let{apiUrl:t,alt:l,width:r,height:i}=e,o=(0,a.c)("worktree"),[d,c]=(0,s.useState)(null);return((0,s.useEffect)(()=>{let e=!1;return fetch(t).then(e=>e.ok?e.json():null).then(t=>{!e&&(null==t?void 0:t.content)&&c(t.content)}).catch(()=>{}),()=>{e=!0}},[t]),d)?(0,n.jsx)("img",{src:d,alt:l,width:r,height:i,style:{maxWidth:r||"100%"}}):(0,n.jsx)("span",{style:{color:"#999"},children:o("markdownPreview.loadingImage")})}let w=(0,s.memo)(function(e){let{content:t,onOpenFile:l,currentFilePath:a,worktreeId:u}=e,x=(0,s.useRef)(l);x.current=l;let m=(0,s.useRef)(a);m.current=a;let p=(0,s.useRef)(u);p.current=u;let g=(0,s.useCallback)((e,t)=>{let l=(0,b.d3)(t);if(l)switch((0,b.dj)(l)){case"anchor":break;case"external":e.preventDefault(),window.open(l,"_blank","noopener,noreferrer");break;case"relative":{e.preventDefault();let t=m.current,n=x.current;if(t&&n){let e=(0,b.WU)(t,l);e&&n(e)}}}},[]),h=(0,s.useMemo)(()=>({code:k,pre:e=>{let{children:t}=e;return!function(e){let t=s.Children.toArray(e)[0];if(!s.isValidElement(t))return!1;let l=t.props.className;return"string"==typeof l&&l.split(" ").includes("language-mermaid")}(t)?(0,n.jsx)(j.Ck,{children:(0,n.jsx)("pre",{className:"overflow-x-auto",children:t})}):(0,n.jsx)("pre",{children:t})},img:e=>{var t,l,s,a;let{src:r,alt:i,width:o,height:d,...c}=e,u=null!=o?o:null==(l=c.node)||null==(t=l.properties)?void 0:t.width,x=null!=d?d:null==(a=c.node)||null==(s=a.properties)?void 0:s.height;if("string"==typeof r&&!r.startsWith("http://")&&!r.startsWith("https://")&&!r.startsWith("data:")){let e=m.current,t=p.current;if(e&&t){let l=(0,b.WU)(e,r);if(l){let e="/api/worktrees/".concat(t,"/files/").concat((0,y.o)(l));return(0,n.jsx)(v,{apiUrl:e,alt:null!=i?i:"",width:u,height:x})}}}return(0,n.jsx)("img",{src:r,alt:null!=i?i:"",width:u,height:x,style:{maxWidth:u||"100%"}})},a:e=>{let{href:t,children:l,...s}=e;return t?(0,n.jsx)("a",{...s,href:t,onClick:e=>g(e,t),children:l}):(0,n.jsx)("a",{...s,children:l})}}),[g]),f=(0,s.useMemo)(()=>[i.A,[o.A,b.uO],d.A,c.A],[]);return(0,n.jsx)(r.oz,{remarkPlugins:N.eT,rehypePlugins:f,components:h,children:t})}),R=(0,s.memo)(function(e){let{mobileTab:t,onTabChange:l}=e,s=(0,a.c)("worktree");return(0,n.jsxs)("div",{className:"flex border-b border-border",children:[(0,n.jsxs)("button",{"data-testid":"mobile-tab-editor",onClick:()=>l("editor"),className:"flex-1 py-2 text-sm font-medium ".concat("editor"===t?"text-accent-600 dark:text-accent-400 border-b-2 border-accent-600 dark:border-accent-400":"text-muted-foreground"),children:[(0,n.jsx)(u.A,{className:"h-4 w-4 inline-block mr-1"}),s("markdownPreview.editor")]}),(0,n.jsxs)("button",{"data-testid":"mobile-tab-preview",onClick:()=>l("preview"),className:"flex-1 py-2 text-sm font-medium ".concat("preview"===t?"text-accent-600 dark:text-accent-400 border-b-2 border-accent-600 dark:border-accent-400":"text-muted-foreground"),children:[(0,n.jsx)(x.A,{className:"h-4 w-4 inline-block mr-1"}),s("markdownPreview.preview")]})]})}),A=(0,s.memo)(function(e){let{isMobile:t}=e,l=(0,a.c)("worktree");return(0,n.jsxs)("div",{"data-testid":"maximize-hint",className:"flex items-center justify-center px-4 py-1 bg-muted text-muted-foreground text-xs",children:[l("markdownPreview.exitFullscreenHint")," ",t&&l("markdownPreview.exitFullscreenHintSwipe")]})}),C=(0,s.memo)(function(e){let{onDismiss:t}=e,l=(0,a.c)("worktree");return(0,n.jsxs)("div",{"data-testid":"large-file-warning",className:"flex items-center gap-2 px-4 py-2 bg-warning-subtle border-b border-warning-border text-warning-foreground text-sm",children:[(0,n.jsx)(m.A,{className:"h-4 w-4"}),l("markdownPreview.largeFileWarning"),(0,n.jsx)("button",{onClick:t,className:"ml-auto text-warning hover:text-warning",children:(0,n.jsx)(p.A,{className:"h-4 w-4"})})]})})},34380:(e,t,l)=>{l.d(t,{B:()=>T});var n=l(95155),s=l(12115),a=l(18955),r=l(28019),i=l(54014),o=l(74385),d=l(50825),c=l(37381);function u(e){var t,l,n,s,a;let r=e.agentInstances&&e.agentInstances.length>0?e.agentInstances.map(e=>e.alias||e.cliTool):null!=(l=e.selectedAgents)?l:e.cliToolId?[e.cliToolId]:[];return{id:e.id,name:e.name,repositoryName:null!=(n=e.repositoryDisplayName)?n:e.repositoryName,syncedBranch:null!=(s=e.branch)?s:null,liveBranch:null!=(a=null==(t=e.gitStatus)?void 0:t.currentBranch)?a:null,dirty:e.gitStatus?e.gitStatus.isDirty:null,agents:[...new Set(r)],sessionRunning:!0===e.isSessionRunning}}let x={status:"loading",options:[]};async function m(e){let t=await fetch("/api/worktrees",{signal:e,headers:{Accept:"application/json"}});if(!t.ok)throw Error("HTTP ".concat(t.status));let l=await t.json(),n=null==l?void 0:l.worktrees;if(!Array.isArray(n))throw Error("Malformed worktree list");return n.map(u)}function p(e){let{selectedWorktreeId:t,onSelect:l,disabled:i=!1}=e,o=(0,a.c)("skills"),[d,u]=(0,s.useState)(x),[p,h]=(0,s.useState)(0);(0,s.useEffect)(()=>{let e=new AbortController;return u(x),m(e.signal).then(t=>{e.signal.aborted||u({status:"loaded",options:t})}).catch(()=>{e.signal.aborted||u({status:"error",options:[]})}),()=>e.abort()},[p]);let f=(0,s.useCallback)(()=>h(e=>e+1),[]);return"loading"===d.status?(0,n.jsxs)("div",{className:"space-y-2","data-testid":"skill-target-loading",children:[(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:o("target.loading")}),(0,n.jsx)(r.EA,{className:"h-24 w-full rounded-lg"})]}):"error"===d.status?(0,n.jsxs)(r.Zp,{className:"space-y-3","data-testid":"skill-target-error",children:[(0,n.jsx)(c.u,{tone:"danger",children:o("target.errorNotice")}),(0,n.jsx)(r.$n,{variant:"secondary",size:"sm",onClick:f,"data-testid":"skill-target-retry",children:o("target.retry")})]}):0===d.options.length?(0,n.jsx)(r.Zp,{"data-testid":"skill-target-empty",children:(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:o("target.empty")})}):(0,n.jsxs)("div",{className:"space-y-3","data-testid":"skill-target-selector",children:[(0,n.jsx)("div",{role:"radiogroup","aria-label":o("target.heading"),className:"space-y-2",children:d.options.map(e=>(0,n.jsx)(g,{option:e,selected:e.id===t,disabled:i,onSelect:l},e.id))}),(0,n.jsx)(c.u,{tone:"neutral","data-testid":"skill-target-branch-notice",children:o("target.branchFreshnessNotice")})]})}function g(e){var t;let{option:l,selected:s,disabled:i,onSelect:o}=e,d=(0,a.c)("skills"),c=null!=(t=l.liveBranch)?t:l.syncedBranch;return(0,n.jsxs)("button",{type:"button",role:"radio","aria-checked":s,disabled:i,onClick:()=>o(l.id),"data-testid":"skill-target-option-".concat(l.id),className:"w-full rounded-lg border px-3 py-2.5 text-left transition-colors disabled:cursor-not-allowed disabled:opacity-60 ".concat(s?"border-accent-500 bg-accent-50 dark:bg-accent-950/40":"border-border bg-card hover:bg-muted"),children:[(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,n.jsx)("span",{className:"text-sm font-semibold text-foreground break-all",children:l.name}),s&&(0,n.jsx)(r.Ex,{variant:"info",children:d("target.selected")})]}),(0,n.jsxs)("dl",{className:"mt-1.5 grid grid-cols-1 gap-x-4 gap-y-1 sm:grid-cols-2",children:[(0,n.jsx)(h,{label:d("target.repository"),children:l.repositoryName}),(0,n.jsx)(h,{label:d("target.branch"),children:null!=c?c:d("target.branchUnknown")}),(0,n.jsx)(h,{label:d("target.agents"),children:l.agents.length>0?l.agents.join(", "):d("target.agentsNone")}),(0,n.jsx)(h,{label:d("target.workingTree"),children:d(null===l.dirty?"target.workingTreeUnknown":l.dirty?"target.workingTreeDirty":"target.workingTreeClean")})]}),l.sessionRunning&&(0,n.jsx)("p",{className:"mt-1.5 text-xs text-muted-foreground","data-testid":"skill-target-session-".concat(l.id),children:d("target.sessionRunning")})]})}function h(e){let{label:t,children:l}=e;return(0,n.jsxs)("div",{className:"min-w-0",children:[(0,n.jsx)("dt",{className:"text-xs font-medium text-muted-foreground",children:t}),(0,n.jsx)("dd",{className:"text-xs text-foreground break-words",children:l})]})}var f=l(95584);function k(e){let{label:t,children:l}=e;return(0,n.jsxs)("div",{className:"min-w-0",children:[(0,n.jsx)("dt",{className:"text-xs font-medium text-muted-foreground",children:t}),(0,n.jsx)("dd",{className:"mt-0.5 break-words text-sm text-foreground",children:l})]})}function j(e){let{level:t,kind:l,label:s}=e,i=(0,a.c)("skills");return(0,n.jsxs)(r.Ex,{variant:f.eK[t],"data-testid":"skill-plan-risk-".concat(l,"-").concat(t),children:[s,": ",i(f.pP[t])]})}function b(e){let{entry:t}=e,l=(0,a.c)("skills"),s=f.KL[t.reason];return(0,n.jsxs)("li",{className:"space-y-1.5 rounded-md border border-border px-3 py-2","data-testid":"skill-plan-file-".concat(t.path),children:[(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,n.jsx)(r.Ex,{variant:f.tC[t.change],children:l(f.AS[t.change])}),(0,n.jsx)("span",{className:"break-all font-mono text-xs text-foreground",children:t.path}),t.generated&&(0,n.jsx)(r.Ex,{variant:"gray",children:l("plan.fileGenerated")})]}),s&&(0,n.jsx)("p",{className:"text-xs text-muted-foreground",children:l(s)}),t.gitIgnored&&(0,n.jsx)("p",{className:"text-xs text-warning-foreground",children:l("plan.gitIgnored")}),t.binary?(0,n.jsx)("p",{className:"text-xs text-muted-foreground",children:l("plan.diffBinary")}):t.diff?(0,n.jsxs)("details",{children:[(0,n.jsx)("summary",{className:"cursor-pointer text-xs text-accent-600 dark:text-accent-400",children:l("plan.diffToggle",{additions:t.additions,deletions:t.deletions})}),(0,n.jsx)("pre",{className:"mt-1 overflow-x-auto rounded bg-muted p-2 font-mono text-[11px] leading-snug text-foreground",children:t.diff}),t.diffTruncated&&(0,n.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:l("plan.diffTruncated")})]}):null]})}function y(e){var t,l,s;let{plan:i}=e,o=(0,a.c)("skills"),{target:d,skill:u}=i,x=u.compatibility.commandmate;return(0,n.jsxs)(r.Zp,{className:"space-y-4","data-testid":"skill-install-plan",children:[(0,n.jsxs)("div",{className:"space-y-1",children:[(0,n.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:o("plan.heading")}),(0,n.jsx)("p",{className:"text-xs text-muted-foreground",children:o("plan.expiresAt",{timestamp:i.expiresAt})})]}),(0,n.jsxs)("section",{className:"space-y-2",children:[(0,n.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:o("plan.targetHeading")}),(0,n.jsxs)("dl",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[(0,n.jsx)(k,{label:o("target.repository"),children:d.repositoryName}),(0,n.jsx)(k,{label:o("target.heading"),children:d.worktreeName}),(0,n.jsx)(k,{label:o("target.branch"),children:null!=(t=d.branch)?t:o("target.branchUnknown")}),(0,n.jsx)(k,{label:o("plan.headStateLabel"),children:o(null!=(l=f.kF[d.headState])?l:"plan.headState.unknown")}),(0,n.jsx)(k,{label:o("target.workingTree"),children:d.workingTreeDirty?o("target.workingTreeDirty"):o("target.workingTreeClean")}),(0,n.jsx)(k,{label:o("plan.installRoot"),children:(0,n.jsx)("span",{className:"break-all font-mono text-xs",children:(d.installRoots&&d.installRoots.length>0?d.installRoots:[d.installRoot]).map(e=>(0,n.jsx)("span",{className:"block",children:e},e))})}),(0,n.jsx)(k,{label:o("plan.existingInstall"),children:d.existingInstall?o("plan.existingInstallVersion",{version:d.existingInstall.version}):o("plan.existingInstallNone")}),(0,n.jsx)(k,{label:o("detail.recommendedVersion"),children:(0,n.jsx)("span",{className:"font-mono text-xs",children:u.version})})]})]}),(0,n.jsxs)("section",{className:"space-y-2","data-testid":"skill-plan-risk-section",children:[(0,n.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:o("plan.riskHeading")}),(0,n.jsxs)("div",{className:"flex flex-wrap gap-1.5",children:[(0,n.jsx)(j,{level:u.declaredRisk,kind:"declared",label:o("plan.riskDeclared")}),(0,n.jsx)(j,{level:u.computedRisk,kind:"computed",label:o("plan.riskComputed")}),(0,n.jsx)(j,{level:u.effectiveRisk,kind:"effective",label:o("plan.riskEffective")})]}),(0,n.jsx)("p",{className:"break-words text-sm text-foreground",children:u.riskRationale}),(0,n.jsx)(c.u,{tone:"neutral",children:o("plan.riskNotice")})]}),(0,n.jsxs)("section",{className:"space-y-2","data-testid":"skill-plan-permissions",children:[(0,n.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:o("permissions.heading")}),u.declaredPermissions.length>0?(0,n.jsx)("div",{className:"flex flex-wrap gap-1.5",children:u.declaredPermissions.map(e=>(0,n.jsx)(r.Ex,{variant:"warning",children:f.z2[e]?o(f.z2[e]):e},e))}):(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:o("plan.permissionsNone")}),(0,n.jsx)(c.u,{tone:"warning",children:o("permissions.declarationOnlyNotice")})]}),(0,n.jsxs)("section",{className:"space-y-2","data-testid":"skill-plan-requirements",children:[(0,n.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:o("requirements.heading")}),0===u.requirements.commands.length&&0===u.requirements.networkHosts.length?(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:o("plan.requirementsNone")}):(0,n.jsxs)("dl",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[u.requirements.commands.length>0&&(0,n.jsx)(k,{label:o("plan.requirementsCommands"),children:u.requirements.commands.map(e=>{var t;return"".concat(e.name," ").concat(null!=(t=e.versionRange)?t:o("plan.commandAnyVersion"))}).join(", ")}),u.requirements.networkHosts.length>0&&(0,n.jsx)(k,{label:o("plan.requirementsHosts"),children:u.requirements.networkHosts.join(", ")})]})]}),(0,n.jsxs)("section",{className:"space-y-2","data-testid":"skill-plan-scripts",children:[(0,n.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:o("plan.scriptsHeading")}),0===u.executablePaths.length&&0===u.scriptPaths.length?(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:o("plan.scriptsNone")}):(0,n.jsx)("ul",{className:"space-y-1",children:[...new Set([...u.scriptPaths,...u.executablePaths])].map(e=>(0,n.jsx)("li",{className:"break-all font-mono text-xs text-foreground",children:e},e))})]}),"compatible"!==x.status&&(0,n.jsx)(c.u,{tone:"warning","data-testid":"skill-plan-compatibility-notice",children:o((0,f.e5)(x.messageKey),{range:x.requiredRange,currentVersion:null!=(s=x.currentVersion)?s:""})}),i.warnings.length>0&&(0,n.jsxs)("section",{className:"space-y-2","data-testid":"skill-plan-warnings",children:[(0,n.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:o("plan.warningsHeading")}),(0,n.jsx)("ul",{className:"space-y-1",children:i.warnings.map(e=>(0,n.jsx)("li",{className:"text-xs text-warning-foreground",children:f.RO[e]?o(f.RO[e]):e},e))})]}),(0,n.jsxs)("section",{className:"space-y-2","data-testid":"skill-plan-files",children:[(0,n.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:o("plan.filesHeading")}),(0,n.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"skill-plan-stats",children:o("plan.stats",{added:i.stats.added,modified:i.stats.modified,unchanged:i.stats.unchanged,conflicted:i.stats.conflicted,unmanaged:i.stats.unmanaged})}),0===i.files.length?(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:o("plan.filesEmpty")}):(0,n.jsx)("ul",{className:"space-y-2",children:i.files.map(e=>(0,n.jsx)(b,{entry:e},e.path))})]}),i.blockers.length>0&&(0,n.jsxs)("section",{className:"space-y-2","data-testid":"skill-install-blockers",children:[(0,n.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-danger-foreground",children:o("plan.blockersHeading")}),(0,n.jsx)("ul",{className:"space-y-1",children:i.blockers.map(e=>{var t,l;return(0,n.jsxs)("li",{className:"text-xs text-danger-foreground",children:[e.path&&(0,n.jsx)("span",{className:"mr-1 break-all font-mono",children:e.path}),e.code.startsWith("skills.")?o((0,f.e5)(e.code),{range:x.requiredRange,currentVersion:null!=(t=x.currentVersion)?t:""}):f.KL[e.code]?o(f.KL[e.code]):e.code]},"".concat(e.code,":").concat(null!=(l=e.path)?l:""))})}),(0,n.jsx)(c.u,{tone:"danger",children:o("plan.blockedNotice")})]})]})}function N(e){let{entry:t}=e,l=(0,a.c)("skills"),s=f.Mj[t.disposition],i=f.hJ[t.reason];return(0,n.jsxs)("li",{className:"flex flex-wrap items-center gap-2","data-testid":"skill-uninstall-file-".concat(t.path),children:[(0,n.jsx)(r.Ex,{variant:"remove"===t.disposition?"info":"warning",children:s?l(s):t.disposition}),(0,n.jsx)("span",{className:"break-all font-mono text-xs text-foreground",children:t.path}),i&&(0,n.jsx)("span",{className:"text-xs text-muted-foreground",children:l(i)})]})}function v(e){var t;let{plan:l}=e,s=(0,a.c)("skills"),{target:o,skill:d}=l;return(0,n.jsxs)(r.Zp,{className:"space-y-4","data-testid":"skill-uninstall-plan",children:[(0,n.jsxs)("div",{className:"space-y-1",children:[(0,n.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:s("uninstall.heading")}),(0,n.jsx)("p",{className:"text-xs text-muted-foreground",children:s("uninstall.expiresAt",{timestamp:l.expiresAt})})]}),(0,n.jsxs)("dl",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[(0,n.jsx)(k,{label:s("target.repository"),children:o.repositoryName}),(0,n.jsx)(k,{label:s("target.heading"),children:o.worktreeName}),(0,n.jsx)(k,{label:s("target.branch"),children:null!=(t=o.branch)?t:s("target.branchUnknown")}),(0,n.jsx)(k,{label:s("uninstall.installedVersion"),children:(0,n.jsx)("span",{className:"font-mono text-xs",children:d.version||s("uninstall.versionUnknown")})}),(0,n.jsx)(k,{label:s("plan.installRoot"),children:(0,n.jsx)("span",{className:"break-all font-mono text-xs",children:o.installRoot})}),(0,n.jsx)(k,{label:s("target.workingTree"),children:o.workingTreeDirty?s("target.workingTreeDirty"):s("target.workingTreeClean")})]}),(0,n.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"skill-uninstall-stats",children:s("uninstall.stats",{removable:l.stats.removable,modified:l.stats.modified,missing:l.stats.missing,unknown:l.stats.unknown,irregular:l.stats.irregular})}),(0,n.jsxs)("section",{className:"space-y-2",children:[(0,n.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:s("uninstall.removalsHeading")}),0===l.removals.length?(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:s("uninstall.removalsEmpty")}):(0,n.jsx)("ul",{className:"space-y-1.5",children:l.removals.map(e=>(0,n.jsx)(N,{entry:e},e.path))})]}),(0,n.jsxs)("section",{className:"space-y-2",children:[(0,n.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:s("uninstall.retainedHeading")}),0===l.retained.length?(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:s("uninstall.retainedEmpty")}):(0,n.jsx)("ul",{className:"space-y-1.5",children:l.retained.map(e=>(0,n.jsx)(N,{entry:e},e.path))})]}),(0,n.jsxs)("div",{className:"space-y-2",children:[l.skill.agents.length>0&&(0,n.jsx)("div",{className:"flex flex-wrap gap-1.5","data-testid":"skill-uninstall-agents",children:l.skill.agents.map(e=>(0,n.jsx)(r.Ex,{variant:"gray",children:(0,i.f_)(e.agent)},e.agent))}),(0,n.jsx)(c.u,{tone:"neutral",children:s((0,f.e5)(l.nextActionKey))})]}),l.blockers.length>0&&(0,n.jsxs)("section",{className:"space-y-2","data-testid":"skill-uninstall-blockers",children:[(0,n.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-danger-foreground",children:s("uninstall.blockersHeading")}),(0,n.jsx)("ul",{className:"space-y-1",children:l.blockers.map(e=>{var t;return(0,n.jsxs)("li",{className:"text-xs text-danger-foreground",children:[e.path&&(0,n.jsx)("span",{className:"mr-1 break-all font-mono",children:e.path}),s((0,f.e5)(e.messageKey))]},"".concat(e.code,":").concat(null!=(t=e.path)?t:""))})})]})]})}var w=l(80130);let R={worktreeId:null,busy:null,installPlan:null,uninstallPlan:null,installResult:null,uninstallResult:null,riskAcknowledged:!1,failure:null};function A(e){return{...e,installPlan:null,uninstallPlan:null,installResult:null,uninstallResult:null,riskAcknowledged:!1,failure:null}}function C(e,t){return"".concat(e,"-").concat(t)}function I(e){let{failure:t}=e,l=(0,a.c)("skills");return(0,n.jsxs)("div",{className:"space-y-2","data-testid":"skill-operation-error",children:[(0,n.jsxs)(c.u,{tone:"danger",children:[(0,n.jsx)("p",{className:"font-medium",children:l("operation.errorHeading")}),(0,n.jsx)("p",{className:"mt-1",children:l((0,f.FW)(t.code))}),(0,n.jsx)("p",{className:"mt-1 break-words",children:l("state.errorCode",{code:t.code})})]}),t.nextActionKey&&(0,n.jsx)(c.u,{tone:"warning",children:l((0,f.e5)(t.nextActionKey))}),t.blockers&&t.blockers.length>0&&(0,n.jsx)("ul",{className:"space-y-1","data-testid":"skill-operation-error-blockers",children:t.blockers.map(e=>{var t;return(0,n.jsxs)("li",{className:"text-xs text-danger-foreground",children:[e.path&&(0,n.jsx)("span",{className:"mr-1 break-all font-mono",children:e.path}),l((0,f.e5)(e.messageKey))]},"".concat(e.code,":").concat(null!=(t=e.path)?t:""))})})]})}function P(e){let{agents:t,skillId:l,version:s}=e,r=(0,a.c)("skills");return 0===t.length?null:(0,n.jsxs)("div",{className:"space-y-1","data-testid":"skill-operation-reload",children:[(0,n.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:r("operation.reloadHeading")}),(0,n.jsx)("ul",{className:"space-y-1",children:t.map(e=>(0,n.jsx)("li",{className:"text-xs text-muted-foreground",children:r((0,f.e5)(e.messageKey),{agent:(0,i.f_)(e.agent),skillId:l,version:s})},e.agent))})]})}function T(e){var t;let{skillId:l,version:i,blockedReason:u,worktreeId:x,agents:m=[]}=e,g=(0,a.c)("skills"),[h,k]=(0,s.useState)(()=>x?{...R,worktreeId:x}:R),j=(0,s.useCallback)(e=>{k(t=>t.worktreeId===e?t:A({...t,worktreeId:e,busy:null}))},[]);(0,s.useEffect)(()=>{x&&j(x)},[x,j]);let b=(0,s.useCallback)(async()=>{let e=h.worktreeId;if(!e)return;k(e=>({...A(e),busy:"install-plan"}));let t=await (0,w.Q6)(e,l,{version:null!=i?i:void 0});k(e=>({...e,busy:null,installPlan:t.ok?t.data.plan:null,failure:t.ok?null:t.failure}))},[l,h.worktreeId,i]),N=(0,s.useCallback)(async()=>{let e=h.worktreeId,t=h.installPlan;if(!e||!t||t.requiresRiskAcknowledgement&&!h.riskAcknowledged)return;k(e=>({...e,busy:"install-apply",failure:null}));let n=await (0,w.Xi)(e,l,{planToken:t.token,version:t.skill.version,acknowledgeRisk:!!t.requiresRiskAcknowledgement||void 0,idempotencyKey:C("skill-install",t.token)});n.ok&&(0,o.k)(e),k(e=>({...e,busy:null,installPlan:n.ok?null:e.installPlan,installResult:n.ok?n.data:null,failure:n.ok?null:n.failure}))},[l,h.installPlan,h.riskAcknowledged,h.worktreeId]),T=(0,s.useCallback)(async()=>{let e=h.worktreeId;if(!e)return;k(e=>({...A(e),busy:"uninstall-plan"}));let t=await (0,w.hN)(e,l);k(e=>({...e,busy:null,uninstallPlan:t.ok?t.data.plan:null,failure:t.ok?null:t.failure}))},[l,h.worktreeId]),E=(0,s.useCallback)(async()=>{let e=h.worktreeId,t=h.uninstallPlan;if(!e||!t)return;k(e=>({...e,busy:"uninstall-apply",failure:null}));let n=await (0,w.E)(e,l,{planToken:t.token,idempotencyKey:C("skill-uninstall",t.token)});k(e=>({...e,busy:null,uninstallPlan:n.ok?null:e.uninstallPlan,uninstallResult:n.ok?n.data:null,failure:n.ok?null:n.failure}))},[l,h.uninstallPlan,h.worktreeId]),K=(0,s.useCallback)(()=>{k(e=>A(e))},[]),H=null!==h.busy,S=h.installPlan,W=h.uninstallPlan,q=null!=u?u:g(h.worktreeId?"plan.ready":"plan.chooseTarget"),z=null!==S&&S.requiresRiskAcknowledgement&&!h.riskAcknowledged;return(0,n.jsxs)("div",{className:"space-y-3","data-testid":"skill-install-panel",children:[!x&&(0,n.jsx)(p,{selectedWorktreeId:h.worktreeId,onSelect:j,disabled:H}),(0,n.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,n.jsx)(r.$n,{variant:"primary",disabled:H||null!==u||!h.worktreeId,onClick:b,"data-testid":"skill-install-action","aria-describedby":"skill-install-reason",children:g("install-plan"===h.busy?"plan.building":"plan.build")}),(0,n.jsx)(r.$n,{variant:"secondary",disabled:H||!h.worktreeId,onClick:T,"data-testid":"skill-uninstall-action",children:g("uninstall-plan"===h.busy?"uninstall.building":"uninstall.build")})]}),(0,n.jsx)("p",{id:"skill-install-reason",className:"text-sm text-muted-foreground","data-testid":"skill-install-reason",children:q}),m.length>0&&(0,n.jsxs)("div",{className:"space-y-1","data-testid":"skill-install-reload-preview",children:[(0,n.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:g("operation.reloadHeading")}),(0,n.jsx)("ul",{className:"space-y-1",children:m.map(e=>(0,n.jsx)(d.m,{agent:e,variant:"reload"},e.agent))})]}),h.failure&&(0,n.jsx)(I,{failure:h.failure}),S&&(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsx)(y,{plan:S}),S.requiresRiskAcknowledgement&&(0,n.jsxs)(r.Zp,{className:"space-y-3","data-testid":"skill-install-risk-acknowledgement",children:[(0,n.jsx)(c.u,{tone:"danger",children:g((0,f.e5)(null!=(t=S.riskAcknowledgementMessageKey)?t:"skills.plan.highRiskAcknowledgement"))}),(0,n.jsxs)("label",{className:"flex items-start gap-2 text-sm text-foreground",children:[(0,n.jsx)(r.Sc,{checked:h.riskAcknowledged,onCheckedChange:e=>k(t=>({...t,riskAcknowledged:!0===e})),disabled:H,"data-testid":"skill-install-risk-checkbox",className:"mt-0.5"}),(0,n.jsx)("span",{children:g("plan.acknowledgeLabel")})]})]}),(0,n.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,n.jsx)(r.$n,{variant:S.requiresRiskAcknowledgement?"danger":"primary",disabled:H||!S.installable||z,onClick:N,"data-testid":"skill-install-confirm",children:g("install-apply"===h.busy?"plan.confirming":"plan.confirm")}),(0,n.jsx)(r.$n,{variant:"ghost",disabled:H,onClick:K,"data-testid":"skill-install-discard",children:g("plan.discard")})]})]}),W&&(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsx)(v,{plan:W}),(0,n.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,n.jsx)(r.$n,{variant:"danger",disabled:H||!W.removable,onClick:E,"data-testid":"skill-uninstall-confirm",children:g("uninstall-apply"===h.busy?"uninstall.confirming":"uninstall.confirm")}),(0,n.jsx)(r.$n,{variant:"ghost",disabled:H,onClick:K,"data-testid":"skill-uninstall-discard",children:g("plan.discard")})]})]}),h.installResult&&(0,n.jsxs)(r.Zp,{className:"space-y-3","data-testid":"skill-install-result",children:[(0,n.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:g("operation.installedHeading")}),(0,n.jsx)(c.u,{tone:"info",children:g((0,f.e5)(h.installResult.operation.nextActionKey))}),h.installResult.operation.replayed&&(0,n.jsx)(c.u,{tone:"neutral","data-testid":"skill-operation-replayed",children:g("operation.replayNotice")}),h.installResult.install&&"files"in h.installResult.install&&(0,n.jsx)("p",{className:"text-xs text-muted-foreground",children:g("operation.filesWritten",{count:h.installResult.install.files.length})}),"reload"in h.installResult&&(0,n.jsx)(P,{agents:h.installResult.reload.agents,skillId:h.installResult.reload.skillId,version:h.installResult.reload.version}),(0,n.jsx)(r.$n,{variant:"secondary",size:"sm",onClick:K,"data-testid":"skill-operation-reset",children:g("operation.startOver")})]}),h.uninstallResult&&(0,n.jsxs)(r.Zp,{className:"space-y-3","data-testid":"skill-uninstall-result",children:[(0,n.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:g("operation.uninstalledHeading")}),(0,n.jsx)(c.u,{tone:"info",children:g((0,f.e5)(h.uninstallResult.operation.nextActionKey))}),h.uninstallResult.operation.replayed&&(0,n.jsx)(c.u,{tone:"neutral","data-testid":"skill-operation-replayed",children:g("operation.replayNotice")}),h.uninstallResult.uninstall&&"removedFiles"in h.uninstallResult.uninstall&&(0,n.jsx)("p",{className:"text-xs text-muted-foreground",children:g("operation.filesRemoved",{count:h.uninstallResult.uninstall.removedFiles.length})}),"reload"in h.uninstallResult&&(0,n.jsx)(P,{agents:h.uninstallResult.reload.agents,skillId:h.uninstallResult.reload.skillId,version:h.uninstallResult.reload.version}),(0,n.jsx)(r.$n,{variant:"secondary",size:"sm",onClick:K,"data-testid":"skill-operation-reset",children:g("operation.startOver")})]})]})}},50666:(e,t,l)=>{l.d(t,{Ck:()=>r});var n=l(95155),s=l(12115),a=l(53482);function r(e){let{children:t,as:l="div",className:r=""}=e,i=function e(t){return null==t||"boolean"==typeof t?"":"string"==typeof t?t:"number"==typeof t?String(t):Array.isArray(t)?t.map(e).join(""):s.isValidElement(t)?e(t.props.children):""}(t);if(!i||0===i.trim().length)return(0,n.jsx)(l,{className:r||void 0,children:t});let o="relative group ".concat("span"===l?"block ":"").concat(r).trim();return(0,n.jsxs)(l,{className:o,"data-testid":"code-block-with-copy",children:[t,(0,n.jsx)(a.i,{text:i,className:"absolute right-2 top-2 z-10 opacity-100 md:opacity-0 md:group-hover:opacity-100 md:group-focus-within:opacity-100 focus:opacity-100"})]})}},50825:(e,t,l)=>{l.d(t,{m:()=>d});var n=l(95155);l(12115);var s=l(18955),a=l(54014),r=l(37381),i=l(95584);function o(e){let{axis:t,agentName:l}=e,a=(0,s.c)("skills");return(0,n.jsxs)("li",{className:"text-xs text-muted-foreground","data-testid":"skill-agent-axis-".concat(t.axis),children:[(0,n.jsx)("span",{className:"font-medium text-foreground",children:a((0,i.e5)(t.axisKey))}),": ",(0,n.jsx)("span",{"data-testid":"skill-agent-axis-".concat(t.axis,"-").concat(t.outcome),children:a((0,i.e5)(t.outcomeKey))})," — ",a((0,i.e5)(t.evidenceKindKey)),t.limitationKey&&(0,n.jsx)("span",{className:"mt-0.5 block","data-testid":"skill-agent-axis-".concat(t.axis,"-limitation"),children:a((0,i.e5)(t.limitationKey),{agent:l})})]})}function d(e){var t;let{agent:l,variant:d="full"}=e,c=(0,s.c)("skills"),u=(0,a.f_)(l.agent),x=l.measured;return"reload"===d?(0,n.jsx)("li",{className:"text-xs text-muted-foreground","data-testid":"skill-agent-reload-".concat(l.agent),children:c((0,i.e5)(l.reloadKey),{agent:u})}):(0,n.jsxs)("div",{className:"space-y-1","data-testid":"skill-agent-evidence-".concat(l.agent),children:[(0,n.jsx)("p",{className:"text-xs font-medium text-foreground",children:u}),(0,n.jsx)("p",{className:"text-xs text-muted-foreground break-words",children:c("compatibility.declaredLabel",{support:c((0,i.e5)(l.declaredLabelKey))})}),(0,n.jsxs)("p",{className:"text-xs text-muted-foreground break-words",children:[c("compatibility.evidence"),": ",l.evidence]}),(0,n.jsx)("p",{className:"text-xs text-muted-foreground break-words","data-testid":"skill-agent-verification-".concat(l.agent),children:c((0,i.e5)(l.verificationKey))}),x?(0,n.jsxs)("div",{className:"space-y-0.5 border-l-2 border-border pl-2",children:[(0,n.jsx)("p",{className:"text-xs font-medium text-foreground",children:c("compatibility.measuredHeading")}),(0,n.jsxs)("ul",{className:"space-y-0.5",children:[(0,n.jsx)(o,{axis:x.discovery,agentName:u}),(0,n.jsx)(o,{axis:x.invocation,agentName:u})]}),x.testedVersion&&(0,n.jsx)("p",{className:"text-xs text-muted-foreground",children:c("compatibility.testedVersion",{agent:u,version:x.testedVersion})}),x.testedDate&&(0,n.jsx)("p",{className:"text-xs text-muted-foreground",children:c("compatibility.testedDate",{date:x.testedDate})}),x.discoveryRoots.length>0&&(0,n.jsx)("p",{className:"text-xs text-muted-foreground break-all",children:c("compatibility.discoveryRoots",{roots:x.discoveryRoots.join(", ")})}),x.evidenceSource&&(0,n.jsxs)("p",{className:"text-xs text-muted-foreground break-all",children:[c("compatibility.evidenceSource"),": ",x.evidenceSource]}),x.stale&&(0,n.jsx)(r.u,{tone:"warning","data-testid":"skill-agent-evidence-stale-".concat(l.agent),children:c("compatibility.evidenceStale",{days:null!=(t=x.ageDays)?t:0})})]}):l.skipReasonKey&&(0,n.jsx)("p",{className:"text-xs text-muted-foreground break-words","data-testid":"skill-agent-skip-reason-".concat(l.agent),children:c((0,i.e5)(l.skipReasonKey))}),(0,n.jsxs)("p",{className:"text-xs text-muted-foreground break-words",children:[(0,n.jsx)("span",{className:"font-medium text-foreground",children:c("compatibility.reloadHeading",{agent:u})}),": ",c((0,i.e5)(l.reloadKey),{agent:u})]})]})}},53482:(e,t,l)=>{l.d(t,{i:()=>d});var n=l(95155),s=l(12115),a=l(60322),r=l(9900);function i(){return(0,n.jsx)("svg",{className:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})}function o(){return(0,n.jsx)("svg",{className:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})}function d(e){let{text:t,className:l="",label:d="Copy"}=e,[c,u]=(0,s.useState)(!1),x=(0,s.useRef)(null);(0,s.useEffect)(()=>()=>{x.current&&clearTimeout(x.current)},[]);let m=(0,s.useCallback)(async()=>{try{await (0,a.l)(t),u(!0),x.current&&clearTimeout(x.current),x.current=setTimeout(()=>u(!1),r.s7)}catch(e){}},[t]);return(0,n.jsxs)("button",{type:"button",onClick:m,className:"inline-flex items-center gap-1 rounded border border-border bg-surface px-2 py-0.5 text-[11px] font-medium text-foreground transition-colors hover:bg-muted ".concat(l),"aria-label":c?"Copied":d,title:c?"Copied!":d,children:[c?(0,n.jsx)(o,{}):(0,n.jsx)(i,{}),(0,n.jsx)("span",{children:c?"Copied":d})]})}},60322:(e,t,l)=>{l.d(t,{l:()=>s});let n=/\x1b\[[0-9;]*[a-zA-Z]|\x1b\][^\x07]*\x07|\[[0-9;]*m/g;async function s(e){var t;if(!e||0===e.trim().length)return;let l=e.replace(n,"");if(null==(t=navigator.clipboard)?void 0:t.writeText)try{await navigator.clipboard.writeText(l);return}catch(e){}let s=document.createElement("textarea");s.value=l,s.style.position="fixed",s.style.left="-9999px",s.style.top="-9999px",s.style.opacity="0",document.body.appendChild(s),s.focus(),s.select();try{document.execCommand("copy")}finally{document.body.removeChild(s)}}},69352:(e,t,l)=>{l.d(t,{WU:()=>d,d3:()=>c,dj:()=>o,uO:()=>u});var n,s,a,r,i=l(9567);function o(e){return e.startsWith("#")?"anchor":e.startsWith("http://")||e.startsWith("https://")||e.startsWith("mailto:")||e.startsWith("tel:")?"external":"relative"}function d(e,t){if(!t)return null;let l=e.substring(0,e.lastIndexOf("/")+1);try{let e=new URL(l,"file:///"),n=new URL(t,e),s=decodeURIComponent(n.pathname);if(s.startsWith("/")){let e=s.substring(1);if(e.length>0)return e}}catch(e){}return null}function c(e){return!e||0===e.length||e.length>2048||/[\x00-\x1f\x7f]/.test(e)?null:e}let u={...i.j,attributes:{...i.j.attributes,a:[...(null!=(a=null==(n=i.j.attributes)?void 0:n.a)?a:[]).filter(e=>"href"!==e),["href",/^(?:#|mailto:|tel:|https?:\/\/|(?![a-zA-Z][a-zA-Z0-9+.-]*:))/]],img:[...(null!=(r=null==(s=i.j.attributes)?void 0:s.img)?r:[]).filter(e=>"src"!==e),["src",/^(?:https?:\/\/|(?![a-zA-Z][a-zA-Z0-9+.-]*:))/],"alt","width","height"]}}},74385:(e,t,l)=>{l.d(t,{I:()=>n,k:()=>s});let n="skill:installed";function s(e){window.dispatchEvent(new CustomEvent(n,{detail:{worktreeId:e}}))}},75333:(e,t,l)=>{l.d(t,{Xz:()=>d,qW:()=>c,uE:()=>u});var n=l(95155);l(12115);var s=l(18955),a=l(77801),r=l(28019),i=l(54014),o=l(95584);function d(e){let{status:t,className:l}=e,a=(0,s.c)("skills");return(0,n.jsx)(r.Ex,{variant:o.H$[t],className:l,"data-testid":"skill-compatibility-".concat(t),children:a(o.OV[t])})}function c(e){let{risk:t,className:l}=e,i=(0,s.c)("skills");return(0,n.jsxs)(r.Ex,{variant:o.eK[t],className:l,"data-testid":"skill-declared-risk-".concat(t),children:["high"===t&&(0,n.jsx)(a.A,{size:12,"aria-hidden":"true",className:"mr-1 shrink-0"}),i("risk.declaredLabel",{level:i(o.pP[t])})]})}function u(e){let{agent:t}=e,l=(0,s.c)("skills");return(0,n.jsxs)(r.Ex,{variant:o.Et[t.support],"data-testid":"skill-agent-".concat(t.agent,"-").concat(t.support),children:[(0,i.f_)(t.agent),": ",l((0,o.e5)(t.labelKey))]})}},76246:(e,t,l)=>{l.d(t,{o:()=>n});function n(e){return e?e.split("/").map(encodeURIComponent).join("/"):""}},99112:(e,t,l)=>{l.d(t,{eT:()=>d});var n=l(22133);let s=["**","__"],a=/^https?:\/\/./i;function r(e){return"object"==typeof e&&null!==e&&"string"==typeof e.type}function i(e,t){var l,n;let s=e.position;if(!s)return null;let a=null==(l=s.start)?void 0:l.offset,r=null==(n=s.end)?void 0:n.offset;return"number"!=typeof a||"number"!=typeof r||!Number.isInteger(a)||!Number.isInteger(r)||a<0||r<a||r>t.length?null:{start:a,end:r}}function o(e,t){var l;return{line:e.line,column:e.column+t,offset:(null!=(l=e.offset)?l:0)+t}}let d=Object.freeze([n.A,function(){return function(e,t){let l=function(e){if("string"==typeof e)return e;if("object"==typeof e&&null!==e){let t=e.value;if("string"==typeof t)return t}return null}(t);null!==l&&r(e)&&function e(t,l){let n=Array.isArray(t.children)?t:null;if(n)for(let t of(!function(e,t){let l=e.children;for(let e=0;e<l.length;e+=1){var n,d,c,u,x,m,p;let g=l[e];if(!r(g)||!function(e,t){if("link"!==e.type||null!==e.title&&void 0!==e.title)return!1;let l=e.url;if("string"!=typeof l||!a.test(l))return!1;let n=i(e,t);if(!n||t.slice(n.start,n.end)!==l)return!1;let s=e.children;if(!Array.isArray(s)||1!==s.length)return!1;let o=s[0];if(!r(o)||"text"!==o.type||o.value!==l)return!1;let d=i(o,t);return null!==d&&d.start===n.start&&d.end===n.end}(g,t))continue;let h=function(e){let t=function(e){for(let t=0;t<e.length;t+=1)if("()、。「」【】".includes(e[t]))return t;return -1}(e);if(t<=0)return null;let l=e.slice(0,t),n=s.find(e=>l.endsWith(e)),r=n?t-n.length:t;if(r<=0)return null;let i=e.slice(0,r);return a.test(i)?{keptUrl:i,tailText:e.slice(r),tailOffset:r,delimiter:null!=n?n:null}:null}(g.url);if(!h)continue;let f=i(g,t),k=null==(n=g.position)?void 0:n.start,j=null==(d=g.position)?void 0:d.end;if(!f||!k||!j)continue;let b=null!==h.delimiter&&function(e,t,l,n){if(!e||"text"!==e.type||"string"!=typeof e.value||!e.value.endsWith(t))return!1;let s=i(e,n);if(!s||s.end!==l)return!1;let a=n.slice(s.start,s.end);if(!a.endsWith(t))return!1;let r=a.length-t.length-1;return r<0||"\\"!==a[r]}(l[e-1],h.delimiter,f.start,t),y=b?h.tailText.slice(null!=(m=null==(c=h.delimiter)?void 0:c.length)?m:0):h.tailText,N=b?h.tailOffset+(null!=(p=null==(u=h.delimiter)?void 0:u.length)?p:0):h.tailOffset,v=o(k,h.keptUrl.length);g.url=h.keptUrl;let w=null==(x=g.children)?void 0:x[0];w&&(w.value=h.keptUrl,w.position={start:{...k},end:{...v}}),g.position={start:{...k},end:v};let R={type:"text",value:y,position:{start:o(k,N),end:{...j}}};if(b&&h.delimiter){let t=l[e-1],n=o(k,-h.delimiter.length),s={type:"strong",children:[g],position:{start:n,end:o(k,N)}},a=t.value.slice(0,-h.delimiter.length);0===a.length?(l.splice(e-1,1),e-=1):(t.value=a,t.position&&(t.position={...t.position,end:n})),l[e]=s}l.splice(e+1,0,R),e+=1}}(n,l),n.children))r(t)&&e(t,l)}(e,l)}}])},99648:(e,t,l)=>{l.d(t,{Co:()=>n,Ms:()=>a,td:()=>s});let n=".agents/skills",s=".claude/skills",a="skills.permissions.declarationOnlyNotice"}}]);