commandmate 0.44.3 → 0.45.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 (352) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-build-manifest.json +293 -292
  3. package/.next/app-path-routes-manifest.json +21 -21
  4. package/.next/build-manifest.json +5 -5
  5. package/.next/next-server.js.nft.json +1 -1
  6. package/.next/prerender-manifest.json +9 -9
  7. package/.next/react-loadable-manifest.json +29 -29
  8. package/.next/required-server-files.json +1 -1
  9. package/.next/server/app/_not-found/page_client-reference-manifest.js +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_client-reference-manifest.js +1 -1
  12. package/.next/server/app/api/app/release-notes/route_client-reference-manifest.js +1 -1
  13. package/.next/server/app/api/app/update/route_client-reference-manifest.js +1 -1
  14. package/.next/server/app/api/app/update-check/route_client-reference-manifest.js +1 -1
  15. package/.next/server/app/api/auth/login/route_client-reference-manifest.js +1 -1
  16. package/.next/server/app/api/auth/logout/route_client-reference-manifest.js +1 -1
  17. package/.next/server/app/api/auth/status/route_client-reference-manifest.js +1 -1
  18. package/.next/server/app/api/capabilities/route.js +1 -1
  19. package/.next/server/app/api/capabilities/route_client-reference-manifest.js +1 -1
  20. package/.next/server/app/api/daily-summary/route_client-reference-manifest.js +1 -1
  21. package/.next/server/app/api/daily-summary/status/route_client-reference-manifest.js +1 -1
  22. package/.next/server/app/api/external-apps/[id]/health/route_client-reference-manifest.js +1 -1
  23. package/.next/server/app/api/external-apps/[id]/route_client-reference-manifest.js +1 -1
  24. package/.next/server/app/api/external-apps/route_client-reference-manifest.js +1 -1
  25. package/.next/server/app/api/fs/browse/route_client-reference-manifest.js +1 -1
  26. package/.next/server/app/api/fs/recent-paths/route_client-reference-manifest.js +1 -1
  27. package/.next/server/app/api/hooks/agent-event/route.js +2 -2
  28. package/.next/server/app/api/hooks/agent-event/route.js.nft.json +1 -1
  29. package/.next/server/app/api/hooks/agent-event/route_client-reference-manifest.js +1 -1
  30. package/.next/server/app/api/hooks/claude-done/route.js +2 -2
  31. package/.next/server/app/api/hooks/claude-done/route.js.nft.json +1 -1
  32. package/.next/server/app/api/hooks/claude-done/route_client-reference-manifest.js +1 -1
  33. package/.next/server/app/api/hooks/permission-request/route.js +1 -1
  34. package/.next/server/app/api/hooks/permission-request/route.js.nft.json +1 -1
  35. package/.next/server/app/api/hooks/permission-request/route_client-reference-manifest.js +1 -1
  36. package/.next/server/app/api/metrics/vibe/route_client-reference-manifest.js +1 -1
  37. package/.next/server/app/api/ollama/models/route_client-reference-manifest.js +1 -1
  38. package/.next/server/app/api/push/escalation/route_client-reference-manifest.js +1 -1
  39. package/.next/server/app/api/push/subscriptions/route_client-reference-manifest.js +1 -1
  40. package/.next/server/app/api/push/vapid/route_client-reference-manifest.js +1 -1
  41. package/.next/server/app/api/relays/[relayId]/cancel/route.js +1 -1
  42. package/.next/server/app/api/relays/[relayId]/cancel/route.js.nft.json +1 -1
  43. package/.next/server/app/api/relays/[relayId]/cancel/route_client-reference-manifest.js +1 -1
  44. package/.next/server/app/api/relays/route.js +1 -1
  45. package/.next/server/app/api/relays/route.js.nft.json +1 -1
  46. package/.next/server/app/api/relays/route_client-reference-manifest.js +1 -1
  47. package/.next/server/app/api/remote/pair/route_client-reference-manifest.js +1 -1
  48. package/.next/server/app/api/repositories/[id]/route_client-reference-manifest.js +1 -1
  49. package/.next/server/app/api/repositories/clone/[jobId]/route.js +1 -1
  50. package/.next/server/app/api/repositories/clone/[jobId]/route.js.nft.json +1 -1
  51. package/.next/server/app/api/repositories/clone/[jobId]/route_client-reference-manifest.js +1 -1
  52. package/.next/server/app/api/repositories/clone/route.js +1 -1
  53. package/.next/server/app/api/repositories/clone/route.js.nft.json +1 -1
  54. package/.next/server/app/api/repositories/clone/route_client-reference-manifest.js +1 -1
  55. package/.next/server/app/api/repositories/excluded/route_client-reference-manifest.js +1 -1
  56. package/.next/server/app/api/repositories/restore/route.js +1 -1
  57. package/.next/server/app/api/repositories/restore/route.js.nft.json +1 -1
  58. package/.next/server/app/api/repositories/restore/route_client-reference-manifest.js +1 -1
  59. package/.next/server/app/api/repositories/route.js +1 -1
  60. package/.next/server/app/api/repositories/route.js.nft.json +1 -1
  61. package/.next/server/app/api/repositories/route_client-reference-manifest.js +1 -1
  62. package/.next/server/app/api/repositories/scan/route.js +1 -1
  63. package/.next/server/app/api/repositories/scan/route.js.nft.json +1 -1
  64. package/.next/server/app/api/repositories/scan/route_client-reference-manifest.js +1 -1
  65. package/.next/server/app/api/repositories/sync/route.js +1 -1
  66. package/.next/server/app/api/repositories/sync/route.js.nft.json +1 -1
  67. package/.next/server/app/api/repositories/sync/route_client-reference-manifest.js +1 -1
  68. package/.next/server/app/api/repositories/validate-path/route_client-reference-manifest.js +1 -1
  69. package/.next/server/app/api/settings/default-agents/route.js +1 -1
  70. package/.next/server/app/api/settings/default-agents/route.js.nft.json +1 -1
  71. package/.next/server/app/api/settings/default-agents/route_client-reference-manifest.js +1 -1
  72. package/.next/server/app/api/settings/default-surface-mode/route_client-reference-manifest.js +1 -1
  73. package/.next/server/app/api/sidebar/group-order/route_client-reference-manifest.js +1 -1
  74. package/.next/server/app/api/skills/[id]/route_client-reference-manifest.js +1 -1
  75. package/.next/server/app/api/skills/installations/route_client-reference-manifest.js +1 -1
  76. package/.next/server/app/api/skills/operations/route_client-reference-manifest.js +1 -1
  77. package/.next/server/app/api/skills/reindex/route_client-reference-manifest.js +1 -1
  78. package/.next/server/app/api/skills/route_client-reference-manifest.js +1 -1
  79. package/.next/server/app/api/slash-commands/route_client-reference-manifest.js +1 -1
  80. package/.next/server/app/api/tasks/[taskId]/cancel/route_client-reference-manifest.js +1 -1
  81. package/.next/server/app/api/tasks/[taskId]/route_client-reference-manifest.js +1 -1
  82. package/.next/server/app/api/templates/[id]/route_client-reference-manifest.js +1 -1
  83. package/.next/server/app/api/templates/route_client-reference-manifest.js +1 -1
  84. package/.next/server/app/api/verification/runs/[runId]/route_client-reference-manifest.js +1 -1
  85. package/.next/server/app/api/verification/runs/route_client-reference-manifest.js +1 -1
  86. package/.next/server/app/api/worktrees/[id]/auto-yes/route.js +1 -1
  87. package/.next/server/app/api/worktrees/[id]/auto-yes/route.js.nft.json +1 -1
  88. package/.next/server/app/api/worktrees/[id]/auto-yes/route_client-reference-manifest.js +1 -1
  89. package/.next/server/app/api/worktrees/[id]/capture/route.js +1 -1
  90. package/.next/server/app/api/worktrees/[id]/capture/route.js.nft.json +1 -1
  91. package/.next/server/app/api/worktrees/[id]/capture/route_client-reference-manifest.js +1 -1
  92. package/.next/server/app/api/worktrees/[id]/clear-composer/route.js +1 -1
  93. package/.next/server/app/api/worktrees/[id]/clear-composer/route.js.nft.json +1 -1
  94. package/.next/server/app/api/worktrees/[id]/clear-composer/route_client-reference-manifest.js +1 -1
  95. package/.next/server/app/api/worktrees/[id]/cli-reference/route_client-reference-manifest.js +1 -1
  96. package/.next/server/app/api/worktrees/[id]/cli-tool/route_client-reference-manifest.js +1 -1
  97. package/.next/server/app/api/worktrees/[id]/cmate/schedules/route_client-reference-manifest.js +1 -1
  98. package/.next/server/app/api/worktrees/[id]/current-output/route.js +1 -1
  99. package/.next/server/app/api/worktrees/[id]/current-output/route.js.nft.json +1 -1
  100. package/.next/server/app/api/worktrees/[id]/current-output/route_client-reference-manifest.js +1 -1
  101. package/.next/server/app/api/worktrees/[id]/direct-input/route.js +1 -1
  102. package/.next/server/app/api/worktrees/[id]/direct-input/route.js.nft.json +1 -1
  103. package/.next/server/app/api/worktrees/[id]/direct-input/route_client-reference-manifest.js +1 -1
  104. package/.next/server/app/api/worktrees/[id]/env/route_client-reference-manifest.js +1 -1
  105. package/.next/server/app/api/worktrees/[id]/execution-logs/[logId]/route_client-reference-manifest.js +1 -1
  106. package/.next/server/app/api/worktrees/[id]/execution-logs/route_client-reference-manifest.js +1 -1
  107. package/.next/server/app/api/worktrees/[id]/files/[...path]/route_client-reference-manifest.js +1 -1
  108. package/.next/server/app/api/worktrees/[id]/git/branch/create/route_client-reference-manifest.js +1 -1
  109. package/.next/server/app/api/worktrees/[id]/git/branch/delete/route_client-reference-manifest.js +1 -1
  110. package/.next/server/app/api/worktrees/[id]/git/branches/route_client-reference-manifest.js +1 -1
  111. package/.next/server/app/api/worktrees/[id]/git/checkout/route.js +1 -1
  112. package/.next/server/app/api/worktrees/[id]/git/checkout/route_client-reference-manifest.js +1 -1
  113. package/.next/server/app/api/worktrees/[id]/git/commit/route_client-reference-manifest.js +1 -1
  114. package/.next/server/app/api/worktrees/[id]/git/diff/route_client-reference-manifest.js +1 -1
  115. package/.next/server/app/api/worktrees/[id]/git/fetch/route_client-reference-manifest.js +1 -1
  116. package/.next/server/app/api/worktrees/[id]/git/log/route_client-reference-manifest.js +1 -1
  117. package/.next/server/app/api/worktrees/[id]/git/pull/route_client-reference-manifest.js +1 -1
  118. package/.next/server/app/api/worktrees/[id]/git/push/route_client-reference-manifest.js +1 -1
  119. package/.next/server/app/api/worktrees/[id]/git/reset/route.js +1 -1
  120. package/.next/server/app/api/worktrees/[id]/git/reset/route_client-reference-manifest.js +1 -1
  121. package/.next/server/app/api/worktrees/[id]/git/revert/route_client-reference-manifest.js +1 -1
  122. package/.next/server/app/api/worktrees/[id]/git/show/[commitHash]/route_client-reference-manifest.js +1 -1
  123. package/.next/server/app/api/worktrees/[id]/git/stage/route_client-reference-manifest.js +1 -1
  124. package/.next/server/app/api/worktrees/[id]/git/staged/route_client-reference-manifest.js +1 -1
  125. package/.next/server/app/api/worktrees/[id]/git/stash/[index]/route_client-reference-manifest.js +1 -1
  126. package/.next/server/app/api/worktrees/[id]/git/stash/apply/route_client-reference-manifest.js +1 -1
  127. package/.next/server/app/api/worktrees/[id]/git/stash/pop/route_client-reference-manifest.js +1 -1
  128. package/.next/server/app/api/worktrees/[id]/git/stash/push/route_client-reference-manifest.js +1 -1
  129. package/.next/server/app/api/worktrees/[id]/git/stash/route_client-reference-manifest.js +1 -1
  130. package/.next/server/app/api/worktrees/[id]/git/status/route_client-reference-manifest.js +1 -1
  131. package/.next/server/app/api/worktrees/[id]/git/unstage/route_client-reference-manifest.js +1 -1
  132. package/.next/server/app/api/worktrees/[id]/git/working-diff/route_client-reference-manifest.js +1 -1
  133. package/.next/server/app/api/worktrees/[id]/instances/notes/route_client-reference-manifest.js +1 -1
  134. package/.next/server/app/api/worktrees/[id]/instances/opencode/route.js.nft.json +1 -1
  135. package/.next/server/app/api/worktrees/[id]/instances/opencode/route_client-reference-manifest.js +1 -1
  136. package/.next/server/app/api/worktrees/[id]/interrupt/route.js +1 -1
  137. package/.next/server/app/api/worktrees/[id]/interrupt/route.js.nft.json +1 -1
  138. package/.next/server/app/api/worktrees/[id]/interrupt/route_client-reference-manifest.js +1 -1
  139. package/.next/server/app/api/worktrees/[id]/kill-session/route.js +1 -1
  140. package/.next/server/app/api/worktrees/[id]/kill-session/route.js.nft.json +1 -1
  141. package/.next/server/app/api/worktrees/[id]/kill-session/route_client-reference-manifest.js +1 -1
  142. package/.next/server/app/api/worktrees/[id]/logs/[filename]/route_client-reference-manifest.js +1 -1
  143. package/.next/server/app/api/worktrees/[id]/logs/route_client-reference-manifest.js +1 -1
  144. package/.next/server/app/api/worktrees/[id]/marp-render/route.js +3 -3
  145. package/.next/server/app/api/worktrees/[id]/marp-render/route_client-reference-manifest.js +1 -1
  146. package/.next/server/app/api/worktrees/[id]/memos/[memoId]/route_client-reference-manifest.js +1 -1
  147. package/.next/server/app/api/worktrees/[id]/memos/route_client-reference-manifest.js +1 -1
  148. package/.next/server/app/api/worktrees/[id]/messages/route_client-reference-manifest.js +1 -1
  149. package/.next/server/app/api/worktrees/[id]/opencode/diff/route_client-reference-manifest.js +1 -1
  150. package/.next/server/app/api/worktrees/[id]/opencode/session/route_client-reference-manifest.js +1 -1
  151. package/.next/server/app/api/worktrees/[id]/opencode/share/route_client-reference-manifest.js +1 -1
  152. package/.next/server/app/api/worktrees/[id]/prompt-response/route.js +1 -1
  153. package/.next/server/app/api/worktrees/[id]/prompt-response/route.js.nft.json +1 -1
  154. package/.next/server/app/api/worktrees/[id]/prompt-response/route_client-reference-manifest.js +1 -1
  155. package/.next/server/app/api/worktrees/[id]/resolve-target/route_client-reference-manifest.js +1 -1
  156. package/.next/server/app/api/worktrees/[id]/respond/route.js +1 -1
  157. package/.next/server/app/api/worktrees/[id]/respond/route.js.nft.json +1 -1
  158. package/.next/server/app/api/worktrees/[id]/respond/route_client-reference-manifest.js +1 -1
  159. package/.next/server/app/api/worktrees/[id]/route.js +1 -1
  160. package/.next/server/app/api/worktrees/[id]/route.js.nft.json +1 -1
  161. package/.next/server/app/api/worktrees/[id]/route_client-reference-manifest.js +1 -1
  162. package/.next/server/app/api/worktrees/[id]/schedules/[scheduleId]/route_client-reference-manifest.js +1 -1
  163. package/.next/server/app/api/worktrees/[id]/schedules/active/route_client-reference-manifest.js +1 -1
  164. package/.next/server/app/api/worktrees/[id]/schedules/route_client-reference-manifest.js +1 -1
  165. package/.next/server/app/api/worktrees/[id]/search/route_client-reference-manifest.js +1 -1
  166. package/.next/server/app/api/worktrees/[id]/send/route.js +1 -1
  167. package/.next/server/app/api/worktrees/[id]/send/route.js.nft.json +1 -1
  168. package/.next/server/app/api/worktrees/[id]/send/route_client-reference-manifest.js +1 -1
  169. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route.js +2 -2
  170. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route.js.nft.json +1 -1
  171. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route_client-reference-manifest.js +1 -1
  172. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/install/route_client-reference-manifest.js +1 -1
  173. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/plan/route_client-reference-manifest.js +1 -1
  174. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall/route_client-reference-manifest.js +1 -1
  175. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall-plan/route_client-reference-manifest.js +1 -1
  176. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/update/route_client-reference-manifest.js +1 -1
  177. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/update-plan/route_client-reference-manifest.js +1 -1
  178. package/.next/server/app/api/worktrees/[id]/skills/route_client-reference-manifest.js +1 -1
  179. package/.next/server/app/api/worktrees/[id]/slash-commands/route_client-reference-manifest.js +1 -1
  180. package/.next/server/app/api/worktrees/[id]/special-keys/route.js +1 -1
  181. package/.next/server/app/api/worktrees/[id]/special-keys/route.js.nft.json +1 -1
  182. package/.next/server/app/api/worktrees/[id]/special-keys/route_client-reference-manifest.js +1 -1
  183. package/.next/server/app/api/worktrees/[id]/tasks/route_client-reference-manifest.js +1 -1
  184. package/.next/server/app/api/worktrees/[id]/terminal/route.js +1 -1
  185. package/.next/server/app/api/worktrees/[id]/terminal/route.js.nft.json +1 -1
  186. package/.next/server/app/api/worktrees/[id]/terminal/route_client-reference-manifest.js +1 -1
  187. package/.next/server/app/api/worktrees/[id]/timers/history/route_client-reference-manifest.js +1 -1
  188. package/.next/server/app/api/worktrees/[id]/timers/route.js +1 -1
  189. package/.next/server/app/api/worktrees/[id]/timers/route.js.nft.json +1 -1
  190. package/.next/server/app/api/worktrees/[id]/timers/route_client-reference-manifest.js +1 -1
  191. package/.next/server/app/api/worktrees/[id]/todos/[todoId]/route_client-reference-manifest.js +1 -1
  192. package/.next/server/app/api/worktrees/[id]/todos/route_client-reference-manifest.js +1 -1
  193. package/.next/server/app/api/worktrees/[id]/tree/[...path]/route_client-reference-manifest.js +1 -1
  194. package/.next/server/app/api/worktrees/[id]/tree/route_client-reference-manifest.js +1 -1
  195. package/.next/server/app/api/worktrees/[id]/upload/[...path]/route_client-reference-manifest.js +1 -1
  196. package/.next/server/app/api/worktrees/[id]/verify/config/route_client-reference-manifest.js +1 -1
  197. package/.next/server/app/api/worktrees/[id]/verify/route_client-reference-manifest.js +1 -1
  198. package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/cancel/route_client-reference-manifest.js +1 -1
  199. package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/route_client-reference-manifest.js +1 -1
  200. package/.next/server/app/api/worktrees/[id]/verify/runs/route_client-reference-manifest.js +1 -1
  201. package/.next/server/app/api/worktrees/[id]/viewed/route_client-reference-manifest.js +1 -1
  202. package/.next/server/app/api/worktrees/apply-default-agents/route_client-reference-manifest.js +1 -1
  203. package/.next/server/app/api/worktrees/route.js +1 -1
  204. package/.next/server/app/api/worktrees/route.js.nft.json +1 -1
  205. package/.next/server/app/api/worktrees/route_client-reference-manifest.js +1 -1
  206. package/.next/server/app/login/page_client-reference-manifest.js +1 -1
  207. package/.next/server/app/manifest.webmanifest/route_client-reference-manifest.js +1 -1
  208. package/.next/server/app/more/page_client-reference-manifest.js +1 -1
  209. package/.next/server/app/offline/page_client-reference-manifest.js +1 -1
  210. package/.next/server/app/page_client-reference-manifest.js +1 -1
  211. package/.next/server/app/proxy/[...path]/route_client-reference-manifest.js +1 -1
  212. package/.next/server/app/repositories/page_client-reference-manifest.js +1 -1
  213. package/.next/server/app/review/page_client-reference-manifest.js +1 -1
  214. package/.next/server/app/sessions/page.js +1 -1
  215. package/.next/server/app/sessions/page.js.nft.json +1 -1
  216. package/.next/server/app/sessions/page_client-reference-manifest.js +1 -1
  217. package/.next/server/app/skills/[skillId]/page.js +2 -2
  218. package/.next/server/app/skills/[skillId]/page.js.nft.json +1 -1
  219. package/.next/server/app/skills/[skillId]/page_client-reference-manifest.js +1 -1
  220. package/.next/server/app/skills/installed/page_client-reference-manifest.js +1 -1
  221. package/.next/server/app/skills/page_client-reference-manifest.js +1 -1
  222. package/.next/server/app/worktrees/[id]/files/[...path]/page.js +1 -1
  223. package/.next/server/app/worktrees/[id]/files/[...path]/page.js.nft.json +1 -1
  224. package/.next/server/app/worktrees/[id]/files/[...path]/page_client-reference-manifest.js +1 -1
  225. package/.next/server/app/worktrees/[id]/page.js +5 -5
  226. package/.next/server/app/worktrees/[id]/page.js.nft.json +1 -1
  227. package/.next/server/app/worktrees/[id]/page_client-reference-manifest.js +1 -1
  228. package/.next/server/app/worktrees/[id]/terminal/page_client-reference-manifest.js +1 -1
  229. package/.next/server/app-paths-manifest.json +21 -21
  230. package/.next/server/chunks/1503.js +2 -2
  231. package/.next/server/chunks/1559.js +2 -2
  232. package/.next/server/chunks/1944.js +1 -1
  233. package/.next/server/chunks/2119.js +1 -1
  234. package/.next/server/chunks/22.js +1 -1
  235. package/.next/server/chunks/2335.js +1 -0
  236. package/.next/server/chunks/2404.js +1 -1
  237. package/.next/server/chunks/2445.js +1 -1
  238. package/.next/server/chunks/2460.js +1 -1
  239. package/.next/server/chunks/2710.js +2 -2
  240. package/.next/server/chunks/2908.js +1 -1
  241. package/.next/server/chunks/3241.js +1 -1
  242. package/.next/server/chunks/4243.js +1 -0
  243. package/.next/server/chunks/4837.js +3 -3
  244. package/.next/server/chunks/5048.js +1 -1
  245. package/.next/server/chunks/5064.js +1 -1
  246. package/.next/server/chunks/5209.js +1 -1
  247. package/.next/server/chunks/5292.js +7 -0
  248. package/.next/server/chunks/5625.js +3 -3
  249. package/.next/server/chunks/5737.js +1 -1
  250. package/.next/server/chunks/6065.js +1 -1
  251. package/.next/server/chunks/6130.js +1 -1
  252. package/.next/server/chunks/6401.js +1 -1
  253. package/.next/server/chunks/6927.js +1 -1
  254. package/.next/server/chunks/850.js +1 -1
  255. package/.next/server/chunks/8728.js +2 -2
  256. package/.next/server/chunks/8918.js +4 -6
  257. package/.next/server/chunks/9051.js +1 -1
  258. package/.next/server/chunks/9130.js +1 -1
  259. package/.next/server/chunks/9355.js +1 -0
  260. package/.next/server/chunks/9390.js +1 -1
  261. package/.next/server/chunks/9584.js +1 -1
  262. package/.next/server/chunks/9731.js +1 -1
  263. package/.next/server/chunks/9862.js +1 -0
  264. package/.next/server/middleware-build-manifest.js +1 -1
  265. package/.next/server/middleware-manifest.json +5 -5
  266. package/.next/server/middleware-react-loadable-manifest.js +1 -1
  267. package/.next/server/pages/500.html +1 -1
  268. package/.next/server/server-reference-manifest.json +1 -1
  269. package/.next/static/chunks/{7485.442b21101fca7257.js → 1111.5ab4f0ffb0d944e5.js} +4 -4
  270. package/.next/static/chunks/1464.09cd37fee202ec4b.js +1 -0
  271. package/.next/static/chunks/{1642-767aed8e7c61ef7f.js → 1642-0f1bf8fb8161e10a.js} +1 -1
  272. package/.next/static/chunks/{2407-06d35bb1aa02de80.js → 2407-86890b00eeecf391.js} +1 -1
  273. package/.next/static/chunks/{2751-9ef0f4b450bd4ef0.js → 2751-5f0b2702accd164d.js} +1 -1
  274. package/.next/static/chunks/{282.6b6f2e31a96674dd.js → 282.a1013532fd9a61b4.js} +1 -1
  275. package/.next/static/chunks/3237.94c29281d9ec122e.js +1 -0
  276. package/.next/static/chunks/3480.2e21f62e5e9d3ba5.js +1 -0
  277. package/.next/static/chunks/3662-5a27ee39a3ecba49.js +1 -0
  278. package/.next/static/chunks/3922.0bc2e4e168d2b522.js +1 -0
  279. package/.next/static/chunks/4290.c06dbe243819fea0.js +66 -0
  280. package/.next/static/chunks/4541-b0ce0bf829ae79b7.js +1 -0
  281. package/.next/static/chunks/4727-4c69d1aa4118cc09.js +1 -0
  282. package/.next/static/chunks/{5222.305dc0ebba9c0784.js → 5222.39e2034d3fce233c.js} +1 -1
  283. package/.next/static/chunks/5371-af1c2b68e983da61.js +1 -0
  284. package/.next/static/chunks/6288-09feba367cc2c65e.js +1 -0
  285. package/.next/static/chunks/{7095.8c869e553133a40e.js → 7095.87323a4fdf426341.js} +1 -1
  286. package/.next/static/chunks/953.31c52a251deda22d.js +1 -0
  287. package/.next/static/chunks/app/{layout-0d1750b833f5cc3e.js → layout-eaa6365f8f942e88.js} +1 -1
  288. package/.next/static/chunks/app/sessions/{page-2af68c63211c751f.js → page-ebfed2c80e916fb8.js} +1 -1
  289. package/.next/static/chunks/app/skills/[skillId]/page-e4b14031f946c007.js +1 -0
  290. package/.next/static/chunks/app/worktrees/[id]/files/[...path]/page-9cf1ecc59e36a004.js +1 -0
  291. package/.next/static/chunks/app/worktrees/[id]/page-3372b78fde232b1f.js +1 -0
  292. package/.next/static/chunks/{webpack-021f0741f22dd16a.js → webpack-ee3ccbe378c4aa06.js} +1 -1
  293. package/.next/static/css/{057f64a65726c439.css → 6faeb04a0b6819d4.css} +1 -1
  294. package/.next/trace +13 -13
  295. package/dist/cli/commands/skill-format.d.ts +8 -0
  296. package/dist/cli/commands/skill-format.d.ts.map +1 -1
  297. package/dist/cli/commands/skill-format.js +13 -3
  298. package/dist/cli/commands/wait.d.ts.map +1 -1
  299. package/dist/cli/commands/wait.js +71 -3
  300. package/dist/cli/types/api-responses.d.ts +7 -10
  301. package/dist/cli/types/api-responses.d.ts.map +1 -1
  302. package/dist/cli/utils/verify-runner.d.ts +21 -0
  303. package/dist/cli/utils/verify-runner.d.ts.map +1 -1
  304. package/dist/cli/utils/verify-runner.js +38 -1
  305. package/dist/server/locales/en/worktree.json +7 -2
  306. package/dist/server/locales/ja/worktree.json +7 -2
  307. package/dist/server/src/lib/auto-yes-poller.js +16 -163
  308. package/dist/server/src/lib/detection/model-info-extractor.js +57 -3
  309. package/dist/server/src/lib/detection/status-detector.js +1 -1
  310. package/dist/server/src/lib/git/git-exec.js +23 -5
  311. package/dist/server/src/lib/hooks/sources/claude/self-resume.js +213 -0
  312. package/dist/server/src/lib/hooks/sources/claude/source.js +24 -7
  313. package/dist/server/src/lib/polling/auto-yes-enter-fallback-state.js +1 -1
  314. package/dist/server/src/lib/polling/auto-yes-poller-state.js +52 -0
  315. package/dist/server/src/lib/polling/auto-yes-prompt-suppression.js +125 -0
  316. package/dist/server/src/lib/polling/prompt-dedup.js +93 -2
  317. package/dist/server/src/lib/polling/response-checker.js +40 -2
  318. package/dist/server/src/lib/polling/response-dedup.js +62 -1
  319. package/dist/server/src/lib/session/agent-event-dedup.js +2 -2
  320. package/dist/server/src/lib/session/agent-event-state.js +2 -1
  321. package/dist/server/src/lib/session/agent-event-turn.js +51 -0
  322. package/dist/server/src/lib/session/current-output-builder.js +0 -5
  323. package/dist/server/src/lib/skills/install-plan.js +1 -0
  324. package/dist/server/src/lib/skills/preview-diff.js +24 -3
  325. package/dist/server/src/lib/skills/uninstall-plan.js +1 -0
  326. package/dist/server/src/lib/verification/env-clean-gate.js +6 -5
  327. package/docs/en/user-guide/commands-guide.md +0 -1
  328. package/package.json +3 -2
  329. package/release-notes/0.45.0.json +41 -0
  330. package/release-notes/0.45.1.json +38 -0
  331. package/scripts/hooks/cmate-agent-event.sh +20 -0
  332. package/.next/server/chunks/364.js +0 -1
  333. package/.next/server/chunks/4672.js +0 -5
  334. package/.next/server/chunks/4802.js +0 -1
  335. package/.next/server/chunks/488.js +0 -1
  336. package/.next/server/chunks/5326.js +0 -1
  337. package/.next/static/chunks/2053-85a974ddfe7498fe.js +0 -1
  338. package/.next/static/chunks/3922.f45dcfc1e7da552a.js +0 -1
  339. package/.next/static/chunks/4290.6cf86f68d73b6e77.js +0 -82
  340. package/.next/static/chunks/4459.a94b52985a76509a.js +0 -1
  341. package/.next/static/chunks/4727-5d695d71e3fdf97b.js +0 -1
  342. package/.next/static/chunks/5951.616956b6aa5df63f.js +0 -1
  343. package/.next/static/chunks/8283-26ad31a4670ea52d.js +0 -1
  344. package/.next/static/chunks/8566-aeda747542072ace.js +0 -1
  345. package/.next/static/chunks/8811-29eaa24237f48558.js +0 -1
  346. package/.next/static/chunks/953.19e4c8178c9eac4c.js +0 -1
  347. package/.next/static/chunks/9856.15463dd58437e2ac.js +0 -1
  348. package/.next/static/chunks/app/skills/[skillId]/page-9ee7a381636e60cb.js +0 -1
  349. package/.next/static/chunks/app/worktrees/[id]/files/[...path]/page-5445205c8dd80109.js +0 -1
  350. package/.next/static/chunks/app/worktrees/[id]/page-e36898c3a80e7302.js +0 -1
  351. /package/.next/static/{tWwHQzmvc-rv9KKUtDWfQ → vYIpFRCU_Mt0wtG8F_3-6}/_buildManifest.js +0 -0
  352. /package/.next/static/{tWwHQzmvc-rv9KKUtDWfQ → vYIpFRCU_Mt0wtG8F_3-6}/_ssgManifest.js +0 -0
