commandmate 0.43.0 → 0.44.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (531) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-build-manifest.json +357 -361
  3. package/.next/app-path-routes-manifest.json +33 -33
  4. package/.next/build-manifest.json +5 -5
  5. package/.next/prerender-manifest.json +3 -3
  6. package/.next/react-loadable-manifest.json +3 -3
  7. package/.next/required-server-files.json +1 -1
  8. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  9. package/.next/server/app/api/agents/update/route.js.nft.json +1 -1
  10. package/.next/server/app/api/agents/update/route_client-reference-manifest.js +1 -1
  11. package/.next/server/app/api/agents/versions/route.js.nft.json +1 -1
  12. package/.next/server/app/api/agents/versions/route_client-reference-manifest.js +1 -1
  13. package/.next/server/app/api/app/release-notes/route_client-reference-manifest.js +1 -1
  14. package/.next/server/app/api/app/update/route.js +2 -2
  15. package/.next/server/app/api/app/update/route.js.nft.json +1 -1
  16. package/.next/server/app/api/app/update/route_client-reference-manifest.js +1 -1
  17. package/.next/server/app/api/app/update-check/route.js +1 -1
  18. package/.next/server/app/api/app/update-check/route.js.nft.json +1 -1
  19. package/.next/server/app/api/app/update-check/route_client-reference-manifest.js +1 -1
  20. package/.next/server/app/api/auth/login/route_client-reference-manifest.js +1 -1
  21. package/.next/server/app/api/auth/logout/route_client-reference-manifest.js +1 -1
  22. package/.next/server/app/api/auth/status/route_client-reference-manifest.js +1 -1
  23. package/.next/server/app/api/capabilities/route.js +1 -1
  24. package/.next/server/app/api/capabilities/route_client-reference-manifest.js +1 -1
  25. package/.next/server/app/api/daily-summary/route.js.nft.json +1 -1
  26. package/.next/server/app/api/daily-summary/route_client-reference-manifest.js +1 -1
  27. package/.next/server/app/api/daily-summary/status/route.js.nft.json +1 -1
  28. package/.next/server/app/api/daily-summary/status/route_client-reference-manifest.js +1 -1
  29. package/.next/server/app/api/external-apps/[id]/health/route.js.nft.json +1 -1
  30. package/.next/server/app/api/external-apps/[id]/health/route_client-reference-manifest.js +1 -1
  31. package/.next/server/app/api/external-apps/[id]/route.js.nft.json +1 -1
  32. package/.next/server/app/api/external-apps/[id]/route_client-reference-manifest.js +1 -1
  33. package/.next/server/app/api/external-apps/route.js.nft.json +1 -1
  34. package/.next/server/app/api/external-apps/route_client-reference-manifest.js +1 -1
  35. package/.next/server/app/api/fs/browse/route.js.nft.json +1 -1
  36. package/.next/server/app/api/fs/browse/route_client-reference-manifest.js +1 -1
  37. package/.next/server/app/api/fs/recent-paths/route.js.nft.json +1 -1
  38. package/.next/server/app/api/fs/recent-paths/route_client-reference-manifest.js +1 -1
  39. package/.next/server/app/api/hooks/agent-event/route.js +2 -2
  40. package/.next/server/app/api/hooks/agent-event/route.js.nft.json +1 -1
  41. package/.next/server/app/api/hooks/agent-event/route_client-reference-manifest.js +1 -1
  42. package/.next/server/app/api/hooks/claude-done/route.js +2 -2
  43. package/.next/server/app/api/hooks/claude-done/route.js.nft.json +1 -1
  44. package/.next/server/app/api/hooks/claude-done/route_client-reference-manifest.js +1 -1
  45. package/.next/server/app/api/hooks/permission-request/route.js +1 -1
  46. package/.next/server/app/api/hooks/permission-request/route.js.nft.json +1 -1
  47. package/.next/server/app/api/hooks/permission-request/route_client-reference-manifest.js +1 -1
  48. package/.next/server/app/api/metrics/vibe/route.js.nft.json +1 -1
  49. package/.next/server/app/api/metrics/vibe/route_client-reference-manifest.js +1 -1
  50. package/.next/server/app/api/ollama/models/route_client-reference-manifest.js +1 -1
  51. package/.next/server/app/api/push/escalation/route.js +1 -1
  52. package/.next/server/app/api/push/escalation/route.js.nft.json +1 -1
  53. package/.next/server/app/api/push/escalation/route_client-reference-manifest.js +1 -1
  54. package/.next/server/app/api/push/subscriptions/route.js.nft.json +1 -1
  55. package/.next/server/app/api/push/subscriptions/route_client-reference-manifest.js +1 -1
  56. package/.next/server/app/api/push/vapid/route.js +1 -1
  57. package/.next/server/app/api/push/vapid/route.js.nft.json +1 -1
  58. package/.next/server/app/api/push/vapid/route_client-reference-manifest.js +1 -1
  59. package/.next/server/app/api/relays/[relayId]/cancel/route.js +1 -1
  60. package/.next/server/app/api/relays/[relayId]/cancel/route.js.nft.json +1 -1
  61. package/.next/server/app/api/relays/[relayId]/cancel/route_client-reference-manifest.js +1 -1
  62. package/.next/server/app/api/relays/route.js +1 -1
  63. package/.next/server/app/api/relays/route.js.nft.json +1 -1
  64. package/.next/server/app/api/relays/route_client-reference-manifest.js +1 -1
  65. package/.next/server/app/api/remote/pair/route.js +2 -2
  66. package/.next/server/app/api/remote/pair/route_client-reference-manifest.js +1 -1
  67. package/.next/server/app/api/repositories/[id]/route.js.nft.json +1 -1
  68. package/.next/server/app/api/repositories/[id]/route_client-reference-manifest.js +1 -1
  69. package/.next/server/app/api/repositories/clone/[jobId]/route.js +1 -1
  70. package/.next/server/app/api/repositories/clone/[jobId]/route.js.nft.json +1 -1
  71. package/.next/server/app/api/repositories/clone/[jobId]/route_client-reference-manifest.js +1 -1
  72. package/.next/server/app/api/repositories/clone/route.js +1 -1
  73. package/.next/server/app/api/repositories/clone/route.js.nft.json +1 -1
  74. package/.next/server/app/api/repositories/clone/route_client-reference-manifest.js +1 -1
  75. package/.next/server/app/api/repositories/excluded/route.js.nft.json +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.js.nft.json +1 -1
  90. package/.next/server/app/api/repositories/validate-path/route_client-reference-manifest.js +1 -1
  91. package/.next/server/app/api/settings/default-agents/route.js +1 -1
  92. package/.next/server/app/api/settings/default-agents/route.js.nft.json +1 -1
  93. package/.next/server/app/api/settings/default-agents/route_client-reference-manifest.js +1 -1
  94. package/.next/server/app/api/settings/default-surface-mode/route.js.nft.json +1 -1
  95. package/.next/server/app/api/settings/default-surface-mode/route_client-reference-manifest.js +1 -1
  96. package/.next/server/app/api/sidebar/group-order/route.js.nft.json +1 -1
  97. package/.next/server/app/api/sidebar/group-order/route_client-reference-manifest.js +1 -1
  98. package/.next/server/app/api/skills/[id]/route.js +1 -1
  99. package/.next/server/app/api/skills/[id]/route.js.nft.json +1 -1
  100. package/.next/server/app/api/skills/[id]/route_client-reference-manifest.js +1 -1
  101. package/.next/server/app/api/skills/installations/route.js +1 -1
  102. package/.next/server/app/api/skills/installations/route.js.nft.json +1 -1
  103. package/.next/server/app/api/skills/installations/route_client-reference-manifest.js +1 -1
  104. package/.next/server/app/api/skills/operations/route.js +2 -2
  105. package/.next/server/app/api/skills/operations/route.js.nft.json +1 -1
  106. package/.next/server/app/api/skills/operations/route_client-reference-manifest.js +1 -1
  107. package/.next/server/app/api/skills/reindex/route.js +1 -1
  108. package/.next/server/app/api/skills/reindex/route.js.nft.json +1 -1
  109. package/.next/server/app/api/skills/reindex/route_client-reference-manifest.js +1 -1
  110. package/.next/server/app/api/skills/route.js +1 -1
  111. package/.next/server/app/api/skills/route.js.nft.json +1 -1
  112. package/.next/server/app/api/skills/route_client-reference-manifest.js +1 -1
  113. package/.next/server/app/api/slash-commands/route.js.nft.json +1 -1
  114. package/.next/server/app/api/slash-commands/route_client-reference-manifest.js +1 -1
  115. package/.next/server/app/api/tasks/[taskId]/cancel/route.js.nft.json +1 -1
  116. package/.next/server/app/api/tasks/[taskId]/cancel/route_client-reference-manifest.js +1 -1
  117. package/.next/server/app/api/tasks/[taskId]/route.js.nft.json +1 -1
  118. package/.next/server/app/api/tasks/[taskId]/route_client-reference-manifest.js +1 -1
  119. package/.next/server/app/api/templates/[id]/route.js.nft.json +1 -1
  120. package/.next/server/app/api/templates/[id]/route_client-reference-manifest.js +1 -1
  121. package/.next/server/app/api/templates/route.js.nft.json +1 -1
  122. package/.next/server/app/api/templates/route_client-reference-manifest.js +1 -1
  123. package/.next/server/app/api/verification/runs/[runId]/route.js.nft.json +1 -1
  124. package/.next/server/app/api/verification/runs/[runId]/route_client-reference-manifest.js +1 -1
  125. package/.next/server/app/api/verification/runs/route.js.nft.json +1 -1
  126. package/.next/server/app/api/verification/runs/route_client-reference-manifest.js +1 -1
  127. package/.next/server/app/api/worktrees/[id]/auto-yes/route.js +1 -1
  128. package/.next/server/app/api/worktrees/[id]/auto-yes/route.js.nft.json +1 -1
  129. package/.next/server/app/api/worktrees/[id]/auto-yes/route_client-reference-manifest.js +1 -1
  130. package/.next/server/app/api/worktrees/[id]/capture/route.js +1 -1
  131. package/.next/server/app/api/worktrees/[id]/capture/route.js.nft.json +1 -1
  132. package/.next/server/app/api/worktrees/[id]/capture/route_client-reference-manifest.js +1 -1
  133. package/.next/server/app/api/worktrees/[id]/clear-composer/route.js +1 -1
  134. package/.next/server/app/api/worktrees/[id]/clear-composer/route.js.nft.json +1 -1
  135. package/.next/server/app/api/worktrees/[id]/clear-composer/route_client-reference-manifest.js +1 -1
  136. package/.next/server/app/api/worktrees/[id]/cli-reference/route.js.nft.json +1 -1
  137. package/.next/server/app/api/worktrees/[id]/cli-reference/route_client-reference-manifest.js +1 -1
  138. package/.next/server/app/api/worktrees/[id]/cli-tool/route.js.nft.json +1 -1
  139. package/.next/server/app/api/worktrees/[id]/cli-tool/route_client-reference-manifest.js +1 -1
  140. package/.next/server/app/api/worktrees/[id]/cmate/schedules/route.js.nft.json +1 -1
  141. package/.next/server/app/api/worktrees/[id]/cmate/schedules/route_client-reference-manifest.js +1 -1
  142. package/.next/server/app/api/worktrees/[id]/current-output/route.js +1 -1
  143. package/.next/server/app/api/worktrees/[id]/current-output/route.js.nft.json +1 -1
  144. package/.next/server/app/api/worktrees/[id]/current-output/route_client-reference-manifest.js +1 -1
  145. package/.next/server/app/api/worktrees/[id]/direct-input/route.js +1 -1
  146. package/.next/server/app/api/worktrees/[id]/direct-input/route.js.nft.json +1 -1
  147. package/.next/server/app/api/worktrees/[id]/direct-input/route_client-reference-manifest.js +1 -1
  148. package/.next/server/app/api/worktrees/[id]/env/route.js.nft.json +1 -1
  149. package/.next/server/app/api/worktrees/[id]/env/route_client-reference-manifest.js +1 -1
  150. package/.next/server/app/api/worktrees/[id]/execution-logs/[logId]/route.js.nft.json +1 -1
  151. package/.next/server/app/api/worktrees/[id]/execution-logs/[logId]/route_client-reference-manifest.js +1 -1
  152. package/.next/server/app/api/worktrees/[id]/execution-logs/route.js.nft.json +1 -1
  153. package/.next/server/app/api/worktrees/[id]/execution-logs/route_client-reference-manifest.js +1 -1
  154. package/.next/server/app/api/worktrees/[id]/files/[...path]/route.js +1 -1
  155. package/.next/server/app/api/worktrees/[id]/files/[...path]/route.js.nft.json +1 -1
  156. package/.next/server/app/api/worktrees/[id]/files/[...path]/route_client-reference-manifest.js +1 -1
  157. package/.next/server/app/api/worktrees/[id]/git/branch/create/route.js.nft.json +1 -1
  158. package/.next/server/app/api/worktrees/[id]/git/branch/create/route_client-reference-manifest.js +1 -1
  159. package/.next/server/app/api/worktrees/[id]/git/branch/delete/route.js.nft.json +1 -1
  160. package/.next/server/app/api/worktrees/[id]/git/branch/delete/route_client-reference-manifest.js +1 -1
  161. package/.next/server/app/api/worktrees/[id]/git/branches/route.js.nft.json +1 -1
  162. package/.next/server/app/api/worktrees/[id]/git/branches/route_client-reference-manifest.js +1 -1
  163. package/.next/server/app/api/worktrees/[id]/git/checkout/route.js.nft.json +1 -1
  164. package/.next/server/app/api/worktrees/[id]/git/checkout/route_client-reference-manifest.js +1 -1
  165. package/.next/server/app/api/worktrees/[id]/git/commit/route.js.nft.json +1 -1
  166. package/.next/server/app/api/worktrees/[id]/git/commit/route_client-reference-manifest.js +1 -1
  167. package/.next/server/app/api/worktrees/[id]/git/diff/route.js.nft.json +1 -1
  168. package/.next/server/app/api/worktrees/[id]/git/diff/route_client-reference-manifest.js +1 -1
  169. package/.next/server/app/api/worktrees/[id]/git/fetch/route.js.nft.json +1 -1
  170. package/.next/server/app/api/worktrees/[id]/git/fetch/route_client-reference-manifest.js +1 -1
  171. package/.next/server/app/api/worktrees/[id]/git/log/route.js.nft.json +1 -1
  172. package/.next/server/app/api/worktrees/[id]/git/log/route_client-reference-manifest.js +1 -1
  173. package/.next/server/app/api/worktrees/[id]/git/pull/route.js.nft.json +1 -1
  174. package/.next/server/app/api/worktrees/[id]/git/pull/route_client-reference-manifest.js +1 -1
  175. package/.next/server/app/api/worktrees/[id]/git/push/route.js.nft.json +1 -1
  176. package/.next/server/app/api/worktrees/[id]/git/push/route_client-reference-manifest.js +1 -1
  177. package/.next/server/app/api/worktrees/[id]/git/reset/route.js.nft.json +1 -1
  178. package/.next/server/app/api/worktrees/[id]/git/reset/route_client-reference-manifest.js +1 -1
  179. package/.next/server/app/api/worktrees/[id]/git/revert/route.js.nft.json +1 -1
  180. package/.next/server/app/api/worktrees/[id]/git/revert/route_client-reference-manifest.js +1 -1
  181. package/.next/server/app/api/worktrees/[id]/git/show/[commitHash]/route.js.nft.json +1 -1
  182. package/.next/server/app/api/worktrees/[id]/git/show/[commitHash]/route_client-reference-manifest.js +1 -1
  183. package/.next/server/app/api/worktrees/[id]/git/stage/route.js.nft.json +1 -1
  184. package/.next/server/app/api/worktrees/[id]/git/stage/route_client-reference-manifest.js +1 -1
  185. package/.next/server/app/api/worktrees/[id]/git/staged/route.js.nft.json +1 -1
  186. package/.next/server/app/api/worktrees/[id]/git/staged/route_client-reference-manifest.js +1 -1
  187. package/.next/server/app/api/worktrees/[id]/git/stash/[index]/route.js.nft.json +1 -1
  188. package/.next/server/app/api/worktrees/[id]/git/stash/[index]/route_client-reference-manifest.js +1 -1
  189. package/.next/server/app/api/worktrees/[id]/git/stash/apply/route.js.nft.json +1 -1
  190. package/.next/server/app/api/worktrees/[id]/git/stash/apply/route_client-reference-manifest.js +1 -1
  191. package/.next/server/app/api/worktrees/[id]/git/stash/pop/route.js.nft.json +1 -1
  192. package/.next/server/app/api/worktrees/[id]/git/stash/pop/route_client-reference-manifest.js +1 -1
  193. package/.next/server/app/api/worktrees/[id]/git/stash/push/route.js.nft.json +1 -1
  194. package/.next/server/app/api/worktrees/[id]/git/stash/push/route_client-reference-manifest.js +1 -1
  195. package/.next/server/app/api/worktrees/[id]/git/stash/route.js.nft.json +1 -1
  196. package/.next/server/app/api/worktrees/[id]/git/stash/route_client-reference-manifest.js +1 -1
  197. package/.next/server/app/api/worktrees/[id]/git/status/route.js.nft.json +1 -1
  198. package/.next/server/app/api/worktrees/[id]/git/status/route_client-reference-manifest.js +1 -1
  199. package/.next/server/app/api/worktrees/[id]/git/unstage/route.js.nft.json +1 -1
  200. package/.next/server/app/api/worktrees/[id]/git/unstage/route_client-reference-manifest.js +1 -1
  201. package/.next/server/app/api/worktrees/[id]/git/working-diff/route.js.nft.json +1 -1
  202. package/.next/server/app/api/worktrees/[id]/git/working-diff/route_client-reference-manifest.js +1 -1
  203. package/.next/server/app/api/worktrees/[id]/instances/notes/route.js.nft.json +1 -1
  204. package/.next/server/app/api/worktrees/[id]/instances/notes/route_client-reference-manifest.js +1 -1
  205. package/.next/server/app/api/worktrees/[id]/instances/opencode/route.js +1 -1
  206. package/.next/server/app/api/worktrees/[id]/instances/opencode/route.js.nft.json +1 -1
  207. package/.next/server/app/api/worktrees/[id]/instances/opencode/route_client-reference-manifest.js +1 -1
  208. package/.next/server/app/api/worktrees/[id]/interrupt/route.js +1 -1
  209. package/.next/server/app/api/worktrees/[id]/interrupt/route.js.nft.json +1 -1
  210. package/.next/server/app/api/worktrees/[id]/interrupt/route_client-reference-manifest.js +1 -1
  211. package/.next/server/app/api/worktrees/[id]/kill-session/route.js +1 -1
  212. package/.next/server/app/api/worktrees/[id]/kill-session/route.js.nft.json +1 -1
  213. package/.next/server/app/api/worktrees/[id]/kill-session/route_client-reference-manifest.js +1 -1
  214. package/.next/server/app/api/worktrees/[id]/logs/[filename]/route.js.nft.json +1 -1
  215. package/.next/server/app/api/worktrees/[id]/logs/[filename]/route_client-reference-manifest.js +1 -1
  216. package/.next/server/app/api/worktrees/[id]/logs/route.js.nft.json +1 -1
  217. package/.next/server/app/api/worktrees/[id]/logs/route_client-reference-manifest.js +1 -1
  218. package/.next/server/app/api/worktrees/[id]/marp-render/route.js +7 -7
  219. package/.next/server/app/api/worktrees/[id]/marp-render/route.js.nft.json +1 -1
  220. package/.next/server/app/api/worktrees/[id]/marp-render/route_client-reference-manifest.js +1 -1
  221. package/.next/server/app/api/worktrees/[id]/memos/[memoId]/route.js.nft.json +1 -1
  222. package/.next/server/app/api/worktrees/[id]/memos/[memoId]/route_client-reference-manifest.js +1 -1
  223. package/.next/server/app/api/worktrees/[id]/memos/route.js.nft.json +1 -1
  224. package/.next/server/app/api/worktrees/[id]/memos/route_client-reference-manifest.js +1 -1
  225. package/.next/server/app/api/worktrees/[id]/messages/route.js.nft.json +1 -1
  226. package/.next/server/app/api/worktrees/[id]/messages/route_client-reference-manifest.js +1 -1
  227. package/.next/server/app/api/worktrees/[id]/opencode/diff/route.js.nft.json +1 -1
  228. package/.next/server/app/api/worktrees/[id]/opencode/diff/route_client-reference-manifest.js +1 -1
  229. package/.next/server/app/api/worktrees/[id]/opencode/session/route.js.nft.json +1 -1
  230. package/.next/server/app/api/worktrees/[id]/opencode/session/route_client-reference-manifest.js +1 -1
  231. package/.next/server/app/api/worktrees/[id]/opencode/share/route.js.nft.json +1 -1
  232. package/.next/server/app/api/worktrees/[id]/opencode/share/route_client-reference-manifest.js +1 -1
  233. package/.next/server/app/api/worktrees/[id]/prompt-response/route.js +1 -1
  234. package/.next/server/app/api/worktrees/[id]/prompt-response/route.js.nft.json +1 -1
  235. package/.next/server/app/api/worktrees/[id]/prompt-response/route_client-reference-manifest.js +1 -1
  236. package/.next/server/app/api/worktrees/[id]/resolve-target/route.js.nft.json +1 -1
  237. package/.next/server/app/api/worktrees/[id]/resolve-target/route_client-reference-manifest.js +1 -1
  238. package/.next/server/app/api/worktrees/[id]/respond/route.js +1 -1
  239. package/.next/server/app/api/worktrees/[id]/respond/route.js.nft.json +1 -1
  240. package/.next/server/app/api/worktrees/[id]/respond/route_client-reference-manifest.js +1 -1
  241. package/.next/server/app/api/worktrees/[id]/route.js +1 -1
  242. package/.next/server/app/api/worktrees/[id]/route.js.nft.json +1 -1
  243. package/.next/server/app/api/worktrees/[id]/route_client-reference-manifest.js +1 -1
  244. package/.next/server/app/api/worktrees/[id]/schedules/[scheduleId]/route.js.nft.json +1 -1
  245. package/.next/server/app/api/worktrees/[id]/schedules/[scheduleId]/route_client-reference-manifest.js +1 -1
  246. package/.next/server/app/api/worktrees/[id]/schedules/active/route.js.nft.json +1 -1
  247. package/.next/server/app/api/worktrees/[id]/schedules/active/route_client-reference-manifest.js +1 -1
  248. package/.next/server/app/api/worktrees/[id]/schedules/route.js.nft.json +1 -1
  249. package/.next/server/app/api/worktrees/[id]/schedules/route_client-reference-manifest.js +1 -1
  250. package/.next/server/app/api/worktrees/[id]/search/route.js +1 -1
  251. package/.next/server/app/api/worktrees/[id]/search/route.js.nft.json +1 -1
  252. package/.next/server/app/api/worktrees/[id]/search/route_client-reference-manifest.js +1 -1
  253. package/.next/server/app/api/worktrees/[id]/send/route.js +1 -1
  254. package/.next/server/app/api/worktrees/[id]/send/route.js.nft.json +1 -1
  255. package/.next/server/app/api/worktrees/[id]/send/route_client-reference-manifest.js +1 -1
  256. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route.js +3 -3
  257. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route.js.nft.json +1 -1
  258. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route_client-reference-manifest.js +1 -1
  259. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/install/route.js +1 -1
  260. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/install/route.js.nft.json +1 -1
  261. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/install/route_client-reference-manifest.js +1 -1
  262. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/plan/route.js +1 -1
  263. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/plan/route.js.nft.json +1 -1
  264. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/plan/route_client-reference-manifest.js +1 -1
  265. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall/route.js +1 -1
  266. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall/route.js.nft.json +1 -1
  267. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall/route_client-reference-manifest.js +1 -1
  268. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall-plan/route.js +1 -1
  269. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall-plan/route.js.nft.json +1 -1
  270. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall-plan/route_client-reference-manifest.js +1 -1
  271. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/update/route.js +1 -1
  272. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/update/route.js.nft.json +1 -1
  273. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/update/route_client-reference-manifest.js +1 -1
  274. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/update-plan/route.js +1 -1
  275. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/update-plan/route.js.nft.json +1 -1
  276. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/update-plan/route_client-reference-manifest.js +1 -1
  277. package/.next/server/app/api/worktrees/[id]/skills/route.js +1 -1
  278. package/.next/server/app/api/worktrees/[id]/skills/route.js.nft.json +1 -1
  279. package/.next/server/app/api/worktrees/[id]/skills/route_client-reference-manifest.js +1 -1
  280. package/.next/server/app/api/worktrees/[id]/slash-commands/route.js.nft.json +1 -1
  281. package/.next/server/app/api/worktrees/[id]/slash-commands/route_client-reference-manifest.js +1 -1
  282. package/.next/server/app/api/worktrees/[id]/special-keys/route.js +1 -1
  283. package/.next/server/app/api/worktrees/[id]/special-keys/route.js.nft.json +1 -1
  284. package/.next/server/app/api/worktrees/[id]/special-keys/route_client-reference-manifest.js +1 -1
  285. package/.next/server/app/api/worktrees/[id]/tasks/route.js.nft.json +1 -1
  286. package/.next/server/app/api/worktrees/[id]/tasks/route_client-reference-manifest.js +1 -1
  287. package/.next/server/app/api/worktrees/[id]/terminal/route.js +103 -1
  288. package/.next/server/app/api/worktrees/[id]/terminal/route.js.nft.json +1 -1
  289. package/.next/server/app/api/worktrees/[id]/terminal/route_client-reference-manifest.js +1 -1
  290. package/.next/server/app/api/worktrees/[id]/timers/history/route.js.nft.json +1 -1
  291. package/.next/server/app/api/worktrees/[id]/timers/history/route_client-reference-manifest.js +1 -1
  292. package/.next/server/app/api/worktrees/[id]/timers/route.js +1 -1
  293. package/.next/server/app/api/worktrees/[id]/timers/route.js.nft.json +1 -1
  294. package/.next/server/app/api/worktrees/[id]/timers/route_client-reference-manifest.js +1 -1
  295. package/.next/server/app/api/worktrees/[id]/todos/[todoId]/route.js.nft.json +1 -1
  296. package/.next/server/app/api/worktrees/[id]/todos/[todoId]/route_client-reference-manifest.js +1 -1
  297. package/.next/server/app/api/worktrees/[id]/todos/route.js.nft.json +1 -1
  298. package/.next/server/app/api/worktrees/[id]/todos/route_client-reference-manifest.js +1 -1
  299. package/.next/server/app/api/worktrees/[id]/tree/[...path]/route.js.nft.json +1 -1
  300. package/.next/server/app/api/worktrees/[id]/tree/[...path]/route_client-reference-manifest.js +1 -1
  301. package/.next/server/app/api/worktrees/[id]/tree/route.js.nft.json +1 -1
  302. package/.next/server/app/api/worktrees/[id]/tree/route_client-reference-manifest.js +1 -1
  303. package/.next/server/app/api/worktrees/[id]/upload/[...path]/route.js.nft.json +1 -1
  304. package/.next/server/app/api/worktrees/[id]/upload/[...path]/route_client-reference-manifest.js +1 -1
  305. package/.next/server/app/api/worktrees/[id]/verify/config/route.js.nft.json +1 -1
  306. package/.next/server/app/api/worktrees/[id]/verify/config/route_client-reference-manifest.js +1 -1
  307. package/.next/server/app/api/worktrees/[id]/verify/route.js +1 -1
  308. package/.next/server/app/api/worktrees/[id]/verify/route.js.nft.json +1 -1
  309. package/.next/server/app/api/worktrees/[id]/verify/route_client-reference-manifest.js +1 -1
  310. package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/cancel/route.js +1 -1
  311. package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/cancel/route.js.nft.json +1 -1
  312. package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/cancel/route_client-reference-manifest.js +1 -1
  313. package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/route.js.nft.json +1 -1
  314. package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/route_client-reference-manifest.js +1 -1
  315. package/.next/server/app/api/worktrees/[id]/verify/runs/route.js.nft.json +1 -1
  316. package/.next/server/app/api/worktrees/[id]/verify/runs/route_client-reference-manifest.js +1 -1
  317. package/.next/server/app/api/worktrees/[id]/viewed/route.js.nft.json +1 -1
  318. package/.next/server/app/api/worktrees/[id]/viewed/route_client-reference-manifest.js +1 -1
  319. package/.next/server/app/api/worktrees/apply-default-agents/route.js.nft.json +1 -1
  320. package/.next/server/app/api/worktrees/apply-default-agents/route_client-reference-manifest.js +1 -1
  321. package/.next/server/app/api/worktrees/route.js +1 -1
  322. package/.next/server/app/api/worktrees/route.js.nft.json +1 -1
  323. package/.next/server/app/api/worktrees/route_client-reference-manifest.js +1 -1
  324. package/.next/server/app/login/page_client-reference-manifest.js +1 -1
  325. package/.next/server/app/manifest.webmanifest/route_client-reference-manifest.js +1 -1
  326. package/.next/server/app/more/page_client-reference-manifest.js +1 -1
  327. package/.next/server/app/offline/page_client-reference-manifest.js +1 -1
  328. package/.next/server/app/page_client-reference-manifest.js +1 -1
  329. package/.next/server/app/proxy/[...path]/route.js.nft.json +1 -1
  330. package/.next/server/app/proxy/[...path]/route_client-reference-manifest.js +1 -1
  331. package/.next/server/app/repositories/page_client-reference-manifest.js +1 -1
  332. package/.next/server/app/review/page_client-reference-manifest.js +1 -1
  333. package/.next/server/app/sessions/page.js +1 -1
  334. package/.next/server/app/sessions/page.js.nft.json +1 -1
  335. package/.next/server/app/sessions/page_client-reference-manifest.js +1 -1
  336. package/.next/server/app/skills/[skillId]/page.js +1 -1
  337. package/.next/server/app/skills/[skillId]/page.js.nft.json +1 -1
  338. package/.next/server/app/skills/[skillId]/page_client-reference-manifest.js +1 -1
  339. package/.next/server/app/skills/installed/page_client-reference-manifest.js +1 -1
  340. package/.next/server/app/skills/page_client-reference-manifest.js +1 -1
  341. package/.next/server/app/worktrees/[id]/files/[...path]/page.js +1 -1
  342. package/.next/server/app/worktrees/[id]/files/[...path]/page.js.nft.json +1 -1
  343. package/.next/server/app/worktrees/[id]/files/[...path]/page_client-reference-manifest.js +1 -1
  344. package/.next/server/app/worktrees/[id]/page.js +9 -9
  345. package/.next/server/app/worktrees/[id]/page.js.nft.json +1 -1
  346. package/.next/server/app/worktrees/[id]/page_client-reference-manifest.js +1 -1
  347. package/.next/server/app/worktrees/[id]/terminal/page.js +1 -1
  348. package/.next/server/app/worktrees/[id]/terminal/page.js.nft.json +1 -1
  349. package/.next/server/app/worktrees/[id]/terminal/page_client-reference-manifest.js +1 -1
  350. package/.next/server/app-paths-manifest.json +33 -33
  351. package/.next/server/chunks/1068.js +1 -1
  352. package/.next/server/chunks/1501.js +3 -3
  353. package/.next/server/chunks/2119.js +1 -1
  354. package/.next/server/chunks/2283.js +15 -0
  355. package/.next/server/chunks/2328.js +1 -1
  356. package/.next/server/chunks/2404.js +1 -1
  357. package/.next/server/chunks/2445.js +1 -1
  358. package/.next/server/chunks/2816.js +1 -1
  359. package/.next/server/chunks/4207.js +1 -1
  360. package/.next/server/chunks/4802.js +1 -1
  361. package/.next/server/chunks/488.js +1 -0
  362. package/.next/server/chunks/5326.js +1 -1
  363. package/.next/server/chunks/5456.js +1 -1
  364. package/.next/server/chunks/611.js +1 -1
  365. package/.next/server/chunks/6130.js +1 -1
  366. package/.next/server/chunks/6401.js +1 -1
  367. package/.next/server/chunks/6474.js +14 -0
  368. package/.next/server/chunks/650.js +1 -0
  369. package/.next/server/chunks/6781.js +1 -1
  370. package/.next/server/chunks/{5742.js → 6927.js} +1 -1
  371. package/.next/server/chunks/7506.js +1 -1
  372. package/.next/server/chunks/7685.js +1 -1
  373. package/.next/server/chunks/7905.js +1 -1
  374. package/.next/server/chunks/8543.js +1 -1
  375. package/.next/server/chunks/8581.js +2 -2
  376. package/.next/server/chunks/8728.js +2 -2
  377. package/.next/server/chunks/8782.js +1 -0
  378. package/.next/server/chunks/8791.js +1 -1
  379. package/.next/server/chunks/8918.js +105 -3
  380. package/.next/server/chunks/9130.js +1 -1
  381. package/.next/server/chunks/9390.js +1 -1
  382. package/.next/server/chunks/967.js +1 -1
  383. package/.next/server/chunks/9731.js +3 -3
  384. package/.next/server/chunks/9882.js +3 -3
  385. package/.next/server/middleware-build-manifest.js +1 -1
  386. package/.next/server/middleware-manifest.json +5 -5
  387. package/.next/server/middleware-react-loadable-manifest.js +1 -1
  388. package/.next/server/pages/500.html +1 -1
  389. package/.next/server/server-reference-manifest.json +1 -1
  390. package/.next/server/src/middleware.js +2 -2
  391. package/.next/server/src/middleware.js.map +1 -1
  392. package/.next/static/chunks/{1642-767aed8e7c61ef7f.js → 1642-fb2e176aaadbd137.js} +1 -1
  393. package/.next/static/chunks/2053-85a974ddfe7498fe.js +1 -0
  394. package/.next/static/chunks/{2407-940df9b11fadafc6.js → 2407-f1f258d4a1d92620.js} +1 -1
  395. package/.next/static/chunks/{2619-a305ad4810f1393a.js → 2619-04bc32f026a0d946.js} +1 -1
  396. package/.next/static/chunks/344-e1cefd00787060e4.js +1 -0
  397. package/.next/static/chunks/3922.f45dcfc1e7da552a.js +1 -0
  398. package/.next/static/chunks/5521-c358c31f60e5e689.js +1 -0
  399. package/.next/static/chunks/591-308072f285c34787.js +1 -0
  400. package/.next/static/chunks/6654-ac431270fac1a283.js +1 -0
  401. package/.next/static/chunks/{8165-3525fb42f1b4976e.js → 8165-3853772f6ae1299b.js} +1 -1
  402. package/.next/static/chunks/{8566-a6a7c70558927410.js → 8566-aeda747542072ace.js} +1 -1
  403. package/.next/static/chunks/8811-29eaa24237f48558.js +1 -0
  404. package/.next/static/chunks/{9619-22adf5367c4b7080.js → 9619-6c17a271f7f98fbb.js} +1 -1
  405. package/.next/static/chunks/998-2eb5883186abd0bd.js +1 -0
  406. package/.next/static/chunks/app/layout-da66300cc20244ed.js +1 -0
  407. package/.next/static/chunks/app/more/{page-30057cf1e0762ad2.js → page-87c84987b2765213.js} +1 -1
  408. package/.next/static/chunks/app/{page-8483ba400af011f5.js → page-1b820c421db48c2c.js} +1 -1
  409. package/.next/static/chunks/app/review/page-95f749caae382f46.js +1 -0
  410. package/.next/static/chunks/app/sessions/page-049e06335187aa91.js +1 -0
  411. package/.next/static/chunks/app/skills/[skillId]/{page-74aac15286504ef4.js → page-9ee7a381636e60cb.js} +1 -1
  412. package/.next/static/chunks/app/worktrees/[id]/page-040c5f0f585e6812.js +1 -0
  413. package/.next/static/chunks/app/worktrees/[id]/terminal/{page-c601f3b3ece6557e.js → page-373ea37b16d930c7.js} +1 -1
  414. package/.next/static/chunks/{webpack-49ade0526854dd4e.js → webpack-021f0741f22dd16a.js} +1 -1
  415. package/.next/static/css/38070d879efa1371.css +1 -0
  416. package/.next/trace +13 -13
  417. package/README.md +90 -605
  418. package/dist/cli/commands/capture.d.ts.map +1 -1
  419. package/dist/cli/commands/capture.js +11 -1
  420. package/dist/cli/commands/docs.d.ts.map +1 -1
  421. package/dist/cli/commands/docs.js +5 -0
  422. package/dist/cli/commands/remote.d.ts +34 -1
  423. package/dist/cli/commands/remote.d.ts.map +1 -1
  424. package/dist/cli/commands/remote.js +171 -6
  425. package/dist/cli/commands/respond.d.ts.map +1 -1
  426. package/dist/cli/commands/respond.js +255 -112
  427. package/dist/cli/commands/stop.d.ts.map +1 -1
  428. package/dist/cli/commands/stop.js +53 -1
  429. package/dist/cli/commands/sync.js +3 -3
  430. package/dist/cli/commands/wait.d.ts.map +1 -1
  431. package/dist/cli/commands/wait.js +11 -0
  432. package/dist/cli/docs/setup-guide.d.ts +14 -0
  433. package/dist/cli/docs/setup-guide.d.ts.map +1 -0
  434. package/dist/cli/docs/setup-guide.js +368 -0
  435. package/dist/cli/types/api-responses.d.ts +21 -0
  436. package/dist/cli/types/api-responses.d.ts.map +1 -1
  437. package/dist/cli/types/index.d.ts +2 -0
  438. package/dist/cli/types/index.d.ts.map +1 -1
  439. package/dist/cli/utils/daemon.d.ts +42 -2
  440. package/dist/cli/utils/daemon.d.ts.map +1 -1
  441. package/dist/cli/utils/daemon.js +222 -40
  442. package/dist/cli/utils/docs-reader.d.ts +6 -0
  443. package/dist/cli/utils/docs-reader.d.ts.map +1 -1
  444. package/dist/cli/utils/docs-reader.js +14 -13
  445. package/dist/cli/utils/npm-runner.d.ts +12 -0
  446. package/dist/cli/utils/npm-runner.d.ts.map +1 -1
  447. package/dist/cli/utils/npm-runner.js +36 -0
  448. package/dist/cli/utils/process-inspect.d.ts +55 -0
  449. package/dist/cli/utils/process-inspect.d.ts.map +1 -0
  450. package/dist/cli/utils/process-inspect.js +214 -0
  451. package/dist/cli/utils/remote-pairing.d.ts +68 -0
  452. package/dist/cli/utils/remote-pairing.d.ts.map +1 -0
  453. package/dist/cli/utils/remote-pairing.js +117 -0
  454. package/dist/cli/utils/server-identity.d.ts +50 -0
  455. package/dist/cli/utils/server-identity.d.ts.map +1 -0
  456. package/dist/cli/utils/server-identity.js +118 -0
  457. package/dist/cli/utils/server-ready.d.ts +13 -0
  458. package/dist/cli/utils/server-ready.d.ts.map +1 -1
  459. package/dist/cli/utils/server-ready.js +16 -0
  460. package/dist/lib/detection/status-reason.d.ts +17 -0
  461. package/dist/lib/detection/status-reason.d.ts.map +1 -1
  462. package/dist/lib/detection/status-reason.js +17 -0
  463. package/dist/lib/security/pairing-code.d.ts +2 -1
  464. package/dist/lib/security/pairing-code.d.ts.map +1 -1
  465. package/dist/server/locales/en/worktree.json +41 -7
  466. package/dist/server/locales/ja/worktree.json +41 -7
  467. package/dist/server/src/config/image-extensions.js +1 -0
  468. package/dist/server/src/config/session-starting-config.js +75 -0
  469. package/dist/server/src/lib/auto-yes-poller.js +22 -0
  470. package/dist/server/src/lib/cli-tools/antigravity.js +2 -1
  471. package/dist/server/src/lib/cli-tools/base.js +15 -1
  472. package/dist/server/src/lib/cli-tools/codex.js +3 -2
  473. package/dist/server/src/lib/cli-tools/command-code-plan-review.js +175 -0
  474. package/dist/server/src/lib/cli-tools/command-code.js +30 -4
  475. package/dist/server/src/lib/cli-tools/copilot.js +2 -1
  476. package/dist/server/src/lib/cli-tools/gemini.js +2 -1
  477. package/dist/server/src/lib/cli-tools/liveness-spec.js +27 -9
  478. package/dist/server/src/lib/cli-tools/opencode-v2.js +2 -1
  479. package/dist/server/src/lib/cli-tools/opencode.js +2 -1
  480. package/dist/server/src/lib/cli-tools/vibe-local.js +2 -1
  481. package/dist/server/src/lib/detection/cli-patterns.js +94 -1
  482. package/dist/server/src/lib/detection/status-reason.js +17 -0
  483. package/dist/server/src/lib/detection/tool-liveness.js +3 -1
  484. package/dist/server/src/lib/detection/tools/codex/detect.js +26 -0
  485. package/dist/server/src/lib/detection/tools/command-code/plan-review-state.js +75 -0
  486. package/dist/server/src/lib/hooks/sources/claude/transcript.js +33 -1
  487. package/dist/server/src/lib/realtime/terminal-broadcast.js +5 -0
  488. package/dist/server/src/lib/session/agent-session-lifecycle.js +11 -0
  489. package/dist/server/src/lib/session/claude-executor.js +2 -2
  490. package/dist/server/src/lib/session/claude-session.js +138 -16
  491. package/dist/server/src/lib/session/current-output-builder.js +49 -21
  492. package/dist/server/src/lib/session/launch-screen.js +57 -0
  493. package/dist/server/src/lib/session/session-start-error.js +20 -0
  494. package/dist/server/src/lib/session/session-starting-state.js +236 -0
  495. package/dist/server/src/lib/skills/agent-state-paths.js +39 -0
  496. package/dist/server/src/lib/skills/receipt-owned-paths.js +118 -0
  497. package/dist/server/src/lib/tmux/tmux.js +25 -0
  498. package/dist/server/src/lib/verification/env-clean-gate.js +195 -6
  499. package/dist/server/src/lib/verification/gate-runner.js +29 -2
  500. package/dist/server/src/lib/verification/scope-gate.js +58 -4
  501. package/docs/en/architecture.md +722 -0
  502. package/docs/en/user-guide/agents-guide.md +306 -0
  503. package/docs/en/user-guide/cli-setup-guide.md +676 -0
  504. package/docs/en/user-guide/cmate-schedules-guide.md +388 -0
  505. package/docs/en/user-guide/commands-guide.md +467 -0
  506. package/docs/en/user-guide/quick-start.md +231 -0
  507. package/docs/en/user-guide/webapp-guide.md +1020 -0
  508. package/docs/en/user-guide/workflow-examples.md +463 -0
  509. package/package.json +18 -7
  510. package/release-notes/0.44.0.json +82 -0
  511. package/release-notes/0.44.1.json +54 -0
  512. package/.next/server/chunks/1990.js +0 -103
  513. package/.next/server/chunks/3707.js +0 -15
  514. package/.next/server/chunks/6491.js +0 -103
  515. package/.next/server/chunks/7004.js +0 -1
  516. package/.next/server/chunks/8673.js +0 -14
  517. package/.next/static/chunks/2039-117a361f795ddc4b.js +0 -1
  518. package/.next/static/chunks/2053-611dd27d42721b79.js +0 -1
  519. package/.next/static/chunks/344-6f9fc1f38f01a839.js +0 -1
  520. package/.next/static/chunks/3778-56f41fc2cecb8c43.js +0 -1
  521. package/.next/static/chunks/3922.8e79fc89f593280b.js +0 -1
  522. package/.next/static/chunks/5449-6cb80bab2bd06b79.js +0 -1
  523. package/.next/static/chunks/6966-bb854d1145783a64.js +0 -1
  524. package/.next/static/chunks/7705-1f58d4c03d991fcf.js +0 -1
  525. package/.next/static/chunks/app/layout-057c850cd0df978e.js +0 -1
  526. package/.next/static/chunks/app/review/page-ff9efae3f86eb840.js +0 -1
  527. package/.next/static/chunks/app/sessions/page-1a8ba152bbcb9efb.js +0 -1
  528. package/.next/static/chunks/app/worktrees/[id]/page-eab0bf7564d3f9e2.js +0 -1
  529. package/.next/static/css/b3f433d52b8ed5c8.css +0 -1
  530. /package/.next/static/{BVkBYdceLRvMROqQIqeBx → 57lOiz8zSEHdw97XIm0af}/_buildManifest.js +0 -0
  531. /package/.next/static/{BVkBYdceLRvMROqQIqeBx → 57lOiz8zSEHdw97XIm0af}/_ssgManifest.js +0 -0
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2053],{24027:(e,t,s)=>{s.d(t,{Uc:()=>A,G8:()=>v,OJ:()=>C,RF:()=>R});var l=s(95155),a=s(12115),n=s(18955),r=s(51238),i=s(89451),d=s(10934),o=s(92254),c=s(5225);s(1226);var u=s(89715),x=s(57828),m=s(52056),p=s(65229),g=s(67909),h=s(3005);let k=(0,g.default)(()=>Promise.all([s.e(221),s.e(7485),s.e(953)]).then(s.bind(s,90953)).then(e=>({default:e.MermaidDiagram})),{loadableGenerated:{webpack:()=>[90953]},ssr:!1,loading:function(){let e=(0,n.c)("worktree");return(0,l.jsxs)("div",{className:"mermaid-loading flex items-center gap-2 text-muted-foreground p-4",children:[(0,l.jsx)(h.y,{size:"sm"}),(0,l.jsx)("span",{children:e("mermaid.loading")})]})}});function f(e){let{className:t,children:s}=e;if(t&&t.split(" ").includes("language-mermaid")){let e=null==s?"":"string"==typeof s?s:Array.isArray(s)?s.map(e=>"string"==typeof e?e:"").join(""):String(s);return(0,l.jsx)(k,{code:e})}return(0,l.jsx)("code",{className:t,children:s})}var j=s(50666),b=s(38021),y=s(69352),N=s(76246),w=s(99112);let v=(0,a.memo)(function(e){let{content:t,onOpenFile:s,currentFilePath:n,worktreeId:u}=e,x=(0,a.useRef)(s);x.current=s;let m=(0,a.useRef)(n);m.current=n;let p=(0,a.useRef)(u);p.current=u;let g=(0,a.useCallback)((e,t)=>{let s=(0,y.d3)(t);if(s)switch((0,y.dj)(s)){case"anchor":break;case"external":e.preventDefault(),window.open(s,"_blank","noopener,noreferrer");break;case"relative":{e.preventDefault();let t=m.current,l=x.current;if(t&&l){let e=(0,y.WU)(t,s);e&&l(e)}}}},[]),h=(0,a.useMemo)(()=>({code:f,pre:e=>{let{children:t}=e;return!function(e){let t=a.Children.toArray(e)[0];if(!a.isValidElement(t))return!1;let s=t.props.className;return"string"==typeof s&&s.split(" ").includes("language-mermaid")}(t)?(0,l.jsx)(j.Ck,{children:(0,l.jsx)("pre",{className:"overflow-x-auto",children:t})}):(0,l.jsx)("pre",{children:t})},img:e=>{var t,s,a,n;let{src:r,alt:i,width:d,height:o,...c}=e,u=null!=d?d:null==(s=c.node)||null==(t=s.properties)?void 0:t.width,x=null!=o?o:null==(n=c.node)||null==(a=n.properties)?void 0:a.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 s=(0,y.WU)(e,r);if(s){let e="/api/worktrees/".concat(t,"/files/").concat((0,N.o)(s));return(0,l.jsx)(b.n,{apiUrl:e,alt:null!=i?i:"",width:u,height:x})}}}return(0,l.jsx)("img",{src:r,alt:null!=i?i:"",width:u,height:x,style:{maxWidth:u||"100%"}})},a:e=>{let{href:t,children:s,...a}=e;return t?(0,l.jsx)("a",{...a,href:t,onClick:e=>g(e,t),children:s}):(0,l.jsx)("a",{...a,children:s})}}),[g]),k=(0,a.useMemo)(()=>[i.A,[d.A,y.uO],o.A,c.A],[]);return(0,l.jsx)(r.oz,{remarkPlugins:w.eT,rehypePlugins:k,components:h,children:t})}),R=(0,a.memo)(function(e){let{mobileTab:t,onTabChange:s}=e,a=(0,n.c)("worktree");return(0,l.jsxs)("div",{className:"flex border-b border-border",children:[(0,l.jsxs)("button",{"data-testid":"mobile-tab-editor",onClick:()=>s("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,l.jsx)(u.A,{className:"h-4 w-4 inline-block mr-1"}),a("markdownPreview.editor")]}),(0,l.jsxs)("button",{"data-testid":"mobile-tab-preview",onClick:()=>s("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,l.jsx)(x.A,{className:"h-4 w-4 inline-block mr-1"}),a("markdownPreview.preview")]})]})}),C=(0,a.memo)(function(e){let{isMobile:t}=e,s=(0,n.c)("worktree");return(0,l.jsxs)("div",{"data-testid":"maximize-hint",className:"flex items-center justify-center px-4 py-1 bg-muted text-muted-foreground text-xs",children:[s("markdownPreview.exitFullscreenHint")," ",t&&s("markdownPreview.exitFullscreenHintSwipe")]})}),A=(0,a.memo)(function(e){let{onDismiss:t}=e,s=(0,n.c)("worktree");return(0,l.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,l.jsx)(m.A,{className:"h-4 w-4"}),s("markdownPreview.largeFileWarning"),(0,l.jsx)("button",{onClick:t,className:"ml-auto text-warning hover:text-warning",children:(0,l.jsx)(p.A,{className:"h-4 w-4"})})]})})},34380:(e,t,s)=>{s.d(t,{B:()=>K});var l=s(95155),a=s(12115),n=s(18955),r=s(48407),i=s(54014),d=s(74385),o=s(50825),c=s(37381);function u(e){var t,s,l,a,n;let r=e.agentInstances&&e.agentInstances.length>0?e.agentInstances.map(e=>e.alias||e.cliTool):null!=(s=e.selectedAgents)?s:e.cliToolId?[e.cliToolId]:[];return{id:e.id,name:e.name,repositoryName:null!=(l=e.repositoryDisplayName)?l:e.repositoryName,syncedBranch:null!=(a=e.branch)?a:null,liveBranch:null!=(n=null==(t=e.gitStatus)?void 0:t.currentBranch)?n: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 s=await t.json(),l=null==s?void 0:s.worktrees;if(!Array.isArray(l))throw Error("Malformed worktree list");return l.map(u)}function p(e){let{selectedWorktreeId:t,onSelect:s,disabled:i=!1}=e,d=(0,n.c)("skills"),[o,u]=(0,a.useState)(x),[p,h]=(0,a.useState)(0);(0,a.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 k=(0,a.useCallback)(()=>h(e=>e+1),[]);return"loading"===o.status?(0,l.jsxs)("div",{className:"space-y-2","data-testid":"skill-target-loading",children:[(0,l.jsx)("p",{className:"text-sm text-muted-foreground",children:d("target.loading")}),(0,l.jsx)(r.EA,{className:"h-24 w-full rounded-lg"})]}):"error"===o.status?(0,l.jsxs)(r.Zp,{className:"space-y-3","data-testid":"skill-target-error",children:[(0,l.jsx)(c.u,{tone:"danger",children:d("target.errorNotice")}),(0,l.jsx)(r.$n,{variant:"secondary",size:"sm",onClick:k,"data-testid":"skill-target-retry",children:d("target.retry")})]}):0===o.options.length?(0,l.jsx)(r.Zp,{"data-testid":"skill-target-empty",children:(0,l.jsx)("p",{className:"text-sm text-muted-foreground",children:d("target.empty")})}):(0,l.jsxs)("div",{className:"space-y-3","data-testid":"skill-target-selector",children:[(0,l.jsx)("div",{role:"radiogroup","aria-label":d("target.heading"),className:"space-y-2",children:o.options.map(e=>(0,l.jsx)(g,{option:e,selected:e.id===t,disabled:i,onSelect:s},e.id))}),(0,l.jsx)(c.u,{tone:"neutral","data-testid":"skill-target-branch-notice",children:d("target.branchFreshnessNotice")})]})}function g(e){var t;let{option:s,selected:a,disabled:i,onSelect:d}=e,o=(0,n.c)("skills"),c=null!=(t=s.liveBranch)?t:s.syncedBranch;return(0,l.jsxs)("button",{type:"button",role:"radio","aria-checked":a,disabled:i,onClick:()=>d(s.id),"data-testid":"skill-target-option-".concat(s.id),className:"w-full rounded-lg border px-3 py-2.5 text-left transition-colors disabled:cursor-not-allowed disabled:opacity-60 ".concat(a?"border-accent-500 bg-accent-50 dark:bg-accent-950/40":"border-border bg-card hover:bg-muted"),children:[(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,l.jsx)("span",{className:"text-sm font-semibold text-foreground break-all",children:s.name}),a&&(0,l.jsx)(r.Ex,{variant:"info",children:o("target.selected")})]}),(0,l.jsxs)("dl",{className:"mt-1.5 grid grid-cols-1 gap-x-4 gap-y-1 sm:grid-cols-2",children:[(0,l.jsx)(h,{label:o("target.repository"),children:s.repositoryName}),(0,l.jsx)(h,{label:o("target.branch"),children:null!=c?c:o("target.branchUnknown")}),(0,l.jsx)(h,{label:o("target.agents"),children:s.agents.length>0?s.agents.join(", "):o("target.agentsNone")}),(0,l.jsx)(h,{label:o("target.workingTree"),children:o(null===s.dirty?"target.workingTreeUnknown":s.dirty?"target.workingTreeDirty":"target.workingTreeClean")})]}),s.sessionRunning&&(0,l.jsx)("p",{className:"mt-1.5 text-xs text-muted-foreground","data-testid":"skill-target-session-".concat(s.id),children:o("target.sessionRunning")})]})}function h(e){let{label:t,children:s}=e;return(0,l.jsxs)("div",{className:"min-w-0",children:[(0,l.jsx)("dt",{className:"text-xs font-medium text-muted-foreground",children:t}),(0,l.jsx)("dd",{className:"text-xs text-foreground break-words",children:s})]})}var k=s(95584);function f(e){let{label:t,children:s}=e;return(0,l.jsxs)("div",{className:"min-w-0",children:[(0,l.jsx)("dt",{className:"text-xs font-medium text-muted-foreground",children:t}),(0,l.jsx)("dd",{className:"mt-0.5 break-words text-sm text-foreground",children:s})]})}function j(e){let{level:t,kind:s,label:a}=e,i=(0,n.c)("skills");return(0,l.jsxs)(r.Ex,{variant:k.eK[t],"data-testid":"skill-plan-risk-".concat(s,"-").concat(t),children:[a,": ",i(k.pP[t])]})}function b(e){let{entry:t}=e,s=(0,n.c)("skills"),a=k.KL[t.reason];return(0,l.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,l.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,l.jsx)(r.Ex,{variant:k.tC[t.change],children:s(k.AS[t.change])}),(0,l.jsx)("span",{className:"break-all font-mono text-xs text-foreground",children:t.path}),t.generated&&(0,l.jsx)(r.Ex,{variant:"gray",children:s("plan.fileGenerated")})]}),a&&(0,l.jsx)("p",{className:"text-xs text-muted-foreground",children:s(a)}),t.gitIgnored&&(0,l.jsx)("p",{className:"text-xs text-warning-foreground",children:s("plan.gitIgnored")}),t.binary?(0,l.jsx)("p",{className:"text-xs text-muted-foreground",children:s("plan.diffBinary")}):t.diff?(0,l.jsxs)("details",{children:[(0,l.jsx)("summary",{className:"cursor-pointer text-xs text-accent-600 dark:text-accent-400",children:s("plan.diffToggle",{additions:t.additions,deletions:t.deletions})}),(0,l.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,l.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:s("plan.diffTruncated")})]}):null]})}function y(e){var t,s,a;let{plan:i}=e,d=(0,n.c)("skills"),{target:o,skill:u}=i,x=u.compatibility.commandmate;return(0,l.jsxs)(r.Zp,{className:"space-y-4","data-testid":"skill-install-plan",children:[(0,l.jsxs)("div",{className:"space-y-1",children:[(0,l.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:d("plan.heading")}),(0,l.jsx)("p",{className:"text-xs text-muted-foreground",children:d("plan.expiresAt",{timestamp:i.expiresAt})})]}),(0,l.jsxs)("section",{className:"space-y-2",children:[(0,l.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:d("plan.targetHeading")}),(0,l.jsxs)("dl",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[(0,l.jsx)(f,{label:d("target.repository"),children:o.repositoryName}),(0,l.jsx)(f,{label:d("target.heading"),children:o.worktreeName}),(0,l.jsx)(f,{label:d("target.branch"),children:null!=(t=o.branch)?t:d("target.branchUnknown")}),(0,l.jsx)(f,{label:d("plan.headStateLabel"),children:d(null!=(s=k.kF[o.headState])?s:"plan.headState.unknown")}),(0,l.jsx)(f,{label:d("target.workingTree"),children:o.workingTreeDirty?d("target.workingTreeDirty"):d("target.workingTreeClean")}),(0,l.jsx)(f,{label:d("plan.installRoot"),children:(0,l.jsx)("span",{className:"break-all font-mono text-xs",children:(o.installRoots&&o.installRoots.length>0?o.installRoots:[o.installRoot]).map(e=>(0,l.jsx)("span",{className:"block",children:e},e))})}),(0,l.jsx)(f,{label:d("plan.existingInstall"),children:o.existingInstall?d("plan.existingInstallVersion",{version:o.existingInstall.version}):d("plan.existingInstallNone")}),(0,l.jsx)(f,{label:d("detail.recommendedVersion"),children:(0,l.jsx)("span",{className:"font-mono text-xs",children:u.version})})]})]}),(0,l.jsxs)("section",{className:"space-y-2","data-testid":"skill-plan-risk-section",children:[(0,l.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:d("plan.riskHeading")}),(0,l.jsxs)("div",{className:"flex flex-wrap gap-1.5",children:[(0,l.jsx)(j,{level:u.declaredRisk,kind:"declared",label:d("plan.riskDeclared")}),(0,l.jsx)(j,{level:u.computedRisk,kind:"computed",label:d("plan.riskComputed")}),(0,l.jsx)(j,{level:u.effectiveRisk,kind:"effective",label:d("plan.riskEffective")})]}),(0,l.jsx)("p",{className:"break-words text-sm text-foreground",children:u.riskRationale}),(0,l.jsx)(c.u,{tone:"neutral",children:d("plan.riskNotice")})]}),(0,l.jsxs)("section",{className:"space-y-2","data-testid":"skill-plan-permissions",children:[(0,l.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:d("permissions.heading")}),u.declaredPermissions.length>0?(0,l.jsx)("div",{className:"flex flex-wrap gap-1.5",children:u.declaredPermissions.map(e=>(0,l.jsx)(r.Ex,{variant:"warning",children:k.z2[e]?d(k.z2[e]):e},e))}):(0,l.jsx)("p",{className:"text-sm text-muted-foreground",children:d("plan.permissionsNone")}),(0,l.jsx)(c.u,{tone:"warning",children:d("permissions.declarationOnlyNotice")})]}),(0,l.jsxs)("section",{className:"space-y-2","data-testid":"skill-plan-requirements",children:[(0,l.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:d("requirements.heading")}),0===u.requirements.commands.length&&0===u.requirements.networkHosts.length?(0,l.jsx)("p",{className:"text-sm text-muted-foreground",children:d("plan.requirementsNone")}):(0,l.jsxs)("dl",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[u.requirements.commands.length>0&&(0,l.jsx)(f,{label:d("plan.requirementsCommands"),children:u.requirements.commands.map(e=>{var t;return"".concat(e.name," ").concat(null!=(t=e.versionRange)?t:d("plan.commandAnyVersion"))}).join(", ")}),u.requirements.networkHosts.length>0&&(0,l.jsx)(f,{label:d("plan.requirementsHosts"),children:u.requirements.networkHosts.join(", ")})]})]}),(0,l.jsxs)("section",{className:"space-y-2","data-testid":"skill-plan-scripts",children:[(0,l.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:d("plan.scriptsHeading")}),0===u.executablePaths.length&&0===u.scriptPaths.length?(0,l.jsx)("p",{className:"text-sm text-muted-foreground",children:d("plan.scriptsNone")}):(0,l.jsx)("ul",{className:"space-y-1",children:[...new Set([...u.scriptPaths,...u.executablePaths])].map(e=>(0,l.jsx)("li",{className:"break-all font-mono text-xs text-foreground",children:e},e))})]}),"compatible"!==x.status&&(0,l.jsx)(c.u,{tone:"warning","data-testid":"skill-plan-compatibility-notice",children:d((0,k.e5)(x.messageKey),{range:x.requiredRange,currentVersion:null!=(a=x.currentVersion)?a:""})}),i.warnings.length>0&&(0,l.jsxs)("section",{className:"space-y-2","data-testid":"skill-plan-warnings",children:[(0,l.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:d("plan.warningsHeading")}),(0,l.jsx)("ul",{className:"space-y-1",children:i.warnings.map(e=>(0,l.jsx)("li",{className:"text-xs text-warning-foreground",children:k.RO[e]?d(k.RO[e]):e},e))})]}),(0,l.jsxs)("section",{className:"space-y-2","data-testid":"skill-plan-files",children:[(0,l.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:d("plan.filesHeading")}),(0,l.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"skill-plan-stats",children:d("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,l.jsx)("p",{className:"text-sm text-muted-foreground",children:d("plan.filesEmpty")}):(0,l.jsx)("ul",{className:"space-y-2",children:i.files.map(e=>(0,l.jsx)(b,{entry:e},e.path))})]}),i.blockers.length>0&&(0,l.jsxs)("section",{className:"space-y-2","data-testid":"skill-install-blockers",children:[(0,l.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-danger-foreground",children:d("plan.blockersHeading")}),(0,l.jsx)("ul",{className:"space-y-1",children:i.blockers.map(e=>{var t,s;return(0,l.jsxs)("li",{className:"text-xs text-danger-foreground",children:[e.path&&(0,l.jsx)("span",{className:"mr-1 break-all font-mono",children:e.path}),e.code.startsWith("skills.")?d((0,k.e5)(e.code),{range:x.requiredRange,currentVersion:null!=(t=x.currentVersion)?t:""}):k.KL[e.code]?d(k.KL[e.code]):e.code]},"".concat(e.code,":").concat(null!=(s=e.path)?s:""))})}),(0,l.jsx)(c.u,{tone:"danger",children:d("plan.blockedNotice")})]})]})}function N(e){let{entry:t}=e,s=(0,n.c)("skills"),a=k.Mj[t.disposition],i=k.hJ[t.reason];return(0,l.jsxs)("li",{className:"flex flex-wrap items-center gap-2","data-testid":"skill-uninstall-file-".concat(t.path),children:[(0,l.jsx)(r.Ex,{variant:"remove"===t.disposition?"info":"warning",children:a?s(a):t.disposition}),(0,l.jsx)("span",{className:"break-all font-mono text-xs text-foreground",children:t.path}),i&&(0,l.jsx)("span",{className:"text-xs text-muted-foreground",children:s(i)})]})}function w(e){var t;let{plan:s}=e,a=(0,n.c)("skills"),{target:d,skill:o}=s;return(0,l.jsxs)(r.Zp,{className:"space-y-4","data-testid":"skill-uninstall-plan",children:[(0,l.jsxs)("div",{className:"space-y-1",children:[(0,l.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:a("uninstall.heading")}),(0,l.jsx)("p",{className:"text-xs text-muted-foreground",children:a("uninstall.expiresAt",{timestamp:s.expiresAt})})]}),(0,l.jsxs)("dl",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[(0,l.jsx)(f,{label:a("target.repository"),children:d.repositoryName}),(0,l.jsx)(f,{label:a("target.heading"),children:d.worktreeName}),(0,l.jsx)(f,{label:a("target.branch"),children:null!=(t=d.branch)?t:a("target.branchUnknown")}),(0,l.jsx)(f,{label:a("uninstall.installedVersion"),children:(0,l.jsx)("span",{className:"font-mono text-xs",children:o.version||a("uninstall.versionUnknown")})}),(0,l.jsx)(f,{label:a("plan.installRoot"),children:(0,l.jsx)("span",{className:"break-all font-mono text-xs",children:d.installRoot})}),(0,l.jsx)(f,{label:a("target.workingTree"),children:d.workingTreeDirty?a("target.workingTreeDirty"):a("target.workingTreeClean")})]}),(0,l.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"skill-uninstall-stats",children:a("uninstall.stats",{removable:s.stats.removable,modified:s.stats.modified,missing:s.stats.missing,unknown:s.stats.unknown,irregular:s.stats.irregular})}),(0,l.jsxs)("section",{className:"space-y-2",children:[(0,l.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:a("uninstall.removalsHeading")}),0===s.removals.length?(0,l.jsx)("p",{className:"text-sm text-muted-foreground",children:a("uninstall.removalsEmpty")}):(0,l.jsx)("ul",{className:"space-y-1.5",children:s.removals.map(e=>(0,l.jsx)(N,{entry:e},e.path))})]}),(0,l.jsxs)("section",{className:"space-y-2",children:[(0,l.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:a("uninstall.retainedHeading")}),0===s.retained.length?(0,l.jsx)("p",{className:"text-sm text-muted-foreground",children:a("uninstall.retainedEmpty")}):(0,l.jsx)("ul",{className:"space-y-1.5",children:s.retained.map(e=>(0,l.jsx)(N,{entry:e},e.path))})]}),(0,l.jsxs)("div",{className:"space-y-2",children:[s.skill.agents.length>0&&(0,l.jsx)("div",{className:"flex flex-wrap gap-1.5","data-testid":"skill-uninstall-agents",children:s.skill.agents.map(e=>(0,l.jsx)(r.Ex,{variant:"gray",children:(0,i.f_)(e.agent)},e.agent))}),(0,l.jsx)(c.u,{tone:"neutral",children:a((0,k.e5)(s.nextActionKey))})]}),s.blockers.length>0&&(0,l.jsxs)("section",{className:"space-y-2","data-testid":"skill-uninstall-blockers",children:[(0,l.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-danger-foreground",children:a("uninstall.blockersHeading")}),(0,l.jsx)("ul",{className:"space-y-1",children:s.blockers.map(e=>{var t;return(0,l.jsxs)("li",{className:"text-xs text-danger-foreground",children:[e.path&&(0,l.jsx)("span",{className:"mr-1 break-all font-mono",children:e.path}),a((0,k.e5)(e.messageKey))]},"".concat(e.code,":").concat(null!=(t=e.path)?t:""))})})]})]})}var v=s(80130);let R={worktreeId:null,busy:null,installPlan:null,uninstallPlan:null,installResult:null,uninstallResult:null,riskAcknowledged:!1,failure:null};function C(e){return{...e,installPlan:null,uninstallPlan:null,installResult:null,uninstallResult:null,riskAcknowledged:!1,failure:null}}function A(e,t){return"".concat(e,"-").concat(t)}function I(e){let{failure:t}=e,s=(0,n.c)("skills");return(0,l.jsxs)("div",{className:"space-y-2","data-testid":"skill-operation-error",children:[(0,l.jsxs)(c.u,{tone:"danger",children:[(0,l.jsx)("p",{className:"font-medium",children:s("operation.errorHeading")}),(0,l.jsx)("p",{className:"mt-1",children:s((0,k.FW)(t.code))}),(0,l.jsx)("p",{className:"mt-1 break-words",children:s("state.errorCode",{code:t.code})})]}),t.nextActionKey&&(0,l.jsx)(c.u,{tone:"warning",children:s((0,k.e5)(t.nextActionKey))}),t.blockers&&t.blockers.length>0&&(0,l.jsx)("ul",{className:"space-y-1","data-testid":"skill-operation-error-blockers",children:t.blockers.map(e=>{var t;return(0,l.jsxs)("li",{className:"text-xs text-danger-foreground",children:[e.path&&(0,l.jsx)("span",{className:"mr-1 break-all font-mono",children:e.path}),s((0,k.e5)(e.messageKey))]},"".concat(e.code,":").concat(null!=(t=e.path)?t:""))})})]})}function P(e){let{agents:t,skillId:s,version:a}=e,r=(0,n.c)("skills");return 0===t.length?null:(0,l.jsxs)("div",{className:"space-y-1","data-testid":"skill-operation-reload",children:[(0,l.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:r("operation.reloadHeading")}),(0,l.jsx)("ul",{className:"space-y-1",children:t.map(e=>(0,l.jsx)("li",{className:"text-xs text-muted-foreground",children:r((0,k.e5)(e.messageKey),{agent:(0,i.f_)(e.agent),skillId:s,version:a})},e.agent))})]})}function K(e){var t;let{skillId:s,version:i,blockedReason:u,worktreeId:x,agents:m=[]}=e,g=(0,n.c)("skills"),[h,f]=(0,a.useState)(()=>x?{...R,worktreeId:x}:R),j=(0,a.useCallback)(e=>{f(t=>t.worktreeId===e?t:C({...t,worktreeId:e,busy:null}))},[]);(0,a.useEffect)(()=>{x&&j(x)},[x,j]);let b=(0,a.useCallback)(async()=>{let e=h.worktreeId;if(!e)return;f(e=>({...C(e),busy:"install-plan"}));let t=await (0,v.Q6)(e,s,{version:null!=i?i:void 0});f(e=>({...e,busy:null,installPlan:t.ok?t.data.plan:null,failure:t.ok?null:t.failure}))},[s,h.worktreeId,i]),N=(0,a.useCallback)(async()=>{let e=h.worktreeId,t=h.installPlan;if(!e||!t||t.requiresRiskAcknowledgement&&!h.riskAcknowledged)return;f(e=>({...e,busy:"install-apply",failure:null}));let l=await (0,v.Xi)(e,s,{planToken:t.token,version:t.skill.version,acknowledgeRisk:!!t.requiresRiskAcknowledgement||void 0,idempotencyKey:A("skill-install",t.token)});l.ok&&(0,d.k)(e),f(e=>({...e,busy:null,installPlan:l.ok?null:e.installPlan,installResult:l.ok?l.data:null,failure:l.ok?null:l.failure}))},[s,h.installPlan,h.riskAcknowledged,h.worktreeId]),K=(0,a.useCallback)(async()=>{let e=h.worktreeId;if(!e)return;f(e=>({...C(e),busy:"uninstall-plan"}));let t=await (0,v.hN)(e,s);f(e=>({...e,busy:null,uninstallPlan:t.ok?t.data.plan:null,failure:t.ok?null:t.failure}))},[s,h.worktreeId]),E=(0,a.useCallback)(async()=>{let e=h.worktreeId,t=h.uninstallPlan;if(!e||!t)return;f(e=>({...e,busy:"uninstall-apply",failure:null}));let l=await (0,v.E)(e,s,{planToken:t.token,idempotencyKey:A("skill-uninstall",t.token)});f(e=>({...e,busy:null,uninstallPlan:l.ok?null:e.uninstallPlan,uninstallResult:l.ok?l.data:null,failure:l.ok?null:l.failure}))},[s,h.uninstallPlan,h.worktreeId]),T=(0,a.useCallback)(()=>{f(e=>C(e))},[]),H=null!==h.busy,S=h.installPlan,q=h.uninstallPlan,D=null!=u?u:g(h.worktreeId?"plan.ready":"plan.chooseTarget"),V=null!==S&&S.requiresRiskAcknowledgement&&!h.riskAcknowledged;return(0,l.jsxs)("div",{className:"space-y-3","data-testid":"skill-install-panel",children:[!x&&(0,l.jsx)(p,{selectedWorktreeId:h.worktreeId,onSelect:j,disabled:H}),(0,l.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,l.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,l.jsx)(r.$n,{variant:"secondary",disabled:H||!h.worktreeId,onClick:K,"data-testid":"skill-uninstall-action",children:g("uninstall-plan"===h.busy?"uninstall.building":"uninstall.build")})]}),(0,l.jsx)("p",{id:"skill-install-reason",className:"text-sm text-muted-foreground","data-testid":"skill-install-reason",children:D}),m.length>0&&(0,l.jsxs)("div",{className:"space-y-1","data-testid":"skill-install-reload-preview",children:[(0,l.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:g("operation.reloadHeading")}),(0,l.jsx)("ul",{className:"space-y-1",children:m.map(e=>(0,l.jsx)(o.m,{agent:e,variant:"reload"},e.agent))})]}),h.failure&&(0,l.jsx)(I,{failure:h.failure}),S&&(0,l.jsxs)("div",{className:"space-y-3",children:[(0,l.jsx)(y,{plan:S}),S.requiresRiskAcknowledgement&&(0,l.jsxs)(r.Zp,{className:"space-y-3","data-testid":"skill-install-risk-acknowledgement",children:[(0,l.jsx)(c.u,{tone:"danger",children:g((0,k.e5)(null!=(t=S.riskAcknowledgementMessageKey)?t:"skills.plan.highRiskAcknowledgement"))}),(0,l.jsxs)("label",{className:"flex items-start gap-2 text-sm text-foreground",children:[(0,l.jsx)(r.Sc,{checked:h.riskAcknowledged,onCheckedChange:e=>f(t=>({...t,riskAcknowledged:!0===e})),disabled:H,"data-testid":"skill-install-risk-checkbox",className:"mt-0.5"}),(0,l.jsx)("span",{children:g("plan.acknowledgeLabel")})]})]}),(0,l.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,l.jsx)(r.$n,{variant:S.requiresRiskAcknowledgement?"danger":"primary",disabled:H||!S.installable||V,onClick:N,"data-testid":"skill-install-confirm",children:g("install-apply"===h.busy?"plan.confirming":"plan.confirm")}),(0,l.jsx)(r.$n,{variant:"ghost",disabled:H,onClick:T,"data-testid":"skill-install-discard",children:g("plan.discard")})]})]}),q&&(0,l.jsxs)("div",{className:"space-y-3",children:[(0,l.jsx)(w,{plan:q}),(0,l.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,l.jsx)(r.$n,{variant:"danger",disabled:H||!q.removable,onClick:E,"data-testid":"skill-uninstall-confirm",children:g("uninstall-apply"===h.busy?"uninstall.confirming":"uninstall.confirm")}),(0,l.jsx)(r.$n,{variant:"ghost",disabled:H,onClick:T,"data-testid":"skill-uninstall-discard",children:g("plan.discard")})]})]}),h.installResult&&(0,l.jsxs)(r.Zp,{className:"space-y-3","data-testid":"skill-install-result",children:[(0,l.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:g("operation.installedHeading")}),(0,l.jsx)(c.u,{tone:"info",children:g((0,k.e5)(h.installResult.operation.nextActionKey))}),h.installResult.operation.replayed&&(0,l.jsx)(c.u,{tone:"neutral","data-testid":"skill-operation-replayed",children:g("operation.replayNotice")}),h.installResult.install&&"files"in h.installResult.install&&(0,l.jsx)("p",{className:"text-xs text-muted-foreground",children:g("operation.filesWritten",{count:h.installResult.install.files.length})}),"reload"in h.installResult&&(0,l.jsx)(P,{agents:h.installResult.reload.agents,skillId:h.installResult.reload.skillId,version:h.installResult.reload.version}),(0,l.jsx)(r.$n,{variant:"secondary",size:"sm",onClick:T,"data-testid":"skill-operation-reset",children:g("operation.startOver")})]}),h.uninstallResult&&(0,l.jsxs)(r.Zp,{className:"space-y-3","data-testid":"skill-uninstall-result",children:[(0,l.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:g("operation.uninstalledHeading")}),(0,l.jsx)(c.u,{tone:"info",children:g((0,k.e5)(h.uninstallResult.operation.nextActionKey))}),h.uninstallResult.operation.replayed&&(0,l.jsx)(c.u,{tone:"neutral","data-testid":"skill-operation-replayed",children:g("operation.replayNotice")}),h.uninstallResult.uninstall&&"removedFiles"in h.uninstallResult.uninstall&&(0,l.jsx)("p",{className:"text-xs text-muted-foreground",children:g("operation.filesRemoved",{count:h.uninstallResult.uninstall.removedFiles.length})}),"reload"in h.uninstallResult&&(0,l.jsx)(P,{agents:h.uninstallResult.reload.agents,skillId:h.uninstallResult.reload.skillId,version:h.uninstallResult.reload.version}),(0,l.jsx)(r.$n,{variant:"secondary",size:"sm",onClick:T,"data-testid":"skill-operation-reset",children:g("operation.startOver")})]})]})}},50666:(e,t,s)=>{s.d(t,{Ck:()=>r});var l=s(95155),a=s(12115),n=s(53482);function r(e){let{children:t,as:s="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(""):a.isValidElement(t)?e(t.props.children):""}(t);if(!i||0===i.trim().length)return(0,l.jsx)(s,{className:r||void 0,children:t});let d="relative group ".concat("span"===s?"block ":"").concat(r).trim();return(0,l.jsxs)(s,{className:d,"data-testid":"code-block-with-copy",children:[t,(0,l.jsx)(n.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,s)=>{s.d(t,{m:()=>o});var l=s(95155);s(12115);var a=s(18955),n=s(54014),r=s(37381),i=s(95584);function d(e){let{axis:t,agentName:s}=e,n=(0,a.c)("skills");return(0,l.jsxs)("li",{className:"text-xs text-muted-foreground","data-testid":"skill-agent-axis-".concat(t.axis),children:[(0,l.jsx)("span",{className:"font-medium text-foreground",children:n((0,i.e5)(t.axisKey))}),": ",(0,l.jsx)("span",{"data-testid":"skill-agent-axis-".concat(t.axis,"-").concat(t.outcome),children:n((0,i.e5)(t.outcomeKey))})," — ",n((0,i.e5)(t.evidenceKindKey)),t.limitationKey&&(0,l.jsx)("span",{className:"mt-0.5 block","data-testid":"skill-agent-axis-".concat(t.axis,"-limitation"),children:n((0,i.e5)(t.limitationKey),{agent:s})})]})}function o(e){var t;let{agent:s,variant:o="full"}=e,c=(0,a.c)("skills"),u=(0,n.f_)(s.agent),x=s.measured;return"reload"===o?(0,l.jsx)("li",{className:"text-xs text-muted-foreground","data-testid":"skill-agent-reload-".concat(s.agent),children:c((0,i.e5)(s.reloadKey),{agent:u})}):(0,l.jsxs)("div",{className:"space-y-1","data-testid":"skill-agent-evidence-".concat(s.agent),children:[(0,l.jsx)("p",{className:"text-xs font-medium text-foreground",children:u}),(0,l.jsx)("p",{className:"text-xs text-muted-foreground break-words",children:c("compatibility.declaredLabel",{support:c((0,i.e5)(s.declaredLabelKey))})}),(0,l.jsxs)("p",{className:"text-xs text-muted-foreground break-words",children:[c("compatibility.evidence"),": ",s.evidence]}),(0,l.jsx)("p",{className:"text-xs text-muted-foreground break-words","data-testid":"skill-agent-verification-".concat(s.agent),children:c((0,i.e5)(s.verificationKey))}),x?(0,l.jsxs)("div",{className:"space-y-0.5 border-l-2 border-border pl-2",children:[(0,l.jsx)("p",{className:"text-xs font-medium text-foreground",children:c("compatibility.measuredHeading")}),(0,l.jsxs)("ul",{className:"space-y-0.5",children:[(0,l.jsx)(d,{axis:x.discovery,agentName:u}),(0,l.jsx)(d,{axis:x.invocation,agentName:u})]}),x.testedVersion&&(0,l.jsx)("p",{className:"text-xs text-muted-foreground",children:c("compatibility.testedVersion",{agent:u,version:x.testedVersion})}),x.testedDate&&(0,l.jsx)("p",{className:"text-xs text-muted-foreground",children:c("compatibility.testedDate",{date:x.testedDate})}),x.discoveryRoots.length>0&&(0,l.jsx)("p",{className:"text-xs text-muted-foreground break-all",children:c("compatibility.discoveryRoots",{roots:x.discoveryRoots.join(", ")})}),x.evidenceSource&&(0,l.jsxs)("p",{className:"text-xs text-muted-foreground break-all",children:[c("compatibility.evidenceSource"),": ",x.evidenceSource]}),x.stale&&(0,l.jsx)(r.u,{tone:"warning","data-testid":"skill-agent-evidence-stale-".concat(s.agent),children:c("compatibility.evidenceStale",{days:null!=(t=x.ageDays)?t:0})})]}):s.skipReasonKey&&(0,l.jsx)("p",{className:"text-xs text-muted-foreground break-words","data-testid":"skill-agent-skip-reason-".concat(s.agent),children:c((0,i.e5)(s.skipReasonKey))}),(0,l.jsxs)("p",{className:"text-xs text-muted-foreground break-words",children:[(0,l.jsx)("span",{className:"font-medium text-foreground",children:c("compatibility.reloadHeading",{agent:u})}),": ",c((0,i.e5)(s.reloadKey),{agent:u})]})]})}},53482:(e,t,s)=>{s.d(t,{i:()=>o});var l=s(95155),a=s(12115),n=s(60322),r=s(9900);function i(){return(0,l.jsx)("svg",{className:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,l.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 d(){return(0,l.jsx)("svg",{className:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})}function o(e){let{text:t,className:s="",label:o="Copy"}=e,[c,u]=(0,a.useState)(!1),x=(0,a.useRef)(null);(0,a.useEffect)(()=>()=>{x.current&&clearTimeout(x.current)},[]);let m=(0,a.useCallback)(async()=>{try{await (0,n.l)(t),u(!0),x.current&&clearTimeout(x.current),x.current=setTimeout(()=>u(!1),r.s7)}catch(e){}},[t]);return(0,l.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(s),"aria-label":c?"Copied":o,title:c?"Copied!":o,children:[c?(0,l.jsx)(d,{}):(0,l.jsx)(i,{}),(0,l.jsx)("span",{children:c?"Copied":o})]})}},75333:(e,t,s)=>{s.d(t,{Xz:()=>o,qW:()=>c,uE:()=>u});var l=s(95155);s(12115);var a=s(18955),n=s(77801),r=s(48407),i=s(54014),d=s(95584);function o(e){let{status:t,className:s}=e,n=(0,a.c)("skills");return(0,l.jsx)(r.Ex,{variant:d.H$[t],className:s,"data-testid":"skill-compatibility-".concat(t),children:n(d.OV[t])})}function c(e){let{risk:t,className:s}=e,i=(0,a.c)("skills");return(0,l.jsxs)(r.Ex,{variant:d.eK[t],className:s,"data-testid":"skill-declared-risk-".concat(t),children:["high"===t&&(0,l.jsx)(n.A,{size:12,"aria-hidden":"true",className:"mr-1 shrink-0"}),i("risk.declaredLabel",{level:i(d.pP[t])})]})}function u(e){let{agent:t}=e,s=(0,a.c)("skills");return(0,l.jsxs)(r.Ex,{variant:d.Et[t.support],"data-testid":"skill-agent-".concat(t.agent,"-").concat(t.support),children:[(0,i.f_)(t.agent),": ",s((0,d.e5)(t.labelKey))]})}},99648:(e,t,s)=>{s.d(t,{Co:()=>l,Ms:()=>n,td:()=>a});let l=".agents/skills",a=".claude/skills",n="skills.permissions.declarationOnlyNotice"}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2407],{52407:(e,t,n)=>{n.d(t,{Fx:()=>h,Rh:()=>b,_X:()=>c,fl:()=>s,nG:()=>d,sV:()=>o});var r=n(12115),u=n(60199);let l="/api/capabilities";function c(e){return!1!==e.browserOnline&&("connected"===e.realtimeStatus||!0===e.serverReachable)}function o(e){return!1===e.browserOnline||!1===e.serverReachable}let i=new Map;async function a(e,t){let n="function"==typeof AbortController?new AbortController:void 0,r=n?setTimeout(()=>n.abort(),t):void 0;try{return await fetch(e,{method:"GET",cache:"no-store",credentials:"same-origin",signal:null==n?void 0:n.signal}),!0}catch(e){return!1}finally{void 0!==r&&clearTimeout(r)}}function s(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5e3;if("function"!=typeof fetch)return Promise.resolve(!1);let n=i.get(e);if(n)return n;let r=a(e,t).finally(()=>{i.delete(e)});return i.set(e,r),r}let f=new Set;function d(e){f.forEach(t=>{try{t(e)}catch(e){}})}function b(e){return f.add(e),()=>{f.delete(e)}}function h(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{probeUrl:t=l,probeDelayMs:n=1e3,probeIntervalMs:c=15e3,probeTimeoutMs:o=5e3,surfaceDelayMs:i=1500,probe:a=!0}=e,{status:f}=(0,u.xM)(),[d,h]=(0,r.useState)(!0),[v,y]=(0,r.useState)(null),[w,m]=(0,r.useState)(null),p=(0,r.useCallback)(e=>{y(t=>t===e?t:e),e&&m(Date.now())},[]);(0,r.useEffect)(()=>{if("undefined"==typeof navigator)return;h(!1!==navigator.onLine);let e=()=>{y(null),h(!0)},t=()=>{y(null),h(!1)};return window.addEventListener("online",e),window.addEventListener("offline",t),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",t)}},[]),(0,r.useEffect)(()=>{"connected"===f&&p(!0)},[f,p]),(0,r.useEffect)(()=>b(p),[p]);let g=(0,r.useMemo)(()=>({browserOnline:d,realtimeStatus:f,serverReachable:v}),[d,f,v]),S=g.browserOnline?"connected"===g.realtimeStatus?"online":!1===g.serverReachable?"offline":!0===g.serverReachable||"connecting"===g.realtimeStatus?"reconnecting":"offline":"offline",E="online"!==S,k=(0,r.useRef)({url:t,timeoutMs:o});k.current={url:t,timeoutMs:o};let C=a&&E&&d;(0,r.useEffect)(()=>{let e;if(!C||"function"!=typeof fetch)return;let t=!1,r=async()=>{let{url:n,timeoutMs:u}=k.current,l=await s(n,u);t||(p(l),e=setTimeout(r,c))};return e=setTimeout(r,n),()=>{t=!0,void 0!==e&&clearTimeout(e)}},[C,n,c,p]);let[R,T]=(0,r.useState)(!1);(0,r.useEffect)(()=>{if(!E)return void T(!1);if(i<=0)return void T(!0);let e=setTimeout(()=>T(!0),i);return()=>clearTimeout(e)},[E,i]);let M=(0,r.useCallback)(()=>{if("function"!=typeof fetch)return;let{url:e,timeoutMs:t}=k.current;s(e,t).then(p)},[p]);return(0,r.useMemo)(()=>({status:S,isOnline:"online"===S,isReconnecting:"reconnecting"===S,isOffline:"offline"===S,shouldSurface:E&&R,signals:g,lastReachableAt:w,recheck:M}),[S,E,R,g,w,M])}},52703:(e,t,n)=>{n.d(t,{Oo:()=>u,ST:()=>r,T4:()=>o,dz:()=>c,rz:()=>l,zS:()=>i});let r="client_version",u="version_mismatch",l="chat_turn_progress",c="messages_invalidated",o="model_changed";function i(e){let t;try{t=JSON.parse(e)}catch(e){return null}if(!t||"object"!=typeof t)return null;let n=t;if("broadcast"===n.type){let e=n.data;return e&&"object"==typeof e?"string"!=typeof e.type?null:(void 0===e.worktreeId&&"string"==typeof n.worktreeId&&(e.worktreeId=n.worktreeId),e):null}return"string"==typeof n.type?n:null}},60199:(e,t,n)=>{n.d(t,{tS:()=>s,xM:()=>f,T3:()=>d});var r=n(95155),u=n(12115),l=n(52703);function c(){return"undefined"!=typeof globalThis&&"function"==typeof globalThis.WebSocket?globalThis.WebSocket:null}let o=()=>{},i={status:"disconnected",connected:!1,subscribe:o,unsubscribe:o,addListener:()=>o},a=(0,u.createContext)(null);function s(e){let{children:t,enabled:n=!0}=e,o=(0,u.useRef)(new Set),i=(0,u.useRef)(new Map),{status:s,subscribe:f,unsubscribe:d}=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{onEvent:t,onStatusChange:n,autoReconnect:r=!0,reconnectBaseDelay:o=1e3,reconnectMaxDelay:i=3e4,livenessTimeout:a=75e3,livenessCheckInterval:s=5e3,enabled:f=!0}=e,[d,b]=(0,u.useState)("disconnected"),h=(0,u.useRef)(null),v=(0,u.useRef)(null),y=(0,u.useRef)(0),w=(0,u.useRef)(new Set),m=(0,u.useRef)(!1),p=(0,u.useRef)(0),g=(0,u.useRef)(()=>{}),S=(0,u.useRef)(t);S.current=t;let E=(0,u.useRef)(n);E.current=n;let k=(0,u.useCallback)(e=>{var t;b(e),null==(t=E.current)||t.call(E,e)},[]),C=(0,u.useCallback)(()=>{null!==v.current&&(clearTimeout(v.current),v.current=null)},[]),R=(0,u.useCallback)(()=>{if(m.current||!r||"undefined"!=typeof document&&"hidden"===document.visibilityState)return;C();let e=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Math.random;return Math.max(0,Math.round(Math.min(t*2**Math.max(0,e),n)*(1+(2*r()-1)*.2)))}(y.current,o,i);y.current+=1,v.current=setTimeout(()=>{v.current=null,g.current()},e)},[r,o,i,C]),T=(0,u.useCallback)(()=>{if(!f)return;let e=c();if(!e||h.current&&(h.current.readyState===e.OPEN||h.current.readyState===e.CONNECTING))return;C(),m.current=!1,p.current=Date.now(),k("connecting");let t="https:"===window.location.protocol?"wss:":"ws:",n=new e("".concat(t,"//").concat(window.location.host));h.current=n,n.onopen=()=>{y.current=0,p.current=Date.now(),k("connected");try{n.send(JSON.stringify({type:l.ST,version:"0.43.0"}))}catch(e){}w.current.forEach(e=>{try{n.send(JSON.stringify({type:"subscribe",worktreeId:e}))}catch(e){}})},n.onmessage=e=>{var t;p.current=Date.now();let n="string"==typeof e.data?e.data:String(e.data),r=(0,l.zS)(n);r&&"heartbeat"!==r.type&&(null==(t=S.current)||t.call(S,r))},n.onerror=()=>{k("error")},n.onclose=()=>{h.current=null,k("disconnected"),R()}},[f,k,C,R]);g.current=T;let M=(0,u.useCallback)(()=>{let e=h.current;if(e){e.onopen=null,e.onmessage=null,e.onerror=null,e.onclose=null,h.current=null;try{e.close(4001,"half-open")}catch(e){}k("disconnected"),R()}},[k,R]),O=(0,u.useCallback)(()=>{if(C(),m.current=!0,h.current){try{h.current.close(1e3,"Client disconnect")}catch(e){}h.current=null}},[C]),N=(0,u.useCallback)(e=>{let t=h.current,n=c();if(t&&n&&t.readyState===n.OPEN)try{t.send(JSON.stringify(e))}catch(e){}},[]),_=(0,u.useCallback)(e=>{w.current.has(e)||(w.current.add(e),N({type:"subscribe",worktreeId:e}))},[N]),L=(0,u.useCallback)(e=>{w.current.has(e)&&(w.current.delete(e),N({type:"unsubscribe",worktreeId:e}))},[N]);return(0,u.useEffect)(()=>{if(f)return T(),()=>{O()}},[f,T,O]),(0,u.useEffect)(()=>{if(!f)return;let e=setInterval(()=>{let e=h.current,t=c();e&&t&&e.readyState===t.OPEN&&(Date.now()-p.current<a||M())},s);return()=>clearInterval(e)},[f,a,s,M]),(0,u.useEffect)(()=>{if(!f||"undefined"==typeof document)return;let e=()=>{"visible"===document.visibilityState&&(h.current||(y.current=0,T()))};return document.addEventListener("visibilitychange",e),()=>document.removeEventListener("visibilitychange",e)},[f,T]),(0,u.useEffect)(()=>{if(!f)return;let e=()=>{h.current||(y.current=0,T())};return window.addEventListener("online",e),()=>window.removeEventListener("online",e)},[f,T]),{status:d,subscribe:_,unsubscribe:L,send:N}}({enabled:n,onEvent:(0,u.useCallback)(e=>{o.current.forEach(t=>{try{t(e)}catch(e){}})},[])}),b=(0,u.useCallback)(e=>{var t;let n=i.current,r=null!=(t=n.get(e))?t:0;n.set(e,r+1),0===r&&f(e)},[f]),h=(0,u.useCallback)(e=>{var t;let n=i.current,r=null!=(t=n.get(e))?t:0;r<=1?(n.delete(e),d(e)):n.set(e,r-1)},[d]),v=(0,u.useCallback)(e=>(o.current.add(e),()=>{o.current.delete(e)}),[]),y=(0,u.useMemo)(()=>({status:s,connected:"connected"===s,subscribe:b,unsubscribe:h,addListener:v}),[s,b,h,v]);return(0,r.jsx)(a.Provider,{value:y,children:t})}function f(){var e;return null!=(e=(0,u.useContext)(a))?e:i}function d(e){let{addListener:t}=f(),n=(0,u.useRef)(e);n.current=e,(0,u.useEffect)(()=>t(e=>n.current(e)),[t])}}}]);
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2407],{52407:(e,t,n)=>{n.d(t,{Fx:()=>h,Rh:()=>b,_X:()=>c,fl:()=>s,nG:()=>d,sV:()=>o});var r=n(12115),u=n(60199);let l="/api/capabilities";function c(e){return!1!==e.browserOnline&&("connected"===e.realtimeStatus||!0===e.serverReachable)}function o(e){return!1===e.browserOnline||!1===e.serverReachable}let i=new Map;async function a(e,t){let n="function"==typeof AbortController?new AbortController:void 0,r=n?setTimeout(()=>n.abort(),t):void 0;try{return await fetch(e,{method:"GET",cache:"no-store",credentials:"same-origin",signal:null==n?void 0:n.signal}),!0}catch(e){return!1}finally{void 0!==r&&clearTimeout(r)}}function s(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5e3;if("function"!=typeof fetch)return Promise.resolve(!1);let n=i.get(e);if(n)return n;let r=a(e,t).finally(()=>{i.delete(e)});return i.set(e,r),r}let f=new Set;function d(e){f.forEach(t=>{try{t(e)}catch(e){}})}function b(e){return f.add(e),()=>{f.delete(e)}}function h(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{probeUrl:t=l,probeDelayMs:n=1e3,probeIntervalMs:c=15e3,probeTimeoutMs:o=5e3,surfaceDelayMs:i=1500,probe:a=!0}=e,{status:f}=(0,u.xM)(),[d,h]=(0,r.useState)(!0),[v,y]=(0,r.useState)(null),[w,m]=(0,r.useState)(null),p=(0,r.useCallback)(e=>{y(t=>t===e?t:e),e&&m(Date.now())},[]);(0,r.useEffect)(()=>{if("undefined"==typeof navigator)return;h(!1!==navigator.onLine);let e=()=>{y(null),h(!0)},t=()=>{y(null),h(!1)};return window.addEventListener("online",e),window.addEventListener("offline",t),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",t)}},[]),(0,r.useEffect)(()=>{"connected"===f&&p(!0)},[f,p]),(0,r.useEffect)(()=>b(p),[p]);let g=(0,r.useMemo)(()=>({browserOnline:d,realtimeStatus:f,serverReachable:v}),[d,f,v]),S=g.browserOnline?"connected"===g.realtimeStatus?"online":!1===g.serverReachable?"offline":!0===g.serverReachable||"connecting"===g.realtimeStatus?"reconnecting":"offline":"offline",E="online"!==S,k=(0,r.useRef)({url:t,timeoutMs:o});k.current={url:t,timeoutMs:o};let C=a&&E&&d;(0,r.useEffect)(()=>{let e;if(!C||"function"!=typeof fetch)return;let t=!1,r=async()=>{let{url:n,timeoutMs:u}=k.current,l=await s(n,u);t||(p(l),e=setTimeout(r,c))};return e=setTimeout(r,n),()=>{t=!0,void 0!==e&&clearTimeout(e)}},[C,n,c,p]);let[R,T]=(0,r.useState)(!1);(0,r.useEffect)(()=>{if(!E)return void T(!1);if(i<=0)return void T(!0);let e=setTimeout(()=>T(!0),i);return()=>clearTimeout(e)},[E,i]);let M=(0,r.useCallback)(()=>{if("function"!=typeof fetch)return;let{url:e,timeoutMs:t}=k.current;s(e,t).then(p)},[p]);return(0,r.useMemo)(()=>({status:S,isOnline:"online"===S,isReconnecting:"reconnecting"===S,isOffline:"offline"===S,shouldSurface:E&&R,signals:g,lastReachableAt:w,recheck:M}),[S,E,R,g,w,M])}},52703:(e,t,n)=>{n.d(t,{Oo:()=>u,ST:()=>r,T4:()=>o,dz:()=>c,rz:()=>l,zS:()=>i});let r="client_version",u="version_mismatch",l="chat_turn_progress",c="messages_invalidated",o="model_changed";function i(e){let t;try{t=JSON.parse(e)}catch(e){return null}if(!t||"object"!=typeof t)return null;let n=t;if("broadcast"===n.type){let e=n.data;return e&&"object"==typeof e?"string"!=typeof e.type?null:(void 0===e.worktreeId&&"string"==typeof n.worktreeId&&(e.worktreeId=n.worktreeId),e):null}return"string"==typeof n.type?n:null}},60199:(e,t,n)=>{n.d(t,{tS:()=>s,xM:()=>f,T3:()=>d});var r=n(95155),u=n(12115),l=n(52703);function c(){return"undefined"!=typeof globalThis&&"function"==typeof globalThis.WebSocket?globalThis.WebSocket:null}let o=()=>{},i={status:"disconnected",connected:!1,subscribe:o,unsubscribe:o,addListener:()=>o},a=(0,u.createContext)(null);function s(e){let{children:t,enabled:n=!0}=e,o=(0,u.useRef)(new Set),i=(0,u.useRef)(new Map),{status:s,subscribe:f,unsubscribe:d}=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{onEvent:t,onStatusChange:n,autoReconnect:r=!0,reconnectBaseDelay:o=1e3,reconnectMaxDelay:i=3e4,livenessTimeout:a=75e3,livenessCheckInterval:s=5e3,enabled:f=!0}=e,[d,b]=(0,u.useState)("disconnected"),h=(0,u.useRef)(null),v=(0,u.useRef)(null),y=(0,u.useRef)(0),w=(0,u.useRef)(new Set),m=(0,u.useRef)(!1),p=(0,u.useRef)(0),g=(0,u.useRef)(()=>{}),S=(0,u.useRef)(t);S.current=t;let E=(0,u.useRef)(n);E.current=n;let k=(0,u.useCallback)(e=>{var t;b(e),null==(t=E.current)||t.call(E,e)},[]),C=(0,u.useCallback)(()=>{null!==v.current&&(clearTimeout(v.current),v.current=null)},[]),R=(0,u.useCallback)(()=>{if(m.current||!r||"undefined"!=typeof document&&"hidden"===document.visibilityState)return;C();let e=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Math.random;return Math.max(0,Math.round(Math.min(t*2**Math.max(0,e),n)*(1+(2*r()-1)*.2)))}(y.current,o,i);y.current+=1,v.current=setTimeout(()=>{v.current=null,g.current()},e)},[r,o,i,C]),T=(0,u.useCallback)(()=>{if(!f)return;let e=c();if(!e||h.current&&(h.current.readyState===e.OPEN||h.current.readyState===e.CONNECTING))return;C(),m.current=!1,p.current=Date.now(),k("connecting");let t="https:"===window.location.protocol?"wss:":"ws:",n=new e("".concat(t,"//").concat(window.location.host));h.current=n,n.onopen=()=>{y.current=0,p.current=Date.now(),k("connected");try{n.send(JSON.stringify({type:l.ST,version:"0.44.1"}))}catch(e){}w.current.forEach(e=>{try{n.send(JSON.stringify({type:"subscribe",worktreeId:e}))}catch(e){}})},n.onmessage=e=>{var t;p.current=Date.now();let n="string"==typeof e.data?e.data:String(e.data),r=(0,l.zS)(n);r&&"heartbeat"!==r.type&&(null==(t=S.current)||t.call(S,r))},n.onerror=()=>{k("error")},n.onclose=()=>{h.current=null,k("disconnected"),R()}},[f,k,C,R]);g.current=T;let M=(0,u.useCallback)(()=>{let e=h.current;if(e){e.onopen=null,e.onmessage=null,e.onerror=null,e.onclose=null,h.current=null;try{e.close(4001,"half-open")}catch(e){}k("disconnected"),R()}},[k,R]),O=(0,u.useCallback)(()=>{if(C(),m.current=!0,h.current){try{h.current.close(1e3,"Client disconnect")}catch(e){}h.current=null}},[C]),N=(0,u.useCallback)(e=>{let t=h.current,n=c();if(t&&n&&t.readyState===n.OPEN)try{t.send(JSON.stringify(e))}catch(e){}},[]),_=(0,u.useCallback)(e=>{w.current.has(e)||(w.current.add(e),N({type:"subscribe",worktreeId:e}))},[N]),L=(0,u.useCallback)(e=>{w.current.has(e)&&(w.current.delete(e),N({type:"unsubscribe",worktreeId:e}))},[N]);return(0,u.useEffect)(()=>{if(f)return T(),()=>{O()}},[f,T,O]),(0,u.useEffect)(()=>{if(!f)return;let e=setInterval(()=>{let e=h.current,t=c();e&&t&&e.readyState===t.OPEN&&(Date.now()-p.current<a||M())},s);return()=>clearInterval(e)},[f,a,s,M]),(0,u.useEffect)(()=>{if(!f||"undefined"==typeof document)return;let e=()=>{"visible"===document.visibilityState&&(h.current||(y.current=0,T()))};return document.addEventListener("visibilitychange",e),()=>document.removeEventListener("visibilitychange",e)},[f,T]),(0,u.useEffect)(()=>{if(!f)return;let e=()=>{h.current||(y.current=0,T())};return window.addEventListener("online",e),()=>window.removeEventListener("online",e)},[f,T]),{status:d,subscribe:_,unsubscribe:L,send:N}}({enabled:n,onEvent:(0,u.useCallback)(e=>{o.current.forEach(t=>{try{t(e)}catch(e){}})},[])}),b=(0,u.useCallback)(e=>{var t;let n=i.current,r=null!=(t=n.get(e))?t:0;n.set(e,r+1),0===r&&f(e)},[f]),h=(0,u.useCallback)(e=>{var t;let n=i.current,r=null!=(t=n.get(e))?t:0;r<=1?(n.delete(e),d(e)):n.set(e,r-1)},[d]),v=(0,u.useCallback)(e=>(o.current.add(e),()=>{o.current.delete(e)}),[]),y=(0,u.useMemo)(()=>({status:s,connected:"connected"===s,subscribe:b,unsubscribe:h,addListener:v}),[s,b,h,v]);return(0,r.jsx)(a.Provider,{value:y,children:t})}function f(){var e;return null!=(e=(0,u.useContext)(a))?e:i}function d(e){let{addListener:t}=f(),n=(0,u.useRef)(e);n.current=e,(0,u.useEffect)(()=>t(e=>n.current(e)),[t])}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2619],{33078:(e,t)=>{function r(e){let t={};for(let[r,n]of e.entries()){let e=t[r];void 0===e?t[r]=n:Array.isArray(e)?e.push(n):t[r]=[e,n]}return t}function n(e){return"string"==typeof e?e:("number"!=typeof e||isNaN(e))&&"boolean"!=typeof e?"":String(e)}function o(e){let t=new URLSearchParams;for(let[r,o]of Object.entries(e))if(Array.isArray(o))for(let e of o)t.append(r,n(e));else t.set(r,n(o));return t}function u(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];for(let t of r){for(let r of t.keys())e.delete(r);for(let[r,n]of t.entries())e.append(r,n)}return e}Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{assign:function(){return u},searchParamsToUrlQuery:function(){return r},urlQueryToSearchParams:function(){return o}})},39426:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"errorOnce",{enumerable:!0,get:function(){return r}});let r=e=>{}},47670:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{formatUrl:function(){return u},formatWithValidation:function(){return i},urlObjectKeys:function(){return a}});let n=r(49417)._(r(33078)),o=/https?|ftp|gopher|file/;function u(e){let{auth:t,hostname:r}=e,u=e.protocol||"",a=e.pathname||"",i=e.hash||"",l=e.query||"",f=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?f=t+e.host:r&&(f=t+(~r.indexOf(":")?"["+r+"]":r),e.port&&(f+=":"+e.port)),l&&"object"==typeof l&&(l=String(n.urlQueryToSearchParams(l)));let c=e.search||l&&"?"+l||"";return u&&!u.endsWith(":")&&(u+=":"),e.slashes||(!u||o.test(u))&&!1!==f?(f="//"+(f||""),a&&"/"!==a[0]&&(a="/"+a)):f||(f=""),i&&"#"!==i[0]&&(i="#"+i),c&&"?"!==c[0]&&(c="?"+c),""+u+f+(a=a.replace(/[?#]/g,encodeURIComponent))+(c=c.replace("#","%23"))+i}let a=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function i(e){return u(e)}},52619:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{default:function(){return g},useLinkStatus:function(){return b}});let n=r(49417),o=r(95155),u=n._(r(12115)),a=r(47670),i=r(46752),l=r(83011),f=r(62296),c=r(96058);r(94781);let s=r(63499),p=r(58607),d=r(11807);r(39426);let h=r(66048);function y(e){return"string"==typeof e?e:(0,a.formatUrl)(e)}function g(e){var t;let r,n,a,[g,b]=(0,u.useOptimistic)(s.IDLE_LINK_STATUS),P=(0,u.useRef)(null),{href:_,as:v,children:E,prefetch:O=null,passHref:j,replace:S,shallow:C,scroll:N,onClick:T,onMouseEnter:x,onTouchStart:A,legacyBehavior:M=!1,onNavigate:R,ref:L,unstable_dynamicOnHover:k,...I}=e;r=E,M&&("string"==typeof r||"number"==typeof r)&&(r=(0,o.jsx)("a",{children:r}));let U=u.default.useContext(i.AppRouterContext),w=!1!==O,F=!1!==O?null===(t=O)||"auto"===t?h.FetchStrategy.PPR:h.FetchStrategy.Full:h.FetchStrategy.PPR,{href:D,as:K}=u.default.useMemo(()=>{let e=y(_);return{href:e,as:v?y(v):e}},[_,v]);M&&(n=u.default.Children.only(r));let B=M?n&&"object"==typeof n&&n.ref:L,z=u.default.useCallback(e=>(null!==U&&(P.current=(0,s.mountLinkInstance)(e,D,U,F,w,b)),()=>{P.current&&((0,s.unmountLinkForCurrentNavigation)(P.current),P.current=null),(0,s.unmountPrefetchableInstance)(e)}),[w,D,U,F,b]),Q={ref:(0,l.useMergedRef)(z,B),onClick(e){M||"function"!=typeof T||T(e),M&&n.props&&"function"==typeof n.props.onClick&&n.props.onClick(e),U&&(e.defaultPrevented||function(e,t,r,n,o,a,i){let{nodeName:l}=e.currentTarget;if(!("A"===l.toUpperCase()&&function(e){let t=e.currentTarget.getAttribute("target");return t&&"_self"!==t||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.nativeEvent&&2===e.nativeEvent.which}(e)||e.currentTarget.hasAttribute("download"))){if(!(0,p.isLocalURL)(t)){o&&(e.preventDefault(),location.replace(t));return}if(e.preventDefault(),i){let e=!1;if(i({preventDefault:()=>{e=!0}}),e)return}u.default.startTransition(()=>{(0,d.dispatchNavigateAction)(r||t,o?"replace":"push",null==a||a,n.current)})}}(e,D,K,P,S,N,R))},onMouseEnter(e){M||"function"!=typeof x||x(e),M&&n.props&&"function"==typeof n.props.onMouseEnter&&n.props.onMouseEnter(e),U&&w&&(0,s.onNavigationIntent)(e.currentTarget,!0===k)},onTouchStart:function(e){M||"function"!=typeof A||A(e),M&&n.props&&"function"==typeof n.props.onTouchStart&&n.props.onTouchStart(e),U&&w&&(0,s.onNavigationIntent)(e.currentTarget,!0===k)}};return(0,f.isAbsoluteUrl)(K)?Q.href=K:M&&!j&&("a"!==n.type||"href"in n.props)||(Q.href=(0,c.addBasePath)(K)),a=M?u.default.cloneElement(n,Q):(0,o.jsx)("a",{...I,...Q,children:r}),(0,o.jsx)(m.Provider,{value:g,children:a})}let m=(0,u.createContext)(s.IDLE_LINK_STATUS),b=()=>(0,u.useContext)(m);("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},58607:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isLocalURL",{enumerable:!0,get:function(){return u}});let n=r(62296),o=r(92929);function u(e){if(!(0,n.isAbsoluteUrl)(e))return!0;try{let t=(0,n.getLocationOrigin)(),r=new URL(e,t);return r.origin===t&&(0,o.hasBasePath)(r.pathname)}catch(e){return!1}}},62296:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{DecodeError:function(){return h},MiddlewareNotFoundError:function(){return b},MissingStaticPage:function(){return m},NormalizeError:function(){return y},PageNotFoundError:function(){return g},SP:function(){return p},ST:function(){return d},WEB_VITALS:function(){return r},execOnce:function(){return n},getDisplayName:function(){return l},getLocationOrigin:function(){return a},getURL:function(){return i},isAbsoluteUrl:function(){return u},isResSent:function(){return f},loadGetInitialProps:function(){return s},normalizeRepeatedSlashes:function(){return c},stringifyError:function(){return P}});let r=["CLS","FCP","FID","INP","LCP","TTFB"];function n(e){let t,r=!1;return function(){for(var n=arguments.length,o=Array(n),u=0;u<n;u++)o[u]=arguments[u];return r||(r=!0,t=e(...o)),t}}let o=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,u=e=>o.test(e);function a(){let{protocol:e,hostname:t,port:r}=window.location;return e+"//"+t+(r?":"+r:"")}function i(){let{href:e}=window.location,t=a();return e.substring(t.length)}function l(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function f(e){return e.finished||e.headersSent}function c(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?"?"+t.slice(1).join("?"):"")}async function s(e,t){let r=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await s(t.Component,t.ctx)}:{};let n=await e.getInitialProps(t);if(r&&f(r))return n;if(!n)throw Object.defineProperty(Error('"'+l(e)+'.getInitialProps()" should resolve to an object. But found "'+n+'" instead.'),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return n}let p="undefined"!=typeof performance,d=p&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class h extends Error{}class y extends Error{}class g extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message="Cannot find module for page: "+e}}class m extends Error{constructor(e,t){super(),this.message="Failed to load static file for page: "+e+" "+t}}class b extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function P(e){return JSON.stringify({message:e.message,stack:e.stack})}},83011:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"useMergedRef",{enumerable:!0,get:function(){return o}});let n=r(12115);function o(e,t){let r=(0,n.useRef)(null),o=(0,n.useRef)(null);return(0,n.useCallback)(n=>{if(null===n){let e=r.current;e&&(r.current=null,e());let t=o.current;t&&(o.current=null,t())}else e&&(r.current=u(e,n)),t&&(o.current=u(t,n))},[e,t])}function u(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let r=e(t);return"function"==typeof r?r:()=>e(null)}}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)}}]);
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2619],{17045:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"errorOnce",{enumerable:!0,get:function(){return r}});let r=e=>{}},33078:(e,t)=>{function r(e){let t={};for(let[r,n]of e.entries()){let e=t[r];void 0===e?t[r]=n:Array.isArray(e)?e.push(n):t[r]=[e,n]}return t}function n(e){return"string"==typeof e?e:("number"!=typeof e||isNaN(e))&&"boolean"!=typeof e?"":String(e)}function o(e){let t=new URLSearchParams;for(let[r,o]of Object.entries(e))if(Array.isArray(o))for(let e of o)t.append(r,n(e));else t.set(r,n(o));return t}function u(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];for(let t of r){for(let r of t.keys())e.delete(r);for(let[r,n]of t.entries())e.append(r,n)}return e}Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{assign:function(){return u},searchParamsToUrlQuery:function(){return r},urlQueryToSearchParams:function(){return o}})},47670:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{formatUrl:function(){return u},formatWithValidation:function(){return i},urlObjectKeys:function(){return a}});let n=r(49417)._(r(33078)),o=/https?|ftp|gopher|file/;function u(e){let{auth:t,hostname:r}=e,u=e.protocol||"",a=e.pathname||"",i=e.hash||"",l=e.query||"",f=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?f=t+e.host:r&&(f=t+(~r.indexOf(":")?"["+r+"]":r),e.port&&(f+=":"+e.port)),l&&"object"==typeof l&&(l=String(n.urlQueryToSearchParams(l)));let c=e.search||l&&"?"+l||"";return u&&!u.endsWith(":")&&(u+=":"),e.slashes||(!u||o.test(u))&&!1!==f?(f="//"+(f||""),a&&"/"!==a[0]&&(a="/"+a)):f||(f=""),i&&"#"!==i[0]&&(i="#"+i),c&&"?"!==c[0]&&(c="?"+c),""+u+f+(a=a.replace(/[?#]/g,encodeURIComponent))+(c=c.replace("#","%23"))+i}let a=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function i(e){return u(e)}},52619:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{default:function(){return g},useLinkStatus:function(){return b}});let n=r(49417),o=r(95155),u=n._(r(12115)),a=r(47670),i=r(46752),l=r(83011),f=r(62296),c=r(96058);r(94781);let s=r(63499),p=r(58607),d=r(11807);r(17045);let h=r(66048);function y(e){return"string"==typeof e?e:(0,a.formatUrl)(e)}function g(e){var t;let r,n,a,[g,b]=(0,u.useOptimistic)(s.IDLE_LINK_STATUS),P=(0,u.useRef)(null),{href:_,as:v,children:E,prefetch:O=null,passHref:j,replace:S,shallow:C,scroll:N,onClick:T,onMouseEnter:x,onTouchStart:A,legacyBehavior:M=!1,onNavigate:R,ref:L,unstable_dynamicOnHover:k,...I}=e;r=E,M&&("string"==typeof r||"number"==typeof r)&&(r=(0,o.jsx)("a",{children:r}));let U=u.default.useContext(i.AppRouterContext),w=!1!==O,F=!1!==O?null===(t=O)||"auto"===t?h.FetchStrategy.PPR:h.FetchStrategy.Full:h.FetchStrategy.PPR,{href:D,as:K}=u.default.useMemo(()=>{let e=y(_);return{href:e,as:v?y(v):e}},[_,v]);M&&(n=u.default.Children.only(r));let B=M?n&&"object"==typeof n&&n.ref:L,z=u.default.useCallback(e=>(null!==U&&(P.current=(0,s.mountLinkInstance)(e,D,U,F,w,b)),()=>{P.current&&((0,s.unmountLinkForCurrentNavigation)(P.current),P.current=null),(0,s.unmountPrefetchableInstance)(e)}),[w,D,U,F,b]),Q={ref:(0,l.useMergedRef)(z,B),onClick(e){M||"function"!=typeof T||T(e),M&&n.props&&"function"==typeof n.props.onClick&&n.props.onClick(e),U&&(e.defaultPrevented||function(e,t,r,n,o,a,i){let{nodeName:l}=e.currentTarget;if(!("A"===l.toUpperCase()&&function(e){let t=e.currentTarget.getAttribute("target");return t&&"_self"!==t||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.nativeEvent&&2===e.nativeEvent.which}(e)||e.currentTarget.hasAttribute("download"))){if(!(0,p.isLocalURL)(t)){o&&(e.preventDefault(),location.replace(t));return}if(e.preventDefault(),i){let e=!1;if(i({preventDefault:()=>{e=!0}}),e)return}u.default.startTransition(()=>{(0,d.dispatchNavigateAction)(r||t,o?"replace":"push",null==a||a,n.current)})}}(e,D,K,P,S,N,R))},onMouseEnter(e){M||"function"!=typeof x||x(e),M&&n.props&&"function"==typeof n.props.onMouseEnter&&n.props.onMouseEnter(e),U&&w&&(0,s.onNavigationIntent)(e.currentTarget,!0===k)},onTouchStart:function(e){M||"function"!=typeof A||A(e),M&&n.props&&"function"==typeof n.props.onTouchStart&&n.props.onTouchStart(e),U&&w&&(0,s.onNavigationIntent)(e.currentTarget,!0===k)}};return(0,f.isAbsoluteUrl)(K)?Q.href=K:M&&!j&&("a"!==n.type||"href"in n.props)||(Q.href=(0,c.addBasePath)(K)),a=M?u.default.cloneElement(n,Q):(0,o.jsx)("a",{...I,...Q,children:r}),(0,o.jsx)(m.Provider,{value:g,children:a})}let m=(0,u.createContext)(s.IDLE_LINK_STATUS),b=()=>(0,u.useContext)(m);("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},58607:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isLocalURL",{enumerable:!0,get:function(){return u}});let n=r(62296),o=r(92929);function u(e){if(!(0,n.isAbsoluteUrl)(e))return!0;try{let t=(0,n.getLocationOrigin)(),r=new URL(e,t);return r.origin===t&&(0,o.hasBasePath)(r.pathname)}catch(e){return!1}}},62296:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{DecodeError:function(){return h},MiddlewareNotFoundError:function(){return b},MissingStaticPage:function(){return m},NormalizeError:function(){return y},PageNotFoundError:function(){return g},SP:function(){return p},ST:function(){return d},WEB_VITALS:function(){return r},execOnce:function(){return n},getDisplayName:function(){return l},getLocationOrigin:function(){return a},getURL:function(){return i},isAbsoluteUrl:function(){return u},isResSent:function(){return f},loadGetInitialProps:function(){return s},normalizeRepeatedSlashes:function(){return c},stringifyError:function(){return P}});let r=["CLS","FCP","FID","INP","LCP","TTFB"];function n(e){let t,r=!1;return function(){for(var n=arguments.length,o=Array(n),u=0;u<n;u++)o[u]=arguments[u];return r||(r=!0,t=e(...o)),t}}let o=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,u=e=>o.test(e);function a(){let{protocol:e,hostname:t,port:r}=window.location;return e+"//"+t+(r?":"+r:"")}function i(){let{href:e}=window.location,t=a();return e.substring(t.length)}function l(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function f(e){return e.finished||e.headersSent}function c(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?"?"+t.slice(1).join("?"):"")}async function s(e,t){let r=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await s(t.Component,t.ctx)}:{};let n=await e.getInitialProps(t);if(r&&f(r))return n;if(!n)throw Object.defineProperty(Error('"'+l(e)+'.getInitialProps()" should resolve to an object. But found "'+n+'" instead.'),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return n}let p="undefined"!=typeof performance,d=p&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class h extends Error{}class y extends Error{}class g extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message="Cannot find module for page: "+e}}class m extends Error{constructor(e,t){super(),this.message="Failed to load static file for page: "+e+" "+t}}class b extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function P(e){return JSON.stringify({message:e.message,stack:e.stack})}},83011:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"useMergedRef",{enumerable:!0,get:function(){return o}});let n=r(12115);function o(e,t){let r=(0,n.useRef)(null),o=(0,n.useRef)(null);return(0,n.useCallback)(n=>{if(null===n){let e=r.current;e&&(r.current=null,e());let t=o.current;t&&(o.current=null,t())}else e&&(r.current=u(e,n)),t&&(o.current=u(t,n))},[e,t])}function u(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let r=e(t);return"function"==typeof r?r:()=>e(null)}}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[344],{54014:(e,t,n)=>{n.d(t,{Ab:()=>a,NL:()=>f,O6:()=>m,XH:()=>o,f_:()=>u,hR:()=>l,lu:()=>y,n6:()=>s,oo:()=>d,pQ:()=>r,sw:()=>p,vz:()=>h});let o=["claude","codex","gemini","vibe-local","opencode","copilot","antigravity","command-code","opencode-v2"],a=10,r=50,i=/^[a-zA-Z0-9_-]+$/;function s(e){return"string"==typeof e&&e.length>0&&e.length<=64&&i.test(e)}let c={claude:"Claude",codex:"Codex",gemini:"Gemini","vibe-local":"Vibe Local",opencode:"OpenCode",copilot:"Copilot",antigravity:"Antigravity","command-code":"Command Code","opencode-v2":"OpenCode V2"};function l(e){return o.includes(e)}function d(e){var t;return null!=(t=c[e])?t:e}function u(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Assistant";return e&&l(e)?d(e):t}function p(e){let t=e.alias;return"string"==typeof t&&t.trim().length>0?t:d(e.cliTool)}function m(e,t,n){let o=e.find(e=>e.id===t);return o?p(o):d(n)}function y(e){return e.map((e,t)=>({id:e,cliTool:e,alias:d(e),order:t}))}let h=128,f=2097152},56936:(e,t,n)=>{n.d(t,{BV:()=>h,Ct:()=>c,Hi:()=>a,K3:()=>i,PS:()=>m,SE:()=>r,SR:()=>s,T2:()=>u,Z3:()=>y,nk:()=>p});var o=n(93025);let a=0;function r(){return(0,o.v8)()+3e4}let i=8e3,s=2,c=2e4,l=[408,425,429,500,502,503,504],d=["GET","HEAD","OPTIONS"],u=3e4;function p(e){let t=(null!=e?e:"GET").toUpperCase();return d.includes(t)}function m(e){return l.includes(e)}function y(e){return p(e)?1e4:3e4}function h(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Math.random(),n=Number.isFinite(e)&&e>0?Math.floor(e):0,o=Math.min(500*2**n,4e3);return Math.max(0,Math.round(o+.25*o*(2*t-1)))}},80344:(e,t,n)=>{n.d(t,{$T:()=>g,E:()=>m,GQ:()=>T,O0:()=>s,Rx:()=>f,gC:()=>w,hD:()=>r,hS:()=>b,xd:()=>c,y:()=>h});var o=n(56936),a=n(52407);class r extends Error{constructor(e,t,n,o){super(e),this.status=t,this.data=n,this.name="ApiError",this.kind=null!=o?o:t>0?"http":"network"}}async function i(e,t,n){if(!(e.headers.get("content-type")||"").includes("application/json"))return t;try{return await e.json()}catch(e){return t}}function s(e){var t;return e.redirected&&(null!=(t=e.url)?t:"").includes("/login")?new r("Authentication required",401):null}function c(e){return e.headers?(e.headers.get("content-type")||"").includes("application/json")?null:new r("Unexpected response format",e.status):null}let l=null;function d(e){let t=Date.now();null!==l&&l.reachable===e&&t-l.at<o.T2||(l={reachable:e,at:t},(0,a.nG)(e))}async function u(e,t,n){var o;let a=null!=(o=t.signal)?o:void 0;if(null==a?void 0:a.aborted)throw new r("Request aborted",0,void 0,"aborted");if(n<=0||"function"!=typeof AbortController)return fetch(e,t);let i=new AbortController,s=!1,c=setTimeout(()=>{s=!0,i.abort()},n),l=()=>i.abort();null==a||a.addEventListener("abort",l);try{return await fetch(e,{...t,signal:i.signal})}catch(e){if(null==a?void 0:a.aborted)throw new r("Request aborted",0,e,"aborted");if(s)throw new r("Request timed out after ".concat(n,"ms"),0,e,"timeout");throw e}finally{clearTimeout(c),null==a||a.removeEventListener("abort",l)}}function p(e){return new Promise(t=>setTimeout(t,e))}async function m(e,t){var n;let{timeoutMs:a,retries:i,...s}=null!=t?t:{},c=(null!=(n=s.method)?n:"GET").toUpperCase(),l=(0,o.nk)(c)?Math.max(0,null!=i?i:o.SR):0,m=void 0===a?(0,o.Z3)(c):null!=a?a:o.Hi,y=Date.now(),h=e=>e<l&&Date.now()-y<o.Ct;for(let t=0;;t++){if("undefined"!=typeof navigator&&!1===navigator.onLine)throw new r("No network connection",0,void 0,"offline");try{let n=await u(e,s,m);if(d(!0),(0,o.PS)(n.status)&&h(t)){await p((0,o.BV)(t));continue}return n}catch(n){let e=function(e){if(e instanceof r)return e;let t=e instanceof Error?e.name:"";return"AbortError"===t||"TimeoutError"===t?new r("Request aborted",0,e,"aborted"):new r(e instanceof Error?e.message:"Unknown error",0,e,"network")}(n);if("aborted"===e.kind||(d(!1),!h(t)))throw e;await p((0,o.BV)(t))}}}async function y(e,t){try{let n=new Headers(null==t?void 0:t.headers);n.set("Content-Type","application/json");let o=await m(e,{...t,headers:n}),a=s(o);if(a)throw a;if(!o.ok){let e=await i(o,{},"error-body");throw new r(e.error||"HTTP error ".concat(o.status),o.status,e)}let l=c(o);if(l)throw l;return o.json()}catch(e){if(e instanceof r)throw e;throw new r(e instanceof Error?e.message:"Unknown error",0,e)}}let h={getAll:async()=>y("/api/worktrees"),getById:async e=>y("/api/worktrees/".concat(e)),updateDescription:async(e,t)=>y("/api/worktrees/".concat(e),{method:"PATCH",body:JSON.stringify({description:t})}),updateLink:async(e,t)=>y("/api/worktrees/".concat(e),{method:"PATCH",body:JSON.stringify({link:t})}),toggleFavorite:async(e,t)=>y("/api/worktrees/".concat(e),{method:"PATCH",body:JSON.stringify({favorite:t})}),updateStatus:async(e,t)=>y("/api/worktrees/".concat(e),{method:"PATCH",body:JSON.stringify({status:t})}),updateCliTool:async(e,t)=>y("/api/worktrees/".concat(e),{method:"PATCH",body:JSON.stringify({cliToolId:t})}),markAsViewed:async e=>y("/api/worktrees/".concat(e,"/viewed"),{method:"PATCH"}),async getMessages(e,t,n,o){let a=new URLSearchParams;return t&&a.append("cliTool",t),n&&a.append("includeArchived","true"),"number"==typeof o&&Number.isFinite(o)&&a.append("limit",String(o)),y("/api/worktrees/".concat(e,"/messages").concat(a.toString()?"?".concat(a.toString()):""))},async sendMessage(e,t,n){var a;let r={content:t};return(null==n?void 0:n.cliToolId)&&(r.cliToolId=n.cliToolId),(null==n?void 0:n.instanceId)&&(r.instanceId=n.instanceId),(null==n?void 0:n.imagePath)&&(r.imagePath=n.imagePath),null===(a=await y("/api/worktrees/".concat(e,"/send"),{method:"POST",body:JSON.stringify(r),timeoutMs:(0,o.SE)()}))||"object"!=typeof a||a.timestamp instanceof Date?a:{...a,timestamp:new Date(a.timestamp)}},async uploadImageFile(e,t){let n=Date.now(),o="".concat(n,"-").concat(t.name),a=".commandmate/attachments",r=new FormData;r.append("file",new File([t],o,{type:t.type}));let s=await fetch("/api/worktrees/".concat(e,"/upload/").concat(a),{method:"POST",body:r});if(!s.ok){var c;let e=await i(s,{},"error-body");throw Error((null==e||null==(c=e.error)?void 0:c.message)||"Upload failed (HTTP ".concat(s.status,")"))}return{path:(await i(s,{},"response-body")).path||"".concat(a,"/").concat(o)}},getLogs:async e=>y("/api/worktrees/".concat(e,"/logs")),async getLogFile(e,t,n){let o=(null==n?void 0:n.sanitize)?"?sanitize=true":"";return y("/api/worktrees/".concat(e,"/logs/").concat(t).concat(o))},async killSession(e,t,n){let o=new URLSearchParams;t&&o.set("cliTool",t),n&&o.set("instance",n);let a=o.toString();return y("/api/worktrees/".concat(e,"/kill-session").concat(a?"?".concat(a):""),{method:"POST"})}},f={scan:async e=>y("/api/repositories/scan",{method:"POST",body:JSON.stringify({repositoryPath:e})}),sync:async()=>y("/api/repositories/sync",{method:"POST"}),delete:async e=>y("/api/repositories",{method:"DELETE",body:JSON.stringify({repositoryPath:e})}),async clone(e,t){var n;return y("/api/repositories/clone",{method:"POST",body:JSON.stringify({cloneUrl:e,fork:null!=(n=null==t?void 0:t.fork)&&n})})},getCloneStatus:async e=>y("/api/repositories/clone/".concat(e)),getExcluded:async()=>y("/api/repositories/excluded"),restore:async e=>y("/api/repositories/restore",{method:"PUT",body:JSON.stringify({repositoryPath:e})}),list:async()=>y("/api/repositories"),updateDisplayName:async(e,t)=>y("/api/repositories/".concat(encodeURIComponent(e)),{method:"PUT",body:JSON.stringify({displayName:t})}),updateVisibility:async(e,t)=>y("/api/repositories/".concat(encodeURIComponent(e)),{method:"PUT",body:JSON.stringify({visible:t})}),updateEnabled:async(e,t)=>y("/api/repositories/".concat(encodeURIComponent(e)),{method:"PUT",body:JSON.stringify({enabled:t})}),validatePath:async e=>y("/api/repositories/validate-path",{method:"POST",body:JSON.stringify({repositoryPath:e})})},w={async browse(e){let t=e?"?path=".concat(encodeURIComponent(e)):"";return y("/api/fs/browse".concat(t))},addRecentPath:async e=>y("/api/fs/recent-paths",{method:"POST",body:JSON.stringify({path:e})})},g={getAll:async e=>(await y("/api/worktrees/".concat(e,"/memos"))).memos,create:async(e,t)=>(await y("/api/worktrees/".concat(e,"/memos"),{method:"POST",body:JSON.stringify(t||{})})).memo,update:async(e,t,n)=>(await y("/api/worktrees/".concat(e,"/memos/").concat(t),{method:"PUT",body:JSON.stringify(n)})).memo,delete:async(e,t)=>y("/api/worktrees/".concat(e,"/memos/").concat(t),{method:"DELETE"}),async reorder(e,t){await y("/api/worktrees/".concat(e,"/memos"),{method:"PATCH",body:JSON.stringify({memoIds:t})})}};function b(e){return e instanceof r||e instanceof Error?e.message:"An unknown error occurred"}let T={checkForUpdate:async()=>y("/api/app/update-check",{method:"GET"}),startUpdate:async()=>y("/api/app/update",{method:"POST"}),async ping(){try{return(await fetch("/api/auth/status",{cache:"no-store"})).ok}catch(e){return!1}},async getReleaseNotes(e,t){let n=new URLSearchParams({from:e,to:t});return y("/api/app/release-notes?".concat(n.toString()),{method:"GET"})}}},93025:(e,t,n)=>{n.d(t,{Up:()=>s,v8:()=>i});var o=n(54014);let a={claude:6e4};function r(e){var t;return(null!=(t=a[e])?t:3e4)+5e3}function i(){return Math.max(...o.XH.map(r))}let s=5e3}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3922],{33922:(e,t,r)=>{r.r(t),r.d(t,{MarkdownEditor:()=>ee});var n=r(95155),l=r(12115),a=r(47650),o=r(18955),s=r(80003),i=r(52056),d=r(64269),c=r(60322),u=r(94442),f=r(36402),m=r(3005),h=r(72115),x=r(89715),v=r(71847);let p=(0,v.A)("columns-2",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]]);var g=r(57828);let w=(0,v.A)("list-indent-increase",[["path",{d:"M21 5H11",key:"us1j55"}],["path",{d:"M21 12H11",key:"wd7e0v"}],["path",{d:"M21 19H11",key:"saa85w"}],["path",{d:"m3 8 4 4-4 4",key:"1a3j6y"}]]),b=(0,v.A)("list-indent-decrease",[["path",{d:"M21 5H11",key:"us1j55"}],["path",{d:"M21 12H11",key:"wd7e0v"}],["path",{d:"M21 19H11",key:"saa85w"}],["path",{d:"m7 8-4 4 4 4",key:"o5hrat"}]]);var k=r(76482),y=r(5917),j=r(75426),E=r(97624),N=r(37354),C=r(46046),S=r(65229),M=r(48407);let F=(0,l.memo)(function(e){let{filePath:t,isDirty:r,viewMode:l,onViewModeChange:a,showMobileTabs:s,copied:i,onCopy:d,isMaximized:c,onToggleFullscreen:u,isAutoSaveEnabled:f,onAutoSaveToggle:m,isAutoSaving:h,isSaving:v,onSave:F,onClose:R,hideViewModeToggle:A,hideMaximizeButton:P,onIndent:T,onOutdent:V,tabMovesFocus:z,onToggleTabMovesFocus:I}=e,D=(0,o.c)("worktree"),O=e=>e.preventDefault();return(0,n.jsxs)("div",{className:"flex items-center justify-between px-4 py-2 border-b border-border bg-muted",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2 min-w-0 flex-shrink",children:[(0,n.jsx)(x.A,{className:"h-4 w-4 text-muted-foreground flex-shrink-0"}),(0,n.jsx)("span",{className:"text-sm font-medium text-foreground truncate",children:t}),r&&(0,n.jsx)("span",{"data-testid":"dirty-indicator",className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium bg-warning-subtle text-warning-foreground flex-shrink-0",children:D("editor.unsaved")})]}),(0,n.jsxs)("div",{className:"flex items-center gap-2 flex-shrink-0",children:[!s&&!A&&(0,n.jsxs)("div",{className:"flex items-center gap-1 bg-muted rounded-lg p-1",children:[(0,n.jsx)("button",{"data-testid":"view-mode-split","aria-pressed":"split"===l,onClick:()=>a("split"),className:"p-1.5 rounded ".concat("split"===l?"bg-white dark:bg-input shadow-sm text-accent-600 dark:text-accent-400":"text-muted-foreground hover:text-foreground"),title:D("editor.splitView"),children:(0,n.jsx)(p,{className:"h-4 w-4"})}),(0,n.jsx)("button",{"data-testid":"view-mode-editor","aria-pressed":"editor"===l,onClick:()=>a("editor"),className:"p-1.5 rounded ".concat("editor"===l?"bg-white dark:bg-input shadow-sm text-accent-600 dark:text-accent-400":"text-muted-foreground hover:text-foreground"),title:D("editor.editorOnly"),children:(0,n.jsx)(x.A,{className:"h-4 w-4"})}),(0,n.jsx)("button",{"data-testid":"view-mode-preview","aria-pressed":"preview"===l,onClick:()=>a("preview"),className:"p-1.5 rounded ".concat("preview"===l?"bg-white dark:bg-input shadow-sm text-accent-600 dark:text-accent-400":"text-muted-foreground hover:text-foreground"),title:D("editor.previewOnly"),children:(0,n.jsx)(g.A,{className:"h-4 w-4"})})]}),(0,n.jsx)(M.$n,{variant:"ghost","data-testid":"editor-indent-button",onMouseDown:O,onClick:T,className:"flex min-h-[44px] min-w-[44px] items-center justify-center p-1.5 text-muted-foreground hover:text-foreground hover:bg-muted rounded",title:D("editor.indent"),"aria-label":D("editor.indent"),children:(0,n.jsx)(w,{className:"h-4 w-4"})}),(0,n.jsx)(M.$n,{variant:"ghost","data-testid":"editor-outdent-button",onMouseDown:O,onClick:V,className:"flex min-h-[44px] min-w-[44px] items-center justify-center p-1.5 text-muted-foreground hover:text-foreground hover:bg-muted rounded",title:D("editor.outdent"),"aria-label":D("editor.outdent"),children:(0,n.jsx)(b,{className:"h-4 w-4"})}),(0,n.jsx)(M.$n,{variant:"ghost","data-testid":"editor-tab-focus-toggle",onMouseDown:O,onClick:I,"aria-pressed":z,className:"flex min-h-[44px] min-w-[44px] items-center justify-center p-1.5 hover:bg-muted rounded ".concat(z?"text-accent-600 dark:text-accent-400":"text-muted-foreground hover:text-foreground"),title:D(z?"editor.tabMovesFocusOn":"editor.tabMovesFocusOff"),"aria-label":D(z?"editor.tabMovesFocusOn":"editor.tabMovesFocusOff"),children:(0,n.jsx)(k.A,{className:"h-4 w-4"})}),(0,n.jsx)(M.$n,{variant:"ghost","data-testid":"copy-content-button",onClick:d,className:"p-1.5 hover:bg-muted rounded ".concat(i?"text-success":"text-muted-foreground hover:text-foreground"),title:D("actions.copyContent"),children:i?(0,n.jsx)(y.A,{className:"h-4 w-4"}):(0,n.jsx)(j.A,{className:"h-4 w-4"})}),!P&&(0,n.jsx)(M.$n,{variant:"ghost","data-testid":"maximize-button",onClick:u,className:"p-1.5 text-muted-foreground hover:text-foreground hover:bg-muted rounded",title:D(c?"editor.exitFullscreen":"editor.enterFullscreen"),"aria-pressed":c,children:c?(0,n.jsx)(E.A,{className:"h-4 w-4"}):(0,n.jsx)(N.A,{className:"h-4 w-4"})}),(0,n.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,n.jsx)("span",{className:"text-xs text-muted-foreground",children:D("editor.auto")}),(0,n.jsx)("button",{"data-testid":"auto-save-toggle",role:"switch","aria-checked":f,onClick:()=>m(!f),className:"relative inline-flex h-5 w-9 items-center rounded-full transition-colors ".concat(f?"bg-accent-600":"bg-input"),children:(0,n.jsx)("span",{className:"inline-block h-3.5 w-3.5 transform rounded-full bg-white transition-transform ".concat(f?"translate-x-4":"translate-x-0.5")})})]}),f?(0,n.jsx)("span",{"data-testid":"auto-save-indicator",className:"text-sm text-muted-foreground",children:h?D("actions.saving"):r?"":D("actions.saved")}):(0,n.jsxs)(M.$n,{variant:"ghost","data-testid":"save-button",onClick:F,disabled:!r||v,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm font-medium transition-colors ".concat(r&&!v?"bg-accent-600 text-white hover:bg-accent-700":"bg-muted text-muted-foreground cursor-not-allowed"),children:[(0,n.jsx)(C.A,{className:"h-4 w-4"}),D(v?"actions.saving":"actions.save")]}),R&&(0,n.jsx)(M.$n,{variant:"ghost","data-testid":"close-button",onClick:R,className:"p-1.5 text-muted-foreground hover:text-foreground hover:bg-muted rounded",title:D("actions.close"),children:(0,n.jsx)(S.A,{className:"h-4 w-4"})})]})]})});var R=r(24027),A=r(55924),P=r(79962),T=r(38218);let V=l.useLayoutEffect;function z(){if("undefined"==typeof document)return null;let e=document;return e.fullscreenElement||e.webkitFullscreenElement||e.mozFullScreenElement||e.msFullscreenElement||null}var I=r(2317),D=r(60850),O=r(8269),L=r(51434),K=r(4138),$=r(59854);function H(e,t){return e.lastIndexOf("\n",t-1)+1}function W(e,t,r){let n=r>t&&r>0&&"\n"===e[r-1]?r-1:r;return{start:H(e,t),end:function(e,t){let r=e.indexOf("\n",t);return -1===r?e.length:r}(e,n)}}function _(e,t,r,n,l,a){return{replaceStart:t,replaceEnd:r,replacement:n,selectionStart:l,selectionEnd:a,value:e.slice(0,t)+n+e.slice(r)}}function q(e,t,r,n){if(!(r>t&&e.slice(t,r).includes("\n"))){let l=t-H(e,t),a=n.length-l%n.length,o=" ".repeat(a),s=t+o.length;return _(e,t,r,o,s,s)}let{start:l,end:a}=W(e,t,r),o=e.slice(l,a).split("\n").map(e=>""===e||"\r"===e?e:n+e).join("\n");return _(e,l,a,o,l,l+o.length)}function B(e,t,r,n){let{start:l,end:a}=W(e,t,r),o=e.slice(l,a),s=o.split("\n").map(e=>(function(e,t){if(e.startsWith(" "))return e.slice(1);let r=0;for(;r<t.length&&" "===e[r];)r+=1;return e.slice(r)})(e,n)).join("\n");if(s===o)return t===r?null:_(e,l,a,s,t,r);if(t===r){let r=Math.min(o.length-s.length,Math.max(0,t-l)),n=t-r;return _(e,l,a,s,n,n)}return _(e,l,a,s,l,l+s.length)}let G={split:{showEditor:!0,showPreview:!0,editorWidth:"w-1/2",previewWidth:"w-1/2"},editor:{showEditor:!0,showPreview:!1,editorWidth:"w-full",previewWidth:"w-0"},preview:{showEditor:!1,showPreview:!0,editorWidth:"w-0",previewWidth:"w-full"}},U="commandmate:md-editor-view-mode",J={WARNING_THRESHOLD:512e3};function Y(e){return"number"==typeof e&&e>=.1&&e<=.9}function X(e){return"boolean"==typeof e}function Z(e){return"split"===e||"editor"===e||"preview"===e}let Q=(0,l.memo)(function(e){let{previewContent:t,onOpenFile:r,filePath:a,worktreeId:o,tocVisible:i,onToggleTocVisible:d,tocTitle:c,tocShowLabel:u,tocHideLabel:f}=e,m=(0,l.useRef)(null),h=(0,l.useRef)(null),[x,v]=(0,l.useState)(null),[p,g]=(0,l.useState)(!1);(0,l.useEffect)(()=>{v(h.current)},[]),(0,l.useEffect)(()=>{let e=m.current;if(!e||"undefined"==typeof ResizeObserver)return;let t=new ResizeObserver(e=>{var t,r;g((null!=(r=null==(t=e[0])?void 0:t.contentRect.width)?r:0)>=480)});return t.observe(e),()=>t.disconnect()},[]);let w=(0,l.useMemo)(()=>(0,P.K)(t),[t]),b=w.length>=2&&p,k=b&&i;return(0,n.jsxs)("div",{ref:m,className:"relative flex flex-1 overflow-hidden",children:[(0,n.jsx)("div",{ref:h,"data-testid":"markdown-preview",className:"flex-1 min-w-0 p-4 overflow-y-auto prose prose-sm dark:prose-invert max-w-none prose-headings:scroll-mt-2",children:(0,n.jsx)(R.G8,{content:t,onOpenFile:r,currentFilePath:a,worktreeId:o})}),k&&(0,n.jsx)("aside",{"data-testid":"markdown-preview-toc",className:"w-48 flex-shrink-0 overflow-y-auto border-l border-border py-4",children:(0,n.jsx)("div",{className:"sticky top-0",children:(0,n.jsx)(A.K,{entries:w,title:c,headerOffset:0,root:x})})}),b&&(0,n.jsx)("button",{"data-testid":"markdown-preview-toc-toggle",onClick:d,"aria-pressed":i,"aria-label":i?f:u,title:i?f:u,className:"absolute top-2 right-2 z-10 flex items-center justify-center rounded-md border border-border bg-surface/90 p-1.5 text-muted-foreground hover:text-foreground hover:bg-muted shadow-sm",children:(0,n.jsx)(s.A,{className:"h-4 w-4"})})]})}),ee=(0,l.memo)(function(e){let{worktreeId:t,filePath:r,fileType:s,onClose:x,onSave:v,initialViewMode:p,onMaximizedChange:g,onDirtyChange:w,onOpenFile:b,initialContent:k,embedded:y=!1,onContentChange:j}=e,E="text"===(null!=s?s:r.toLowerCase().endsWith(".md")?"markdown":"text"),N=(0,o.c)("worktree"),C=(0,f.SC)(),S=void 0!==k,M=null!=k?k:"",[A,H]=(0,l.useState)(M),[W,_]=(0,l.useState)(M),[ee,et]=(0,l.useState)(M),[er,en]=(0,l.useState)(()=>E||y?"editor":function(e){if(e&&Z(e))return e;{let e=localStorage.getItem(U);if(e&&Z(e))return e}return"split"}(p)),[el,ea]=(0,l.useState)(!S),[eo,es]=(0,l.useState)(!1),[ei,ed]=(0,l.useState)(null),[ec,eu]=(0,l.useState)(()=>S&&new Blob([M]).size>J.WARNING_THRESHOLD),{copied:ef,markCopied:em}=(0,K.q)(),[eh,ex]=(0,l.useState)("editor"),[ev,ep]=(0,l.useState)(null),{showToast:eg}=(0,u.dj)(),ew=(0,l.useRef)(null),eb=(0,l.useRef)(null),ek=(0,l.useRef)(null),ey=(0,l.useRef)(null),ej=(0,l.useRef)(null),eE=(0,l.useRef)(null),eN=(0,T.a)(),eC=function(){let[e,t]=(0,l.useState)(!1);return V(()=>{let e=window.matchMedia("(orientation: portrait)");t(e.matches);let r=e=>{t(e.matches)};return e.addEventListener("change",r),()=>e.removeEventListener("change",r)},[]),e}();(0,l.useEffect)(()=>{eN&&ex("preview")},[eN]);let{isKeyboardVisible:eS,keyboardHeight:eM}=(0,L.C)(),{value:eF,setValue:eR}=(0,I.V)({key:"commandmate:md-editor-maximized",defaultValue:!1,validate:X}),{isFullscreen:eA,isFallbackMode:eP,enterFullscreen:eT,exitFullscreen:eV,toggleFullscreen:ez}=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{elementRef:t,onEnter:r,onExit:n,onError:a}=e,[o,s]=(0,l.useState)(!1),[i,d]=(0,l.useState)(!1),[c,u]=(0,l.useState)(null),f=(0,l.useCallback)(()=>{let e=null!=z();s(e),!e&&i&&d(!1)},[i]),m=(0,l.useCallback)(async()=>{if(u(null),"undefined"!=typeof navigator&&(/iPad|iPhone|iPod/.test(navigator.userAgent)||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1||0)){s(!0),d(!0),null==r||r();return}if(function(){if("undefined"==typeof document)return!1;let e=document;return!!(e.fullscreenEnabled||e.webkitFullscreenEnabled||e.mozFullScreenEnabled||e.msFullscreenEnabled)}()&&(null==t?void 0:t.current))try{var e;await ((e=t.current).requestFullscreen?Promise.resolve(e.requestFullscreen()):e.webkitRequestFullscreen?Promise.resolve(e.webkitRequestFullscreen()):e.mozRequestFullScreen?Promise.resolve(e.mozRequestFullScreen()):e.msRequestFullscreen?Promise.resolve(e.msRequestFullscreen()):Promise.reject(Error("Fullscreen API not supported"))),s(!0),d(!1),null==r||r()}catch(t){let e=t instanceof Error?t.message:"Failed to enter fullscreen";u(e),null==a||a(t instanceof Error?t:Error(e)),s(!0),d(!0),null==r||r()}else s(!0),d(!0),null==r||r()},[t,r,a]),h=(0,l.useCallback)(async()=>{if(u(null),i){s(!1),d(!1),null==n||n();return}if(z())try{await function(){if("undefined"==typeof document)return Promise.resolve();let e=document;return e.exitFullscreen?Promise.resolve(e.exitFullscreen()):e.webkitExitFullscreen?Promise.resolve(e.webkitExitFullscreen()):e.mozCancelFullScreen?Promise.resolve(e.mozCancelFullScreen()):e.msExitFullscreen?Promise.resolve(e.msExitFullscreen()):Promise.resolve()}(),s(!1),null==n||n()}catch(t){let e=t instanceof Error?t.message:"Failed to exit fullscreen";u(e),null==a||a(t instanceof Error?t:Error(e)),s(!1),d(!1),null==n||n()}else s(!1),d(!1),null==n||n()},[i,n,a]),x=(0,l.useCallback)(async()=>{o?await h():await m()},[o,m,h]);return(0,l.useEffect)(()=>(function(e){if("undefined"==typeof document)return()=>{};let t=["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"];for(let r of t)document.addEventListener(r,e);return()=>{for(let r of t)document.removeEventListener(r,e)}})(f),[f]),{isFullscreen:o,isFallbackMode:i,enterFullscreen:m,exitFullscreen:h,toggleFullscreen:x,error:c}}({elementRef:ey,onEnter:()=>eR(!0),onExit:()=>eR(!1)}),{value:eI,setValue:eD}=(0,I.V)({key:"commandmate:md-editor-split-ratio",defaultValue:.5,validate:Y}),{value:eO,setValue:eL}=(0,I.V)({key:"commandmate:md-editor-auto-save",defaultValue:!1,validate:X}),{value:eK,setValue:e$}=(0,I.V)({key:"commandmate:md-editor-tab-moves-focus",defaultValue:!1,validate:X}),{value:eH,setValue:eW}=(0,I.V)({key:P.Y,defaultValue:!0,validate:X}),e_=(0,l.useCallback)(()=>{eW(e=>!e)},[eW]),{ref:eq}=(0,O.hU)({onSwipeDown:()=>{eA&&eV()},threshold:150,enabled:eA&&eN}),eB=A!==W,eG=E?G.editor:G[er];(0,l.useEffect)(()=>{null==w||w(eB)},[eB,w]);let eU=!E&&eN&&eC&&"split"===er,eJ=(0,l.useMemo)(()=>(0,d.sg)(e=>{et(e)},300),[]);(0,l.useEffect)(()=>()=>eJ.cancel(),[eJ]);let eY=(0,l.useCallback)(async()=>{ea(!0),ed(null);try{let n=await fetch("/api/worktrees/".concat(t,"/files/").concat(r)),l=await n.json();if(!n.ok||!l.success){var e;throw Error((null==(e=l.error)?void 0:e.message)||N("editor.loadError"))}let a=l.content||"";H(a),_(a),et(a),new Blob([a]).size>J.WARNING_THRESHOLD&&eu(!0)}catch(e){ed(e instanceof Error?e.message:N("editor.loadError"))}finally{ea(!1)}},[t,r]),eX=(0,l.useCallback)(async e=>{let n=await fetch("/api/worktrees/".concat(t,"/files/").concat(r),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:e})});if(401===n.status||n.redirected)throw Error(N("editor.sessionExpired"));let l=await n.json();if(!n.ok||!l.success){var a;throw Error((null==(a=l.error)?void 0:a.message)||N("editor.saveError"))}_(e)},[t,r,N]),{isSaving:eZ,error:eQ,saveNow:e0}=(0,D.U)({value:A,saveFn:eX,debounceMs:3e3,disabled:!eO}),e1=(0,l.useCallback)(e=>{eL(e),e&&eB&&eX(A)},[eL,eB,eX,A]),e4=(0,l.useCallback)(async()=>{if(eB&&!eo){es(!0);try{await eX(A),eg(N("editor.saveSuccess"),"success"),v&&v(r,A)}catch(e){eg(e instanceof Error?e.message:N("editor.saveError"),"error")}finally{es(!1)}}},[eX,A,eB,eo,v,r,eg,N]),e2=A.split("\n").length,e5=(0,l.useCallback)(()=>{ew.current&&eb.current&&(eb.current.scrollTop=ew.current.scrollTop)},[]),e3=(0,l.useCallback)(e=>{let t=e.target.value;H(t),eJ(t),null==j||j(t)},[eJ,j]),e8=(0,l.useCallback)(e=>{en(e),localStorage.setItem(U,e)},[]),e7=(0,l.useCallback)(async()=>{if(eO){if((eB||eZ)&&(await e0(),eQ)&&!await C({description:N("editor.saveFailedCloseConfirm"),variant:"danger"}))return}else if(eB&&!await C({description:N("editor.unsavedCloseConfirm"),variant:"danger"}))return;null==x||x()},[eO,eB,eZ,e0,eQ,x,C,N]),e9=(0,l.useCallback)(async()=>{try{await (0,c.l)(A),em()}catch(e){}},[A,em]),e6=(0,l.useCallback)(e=>{if(!ej.current)return;let t=ej.current.offsetWidth;if(0===t)return;let r=e/t;eD(e=>Math.max(.1,Math.min(.9,e+r)))},[eD]),te=(0,l.useCallback)(()=>{eD(.5)},[eD]),tt=(0,l.useCallback)(e=>{if(e.target!==ew.current||e.currentTarget===e.target){if((e.ctrlKey||e.metaKey)&&"s"===e.key){e.preventDefault(),eO?(async()=>{await e0(),null==v||v(r,A)})():e4();return}if((e.ctrlKey||e.metaKey)&&e.shiftKey&&"F"===e.key){e.preventDefault(),ez();return}if("Escape"===e.key&&eA){e.preventDefault(),eV();return}}},[e4,eO,e0,v,r,A,ez,eV,eA]),tr=(0,l.useCallback)(e=>{let t=ew.current;if(!t)return;if(e.value===t.value)return void t.setSelectionRange(e.selectionStart,e.selectionEnd);t.focus(),t.setSelectionRange(e.replaceStart,e.replaceEnd);let r=!1;try{r="function"==typeof document.execCommand&&document.execCommand("insertText",!1,e.replacement)}catch(e){r=!1}if(r)return void t.setSelectionRange(e.selectionStart,e.selectionEnd);eE.current={start:e.selectionStart,end:e.selectionEnd},H(e.value),eJ(e.value),null==j||j(e.value)},[eJ,j]),tn=(0,l.useCallback)(()=>{let e=ew.current;e&&tr(q(e.value,e.selectionStart,e.selectionEnd," "))},[tr]),tl=(0,l.useCallback)(()=>{let e=ew.current;if(!e)return;let t=B(e.value,e.selectionStart,e.selectionEnd," ");t&&tr(t)},[tr]),ta=(0,l.useCallback)(()=>{e$(e=>!e)},[e$]),to=(0,l.useCallback)(e=>{if(e.ctrlKey&&!e.metaKey&&!e.altKey&&("m"===e.key||"M"===e.key)){e.preventDefault(),ta();return}if("Tab"===e.key&&!eK&&!e.ctrlKey&&!e.metaKey&&!e.altKey){let t=e.currentTarget,r=e.shiftKey?B(t.value,t.selectionStart,t.selectionEnd," "):q(t.value,t.selectionStart,t.selectionEnd," ");r&&(e.preventDefault(),tr(r));return}tt(e)},[eK,ta,tr,tt]);(0,l.useEffect)(()=>{let e=eE.current;if(!e)return;eE.current=null;let t=ew.current;t&&(t.focus(),t.setSelectionRange(e.start,e.end))},[A]);let ts=(0,l.useCallback)(e=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{ref:eb,className:"flex-shrink-0 py-4 pl-2 pr-2 text-right select-none text-muted-foreground font-mono text-sm bg-muted dark:bg-muted/50 border-r border-border overflow-hidden","aria-hidden":"true",children:Array.from({length:e2},(e,t)=>(0,n.jsx)("div",{className:"leading-[1.5rem]",children:t+1},t+1))}),(0,n.jsx)("textarea",{ref:ew,"data-testid":"markdown-editor-textarea",value:A,onChange:e3,onKeyDown:to,onScroll:e5,className:"flex-1 py-4 pr-4 pl-3 font-mono text-sm resize-none bg-surface text-foreground focus:outline-none leading-[1.5rem]".concat(e?" focus:ring-2 focus:ring-ring focus:ring-inset":""),placeholder:E?N("editor.placeholder"):N("editor.placeholderMarkdown"),spellCheck:!1})]}),[e2,A,e3,to,e5,E,N]);(0,l.useEffect)(()=>{let e=e=>{"Escape"===e.key&&eA&&(e.preventDefault(),eV())};return eA&&document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[eA,eV]),(0,l.useEffect)(()=>{y||eF&&!eA&&eT()},[]),(0,l.useEffect)(()=>{if("undefined"==typeof document)return;let e=document.getElementById("markdown-editor-portal");return e||((e=document.createElement("div")).id="markdown-editor-portal",document.body.appendChild(e)),ep(e),()=>{let e=document.getElementById("markdown-editor-portal");e&&0===e.childNodes.length&&e.remove()}},[]),(0,l.useEffect)(()=>{null==g||g(eA)},[eA,g]),(0,l.useEffect)(()=>{S||eY()},[eY,S]),(0,l.useEffect)(()=>{let e=eO?eB||eZ:eB,t=t=>{e&&(t.preventDefault(),t.returnValue="")};return e?(ek.current=t,window.addEventListener("beforeunload",t)):ek.current&&(window.removeEventListener("beforeunload",ek.current),ek.current=null),()=>{ek.current&&window.removeEventListener("beforeunload",ek.current)}},[eB,eZ,eO]),(0,l.useEffect)(()=>{eQ&&eO&&(eL(!1),eg(N("editor.autoSaveFailed"),"error"))},[eQ,eO,eL,eg,N]);let ti=(0,l.useMemo)(()=>{let e="flex flex-col bg-surface";return eA&&eP?"".concat(e," fixed inset-0"):"".concat(e," h-full")},[eA,eP]),td=(0,l.useMemo)(()=>{if(eA)return{zIndex:$.M.MAXIMIZED_EDITOR}},[eA]),tc=(0,l.useMemo)(()=>{if("split"===er&&!eU)return{width:"".concat(100*eI,"%"),flexShrink:0}},[er,eI,eU]),tu=(0,l.useMemo)(()=>{if("split"===er&&!eU)return{width:"".concat((1-eI)*100,"%"),flexShrink:0}},[er,eI,eU]),tf=(0,l.useMemo)(()=>{if(eS&&eM>0)return{paddingBottom:eM}},[eS,eM]);if(el)return(0,n.jsx)("div",{"data-testid":"markdown-editor",className:"flex items-center justify-center h-full bg-surface",children:(0,n.jsxs)("div",{className:"text-center",children:[(0,n.jsx)(m.y,{size:"xl",variant:"accent",className:"inline-block"}),(0,n.jsx)("p",{className:"mt-4 text-muted-foreground",children:N("editor.loading")})]})});if(ei)return(0,n.jsx)("div",{"data-testid":"markdown-editor-error",className:"flex items-center justify-center h-full bg-surface",children:(0,n.jsxs)("div",{className:"text-center",children:[(0,n.jsx)(i.A,{className:"h-12 w-12 text-danger mx-auto mb-4"}),(0,n.jsx)("p",{className:"text-danger-foreground",children:ei}),x&&(0,n.jsx)("button",{onClick:x,className:"mt-4 px-4 py-2 bg-muted hover:bg-muted/80 rounded-lg text-foreground",children:N("actions.close")})]})});let tm=(0,n.jsxs)("div",{ref:e=>{ey.current=e,eq.current=e},"data-testid":"markdown-editor",className:ti,style:td,onKeyDown:tt,role:eA&&eP?"dialog":void 0,"aria-modal":eA&&eP?"true":void 0,children:[(0,n.jsx)(F,{filePath:r,isDirty:eB,viewMode:er,onViewModeChange:e8,showMobileTabs:eU,copied:ef,onCopy:e9,isMaximized:eA,onToggleFullscreen:ez,isAutoSaveEnabled:eO,onAutoSaveToggle:e1,isAutoSaving:eZ,isSaving:eo,onSave:e4,onClose:x?e7:void 0,hideViewModeToggle:E||y,hideMaximizeButton:y,onIndent:tn,onOutdent:tl,tabMovesFocus:eK,onToggleTabMovesFocus:ta}),eA&&(0,n.jsx)(R.OJ,{isMobile:eN}),ec&&(0,n.jsx)(R.Uc,{onDismiss:()=>eu(!1)}),eU&&(0,n.jsx)(R.RF,{mobileTab:eh,onTabChange:ex}),(0,n.jsxs)("div",{ref:ej,className:"flex flex-1 overflow-hidden",style:tf,children:[eU?"editor"===eh&&(0,n.jsx)("div",{"data-testid":"markdown-editor-container",className:"flex overflow-hidden w-full flex-1",children:ts(!1)}):(0,n.jsx)("div",{"data-testid":"markdown-editor-container",className:"flex overflow-hidden transition-all duration-200 ".concat(eG.showEditor?"":"hidden"),style:"split"===er?tc:{width:eG.showEditor?"100%":"0%"},children:ts(!0)}),"split"===er&&eG.showEditor&&eG.showPreview&&!eU&&(0,n.jsx)(h.f,{onResize:e6,onDoubleClick:te,orientation:"horizontal",ariaValueNow:Math.round(100*eI),minRatio:.1}),eU?"preview"===eh&&(0,n.jsx)("div",{"data-testid":"markdown-preview-container",className:"flex flex-col overflow-hidden w-full",children:(0,n.jsx)(Q,{previewContent:ee,onOpenFile:b,filePath:r,worktreeId:t,tocVisible:eH,onToggleTocVisible:e_,tocTitle:N("toc.title"),tocShowLabel:N("toc.show"),tocHideLabel:N("toc.hide")})}):(0,n.jsx)("div",{"data-testid":"markdown-preview-container",className:"flex flex-col overflow-hidden transition-all duration-200 ".concat(eG.showPreview?"":"hidden"),style:"split"===er?tu:{width:eG.showPreview?"100%":"0%"},children:(0,n.jsx)(Q,{previewContent:ee,onOpenFile:b,filePath:r,worktreeId:t,tocVisible:eH,onToggleTocVisible:e_,tocTitle:N("toc.title"),tocShowLabel:N("toc.show"),tocHideLabel:N("toc.hide")})})]})]});return eA&&eP&&ev?(0,a.createPortal)(tm,ev):tm})},55924:(e,t,r)=>{r.d(t,{K:()=>a});var n=r(95155),l=r(12115);function a(e){let{entries:t,title:r,headerOffset:a=64,root:o=null,className:s=""}=e,[i,d]=(0,l.useState)(null);return((0,l.useRef)(null).current=i,(0,l.useEffect)(()=>{if("undefined"==typeof IntersectionObserver||0===t.length)return;let e=new IntersectionObserver(e=>{let t=function(e){let t=e.filter(e=>e.isIntersecting).sort((e,t)=>e.boundingClientRect.top-t.boundingClientRect.top);return t.length>0?t[0].target.id:null}(e);t&&d(t)},{root:o,rootMargin:"-".concat(a,"px 0px -70% 0px"),threshold:0}),r=[];for(let n of t){let t=document.getElementById(n.id);t&&(e.observe(t),r.push(t))}return()=>{e.disconnect(),r.length=0}},[t,a,o]),0===t.length)?null:(0,n.jsxs)("nav",{"aria-label":r,className:s,children:[(0,n.jsx)("p",{className:"px-3 pb-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:r}),(0,n.jsx)("ul",{className:"space-y-0.5 text-sm",children:t.map((e,t)=>{let r=e.id===i;return(0,n.jsx)("li",{children:(0,n.jsx)("a",{href:"#".concat(e.id),onClick:t=>((e,t)=>{e.preventDefault();let r="undefined"!=typeof document?document.getElementById(t):null;r&&r.scrollIntoView({behavior:"smooth",block:"start"}),d(t)})(t,e.id),"aria-current":r?"location":void 0,"data-depth":e.depth,style:{paddingLeft:"".concat((e.depth-1)*12+12,"px")},className:["block truncate rounded py-1 pr-2 transition-colors",r?"bg-accent-50 font-medium text-accent-700":"text-muted-foreground hover:bg-muted hover:text-foreground"].join(" "),title:e.text,children:e.text})},"".concat(e.id,"-").concat(t))})})]})}},79962:(e,t,r)=>{r.d(t,{K:()=>s,Y:()=>l});var n=r(21286);let l="commandmate:md-toc-visible",a=/^ {0,3}(#{1,6})(?:[ \t]+(.*?))?[ \t]*$/,o=/^( {0,3})(`{3,}|~{3,})(.*)$/;function s(e){if(!e)return[];let t=new n.A,r=[],l=null,s=0;for(let n of e.split("\n")){var i;let e=o.exec(n);if(l){if(e){let t=e[2];t[0]===l&&t.length>=s&&""===e[3].trim()&&(l=null,s=0)}continue}if(e){let t=e[2],r=t[0];if("`"===r&&e[3].includes("`"));else{l=r,s=t.length;continue}}let d=a.exec(n);if(!d)continue;let c=d[1].length,u=function(e){let t=e;return(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace(/!\[[^\]]*\]\([^)]*\)/g,"")).replace(/!\[[^\]]*\]\[[^\]]*\]/g,"")).replace(/\[([^\]]*)\]\([^)]*\)/g,"$1")).replace(/\[([^\]]*)\]\[[^\]]*\]/g,"$1")).replace(/\[([^\]]*)\]/g,"$1")).replace(/(`+)([\s\S]*?)\1/g,"$2")).replace(/(\*\*|__)(.*?)\1/g,"$2")).replace(/(\*|_)(.*?)\1/g,"$2")).replace(/~~(.*?)~~/g,"$1")).replace(/\\([\\`*_{}[\]()#+\-.!~])/g,"$1")).trim()}((null!=(i=d[2])?i:"").replace(/([ \t]|^)#+[ \t]*$/,"")),f=t.slug(u);r.push({depth:c,text:u,id:f})}return r}},80003:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("list",[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]])}}]);