@@ -1,2 +1,2 @@
1
- "use strict";exports.id=2710,exports.ids=[2710],exports.modules={32520:(a,b,c)=>{c.d(b,{Bi:()=>i,F5:()=>m,Hg:()=>p,KX:()=>j,Oj:()=>w,SA:()=>o,WS:()=>k,X7:()=>s,gT:()=>n,h6:()=>r,iC:()=>v,oM:()=>t,rV:()=>l,uM:()=>q,xo:()=>u});var d=c(75359);let e="Kewton/commandmate-skills",f=[{host:"raw.githubusercontent.com",pathPrefix:`/${e}/`}],g=[{host:"github.com",pathPrefix:`/${e}/releases/download/`}],h=[...g,{host:"objects.githubusercontent.com"},{host:"release-assets.githubusercontent.com"}],i={catalog:{kind:"catalog",entryHosts:f,redirectHosts:f,accept:"application/json",contentTypes:["application/json","text/plain"],maxBytes:4194304},artifact:{kind:"artifact",entryHosts:g,redirectHosts:h,accept:d.gJ,contentTypes:[d.gJ,"application/octet-stream"],maxBytes:d.a6}},j=5,k=1e4,l=12e4,m=["authorization","cookie","proxy-authorization"],n="CommandMate",o="skill-snapshots",p=448,q=256,r=18e5,s=0x10000000,t=64,u=16,v=/^[0-9a-f]{32}$/,w=6e4},33095:(a,b,c)=>{c.d(b,{Hg:()=>t,M$:()=>v,OV:()=>n,QL:()=>o,Uf:()=>w,VA:()=>r,bh:()=>u,cu:()=>q,kt:()=>z,mo:()=>l,tP:()=>A,yj:()=>p});var d=c(55511),e=c(29021),f=c(33873),g=c.n(f),h=c(46065),i=c(96210),j=c(93356),k=c(55926);let l=524288,m={NEW_FILE:"SKILL_DIFF_NEW_FILE",CONTENT_IDENTICAL:"SKILL_DIFF_CONTENT_IDENTICAL",MANAGED_UPDATE:"SKILL_DIFF_MANAGED_UPDATE",LOCAL_MODIFICATION:"SKILL_DIFF_LOCAL_MODIFICATION",UNMANAGED_SKILL:"SKILL_DIFF_UNMANAGED_SKILL",RECEIPT_ORPHAN:"SKILL_DIFF_RECEIPT_ORPHAN",NOT_A_REGULAR_FILE:"SKILL_DIFF_NOT_A_REGULAR_FILE"},n={DETACHED_HEAD:"SKILL_PREVIEW_DETACHED_HEAD",UNBORN_HEAD:"SKILL_PREVIEW_UNBORN_HEAD",HEAD_UNRESOLVED:"SKILL_PREVIEW_HEAD_UNRESOLVED",WORKING_TREE_DIRTY:"SKILL_PREVIEW_WORKING_TREE_DIRTY",PATH_GIT_IGNORED:"SKILL_PREVIEW_PATH_GIT_IGNORED",DIFF_TRUNCATED:"SKILL_PREVIEW_DIFF_TRUNCATED",BINARY_CONTENT:"SKILL_PREVIEW_BINARY_CONTENT",LINE_ENDING_CRLF:"SKILL_PREVIEW_LINE_ENDING_CRLF",TREE_SCAN_TRUNCATED:"SKILL_PREVIEW_TREE_SCAN_TRUNCATED"};function o(a,b){return`${a}/${b}`}function p(a,b,c){if(!i.X0.test(c)||c.length>i.cj)throw Error("Skill ID is not a valid install root segment");let d=g().resolve(a),e=g().resolve(d,b,c),f=g().relative(d,e);if(f!==g().join(b,c)||f.startsWith("..")||g().isAbsolute(f))throw Error("Skill install root escapes the worktree");return e}function q(a,b){return p(a,i.Co,b)}function r(a){let b=Math.min(a.length,8e3);for(let c=0;c<b;c+=1)if(0===a[c])return!0;return!1}function s(a){let b=Buffer.from(a).toString("utf-8");if(0===b.length)return[];let c=b.split("\n");return""===c[c.length-1]&&c.pop(),c}function t(a){let b=[...a].sort((a,b)=>a.path<b.path?-1:+(a.path>b.path)).map(a=>`${a.path}\0${a.sha256}\0${a.executable?"1":"0"}`).join("\n");return(0,d.createHash)("sha256").update(`skill-tree-v1
2
- ${b}`).digest("hex")}function u(a){let b;try{b=(0,e.lstatSync)(a)}catch{return{present:!1,files:[],irregularPaths:[],truncated:!1}}if(!b.isDirectory())return{present:!0,files:[],irregularPaths:[""],truncated:!1};let c=[],d=[],f=!1,h=0,k=(a,b,l)=>{let m;if(!f){if(l>16){f=!0;return}try{m=(0,e.readdirSync)(a,{withFileTypes:!0})}catch{f=!0;return}for(let n of m.sort((a,b)=>a.name<b.name?-1:1)){let m,o;if(f)return;if((h+=1)>2e3){f=!0;return}let p=b?`${b}/${n.name}`:n.name,q=g().join(a,n.name);if(n.isDirectory()){k(q,p,l+1);continue}if(!n.isFile()){d.push(p);continue}try{m=(0,e.lstatSync)(q)}catch{d.push(p);continue}if(!m.isFile()||m.size>i.em){d.push(p);continue}try{o=(0,e.readFileSync)(q)}catch{d.push(p);continue}c.push({path:p,sha256:(0,j.Q_)(o),size:o.byteLength,executable:(73&m.mode)!=0,bytes:o})}}};return k(a,"",0),{present:!0,files:c,irregularPaths:d,truncated:f}}async function v(a){let[b,c,d]=await Promise.all([(0,h.Bc)(["symbolic-ref","--quiet","--short","HEAD"],a),(0,h.Bc)(["rev-parse","HEAD"],a),(0,h.Bc)(["status","--porcelain"],a)]),e=c&&/^[0-9a-f]{40}$/.test(c)?c:null;return{headState:b&&e?"attached":!b&&e?"detached":b&&!e?"unborn":"unknown",branch:b&&b.length>0?b:null,headCommit:e,dirty:null!==d&&d.length>0}}async function w(a,b){if(0===b.length)return new Set;try{let{stdout:c}=await (0,h.mf)("git",["check-ignore","-z","--",...b],{cwd:a,timeout:3e3});return x(c)}catch(b){let a=b.stdout;return"string"==typeof a?x(a):new Set}}function x(a){return new Set(a.split("\0").filter(a=>a.length>0))}function y(){return{text:null,truncated:!1,additions:0,deletions:0}}function z(a,b,c){if(null===a&&null===b)return y();let d=a?s(a):[],e=b?s(b):[],f=0,g=Math.min(d.length,e.length);for(;f<g&&d[f]===e[f];)f+=1;let h=0;for(;h<g-f&&d[d.length-1-h]===e[e.length-1-h];)h+=1;let i=d.slice(f,d.length-h),j=e.slice(f,e.length-h);if(0===i.length&&0===j.length)return y();let k=Math.max(0,f-3),l=d.slice(k,f),m=d.slice(d.length-h,Math.min(d.length,d.length-h+3)),n=l.length+i.length+m.length,o=l.length+j.length+m.length,p=0===n?0:k+1,q=0===o?0:k+1,r=[`@@ -${p},${n} +${q},${o} @@`],t=!1,u=r[0].length+1,v=(a,b)=>{if(r.length>=401)return!1;let d=`${a}${b}`,e=d.length+1;return!(u+e>65536)&&!(e>c.remainingBytes-u)&&(r.push(d),u+=e,!0)};for(let a of l)if(!v(" ",a)){t=!0;break}if(!t){for(let a of i)if(!v("-",a)){t=!0;break}}if(!t){for(let a of j)if(!v("+",a)){t=!0;break}}if(!t){for(let a of m)if(!v(" ",a)){t=!0;break}}t&&r.push("… diff truncated");let w=r.join("\n");return c.remainingBytes=Math.max(0,c.remainingBytes-w.length),{text:w,truncated:t,additions:j.length,deletions:i.length}}function A(a){let b=o(a.installRootPrefix??i.Co,a.skillId),c=new Map(a.plannedFiles.map(a=>[a.relativePath,a])),d=new Map(a.existing.files.map(a=>[a.path,a])),e=[...new Set([...c.keys(),...d.keys(),...a.receiptFiles?[...a.receiptFiles.keys()]:[]])].filter(a=>!(0,k.hm)(`${b}/${a}`)).sort(),f={remainingBytes:l},g=[],h={added:0,modified:0,unchanged:0,conflicted:0,unmanaged:0,binaryFiles:0,truncatedFiles:0,diffBytes:0},j=!1;for(let i of e){let e=c.get(i)??null,k=d.get(i)??null,l=a.receiptFiles?.get(i)??null,{change:n,reason:o}=k?l?k.sha256!==l.sha256||k.executable!==l.executable?{change:"conflict",reason:m.LOCAL_MODIFICATION}:e?e.sha256===k.sha256&&e.executable===k.executable?{change:"unchanged",reason:m.CONTENT_IDENTICAL}:{change:"modify",reason:m.MANAGED_UPDATE}:{change:"unmanaged",reason:m.RECEIPT_ORPHAN}:{change:"unmanaged",reason:m.UNMANAGED_SKILL}:e?{change:"add",reason:m.NEW_FILE}:{change:"unchanged",reason:m.RECEIPT_ORPHAN},p=`${b}/${i}`,q=e?.bytes??k?.bytes??null,s=!!e&&r(e.bytes)||!!k&&r(k.bytes),t=q?function(a){let b=0,c=0;for(let d=0;d<a.length;d+=1)10===a[d]&&(d>0&&13===a[d-1]?b+=1:c+=1);return b>0&&c>0?"mixed":b>0?"crlf":c>0?"lf":"none"}(q):"none";e&&("crlf"===t||"mixed"===t)&&(j=!0);let u=s||"unchanged"===n?y():z(k?.bytes??null,e?.bytes??null,f);g.push({path:p,change:n,reason:o,generated:e?.generated??!1,sha256:e?.sha256??null,size:e?.size??null,executable:e?.executable??k?.executable??!1,currentSha256:k?.sha256??null,currentSize:k?.size??null,binary:s,lineEnding:t,gitIgnored:a.gitIgnoredPaths.has(p),diff:u.text,diffTruncated:u.truncated,additions:u.additions,deletions:u.deletions}),"add"===n?h.added+=1:"modify"===n?h.modified+=1:"unchanged"===n?h.unchanged+=1:"conflict"===n?h.conflicted+=1:h.unmanaged+=1,s&&(h.binaryFiles+=1),u.truncated&&(h.truncatedFiles+=1),h.diffBytes+=u.text?.length??0}for(let c of a.existing.irregularPaths){let d=c?`${b}/${c}`:b;g.push({path:d,change:"conflict",reason:m.NOT_A_REGULAR_FILE,generated:!1,sha256:null,size:null,executable:!1,currentSha256:null,currentSize:null,binary:!1,lineEnding:"none",gitIgnored:a.gitIgnoredPaths.has(d),diff:null,diffTruncated:!1,additions:0,deletions:0}),h.conflicted+=1}let p=function(a,b,c,d){let e=[];return"detached"===a.git.headState&&e.push(n.DETACHED_HEAD),"unborn"===a.git.headState&&e.push(n.UNBORN_HEAD),"unknown"===a.git.headState&&e.push(n.HEAD_UNRESOLVED),a.git.dirty&&e.push(n.WORKING_TREE_DIRTY),b.some(a=>a.gitIgnored)&&e.push(n.PATH_GIT_IGNORED),c.truncatedFiles>0&&e.push(n.DIFF_TRUNCATED),c.binaryFiles>0&&e.push(n.BINARY_CONTENT),d&&e.push(n.LINE_ENDING_CRLF),a.existing.truncated&&e.push(n.TREE_SCAN_TRUNCATED),e}(a,g,h,j),q=a.plannedFiles.map(a=>({path:a.relativePath,sha256:a.sha256,executable:a.executable}));for(let b of a.existing.files)c.has(b.path)||q.push({path:b.path,sha256:b.sha256,executable:b.executable});return{installRoot:b,entries:g.sort((a,b)=>a.path<b.path?-1:+(a.path>b.path)),stats:h,warnings:p,currentTreeHash:t(a.existing.files),plannedTreeHash:t(q)}}},52710:(a,b,c)=>{c.d(b,{$h:()=>s,ER:()=>n,Jg:()=>y,Pw:()=>r,Q6:()=>C,Rq:()=>q,Y9:()=>A,c$:()=>k,gk:()=>B,nf:()=>p,q$:()=>u,sK:()=>l,tJ:()=>t,vg:()=>m,zi:()=>j});var d=c(55511),e=c(13075),f=c(96210),g=c(89936),h=c(33095),i=c(36925);let j=".commandmate-receipt.json",k=6e5,l=32,m=/^[0-9a-f]{48}$/,n={NOT_FOUND:"SKILL_PLAN_NOT_FOUND",EXPIRED:"SKILL_PLAN_EXPIRED",CONSUMED:"SKILL_PLAN_CONSUMED",STALE:"SKILL_PLAN_STALE",BINDING_MISMATCH:"SKILL_PLAN_BINDING_MISMATCH",NOT_INSTALLABLE:"SKILL_PLAN_NOT_INSTALLABLE",RISK_NOT_ACKNOWLEDGED:"SKILL_PLAN_RISK_NOT_ACKNOWLEDGED",TARGET_UNSAFE:"SKILL_PLAN_TARGET_UNSAFE"},o={[n.NOT_FOUND]:404,[n.EXPIRED]:410,[n.CONSUMED]:409,[n.STALE]:409,[n.BINDING_MISMATCH]:409,[n.NOT_INSTALLABLE]:409,[n.RISK_NOT_ACKNOWLEDGED]:409,[n.TARGET_UNSAFE]:400};class p extends Error{constructor(a,b){super(`Skill install plan rejected: ${a}`),this.code=a,this.detail=b,this.name="SkillPlanError"}get status(){return o[this.code]}}function q(a){return a instanceof p}function r(a){return a.install_roots&&a.install_roots.length>0?[...a.install_roots]:[a.install_root]}function s(a){let{snapshot:b,version:c}=a,d=b.files.map(a=>({path:a.path,sha256:a.sha256,size:a.size,executable:a.executable})),e=c.compatibility.agents.map(a=>({agent:a.agent,support:a.support,evidence:a.evidence})),g=(a.rootPrefixes&&a.rootPrefixes.length>0?[...a.rootPrefixes]:[f.Co]).map(a=>(0,h.QL)(a,b.skillId));return{schema_version:f.jq,skill_id:b.skillId,version:b.version,install_root:g[0],...g.length>1?{install_roots:g}:{},source:{repository:c.source.repository,ref:c.source.ref,commit:c.source.commit},artifact:{asset_name:c.artifact.asset_name,sha256:c.artifact.sha256,size:c.artifact.size,format:c.artifact.format},files:d,declared_risk:b.declaredRisk,computed_risk:b.computedRisk,effective_risk:b.effectiveRisk,declared_permissions:[...b.inspection.declared_permissions],agent_compatibility:e}}function t(a){return Buffer.from((0,e.en)(a),"utf-8")}function u(a){try{let b=JSON.parse(Buffer.from(a).toString("utf-8"));if(!b||"object"!=typeof b||"string"!=typeof b.skill_id||!Array.isArray(b.files))return null;return b}catch{return null}}let v=(0,i.v)("__skillInstallPlans",()=>({records:new Map}));function w(a){v.records.delete(a.token),null===a.consumedAt&&(0,g.TO)(a.binding.snapshotId)}function x(a,b){let c=0;for(let d of[...v.records.values()])d.token!==b&&a>=d.expiresAt&&(w(d),c+=1);return c}function y(a={}){return x(a.now??Date.now())}function z(a,b){if(!m.test(a))throw new p(n.NOT_FOUND);let c=v.records.get(a);if(x(b,a),!c)throw new p(n.NOT_FOUND);let e=Buffer.from(a,"utf-8"),f=Buffer.from(c.token,"utf-8");if(e.length!==f.length||!(0,d.timingSafeEqual)(e,f))throw new p(n.NOT_FOUND);if(b>=c.expiresAt)throw w(c),new p(n.EXPIRED);if(null!==c.consumedAt)throw new p(n.CONSUMED);return c}function A(a,b={}){return z(a,b.now??Date.now())}function B(a,b,c,d={}){let e=d.now??Date.now(),f=z(a,e),{binding:g}=f;if(g.actor.type!==b.actor.type||g.actor.id!==b.actor.id||g.worktreeId!==b.worktreeId||g.skillId!==b.skillId||g.version!==b.version)throw new p(n.BINDING_MISMATCH);if(!f.dto.installable)throw new p(n.NOT_INSTALLABLE);if(f.dto.requiresRiskAcknowledgement&&!b.riskAcknowledged)throw new p(n.RISK_NOT_ACKNOWLEDGED);let{binding:h}=f;if(c.branch!==h.branch||c.headCommit!==h.headCommit||c.currentTreeHash!==h.currentTreeHash)throw new p(n.STALE);return f.consumedAt=e,f}async function C(a){let b,c=a.now??Date.now(),{snapshot:e}=a,g=a.targets&&a.targets.length>0?[...a.targets]:[f.Co];try{b=g.map(b=>({prefix:b,abs:(0,h.yj)(a.worktree.path,b,e.skillId),rel:(0,h.QL)(b,e.skillId)}))}catch{throw new p(n.TARGET_UNSAFE)}let i=s({snapshot:e,version:a.version,rootPrefixes:g}),m=t(i),o=(0,d.createHash)("sha256").update(m).digest("hex"),q=[...e.files.map(a=>({relativePath:a.path,sha256:a.sha256,size:a.size,executable:a.executable,bytes:e.readFile(a.path),generated:!1})),{relativePath:j,sha256:o,size:m.byteLength,executable:!1,bytes:m,generated:!0}],r=await (0,h.M$)(a.worktree.path),y=await (0,h.Uf)(a.worktree.path,b.flatMap(a=>q.map(b=>`${a.rel}/${b.relativePath}`))),z=b.map(b=>{let c=(0,h.bh)(b.abs),d=function(a){let b=a.files.find(a=>a.path===j);if(!b)return null;let c=u(b.bytes);return c?{receipt:c,digest:b.sha256}:null}(c),f=d?new Map([...d.receipt.files.map(a=>[a.path,{sha256:a.sha256,executable:a.executable}]),[j,{sha256:d.digest,executable:!1}]]):null,g=(0,h.tP)({skillId:e.skillId,worktreePath:a.worktree.path,installRootPrefix:b.prefix,plannedFiles:q,existing:c,receiptFiles:f,git:r,gitIgnoredPaths:y});return{root:b,installedReceipt:d,preview:g}}),A=z[0],B=A.root.rel,C=A.installedReceipt,D=b.map(a=>a.rel),E=z.flatMap(a=>[...a.preview.entries]).sort((a,b)=>a.path<b.path?-1:+(a.path>b.path)),F=z.reduce((a,b)=>({added:a.added+b.preview.stats.added,modified:a.modified+b.preview.stats.modified,unchanged:a.unchanged+b.preview.stats.unchanged,conflicted:a.conflicted+b.preview.stats.conflicted,unmanaged:a.unmanaged+b.preview.stats.unmanaged,binaryFiles:a.binaryFiles+b.preview.stats.binaryFiles,truncatedFiles:a.truncatedFiles+b.preview.stats.truncatedFiles,diffBytes:a.diffBytes+b.preview.stats.diffBytes}),{added:0,modified:0,unchanged:0,conflicted:0,unmanaged:0,binaryFiles:0,truncatedFiles:0,diffBytes:0}),G=[...new Set(z.flatMap(a=>[...a.preview.warnings]))],H=E.filter(a=>"conflict"===a.change||"unmanaged"===a.change).map(a=>({code:a.reason,path:a.path}));"compatible"!==a.compatibility.status&&H.push({code:a.compatibility.messageKey,path:null});let I="high"===e.effectiveRisk,J=!0===a.riskAcknowledged,K=(0,d.randomBytes)(24).toString("hex"),L=c+k,M={actor:a.actor,operation:"install",worktreeId:a.worktree.id,skillId:e.skillId,version:e.version,artifactSha256:a.version.artifact.sha256,snapshotId:a.snapshotId,branch:r.branch,headCommit:r.headCommit,currentTreeHash:A.preview.currentTreeHash,plannedTreeHash:A.preview.plannedTreeHash,receiptDigest:o,riskAcknowledged:J},N={token:K,expiresAt:new Date(L).toISOString().replace(/\.\d{3}Z$/,"Z"),installable:0===H.length,requiresRiskAcknowledgement:I,riskAcknowledged:J,riskAcknowledgementMessageKey:I?"skills.plan.highRiskAcknowledgement":null,blockers:H,warnings:G,target:{worktreeId:a.worktree.id,worktreeName:a.worktree.name,repositoryName:a.worktree.repositoryName,syncedBranch:a.worktree.syncedBranch,branch:r.branch,headState:r.headState,headCommit:r.headCommit,workingTreeDirty:r.dirty,installRoot:A.preview.installRoot,installRoots:D,currentTreeHash:A.preview.currentTreeHash,plannedTreeHash:A.preview.plannedTreeHash,existingInstall:C?{version:C.receipt.version,receiptDigest:C.digest}:null},skill:function(a){let{manifest:b}=a.snapshot;return{id:a.snapshot.skillId,name:b.name,version:a.snapshot.version,summary:b.summary,description:b.description,capabilities:[...b.capabilities],expectedOutcomes:[...b.expected_outcomes],provider:{...b.provider},license:b.license,homepage:b.homepage??null,declaredPermissions:[...a.snapshot.inspection.declared_permissions],requirements:{commands:b.requirements.commands.map(a=>({name:a.name,versionRange:a.version_range??null})),networkHosts:[...b.requirements.network_hosts]},declaredRisk:a.snapshot.declaredRisk,computedRisk:a.snapshot.computedRisk,effectiveRisk:a.snapshot.effectiveRisk,riskRationale:b.risk_rationale,executablePaths:[...a.snapshot.inspection.executable_paths],scriptPaths:[...a.snapshot.inspection.script_paths],compatibility:{commandmate:a.compatibility,agents:a.version.compatibility.agents.map(a=>({...a}))},source:{repository:a.version.source.repository,ref:a.version.source.ref,commit:a.version.source.commit},artifact:{assetName:a.version.artifact.asset_name,sha256:a.version.artifact.sha256,size:a.version.artifact.size,format:a.version.artifact.format}}}(a),receipt:{path:`${B}/${j}`,sha256:o,size:m.byteLength},files:E,stats:F},O={token:K,binding:M,bindingHash:(0,d.createHash)("sha256").update(function a(b){if(null===b||"object"!=typeof b)return JSON.stringify(b)??"null";if(Array.isArray(b))return`[${b.map(a).join(",")}]`;let c=Object.entries(b).filter(([,a])=>void 0!==a).sort(([a],[b])=>a<b?-1:+(a>b));return`{${c.map(([b,c])=>`${JSON.stringify(b)}:${a(c)}`).join(",")}}`}(M)).digest("hex"),createdAt:c,expiresAt:L,consumedAt:null,worktreePath:a.worktree.path,rootPrefixes:g,receipt:i,receiptBytes:m,dto:N};for(x(c);v.records.size>=l;){let a=[...v.records.values()].sort((a,b)=>a.createdAt-b.createdAt)[0];if(!a)break;w(a)}return v.records.set(K,O),O}},55926:(a,b,c)=>{c.d(b,{Pq:()=>l,QQ:()=>k,V8:()=>j,dI:()=>s,f$:()=>q,hm:()=>p,m_:()=>m,of:()=>r,vg:()=>i,wr:()=>n});var d=c(29021),e=c(33873),f=c(55511),g=c(96210),h=c(48870);let i="locks",j="journal",k=448,l=384;function m(a,b={}){let c=(0,e.join)(function(a={}){return a.root??(0,e.join)((0,h.GQ)(),"skills")}(b),a);return(0,d.mkdirSync)(c,{recursive:!0,mode:k}),(0,d.chmodSync)(c,k),c}function n(a,b=g.Co){return(0,e.join)(a,b,g.B3)}let o=g.y2.map(a=>`${a}/${g.B3}`);function p(a){let b=a.replace(/\\/g,"/").replace(/^\.\//,"").replace(/^\/+/,"");return o.some(a=>b===a||b.startsWith(`${a}/`))}function q(a){let b=a;return(b=(b=(b=(b=(b=(b=(b=(b=b.replace(/https?:\/\/\S+/gi,a=>{try{let b=new URL(a);return`${b.protocol}//${b.host}${b.pathname}`}catch{return"[url]"}})).replace(/\b(?:Bearer|Basic)\s+[A-Za-z0-9._~+/=-]+/gi,"[redacted]")).replace(/\bgh[pousr]_[A-Za-z0-9]{16,}\b/g,"[redacted]")).replace(/\bgithub_pat_[A-Za-z0-9_]{16,}\b/g,"[redacted]")).replace(/\bxox[baprs]-[A-Za-z0-9-]{10,}\b/g,"[redacted]")).replace(/\b(token|secret|password|api[_-]?key|authorization)\s*[=:]\s*\S+/gi,"$1=[redacted]")).replace(/(^|[\s"'(\[<])(\/[A-Za-z0-9._@+-]+){2,}\/?/g,"$1[path]")).replace(/(^|[\s"'(\[<])[A-Za-z]:\\[^\s"'\])>]*/g,"$1[path]")).length>500?`${b.slice(0,500)}…`:b}function r(a,b){let c=`${a}.tmp-${(0,f.randomBytes)(8).toString("hex")}`;(0,d.writeFileSync)(c,JSON.stringify(b),{mode:l}),(0,d.chmodSync)(c,l);try{(0,d.renameSync)(c,a)}catch(a){try{(0,d.unlinkSync)(c)}catch{}throw a}}function s(a){try{return JSON.parse((0,d.readFileSync)(a,"utf-8"))}catch{return null}}},75359:(a,b,c)=>{c.d(b,{Z4:()=>d.Z4,wD:()=>d.wD,x2:()=>d.x2,gJ:()=>d.gJ,jn:()=>d.jn,a6:()=>d.a6,xP:()=>d.xP,em:()=>d.em,KH:()=>d.KH,Wr:()=>d.Wr,WL:()=>d.WL,l9:()=>d.l9,MD:()=>f.MD,vy:()=>f.vy,BO:()=>e.BO,qZ:()=>f.qZ,Yz:()=>f.Yz,EU:()=>f.EU,bX:()=>f.bX,r5:()=>f.r5});var d=c(96210);c(55432);var e=c(36931),f=c(13075),g=c(15194);d.jq,d.q3,[...g.XH],[...d.h3],d.G0,d.AH.source,d.mg.source,d.Z4.source,d.x2.source,d.mt.length,[...d.mt],[...d.wI],d.S$,d.jq,d.X0.source,d.cj,d.q3,e.l2.source,d.BQ,d.t9,d.yV,d.$K,d.yV,d.$K,d.DA.source,d.Ue,d.UN,d.SU,d._Z,d.PB.source,d.gI,d.xP,d.em,[...d.Hx],d.jq,d.Gm,d.X0.source,d.cj,d.q3,d.BQ,d.DA.source,d.Ue,d.UN,e.l2.source,d.Xk,e.l2.source,d.b,d.qu.source,d.a6,d.gJ,d.jn,d.jq,d.X0.source,d.cj,e.l2.source,d.y2.length,d.a6,d.jn,d.xP,d.em},89936:(a,b,c)=>{c.d(b,{Jk:()=>z,LH:()=>y,Oi:()=>x,TO:()=>w,lw:()=>n,nW:()=>p,yn:()=>v});var d=c(55511),e=c(29021),f=c(33873),g=c.n(f),h=c(48870),i=c(32520),j=c(7956),k=c(75359),l=c(93356);let m=(0,c(36925).v)("__skillSnapshotStore",()=>({rootDir:null,records:new Map,totalBytes:0}));function n(a={}){let b=g().resolve(a.rootDir??g().join((0,h.WI)(),"data",i.SA));if((0,j.fW)(b))throw new l.q2(l.Fk.STORE_IO,{reason:"system-directory"});if(m.rootDir===b)return b;try{(0,e.mkdirSync)(b,{recursive:!0,mode:i.Hg}),(0,e.chmodSync)(b,i.Hg)}catch{throw new l.q2(l.Fk.STORE_IO,{reason:"mkdir"})}return m.rootDir=b,m.records.clear(),m.totalBytes=0,q(),b}function o(){if(!m.rootDir)throw new l.q2(l.Fk.STORE_UNINITIALIZED);return m.rootDir}function p(){return null!==m.rootDir}function q(){let a,b=o(),c=new Set([...m.records.values()].map(a=>a.filename));try{a=(0,e.readdirSync)(b)}catch{throw new l.q2(l.Fk.STORE_IO,{reason:"readdir"})}for(let d of a)c.has(d)||(0,e.rmSync)(g().join(b,d),{force:!0,recursive:!0})}function r(a){return g().join(o(),a.filename)}function s(a){(0,e.rmSync)(r(a),{force:!0}),m.records.delete(a.snapshotId),m.totalBytes-=a.size}function t(a){if(o(),!i.iC.test(a))throw new l.q2(l.Fk.SNAPSHOT_NOT_FOUND);let b=m.records.get(a);if(!b)throw new l.q2(l.Fk.SNAPSHOT_NOT_FOUND);if(0===b.refCount&&Date.now()>=b.expiresAt)throw s(b),new l.q2(l.Fk.SNAPSHOT_EXPIRED);return b}function u(a){return{snapshotId:a.snapshotId,skillId:a.skillId,version:a.version,commit:a.commit,sha256:a.sha256,size:a.size,expiresAt:a.expiresAt}}function v(a){let b=o(),c=Date.now(),f=a.bytes.byteLength;if(f<=0||f>k.a6)throw new l.q2(l.Fk.SIZE_LIMIT_EXCEEDED,{limit:k.a6});if(!(0,l.U2)(a.sha256,(0,l.Q_)(a.bytes)))throw new l.q2(l.Fk.CHECKSUM_MISMATCH);for(let b of m.records.values())if(b.sha256===a.sha256&&(0,e.existsSync)(r(b)))return b.refCount+=1,b.lastAccessedAt=c,b.expiresAt=c+i.h6,u(b);!function(a,b){let c=()=>m.totalBytes+a<=i.X7&&m.records.size<i.oM;if(!c()){for(let a of[...m.records.values()].filter(a=>0===a.refCount).sort((a,c)=>{let d=b>=a.expiresAt?0:1,e=b>=c.expiresAt?0:1;return d!==e?d-e:a.lastAccessedAt-c.lastAccessedAt})){if(c())return;s(a)}if(!c())throw new l.q2(l.Fk.QUOTA_EXCEEDED,{requested:a,limit:i.X7})}}(f,c);let h=(0,d.randomBytes)(i.xo).toString("hex"),j=`${h}.artifact`,n=g().join(b,j),p=`${n}.tmp`;try{(0,e.writeFileSync)(p,a.bytes,{mode:384}),(0,e.chmodSync)(p,i.uM),(0,e.renameSync)(p,n)}catch{throw(0,e.rmSync)(p,{force:!0}),new l.q2(l.Fk.STORE_IO,{reason:"write"})}let q={snapshotId:h,skillId:a.skillId,version:a.version,commit:a.commit,sha256:a.sha256,size:f,expiresAt:c+i.h6,refCount:1,lastAccessedAt:c,filename:j};return m.records.set(h,q),m.totalBytes+=f,u(q)}function w(a){let b=m.records.get(a);b&&(b.refCount>0&&(b.refCount-=1),0===b.refCount&&(b.lastAccessedAt=Date.now()))}function x(a){return u(t(a))}function y(a){let b=t(a);try{let a=(0,e.readFileSync)(r(b));return b.lastAccessedAt=Date.now(),a}catch{throw new l.q2(l.Fk.STORE_IO,{reason:"read"})}}function z(a={}){o();let b=a.now??Date.now(),c=0;for(let a of[...m.records.values()])0===a.refCount&&b>=a.expiresAt&&(s(a),c+=1);return q(),c}},93356:(a,b,c)=>{c.d(b,{Fk:()=>f,Ld:()=>o,Q_:()=>l,U2:()=>m,eG:()=>j,i1:()=>n,of:()=>k,q2:()=>i});var d=c(55511),e=c(75359);let f={URL_INVALID:"SKILL_FETCH_URL_INVALID",SOURCE_NOT_ALLOWED:"SKILL_FETCH_SOURCE_NOT_ALLOWED",REDIRECT_INVALID:"SKILL_FETCH_REDIRECT_INVALID",REDIRECT_LIMIT_EXCEEDED:"SKILL_FETCH_REDIRECT_LIMIT_EXCEEDED",HTTP_STATUS:"SKILL_FETCH_HTTP_STATUS",CONTENT_TYPE_INVALID:"SKILL_FETCH_CONTENT_TYPE_INVALID",BODY_MISSING:"SKILL_FETCH_BODY_MISSING",SIZE_LIMIT_EXCEEDED:"SKILL_FETCH_SIZE_LIMIT_EXCEEDED",SIZE_MISMATCH:"SKILL_FETCH_SIZE_MISMATCH",CHECKSUM_MISMATCH:"SKILL_FETCH_CHECKSUM_MISMATCH",BINDING_INVALID:"SKILL_FETCH_BINDING_INVALID",TIMEOUT:"SKILL_FETCH_TIMEOUT",ABORTED:"SKILL_FETCH_ABORTED",NETWORK:"SKILL_FETCH_NETWORK",SNAPSHOT_NOT_FOUND:"SKILL_SNAPSHOT_NOT_FOUND",SNAPSHOT_EXPIRED:"SKILL_SNAPSHOT_EXPIRED",QUOTA_EXCEEDED:"SKILL_SNAPSHOT_QUOTA_EXCEEDED",STORE_IO:"SKILL_SNAPSHOT_STORE_IO",STORE_UNINITIALIZED:"SKILL_SNAPSHOT_STORE_UNINITIALIZED"},g=new Set([f.TIMEOUT,f.NETWORK,f.HTTP_STATUS,f.STORE_IO]),h={[f.URL_INVALID]:"Skill source URL is not a usable HTTPS URL",[f.SOURCE_NOT_ALLOWED]:"Skill source is not on the official allowlist",[f.REDIRECT_INVALID]:"Skill source redirect was malformed",[f.REDIRECT_LIMIT_EXCEEDED]:"Skill source exceeded the redirect limit",[f.HTTP_STATUS]:"Skill source responded with an error status",[f.CONTENT_TYPE_INVALID]:"Skill source returned an unexpected media type",[f.BODY_MISSING]:"Skill source response had no body",[f.SIZE_LIMIT_EXCEEDED]:"Skill source response exceeded the size limit",[f.SIZE_MISMATCH]:"Skill artifact size did not match the catalog",[f.CHECKSUM_MISMATCH]:"Skill artifact checksum did not match the catalog",[f.BINDING_INVALID]:"Skill catalog version is not bound to an immutable source",[f.TIMEOUT]:"Skill source request timed out",[f.ABORTED]:"Skill source request was aborted",[f.NETWORK]:"Skill source could not be reached",[f.SNAPSHOT_NOT_FOUND]:"Skill snapshot is unknown or already released",[f.SNAPSHOT_EXPIRED]:"Skill snapshot has expired",[f.QUOTA_EXCEEDED]:"Skill snapshot store quota exceeded",[f.STORE_IO]:"Skill snapshot store could not be accessed",[f.STORE_UNINITIALIZED]:"Skill snapshot store is not initialized"};class i extends Error{constructor(a,b){super(h[a]),this.name="SkillFetchError",this.code=a,this.retryable=g.has(a),b&&(this.detail=b)}}function j(a){return a instanceof i}function k(){let a=(0,d.createHash)("sha256");return{update(b){a.update(b)},hex:()=>a.digest("hex")}}function l(a){return(0,d.createHash)("sha256").update(a).digest("hex")}function m(a,b){return!!e.x2.test(a)&&!!e.x2.test(b)&&(0,d.timingSafeEqual)(Buffer.from(a,"hex"),Buffer.from(b,"hex"))}function n(a,b){let c=a=>{throw new i(f.BINDING_INVALID,{field:a})};(0,e.BO)(b.version)||c("version"),e.Z4.test(b.source.commit)||c("source.commit"),b.artifact.asset_name!==(0,e.l9)(a,b.version)&&c("artifact.asset_name"),b.artifact.format!==e.jn&&c("artifact.format"),b.artifact.content_type!==e.gJ&&c("artifact.content_type"),e.x2.test(b.artifact.sha256)||c("artifact.sha256"),(!Number.isSafeInteger(b.artifact.size)||b.artifact.size<=0||b.artifact.size>e.a6)&&c("artifact.size")}function o(a){if(a.actualSize!==a.expectedSize)throw new i(f.SIZE_MISMATCH,{expected:a.expectedSize,actual:a.actualSize});if(!m(a.expectedSha256,a.actualSha256))throw new i(f.CHECKSUM_MISMATCH)}}};
1
+ "use strict";exports.id=2710,exports.ids=[2710],exports.modules={32520:(a,b,c)=>{c.d(b,{Bi:()=>i,F5:()=>m,Hg:()=>p,KX:()=>j,Oj:()=>w,SA:()=>o,WS:()=>k,X7:()=>s,gT:()=>n,h6:()=>r,iC:()=>v,oM:()=>t,rV:()=>l,uM:()=>q,xo:()=>u});var d=c(75359);let e="Kewton/commandmate-skills",f=[{host:"raw.githubusercontent.com",pathPrefix:`/${e}/`}],g=[{host:"github.com",pathPrefix:`/${e}/releases/download/`}],h=[...g,{host:"objects.githubusercontent.com"},{host:"release-assets.githubusercontent.com"}],i={catalog:{kind:"catalog",entryHosts:f,redirectHosts:f,accept:"application/json",contentTypes:["application/json","text/plain"],maxBytes:4194304},artifact:{kind:"artifact",entryHosts:g,redirectHosts:h,accept:d.gJ,contentTypes:[d.gJ,"application/octet-stream"],maxBytes:d.a6}},j=5,k=1e4,l=12e4,m=["authorization","cookie","proxy-authorization"],n="CommandMate",o="skill-snapshots",p=448,q=256,r=18e5,s=0x10000000,t=64,u=16,v=/^[0-9a-f]{32}$/,w=6e4},33095:(a,b,c)=>{c.d(b,{Hg:()=>t,M$:()=>v,OV:()=>n,QL:()=>o,Uf:()=>w,VA:()=>r,bh:()=>u,cu:()=>q,e:()=>B,kt:()=>z,mo:()=>l,tP:()=>A,yj:()=>p});var d=c(55511),e=c(29021),f=c(33873),g=c.n(f),h=c(46065),i=c(96210),j=c(93356),k=c(55926);let l=524288,m={NEW_FILE:"SKILL_DIFF_NEW_FILE",CONTENT_IDENTICAL:"SKILL_DIFF_CONTENT_IDENTICAL",MANAGED_UPDATE:"SKILL_DIFF_MANAGED_UPDATE",LOCAL_MODIFICATION:"SKILL_DIFF_LOCAL_MODIFICATION",UNMANAGED_SKILL:"SKILL_DIFF_UNMANAGED_SKILL",RECEIPT_ORPHAN:"SKILL_DIFF_RECEIPT_ORPHAN",NOT_A_REGULAR_FILE:"SKILL_DIFF_NOT_A_REGULAR_FILE"},n={DETACHED_HEAD:"SKILL_PREVIEW_DETACHED_HEAD",UNBORN_HEAD:"SKILL_PREVIEW_UNBORN_HEAD",HEAD_UNRESOLVED:"SKILL_PREVIEW_HEAD_UNRESOLVED",WORKING_TREE_DIRTY:"SKILL_PREVIEW_WORKING_TREE_DIRTY",WORKING_TREE_STATUS_UNKNOWN:"SKILL_PREVIEW_WORKING_TREE_STATUS_UNKNOWN",PATH_GIT_IGNORED:"SKILL_PREVIEW_PATH_GIT_IGNORED",DIFF_TRUNCATED:"SKILL_PREVIEW_DIFF_TRUNCATED",BINARY_CONTENT:"SKILL_PREVIEW_BINARY_CONTENT",LINE_ENDING_CRLF:"SKILL_PREVIEW_LINE_ENDING_CRLF",TREE_SCAN_TRUNCATED:"SKILL_PREVIEW_TREE_SCAN_TRUNCATED"};function o(a,b){return`${a}/${b}`}function p(a,b,c){if(!i.X0.test(c)||c.length>i.cj)throw Error("Skill ID is not a valid install root segment");let d=g().resolve(a),e=g().resolve(d,b,c),f=g().relative(d,e);if(f!==g().join(b,c)||f.startsWith("..")||g().isAbsolute(f))throw Error("Skill install root escapes the worktree");return e}function q(a,b){return p(a,i.Co,b)}function r(a){let b=Math.min(a.length,8e3);for(let c=0;c<b;c+=1)if(0===a[c])return!0;return!1}function s(a){let b=Buffer.from(a).toString("utf-8");if(0===b.length)return[];let c=b.split("\n");return""===c[c.length-1]&&c.pop(),c}function t(a){let b=[...a].sort((a,b)=>a.path<b.path?-1:+(a.path>b.path)).map(a=>`${a.path}\0${a.sha256}\0${a.executable?"1":"0"}`).join("\n");return(0,d.createHash)("sha256").update(`skill-tree-v1
2
+ ${b}`).digest("hex")}function u(a){let b;try{b=(0,e.lstatSync)(a)}catch{return{present:!1,files:[],irregularPaths:[],truncated:!1}}if(!b.isDirectory())return{present:!0,files:[],irregularPaths:[""],truncated:!1};let c=[],d=[],f=!1,h=0,k=(a,b,l)=>{let m;if(!f){if(l>16){f=!0;return}try{m=(0,e.readdirSync)(a,{withFileTypes:!0})}catch{f=!0;return}for(let n of m.sort((a,b)=>a.name<b.name?-1:1)){let m,o;if(f)return;if((h+=1)>2e3){f=!0;return}let p=b?`${b}/${n.name}`:n.name,q=g().join(a,n.name);if(n.isDirectory()){k(q,p,l+1);continue}if(!n.isFile()){d.push(p);continue}try{m=(0,e.lstatSync)(q)}catch{d.push(p);continue}if(!m.isFile()||m.size>i.em){d.push(p);continue}try{o=(0,e.readFileSync)(q)}catch{d.push(p);continue}c.push({path:p,sha256:(0,j.Q_)(o),size:o.byteLength,executable:(73&m.mode)!=0,bytes:o})}}};return k(a,"",0),{present:!0,files:c,irregularPaths:d,truncated:f}}async function v(a){let[b,c,d]=await Promise.all([(0,h.Bc)(["symbolic-ref","--quiet","--short","HEAD"],a),(0,h.Bc)(["rev-parse","HEAD"],a),(0,h.Bc)(["status","--porcelain"],a)]),e=c&&/^[0-9a-f]{40}$/.test(c)?c:null;return{headState:b&&e?"attached":!b&&e?"detached":b&&!e?"unborn":"unknown",branch:b&&b.length>0?b:null,headCommit:e,dirty:null===d||d.length>0,...null===d?{dirtyUnknown:!0}:{}}}async function w(a,b){if(0===b.length)return new Set;try{let{stdout:c}=await (0,h.mf)("git",["check-ignore","-z","--",...b],{cwd:a,timeout:3e3});return x(c)}catch(b){let a=b.stdout;return"string"==typeof a?x(a):new Set}}function x(a){return new Set(a.split("\0").filter(a=>a.length>0))}function y(){return{text:null,truncated:!1,additions:0,deletions:0}}function z(a,b,c){if(null===a&&null===b)return y();let d=a?s(a):[],e=b?s(b):[],f=0,g=Math.min(d.length,e.length);for(;f<g&&d[f]===e[f];)f+=1;let h=0;for(;h<g-f&&d[d.length-1-h]===e[e.length-1-h];)h+=1;let i=d.slice(f,d.length-h),j=e.slice(f,e.length-h);if(0===i.length&&0===j.length)return y();let k=Math.max(0,f-3),l=d.slice(k,f),m=d.slice(d.length-h,Math.min(d.length,d.length-h+3)),n=l.length+i.length+m.length,o=l.length+j.length+m.length,p=0===n?0:k+1,q=0===o?0:k+1,r=[`@@ -${p},${n} +${q},${o} @@`],t=!1,u=r[0].length+1,v=(a,b)=>{if(r.length>=401)return!1;let d=`${a}${b}`,e=d.length+1;return!(u+e>65536)&&!(e>c.remainingBytes-u)&&(r.push(d),u+=e,!0)};for(let a of l)if(!v(" ",a)){t=!0;break}if(!t){for(let a of i)if(!v("-",a)){t=!0;break}}if(!t){for(let a of j)if(!v("+",a)){t=!0;break}}if(!t){for(let a of m)if(!v(" ",a)){t=!0;break}}t&&r.push("… diff truncated");let w=r.join("\n");return c.remainingBytes=Math.max(0,c.remainingBytes-w.length),{text:w,truncated:t,additions:j.length,deletions:i.length}}function A(a){let b=o(a.installRootPrefix??i.Co,a.skillId),c=new Map(a.plannedFiles.map(a=>[a.relativePath,a])),d=new Map(a.existing.files.map(a=>[a.path,a])),e=[...new Set([...c.keys(),...d.keys(),...a.receiptFiles?[...a.receiptFiles.keys()]:[]])].filter(a=>!(0,k.hm)(`${b}/${a}`)).sort(),f={remainingBytes:l},g=[],h={added:0,modified:0,unchanged:0,conflicted:0,unmanaged:0,binaryFiles:0,truncatedFiles:0,diffBytes:0},j=!1;for(let i of e){let e=c.get(i)??null,k=d.get(i)??null,l=a.receiptFiles?.get(i)??null,{change:n,reason:o}=k?l?k.sha256!==l.sha256||k.executable!==l.executable?{change:"conflict",reason:m.LOCAL_MODIFICATION}:e?e.sha256===k.sha256&&e.executable===k.executable?{change:"unchanged",reason:m.CONTENT_IDENTICAL}:{change:"modify",reason:m.MANAGED_UPDATE}:{change:"unmanaged",reason:m.RECEIPT_ORPHAN}:{change:"unmanaged",reason:m.UNMANAGED_SKILL}:e?{change:"add",reason:m.NEW_FILE}:{change:"unchanged",reason:m.RECEIPT_ORPHAN},p=`${b}/${i}`,q=e?.bytes??k?.bytes??null,s=!!e&&r(e.bytes)||!!k&&r(k.bytes),t=q?function(a){let b=0,c=0;for(let d=0;d<a.length;d+=1)10===a[d]&&(d>0&&13===a[d-1]?b+=1:c+=1);return b>0&&c>0?"mixed":b>0?"crlf":c>0?"lf":"none"}(q):"none";e&&("crlf"===t||"mixed"===t)&&(j=!0);let u=s||"unchanged"===n?y():z(k?.bytes??null,e?.bytes??null,f);g.push({path:p,change:n,reason:o,generated:e?.generated??!1,sha256:e?.sha256??null,size:e?.size??null,executable:e?.executable??k?.executable??!1,currentSha256:k?.sha256??null,currentSize:k?.size??null,binary:s,lineEnding:t,gitIgnored:a.gitIgnoredPaths.has(p),diff:u.text,diffTruncated:u.truncated,additions:u.additions,deletions:u.deletions}),"add"===n?h.added+=1:"modify"===n?h.modified+=1:"unchanged"===n?h.unchanged+=1:"conflict"===n?h.conflicted+=1:h.unmanaged+=1,s&&(h.binaryFiles+=1),u.truncated&&(h.truncatedFiles+=1),h.diffBytes+=u.text?.length??0}for(let c of a.existing.irregularPaths){let d=c?`${b}/${c}`:b;g.push({path:d,change:"conflict",reason:m.NOT_A_REGULAR_FILE,generated:!1,sha256:null,size:null,executable:!1,currentSha256:null,currentSize:null,binary:!1,lineEnding:"none",gitIgnored:a.gitIgnoredPaths.has(d),diff:null,diffTruncated:!1,additions:0,deletions:0}),h.conflicted+=1}let p=function(a,b,c,d){let e=[];"detached"===a.git.headState&&e.push(n.DETACHED_HEAD),"unborn"===a.git.headState&&e.push(n.UNBORN_HEAD),"unknown"===a.git.headState&&e.push(n.HEAD_UNRESOLVED);let f=B(a.git);return f&&e.push(f),b.some(a=>a.gitIgnored)&&e.push(n.PATH_GIT_IGNORED),c.truncatedFiles>0&&e.push(n.DIFF_TRUNCATED),c.binaryFiles>0&&e.push(n.BINARY_CONTENT),d&&e.push(n.LINE_ENDING_CRLF),a.existing.truncated&&e.push(n.TREE_SCAN_TRUNCATED),e}(a,g,h,j),q=a.plannedFiles.map(a=>({path:a.relativePath,sha256:a.sha256,executable:a.executable}));for(let b of a.existing.files)c.has(b.path)||q.push({path:b.path,sha256:b.sha256,executable:b.executable});return{installRoot:b,entries:g.sort((a,b)=>a.path<b.path?-1:+(a.path>b.path)),stats:h,warnings:p,currentTreeHash:t(a.existing.files),plannedTreeHash:t(q)}}function B(a){return a.dirtyUnknown?n.WORKING_TREE_STATUS_UNKNOWN:a.dirty?n.WORKING_TREE_DIRTY:null}},52710:(a,b,c)=>{c.d(b,{$h:()=>s,ER:()=>n,Jg:()=>y,Pw:()=>r,Q6:()=>C,Rq:()=>q,Y9:()=>A,c$:()=>k,gk:()=>B,nf:()=>p,q$:()=>u,sK:()=>l,tJ:()=>t,vg:()=>m,zi:()=>j});var d=c(55511),e=c(13075),f=c(96210),g=c(89936),h=c(33095),i=c(36925);let j=".commandmate-receipt.json",k=6e5,l=32,m=/^[0-9a-f]{48}$/,n={NOT_FOUND:"SKILL_PLAN_NOT_FOUND",EXPIRED:"SKILL_PLAN_EXPIRED",CONSUMED:"SKILL_PLAN_CONSUMED",STALE:"SKILL_PLAN_STALE",BINDING_MISMATCH:"SKILL_PLAN_BINDING_MISMATCH",NOT_INSTALLABLE:"SKILL_PLAN_NOT_INSTALLABLE",RISK_NOT_ACKNOWLEDGED:"SKILL_PLAN_RISK_NOT_ACKNOWLEDGED",TARGET_UNSAFE:"SKILL_PLAN_TARGET_UNSAFE"},o={[n.NOT_FOUND]:404,[n.EXPIRED]:410,[n.CONSUMED]:409,[n.STALE]:409,[n.BINDING_MISMATCH]:409,[n.NOT_INSTALLABLE]:409,[n.RISK_NOT_ACKNOWLEDGED]:409,[n.TARGET_UNSAFE]:400};class p extends Error{constructor(a,b){super(`Skill install plan rejected: ${a}`),this.code=a,this.detail=b,this.name="SkillPlanError"}get status(){return o[this.code]}}function q(a){return a instanceof p}function r(a){return a.install_roots&&a.install_roots.length>0?[...a.install_roots]:[a.install_root]}function s(a){let{snapshot:b,version:c}=a,d=b.files.map(a=>({path:a.path,sha256:a.sha256,size:a.size,executable:a.executable})),e=c.compatibility.agents.map(a=>({agent:a.agent,support:a.support,evidence:a.evidence})),g=(a.rootPrefixes&&a.rootPrefixes.length>0?[...a.rootPrefixes]:[f.Co]).map(a=>(0,h.QL)(a,b.skillId));return{schema_version:f.jq,skill_id:b.skillId,version:b.version,install_root:g[0],...g.length>1?{install_roots:g}:{},source:{repository:c.source.repository,ref:c.source.ref,commit:c.source.commit},artifact:{asset_name:c.artifact.asset_name,sha256:c.artifact.sha256,size:c.artifact.size,format:c.artifact.format},files:d,declared_risk:b.declaredRisk,computed_risk:b.computedRisk,effective_risk:b.effectiveRisk,declared_permissions:[...b.inspection.declared_permissions],agent_compatibility:e}}function t(a){return Buffer.from((0,e.en)(a),"utf-8")}function u(a){try{let b=JSON.parse(Buffer.from(a).toString("utf-8"));if(!b||"object"!=typeof b||"string"!=typeof b.skill_id||!Array.isArray(b.files))return null;return b}catch{return null}}let v=(0,i.v)("__skillInstallPlans",()=>({records:new Map}));function w(a){v.records.delete(a.token),null===a.consumedAt&&(0,g.TO)(a.binding.snapshotId)}function x(a,b){let c=0;for(let d of[...v.records.values()])d.token!==b&&a>=d.expiresAt&&(w(d),c+=1);return c}function y(a={}){return x(a.now??Date.now())}function z(a,b){if(!m.test(a))throw new p(n.NOT_FOUND);let c=v.records.get(a);if(x(b,a),!c)throw new p(n.NOT_FOUND);let e=Buffer.from(a,"utf-8"),f=Buffer.from(c.token,"utf-8");if(e.length!==f.length||!(0,d.timingSafeEqual)(e,f))throw new p(n.NOT_FOUND);if(b>=c.expiresAt)throw w(c),new p(n.EXPIRED);if(null!==c.consumedAt)throw new p(n.CONSUMED);return c}function A(a,b={}){return z(a,b.now??Date.now())}function B(a,b,c,d={}){let e=d.now??Date.now(),f=z(a,e),{binding:g}=f;if(g.actor.type!==b.actor.type||g.actor.id!==b.actor.id||g.worktreeId!==b.worktreeId||g.skillId!==b.skillId||g.version!==b.version)throw new p(n.BINDING_MISMATCH);if(!f.dto.installable)throw new p(n.NOT_INSTALLABLE);if(f.dto.requiresRiskAcknowledgement&&!b.riskAcknowledged)throw new p(n.RISK_NOT_ACKNOWLEDGED);let{binding:h}=f;if(c.branch!==h.branch||c.headCommit!==h.headCommit||c.currentTreeHash!==h.currentTreeHash)throw new p(n.STALE);return f.consumedAt=e,f}async function C(a){let b,c=a.now??Date.now(),{snapshot:e}=a,g=a.targets&&a.targets.length>0?[...a.targets]:[f.Co];try{b=g.map(b=>({prefix:b,abs:(0,h.yj)(a.worktree.path,b,e.skillId),rel:(0,h.QL)(b,e.skillId)}))}catch{throw new p(n.TARGET_UNSAFE)}let i=s({snapshot:e,version:a.version,rootPrefixes:g}),m=t(i),o=(0,d.createHash)("sha256").update(m).digest("hex"),q=[...e.files.map(a=>({relativePath:a.path,sha256:a.sha256,size:a.size,executable:a.executable,bytes:e.readFile(a.path),generated:!1})),{relativePath:j,sha256:o,size:m.byteLength,executable:!1,bytes:m,generated:!0}],r=await (0,h.M$)(a.worktree.path),y=await (0,h.Uf)(a.worktree.path,b.flatMap(a=>q.map(b=>`${a.rel}/${b.relativePath}`))),z=b.map(b=>{let c=(0,h.bh)(b.abs),d=function(a){let b=a.files.find(a=>a.path===j);if(!b)return null;let c=u(b.bytes);return c?{receipt:c,digest:b.sha256}:null}(c),f=d?new Map([...d.receipt.files.map(a=>[a.path,{sha256:a.sha256,executable:a.executable}]),[j,{sha256:d.digest,executable:!1}]]):null,g=(0,h.tP)({skillId:e.skillId,worktreePath:a.worktree.path,installRootPrefix:b.prefix,plannedFiles:q,existing:c,receiptFiles:f,git:r,gitIgnoredPaths:y});return{root:b,installedReceipt:d,preview:g}}),A=z[0],B=A.root.rel,C=A.installedReceipt,D=b.map(a=>a.rel),E=z.flatMap(a=>[...a.preview.entries]).sort((a,b)=>a.path<b.path?-1:+(a.path>b.path)),F=z.reduce((a,b)=>({added:a.added+b.preview.stats.added,modified:a.modified+b.preview.stats.modified,unchanged:a.unchanged+b.preview.stats.unchanged,conflicted:a.conflicted+b.preview.stats.conflicted,unmanaged:a.unmanaged+b.preview.stats.unmanaged,binaryFiles:a.binaryFiles+b.preview.stats.binaryFiles,truncatedFiles:a.truncatedFiles+b.preview.stats.truncatedFiles,diffBytes:a.diffBytes+b.preview.stats.diffBytes}),{added:0,modified:0,unchanged:0,conflicted:0,unmanaged:0,binaryFiles:0,truncatedFiles:0,diffBytes:0}),G=[...new Set(z.flatMap(a=>[...a.preview.warnings]))],H=E.filter(a=>"conflict"===a.change||"unmanaged"===a.change).map(a=>({code:a.reason,path:a.path}));"compatible"!==a.compatibility.status&&H.push({code:a.compatibility.messageKey,path:null});let I="high"===e.effectiveRisk,J=!0===a.riskAcknowledged,K=(0,d.randomBytes)(24).toString("hex"),L=c+k,M={actor:a.actor,operation:"install",worktreeId:a.worktree.id,skillId:e.skillId,version:e.version,artifactSha256:a.version.artifact.sha256,snapshotId:a.snapshotId,branch:r.branch,headCommit:r.headCommit,currentTreeHash:A.preview.currentTreeHash,plannedTreeHash:A.preview.plannedTreeHash,receiptDigest:o,riskAcknowledged:J},N={token:K,expiresAt:new Date(L).toISOString().replace(/\.\d{3}Z$/,"Z"),installable:0===H.length,requiresRiskAcknowledgement:I,riskAcknowledged:J,riskAcknowledgementMessageKey:I?"skills.plan.highRiskAcknowledgement":null,blockers:H,warnings:G,target:{worktreeId:a.worktree.id,worktreeName:a.worktree.name,repositoryName:a.worktree.repositoryName,syncedBranch:a.worktree.syncedBranch,branch:r.branch,headState:r.headState,headCommit:r.headCommit,workingTreeDirty:r.dirty,...r.dirtyUnknown?{workingTreeUnknown:!0}:{},installRoot:A.preview.installRoot,installRoots:D,currentTreeHash:A.preview.currentTreeHash,plannedTreeHash:A.preview.plannedTreeHash,existingInstall:C?{version:C.receipt.version,receiptDigest:C.digest}:null},skill:function(a){let{manifest:b}=a.snapshot;return{id:a.snapshot.skillId,name:b.name,version:a.snapshot.version,summary:b.summary,description:b.description,capabilities:[...b.capabilities],expectedOutcomes:[...b.expected_outcomes],provider:{...b.provider},license:b.license,homepage:b.homepage??null,declaredPermissions:[...a.snapshot.inspection.declared_permissions],requirements:{commands:b.requirements.commands.map(a=>({name:a.name,versionRange:a.version_range??null})),networkHosts:[...b.requirements.network_hosts]},declaredRisk:a.snapshot.declaredRisk,computedRisk:a.snapshot.computedRisk,effectiveRisk:a.snapshot.effectiveRisk,riskRationale:b.risk_rationale,executablePaths:[...a.snapshot.inspection.executable_paths],scriptPaths:[...a.snapshot.inspection.script_paths],compatibility:{commandmate:a.compatibility,agents:a.version.compatibility.agents.map(a=>({...a}))},source:{repository:a.version.source.repository,ref:a.version.source.ref,commit:a.version.source.commit},artifact:{assetName:a.version.artifact.asset_name,sha256:a.version.artifact.sha256,size:a.version.artifact.size,format:a.version.artifact.format}}}(a),receipt:{path:`${B}/${j}`,sha256:o,size:m.byteLength},files:E,stats:F},O={token:K,binding:M,bindingHash:(0,d.createHash)("sha256").update(function a(b){if(null===b||"object"!=typeof b)return JSON.stringify(b)??"null";if(Array.isArray(b))return`[${b.map(a).join(",")}]`;let c=Object.entries(b).filter(([,a])=>void 0!==a).sort(([a],[b])=>a<b?-1:+(a>b));return`{${c.map(([b,c])=>`${JSON.stringify(b)}:${a(c)}`).join(",")}}`}(M)).digest("hex"),createdAt:c,expiresAt:L,consumedAt:null,worktreePath:a.worktree.path,rootPrefixes:g,receipt:i,receiptBytes:m,dto:N};for(x(c);v.records.size>=l;){let a=[...v.records.values()].sort((a,b)=>a.createdAt-b.createdAt)[0];if(!a)break;w(a)}return v.records.set(K,O),O}},55926:(a,b,c)=>{c.d(b,{Pq:()=>l,QQ:()=>k,V8:()=>j,dI:()=>s,f$:()=>q,hm:()=>p,m_:()=>m,of:()=>r,vg:()=>i,wr:()=>n});var d=c(29021),e=c(33873),f=c(55511),g=c(96210),h=c(48870);let i="locks",j="journal",k=448,l=384;function m(a,b={}){let c=(0,e.join)(function(a={}){return a.root??(0,e.join)((0,h.GQ)(),"skills")}(b),a);return(0,d.mkdirSync)(c,{recursive:!0,mode:k}),(0,d.chmodSync)(c,k),c}function n(a,b=g.Co){return(0,e.join)(a,b,g.B3)}let o=g.y2.map(a=>`${a}/${g.B3}`);function p(a){let b=a.replace(/\\/g,"/").replace(/^\.\//,"").replace(/^\/+/,"");return o.some(a=>b===a||b.startsWith(`${a}/`))}function q(a){let b=a;return(b=(b=(b=(b=(b=(b=(b=(b=b.replace(/https?:\/\/\S+/gi,a=>{try{let b=new URL(a);return`${b.protocol}//${b.host}${b.pathname}`}catch{return"[url]"}})).replace(/\b(?:Bearer|Basic)\s+[A-Za-z0-9._~+/=-]+/gi,"[redacted]")).replace(/\bgh[pousr]_[A-Za-z0-9]{16,}\b/g,"[redacted]")).replace(/\bgithub_pat_[A-Za-z0-9_]{16,}\b/g,"[redacted]")).replace(/\bxox[baprs]-[A-Za-z0-9-]{10,}\b/g,"[redacted]")).replace(/\b(token|secret|password|api[_-]?key|authorization)\s*[=:]\s*\S+/gi,"$1=[redacted]")).replace(/(^|[\s"'(\[<])(\/[A-Za-z0-9._@+-]+){2,}\/?/g,"$1[path]")).replace(/(^|[\s"'(\[<])[A-Za-z]:\\[^\s"'\])>]*/g,"$1[path]")).length>500?`${b.slice(0,500)}…`:b}function r(a,b){let c=`${a}.tmp-${(0,f.randomBytes)(8).toString("hex")}`;(0,d.writeFileSync)(c,JSON.stringify(b),{mode:l}),(0,d.chmodSync)(c,l);try{(0,d.renameSync)(c,a)}catch(a){try{(0,d.unlinkSync)(c)}catch{}throw a}}function s(a){try{return JSON.parse((0,d.readFileSync)(a,"utf-8"))}catch{return null}}},75359:(a,b,c)=>{c.d(b,{Z4:()=>d.Z4,wD:()=>d.wD,x2:()=>d.x2,gJ:()=>d.gJ,jn:()=>d.jn,a6:()=>d.a6,xP:()=>d.xP,em:()=>d.em,KH:()=>d.KH,Wr:()=>d.Wr,WL:()=>d.WL,l9:()=>d.l9,MD:()=>f.MD,vy:()=>f.vy,BO:()=>e.BO,qZ:()=>f.qZ,Yz:()=>f.Yz,EU:()=>f.EU,bX:()=>f.bX,r5:()=>f.r5});var d=c(96210);c(55432);var e=c(36931),f=c(13075),g=c(15194);d.jq,d.q3,[...g.XH],[...d.h3],d.G0,d.AH.source,d.mg.source,d.Z4.source,d.x2.source,d.mt.length,[...d.mt],[...d.wI],d.S$,d.jq,d.X0.source,d.cj,d.q3,e.l2.source,d.BQ,d.t9,d.yV,d.$K,d.yV,d.$K,d.DA.source,d.Ue,d.UN,d.SU,d._Z,d.PB.source,d.gI,d.xP,d.em,[...d.Hx],d.jq,d.Gm,d.X0.source,d.cj,d.q3,d.BQ,d.DA.source,d.Ue,d.UN,e.l2.source,d.Xk,e.l2.source,d.b,d.qu.source,d.a6,d.gJ,d.jn,d.jq,d.X0.source,d.cj,e.l2.source,d.y2.length,d.a6,d.jn,d.xP,d.em},89936:(a,b,c)=>{c.d(b,{Jk:()=>z,LH:()=>y,Oi:()=>x,TO:()=>w,lw:()=>n,nW:()=>p,yn:()=>v});var d=c(55511),e=c(29021),f=c(33873),g=c.n(f),h=c(48870),i=c(32520),j=c(7956),k=c(75359),l=c(93356);let m=(0,c(36925).v)("__skillSnapshotStore",()=>({rootDir:null,records:new Map,totalBytes:0}));function n(a={}){let b=g().resolve(a.rootDir??g().join((0,h.WI)(),"data",i.SA));if((0,j.fW)(b))throw new l.q2(l.Fk.STORE_IO,{reason:"system-directory"});if(m.rootDir===b)return b;try{(0,e.mkdirSync)(b,{recursive:!0,mode:i.Hg}),(0,e.chmodSync)(b,i.Hg)}catch{throw new l.q2(l.Fk.STORE_IO,{reason:"mkdir"})}return m.rootDir=b,m.records.clear(),m.totalBytes=0,q(),b}function o(){if(!m.rootDir)throw new l.q2(l.Fk.STORE_UNINITIALIZED);return m.rootDir}function p(){return null!==m.rootDir}function q(){let a,b=o(),c=new Set([...m.records.values()].map(a=>a.filename));try{a=(0,e.readdirSync)(b)}catch{throw new l.q2(l.Fk.STORE_IO,{reason:"readdir"})}for(let d of a)c.has(d)||(0,e.rmSync)(g().join(b,d),{force:!0,recursive:!0})}function r(a){return g().join(o(),a.filename)}function s(a){(0,e.rmSync)(r(a),{force:!0}),m.records.delete(a.snapshotId),m.totalBytes-=a.size}function t(a){if(o(),!i.iC.test(a))throw new l.q2(l.Fk.SNAPSHOT_NOT_FOUND);let b=m.records.get(a);if(!b)throw new l.q2(l.Fk.SNAPSHOT_NOT_FOUND);if(0===b.refCount&&Date.now()>=b.expiresAt)throw s(b),new l.q2(l.Fk.SNAPSHOT_EXPIRED);return b}function u(a){return{snapshotId:a.snapshotId,skillId:a.skillId,version:a.version,commit:a.commit,sha256:a.sha256,size:a.size,expiresAt:a.expiresAt}}function v(a){let b=o(),c=Date.now(),f=a.bytes.byteLength;if(f<=0||f>k.a6)throw new l.q2(l.Fk.SIZE_LIMIT_EXCEEDED,{limit:k.a6});if(!(0,l.U2)(a.sha256,(0,l.Q_)(a.bytes)))throw new l.q2(l.Fk.CHECKSUM_MISMATCH);for(let b of m.records.values())if(b.sha256===a.sha256&&(0,e.existsSync)(r(b)))return b.refCount+=1,b.lastAccessedAt=c,b.expiresAt=c+i.h6,u(b);!function(a,b){let c=()=>m.totalBytes+a<=i.X7&&m.records.size<i.oM;if(!c()){for(let a of[...m.records.values()].filter(a=>0===a.refCount).sort((a,c)=>{let d=b>=a.expiresAt?0:1,e=b>=c.expiresAt?0:1;return d!==e?d-e:a.lastAccessedAt-c.lastAccessedAt})){if(c())return;s(a)}if(!c())throw new l.q2(l.Fk.QUOTA_EXCEEDED,{requested:a,limit:i.X7})}}(f,c);let h=(0,d.randomBytes)(i.xo).toString("hex"),j=`${h}.artifact`,n=g().join(b,j),p=`${n}.tmp`;try{(0,e.writeFileSync)(p,a.bytes,{mode:384}),(0,e.chmodSync)(p,i.uM),(0,e.renameSync)(p,n)}catch{throw(0,e.rmSync)(p,{force:!0}),new l.q2(l.Fk.STORE_IO,{reason:"write"})}let q={snapshotId:h,skillId:a.skillId,version:a.version,commit:a.commit,sha256:a.sha256,size:f,expiresAt:c+i.h6,refCount:1,lastAccessedAt:c,filename:j};return m.records.set(h,q),m.totalBytes+=f,u(q)}function w(a){let b=m.records.get(a);b&&(b.refCount>0&&(b.refCount-=1),0===b.refCount&&(b.lastAccessedAt=Date.now()))}function x(a){return u(t(a))}function y(a){let b=t(a);try{let a=(0,e.readFileSync)(r(b));return b.lastAccessedAt=Date.now(),a}catch{throw new l.q2(l.Fk.STORE_IO,{reason:"read"})}}function z(a={}){o();let b=a.now??Date.now(),c=0;for(let a of[...m.records.values()])0===a.refCount&&b>=a.expiresAt&&(s(a),c+=1);return q(),c}},93356:(a,b,c)=>{c.d(b,{Fk:()=>f,Ld:()=>o,Q_:()=>l,U2:()=>m,eG:()=>j,i1:()=>n,of:()=>k,q2:()=>i});var d=c(55511),e=c(75359);let f={URL_INVALID:"SKILL_FETCH_URL_INVALID",SOURCE_NOT_ALLOWED:"SKILL_FETCH_SOURCE_NOT_ALLOWED",REDIRECT_INVALID:"SKILL_FETCH_REDIRECT_INVALID",REDIRECT_LIMIT_EXCEEDED:"SKILL_FETCH_REDIRECT_LIMIT_EXCEEDED",HTTP_STATUS:"SKILL_FETCH_HTTP_STATUS",CONTENT_TYPE_INVALID:"SKILL_FETCH_CONTENT_TYPE_INVALID",BODY_MISSING:"SKILL_FETCH_BODY_MISSING",SIZE_LIMIT_EXCEEDED:"SKILL_FETCH_SIZE_LIMIT_EXCEEDED",SIZE_MISMATCH:"SKILL_FETCH_SIZE_MISMATCH",CHECKSUM_MISMATCH:"SKILL_FETCH_CHECKSUM_MISMATCH",BINDING_INVALID:"SKILL_FETCH_BINDING_INVALID",TIMEOUT:"SKILL_FETCH_TIMEOUT",ABORTED:"SKILL_FETCH_ABORTED",NETWORK:"SKILL_FETCH_NETWORK",SNAPSHOT_NOT_FOUND:"SKILL_SNAPSHOT_NOT_FOUND",SNAPSHOT_EXPIRED:"SKILL_SNAPSHOT_EXPIRED",QUOTA_EXCEEDED:"SKILL_SNAPSHOT_QUOTA_EXCEEDED",STORE_IO:"SKILL_SNAPSHOT_STORE_IO",STORE_UNINITIALIZED:"SKILL_SNAPSHOT_STORE_UNINITIALIZED"},g=new Set([f.TIMEOUT,f.NETWORK,f.HTTP_STATUS,f.STORE_IO]),h={[f.URL_INVALID]:"Skill source URL is not a usable HTTPS URL",[f.SOURCE_NOT_ALLOWED]:"Skill source is not on the official allowlist",[f.REDIRECT_INVALID]:"Skill source redirect was malformed",[f.REDIRECT_LIMIT_EXCEEDED]:"Skill source exceeded the redirect limit",[f.HTTP_STATUS]:"Skill source responded with an error status",[f.CONTENT_TYPE_INVALID]:"Skill source returned an unexpected media type",[f.BODY_MISSING]:"Skill source response had no body",[f.SIZE_LIMIT_EXCEEDED]:"Skill source response exceeded the size limit",[f.SIZE_MISMATCH]:"Skill artifact size did not match the catalog",[f.CHECKSUM_MISMATCH]:"Skill artifact checksum did not match the catalog",[f.BINDING_INVALID]:"Skill catalog version is not bound to an immutable source",[f.TIMEOUT]:"Skill source request timed out",[f.ABORTED]:"Skill source request was aborted",[f.NETWORK]:"Skill source could not be reached",[f.SNAPSHOT_NOT_FOUND]:"Skill snapshot is unknown or already released",[f.SNAPSHOT_EXPIRED]:"Skill snapshot has expired",[f.QUOTA_EXCEEDED]:"Skill snapshot store quota exceeded",[f.STORE_IO]:"Skill snapshot store could not be accessed",[f.STORE_UNINITIALIZED]:"Skill snapshot store is not initialized"};class i extends Error{constructor(a,b){super(h[a]),this.name="SkillFetchError",this.code=a,this.retryable=g.has(a),b&&(this.detail=b)}}function j(a){return a instanceof i}function k(){let a=(0,d.createHash)("sha256");return{update(b){a.update(b)},hex:()=>a.digest("hex")}}function l(a){return(0,d.createHash)("sha256").update(a).digest("hex")}function m(a,b){return!!e.x2.test(a)&&!!e.x2.test(b)&&(0,d.timingSafeEqual)(Buffer.from(a,"hex"),Buffer.from(b,"hex"))}function n(a,b){let c=a=>{throw new i(f.BINDING_INVALID,{field:a})};(0,e.BO)(b.version)||c("version"),e.Z4.test(b.source.commit)||c("source.commit"),b.artifact.asset_name!==(0,e.l9)(a,b.version)&&c("artifact.asset_name"),b.artifact.format!==e.jn&&c("artifact.format"),b.artifact.content_type!==e.gJ&&c("artifact.content_type"),e.x2.test(b.artifact.sha256)||c("artifact.sha256"),(!Number.isSafeInteger(b.artifact.size)||b.artifact.size<=0||b.artifact.size>e.a6)&&c("artifact.size")}function o(a){if(a.actualSize!==a.expectedSize)throw new i(f.SIZE_MISMATCH,{expected:a.expectedSize,actual:a.actualSize});if(!m(a.expectedSha256,a.actualSha256))throw new i(f.CHECKSUM_MISMATCH)}}};
@@ -1 +1 @@
1
- "use strict";exports.id=2908,exports.ids=[850,2839,2908,5220,9130],exports.modules={2669:(a,b,c)=>{c.d(b,{JI:()=>n,M7:()=>d,Sr:()=>h,Zf:()=>f,c7:()=>e,lU:()=>k,mR:()=>j,qO:()=>i,su:()=>m,wQ:()=>l});let d="SESSION_STARTING",e="SESSION_START_FAILED",f="SESSION_START_UNAVAILABLE",g=[d,e];class h extends Error{constructor(a,b,c){super(`${a} did not reach its input prompt within ${Math.round(c/1e3)}s (initialization timeout). The tmux session '${b}' and its process are still running, so this is a slow start, not a failed one — the message was not delivered, but nothing needs repairing. Retry the send in a few seconds, or run \`commandmate capture <worktree-id>\` to see what it is waiting on.`),this.toolName=a,this.sessionName=b,this.timeoutMs=c,this.code=d,this.name="SessionStartTimeoutError"}}function i(a,b){return`${a} exited before reaching its input prompt: the tmux session '${b}' is back at a shell, so this is not a slow start and waiting will not help. The message was not delivered. Run \`commandmate capture <worktree-id>\` to see why it exited (for example a startup dialog answered with exit, or a missing login), fix that, then send again.`}class j extends Error{constructor(a,b,c){super(`${a} reported an error while starting in tmux session '${b}': "${c}". Retrying will not help until that is resolved; run \`commandmate capture <worktree-id>\` to see the session output.`),this.toolName=a,this.sessionName=b,this.detectedPattern=c,this.code=e,this.name="SessionStartFailedError"}}class k extends Error{constructor(a,b=`${a} is not installed. Please install it first.`){super(b),this.toolName=a,this.code=f,this.name="SessionStartUnavailableError"}}function l(a){return o(a)===d}function m(a){let b=o(a);return void 0!==b&&g.includes(b)}function n(a){return o(a)===f}function o(a){if("object"!=typeof a||null===a)return;let b=a.code;return"string"==typeof b?b:void 0}},22354:(a,b,c)=>{c.d(b,{F0:()=>j.F,K9:()=>e.K9,VM:()=>d.VM,_0:()=>f._0,c1:()=>k.c,o:()=>i.o,vm:()=>h.v,y_:()=>g.y_});var d=c(56365);c(66101);var e=c(45567);c(57510),c(38367);var f=c(25071),g=c(50474),h=c(70997),i=c(77904),j=c(76835),k=c(2734)},39687:(a,b,c)=>{c.d(b,{d:()=>t});var d=c(56791),e=c(8360),f=c(15194),g=c(95220),h=c(12462),i=c(43015),j=c(54325),k=c(72626),l=c(34331),m=c(40964),n=c(58707),o=c(2669),p=c(49319);let q=(0,k.h)("session/send-user-message");function r(a){return a instanceof Error?a.message:String(a)}async function s(a,b){let c=`${a}:${b}`,d=Date.now()+5e3;for(;(0,g.getActivePollers)().includes(c);){if(Date.now()>=d)return!1;await new Promise(a=>setTimeout(a,100))}return!0}async function t(a,b){let{worktreeId:c,content:k,cliToolId:t,instanceId:u,absoluteImagePath:v,copilotModel:w}=b,x=b.messageType??"normal",y=u??t,z=e.CLIToolManager.getInstance().getTool(t),A=(0,m.mf)(t,c,u),B=await (0,l.L)(c,A,a);if(null===B||"foreign"===B.verdict)return q.warn("send-refused-foreign-session",{worktreeId:c,cliToolId:t,instanceId:y,sessionName:A,sessionPath:B?.sessionPath??null,reason:B?"foreign":"worktree_not_found"}),{ok:!1,stage:"foreign_session",error:B?`tmux session "${A}" belongs to another CommandMate server`:`Worktree '${c}' not found; cannot confirm tmux session "${A}" is this server's`};let C=await (0,n.a3)(c,t,u,{ignoreStructured:b.ignoreStructuredPromptGuard});if(C.waiting)return q.info("send-refused-prompt-waiting",{worktreeId:c,cliToolId:t,reason:C.reason,blockedBy:C.blockedBy}),{ok:!1,stage:"prompt_waiting",error:(0,n.br)(c,C.blockedBy)};if(w&&"copilot"===t){try{await z.sendModelCommand(c,w,u),q.info("copilot-model-command-sent",{model:w})}catch(a){return q.error("failed-to-send-model-command:",{error:r(a)}),{ok:!1,stage:"model",error:r(a)}}await s(c,y)||q.warn("previous-turn-poller-still-running",{worktreeId:c,instanceId:y,waitedMs:5e3})}let D=new Date;try{await (0,h.o4)(a,c,t,D,u)}catch(a){q.error("failed-to-save-pending-assistant-response:",{error:r(a)})}let E=null;try{let b=(0,d.getMessages)(a,c,{limit:1,cliToolId:t,instanceId:y,matchResolvedInstance:!0});b.length>0&&"user"===b[0].role&&b[0].content===k&&(E=b[0].id)}catch(a){q.error("failed-to-detect-orphaned-messages:",{error:r(a)})}try{v?(0,f._J)(z)?await z.sendMessageWithImage(c,k,v,u):await z.sendMessage(c,(0,p.TZ)(k,v),u):await z.sendMessage(c,k,u)}catch(a){if(q.error("failed-to-send-message-to:",{error:r(a)}),(0,o.wQ)(a))return{ok:!1,stage:"send",error:a.message,code:o.M7};return{ok:!1,stage:"send",error:r(a)}}let F=(0,d.createMessage)(a,{worktreeId:c,role:"user",content:k,messageType:x,timestamp:D,cliToolId:t,instanceId:u,requestId:b.requestId});try{(0,i.broadcastMessage)("message",{worktreeId:c,message:{...F,cliToolId:t,instanceId:y}})}catch(a){q.warn("user-message-broadcast-failed",{error:r(a)})}if(E)try{if((0,d.deleteMessageById)(a,E)){q.info("cleaned-up-orphaned-user");try{(0,i.broadcastMessage)(j.dz,{worktreeId:c,cliToolId:t,instanceId:y,reason:"orphan_cleanup"})}catch(a){q.warn("orphan-cleanup-broadcast-failed",{error:r(a)})}}}catch(a){q.error("failed-to-clean-up-orphaned-message:",{error:r(a)})}return(0,d.updateLastUserMessage)(a,c,k,D),(0,d.clearInProgressMessageId)(a,c,t,u),q.info("cleared-in-progress-message"),(0,g.startPolling)(c,t,u),{ok:!0,message:F}}},50474:(a,b,c)=>{c.d(b,{y_:()=>d});function d(a){var b=a.noDecision;switch(b.kind){case"proceeds":return{safe:!0,blocksForMs:0,summary:"the agent continues with its own approval flow"};case"blocks":return{safe:!1,blocksForMs:null,summary:"the agent waits indefinitely; nothing else will unblock it"};case"blocksUntil":return{safe:!1,blocksForMs:b.timeoutMs,summary:`the agent waits up to ${b.timeoutMs}ms before continuing`}}}},58707:(a,b,c)=>{c.d(b,{$n:()=>k,a3:()=>l,br:()=>m});var d=c(8360),e=c(31990),f=c(95595),g=c(34405),h=c(72626),i=c(30008);let j=(0,h.h)("prompt-waiting-guard"),k="PROMPT_WAITING";async function l(a,b,c,h){try{let k=d.CLIToolManager.getInstance().getTool(b);if(!await k.isRunning(a,c))return{waiting:!1};let l=await (0,e.Wh)(a,b,g._,c),m=(0,f.WC)(l,b),n=(0,i._G)({worktreeId:a,cliToolId:b,instanceId:c,scraper:{status:m.status,reason:m.reason,hasActivePrompt:m.hasActivePrompt},ignoreStructured:h?.ignoreStructured});if(!n.blocksSend)return null!==n.structuredSendBlockSuppressed&&j.info("structured-send-guard-not-applied",{worktreeId:a,cliToolId:b,instanceId:c,suppressed:n.structuredSendBlockSuppressed,promptWaitingSince:n.structured?.at??null}),{waiting:!1};return{waiting:!0,reason:n.blockReason??void 0,blockedBy:n.blockedBy??void 0}}catch(c){return j.warn("prompt-waiting-check-failed",{worktreeId:a,cliToolId:b,error:c instanceof Error?c.message:String(c)}),{waiting:!1}}}function m(a,b){let c=`${a} is waiting on a prompt. Sending now would type into the prompt's input line instead of reaching the agent, and would leave that text in place for the next answer. Answer the prompt first: \`commandmate respond ${a} <answer>\`.`;if("structured"!==b)return c;let d=Math.round(i.j0/6e4);return`${c} This dialog was reported by the agent's own hooks and is not visible to the terminal scraper, so if the pane looks idle the record has outlived its dialog: it stops blocking sends ${d} minutes after it was reported, or immediately with \`commandmate send ${a} <message> --ignore-structured-prompt\` (server-wide: ${i.F1}=off).`}},85775:(a,b,c)=>{c.d(b,{Tm:()=>p,x4:()=>n,xJ:()=>o});var d=c(34129),e=c(8360),f=c(88807),g=c(72626),h=c(87374),i=c(39687),j=c(36925);let k=(0,g.h)("timer-manager");function l(){return(0,j.v)("__timerManagerState",()=>({timers:new Map,timerWorktrees:new Map,initialized:!1}))}async function m(a){let b=l(),c=(0,f.getDbInstance)();try{let b=(0,d.kx)(c,a);if(!b||"pending"!==b.status)return;let f=e.CLIToolManager.getInstance().getTool(b.cliToolId),g=b.instanceId;if(!await f.isRunning(b.worktreeId,g)){k.warn("timer:no-session",{timerId:a,worktreeId:b.worktreeId,instanceId:g}),(0,d.j2)(c,a,h.HR.NO_SESSION);return}(0,d.j2)(c,a,"sending");let j=await (0,i.d)(c,{worktreeId:b.worktreeId,content:b.message,cliToolId:b.cliToolId,instanceId:g});if(!j.ok){let b=`[${j.stage}] ${j.error}`;(0,d.j2)(c,a,"failed",void 0,b),k.error("timer:send-failed",{timerId:a,stage:j.stage,error:j.error});return}(0,d.j2)(c,a,"sent",Date.now()),k.info("timer:sent",{timerId:a,worktreeId:b.worktreeId})}catch(e){let b=e instanceof Error?e.message:String(e);try{(0,d.j2)(c,a,"failed",void 0,b)}catch{}k.error("timer:send-failed",{timerId:a,error:b})}finally{b.timers.delete(a),b.timerWorktrees.delete(a)}}function n(a,b,c){let d=l(),e=setTimeout(()=>{m(a)},c);d.timers.set(a,e),d.timerWorktrees.set(a,b)}function o(a){let b=l(),c=b.timers.get(a);c&&(clearTimeout(c),b.timers.delete(a),b.timerWorktrees.delete(a));let e=(0,f.getDbInstance)();(0,d.Ud)(e,a)}function p(a){let b=l(),c=(0,f.getDbInstance)();for(let[c,d]of b.timerWorktrees)if(d===a){let a=b.timers.get(c);a&&clearTimeout(a),b.timers.delete(c),b.timerWorktrees.delete(c)}(0,d.$$)(c,a)}},95220:(a,b,c)=>{c.r(b),c.d(b,{accumulateTuiContent:()=>g.IZ,cleanClaudeResponse:()=>f.NN,cleanCopilotResponse:()=>f.LH,cleanGeminiResponse:()=>f.IS,cleanOpenCodeResponse:()=>f.aW,clearPromptHashCache:()=>h.iX,clearTuiAccumulator:()=>g.q1,extractCopilotContentLines:()=>g.o0,extractTuiContentLines:()=>g.K0,findOverlapIndex:()=>g.vQ,getAccumulatedContent:()=>g.Uz,getActivePollers:()=>d.KQ,initTuiAccumulator:()=>g.tb,isDuplicatePrompt:()=>h.gv,isOpenCodeComplete:()=>e.bE,migrateResponsePollerWorktreeIds:()=>d.sR,normalizeCopilotLine:()=>g.IW,normalizePromptForDedup:()=>h.zm,renamePromptHashCacheKey:()=>h.i2,resolveExtractionStartIndex:()=>e.QM,startPolling:()=>d.g8,stopAllPolling:()=>d.fq,stopPolling:()=>d.Et,truncateMessage:()=>f.Sj});var d=c(45146),e=c(60),f=c(82450),g=c(13033),h=c(72457)}};
1
+ "use strict";exports.id=2908,exports.ids=[850,2839,2908,5220,9130],exports.modules={2669:(a,b,c)=>{c.d(b,{JI:()=>n,M7:()=>d,Sr:()=>h,Zf:()=>f,c7:()=>e,lU:()=>k,mR:()=>j,qO:()=>i,su:()=>m,wQ:()=>l});let d="SESSION_STARTING",e="SESSION_START_FAILED",f="SESSION_START_UNAVAILABLE",g=[d,e];class h extends Error{constructor(a,b,c){super(`${a} did not reach its input prompt within ${Math.round(c/1e3)}s (initialization timeout). The tmux session '${b}' and its process are still running, so this is a slow start, not a failed one — the message was not delivered, but nothing needs repairing. Retry the send in a few seconds, or run \`commandmate capture <worktree-id>\` to see what it is waiting on.`),this.toolName=a,this.sessionName=b,this.timeoutMs=c,this.code=d,this.name="SessionStartTimeoutError"}}function i(a,b){return`${a} exited before reaching its input prompt: the tmux session '${b}' is back at a shell, so this is not a slow start and waiting will not help. The message was not delivered. Run \`commandmate capture <worktree-id>\` to see why it exited (for example a startup dialog answered with exit, or a missing login), fix that, then send again.`}class j extends Error{constructor(a,b,c){super(`${a} reported an error while starting in tmux session '${b}': "${c}". Retrying will not help until that is resolved; run \`commandmate capture <worktree-id>\` to see the session output.`),this.toolName=a,this.sessionName=b,this.detectedPattern=c,this.code=e,this.name="SessionStartFailedError"}}class k extends Error{constructor(a,b=`${a} is not installed. Please install it first.`){super(b),this.toolName=a,this.code=f,this.name="SessionStartUnavailableError"}}function l(a){return o(a)===d}function m(a){let b=o(a);return void 0!==b&&g.includes(b)}function n(a){return o(a)===f}function o(a){if("object"!=typeof a||null===a)return;let b=a.code;return"string"==typeof b?b:void 0}},22354:(a,b,c)=>{c.d(b,{F0:()=>j.F,K9:()=>e.K9,VM:()=>d.VM,_0:()=>f._0,c1:()=>k.c,o:()=>i.o,vm:()=>h.v,y_:()=>g.y_});var d=c(59409);c(66101);var e=c(45567);c(57510),c(38367);var f=c(25071),g=c(50474),h=c(70997),i=c(77904),j=c(76835),k=c(2734)},39687:(a,b,c)=>{c.d(b,{d:()=>t});var d=c(56791),e=c(8360),f=c(15194),g=c(95220),h=c(12462),i=c(43015),j=c(54325),k=c(72626),l=c(34331),m=c(40964),n=c(58707),o=c(2669),p=c(49319);let q=(0,k.h)("session/send-user-message");function r(a){return a instanceof Error?a.message:String(a)}async function s(a,b){let c=`${a}:${b}`,d=Date.now()+5e3;for(;(0,g.getActivePollers)().includes(c);){if(Date.now()>=d)return!1;await new Promise(a=>setTimeout(a,100))}return!0}async function t(a,b){let{worktreeId:c,content:k,cliToolId:t,instanceId:u,absoluteImagePath:v,copilotModel:w}=b,x=b.messageType??"normal",y=u??t,z=e.CLIToolManager.getInstance().getTool(t),A=(0,m.mf)(t,c,u),B=await (0,l.L)(c,A,a);if(null===B||"foreign"===B.verdict)return q.warn("send-refused-foreign-session",{worktreeId:c,cliToolId:t,instanceId:y,sessionName:A,sessionPath:B?.sessionPath??null,reason:B?"foreign":"worktree_not_found"}),{ok:!1,stage:"foreign_session",error:B?`tmux session "${A}" belongs to another CommandMate server`:`Worktree '${c}' not found; cannot confirm tmux session "${A}" is this server's`};let C=await (0,n.a3)(c,t,u,{ignoreStructured:b.ignoreStructuredPromptGuard});if(C.waiting)return q.info("send-refused-prompt-waiting",{worktreeId:c,cliToolId:t,reason:C.reason,blockedBy:C.blockedBy}),{ok:!1,stage:"prompt_waiting",error:(0,n.br)(c,C.blockedBy)};if(w&&"copilot"===t){try{await z.sendModelCommand(c,w,u),q.info("copilot-model-command-sent",{model:w})}catch(a){return q.error("failed-to-send-model-command:",{error:r(a)}),{ok:!1,stage:"model",error:r(a)}}await s(c,y)||q.warn("previous-turn-poller-still-running",{worktreeId:c,instanceId:y,waitedMs:5e3})}let D=new Date;try{await (0,h.o4)(a,c,t,D,u)}catch(a){q.error("failed-to-save-pending-assistant-response:",{error:r(a)})}let E=null;try{let b=(0,d.getMessages)(a,c,{limit:1,cliToolId:t,instanceId:y,matchResolvedInstance:!0});b.length>0&&"user"===b[0].role&&b[0].content===k&&(E=b[0].id)}catch(a){q.error("failed-to-detect-orphaned-messages:",{error:r(a)})}try{v?(0,f._J)(z)?await z.sendMessageWithImage(c,k,v,u):await z.sendMessage(c,(0,p.TZ)(k,v),u):await z.sendMessage(c,k,u)}catch(a){if(q.error("failed-to-send-message-to:",{error:r(a)}),(0,o.wQ)(a))return{ok:!1,stage:"send",error:a.message,code:o.M7};return{ok:!1,stage:"send",error:r(a)}}let F=(0,d.createMessage)(a,{worktreeId:c,role:"user",content:k,messageType:x,timestamp:D,cliToolId:t,instanceId:u,requestId:b.requestId});try{(0,i.broadcastMessage)("message",{worktreeId:c,message:{...F,cliToolId:t,instanceId:y}})}catch(a){q.warn("user-message-broadcast-failed",{error:r(a)})}if(E)try{if((0,d.deleteMessageById)(a,E)){q.info("cleaned-up-orphaned-user");try{(0,i.broadcastMessage)(j.dz,{worktreeId:c,cliToolId:t,instanceId:y,reason:"orphan_cleanup"})}catch(a){q.warn("orphan-cleanup-broadcast-failed",{error:r(a)})}}}catch(a){q.error("failed-to-clean-up-orphaned-message:",{error:r(a)})}return(0,d.updateLastUserMessage)(a,c,k,D),(0,d.clearInProgressMessageId)(a,c,t,u),q.info("cleared-in-progress-message"),(0,g.startPolling)(c,t,u),{ok:!0,message:F}}},50474:(a,b,c)=>{c.d(b,{y_:()=>d});function d(a){var b=a.noDecision;switch(b.kind){case"proceeds":return{safe:!0,blocksForMs:0,summary:"the agent continues with its own approval flow"};case"blocks":return{safe:!1,blocksForMs:null,summary:"the agent waits indefinitely; nothing else will unblock it"};case"blocksUntil":return{safe:!1,blocksForMs:b.timeoutMs,summary:`the agent waits up to ${b.timeoutMs}ms before continuing`}}}},58707:(a,b,c)=>{c.d(b,{$n:()=>k,a3:()=>l,br:()=>m});var d=c(8360),e=c(31990),f=c(95595),g=c(34405),h=c(72626),i=c(30008);let j=(0,h.h)("prompt-waiting-guard"),k="PROMPT_WAITING";async function l(a,b,c,h){try{let k=d.CLIToolManager.getInstance().getTool(b);if(!await k.isRunning(a,c))return{waiting:!1};let l=await (0,e.Wh)(a,b,g._,c),m=(0,f.WC)(l,b),n=(0,i._G)({worktreeId:a,cliToolId:b,instanceId:c,scraper:{status:m.status,reason:m.reason,hasActivePrompt:m.hasActivePrompt},ignoreStructured:h?.ignoreStructured});if(!n.blocksSend)return null!==n.structuredSendBlockSuppressed&&j.info("structured-send-guard-not-applied",{worktreeId:a,cliToolId:b,instanceId:c,suppressed:n.structuredSendBlockSuppressed,promptWaitingSince:n.structured?.at??null}),{waiting:!1};return{waiting:!0,reason:n.blockReason??void 0,blockedBy:n.blockedBy??void 0}}catch(c){return j.warn("prompt-waiting-check-failed",{worktreeId:a,cliToolId:b,error:c instanceof Error?c.message:String(c)}),{waiting:!1}}}function m(a,b){let c=`${a} is waiting on a prompt. Sending now would type into the prompt's input line instead of reaching the agent, and would leave that text in place for the next answer. Answer the prompt first: \`commandmate respond ${a} <answer>\`.`;if("structured"!==b)return c;let d=Math.round(i.j0/6e4);return`${c} This dialog was reported by the agent's own hooks and is not visible to the terminal scraper, so if the pane looks idle the record has outlived its dialog: it stops blocking sends ${d} minutes after it was reported, or immediately with \`commandmate send ${a} <message> --ignore-structured-prompt\` (server-wide: ${i.F1}=off).`}},85775:(a,b,c)=>{c.d(b,{Tm:()=>p,x4:()=>n,xJ:()=>o});var d=c(34129),e=c(8360),f=c(88807),g=c(72626),h=c(87374),i=c(39687),j=c(36925);let k=(0,g.h)("timer-manager");function l(){return(0,j.v)("__timerManagerState",()=>({timers:new Map,timerWorktrees:new Map,initialized:!1}))}async function m(a){let b=l(),c=(0,f.getDbInstance)();try{let b=(0,d.kx)(c,a);if(!b||"pending"!==b.status)return;let f=e.CLIToolManager.getInstance().getTool(b.cliToolId),g=b.instanceId;if(!await f.isRunning(b.worktreeId,g)){k.warn("timer:no-session",{timerId:a,worktreeId:b.worktreeId,instanceId:g}),(0,d.j2)(c,a,h.HR.NO_SESSION);return}(0,d.j2)(c,a,"sending");let j=await (0,i.d)(c,{worktreeId:b.worktreeId,content:b.message,cliToolId:b.cliToolId,instanceId:g});if(!j.ok){let b=`[${j.stage}] ${j.error}`;(0,d.j2)(c,a,"failed",void 0,b),k.error("timer:send-failed",{timerId:a,stage:j.stage,error:j.error});return}(0,d.j2)(c,a,"sent",Date.now()),k.info("timer:sent",{timerId:a,worktreeId:b.worktreeId})}catch(e){let b=e instanceof Error?e.message:String(e);try{(0,d.j2)(c,a,"failed",void 0,b)}catch{}k.error("timer:send-failed",{timerId:a,error:b})}finally{b.timers.delete(a),b.timerWorktrees.delete(a)}}function n(a,b,c){let d=l(),e=setTimeout(()=>{m(a)},c);d.timers.set(a,e),d.timerWorktrees.set(a,b)}function o(a){let b=l(),c=b.timers.get(a);c&&(clearTimeout(c),b.timers.delete(a),b.timerWorktrees.delete(a));let e=(0,f.getDbInstance)();(0,d.Ud)(e,a)}function p(a){let b=l(),c=(0,f.getDbInstance)();for(let[c,d]of b.timerWorktrees)if(d===a){let a=b.timers.get(c);a&&clearTimeout(a),b.timers.delete(c),b.timerWorktrees.delete(c)}(0,d.$$)(c,a)}},95220:(a,b,c)=>{c.r(b),c.d(b,{accumulateTuiContent:()=>g.IZ,cleanClaudeResponse:()=>f.NN,cleanCopilotResponse:()=>f.LH,cleanGeminiResponse:()=>f.IS,cleanOpenCodeResponse:()=>f.aW,clearPromptHashCache:()=>h.iX,clearTuiAccumulator:()=>g.q1,extractCopilotContentLines:()=>g.o0,extractTuiContentLines:()=>g.K0,findOverlapIndex:()=>g.vQ,getAccumulatedContent:()=>g.Uz,getActivePollers:()=>d.KQ,initTuiAccumulator:()=>g.tb,isDuplicatePrompt:()=>h.gv,isOpenCodeComplete:()=>e.bE,migrateResponsePollerWorktreeIds:()=>d.sR,normalizeCopilotLine:()=>g.IW,normalizePromptForDedup:()=>h.zm,renamePromptHashCacheKey:()=>h.i2,resolveExtractionStartIndex:()=>e.QM,startPolling:()=>d.g8,stopAllPolling:()=>d.fq,stopPolling:()=>d.Et,truncateMessage:()=>f.Sj});var d=c(45146),e=c(60),f=c(82450),g=c(13033),h=c(72457)}};
@@ -1 +1 @@
1
- "use strict";exports.id=3241,exports.ids=[3241],exports.modules={43241:(a,b,c)=>{c.d(b,{resolvePermissionRequest:()=>u,wn:()=>r});var d=c(24455),e=c(88807),f=c(52660),g=c(91318),h=c(75498),i=c(52277),j=c(33294),k=c(72626),l=c(2466),m=c(13287),n=c(56365),o=c(15388);let p=(0,k.h)("lib/hooks/permission-decision-service"),q="multiple_choice",r=500,s=a=>({behavior:null,reason:a}),t=new Set(["bypassPermissions"]);function u(a,b,k={}){let r=function(a,b,c={}){if(!b)return s("unknown-payload");if(b.toolName===m.k$)return s("ask-user-question");let{worktreeId:e,cliToolId:f,instanceId:i}=a,j=(0,d.aq)(e,f,i);if(!j?.enabled)return s("auto-yes-disabled");let k=(c.readPolicy??function(a){return(0,g.n)(a.worktreeId,a.cliToolId,a.instanceId)})({worktreeId:e,cliToolId:f,instanceId:i}),l=(0,h.Lj)(q,(0,m.I4)(b.toolName,b.toolInput,b.toolInputNormalization),k);return l?{behavior:null,reason:"policy-suppressed",suppressedBy:l.reason,pattern:l.pattern,mode:k?.mode??null}:{behavior:"allow",reason:"auto-yes",mode:k?.mode??null}}(a,b,k);if(b?.toolInputNormalization&&(0,o.RJ)(a.worktreeId,a.cliToolId,a.instanceId,b.toolInputNormalization,b.toolName),b?.toolName===m.k$){let c=(0,l.ek)({tool_name:b.toolName,tool_input:b.toolInput,prompt_id:b.promptId});c&&(0,j.recordAskUserQuestion)(a.worktreeId,a.cliToolId,a.instanceId,c)}return"allow"!==r.behavior&&function(a,b){if(!(b?.permissionMode&&t.has(b.permissionMode))){if(!(0,n.VM)(a.cliToolId).capabilities.permissionHookPredictsDialog)return p.debug("permission-request:dialog-forecast-skipped",{worktreeId:a.worktreeId,cliToolId:a.cliToolId,instanceId:a.instanceId,toolName:b?.toolName??null,reason:"capability-permissionHookPredictsDialog-false"});(0,j.reportPermissionRequestPending)(a.worktreeId,a.cliToolId,a.instanceId,b?.toolName??null)}}(a,b),"policy-suppressed"===r.reason&&r.suppressedBy&&((0,i.ZS)(a.worktreeId,a.cliToolId,a.instanceId,{reason:r.suppressedBy,mode:r.mode??null,promptType:q,pattern:r.pattern}),p.warn("permission-request:suppressed-by-policy",{worktreeId:a.worktreeId,cliToolId:a.cliToolId,instanceId:a.instanceId,toolName:b?.toolName,promptId:b?.promptId,reason:r.suppressedBy,mode:r.mode??null,pattern:r.pattern})),"allow"===r.behavior&&b&&(k.recordAllow??function(a,b){var d,g;let i=(0,m.I4)(b.toolName,b.toolInput,b.toolInputNormalization).join("\n").slice(0,h.Tb),j=new Date,k=null;try{k=(0,f.createMessage)((0,e.getDbInstance)(),{worktreeId:a.worktreeId,role:"assistant",content:`${b.toolName}: ${i}`.slice(0,h.Tb),summary:`PermissionRequest allow \xb7 tool=${b.toolName} \xb7 prompt_id=${b.promptId??"unknown"}`,messageType:"prompt",promptData:{type:"multiple_choice",question:`Approve ${b.toolName}?`,options:[],status:"answered",answer:"allow",answeredAt:j.toISOString(),answeredBy:"auto",approvalTarget:i},timestamp:j,cliToolId:a.cliToolId,instanceId:a.instanceId})}catch(c){p.warn("permission-request:audit-record-failed",{worktreeId:a.worktreeId,instanceId:a.instanceId,toolName:b.toolName,error:c instanceof Error?c.message:String(c)})}k&&(d=a,g=k,Promise.all([c.e(1356),c.e(1503),c.e(1191),c.e(8791),c.e(1719),c.e(2119),c.e(2445),c.e(8728)]).then(c.bind(c,43015)).then(({broadcastMessage:a})=>{a("message",{worktreeId:d.worktreeId,message:g})}).catch(a=>{p.warn("permission-request:audit-broadcast-failed",{worktreeId:d.worktreeId,instanceId:d.instanceId,error:a instanceof Error?a.message:String(a)})}))})(a,b),r}}};
1
+ "use strict";exports.id=3241,exports.ids=[3241],exports.modules={43241:(a,b,c)=>{c.d(b,{resolvePermissionRequest:()=>u,wn:()=>r});var d=c(24455),e=c(88807),f=c(52660),g=c(91318),h=c(75498),i=c(52277),j=c(33294),k=c(72626),l=c(2466),m=c(13287),n=c(59409),o=c(15388);let p=(0,k.h)("lib/hooks/permission-decision-service"),q="multiple_choice",r=500,s=a=>({behavior:null,reason:a}),t=new Set(["bypassPermissions"]);function u(a,b,k={}){let r=function(a,b,c={}){if(!b)return s("unknown-payload");if(b.toolName===m.k$)return s("ask-user-question");let{worktreeId:e,cliToolId:f,instanceId:i}=a,j=(0,d.aq)(e,f,i);if(!j?.enabled)return s("auto-yes-disabled");let k=(c.readPolicy??function(a){return(0,g.n)(a.worktreeId,a.cliToolId,a.instanceId)})({worktreeId:e,cliToolId:f,instanceId:i}),l=(0,h.Lj)(q,(0,m.I4)(b.toolName,b.toolInput,b.toolInputNormalization),k);return l?{behavior:null,reason:"policy-suppressed",suppressedBy:l.reason,pattern:l.pattern,mode:k?.mode??null}:{behavior:"allow",reason:"auto-yes",mode:k?.mode??null}}(a,b,k);if(b?.toolInputNormalization&&(0,o.RJ)(a.worktreeId,a.cliToolId,a.instanceId,b.toolInputNormalization,b.toolName),b?.toolName===m.k$){let c=(0,l.ek)({tool_name:b.toolName,tool_input:b.toolInput,prompt_id:b.promptId});c&&(0,j.recordAskUserQuestion)(a.worktreeId,a.cliToolId,a.instanceId,c)}return"allow"!==r.behavior&&function(a,b){if(!(b?.permissionMode&&t.has(b.permissionMode))){if(!(0,n.VM)(a.cliToolId).capabilities.permissionHookPredictsDialog)return p.debug("permission-request:dialog-forecast-skipped",{worktreeId:a.worktreeId,cliToolId:a.cliToolId,instanceId:a.instanceId,toolName:b?.toolName??null,reason:"capability-permissionHookPredictsDialog-false"});(0,j.reportPermissionRequestPending)(a.worktreeId,a.cliToolId,a.instanceId,b?.toolName??null)}}(a,b),"policy-suppressed"===r.reason&&r.suppressedBy&&((0,i.ZS)(a.worktreeId,a.cliToolId,a.instanceId,{reason:r.suppressedBy,mode:r.mode??null,promptType:q,pattern:r.pattern}),p.warn("permission-request:suppressed-by-policy",{worktreeId:a.worktreeId,cliToolId:a.cliToolId,instanceId:a.instanceId,toolName:b?.toolName,promptId:b?.promptId,reason:r.suppressedBy,mode:r.mode??null,pattern:r.pattern})),"allow"===r.behavior&&b&&(k.recordAllow??function(a,b){var d,g;let i=(0,m.I4)(b.toolName,b.toolInput,b.toolInputNormalization).join("\n").slice(0,h.Tb),j=new Date,k=null;try{k=(0,f.createMessage)((0,e.getDbInstance)(),{worktreeId:a.worktreeId,role:"assistant",content:`${b.toolName}: ${i}`.slice(0,h.Tb),summary:`PermissionRequest allow \xb7 tool=${b.toolName} \xb7 prompt_id=${b.promptId??"unknown"}`,messageType:"prompt",promptData:{type:"multiple_choice",question:`Approve ${b.toolName}?`,options:[],status:"answered",answer:"allow",answeredAt:j.toISOString(),answeredBy:"auto",approvalTarget:i},timestamp:j,cliToolId:a.cliToolId,instanceId:a.instanceId})}catch(c){p.warn("permission-request:audit-record-failed",{worktreeId:a.worktreeId,instanceId:a.instanceId,toolName:b.toolName,error:c instanceof Error?c.message:String(c)})}k&&(d=a,g=k,Promise.all([c.e(1356),c.e(1503),c.e(1191),c.e(8791),c.e(1719),c.e(2119),c.e(2445),c.e(8728)]).then(c.bind(c,43015)).then(({broadcastMessage:a})=>{a("message",{worktreeId:d.worktreeId,message:g})}).catch(a=>{p.warn("permission-request:audit-broadcast-failed",{worktreeId:d.worktreeId,instanceId:d.instanceId,error:a instanceof Error?a.message:String(a)})}))})(a,b),r}}};
@@ -0,0 +1 @@
1
+ "use strict";exports.id=4243,exports.ids=[4243],exports.modules={9758:(a,b,c)=>{c.d(b,{Ck:()=>h});var d=c(21124),e=c(38301),f=c.n(e),g=c(62484);function h({children:a,as:b="div",className:c=""}){let e=function a(b){return null==b||"boolean"==typeof b?"":"string"==typeof b?b:"number"==typeof b?String(b):Array.isArray(b)?b.map(a).join(""):f().isValidElement(b)?a(b.props.children):""}(a);if(!e||0===e.trim().length)return(0,d.jsx)(b,{className:c||void 0,children:a});let h=`relative group ${"span"===b?"block ":""}${c}`.trim();return(0,d.jsxs)(b,{className:h,"data-testid":"code-block-with-copy",children:[a,(0,d.jsx)(g.i,{text:e,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"})]})}},9815:(a,b,c)=>{c.d(b,{B:()=>B});var d=c(21124),e=c(38301),f=c(20481),g=c(85866),h=c(17252),i=c(90349),j=c(85389),k=c(3805);let l={status:"loading",options:[]};function m({selectedWorktreeId:a,onSelect:b,disabled:c=!1}){let h=(0,f.c)("skills"),[i,j]=(0,e.useState)(l),[m,o]=(0,e.useState)(0),p=(0,e.useCallback)(()=>o(a=>a+1),[]);return"loading"===i.status?(0,d.jsxs)("div",{className:"space-y-2","data-testid":"skill-target-loading",children:[(0,d.jsx)("p",{className:"text-sm text-muted-foreground",children:h("target.loading")}),(0,d.jsx)(g.EA,{className:"h-24 w-full rounded-lg"})]}):"error"===i.status?(0,d.jsxs)(g.Zp,{className:"space-y-3","data-testid":"skill-target-error",children:[(0,d.jsx)(k.u,{tone:"danger",children:h("target.errorNotice")}),(0,d.jsx)(g.$n,{variant:"secondary",size:"sm",onClick:p,"data-testid":"skill-target-retry",children:h("target.retry")})]}):0===i.options.length?(0,d.jsx)(g.Zp,{"data-testid":"skill-target-empty",children:(0,d.jsx)("p",{className:"text-sm text-muted-foreground",children:h("target.empty")})}):(0,d.jsxs)("div",{className:"space-y-3","data-testid":"skill-target-selector",children:[(0,d.jsx)("div",{role:"radiogroup","aria-label":h("target.heading"),className:"space-y-2",children:i.options.map(e=>(0,d.jsx)(n,{option:e,selected:e.id===a,disabled:c,onSelect:b},e.id))}),(0,d.jsx)(k.u,{tone:"neutral","data-testid":"skill-target-branch-notice",children:h("target.branchFreshnessNotice")})]})}function n({option:a,selected:b,disabled:c,onSelect:e}){let h=(0,f.c)("skills"),i=a.liveBranch??a.syncedBranch;return(0,d.jsxs)("button",{type:"button",role:"radio","aria-checked":b,disabled:c,onClick:()=>e(a.id),"data-testid":`skill-target-option-${a.id}`,className:`w-full rounded-lg border px-3 py-2.5 text-left transition-colors disabled:cursor-not-allowed disabled:opacity-60 ${b?"border-accent-500 bg-accent-50 dark:bg-accent-950/40":"border-border bg-card hover:bg-muted"}`,children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,d.jsx)("span",{className:"text-sm font-semibold text-foreground break-all",children:a.name}),b&&(0,d.jsx)(g.Ex,{variant:"info",children:h("target.selected")})]}),(0,d.jsxs)("dl",{className:"mt-1.5 grid grid-cols-1 gap-x-4 gap-y-1 sm:grid-cols-2",children:[(0,d.jsx)(o,{label:h("target.repository"),children:a.repositoryName}),(0,d.jsx)(o,{label:h("target.branch"),children:i??h("target.branchUnknown")}),(0,d.jsx)(o,{label:h("target.agents"),children:a.agents.length>0?a.agents.join(", "):h("target.agentsNone")}),(0,d.jsx)(o,{label:h("target.workingTree"),children:h(null===a.dirty?"target.workingTreeUnknown":a.dirty?"target.workingTreeDirty":"target.workingTreeClean")})]}),a.sessionRunning&&(0,d.jsx)("p",{className:"mt-1.5 text-xs text-muted-foreground","data-testid":`skill-target-session-${a.id}`,children:h("target.sessionRunning")})]})}function o({label:a,children:b}){return(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsx)("dt",{className:"text-xs font-medium text-muted-foreground",children:a}),(0,d.jsx)("dd",{className:"text-xs text-foreground break-words",children:b})]})}var p=c(27884);function q({label:a,children:b}){return(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsx)("dt",{className:"text-xs font-medium text-muted-foreground",children:a}),(0,d.jsx)("dd",{className:"mt-0.5 break-words text-sm text-foreground",children:b})]})}function r({level:a,kind:b,label:c}){let e=(0,f.c)("skills");return(0,d.jsxs)(g.Ex,{variant:p.eK[a],"data-testid":`skill-plan-risk-${b}-${a}`,children:[c,": ",e(p.pP[a])]})}function s({entry:a}){let b=(0,f.c)("skills"),c=p.KL[a.reason];return(0,d.jsxs)("li",{className:"space-y-1.5 rounded-md border border-border px-3 py-2","data-testid":`skill-plan-file-${a.path}`,children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,d.jsx)(g.Ex,{variant:p.tC[a.change],children:b(p.AS[a.change])}),(0,d.jsx)("span",{className:"break-all font-mono text-xs text-foreground",children:a.path}),a.generated&&(0,d.jsx)(g.Ex,{variant:"gray",children:b("plan.fileGenerated")})]}),c&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:b(c)}),a.gitIgnored&&(0,d.jsx)("p",{className:"text-xs text-warning-foreground",children:b("plan.gitIgnored")}),a.binary?(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:b("plan.diffBinary")}):a.diff?(0,d.jsxs)("details",{children:[(0,d.jsx)("summary",{className:"cursor-pointer text-xs text-accent-600 dark:text-accent-400",children:b("plan.diffToggle",{additions:a.additions,deletions:a.deletions})}),(0,d.jsx)("pre",{className:"mt-1 overflow-x-auto rounded bg-muted p-2 font-mono text-[11px] leading-snug text-foreground",children:a.diff}),a.diffTruncated&&(0,d.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:b("plan.diffTruncated")})]}):null]})}function t({plan:a}){let b=(0,f.c)("skills"),{target:c,skill:e}=a,h=e.compatibility.commandmate;return(0,d.jsxs)(g.Zp,{className:"space-y-4","data-testid":"skill-install-plan",children:[(0,d.jsxs)("div",{className:"space-y-1",children:[(0,d.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:b("plan.heading")}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:b("plan.expiresAt",{timestamp:a.expiresAt})})]}),(0,d.jsxs)("section",{className:"space-y-2",children:[(0,d.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:b("plan.targetHeading")}),(0,d.jsxs)("dl",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[(0,d.jsx)(q,{label:b("target.repository"),children:c.repositoryName}),(0,d.jsx)(q,{label:b("target.heading"),children:c.worktreeName}),(0,d.jsx)(q,{label:b("target.branch"),children:c.branch??b("target.branchUnknown")}),(0,d.jsx)(q,{label:b("plan.headStateLabel"),children:b(p.kF[c.headState]??"plan.headState.unknown")}),(0,d.jsx)(q,{label:b("target.workingTree"),children:c.workingTreeUnknown?b("target.workingTreeStatusUnknown"):c.workingTreeDirty?b("target.workingTreeDirty"):b("target.workingTreeClean")}),(0,d.jsx)(q,{label:b("plan.installRoot"),children:(0,d.jsx)("span",{className:"break-all font-mono text-xs",children:(c.installRoots&&c.installRoots.length>0?c.installRoots:[c.installRoot]).map(a=>(0,d.jsx)("span",{className:"block",children:a},a))})}),(0,d.jsx)(q,{label:b("plan.existingInstall"),children:c.existingInstall?b("plan.existingInstallVersion",{version:c.existingInstall.version}):b("plan.existingInstallNone")}),(0,d.jsx)(q,{label:b("detail.recommendedVersion"),children:(0,d.jsx)("span",{className:"font-mono text-xs",children:e.version})})]})]}),(0,d.jsxs)("section",{className:"space-y-2","data-testid":"skill-plan-risk-section",children:[(0,d.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:b("plan.riskHeading")}),(0,d.jsxs)("div",{className:"flex flex-wrap gap-1.5",children:[(0,d.jsx)(r,{level:e.declaredRisk,kind:"declared",label:b("plan.riskDeclared")}),(0,d.jsx)(r,{level:e.computedRisk,kind:"computed",label:b("plan.riskComputed")}),(0,d.jsx)(r,{level:e.effectiveRisk,kind:"effective",label:b("plan.riskEffective")})]}),(0,d.jsx)("p",{className:"break-words text-sm text-foreground",children:e.riskRationale}),(0,d.jsx)(k.u,{tone:"neutral",children:b("plan.riskNotice")})]}),(0,d.jsxs)("section",{className:"space-y-2","data-testid":"skill-plan-permissions",children:[(0,d.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:b("permissions.heading")}),e.declaredPermissions.length>0?(0,d.jsx)("div",{className:"flex flex-wrap gap-1.5",children:e.declaredPermissions.map(a=>(0,d.jsx)(g.Ex,{variant:"warning",children:p.z2[a]?b(p.z2[a]):a},a))}):(0,d.jsx)("p",{className:"text-sm text-muted-foreground",children:b("plan.permissionsNone")}),(0,d.jsx)(k.u,{tone:"warning",children:b("permissions.declarationOnlyNotice")})]}),(0,d.jsxs)("section",{className:"space-y-2","data-testid":"skill-plan-requirements",children:[(0,d.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:b("requirements.heading")}),0===e.requirements.commands.length&&0===e.requirements.networkHosts.length?(0,d.jsx)("p",{className:"text-sm text-muted-foreground",children:b("plan.requirementsNone")}):(0,d.jsxs)("dl",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[e.requirements.commands.length>0&&(0,d.jsx)(q,{label:b("plan.requirementsCommands"),children:e.requirements.commands.map(a=>`${a.name} ${a.versionRange??b("plan.commandAnyVersion")}`).join(", ")}),e.requirements.networkHosts.length>0&&(0,d.jsx)(q,{label:b("plan.requirementsHosts"),children:e.requirements.networkHosts.join(", ")})]})]}),(0,d.jsxs)("section",{className:"space-y-2","data-testid":"skill-plan-scripts",children:[(0,d.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:b("plan.scriptsHeading")}),0===e.executablePaths.length&&0===e.scriptPaths.length?(0,d.jsx)("p",{className:"text-sm text-muted-foreground",children:b("plan.scriptsNone")}):(0,d.jsx)("ul",{className:"space-y-1",children:[...new Set([...e.scriptPaths,...e.executablePaths])].map(a=>(0,d.jsx)("li",{className:"break-all font-mono text-xs text-foreground",children:a},a))})]}),"compatible"!==h.status&&(0,d.jsx)(k.u,{tone:"warning","data-testid":"skill-plan-compatibility-notice",children:b((0,p.e5)(h.messageKey),{range:h.requiredRange,currentVersion:h.currentVersion??""})}),a.warnings.length>0&&(0,d.jsxs)("section",{className:"space-y-2","data-testid":"skill-plan-warnings",children:[(0,d.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:b("plan.warningsHeading")}),(0,d.jsx)("ul",{className:"space-y-1",children:a.warnings.map(a=>(0,d.jsx)("li",{className:"text-xs text-warning-foreground",children:p.RO[a]?b(p.RO[a]):a},a))})]}),(0,d.jsxs)("section",{className:"space-y-2","data-testid":"skill-plan-files",children:[(0,d.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:b("plan.filesHeading")}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"skill-plan-stats",children:b("plan.stats",{added:a.stats.added,modified:a.stats.modified,unchanged:a.stats.unchanged,conflicted:a.stats.conflicted,unmanaged:a.stats.unmanaged})}),0===a.files.length?(0,d.jsx)("p",{className:"text-sm text-muted-foreground",children:b("plan.filesEmpty")}):(0,d.jsx)("ul",{className:"space-y-2",children:a.files.map(a=>(0,d.jsx)(s,{entry:a},a.path))})]}),a.blockers.length>0&&(0,d.jsxs)("section",{className:"space-y-2","data-testid":"skill-install-blockers",children:[(0,d.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-danger-foreground",children:b("plan.blockersHeading")}),(0,d.jsx)("ul",{className:"space-y-1",children:a.blockers.map(a=>(0,d.jsxs)("li",{className:"text-xs text-danger-foreground",children:[a.path&&(0,d.jsx)("span",{className:"mr-1 break-all font-mono",children:a.path}),a.code.startsWith("skills.")?b((0,p.e5)(a.code),{range:h.requiredRange,currentVersion:h.currentVersion??""}):p.KL[a.code]?b(p.KL[a.code]):a.code]},`${a.code}:${a.path??""}`))}),(0,d.jsx)(k.u,{tone:"danger",children:b("plan.blockedNotice")})]})]})}function u({entry:a}){let b=(0,f.c)("skills"),c=p.Mj[a.disposition],e=p.hJ[a.reason];return(0,d.jsxs)("li",{className:"flex flex-wrap items-center gap-2","data-testid":`skill-uninstall-file-${a.path}`,children:[(0,d.jsx)(g.Ex,{variant:"remove"===a.disposition?"info":"warning",children:c?b(c):a.disposition}),(0,d.jsx)("span",{className:"break-all font-mono text-xs text-foreground",children:a.path}),e&&(0,d.jsx)("span",{className:"text-xs text-muted-foreground",children:b(e)})]})}function v({plan:a}){let b=(0,f.c)("skills"),{target:c,skill:e}=a;return(0,d.jsxs)(g.Zp,{className:"space-y-4","data-testid":"skill-uninstall-plan",children:[(0,d.jsxs)("div",{className:"space-y-1",children:[(0,d.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:b("uninstall.heading")}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:b("uninstall.expiresAt",{timestamp:a.expiresAt})})]}),(0,d.jsxs)("dl",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[(0,d.jsx)(q,{label:b("target.repository"),children:c.repositoryName}),(0,d.jsx)(q,{label:b("target.heading"),children:c.worktreeName}),(0,d.jsx)(q,{label:b("target.branch"),children:c.branch??b("target.branchUnknown")}),(0,d.jsx)(q,{label:b("uninstall.installedVersion"),children:(0,d.jsx)("span",{className:"font-mono text-xs",children:e.version||b("uninstall.versionUnknown")})}),(0,d.jsx)(q,{label:b("plan.installRoot"),children:(0,d.jsx)("span",{className:"break-all font-mono text-xs",children:c.installRoot})}),(0,d.jsx)(q,{label:b("target.workingTree"),children:c.workingTreeUnknown?b("target.workingTreeStatusUnknown"):c.workingTreeDirty?b("target.workingTreeDirty"):b("target.workingTreeClean")})]}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"skill-uninstall-stats",children:b("uninstall.stats",{removable:a.stats.removable,modified:a.stats.modified,missing:a.stats.missing,unknown:a.stats.unknown,irregular:a.stats.irregular})}),(0,d.jsxs)("section",{className:"space-y-2",children:[(0,d.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:b("uninstall.removalsHeading")}),0===a.removals.length?(0,d.jsx)("p",{className:"text-sm text-muted-foreground",children:b("uninstall.removalsEmpty")}):(0,d.jsx)("ul",{className:"space-y-1.5",children:a.removals.map(a=>(0,d.jsx)(u,{entry:a},a.path))})]}),(0,d.jsxs)("section",{className:"space-y-2",children:[(0,d.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:b("uninstall.retainedHeading")}),0===a.retained.length?(0,d.jsx)("p",{className:"text-sm text-muted-foreground",children:b("uninstall.retainedEmpty")}):(0,d.jsx)("ul",{className:"space-y-1.5",children:a.retained.map(a=>(0,d.jsx)(u,{entry:a},a.path))})]}),(0,d.jsxs)("div",{className:"space-y-2",children:[a.skill.agents.length>0&&(0,d.jsx)("div",{className:"flex flex-wrap gap-1.5","data-testid":"skill-uninstall-agents",children:a.skill.agents.map(a=>(0,d.jsx)(g.Ex,{variant:"gray",children:(0,h.f_)(a.agent)},a.agent))}),(0,d.jsx)(k.u,{tone:"neutral",children:b((0,p.e5)(a.nextActionKey))})]}),a.blockers.length>0&&(0,d.jsxs)("section",{className:"space-y-2","data-testid":"skill-uninstall-blockers",children:[(0,d.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-danger-foreground",children:b("uninstall.blockersHeading")}),(0,d.jsx)("ul",{className:"space-y-1",children:a.blockers.map(a=>(0,d.jsxs)("li",{className:"text-xs text-danger-foreground",children:[a.path&&(0,d.jsx)("span",{className:"mr-1 break-all font-mono",children:a.path}),b((0,p.e5)(a.messageKey))]},`${a.code}:${a.path??""}`))})]})]})}var w=c(30156);let x={worktreeId:null,busy:null,installPlan:null,uninstallPlan:null,installResult:null,uninstallResult:null,riskAcknowledged:!1,failure:null};function y(a){return{...a,installPlan:null,uninstallPlan:null,installResult:null,uninstallResult:null,riskAcknowledged:!1,failure:null}}function z({failure:a}){let b=(0,f.c)("skills");return(0,d.jsxs)("div",{className:"space-y-2","data-testid":"skill-operation-error",children:[(0,d.jsxs)(k.u,{tone:"danger",children:[(0,d.jsx)("p",{className:"font-medium",children:b("operation.errorHeading")}),(0,d.jsx)("p",{className:"mt-1",children:b((0,p.FW)(a.code))}),(0,d.jsx)("p",{className:"mt-1 break-words",children:b("state.errorCode",{code:a.code})})]}),a.nextActionKey&&(0,d.jsx)(k.u,{tone:"warning",children:b((0,p.e5)(a.nextActionKey))}),a.blockers&&a.blockers.length>0&&(0,d.jsx)("ul",{className:"space-y-1","data-testid":"skill-operation-error-blockers",children:a.blockers.map(a=>(0,d.jsxs)("li",{className:"text-xs text-danger-foreground",children:[a.path&&(0,d.jsx)("span",{className:"mr-1 break-all font-mono",children:a.path}),b((0,p.e5)(a.messageKey))]},`${a.code}:${a.path??""}`))})]})}function A({agents:a,skillId:b,version:c}){let e=(0,f.c)("skills");return 0===a.length?null:(0,d.jsxs)("div",{className:"space-y-1","data-testid":"skill-operation-reload",children:[(0,d.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:e("operation.reloadHeading")}),(0,d.jsx)("ul",{className:"space-y-1",children:a.map(a=>(0,d.jsx)("li",{className:"text-xs text-muted-foreground",children:e((0,p.e5)(a.messageKey),{agent:(0,h.f_)(a.agent),skillId:b,version:c})},a.agent))})]})}function B({skillId:a,version:b,blockedReason:c,worktreeId:h,agents:l=[]}){let n=(0,f.c)("skills"),[o,q]=(0,e.useState)(()=>h?{...x,worktreeId:h}:x),r=(0,e.useCallback)(a=>{q(b=>b.worktreeId===a?b:y({...b,worktreeId:a,busy:null}))},[]),s=(0,e.useCallback)(async()=>{let c=o.worktreeId;if(!c)return;q(a=>({...y(a),busy:"install-plan"}));let d=await (0,w.Q6)(c,a,{version:b??void 0});q(a=>({...a,busy:null,installPlan:d.ok?d.data.plan:null,failure:d.ok?null:d.failure}))},[a,o.worktreeId,b]),u=(0,e.useCallback)(async()=>{var b;let c=o.worktreeId,d=o.installPlan;if(!c||!d||d.requiresRiskAcknowledgement&&!o.riskAcknowledged)return;q(a=>({...a,busy:"install-apply",failure:null}));let e=await (0,w.Xi)(c,a,{planToken:d.token,version:d.skill.version,acknowledgeRisk:!!d.requiresRiskAcknowledgement||void 0,idempotencyKey:(b=d.token,`skill-install-${b}`)});e.ok&&(0,i.k)(c),q(a=>({...a,busy:null,installPlan:e.ok?null:a.installPlan,installResult:e.ok?e.data:null,failure:e.ok?null:e.failure}))},[a,o.installPlan,o.riskAcknowledged,o.worktreeId]),B=(0,e.useCallback)(async()=>{let b=o.worktreeId;if(!b)return;q(a=>({...y(a),busy:"uninstall-plan"}));let c=await (0,w.hN)(b,a);q(a=>({...a,busy:null,uninstallPlan:c.ok?c.data.plan:null,failure:c.ok?null:c.failure}))},[a,o.worktreeId]),C=(0,e.useCallback)(async()=>{var b;let c=o.worktreeId,d=o.uninstallPlan;if(!c||!d)return;q(a=>({...a,busy:"uninstall-apply",failure:null}));let e=await (0,w.E)(c,a,{planToken:d.token,idempotencyKey:(b=d.token,`skill-uninstall-${b}`)});q(a=>({...a,busy:null,uninstallPlan:e.ok?null:a.uninstallPlan,uninstallResult:e.ok?e.data:null,failure:e.ok?null:e.failure}))},[a,o.uninstallPlan,o.worktreeId]),D=(0,e.useCallback)(()=>{q(a=>y(a))},[]),E=null!==o.busy,F=o.installPlan,G=o.uninstallPlan,H=c??n(o.worktreeId?"plan.ready":"plan.chooseTarget"),I=null!==F&&F.requiresRiskAcknowledgement&&!o.riskAcknowledged;return(0,d.jsxs)("div",{className:"space-y-3","data-testid":"skill-install-panel",children:[!h&&(0,d.jsx)(m,{selectedWorktreeId:o.worktreeId,onSelect:r,disabled:E}),(0,d.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,d.jsx)(g.$n,{variant:"primary",disabled:E||null!==c||!o.worktreeId,onClick:s,"data-testid":"skill-install-action","aria-describedby":"skill-install-reason",children:n("install-plan"===o.busy?"plan.building":"plan.build")}),(0,d.jsx)(g.$n,{variant:"secondary",disabled:E||!o.worktreeId,onClick:B,"data-testid":"skill-uninstall-action",children:n("uninstall-plan"===o.busy?"uninstall.building":"uninstall.build")})]}),(0,d.jsx)("p",{id:"skill-install-reason",className:"text-sm text-muted-foreground","data-testid":"skill-install-reason",children:H}),l.length>0&&(0,d.jsxs)("div",{className:"space-y-1","data-testid":"skill-install-reload-preview",children:[(0,d.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:n("operation.reloadHeading")}),(0,d.jsx)("ul",{className:"space-y-1",children:l.map(a=>(0,d.jsx)(j.m,{agent:a,variant:"reload"},a.agent))})]}),o.failure&&(0,d.jsx)(z,{failure:o.failure}),F&&(0,d.jsxs)("div",{className:"space-y-3",children:[(0,d.jsx)(t,{plan:F}),F.requiresRiskAcknowledgement&&(0,d.jsxs)(g.Zp,{className:"space-y-3","data-testid":"skill-install-risk-acknowledgement",children:[(0,d.jsx)(k.u,{tone:"danger",children:n((0,p.e5)(F.riskAcknowledgementMessageKey??"skills.plan.highRiskAcknowledgement"))}),(0,d.jsxs)("label",{className:"flex items-start gap-2 text-sm text-foreground",children:[(0,d.jsx)(g.Sc,{checked:o.riskAcknowledged,onCheckedChange:a=>q(b=>({...b,riskAcknowledged:!0===a})),disabled:E,"data-testid":"skill-install-risk-checkbox",className:"mt-0.5"}),(0,d.jsx)("span",{children:n("plan.acknowledgeLabel")})]})]}),(0,d.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,d.jsx)(g.$n,{variant:F.requiresRiskAcknowledgement?"danger":"primary",disabled:E||!F.installable||I,onClick:u,"data-testid":"skill-install-confirm",children:n("install-apply"===o.busy?"plan.confirming":"plan.confirm")}),(0,d.jsx)(g.$n,{variant:"ghost",disabled:E,onClick:D,"data-testid":"skill-install-discard",children:n("plan.discard")})]})]}),G&&(0,d.jsxs)("div",{className:"space-y-3",children:[(0,d.jsx)(v,{plan:G}),(0,d.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,d.jsx)(g.$n,{variant:"danger",disabled:E||!G.removable,onClick:C,"data-testid":"skill-uninstall-confirm",children:n("uninstall-apply"===o.busy?"uninstall.confirming":"uninstall.confirm")}),(0,d.jsx)(g.$n,{variant:"ghost",disabled:E,onClick:D,"data-testid":"skill-uninstall-discard",children:n("plan.discard")})]})]}),o.installResult&&(0,d.jsxs)(g.Zp,{className:"space-y-3","data-testid":"skill-install-result",children:[(0,d.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:n("operation.installedHeading")}),(0,d.jsx)(k.u,{tone:"info",children:n((0,p.e5)(o.installResult.operation.nextActionKey))}),o.installResult.operation.replayed&&(0,d.jsx)(k.u,{tone:"neutral","data-testid":"skill-operation-replayed",children:n("operation.replayNotice")}),o.installResult.install&&"files"in o.installResult.install&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:n("operation.filesWritten",{count:o.installResult.install.files.length})}),"reload"in o.installResult&&(0,d.jsx)(A,{agents:o.installResult.reload.agents,skillId:o.installResult.reload.skillId,version:o.installResult.reload.version}),(0,d.jsx)(g.$n,{variant:"secondary",size:"sm",onClick:D,"data-testid":"skill-operation-reset",children:n("operation.startOver")})]}),o.uninstallResult&&(0,d.jsxs)(g.Zp,{className:"space-y-3","data-testid":"skill-uninstall-result",children:[(0,d.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:n("operation.uninstalledHeading")}),(0,d.jsx)(k.u,{tone:"info",children:n((0,p.e5)(o.uninstallResult.operation.nextActionKey))}),o.uninstallResult.operation.replayed&&(0,d.jsx)(k.u,{tone:"neutral","data-testid":"skill-operation-replayed",children:n("operation.replayNotice")}),o.uninstallResult.uninstall&&"removedFiles"in o.uninstallResult.uninstall&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:n("operation.filesRemoved",{count:o.uninstallResult.uninstall.removedFiles.length})}),"reload"in o.uninstallResult&&(0,d.jsx)(A,{agents:o.uninstallResult.reload.agents,skillId:o.uninstallResult.reload.skillId,version:o.uninstallResult.reload.version}),(0,d.jsx)(g.$n,{variant:"secondary",size:"sm",onClick:D,"data-testid":"skill-operation-reset",children:n("operation.startOver")})]})]})}},28593:(a,b,c)=>{c.d(b,{Xz:()=>j,qW:()=>k,uE:()=>l});var d=c(21124);c(38301);var e=c(20481),f=c(93983),g=c(85866),h=c(17252),i=c(27884);function j({status:a,className:b}){let c=(0,e.c)("skills");return(0,d.jsx)(g.Ex,{variant:i.H$[a],className:b,"data-testid":`skill-compatibility-${a}`,children:c(i.OV[a])})}function k({risk:a,className:b}){let c=(0,e.c)("skills");return(0,d.jsxs)(g.Ex,{variant:i.eK[a],className:b,"data-testid":`skill-declared-risk-${a}`,children:["high"===a&&(0,d.jsx)(f.A,{size:12,"aria-hidden":"true",className:"mr-1 shrink-0"}),c("risk.declaredLabel",{level:c(i.pP[a])})]})}function l({agent:a}){let b=(0,e.c)("skills");return(0,d.jsxs)(g.Ex,{variant:i.Et[a.support],"data-testid":`skill-agent-${a.agent}-${a.support}`,children:[(0,h.f_)(a.agent),": ",b((0,i.e5)(a.labelKey))]})}},34126:(a,b,c)=>{c.d(b,{G8:()=>r});var d=c(21124),e=c(38301),f=c(27867),g=c(26295),h=c(29701),i=c(28752),j=c(37950);c(31230);var k=c(56722),l=c(45538),m=c(9758),n=c(30917),o=c(82620),p=c(12894),q=c(88033);let r=(0,e.memo)(function({content:a,onOpenFile:b,currentFilePath:c,worktreeId:r}){let s=(0,e.useRef)(b);s.current=b;let t=(0,e.useRef)(c);t.current=c;let u=(0,e.useRef)(r);u.current=r;let v=(0,e.useCallback)((a,b)=>{let c=(0,o.d3)(b);if(c)switch((0,o.dj)(c)){case"anchor":break;case"external":a.preventDefault(),window.open(c,"_blank","noopener,noreferrer");break;case"relative":{a.preventDefault();let b=t.current,d=s.current;if(b&&d){let a=(0,o.WU)(b,c);a&&d(a)}}}},[]),w=(0,e.useMemo)(()=>({code:k.AY,pre:({children:a})=>(0,l.D)(a)?(0,d.jsx)(d.Fragment,{children:a}):(0,d.jsx)(m.Ck,{children:(0,d.jsx)("pre",{className:"overflow-x-auto",children:a})}),img:({src:a,alt:b,width:c,height:e,...f})=>{let g=c??f.node?.properties?.width,h=e??f.node?.properties?.height;if("string"==typeof a&&!a.startsWith("http://")&&!a.startsWith("https://")&&!a.startsWith("data:")){let c=t.current,e=u.current;if(c&&e){let f=(0,o.WU)(c,a);if(f){let a=`/api/worktrees/${e}/files/${(0,p.o)(f)}`;return(0,d.jsx)(n.n,{apiUrl:a,alt:b??"",width:g,height:h})}}}return(0,d.jsx)("img",{src:a,alt:b??"",width:g,height:h,style:{maxWidth:g||"100%"}})},a:({href:a,children:b,...c})=>a?(0,d.jsx)("a",{...c,href:a,onClick:b=>v(b,a),children:b}):(0,d.jsx)("a",{...c,children:b})}),[v]),x=(0,e.useMemo)(()=>[g.A,[h.A,o.uO],i.A,j.A],[]);return(0,d.jsx)(f.oz,{remarkPlugins:q.eT,rehypePlugins:x,components:w,children:a})})},62484:(a,b,c)=>{c.d(b,{i:()=>j});var d=c(21124),e=c(38301),f=c(63156),g=c(58970);function h(){return(0,d.jsx)("svg",{className:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,d.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 i(){return(0,d.jsx)("svg",{className:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})}function j({text:a,className:b="",label:c="Copy"}){let[j,k]=(0,e.useState)(!1),l=(0,e.useRef)(null),m=(0,e.useCallback)(async()=>{try{await (0,f.l)(a),k(!0),l.current&&clearTimeout(l.current),l.current=setTimeout(()=>k(!1),g.s7)}catch{}},[a]);return(0,d.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 ${b}`,"aria-label":j?"Copied":c,title:j?"Copied!":c,children:[j?(0,d.jsx)(i,{}):(0,d.jsx)(h,{}),(0,d.jsx)("span",{children:j?"Copied":c})]})}},81136:(a,b,c)=>{c.d(b,{Co:()=>d,Ms:()=>f,td:()=>e});let d=".agents/skills",e=".claude/skills",f="skills.permissions.declarationOnlyNotice"},85389:(a,b,c)=>{c.d(b,{m:()=>j});var d=c(21124);c(38301);var e=c(20481),f=c(17252),g=c(3805),h=c(27884);function i({axis:a,agentName:b}){let c=(0,e.c)("skills");return(0,d.jsxs)("li",{className:"text-xs text-muted-foreground","data-testid":`skill-agent-axis-${a.axis}`,children:[(0,d.jsx)("span",{className:"font-medium text-foreground",children:c((0,h.e5)(a.axisKey))}),": ",(0,d.jsx)("span",{"data-testid":`skill-agent-axis-${a.axis}-${a.outcome}`,children:c((0,h.e5)(a.outcomeKey))})," — ",c((0,h.e5)(a.evidenceKindKey)),a.limitationKey&&(0,d.jsx)("span",{className:"mt-0.5 block","data-testid":`skill-agent-axis-${a.axis}-limitation`,children:c((0,h.e5)(a.limitationKey),{agent:b})})]})}function j({agent:a,variant:b="full"}){let c=(0,e.c)("skills"),j=(0,f.f_)(a.agent),k=a.measured;return"reload"===b?(0,d.jsx)("li",{className:"text-xs text-muted-foreground","data-testid":`skill-agent-reload-${a.agent}`,children:c((0,h.e5)(a.reloadKey),{agent:j})}):(0,d.jsxs)("div",{className:"space-y-1","data-testid":`skill-agent-evidence-${a.agent}`,children:[(0,d.jsx)("p",{className:"text-xs font-medium text-foreground",children:j}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground break-words",children:c("compatibility.declaredLabel",{support:c((0,h.e5)(a.declaredLabelKey))})}),(0,d.jsxs)("p",{className:"text-xs text-muted-foreground break-words",children:[c("compatibility.evidence"),": ",a.evidence]}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground break-words","data-testid":`skill-agent-verification-${a.agent}`,children:c((0,h.e5)(a.verificationKey))}),k?(0,d.jsxs)("div",{className:"space-y-0.5 border-l-2 border-border pl-2",children:[(0,d.jsx)("p",{className:"text-xs font-medium text-foreground",children:c("compatibility.measuredHeading")}),(0,d.jsxs)("ul",{className:"space-y-0.5",children:[(0,d.jsx)(i,{axis:k.discovery,agentName:j}),(0,d.jsx)(i,{axis:k.invocation,agentName:j})]}),k.testedVersion&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:c("compatibility.testedVersion",{agent:j,version:k.testedVersion})}),k.testedDate&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:c("compatibility.testedDate",{date:k.testedDate})}),k.discoveryRoots.length>0&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground break-all",children:c("compatibility.discoveryRoots",{roots:k.discoveryRoots.join(", ")})}),k.evidenceSource&&(0,d.jsxs)("p",{className:"text-xs text-muted-foreground break-all",children:[c("compatibility.evidenceSource"),": ",k.evidenceSource]}),k.stale&&(0,d.jsx)(g.u,{tone:"warning","data-testid":`skill-agent-evidence-stale-${a.agent}`,children:c("compatibility.evidenceStale",{days:k.ageDays??0})})]}):a.skipReasonKey&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground break-words","data-testid":`skill-agent-skip-reason-${a.agent}`,children:c((0,h.e5)(a.skipReasonKey))}),(0,d.jsxs)("p",{className:"text-xs text-muted-foreground break-words",children:[(0,d.jsx)("span",{className:"font-medium text-foreground",children:c("compatibility.reloadHeading",{agent:j})}),": ",c((0,h.e5)(a.reloadKey),{agent:j})]})]})}}};