@alexjbarnes/cockpit 0.1.1 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (707) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-path-routes-manifest.json +28 -3
  3. package/.next/build-manifest.json +3 -3
  4. package/.next/prerender-manifest.json +147 -3
  5. package/.next/react-loadable-manifest.json +19 -3
  6. package/.next/required-server-files.js +3 -0
  7. package/.next/required-server-files.json +3 -0
  8. package/.next/routes-manifest.json +162 -0
  9. package/.next/server/app/(app)/agents/[name]/page.js +3 -3
  10. package/.next/server/app/(app)/agents/[name]/page.js.nft.json +1 -1
  11. package/.next/server/app/(app)/agents/[name]/page_client-reference-manifest.js +1 -1
  12. package/.next/server/app/(app)/agents/page.js +2 -2
  13. package/.next/server/app/(app)/agents/page.js.nft.json +1 -1
  14. package/.next/server/app/(app)/agents/page_client-reference-manifest.js +1 -1
  15. package/.next/server/app/(app)/changes/page.js +2 -2
  16. package/.next/server/app/(app)/changes/page.js.nft.json +1 -1
  17. package/.next/server/app/(app)/changes/page_client-reference-manifest.js +1 -1
  18. package/.next/server/app/(app)/claude-md/edit/page.js +2 -2
  19. package/.next/server/app/(app)/claude-md/edit/page.js.nft.json +1 -1
  20. package/.next/server/app/(app)/claude-md/edit/page_client-reference-manifest.js +1 -1
  21. package/.next/server/app/(app)/claude-md/page.js +2 -2
  22. package/.next/server/app/(app)/claude-md/page.js.nft.json +1 -1
  23. package/.next/server/app/(app)/claude-md/page_client-reference-manifest.js +1 -1
  24. package/.next/server/app/(app)/commands/[name]/page.js +3 -3
  25. package/.next/server/app/(app)/commands/[name]/page.js.nft.json +1 -1
  26. package/.next/server/app/(app)/commands/[name]/page_client-reference-manifest.js +1 -1
  27. package/.next/server/app/(app)/commands/page.js +2 -2
  28. package/.next/server/app/(app)/commands/page.js.nft.json +1 -1
  29. package/.next/server/app/(app)/commands/page_client-reference-manifest.js +1 -1
  30. package/.next/server/app/(app)/files/page.js +2 -2
  31. package/.next/server/app/(app)/files/page.js.nft.json +1 -1
  32. package/.next/server/app/(app)/files/page_client-reference-manifest.js +1 -1
  33. package/.next/server/app/(app)/hooks/[event]/page.js +3 -3
  34. package/.next/server/app/(app)/hooks/[event]/page.js.nft.json +1 -1
  35. package/.next/server/app/(app)/hooks/[event]/page_client-reference-manifest.js +1 -1
  36. package/.next/server/app/(app)/hooks/page.js +2 -2
  37. package/.next/server/app/(app)/hooks/page.js.nft.json +1 -1
  38. package/.next/server/app/(app)/hooks/page_client-reference-manifest.js +1 -1
  39. package/.next/server/app/(app)/inbox/[id]/page.js +2 -0
  40. package/.next/server/app/(app)/inbox/[id]/page.js.nft.json +1 -0
  41. package/.next/server/app/(app)/inbox/[id]/page_client-reference-manifest.js +1 -0
  42. package/.next/server/app/(app)/inbox/page.js +2 -0
  43. package/.next/server/app/(app)/inbox/page.js.nft.json +1 -0
  44. package/.next/server/app/(app)/inbox/page_client-reference-manifest.js +1 -0
  45. package/.next/server/app/(app)/jobs/[id]/edit/page.js +2 -2
  46. package/.next/server/app/(app)/jobs/[id]/edit/page.js.nft.json +1 -1
  47. package/.next/server/app/(app)/jobs/[id]/edit/page_client-reference-manifest.js +1 -1
  48. package/.next/server/app/(app)/jobs/[id]/page.js +2 -2
  49. package/.next/server/app/(app)/jobs/[id]/page.js.nft.json +1 -1
  50. package/.next/server/app/(app)/jobs/[id]/page_client-reference-manifest.js +1 -1
  51. package/.next/server/app/(app)/jobs/[id]/runs/[runId]/page.js +2 -2
  52. package/.next/server/app/(app)/jobs/[id]/runs/[runId]/page.js.nft.json +1 -1
  53. package/.next/server/app/(app)/jobs/[id]/runs/[runId]/page_client-reference-manifest.js +1 -1
  54. package/.next/server/app/(app)/jobs/page.js +2 -2
  55. package/.next/server/app/(app)/jobs/page.js.nft.json +1 -1
  56. package/.next/server/app/(app)/jobs/page_client-reference-manifest.js +1 -1
  57. package/.next/server/app/(app)/mcp-servers/[name]/page.js +2 -2
  58. package/.next/server/app/(app)/mcp-servers/[name]/page.js.nft.json +1 -1
  59. package/.next/server/app/(app)/mcp-servers/[name]/page_client-reference-manifest.js +1 -1
  60. package/.next/server/app/(app)/mcp-servers/page.js +2 -2
  61. package/.next/server/app/(app)/mcp-servers/page.js.nft.json +1 -1
  62. package/.next/server/app/(app)/mcp-servers/page_client-reference-manifest.js +1 -1
  63. package/.next/server/app/(app)/page.js +2 -2
  64. package/.next/server/app/(app)/page.js.nft.json +1 -1
  65. package/.next/server/app/(app)/page_client-reference-manifest.js +1 -1
  66. package/.next/server/app/(app)/reviews/[owner]/[repo]/[number]/page.js +6 -6
  67. package/.next/server/app/(app)/reviews/[owner]/[repo]/[number]/page.js.nft.json +1 -1
  68. package/.next/server/app/(app)/reviews/[owner]/[repo]/[number]/page_client-reference-manifest.js +1 -1
  69. package/.next/server/app/(app)/reviews/[owner]/[repo]/page.js +2 -2
  70. package/.next/server/app/(app)/reviews/[owner]/[repo]/page.js.nft.json +1 -1
  71. package/.next/server/app/(app)/reviews/[owner]/[repo]/page_client-reference-manifest.js +1 -1
  72. package/.next/server/app/(app)/reviews/page.js +2 -2
  73. package/.next/server/app/(app)/reviews/page.js.nft.json +1 -1
  74. package/.next/server/app/(app)/reviews/page_client-reference-manifest.js +1 -1
  75. package/.next/server/app/(app)/sessions/[id]/page.js +2 -2
  76. package/.next/server/app/(app)/sessions/[id]/page.js.nft.json +1 -1
  77. package/.next/server/app/(app)/sessions/[id]/page_client-reference-manifest.js +1 -1
  78. package/.next/server/app/(app)/settings/appearance/page.js +2 -0
  79. package/.next/server/app/(app)/settings/appearance/page.js.nft.json +1 -0
  80. package/.next/server/app/(app)/settings/appearance/page_client-reference-manifest.js +1 -0
  81. package/.next/server/app/(app)/settings/notifications/page.js +2 -0
  82. package/.next/server/app/(app)/settings/notifications/page.js.nft.json +1 -0
  83. package/.next/server/app/(app)/settings/notifications/page_client-reference-manifest.js +1 -0
  84. package/.next/server/app/(app)/settings/page.js +2 -2
  85. package/.next/server/app/(app)/settings/page.js.nft.json +1 -1
  86. package/.next/server/app/(app)/settings/page_client-reference-manifest.js +1 -1
  87. package/.next/server/app/(app)/settings/providers/[id]/page.js +2 -0
  88. package/.next/server/app/(app)/settings/providers/[id]/page.js.nft.json +1 -0
  89. package/.next/server/app/(app)/settings/providers/[id]/page_client-reference-manifest.js +1 -0
  90. package/.next/server/app/(app)/settings/providers/new/page.js +2 -0
  91. package/.next/server/app/(app)/settings/providers/new/page.js.nft.json +1 -0
  92. package/.next/server/app/(app)/settings/providers/new/page_client-reference-manifest.js +1 -0
  93. package/.next/server/app/(app)/settings/providers/page.js +2 -0
  94. package/.next/server/app/(app)/settings/providers/page.js.nft.json +1 -0
  95. package/.next/server/app/(app)/settings/providers/page_client-reference-manifest.js +1 -0
  96. package/.next/server/app/(app)/settings/session/page.js +2 -0
  97. package/.next/server/app/(app)/settings/session/page.js.nft.json +1 -0
  98. package/.next/server/app/(app)/settings/session/page_client-reference-manifest.js +1 -0
  99. package/.next/server/app/(app)/skills/[name]/page.js +3 -3
  100. package/.next/server/app/(app)/skills/[name]/page.js.nft.json +1 -1
  101. package/.next/server/app/(app)/skills/[name]/page_client-reference-manifest.js +1 -1
  102. package/.next/server/app/(app)/skills/page.js +2 -2
  103. package/.next/server/app/(app)/skills/page.js.nft.json +1 -1
  104. package/.next/server/app/(app)/skills/page_client-reference-manifest.js +1 -1
  105. package/.next/server/app/_global-error/page.js +3 -3
  106. package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  107. package/.next/server/app/_global-error.html +1 -1
  108. package/.next/server/app/_global-error.rsc +1 -1
  109. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  110. package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  111. package/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  112. package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  113. package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  114. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  115. package/.next/server/app/_not-found/page.js +2 -2
  116. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  117. package/.next/server/app/_not-found.html +1 -1
  118. package/.next/server/app/_not-found.rsc +2 -2
  119. package/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
  120. package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  121. package/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
  122. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  123. package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  124. package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  125. package/.next/server/app/agents.html +1 -1
  126. package/.next/server/app/agents.rsc +4 -4
  127. package/.next/server/app/agents.segments/!KGFwcCk/agents/__PAGE__.segment.rsc +2 -2
  128. package/.next/server/app/agents.segments/!KGFwcCk/agents.segment.rsc +1 -1
  129. package/.next/server/app/agents.segments/!KGFwcCk.segment.rsc +2 -2
  130. package/.next/server/app/agents.segments/_full.segment.rsc +4 -4
  131. package/.next/server/app/agents.segments/_head.segment.rsc +1 -1
  132. package/.next/server/app/agents.segments/_index.segment.rsc +2 -2
  133. package/.next/server/app/agents.segments/_tree.segment.rsc +2 -2
  134. package/.next/server/app/api/agents/[name]/route.js +1 -1
  135. package/.next/server/app/api/agents/route.js +1 -1
  136. package/.next/server/app/api/auth/check/route.js +1 -1
  137. package/.next/server/app/api/auth/login/route.js +1 -1
  138. package/.next/server/app/api/auth/setup/route.js +1 -1
  139. package/.next/server/app/api/auth/ws-token/route.js +1 -1
  140. package/.next/server/app/api/btw/route.js +2 -2
  141. package/.next/server/app/api/claude-md/route.js +1 -1
  142. package/.next/server/app/api/commands/[name]/route.js +1 -1
  143. package/.next/server/app/api/commands/route.js +1 -1
  144. package/.next/server/app/api/defaults/route.js +1 -1
  145. package/.next/server/app/api/filesystem/browse/route.js +1 -1
  146. package/.next/server/app/api/filesystem/files/route.js +1 -1
  147. package/.next/server/app/api/filesystem/mkdir/route.js +1 -1
  148. package/.next/server/app/api/filesystem/read/route.js +1 -1
  149. package/.next/server/app/api/git/clone/route.js +1 -1
  150. package/.next/server/app/api/git/commit/route.js +1 -1
  151. package/.next/server/app/api/git/diff/route.js +1 -1
  152. package/.next/server/app/api/git/discard/route.js +1 -1
  153. package/.next/server/app/api/git/generate-message/route.js +2 -2
  154. package/.next/server/app/api/git/push/route.js +1 -1
  155. package/.next/server/app/api/git/status/route.js +1 -1
  156. package/.next/server/app/api/github/file-content/route.js +1 -1
  157. package/.next/server/app/api/github/orgs/route.js +1 -1
  158. package/.next/server/app/api/github/prs/checks/route.js +1 -1
  159. package/.next/server/app/api/github/prs/diff/route.js +1 -1
  160. package/.next/server/app/api/github/prs/review/route.js +1 -1
  161. package/.next/server/app/api/github/prs/route.js +1 -1
  162. package/.next/server/app/api/github/prs/view/route.js +1 -1
  163. package/.next/server/app/api/github/repos/route.js +1 -1
  164. package/.next/server/app/api/github/review-session/route.js +1 -1
  165. package/.next/server/app/api/github/review-session/route.js.nft.json +1 -1
  166. package/.next/server/app/api/health/route.js +1 -1
  167. package/.next/server/app/api/hooks/route.js +1 -1
  168. package/.next/server/app/api/inbox/[id]/route.js +5 -0
  169. package/.next/server/app/api/inbox/[id]/route.js.nft.json +1 -0
  170. package/.next/server/app/api/inbox/[id]/route_client-reference-manifest.js +1 -0
  171. package/.next/server/app/api/inbox/route.js +5 -0
  172. package/.next/server/app/api/inbox/route.js.nft.json +1 -0
  173. package/.next/server/app/api/inbox/route_client-reference-manifest.js +1 -0
  174. package/.next/server/app/api/jobs/[id]/route.js +1 -1
  175. package/.next/server/app/api/jobs/[id]/route.js.nft.json +1 -1
  176. package/.next/server/app/api/jobs/[id]/runs/[runId]/route.js +1 -1
  177. package/.next/server/app/api/jobs/[id]/runs/[runId]/transcript/route.js +1 -1
  178. package/.next/server/app/api/jobs/[id]/runs/route.js +1 -1
  179. package/.next/server/app/api/jobs/[id]/trigger/route.js +1 -1
  180. package/.next/server/app/api/jobs/[id]/trigger/route.js.nft.json +1 -1
  181. package/.next/server/app/api/jobs/mcp-discover/route.js +1 -1
  182. package/.next/server/app/api/jobs/mcp-discover/route.js.nft.json +1 -1
  183. package/.next/server/app/api/jobs/route.js +1 -1
  184. package/.next/server/app/api/jobs/route.js.nft.json +1 -1
  185. package/.next/server/app/api/jobs/status/route.js +1 -1
  186. package/.next/server/app/api/mcp-servers/[name]/route.js +1 -1
  187. package/.next/server/app/api/mcp-servers/[name]/test/route.js +1 -1
  188. package/.next/server/app/api/mcp-servers/route.js +1 -1
  189. package/.next/server/app/api/notifications/route.js +1 -0
  190. package/.next/server/app/api/notifications/route.js.nft.json +1 -0
  191. package/.next/server/app/api/notifications/route_client-reference-manifest.js +1 -0
  192. package/.next/server/app/api/notifications/test/route.js +5 -0
  193. package/.next/server/app/api/notifications/test/route.js.nft.json +1 -0
  194. package/.next/server/app/api/notifications/test/route_client-reference-manifest.js +1 -0
  195. package/.next/server/app/api/providers/[id]/route.js +1 -0
  196. package/.next/server/app/api/providers/[id]/route.js.nft.json +1 -0
  197. package/.next/server/app/api/providers/[id]/route_client-reference-manifest.js +1 -0
  198. package/.next/server/app/api/providers/route.js +1 -0
  199. package/.next/server/app/api/providers/route.js.nft.json +1 -0
  200. package/.next/server/app/api/providers/route_client-reference-manifest.js +1 -0
  201. package/.next/server/app/api/reviews/pinned/route.js +1 -0
  202. package/.next/server/app/api/reviews/pinned/route.js.nft.json +1 -0
  203. package/.next/server/app/api/reviews/pinned/route_client-reference-manifest.js +1 -0
  204. package/.next/server/app/api/sessions/[id]/context/route.js +1 -1
  205. package/.next/server/app/api/sessions/[id]/mcp/route.js +1 -1
  206. package/.next/server/app/api/sessions/[id]/mcp/route.js.nft.json +1 -1
  207. package/.next/server/app/api/sessions/[id]/route.js +1 -1
  208. package/.next/server/app/api/sessions/[id]/route.js.nft.json +1 -1
  209. package/.next/server/app/api/sessions/[id]/search/route.js +1 -1
  210. package/.next/server/app/api/sessions/[id]/tabs/route.js +1 -0
  211. package/.next/server/app/api/sessions/[id]/tabs/route.js.nft.json +1 -0
  212. package/.next/server/app/api/sessions/[id]/tabs/route_client-reference-manifest.js +1 -0
  213. package/.next/server/app/api/sessions/bulk-delete/route.js +1 -0
  214. package/.next/server/app/api/sessions/bulk-delete/route.js.nft.json +1 -0
  215. package/.next/server/app/api/sessions/bulk-delete/route_client-reference-manifest.js +1 -0
  216. package/.next/server/app/api/sessions/by-ids/route.js +1 -0
  217. package/.next/server/app/api/sessions/by-ids/route.js.nft.json +1 -0
  218. package/.next/server/app/api/sessions/by-ids/route_client-reference-manifest.js +1 -0
  219. package/.next/server/app/api/sessions/group/route.js +1 -0
  220. package/.next/server/app/api/sessions/group/route.js.nft.json +1 -0
  221. package/.next/server/app/api/sessions/group/route_client-reference-manifest.js +1 -0
  222. package/.next/server/app/api/sessions/pinned/route.js +1 -1
  223. package/.next/server/app/api/sessions/route.js +1 -1
  224. package/.next/server/app/api/sessions/route.js.nft.json +1 -1
  225. package/.next/server/app/api/sessions/search/route.js +1 -0
  226. package/.next/server/app/api/sessions/search/route.js.nft.json +1 -0
  227. package/.next/server/app/api/sessions/search/route_client-reference-manifest.js +1 -0
  228. package/.next/server/app/api/sessions/thinking/route.js +1 -0
  229. package/.next/server/app/api/sessions/thinking/route.js.nft.json +1 -0
  230. package/.next/server/app/api/sessions/thinking/route_client-reference-manifest.js +1 -0
  231. package/.next/server/app/api/skills/[name]/route.js +1 -1
  232. package/.next/server/app/api/skills/route.js +1 -1
  233. package/.next/server/app/api/terminal/[id]/route.js +1 -0
  234. package/.next/server/app/api/terminal/[id]/route.js.nft.json +1 -0
  235. package/.next/server/app/api/terminal/[id]/route_client-reference-manifest.js +1 -0
  236. package/.next/server/app/api/terminal/route.js +1 -0
  237. package/.next/server/app/api/terminal/route.js.nft.json +1 -0
  238. package/.next/server/app/api/terminal/route_client-reference-manifest.js +1 -0
  239. package/.next/server/app/api/usage/route.js +1 -1
  240. package/.next/server/app/api/version/changelog/route.js +1 -0
  241. package/.next/server/app/api/version/changelog/route.js.nft.json +1 -0
  242. package/.next/server/app/api/version/changelog/route_client-reference-manifest.js +1 -0
  243. package/.next/server/app/api/version/cockpit/changelog/route.js +1 -0
  244. package/.next/server/app/api/version/cockpit/changelog/route.js.nft.json +1 -0
  245. package/.next/server/app/api/version/cockpit/changelog/route_client-reference-manifest.js +1 -0
  246. package/.next/server/app/api/version/cockpit/route.js +1 -1
  247. package/.next/server/app/api/version/route.js +2 -2
  248. package/.next/server/app/changes.html +1 -1
  249. package/.next/server/app/changes.rsc +4 -4
  250. package/.next/server/app/changes.segments/!KGFwcCk/changes/__PAGE__.segment.rsc +2 -2
  251. package/.next/server/app/changes.segments/!KGFwcCk/changes.segment.rsc +1 -1
  252. package/.next/server/app/changes.segments/!KGFwcCk.segment.rsc +2 -2
  253. package/.next/server/app/changes.segments/_full.segment.rsc +4 -4
  254. package/.next/server/app/changes.segments/_head.segment.rsc +1 -1
  255. package/.next/server/app/changes.segments/_index.segment.rsc +2 -2
  256. package/.next/server/app/changes.segments/_tree.segment.rsc +2 -2
  257. package/.next/server/app/claude-md/edit.html +1 -1
  258. package/.next/server/app/claude-md/edit.rsc +4 -4
  259. package/.next/server/app/claude-md/edit.segments/!KGFwcCk/claude-md/edit/__PAGE__.segment.rsc +2 -2
  260. package/.next/server/app/claude-md/edit.segments/!KGFwcCk/claude-md/edit.segment.rsc +1 -1
  261. package/.next/server/app/claude-md/edit.segments/!KGFwcCk/claude-md.segment.rsc +1 -1
  262. package/.next/server/app/claude-md/edit.segments/!KGFwcCk.segment.rsc +2 -2
  263. package/.next/server/app/claude-md/edit.segments/_full.segment.rsc +4 -4
  264. package/.next/server/app/claude-md/edit.segments/_head.segment.rsc +1 -1
  265. package/.next/server/app/claude-md/edit.segments/_index.segment.rsc +2 -2
  266. package/.next/server/app/claude-md/edit.segments/_tree.segment.rsc +2 -2
  267. package/.next/server/app/claude-md.html +1 -1
  268. package/.next/server/app/claude-md.rsc +4 -4
  269. package/.next/server/app/claude-md.segments/!KGFwcCk/claude-md/__PAGE__.segment.rsc +2 -2
  270. package/.next/server/app/claude-md.segments/!KGFwcCk/claude-md.segment.rsc +1 -1
  271. package/.next/server/app/claude-md.segments/!KGFwcCk.segment.rsc +2 -2
  272. package/.next/server/app/claude-md.segments/_full.segment.rsc +4 -4
  273. package/.next/server/app/claude-md.segments/_head.segment.rsc +1 -1
  274. package/.next/server/app/claude-md.segments/_index.segment.rsc +2 -2
  275. package/.next/server/app/claude-md.segments/_tree.segment.rsc +2 -2
  276. package/.next/server/app/commands.html +1 -1
  277. package/.next/server/app/commands.rsc +4 -4
  278. package/.next/server/app/commands.segments/!KGFwcCk/commands/__PAGE__.segment.rsc +2 -2
  279. package/.next/server/app/commands.segments/!KGFwcCk/commands.segment.rsc +1 -1
  280. package/.next/server/app/commands.segments/!KGFwcCk.segment.rsc +2 -2
  281. package/.next/server/app/commands.segments/_full.segment.rsc +4 -4
  282. package/.next/server/app/commands.segments/_head.segment.rsc +1 -1
  283. package/.next/server/app/commands.segments/_index.segment.rsc +2 -2
  284. package/.next/server/app/commands.segments/_tree.segment.rsc +2 -2
  285. package/.next/server/app/files.html +1 -1
  286. package/.next/server/app/files.rsc +4 -4
  287. package/.next/server/app/files.segments/!KGFwcCk/files/__PAGE__.segment.rsc +2 -2
  288. package/.next/server/app/files.segments/!KGFwcCk/files.segment.rsc +1 -1
  289. package/.next/server/app/files.segments/!KGFwcCk.segment.rsc +2 -2
  290. package/.next/server/app/files.segments/_full.segment.rsc +4 -4
  291. package/.next/server/app/files.segments/_head.segment.rsc +1 -1
  292. package/.next/server/app/files.segments/_index.segment.rsc +2 -2
  293. package/.next/server/app/files.segments/_tree.segment.rsc +2 -2
  294. package/.next/server/app/hooks.html +1 -1
  295. package/.next/server/app/hooks.rsc +4 -4
  296. package/.next/server/app/hooks.segments/!KGFwcCk/hooks/__PAGE__.segment.rsc +2 -2
  297. package/.next/server/app/hooks.segments/!KGFwcCk/hooks.segment.rsc +1 -1
  298. package/.next/server/app/hooks.segments/!KGFwcCk.segment.rsc +2 -2
  299. package/.next/server/app/hooks.segments/_full.segment.rsc +4 -4
  300. package/.next/server/app/hooks.segments/_head.segment.rsc +1 -1
  301. package/.next/server/app/hooks.segments/_index.segment.rsc +2 -2
  302. package/.next/server/app/hooks.segments/_tree.segment.rsc +2 -2
  303. package/.next/server/app/inbox.html +1 -0
  304. package/.next/server/app/inbox.meta +16 -0
  305. package/.next/server/app/inbox.rsc +23 -0
  306. package/.next/server/app/inbox.segments/!KGFwcCk/inbox/__PAGE__.segment.rsc +9 -0
  307. package/.next/server/app/inbox.segments/!KGFwcCk/inbox.segment.rsc +5 -0
  308. package/.next/server/app/inbox.segments/!KGFwcCk.segment.rsc +7 -0
  309. package/.next/server/app/inbox.segments/_full.segment.rsc +23 -0
  310. package/.next/server/app/inbox.segments/_head.segment.rsc +6 -0
  311. package/.next/server/app/inbox.segments/_index.segment.rsc +5 -0
  312. package/.next/server/app/inbox.segments/_tree.segment.rsc +2 -0
  313. package/.next/server/app/index.html +1 -1
  314. package/.next/server/app/index.rsc +4 -4
  315. package/.next/server/app/index.segments/!KGFwcCk/__PAGE__.segment.rsc +2 -2
  316. package/.next/server/app/index.segments/!KGFwcCk.segment.rsc +2 -2
  317. package/.next/server/app/index.segments/_full.segment.rsc +4 -4
  318. package/.next/server/app/index.segments/_head.segment.rsc +1 -1
  319. package/.next/server/app/index.segments/_index.segment.rsc +2 -2
  320. package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  321. package/.next/server/app/jobs.html +1 -1
  322. package/.next/server/app/jobs.rsc +4 -4
  323. package/.next/server/app/jobs.segments/!KGFwcCk/jobs/__PAGE__.segment.rsc +2 -2
  324. package/.next/server/app/jobs.segments/!KGFwcCk/jobs.segment.rsc +1 -1
  325. package/.next/server/app/jobs.segments/!KGFwcCk.segment.rsc +2 -2
  326. package/.next/server/app/jobs.segments/_full.segment.rsc +4 -4
  327. package/.next/server/app/jobs.segments/_head.segment.rsc +1 -1
  328. package/.next/server/app/jobs.segments/_index.segment.rsc +2 -2
  329. package/.next/server/app/jobs.segments/_tree.segment.rsc +2 -2
  330. package/.next/server/app/login/page.js +2 -2
  331. package/.next/server/app/login/page_client-reference-manifest.js +1 -1
  332. package/.next/server/app/login.html +1 -1
  333. package/.next/server/app/login.rsc +2 -2
  334. package/.next/server/app/login.segments/_full.segment.rsc +2 -2
  335. package/.next/server/app/login.segments/_head.segment.rsc +1 -1
  336. package/.next/server/app/login.segments/_index.segment.rsc +2 -2
  337. package/.next/server/app/login.segments/_tree.segment.rsc +2 -2
  338. package/.next/server/app/login.segments/login/__PAGE__.segment.rsc +1 -1
  339. package/.next/server/app/login.segments/login.segment.rsc +1 -1
  340. package/.next/server/app/mcp-servers.html +1 -1
  341. package/.next/server/app/mcp-servers.rsc +4 -4
  342. package/.next/server/app/mcp-servers.segments/!KGFwcCk/mcp-servers/__PAGE__.segment.rsc +2 -2
  343. package/.next/server/app/mcp-servers.segments/!KGFwcCk/mcp-servers.segment.rsc +1 -1
  344. package/.next/server/app/mcp-servers.segments/!KGFwcCk.segment.rsc +2 -2
  345. package/.next/server/app/mcp-servers.segments/_full.segment.rsc +4 -4
  346. package/.next/server/app/mcp-servers.segments/_head.segment.rsc +1 -1
  347. package/.next/server/app/mcp-servers.segments/_index.segment.rsc +2 -2
  348. package/.next/server/app/mcp-servers.segments/_tree.segment.rsc +2 -2
  349. package/.next/server/app/reviews.html +1 -1
  350. package/.next/server/app/reviews.rsc +4 -4
  351. package/.next/server/app/reviews.segments/!KGFwcCk/reviews/__PAGE__.segment.rsc +2 -2
  352. package/.next/server/app/reviews.segments/!KGFwcCk/reviews.segment.rsc +1 -1
  353. package/.next/server/app/reviews.segments/!KGFwcCk.segment.rsc +2 -2
  354. package/.next/server/app/reviews.segments/_full.segment.rsc +4 -4
  355. package/.next/server/app/reviews.segments/_head.segment.rsc +1 -1
  356. package/.next/server/app/reviews.segments/_index.segment.rsc +2 -2
  357. package/.next/server/app/reviews.segments/_tree.segment.rsc +2 -2
  358. package/.next/server/app/settings/appearance.html +1 -0
  359. package/.next/server/app/settings/appearance.meta +17 -0
  360. package/.next/server/app/settings/appearance.rsc +23 -0
  361. package/.next/server/app/settings/appearance.segments/!KGFwcCk/settings/appearance/__PAGE__.segment.rsc +9 -0
  362. package/.next/server/app/settings/appearance.segments/!KGFwcCk/settings/appearance.segment.rsc +5 -0
  363. package/.next/server/app/settings/appearance.segments/!KGFwcCk/settings.segment.rsc +5 -0
  364. package/.next/server/app/settings/appearance.segments/!KGFwcCk.segment.rsc +7 -0
  365. package/.next/server/app/settings/appearance.segments/_full.segment.rsc +23 -0
  366. package/.next/server/app/settings/appearance.segments/_head.segment.rsc +6 -0
  367. package/.next/server/app/settings/appearance.segments/_index.segment.rsc +5 -0
  368. package/.next/server/app/settings/appearance.segments/_tree.segment.rsc +2 -0
  369. package/.next/server/app/settings/notifications.html +1 -0
  370. package/.next/server/app/settings/notifications.meta +17 -0
  371. package/.next/server/app/settings/notifications.rsc +23 -0
  372. package/.next/server/app/settings/notifications.segments/!KGFwcCk/settings/notifications/__PAGE__.segment.rsc +9 -0
  373. package/.next/server/app/settings/notifications.segments/!KGFwcCk/settings/notifications.segment.rsc +5 -0
  374. package/.next/server/app/settings/notifications.segments/!KGFwcCk/settings.segment.rsc +5 -0
  375. package/.next/server/app/settings/notifications.segments/!KGFwcCk.segment.rsc +7 -0
  376. package/.next/server/app/settings/notifications.segments/_full.segment.rsc +23 -0
  377. package/.next/server/app/settings/notifications.segments/_head.segment.rsc +6 -0
  378. package/.next/server/app/settings/notifications.segments/_index.segment.rsc +5 -0
  379. package/.next/server/app/settings/notifications.segments/_tree.segment.rsc +2 -0
  380. package/.next/server/app/settings/providers/new.html +1 -0
  381. package/.next/server/app/settings/providers/new.meta +18 -0
  382. package/.next/server/app/settings/providers/new.rsc +23 -0
  383. package/.next/server/app/settings/providers/new.segments/!KGFwcCk/settings/providers/new/__PAGE__.segment.rsc +9 -0
  384. package/.next/server/app/settings/providers/new.segments/!KGFwcCk/settings/providers/new.segment.rsc +5 -0
  385. package/.next/server/app/settings/providers/new.segments/!KGFwcCk/settings/providers.segment.rsc +5 -0
  386. package/.next/server/app/settings/providers/new.segments/!KGFwcCk/settings.segment.rsc +5 -0
  387. package/.next/server/app/settings/providers/new.segments/!KGFwcCk.segment.rsc +7 -0
  388. package/.next/server/app/settings/providers/new.segments/_full.segment.rsc +23 -0
  389. package/.next/server/app/settings/providers/new.segments/_head.segment.rsc +6 -0
  390. package/.next/server/app/settings/providers/new.segments/_index.segment.rsc +5 -0
  391. package/.next/server/app/settings/providers/new.segments/_tree.segment.rsc +2 -0
  392. package/.next/server/app/settings/providers.html +1 -0
  393. package/.next/server/app/settings/providers.meta +17 -0
  394. package/.next/server/app/settings/providers.rsc +23 -0
  395. package/.next/server/app/settings/providers.segments/!KGFwcCk/settings/providers/__PAGE__.segment.rsc +9 -0
  396. package/.next/server/app/settings/providers.segments/!KGFwcCk/settings/providers.segment.rsc +5 -0
  397. package/.next/server/app/settings/providers.segments/!KGFwcCk/settings.segment.rsc +5 -0
  398. package/.next/server/app/settings/providers.segments/!KGFwcCk.segment.rsc +7 -0
  399. package/.next/server/app/settings/providers.segments/_full.segment.rsc +23 -0
  400. package/.next/server/app/settings/providers.segments/_head.segment.rsc +6 -0
  401. package/.next/server/app/settings/providers.segments/_index.segment.rsc +5 -0
  402. package/.next/server/app/settings/providers.segments/_tree.segment.rsc +2 -0
  403. package/.next/server/app/settings/session.html +1 -0
  404. package/.next/server/app/settings/session.meta +17 -0
  405. package/.next/server/app/settings/session.rsc +23 -0
  406. package/.next/server/app/settings/session.segments/!KGFwcCk/settings/session/__PAGE__.segment.rsc +9 -0
  407. package/.next/server/app/settings/session.segments/!KGFwcCk/settings/session.segment.rsc +5 -0
  408. package/.next/server/app/settings/session.segments/!KGFwcCk/settings.segment.rsc +5 -0
  409. package/.next/server/app/settings/session.segments/!KGFwcCk.segment.rsc +7 -0
  410. package/.next/server/app/settings/session.segments/_full.segment.rsc +23 -0
  411. package/.next/server/app/settings/session.segments/_head.segment.rsc +6 -0
  412. package/.next/server/app/settings/session.segments/_index.segment.rsc +5 -0
  413. package/.next/server/app/settings/session.segments/_tree.segment.rsc +2 -0
  414. package/.next/server/app/settings.html +1 -1
  415. package/.next/server/app/settings.rsc +4 -4
  416. package/.next/server/app/settings.segments/!KGFwcCk/settings/__PAGE__.segment.rsc +2 -2
  417. package/.next/server/app/settings.segments/!KGFwcCk/settings.segment.rsc +1 -1
  418. package/.next/server/app/settings.segments/!KGFwcCk.segment.rsc +2 -2
  419. package/.next/server/app/settings.segments/_full.segment.rsc +4 -4
  420. package/.next/server/app/settings.segments/_head.segment.rsc +1 -1
  421. package/.next/server/app/settings.segments/_index.segment.rsc +2 -2
  422. package/.next/server/app/settings.segments/_tree.segment.rsc +2 -2
  423. package/.next/server/app/skills.html +1 -1
  424. package/.next/server/app/skills.rsc +4 -4
  425. package/.next/server/app/skills.segments/!KGFwcCk/skills/__PAGE__.segment.rsc +2 -2
  426. package/.next/server/app/skills.segments/!KGFwcCk/skills.segment.rsc +1 -1
  427. package/.next/server/app/skills.segments/!KGFwcCk.segment.rsc +2 -2
  428. package/.next/server/app/skills.segments/_full.segment.rsc +4 -4
  429. package/.next/server/app/skills.segments/_head.segment.rsc +1 -1
  430. package/.next/server/app/skills.segments/_index.segment.rsc +2 -2
  431. package/.next/server/app/skills.segments/_tree.segment.rsc +2 -2
  432. package/.next/server/app-paths-manifest.json +28 -3
  433. package/.next/server/chunks/1002.js +18 -0
  434. package/.next/server/chunks/1011.js +1 -0
  435. package/.next/server/chunks/1979.js +2 -2
  436. package/.next/server/chunks/{9012.js → 3006.js} +3 -3
  437. package/.next/server/chunks/3108.js +1 -0
  438. package/.next/server/chunks/3434.js +1 -0
  439. package/.next/server/chunks/{6142.js → 4342.js} +1 -1
  440. package/.next/server/chunks/4352.js +1 -0
  441. package/.next/server/chunks/4445.js +1 -1
  442. package/.next/server/chunks/5965.js +1 -1
  443. package/.next/server/chunks/7782.js +6 -0
  444. package/.next/server/chunks/8148.js +1 -0
  445. package/.next/server/chunks/9599.js +11 -0
  446. package/.next/server/middleware-build-manifest.js +1 -1
  447. package/.next/server/middleware-react-loadable-manifest.js +1 -1
  448. package/.next/server/pages/404.html +1 -1
  449. package/.next/server/pages/500.html +1 -1
  450. package/.next/server/server-reference-manifest.json +1 -1
  451. package/.next/static/chunks/{35922.5bdf78a760129504.js → 13541.056c34ca7fde6869.js} +1 -1
  452. package/.next/static/chunks/26126-97874904b42befb8.js +1 -0
  453. package/.next/static/chunks/{22086-756d490e3320ad15.js → 31010-6e87f77b97544424.js} +1 -1
  454. package/.next/static/chunks/3765-d323c6675307a63e.js +20 -0
  455. package/.next/static/chunks/41487-d802643f4a8fad3c.js +199 -0
  456. package/.next/static/chunks/48273-bbd15bac6733dfc4.js +6 -0
  457. package/.next/static/chunks/{80392.bca860d8b5972706.js → 58011.3de5770e8b0d8759.js} +1 -1
  458. package/.next/static/chunks/63606.a387b0261d6523ab.js +1 -0
  459. package/.next/static/chunks/6935-f436a624267529fb.js +1 -0
  460. package/.next/static/chunks/{69427.755a0a4013596f7a.js → 69427.a0b463c808aa54c8.js} +1 -1
  461. package/.next/static/chunks/86939-dfc6f8eb395caa89.js +1 -0
  462. package/.next/static/chunks/app/(app)/agents/[name]/page-8bdd0359043537d4.js +8 -0
  463. package/.next/static/chunks/app/(app)/agents/page-6fcfd7ab6781814e.js +1 -0
  464. package/.next/static/chunks/app/(app)/changes/page-4549a5bd72d77e3e.js +1 -0
  465. package/.next/static/chunks/app/(app)/claude-md/edit/page-08e6e120e71979f4.js +1 -0
  466. package/.next/static/chunks/app/(app)/claude-md/page-cd9e2176a12ba241.js +1 -0
  467. package/.next/static/chunks/app/(app)/commands/[name]/page-7cdfdef29ded0aa0.js +6 -0
  468. package/.next/static/chunks/app/(app)/commands/page-f126b608b04747ac.js +1 -0
  469. package/.next/static/chunks/app/(app)/files/page-f526eb95821e000e.js +1 -0
  470. package/.next/static/chunks/app/(app)/hooks/[event]/page-28038323fd29adfa.js +6 -0
  471. package/.next/static/chunks/app/(app)/hooks/page-f1f39284e53c0344.js +1 -0
  472. package/.next/static/chunks/app/(app)/inbox/[id]/page-bc1ff3a0db0114a4.js +1 -0
  473. package/.next/static/chunks/app/(app)/inbox/page-82e03870103ce9bd.js +1 -0
  474. package/.next/static/chunks/app/(app)/jobs/[id]/edit/page-7fb788f772ff2129.js +1 -0
  475. package/.next/static/chunks/app/(app)/jobs/[id]/page-a5856b9ae967ff59.js +1 -0
  476. package/.next/static/chunks/app/(app)/jobs/[id]/runs/[runId]/page-b7c513402db11db6.js +1 -0
  477. package/.next/static/chunks/app/(app)/jobs/page-e9bbd6c116b9699f.js +1 -0
  478. package/.next/static/chunks/app/(app)/layout-ce9e1be301c60fe5.js +1 -0
  479. package/.next/static/chunks/app/(app)/mcp-servers/[name]/page-d6d805a27ec0b0c0.js +1 -0
  480. package/.next/static/chunks/app/(app)/mcp-servers/page-4b7276d43451cd43.js +1 -0
  481. package/.next/static/chunks/app/(app)/page-027a5382da30ddb9.js +1 -0
  482. package/.next/static/chunks/app/(app)/reviews/[owner]/[repo]/[number]/page-9ab2955c455bb5fa.js +13 -0
  483. package/.next/static/chunks/app/(app)/reviews/[owner]/[repo]/page-c5fd013309ab3eba.js +1 -0
  484. package/.next/static/chunks/app/(app)/reviews/page-47530d93bb9d4a76.js +1 -0
  485. package/.next/static/chunks/app/(app)/sessions/[id]/page-94f891e1b54fd05f.js +1 -0
  486. package/.next/static/chunks/app/(app)/settings/appearance/page-95902da748ac5f1e.js +1 -0
  487. package/.next/static/chunks/app/(app)/settings/notifications/page-229f1db6beb1d19c.js +1 -0
  488. package/.next/static/chunks/app/(app)/settings/page-8ed16a66fdde10cd.js +1 -0
  489. package/.next/static/chunks/app/(app)/settings/providers/[id]/page-13654263246617b3.js +1 -0
  490. package/.next/static/chunks/app/(app)/settings/providers/new/page-e1798e321ccbc6df.js +1 -0
  491. package/.next/static/chunks/app/(app)/settings/providers/page-0bb4c1db2ee35b3d.js +1 -0
  492. package/.next/static/chunks/app/(app)/settings/session/page-ab216a8fa37a0f76.js +1 -0
  493. package/.next/static/chunks/app/(app)/skills/[name]/page-8ab85d5090967ee4.js +6 -0
  494. package/.next/static/chunks/app/(app)/skills/page-c52773eacb27c04e.js +1 -0
  495. package/.next/static/chunks/app/_global-error/page-fc747760bd4c8a4b.js +1 -0
  496. package/.next/static/chunks/app/api/agents/[name]/route-fc747760bd4c8a4b.js +1 -0
  497. package/.next/static/chunks/app/api/agents/route-fc747760bd4c8a4b.js +1 -0
  498. package/.next/static/chunks/app/api/auth/check/route-fc747760bd4c8a4b.js +1 -0
  499. package/.next/static/chunks/app/api/auth/login/route-fc747760bd4c8a4b.js +1 -0
  500. package/.next/static/chunks/app/api/auth/setup/route-fc747760bd4c8a4b.js +1 -0
  501. package/.next/static/chunks/app/api/auth/ws-token/route-fc747760bd4c8a4b.js +1 -0
  502. package/.next/static/chunks/app/api/btw/route-fc747760bd4c8a4b.js +1 -0
  503. package/.next/static/chunks/app/api/claude-md/route-fc747760bd4c8a4b.js +1 -0
  504. package/.next/static/chunks/app/api/commands/[name]/route-fc747760bd4c8a4b.js +1 -0
  505. package/.next/static/chunks/app/api/commands/route-fc747760bd4c8a4b.js +1 -0
  506. package/.next/static/chunks/app/api/defaults/route-fc747760bd4c8a4b.js +1 -0
  507. package/.next/static/chunks/app/api/filesystem/browse/route-fc747760bd4c8a4b.js +1 -0
  508. package/.next/static/chunks/app/api/filesystem/files/route-fc747760bd4c8a4b.js +1 -0
  509. package/.next/static/chunks/app/api/filesystem/mkdir/route-fc747760bd4c8a4b.js +1 -0
  510. package/.next/static/chunks/app/api/filesystem/read/route-fc747760bd4c8a4b.js +1 -0
  511. package/.next/static/chunks/app/api/git/clone/route-fc747760bd4c8a4b.js +1 -0
  512. package/.next/static/chunks/app/api/git/commit/route-fc747760bd4c8a4b.js +1 -0
  513. package/.next/static/chunks/app/api/git/diff/route-fc747760bd4c8a4b.js +1 -0
  514. package/.next/static/chunks/app/api/git/discard/route-fc747760bd4c8a4b.js +1 -0
  515. package/.next/static/chunks/app/api/git/generate-message/route-fc747760bd4c8a4b.js +1 -0
  516. package/.next/static/chunks/app/api/git/push/route-fc747760bd4c8a4b.js +1 -0
  517. package/.next/static/chunks/app/api/git/status/route-fc747760bd4c8a4b.js +1 -0
  518. package/.next/static/chunks/app/api/github/file-content/route-fc747760bd4c8a4b.js +1 -0
  519. package/.next/static/chunks/app/api/github/orgs/route-fc747760bd4c8a4b.js +1 -0
  520. package/.next/static/chunks/app/api/github/prs/checks/route-fc747760bd4c8a4b.js +1 -0
  521. package/.next/static/chunks/app/api/github/prs/diff/route-fc747760bd4c8a4b.js +1 -0
  522. package/.next/static/chunks/app/api/github/prs/review/route-fc747760bd4c8a4b.js +1 -0
  523. package/.next/static/chunks/app/api/github/prs/route-fc747760bd4c8a4b.js +1 -0
  524. package/.next/static/chunks/app/api/github/prs/view/route-fc747760bd4c8a4b.js +1 -0
  525. package/.next/static/chunks/app/api/github/repos/route-fc747760bd4c8a4b.js +1 -0
  526. package/.next/static/chunks/app/api/github/review-session/route-fc747760bd4c8a4b.js +1 -0
  527. package/.next/static/chunks/app/api/health/route-fc747760bd4c8a4b.js +1 -0
  528. package/.next/static/chunks/app/api/hooks/route-fc747760bd4c8a4b.js +1 -0
  529. package/.next/static/chunks/app/api/inbox/[id]/route-fc747760bd4c8a4b.js +1 -0
  530. package/.next/static/chunks/app/api/inbox/route-fc747760bd4c8a4b.js +1 -0
  531. package/.next/static/chunks/app/api/jobs/[id]/route-fc747760bd4c8a4b.js +1 -0
  532. package/.next/static/chunks/app/api/jobs/[id]/runs/[runId]/route-fc747760bd4c8a4b.js +1 -0
  533. package/.next/static/chunks/app/api/jobs/[id]/runs/[runId]/transcript/route-fc747760bd4c8a4b.js +1 -0
  534. package/.next/static/chunks/app/api/jobs/[id]/runs/route-fc747760bd4c8a4b.js +1 -0
  535. package/.next/static/chunks/app/api/jobs/[id]/trigger/route-fc747760bd4c8a4b.js +1 -0
  536. package/.next/static/chunks/app/api/jobs/mcp-discover/route-fc747760bd4c8a4b.js +1 -0
  537. package/.next/static/chunks/app/api/jobs/route-fc747760bd4c8a4b.js +1 -0
  538. package/.next/static/chunks/app/api/jobs/status/route-fc747760bd4c8a4b.js +1 -0
  539. package/.next/static/chunks/app/api/mcp-servers/[name]/route-fc747760bd4c8a4b.js +1 -0
  540. package/.next/static/chunks/app/api/mcp-servers/[name]/test/route-fc747760bd4c8a4b.js +1 -0
  541. package/.next/static/chunks/app/api/mcp-servers/route-fc747760bd4c8a4b.js +1 -0
  542. package/.next/static/chunks/app/api/notifications/route-fc747760bd4c8a4b.js +1 -0
  543. package/.next/static/chunks/app/api/notifications/test/route-fc747760bd4c8a4b.js +1 -0
  544. package/.next/static/chunks/app/api/providers/[id]/route-fc747760bd4c8a4b.js +1 -0
  545. package/.next/static/chunks/app/api/providers/route-fc747760bd4c8a4b.js +1 -0
  546. package/.next/static/chunks/app/api/reviews/pinned/route-fc747760bd4c8a4b.js +1 -0
  547. package/.next/static/chunks/app/api/sessions/[id]/context/route-fc747760bd4c8a4b.js +1 -0
  548. package/.next/static/chunks/app/api/sessions/[id]/mcp/route-fc747760bd4c8a4b.js +1 -0
  549. package/.next/static/chunks/app/api/sessions/[id]/route-fc747760bd4c8a4b.js +1 -0
  550. package/.next/static/chunks/app/api/sessions/[id]/search/route-fc747760bd4c8a4b.js +1 -0
  551. package/.next/static/chunks/app/api/sessions/[id]/tabs/route-fc747760bd4c8a4b.js +1 -0
  552. package/.next/static/chunks/app/api/sessions/bulk-delete/route-fc747760bd4c8a4b.js +1 -0
  553. package/.next/static/chunks/app/api/sessions/by-ids/route-fc747760bd4c8a4b.js +1 -0
  554. package/.next/static/chunks/app/api/sessions/group/route-fc747760bd4c8a4b.js +1 -0
  555. package/.next/static/chunks/app/api/sessions/pinned/route-fc747760bd4c8a4b.js +1 -0
  556. package/.next/static/chunks/app/api/sessions/route-fc747760bd4c8a4b.js +1 -0
  557. package/.next/static/chunks/app/api/sessions/search/route-fc747760bd4c8a4b.js +1 -0
  558. package/.next/static/chunks/app/api/sessions/thinking/route-fc747760bd4c8a4b.js +1 -0
  559. package/.next/static/chunks/app/api/skills/[name]/route-fc747760bd4c8a4b.js +1 -0
  560. package/.next/static/chunks/app/api/skills/route-fc747760bd4c8a4b.js +1 -0
  561. package/.next/static/chunks/app/api/terminal/[id]/route-fc747760bd4c8a4b.js +1 -0
  562. package/.next/static/chunks/app/api/terminal/route-fc747760bd4c8a4b.js +1 -0
  563. package/.next/static/chunks/app/api/usage/route-fc747760bd4c8a4b.js +1 -0
  564. package/.next/static/chunks/app/api/version/changelog/route-fc747760bd4c8a4b.js +1 -0
  565. package/.next/static/chunks/app/api/version/cockpit/changelog/route-fc747760bd4c8a4b.js +1 -0
  566. package/.next/static/chunks/app/api/version/cockpit/route-fc747760bd4c8a4b.js +1 -0
  567. package/.next/static/chunks/app/api/version/route-fc747760bd4c8a4b.js +1 -0
  568. package/.next/static/chunks/e868780c.f24b6da08e62c7b2.js +18 -0
  569. package/.next/static/chunks/next/dist/client/components/builtin/app-error-fc747760bd4c8a4b.js +1 -0
  570. package/.next/static/chunks/next/dist/client/components/builtin/forbidden-fc747760bd4c8a4b.js +1 -0
  571. package/.next/static/chunks/next/dist/client/components/builtin/not-found-fc747760bd4c8a4b.js +1 -0
  572. package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-fc747760bd4c8a4b.js +1 -0
  573. package/.next/static/chunks/webpack-e31bb45fa59caed8.js +1 -0
  574. package/.next/static/css/3f8af4ae6f812d5c.css +1 -0
  575. package/.next/static/zr8XZzqb74eHitdlkpo-C/_buildManifest.js +1 -0
  576. package/README.md +14 -4
  577. package/bin/cockpit-hook-bridge.mjs +101 -0
  578. package/dist/server.js +49 -2
  579. package/dist/src/lib/models.js +48 -7
  580. package/dist/src/server/auth.js +32 -10
  581. package/dist/src/server/claude-settings.js +153 -0
  582. package/dist/src/server/cli-init-fetch.js +86 -0
  583. package/dist/src/server/cron-utils.js +16 -5
  584. package/dist/src/server/debug-logger.js +2 -2
  585. package/dist/src/server/defaults.js +18 -7
  586. package/dist/src/server/fs-watcher.js +50 -0
  587. package/dist/src/server/hook-bridge-path.js +34 -0
  588. package/dist/src/server/hook-event-translator.js +211 -0
  589. package/dist/src/server/hook-router.js +150 -0
  590. package/dist/src/server/inbox.js +136 -0
  591. package/dist/src/server/job-lock.js +103 -0
  592. package/dist/src/server/job-scheduler.js +170 -43
  593. package/dist/src/server/job-storage.js +32 -20
  594. package/dist/src/server/notification-settings.js +43 -0
  595. package/dist/src/server/notifications.js +125 -0
  596. package/dist/src/server/paths.js +23 -0
  597. package/dist/src/server/plans.js +8 -5
  598. package/dist/src/server/providers.js +128 -0
  599. package/dist/src/server/pty-runtime.js +324 -0
  600. package/dist/src/server/pty-session.js +178 -0
  601. package/dist/src/server/session-manager.js +838 -152
  602. package/dist/src/server/session-prefs.js +33 -8
  603. package/dist/src/server/singleton.js +18 -0
  604. package/dist/src/server/stream-processor.js +61 -48
  605. package/dist/src/server/terminal-manager.js +153 -0
  606. package/dist/src/server/todo-watcher.js +178 -0
  607. package/dist/src/server/transcript-watcher.js +91 -0
  608. package/dist/src/server/transcript.js +444 -13
  609. package/dist/src/server/ws-handler.js +251 -74
  610. package/next.config.ts +1 -0
  611. package/package.json +10 -3
  612. package/public/fonts/symbols-nerd-font-mono.woff2 +0 -0
  613. package/.next/server/chunks/1941.js +0 -9
  614. package/.next/server/chunks/2444.js +0 -6
  615. package/.next/server/chunks/8346.js +0 -1
  616. package/.next/static/V2EfPtTUC96VYyF12K0om/_buildManifest.js +0 -1
  617. package/.next/static/chunks/30120-1535e9064b17ce74.js +0 -20
  618. package/.next/static/chunks/66997-652baf5596173fea.js +0 -199
  619. package/.next/static/chunks/93273-c5cb6dcedef67c81.js +0 -6
  620. package/.next/static/chunks/app/(app)/agents/[name]/page-44c5691c80f17d38.js +0 -8
  621. package/.next/static/chunks/app/(app)/agents/page-4ce7a715bc0145dc.js +0 -1
  622. package/.next/static/chunks/app/(app)/changes/page-84cf4cd3ca347d98.js +0 -1
  623. package/.next/static/chunks/app/(app)/claude-md/edit/page-fb7117171d0f94d2.js +0 -1
  624. package/.next/static/chunks/app/(app)/claude-md/page-9503f1415e660911.js +0 -1
  625. package/.next/static/chunks/app/(app)/commands/[name]/page-6ef571e73b105248.js +0 -6
  626. package/.next/static/chunks/app/(app)/commands/page-e8a506da73d1c280.js +0 -1
  627. package/.next/static/chunks/app/(app)/files/page-67a95d351a685d79.js +0 -1
  628. package/.next/static/chunks/app/(app)/hooks/[event]/page-03f85595561b068a.js +0 -6
  629. package/.next/static/chunks/app/(app)/hooks/page-5578c83ad353e307.js +0 -1
  630. package/.next/static/chunks/app/(app)/jobs/[id]/edit/page-51d784c59737778c.js +0 -1
  631. package/.next/static/chunks/app/(app)/jobs/[id]/page-7d00e7a01c70a261.js +0 -1
  632. package/.next/static/chunks/app/(app)/jobs/[id]/runs/[runId]/page-665191da233fde19.js +0 -1
  633. package/.next/static/chunks/app/(app)/jobs/page-8b4ee1166a53d5e1.js +0 -1
  634. package/.next/static/chunks/app/(app)/layout-8dad55d6ce637a01.js +0 -1
  635. package/.next/static/chunks/app/(app)/mcp-servers/[name]/page-c30f0d78daf7719e.js +0 -1
  636. package/.next/static/chunks/app/(app)/mcp-servers/page-737b87d338afdb49.js +0 -1
  637. package/.next/static/chunks/app/(app)/page-40052655d2a9a84f.js +0 -1
  638. package/.next/static/chunks/app/(app)/reviews/[owner]/[repo]/[number]/page-1d9179bf5a4de7a4.js +0 -13
  639. package/.next/static/chunks/app/(app)/reviews/[owner]/[repo]/page-d8a9ee39e7cc056a.js +0 -1
  640. package/.next/static/chunks/app/(app)/reviews/page-098e6e6fe3123e02.js +0 -1
  641. package/.next/static/chunks/app/(app)/sessions/[id]/page-a74f7fe8322678ba.js +0 -1
  642. package/.next/static/chunks/app/(app)/settings/page-1fa46b8ac8e22927.js +0 -1
  643. package/.next/static/chunks/app/(app)/skills/[name]/page-e6572062a6ad90df.js +0 -6
  644. package/.next/static/chunks/app/(app)/skills/page-8fca8814aa818ae6.js +0 -1
  645. package/.next/static/chunks/app/_global-error/page-b277aba73f9e0212.js +0 -1
  646. package/.next/static/chunks/app/api/agents/[name]/route-b277aba73f9e0212.js +0 -1
  647. package/.next/static/chunks/app/api/agents/route-b277aba73f9e0212.js +0 -1
  648. package/.next/static/chunks/app/api/auth/check/route-b277aba73f9e0212.js +0 -1
  649. package/.next/static/chunks/app/api/auth/login/route-b277aba73f9e0212.js +0 -1
  650. package/.next/static/chunks/app/api/auth/setup/route-b277aba73f9e0212.js +0 -1
  651. package/.next/static/chunks/app/api/auth/ws-token/route-b277aba73f9e0212.js +0 -1
  652. package/.next/static/chunks/app/api/btw/route-b277aba73f9e0212.js +0 -1
  653. package/.next/static/chunks/app/api/claude-md/route-b277aba73f9e0212.js +0 -1
  654. package/.next/static/chunks/app/api/commands/[name]/route-b277aba73f9e0212.js +0 -1
  655. package/.next/static/chunks/app/api/commands/route-b277aba73f9e0212.js +0 -1
  656. package/.next/static/chunks/app/api/defaults/route-b277aba73f9e0212.js +0 -1
  657. package/.next/static/chunks/app/api/filesystem/browse/route-b277aba73f9e0212.js +0 -1
  658. package/.next/static/chunks/app/api/filesystem/files/route-b277aba73f9e0212.js +0 -1
  659. package/.next/static/chunks/app/api/filesystem/mkdir/route-b277aba73f9e0212.js +0 -1
  660. package/.next/static/chunks/app/api/filesystem/read/route-b277aba73f9e0212.js +0 -1
  661. package/.next/static/chunks/app/api/git/clone/route-b277aba73f9e0212.js +0 -1
  662. package/.next/static/chunks/app/api/git/commit/route-b277aba73f9e0212.js +0 -1
  663. package/.next/static/chunks/app/api/git/diff/route-b277aba73f9e0212.js +0 -1
  664. package/.next/static/chunks/app/api/git/discard/route-b277aba73f9e0212.js +0 -1
  665. package/.next/static/chunks/app/api/git/generate-message/route-b277aba73f9e0212.js +0 -1
  666. package/.next/static/chunks/app/api/git/push/route-b277aba73f9e0212.js +0 -1
  667. package/.next/static/chunks/app/api/git/status/route-b277aba73f9e0212.js +0 -1
  668. package/.next/static/chunks/app/api/github/file-content/route-b277aba73f9e0212.js +0 -1
  669. package/.next/static/chunks/app/api/github/orgs/route-b277aba73f9e0212.js +0 -1
  670. package/.next/static/chunks/app/api/github/prs/checks/route-b277aba73f9e0212.js +0 -1
  671. package/.next/static/chunks/app/api/github/prs/diff/route-b277aba73f9e0212.js +0 -1
  672. package/.next/static/chunks/app/api/github/prs/review/route-b277aba73f9e0212.js +0 -1
  673. package/.next/static/chunks/app/api/github/prs/route-b277aba73f9e0212.js +0 -1
  674. package/.next/static/chunks/app/api/github/prs/view/route-b277aba73f9e0212.js +0 -1
  675. package/.next/static/chunks/app/api/github/repos/route-b277aba73f9e0212.js +0 -1
  676. package/.next/static/chunks/app/api/github/review-session/route-b277aba73f9e0212.js +0 -1
  677. package/.next/static/chunks/app/api/health/route-b277aba73f9e0212.js +0 -1
  678. package/.next/static/chunks/app/api/hooks/route-b277aba73f9e0212.js +0 -1
  679. package/.next/static/chunks/app/api/jobs/[id]/route-b277aba73f9e0212.js +0 -1
  680. package/.next/static/chunks/app/api/jobs/[id]/runs/[runId]/route-b277aba73f9e0212.js +0 -1
  681. package/.next/static/chunks/app/api/jobs/[id]/runs/[runId]/transcript/route-b277aba73f9e0212.js +0 -1
  682. package/.next/static/chunks/app/api/jobs/[id]/runs/route-b277aba73f9e0212.js +0 -1
  683. package/.next/static/chunks/app/api/jobs/[id]/trigger/route-b277aba73f9e0212.js +0 -1
  684. package/.next/static/chunks/app/api/jobs/mcp-discover/route-b277aba73f9e0212.js +0 -1
  685. package/.next/static/chunks/app/api/jobs/route-b277aba73f9e0212.js +0 -1
  686. package/.next/static/chunks/app/api/jobs/status/route-b277aba73f9e0212.js +0 -1
  687. package/.next/static/chunks/app/api/mcp-servers/[name]/route-b277aba73f9e0212.js +0 -1
  688. package/.next/static/chunks/app/api/mcp-servers/[name]/test/route-b277aba73f9e0212.js +0 -1
  689. package/.next/static/chunks/app/api/mcp-servers/route-b277aba73f9e0212.js +0 -1
  690. package/.next/static/chunks/app/api/sessions/[id]/context/route-b277aba73f9e0212.js +0 -1
  691. package/.next/static/chunks/app/api/sessions/[id]/mcp/route-b277aba73f9e0212.js +0 -1
  692. package/.next/static/chunks/app/api/sessions/[id]/route-b277aba73f9e0212.js +0 -1
  693. package/.next/static/chunks/app/api/sessions/[id]/search/route-b277aba73f9e0212.js +0 -1
  694. package/.next/static/chunks/app/api/sessions/pinned/route-b277aba73f9e0212.js +0 -1
  695. package/.next/static/chunks/app/api/sessions/route-b277aba73f9e0212.js +0 -1
  696. package/.next/static/chunks/app/api/skills/[name]/route-b277aba73f9e0212.js +0 -1
  697. package/.next/static/chunks/app/api/skills/route-b277aba73f9e0212.js +0 -1
  698. package/.next/static/chunks/app/api/usage/route-b277aba73f9e0212.js +0 -1
  699. package/.next/static/chunks/app/api/version/cockpit/route-b277aba73f9e0212.js +0 -1
  700. package/.next/static/chunks/app/api/version/route-b277aba73f9e0212.js +0 -1
  701. package/.next/static/chunks/next/dist/client/components/builtin/app-error-b277aba73f9e0212.js +0 -1
  702. package/.next/static/chunks/next/dist/client/components/builtin/forbidden-b277aba73f9e0212.js +0 -1
  703. package/.next/static/chunks/next/dist/client/components/builtin/not-found-b277aba73f9e0212.js +0 -1
  704. package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-b277aba73f9e0212.js +0 -1
  705. package/.next/static/chunks/webpack-2a5835e108df6f34.js +0 -1
  706. package/.next/static/css/1e1239c76b265910.css +0 -1
  707. /package/.next/static/{V2EfPtTUC96VYyF12K0om → zr8XZzqb74eHitdlkpo-C}/_ssgManifest.js +0 -0
@@ -1,6 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[93273],{8081:(e,t,s)=>{s.d(t,{AX:()=>o,Mi:()=>c,bs:()=>a,iz:()=>i,r5:()=>r,zQ:()=>l});let n=[{alias:"haiku",version:"4.5",modelId:"claude-haiku-4-5-20251001",displayName:"Haiku 4.5",description:"Fastest",supportsExtendedContext:!1,contextWindow:2e5,isDefault:!0},{alias:"sonnet",version:"4.6",modelId:"claude-sonnet-4-6",displayName:"Sonnet 4.6",description:"Balanced",supportsExtendedContext:!0,contextWindow:2e5,isDefault:!0},{alias:"opus",version:"4.6",modelId:"claude-opus-4-6",displayName:"Opus 4.6",description:"Previous generation",supportsExtendedContext:!0,contextWindow:2e5},{alias:"opus",version:"4.7",modelId:"claude-opus-4-7",displayName:"Opus 4.7",description:"Most capable",supportsExtendedContext:!0,contextWindow:2e5,isDefault:!0}];function a(e){if(e)return n.find(t=>t.modelId===e)}function r(e){return n.filter(t=>t.alias===e)}function l(e){return n.find(t=>t.alias===e&&t.isDefault)??r(e)[0]}function o(e){if(!e)return null;let t=e.replace(/\[.*\]$/,"");return"opus"===t||"sonnet"===t||"haiku"===t?l(t)??null:a(t)??null}function i(e){if(!e||"haiku"===e.alias)return[];let t=["low","medium","high"];return"opus"===e.alias&&"4.7"===e.version&&t.push("xhigh"),t.push("max"),t}function c(e){return e&&"haiku"!==e.alias?"opus"===e.alias&&"4.7"===e.version?"xhigh":"sonnet"===e.alias?"medium":"high":null}},93273:(e,t,s)=>{s.d(t,{I:()=>eR});var n=s(95155),a=s(92571),r=s(11012),l=s(92298),o=s(19805),i=s(12115);function c(e){if("system"===e.role)return"";if("user"===e.role)return e.content;let t=e.blocks.filter(e=>"text"===e.type).map(e=>e.text);return t.length>0?t.join("\n"):e.content}var d=s(89323),u=s(22317),m=s(53972),x=s(30120),p=s(25494),h=s(9005),f=s(66763),g=s(12651),b=s(19707),v=s(8962),w=s(5045),j=s(28750),y=s(50981),k=s(55737),N=s(76721),C=s(82749),S=s(65738),D=s(36483),A=s(15561),$=s(40852),E=s(9383),I=s(25182),q=s(14283),_=s(18189),M=s(64233),U=s(30966),T=s(18402),R=s(88074),P=s(73321),z=s(45160),L=s(89239),F=s(40980);function O({open:e,onOpenChange:t,sessionId:s,initData:r}){let l=(0,P.useRouter)(),[o,c]=(0,i.useState)([]),[d,u]=(0,i.useState)(!1),[m,x]=(0,i.useState)(null),[p,f]=(0,i.useState)(null);(0,i.useEffect)(()=>{r?.mcpServers&&c(r.mcpServers.map(e=>({name:e.name,status:e.status})))},[r]);let g=(0,i.useCallback)(()=>{s&&(u(!0),fetch(`/api/sessions/${encodeURIComponent(s)}/mcp`).then(e=>{if(!e.ok)throw Error("Failed to fetch");return e.json()}).then(e=>{e.mcpServers&&c(e.mcpServers)}).catch(()=>{}).finally(()=>u(!1)))},[s]);(0,i.useEffect)(()=>{if(!e)return;let s=e=>{"Escape"===e.key&&t(!1)};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[e,t]);let b=(0,i.useCallback)(async(e,t)=>{if(!s)return;let n="disabled"===t;f(e),c(t=>t.map(t=>t.name===e?{...t,status:n?"connecting":"disabled"}:t));try{await fetch(`/api/sessions/${encodeURIComponent(s)}/mcp`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"toggle",serverName:e,enabled:n})}),c(t=>t.map(t=>t.name===e?{...t,status:n?"connected":"disabled"}:t))}catch{c(s=>s.map(s=>s.name===e?{...s,status:t}:s))}finally{f(null)}},[s]),v=(0,i.useCallback)(async e=>{if(s){f(e),c(t=>t.map(t=>t.name===e?{...t,status:"connecting",error:void 0}:t));try{await fetch(`/api/sessions/${encodeURIComponent(s)}/mcp`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"reconnect",serverName:e})}),c(t=>t.map(t=>t.name===e?{...t,status:"connected"}:t))}catch{c(t=>t.map(t=>t.name===e?{...t,status:"failed"}:t))}finally{f(null)}}},[s]);return 0!==(r?.mcpServers?.length??0)&&e?(0,n.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",onMouseDown:e=>{e.target===e.currentTarget&&t(!1)},children:(0,n.jsxs)("div",{className:"w-full max-w-lg mx-4 rounded-lg border bg-background p-5 shadow-lg max-h-[80vh] flex flex-col",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(k.A,{className:"h-4 w-4"}),(0,n.jsx)("h2",{className:"text-base font-semibold",children:"MCP Servers"}),(0,n.jsx)(z.E,{variant:"secondary",className:"text-xs",children:o.length})]}),(0,n.jsxs)("div",{className:"flex items-center gap-1",children:[(0,n.jsx)(L.$,{variant:"ghost",size:"icon",onClick:g,title:"Refresh",children:(0,n.jsx)(C.A,{className:(0,F.cn)("h-4 w-4",d&&"animate-spin")})}),(0,n.jsx)(L.$,{variant:"ghost",size:"icon",onClick:()=>t(!1),children:(0,n.jsx)(h.A,{className:"h-4 w-4"})})]})]}),d&&0===o.length&&(0,n.jsx)("div",{className:"flex items-center justify-center py-8",children:(0,n.jsx)(a.A,{className:"h-5 w-5 animate-spin text-muted-foreground"})}),!d&&m&&(0,n.jsx)("p",{className:"text-sm text-muted-foreground py-4 text-center",children:m}),o.length>0&&(0,n.jsx)("div",{className:"flex-1 min-h-0 overflow-y-auto border rounded",children:o.map(e=>(0,n.jsxs)("div",{className:"flex items-center gap-3 px-3 py-2.5 border-b last:border-b-0",children:[(0,n.jsx)("div",{className:(0,F.cn)("h-2 w-2 rounded-full shrink-0",function(e){switch(e){case"connected":return"bg-green-500";case"disabled":return"bg-muted-foreground/40";case"failed":return"bg-red-500";default:return"bg-yellow-500"}}(e.status))}),(0,n.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("span",{className:"font-mono text-sm font-bold truncate",children:e.name}),e.scope&&(0,n.jsx)(z.E,{variant:"outline",className:"text-[10px] shrink-0",children:e.scope})]}),(0,n.jsxs)("div",{className:"flex items-center gap-2 mt-0.5",children:[(0,n.jsx)("span",{className:"text-xs text-muted-foreground",children:function(e){switch(e){case"connected":return"Connected";case"connecting":return"Connecting...";case"disabled":return"Disabled";case"failed":return"Failed";default:return e}}(e.status)}),e.tools&&e.tools.length>0&&(0,n.jsxs)("span",{className:"text-xs text-muted-foreground",children:[e.tools.length," tools"]}),e.config?.type&&(0,n.jsx)("span",{className:"text-xs text-muted-foreground",children:e.config.type})]}),e.error&&(0,n.jsx)("p",{className:"text-xs text-red-500 mt-0.5 truncate",children:e.error})]}),(0,n.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:["failed"===e.status&&s&&(0,n.jsx)(L.$,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>v(e.name),disabled:p===e.name,title:"Reconnect",children:(0,n.jsx)(C.A,{className:(0,F.cn)("h-3.5 w-3.5",p===e.name&&"animate-spin")})}),s&&(0,n.jsx)(L.$,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>b(e.name,e.status),disabled:p===e.name,title:"disabled"===e.status?"Enable":"Disable",children:"disabled"===e.status?(0,n.jsx)(U.A,{className:"h-3.5 w-3.5"}):(0,n.jsx)(T.A,{className:"h-3.5 w-3.5"})})]})]},e.name))}),!d&&0===o.length&&!m&&(0,n.jsx)("p",{className:"text-sm text-muted-foreground py-4 text-center",children:"No MCP servers configured"}),(0,n.jsx)("div",{className:"flex justify-end mt-3",children:(0,n.jsxs)(L.$,{variant:"outline",size:"sm",className:"gap-1.5",onClick:()=>{t(!1),l.push("/mcp-servers")},children:[(0,n.jsx)(R.A,{className:"h-3.5 w-3.5"}),"Manage servers"]})})]})}):null}let W=[{name:"Explore",description:"Fast codebase exploration"},{name:"Plan",description:"Design implementation plans"},{name:"general-purpose",description:"Multi-step tasks and code changes"},{name:"claude-code-guide",description:"Claude Code documentation"}];function B({query:e,cwd:t,selectedIndex:s,onSelect:a,onItemsChange:r,initAgents:l}){let o=(0,i.useRef)(null),[c,d]=(0,i.useState)([]),[u,x]=(0,i.useState)([]),p=(0,i.useRef)(null);(0,i.useEffect)(()=>{if(l)return;let e=new URLSearchParams;t&&e.set("cwd",t),fetch(`/api/agents?${e}`).then(e=>e.json()).then(e=>x(e.agents)).catch(()=>{})},[t,l]),(0,i.useEffect)(()=>(p.current&&clearTimeout(p.current),p.current=setTimeout(()=>{let s=new URLSearchParams({cwd:t});e&&s.set("query",e),fetch(`/api/filesystem/files?${s}`).then(e=>e.json()).then(e=>d(e.files)).catch(()=>d([]))},150),()=>{p.current&&clearTimeout(p.current)}),[e,t]);let h=e.toLowerCase(),f=(0,i.useMemo)(()=>{if(l&&l.length>0)return l.map(e=>({name:e.name,description:e.description}));let e=new Set(u.map(e=>e.name));return[...W.filter(t=>!e.has(t.name)).map(e=>({name:e.name,description:e.description})),...u.map(e=>({name:e.name,description:e.description}))]},[l,u]),g=(0,i.useMemo)(()=>f.filter(e=>e.name.toLowerCase().includes(h)).map(e=>({value:e.name,label:e.name,description:e.description,kind:"agent"})),[h,f]),b=(0,i.useMemo)(()=>c.map(e=>({value:e,label:e,kind:"file"})),[c]),v=(0,i.useMemo)(()=>[...g,...b],[g,b]);return((0,i.useEffect)(()=>{r?.(v)},[v,r]),(0,i.useEffect)(()=>{let e=o.current;if(!e)return;let t=e.querySelector(`[data-index="${s}"]`);t?.scrollIntoView({block:"nearest"})},[s]),0===v.length)?null:(0,n.jsxs)("div",{ref:o,className:"absolute bottom-full left-0 mb-1 w-80 max-h-60 overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-md",children:[g.length>0&&b.length>0&&(0,n.jsx)("div",{className:"px-3 py-1 text-xs text-muted-foreground font-medium",children:"Agents"}),g.map((e,t)=>(0,n.jsxs)("button",{type:"button","data-index":t,className:`flex w-full items-baseline gap-3 px-3 py-2 text-sm text-left ${t===s?"bg-accent text-accent-foreground":""}`,onMouseDown:t=>{t.preventDefault(),a(e.value)},children:[(0,n.jsx)("span",{className:"font-mono font-bold shrink-0",children:e.label}),(0,n.jsx)("span",{className:"text-muted-foreground truncate",children:e.description})]},e.value)),b.length>0&&g.length>0&&(0,n.jsx)("div",{className:"px-3 py-1 text-xs text-muted-foreground font-medium",children:"Files"}),b.map((e,t)=>{let r=g.length+t,l=(0,m.uk)(e.value),o=(0,m.ww)(e.value)||null;return(0,n.jsxs)("button",{type:"button","data-index":r,className:`flex w-full items-baseline gap-3 px-3 py-2 text-sm text-left ${r===s?"bg-accent text-accent-foreground":""}`,onMouseDown:t=>{t.preventDefault(),a(e.value)},children:[(0,n.jsx)("span",{className:"font-mono font-bold shrink-0",children:l}),o&&(0,n.jsx)("span",{className:"text-muted-foreground truncate",children:o})]},e.value)})]})}let H=[{command:"/clear",description:"Clear conversation and start fresh"},{command:"/compact",description:"Compact conversation context"},{command:"/cost",description:"Show token usage"},{command:"/context",description:"Show context window usage"},{command:"/model",description:"Show or switch model"},{command:"/rename",description:"Rename this session"},{command:"/commit",description:"Commit changes"},{command:"/review",description:"Review code changes"},{command:"/help",description:"Show available commands"}],Q=[{command:"/btw",description:"Nudge Claude while it's working"},{command:"/mcp",description:"Show MCP server status"}];function K({query:e,selectedIndex:t,onSelect:s,cwd:a,onItemsChange:r,initCommands:l}){let o,c,d,u,m=(0,i.useRef)(null),[x,p]=(0,i.useState)([]);(0,i.useEffect)(()=>{if(l)return;let e=new URLSearchParams;a&&e.set("cwd",a),Promise.all([fetch(`/api/skills?${e}`).then(e=>e.json()).then(e=>e.skills.map(e=>({command:"/"+e.name,description:e.description||"Custom skill"}))).catch(()=>[]),fetch(`/api/commands?${e}`).then(e=>e.json()).then(e=>e.commands.map(e=>({command:"/"+e.name,description:e.description||"Custom command"}))).catch(()=>[])]).then(([e,t])=>{let s=new Set,n=[];for(let t of e)s.add(t.command),n.push(t);for(let e of t)s.has(e.command)||n.push(e);p(n)})},[a,l]);let h=l?(o=new Map(H.map(e=>[e.command,e])),d=new Set((c=l.map(e=>{let t=e.startsWith("/")?e:"/"+e;return o.get(t)||{command:t,description:""}})).map(e=>e.command)),[...c,...H.filter(e=>!d.has(e.command))]):(u=new Set(H.map(e=>e.command)),[...H,...x.filter(e=>!u.has(e.command))]),f=new Set,g=[];for(let e of[...h,...Q])f.has(e.command)||(f.add(e.command),g.push(e));let b=g.filter(t=>t.command.startsWith("/"+e));return((0,i.useEffect)(()=>{r?.(b)},[b.length,r,b]),(0,i.useEffect)(()=>{let e=m.current;if(!e)return;let s=e.children[t];s?.scrollIntoView({block:"nearest"})},[t]),0===b.length)?null:(0,n.jsx)("div",{ref:m,className:"absolute bottom-full left-0 mb-1 w-80 max-h-60 overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-md",children:b.map((e,a)=>(0,n.jsxs)("button",{type:"button",className:`flex w-full items-baseline gap-3 px-3 py-2 text-sm text-left ${a===t?"bg-accent text-accent-foreground":""}`,onMouseDown:t=>{t.preventDefault(),s(e)},children:[(0,n.jsx)("span",{className:"font-mono font-bold shrink-0",children:e.command}),(0,n.jsx)("span",{className:"text-muted-foreground truncate",children:e.description})]},e.command))})}var J=s(42763),V=s(8081);let Y={asm:"asm",awk:"awk",batch:"bat",c:"c",clojure:"clj",cmake:"cmake",cobol:"cob",coffeescript:"coffee",cpp:"cpp",cs:"cs",css:"css",csv:"csv",dart:"dart",diff:"diff",dockerfile:"dockerfile",elixir:"ex",erlang:"erl",fortran:"f90",gleam:"gleam",go:"go",gradle:"gradle",groovy:"groovy",h:"h",handlebars:"hbs",haskell:"hs",hcl:"tf",hpp:"hpp",html:"html",ini:"ini",java:"java",javascript:"js",json:"json",jsonc:"jsonc",jsonl:"jsonl",jsx:"jsx",julia:"jl",kotlin:"kt",latex:"tex",less:"less",lisp:"lisp",lua:"lua",makefile:"makefile",markdown:"md",matlab:"m",nim:"nim",objectivec:"m",ocaml:"ml",odin:"odin",pascal:"pas",perl:"pl",php:"php",powershell:"ps1",prolog:"pl",proto:"proto",python:"py",r:"r",rst:"rst",ruby:"rb",rust:"rs",scala:"scala",scheme:"scm",scss:"scss",shell:"sh",solidity:"sol",sql:"sql",svelte:"svelte",svg:"svg",swift:"swift",tcl:"tcl",toml:"toml",tsx:"tsx",typescript:"ts",vba:"vba",verilog:"v",vhdl:"vhdl",vue:"vue",xml:"xml",yaml:"yaml",yara:"yar",zig:"zig"};function G(e){return e.split(/\r?\n/).length>=10}let X=null;async function Z(e){try{X||(X=Promise.all([s.e(63690),s.e(30272),s.e(63660),s.e(5056),s.e(37087),s.e(56251),s.e(12674),s.e(77607),s.e(43209)]).then(s.bind(s,55681)).then(e=>e.Magika.create()));let t=await X,n=new TextEncoder().encode(e.slice(0,8192)),a=(await t.identifyBytes(n)).prediction.output.label;if("txt"===a||"unknown"===a||"empty"===a)return null;return Y[a]?a:null}catch{return null}}var ee=s(64350);function et(e){return e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function es({usage:e,onCompact:t}){let[s,a]=(0,i.useState)(!1);(0,i.useEffect)(()=>{if(!s)return;let e=e=>{"Escape"===e.key&&a(!1)};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[s]);let r=Math.round(e.used/e.total*100),l=r>80?"#ef4444":r>50?"#f97316":"#22c55e",o=2*Math.PI*6,c=Math.min(r,100)/100*o;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("button",{onClick:()=>a(!0),className:"flex items-center justify-center w-8 h-6 rounded-md hover:bg-muted transition-colors",title:`Context: ${r}%`,children:(0,n.jsxs)("svg",{width:14,height:14,className:"-rotate-90",children:[(0,n.jsx)("circle",{cx:7,cy:7,r:6,fill:"none",stroke:"currentColor",strokeWidth:2,className:"text-muted-foreground/25"}),(0,n.jsx)("circle",{cx:7,cy:7,r:6,fill:"none",stroke:l,strokeWidth:2,strokeDasharray:o,strokeDashoffset:o-c,strokeLinecap:"round"})]})}),s&&(0,n.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",onMouseDown:e=>{e.target===e.currentTarget&&a(!1)},children:(0,n.jsxs)("div",{className:"w-full max-w-sm mx-4 rounded-lg border bg-background p-5 shadow-lg",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,n.jsx)("h2",{className:"text-base font-semibold",children:"Context Usage"}),(0,n.jsx)(L.$,{variant:"ghost",size:"icon",onClick:()=>a(!1),children:(0,n.jsx)(h.A,{className:"h-4 w-4"})})]}),(0,n.jsxs)("div",{className:"flex justify-between text-sm mb-2",children:[(0,n.jsx)("span",{children:"Tokens used"}),(0,n.jsxs)("span",{className:"text-muted-foreground",children:[r,"%"]})]}),(0,n.jsx)("div",{className:"h-2.5 rounded-full bg-muted overflow-hidden mb-2",children:(0,n.jsx)("div",{className:"h-full rounded-full transition-all",style:{width:`${Math.min(r,100)}%`,backgroundColor:l}})}),(0,n.jsxs)("div",{className:"flex justify-between text-xs text-muted-foreground",children:[(0,n.jsxs)("span",{children:[et(e.used)," used"]}),(0,n.jsxs)("span",{children:[et(e.total)," total"]})]}),t&&(0,n.jsxs)(L.$,{variant:"outline",size:"sm",className:"w-full mt-4",onClick:()=>{t(),a(!1)},children:[(0,n.jsx)(ee.A,{className:"h-3.5 w-3.5 mr-2"}),"Compact now"]})]})})]})}var en=s(18986),ea=s(36619);function er({open:e,onOpenChange:t,messages:s,paused:a,onDelete:r,onEdit:l,onResume:o}){return((0,i.useEffect)(()=>{if(!e)return;let s=e=>{"Escape"===e.key&&t(!1)};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[e,t]),e)?(0,n.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",onMouseDown:e=>{e.target===e.currentTarget&&t(!1)},children:(0,n.jsxs)("div",{className:"w-full max-w-md mx-4 rounded-lg border bg-background p-5 shadow-lg",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,n.jsx)("h2",{className:"text-base font-semibold",children:"Queued Messages"}),(0,n.jsx)(L.$,{variant:"ghost",size:"icon",onClick:()=>t(!1),children:(0,n.jsx)(h.A,{className:"h-4 w-4"})})]}),0===s.length?(0,n.jsx)("p",{className:"text-sm text-muted-foreground py-4 text-center",children:"No queued messages"}):(0,n.jsx)("div",{className:"space-y-2 max-h-64 overflow-y-auto",children:s.map((e,s)=>(0,n.jsxs)("div",{className:"flex items-start gap-3 rounded-md border border-border px-3 py-2.5",children:[(0,n.jsxs)("span",{className:"text-xs text-muted-foreground mt-0.5 shrink-0",children:[s+1,"."]}),(0,n.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,n.jsx)("p",{className:"text-sm break-words line-clamp-3",children:e.text}),(0,n.jsx)("span",{className:`text-[10px] mt-0.5 inline-block ${a?"text-yellow-500":"text-muted-foreground"}`,children:a?"paused":"queued"})]}),(0,n.jsxs)("div",{className:"flex gap-1 shrink-0",children:[(0,n.jsx)("button",{onClick:()=>{l(e.id),t(!1)},className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors",title:"Edit (move to input)",children:(0,n.jsx)(en.A,{className:"h-3.5 w-3.5"})}),(0,n.jsx)("button",{onClick:()=>r(e.id),className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-destructive transition-colors",title:"Delete",children:(0,n.jsx)(S.A,{className:"h-3.5 w-3.5"})})]})]},e.id))}),a&&s.length>0&&(0,n.jsx)("div",{className:"mt-4 pt-4 border-t",children:(0,n.jsxs)(L.$,{variant:"default",size:"sm",className:"w-full",onClick:()=>{o(),t(!1)},children:[(0,n.jsx)(ea.A,{className:"h-3.5 w-3.5 mr-2"}),"Resume queue"]})})]})}):null}let el=[{value:"haiku",label:"Haiku"},{value:"sonnet",label:"Sonnet"},{value:"opus",label:"Opus"}],eo=[{value:"default",label:"200K"},{value:"1m",label:"1M"}];function ei(e,t){let s=1===(0,V.r5)(e.alias).length&&e.isDefault?e.alias:e.modelId;return t&&e.supportsExtendedContext?`${s}[1m]`:s}let ec=[{value:"low",label:"Low"},{value:"medium",label:"Medium"},{value:"high",label:"High"},{value:"xhigh",label:"XHigh"},{value:"max",label:"Max"}],ed=new Set(["image/png","image/jpeg","image/gif","image/webp"]),eu=new Set([".txt",".md",".py",".js",".ts",".tsx",".jsx",".json",".csv",".xml",".yaml",".yml",".html",".css",".log",".sh",".go",".rs",".java",".c",".cpp",".h",".rb",".swift",".kt",".toml",".cfg",".ini",".env",".sql",".r",".lua",".pl",".php"]);function em(e){return new Promise(t=>{let s=new FileReader;s.onload=()=>{t(s.result.split(",")[1]||null)},s.onerror=()=>t(null),s.readAsDataURL(e)})}let ex=["image/*",".pdf",...Array.from(eu)].join(","),ep=new Map,eh=new Map;function ef({sessionId:e,onSend:t,onInterrupt:s,isResponding:r,bypassActive:l,onSetBypass:o,planMode:c,onSetPlanMode:u,thinkingLevel:m,onSetThinking:x,currentModel:U,onSetModel:T,contextUsage:R,dismissKeyboard:P,cwd:z,onCompact:F,initData:W,activeModelId:H,hasQueuedMessage:Q,queuedMessages:X,queuePaused:ee,onDeleteQueued:et,onEditQueued:en,onResumeQueue:ea,restoredText:eg,onClearRestoredText:eb,btw:ev,onDismissBtw:ew,onRestart:ej}){let ey,ek,eN,eC,eS,eD,eA,{connected:e$}=(0,d.h)(),[eE,eI]=(0,i.useState)(()=>ep.get(e)||""),[eq,e_]=(0,i.useState)(!1),[eM,eU]=(0,i.useState)(!1);(0,i.useEffect)(()=>{eI(ep.get(e)||"")},[e]),(0,i.useEffect)(()=>{ep.set(e,eE)},[e,eE]),(0,i.useEffect)(()=>{eg&&(eI(eg),eb?.(),e1.current?.focus())},[eg,eb]);let eT=(0,i.useRef)(-1),[eR,eP]=(0,i.useState)(0),[ez,eL]=(0,i.useState)(!1),[eF,eO]=(0,i.useState)(0),[eW,eB]=(0,i.useState)(0),[eH,eQ]=(0,i.useState)([]),[eK,eJ]=(0,i.useState)([]),[eV,eY]=(0,i.useState)([]),[eG,eX]=(0,i.useState)(!1),[eZ,e0]=(0,i.useState)(null),e1=(0,i.useRef)(null),e5=(0,i.useRef)(null),e2=(0,i.useRef)([]),e3=(0,i.useRef)([]),e4=(0,i.useRef)(!1),e6=(ey=eE.slice(0,eW).match(/(?:^|\s)\/([^\s]*)$/))?{active:!0,query:ey[1],start:eW-1-ey[1].length}:{active:!1,query:"",start:0},e8=e6.active,e7=e6.query,e9=(ek=eE.slice(0,eW).match(/@([^\s]*)$/))?{active:!0,query:ek[1],start:eW-ek[0].length}:{active:!1,query:"",start:0},te=!e8&&e9.active&&!!z,tt=(0,i.useCallback)(e=>{let t=eE.slice(0,e6.start),s=eE.slice(eW);eI(t+e.command+" "+s),eP(0);let n=e6.start+e.command.length+1;eB(n),requestAnimationFrame(()=>{let e=e1.current;e&&(e.focus(),e.setSelectionRange(n,n))})},[eE,e6.start,eW]),ts=(0,i.useCallback)(e=>{eI(eE.slice(0,e9.start)+"@"+e+" "+eE.slice(eW)),eO(0);let t=e9.start+1+e.length+1;eB(t),requestAnimationFrame(()=>{let e=e1.current;e&&(e.focus(),e.setSelectionRange(t,t))})},[eE,e9.start,eW]),tn=eH.length>0||eK.length>0||eV.length>0,ta=(0,i.useCallback)(()=>{let s=eE.trim();if(!s&&!tn||!e$)return;if(/^\/mcp\s*$/i.test(s)){eI(""),eU(!0);return}t(s,eH.length>0?eH:void 0,eK.length>0?eK:void 0,eV.length>0?eV:void 0);let n=eh.get(e)||[];n[n.length-1]!==s&&(n.push(s),eh.set(e,n)),eT.current=-1,eI(""),eQ([]),eJ([]),eY([]),eP(0),e1.current&&(e1.current.style.height="auto",P&&"ontouchstart"in window?e1.current.blur():e1.current.focus())},[eE,tn,eH,eK,eV,t,P,e$]),tr=(0,i.useCallback)(t=>{if(e8){let e=e3.current;if(e.length>0){if("ArrowDown"===t.key){t.preventDefault(),eP(t=>(t+1)%e.length);return}if("ArrowUp"===t.key){t.preventDefault(),eP(t=>(t-1+e.length)%e.length);return}if("Enter"===t.key||"Tab"===t.key){t.preventDefault(),tt(e[eR]);return}}if("Escape"===t.key){t.preventDefault(),t.stopPropagation(),eI(eE.slice(0,e6.start)+eE.slice(eW));let e=e6.start;eB(e),requestAnimationFrame(()=>{let t=e1.current;t&&t.setSelectionRange(e,e)});return}}if(te&&e2.current.length>0){let e=e2.current.length;if("ArrowDown"===t.key){t.preventDefault(),eO(t=>(t+1)%e);return}if("ArrowUp"===t.key){t.preventDefault(),eO(t=>(t-1+e)%e);return}if("Enter"===t.key||"Tab"===t.key){t.preventDefault(),ts(e2.current[eF].value);return}if("Escape"===t.key){t.preventDefault(),t.stopPropagation(),eI(eE.slice(0,e9.start)+eE.slice(eW));let e=e9.start;eB(e),requestAnimationFrame(()=>{let t=e1.current;t&&t.setSelectionRange(e,e)});return}}if("Tab"===t.key&&!t.shiftKey){t.preventDefault(),u(!c);return}if("Escape"===t.key&&r){t.preventDefault(),s();return}let n=eh.get(e)||[];if("ArrowUp"===t.key&&!eE.trim()&&n.length>0){t.preventDefault();let e=-1===eT.current?n.length-1:Math.max(0,eT.current-1);eT.current=e,eI(n[e]);return}if("ArrowDown"===t.key&&eT.current>=0){t.preventDefault();let e=eT.current+1;e>=n.length?(eT.current=-1,eI("")):(eT.current=e,eI(n[e]));return}"Enter"!==t.key||t.shiftKey||e4.current||(t.preventDefault(),ta())},[e8,te,eR,eF,ta,tt,ts,eE,e9.start,e6.start,eW,r,s,c,u,e]),tl=(0,i.useCallback)(()=>{let e=e1.current;e&&(e.style.height="auto",e.style.height=Math.min(e.scrollHeight,200)+"px")},[]),to=(0,i.useRef)(0),ti=(0,i.useCallback)(e=>{to.current+=1;let t=to.current,s=t>1?`-${t}`:"",n=`paste${s}`;eY(t=>[...t,{name:n,content:e}]),Z(e).then(t=>{if(!t)return;let a=Y[t];if(!a)return;let r=`paste${s}.${a}`;eY(s=>s.map(s=>s.name===n&&s.content===e?{...s,name:r,language:t}:s))})},[]),tc=(0,i.useCallback)(e=>{let t=e.target.value,s=t.length-eE.length;if(s>0){let n=e.target.selectionStart??t.length,a=t.slice(n-s,n);if(G(a)){let e=t.slice(0,n-s);eI(e+t.slice(n)),ti(a),eB(e.length),eP(0),eO(0);return}}eI(t),eB(e.target.selectionStart??0),eP(0),eO(0)},[eE,ti]),td=(0,i.useCallback)(async e=>{for(let t of e)if(ed.has(t.type)){let e=await function(e){return e.size<=35e5?em(e).then(t=>t?{mediaType:e.type,data:t}:null):function(e){return new Promise(t=>{let s=URL.createObjectURL(e),n=new Image;n.onload=()=>{URL.revokeObjectURL(s);let a=document.createElement("canvas"),r=Math.sqrt(35e5/e.size),l=Math.round(n.width*r),o=Math.round(n.height*r);a.width=l,a.height=o;let i=a.getContext("2d");if(!i)return void t(null);i.drawImage(n,0,0,l,o);let c=.85,d=a.toDataURL("image/jpeg",c).split(",")[1]||"";for(;d.length>45e5&&c>.3;)c-=.1,d=a.toDataURL("image/jpeg",c).split(",")[1]||"";t({mediaType:"image/jpeg",data:d})},n.onerror=()=>{URL.revokeObjectURL(s),t(null)},n.src=s})}(e)}(t);e&&eQ(t=>[...t,e])}else if("application/pdf"===t.type){let e=await em(t);e&&eJ(s=>[...s,{mediaType:"application/pdf",data:e,name:t.name}])}else if(eu.has(function(e){let t=e.lastIndexOf(".");return t>=0?e.slice(t).toLowerCase():""}(t.name))||t.type.startsWith("text/")){let e=await function(e){return new Promise(t=>{let s=new FileReader;s.onload=()=>t(s.result),s.onerror=()=>t(null),s.readAsText(e)})}(t);null!==e&&eY(s=>[...s,{name:t.name,content:e}])}},[]),tu=(0,i.useCallback)(e=>{e4.current=!0,requestAnimationFrame(()=>{e4.current=!1});let t=e.clipboardData?.items;if(!t)return;let s=[];for(let e=0;e<t.length;e++){let n=t[e];if("file"===n.kind){let e=n.getAsFile();e&&s.push(e)}}if(0===s.length&&e.clipboardData?.files?.length)for(let t=0;t<e.clipboardData.files.length;t++)s.push(e.clipboardData.files[t]);if(0===s.length){let t=e.clipboardData?.getData("text/html");if(t){let e=t.match(/<img[^>]+src="(data:image\/[^;]+;base64,[^"]+)"/);if(e){let[t,n]=e[1].split(","),a=t.match(/data:([^;]+)/);if(a&&n){let e=a[1],t=atob(n),r=new Uint8Array(t.length);for(let e=0;e<t.length;e++)r[e]=t.charCodeAt(e);let l=new Blob([r],{type:e});s.push(new File([l],`pasted-image.${e.split("/")[1]||"png"}`,{type:e}))}}}}if(s.length>0){e.preventDefault(),td(s);return}let n=e.clipboardData?.getData("text/plain");n&&G(n)&&(e.preventDefault(),ti(n))},[td,ti]),tm=(0,i.useCallback)(e=>{e.preventDefault(),eX(!0)},[]),tx=(0,i.useCallback)(e=>{e.preventDefault(),eX(!1)},[]),tp=(0,i.useCallback)(e=>{e.preventDefault(),eX(!1);let t=[];if(e.dataTransfer?.files)for(let s=0;s<e.dataTransfer.files.length;s++)t.push(e.dataTransfer.files[s]);t.length>0&&td(t)},[td]),th=(0,i.useCallback)(e=>{eQ(t=>t.filter((t,s)=>s!==e))},[]),tf=(0,i.useCallback)(e=>{eJ(t=>t.filter((t,s)=>s!==e))},[]),tg=(0,i.useCallback)(e=>{eY(t=>t.filter((t,s)=>s!==e))},[]),tb=(0,i.useCallback)(()=>{e5.current?.click()},[]),tv=(0,i.useCallback)(e=>{let t=e.target.files;t&&0!==t.length&&(td(Array.from(t)),e.target.value="")},[td]);return(0,n.jsxs)("div",{className:`border-t bg-background px-1 pt-2 pb-1 ${eG?"ring-2 ring-primary ring-inset":""}`,onDragOver:tm,onDragLeave:tx,onDrop:tp,children:[(0,n.jsxs)("div",{className:"mx-auto max-w-3xl",children:[ev&&(0,n.jsxs)("div",{className:"mb-2 rounded-md border border-input bg-muted/50 p-2",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[(0,n.jsx)(p.A,{className:"h-3.5 w-3.5"}),(0,n.jsx)("span",{children:"Side question"})]}),(0,n.jsx)("button",{onClick:ew,className:"text-muted-foreground hover:text-foreground",children:(0,n.jsx)(h.A,{className:"h-3.5 w-3.5"})})]}),(0,n.jsx)("p",{className:"text-sm font-medium px-1 mb-1",children:ev.question}),ev.loading&&(0,n.jsxs)("div",{className:"flex items-center gap-2 text-xs text-muted-foreground px-1 py-1",children:[(0,n.jsx)(a.A,{className:"h-3.5 w-3.5 animate-spin"}),(0,n.jsx)("span",{children:"Thinking..."})]}),ev.error&&(0,n.jsx)("p",{className:"text-xs text-destructive px-1",children:ev.error}),ev.answer&&(0,n.jsx)(M.Y,{variant:"lite",content:ev.answer,className:"text-xs px-1 border-t pt-1 max-h-48 overflow-y-auto"})]}),ez&&(eS=(eC=(eN=function(e){let t=e.includes("[1m]"),s=e.replace(/\[.*\]$/,"");if("opus"===s||"sonnet"===s||"haiku"===s)return{alias:s,entry:(0,V.zQ)(s)??null,extended:t};let n=(0,V.bs)(s)??null;return{alias:n?.alias??null,entry:n,extended:t}}(U)).alias?(0,V.r5)(eN.alias):[]).length>1,eD=eN.entry?.supportsExtendedContext??!1,(0,n.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",onMouseDown:e=>{e.target===e.currentTarget&&eL(!1)},children:(0,n.jsxs)("div",{className:"w-full max-w-md mx-4 rounded-lg border bg-background p-4 shadow-lg space-y-1",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between pb-2",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(f.A,{className:"h-4 w-4"}),(0,n.jsx)("h2",{className:"text-sm font-semibold",children:"Session settings"})]}),(0,n.jsx)("button",{onClick:()=>eL(!1),className:"rounded p-1 text-muted-foreground hover:text-foreground hover:bg-muted",children:(0,n.jsx)(h.A,{className:"h-4 w-4"})})]}),(0,n.jsxs)("div",{className:"flex w-full items-center gap-2 rounded px-2 py-1.5 text-xs",children:[(0,n.jsx)(g.A,{className:"h-3.5 w-3.5 text-muted-foreground"}),(0,n.jsx)("span",{className:"text-muted-foreground",children:"Model"}),H&&(0,n.jsx)("span",{className:"text-[10px] font-mono text-muted-foreground/70 truncate",children:H}),(0,n.jsx)("div",{className:"ml-auto flex gap-1",children:el.map(e=>(0,n.jsx)("button",{onClick:()=>{var t,s;let n;return T((t=e.value,s=eN.extended&&"haiku"!==e.value,(n=(0,V.zQ)(t))?ei(n,s):t))},className:`rounded px-2 py-0.5 text-xs transition-colors ${eN.alias===e.value?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:text-foreground"}`,children:e.label},e.value))})]}),eS&&(0,n.jsxs)("div",{className:"flex w-full items-center gap-2 rounded px-2 py-1.5 text-xs",children:[(0,n.jsx)(b.A,{className:"h-3.5 w-3.5 text-muted-foreground"}),(0,n.jsx)("span",{className:"text-muted-foreground",children:"Version"}),(0,n.jsx)("div",{className:"ml-auto flex gap-1",children:eC.map(e=>(0,n.jsx)("button",{onClick:()=>T(ei(e,eN.extended&&e.supportsExtendedContext)),className:`rounded px-2 py-0.5 text-xs transition-colors ${eN.entry?.modelId===e.modelId?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:text-foreground"}`,children:e.version},e.modelId))})]}),eD&&eN.entry&&(0,n.jsxs)("div",{className:"flex w-full items-center gap-2 rounded px-2 py-1.5 text-xs",children:[(0,n.jsx)(v.A,{className:"h-3.5 w-3.5 text-muted-foreground"}),(0,n.jsx)("span",{className:"text-muted-foreground",children:"Context"}),(0,n.jsx)("div",{className:"ml-auto flex gap-1",children:eo.map(e=>(0,n.jsx)("button",{onClick:()=>T(ei(eN.entry,"1m"===e.value)),className:`rounded px-2 py-0.5 text-xs transition-colors ${"1m"===e.value===eN.extended?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:text-foreground"}`,children:e.label},e.value))})]}),(()=>{let e=new Set((0,V.iz)(eN.entry));if(0===e.size)return null;let t=ec.filter(t=>e.has(t.value));return(0,n.jsxs)("div",{className:"flex w-full items-center gap-2 rounded px-2 py-1.5 text-xs",children:[(0,n.jsx)(w.A,{className:"h-3.5 w-3.5 text-muted-foreground"}),(0,n.jsx)("span",{className:"text-muted-foreground",children:"Thinking"}),(0,n.jsx)("div",{className:"ml-auto flex gap-1",children:t.map(e=>(0,n.jsx)("button",{onClick:()=>x(e.value),className:`rounded px-2 py-0.5 text-xs transition-colors ${m===e.value?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:text-foreground"}`,children:e.label},e.value))})]})})(),(0,n.jsxs)("button",{onClick:()=>o(!l),className:"flex w-full items-center gap-2 rounded px-2 py-1.5 text-xs hover:bg-muted transition-colors",children:[l?(0,n.jsx)(j.A,{className:"h-3.5 w-3.5 text-orange-500"}):(0,n.jsx)(y.A,{className:"h-3.5 w-3.5 text-muted-foreground"}),(0,n.jsx)("span",{className:l?"text-orange-500 font-medium":"text-muted-foreground",children:"Bypass all permissions"}),(0,n.jsx)("span",{className:`ml-auto inline-flex h-4 w-7 items-center rounded-full transition-colors ${l?"bg-orange-500":"bg-muted-foreground/30"}`,children:(0,n.jsx)("span",{className:`inline-block h-3 w-3 rounded-full bg-white transition-transform ${l?"translate-x-3.5":"translate-x-0.5"}`})})]}),W?.mcpServers&&W.mcpServers.length>0&&(0,n.jsxs)("button",{onClick:()=>eU(!0),className:"flex w-full items-center gap-2 rounded px-2 py-1.5 text-xs hover:bg-muted transition-colors",children:[(0,n.jsx)(k.A,{className:"h-3.5 w-3.5 text-muted-foreground"}),(0,n.jsx)("span",{className:"text-muted-foreground",children:"MCP Servers"}),(0,n.jsxs)("span",{className:"ml-auto flex items-center gap-1 text-muted-foreground",children:[W.mcpServers.filter(e=>"connected"===e.status).length,"/",W.mcpServers.length,(0,n.jsx)(N.A,{className:"h-3 w-3"})]})]}),(0,n.jsxs)("button",{onClick:()=>{ej?.(),eL(!1)},className:"flex w-full items-center gap-2 rounded px-2 py-1.5 text-xs hover:bg-muted transition-colors",children:[(0,n.jsx)(C.A,{className:"h-3.5 w-3.5 text-muted-foreground"}),(0,n.jsx)("span",{className:"text-muted-foreground",children:"Restart process"})]})]})})),tn&&(0,n.jsxs)("div",{className:"mb-1 flex gap-2 flex-wrap px-9",children:[eH.map((e,t)=>(0,n.jsxs)("div",{className:"relative group",children:[(0,n.jsx)("img",{src:`data:${e.mediaType};base64,${e.data}`,className:"h-16 rounded border object-contain cursor-pointer",alt:"",onClick:()=>e0({type:"image",src:`data:${e.mediaType};base64,${e.data}`,index:t})}),(0,n.jsx)("button",{onClick:()=>th(t),className:"absolute top-0.5 right-0.5 opacity-0 group-hover:opacity-100 transition-opacity text-destructive",children:(0,n.jsx)(S.A,{className:"h-3.5 w-3.5"})})]},`img-${t}`)),eK.map((e,t)=>(0,n.jsxs)("div",{className:"relative group flex items-center gap-1.5 rounded border px-2 py-1 text-xs bg-muted h-16",children:[(0,n.jsx)(D.A,{className:"h-4 w-4 text-red-500 shrink-0"}),(0,n.jsx)("span",{className:"truncate max-w-[120px]",children:e.name}),(0,n.jsx)("button",{onClick:()=>tf(t),className:"absolute top-0.5 right-0.5 opacity-0 group-hover:opacity-100 transition-opacity text-destructive",children:(0,n.jsx)(S.A,{className:"h-3.5 w-3.5"})})]},`doc-${t}`)),eV.map((e,t)=>(0,n.jsxs)("div",{className:"relative group flex items-center gap-1.5 rounded border px-2 py-1 text-xs bg-muted h-16 cursor-pointer",onClick:()=>e0({type:"text",content:e.content,name:e.name,index:t}),children:[(0,n.jsx)(D.A,{className:"h-4 w-4 text-muted-foreground shrink-0"}),(0,n.jsx)("span",{className:"truncate max-w-[120px]",children:e.name}),(0,n.jsx)("button",{onClick:e=>{e.stopPropagation(),tg(t)},className:"absolute top-0.5 right-0.5 opacity-0 group-hover:opacity-100 transition-opacity text-destructive",children:(0,n.jsx)(S.A,{className:"h-3.5 w-3.5"})})]},`txt-${t}`))]}),Q&&(0,n.jsxs)("button",{type:"button",onClick:()=>e_(!0),className:"mb-1 mx-9 flex items-center gap-2 rounded-md border border-dashed px-3 py-1.5 text-xs hover:bg-muted transition-colors cursor-pointer",children:[(0,n.jsx)(p.A,{className:`h-3.5 w-3.5 shrink-0 ${ee?"text-yellow-500":"text-primary"}`}),(0,n.jsxs)("span",{className:ee?"text-yellow-500":"text-muted-foreground",children:[X?.length??0," message",(X?.length??0)!==1?"s":""," ",ee?"paused":"queued"]}),(0,n.jsx)("span",{className:"text-muted-foreground/50 ml-auto",children:"click to manage"})]}),(0,n.jsxs)("div",{className:"relative flex items-stretch gap-1",children:[e8&&(0,n.jsx)(K,{query:e7,selectedIndex:eR,onSelect:tt,cwd:z,onItemsChange:e=>{e3.current=e},initCommands:W?.slashCommands}),te&&z&&(0,n.jsx)(B,{query:e9.query,cwd:z,selectedIndex:eF,onSelect:ts,onItemsChange:e=>{e2.current=e},initAgents:W?.agents}),(0,n.jsx)("input",{ref:e5,type:"file",accept:ex,multiple:!0,onChange:tv,className:"hidden"}),(0,n.jsxs)("div",{className:"flex flex-col items-center justify-evenly w-8 shrink-0",children:[R&&(0,n.jsx)(es,{usage:R,onCompact:F}),(0,n.jsx)(L.$,{size:"icon",variant:"ghost",className:`h-8 w-8 ${l?"text-orange-500":""}`,onClick:()=>eL(e=>!e),children:(0,n.jsx)(f.A,{className:"h-4 w-4"})})]}),(0,n.jsxs)("div",{className:"relative flex-1 mr-1",children:[(0,n.jsx)("textarea",{ref:e1,value:eE,onChange:tc,onKeyDown:tr,onInput:tl,onPaste:tu,placeholder:Q?ee?"Queue paused (send to discard, or manage in modal)":"Message queued (Esc to interrupt)":r?"Use /btw to nudge, or type to queue...":c?"Plan with Claude...":"Send a message...",rows:2,className:`w-full resize-none rounded-md border bg-background px-3 py-2 pb-7 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 overflow-y-auto scrollbar-none ${c?"border-blue-500/50 focus-visible:ring-blue-500/50":"border-input focus-visible:ring-ring"}`}),(0,n.jsx)("button",{onClick:tb,title:"Attach file",className:"absolute bottom-2.5 right-1.5 rounded p-1 text-muted-foreground hover:text-foreground hover:bg-muted transition-colors disabled:opacity-50",children:(0,n.jsx)(A.A,{className:"h-4 w-4"})})]}),(0,n.jsxs)("div",{className:"flex flex-col items-center justify-center w-12 shrink-0 overflow-visible",children:[e$?!r||eE.trim()||tn?(0,n.jsx)(L.$,{size:"icon",className:"h-8 w-8",onClick:ta,disabled:!eE.trim()&&!tn,children:(0,n.jsx)(E.A,{className:"h-4 w-4"})}):(0,n.jsx)(L.$,{size:"icon",variant:"destructive",className:"h-8 w-8",onClick:()=>s(),children:(0,n.jsx)($.A,{className:"h-4 w-4"})}):(0,n.jsx)(L.$,{size:"icon",variant:"ghost",className:"h-8 w-8",disabled:!0,title:"Connecting...",children:(0,n.jsx)(a.A,{className:"h-4 w-4 animate-spin text-muted-foreground"})}),(0,n.jsxs)("button",{onClick:()=>u(!c),title:c?"Switch to Build mode (Tab)":"Switch to Plan mode (Tab)",className:`mt-4 flex items-center gap-0.5 whitespace-nowrap rounded-full px-1.5 py-0.5 text-[10px] font-medium transition-colors ${c?"bg-blue-500/15 text-blue-500 hover:bg-blue-500/25":"bg-muted text-muted-foreground hover:bg-muted/80 hover:text-foreground"}`,children:[c?(0,n.jsx)(I.A,{className:"h-2.5 w-2.5"}):(0,n.jsx)(q.A,{className:"h-2.5 w-2.5"}),c?"Plan":"Build"]})]})]})]}),(0,n.jsx)(J.lG,{open:null!==eZ,onOpenChange:()=>e0(null),className:"max-w-3xl",children:(0,n.jsxs)(J.Cf,{className:"max-h-[80vh] overflow-auto",onClose:()=>e0(null),onDelete:()=>{eZ&&("image"===eZ.type?th(eZ.index):tg(eZ.index),e0(null))},children:[eZ?.type==="image"&&(0,n.jsx)("img",{src:eZ.src,className:"w-full rounded object-contain",alt:""}),eZ?.type==="text"&&((eA=(0,_.WG)(eZ.name))?(0,n.jsx)(_.NG,{code:eZ.content,language:eA,fullHeight:!0}):(0,n.jsx)("pre",{className:"whitespace-pre-wrap text-sm font-mono",children:eZ.content}))]})}),(0,n.jsx)(er,{open:eq,onOpenChange:e_,messages:X??[],paused:ee??!1,onDelete:et??(()=>{}),onEdit:en??(()=>{}),onResume:ea??(()=>{})}),(0,n.jsx)(O,{open:eM,onOpenChange:eU,sessionId:e,initData:W})]})}var eg=s(513),eb=s(64577);function ev(e){return e.replace(/\[.*\]$/,"")}function ew({currentModel:e,activeModelId:t,onSelect:s}){let a=function(){let e=[];for(let t of["haiku","sonnet","opus"]){let s=(0,V.r5)(t),n=1===s.length;for(let t of s)e.push(...function(e,t){let s=t&&e.isDefault?e.alias:e.modelId,n=[{key:`${e.modelId}`,value:s,entry:e,label:e.displayName,extended:!1}];return e.supportsExtendedContext&&n.push({key:`${e.modelId}[1m]`,value:t&&e.isDefault?`${e.alias}[1m]`:`${e.modelId}[1m]`,entry:e,label:`${e.displayName} (1M)`,extended:!0}),n}(t,n))}return e}(),r=(0,V.bs)(t),l=ev(e),o=e.includes("[1m]");return(0,n.jsx)("div",{className:"mx-auto max-w-3xl",children:(0,n.jsxs)("div",{className:"rounded-lg border border-border bg-card p-4 space-y-1",children:[(0,n.jsxs)("div",{className:"flex items-baseline justify-between pb-2",children:[(0,n.jsx)("div",{className:"text-sm font-medium",children:"Switch model"}),(0,n.jsx)("div",{className:"text-xs text-muted-foreground font-mono",children:r?`Current: ${r.displayName} (${r.modelId})`:t?`Current: ${t}`:"Current: unknown"})]}),a.map(e=>{let t=ev(e.value),a=e.extended===o&&(t===l||r&&e.entry.modelId===r.modelId&&t===l);return(0,n.jsxs)("button",{onClick:()=>s(e.value),className:`w-full flex items-center gap-3 rounded-md px-3 py-2 text-left text-sm transition-colors ${a?"bg-primary/10 text-primary":"hover:bg-muted text-foreground"}`,children:[(0,n.jsx)("div",{className:"w-4 shrink-0",children:a&&(0,n.jsx)(eb.A,{className:"h-4 w-4"})}),(0,n.jsx)("span",{className:"font-mono font-bold",children:e.value}),(0,n.jsx)("span",{className:"text-muted-foreground",children:e.label}),(0,n.jsx)("span",{className:"text-muted-foreground ml-auto text-xs",children:e.entry.description})]},e.key)})]})})}var ej=s(69203);let ey={session:"session",localSettings:"project (local)",projectSettings:"project",userSettings:"global",cliArg:"session"};function ek({permission:e,onRespond:t}){let s=(0,i.useRef)(null);(0,i.useEffect)(()=>{s.current?.focus()},[]);let a=(0,i.useMemo)(()=>{if(!e.input)return{};try{return JSON.parse(e.input)}catch{return{}}},[e.input]),r=function(e,t){switch(e){case"Bash":case"bash":{let e=t.command||"";return e.length>80?e.slice(0,80)+"...":e}case"Write":case"write":case"Edit":case"edit":case"Read":case"read":{let e=t.file_path||"";return e?(0,m._1)(e):""}default:return""}}(e.toolName,a),l=e.suggestions,o=l&&l.length>0;return(0,n.jsx)("div",{className:"mx-auto max-w-3xl",children:(0,n.jsx)("div",{className:"rounded-lg border border-yellow-500/50 bg-yellow-500/10 p-4",children:(0,n.jsxs)("div",{className:"flex items-start gap-3",children:[(0,n.jsx)(ej.A,{className:"h-5 w-5 shrink-0 text-yellow-500 mt-0.5"}),(0,n.jsxs)("div",{className:"flex-1 min-w-0 space-y-2",children:[(0,n.jsxs)("div",{className:"text-sm font-medium",children:["Permission requested: ",(0,n.jsx)("span",{className:"font-mono",children:e.toolName})]}),r&&(0,n.jsx)("div",{className:"font-mono text-xs text-muted-foreground truncate",children:r}),e.input&&(0,n.jsx)("pre",{className:"overflow-x-auto rounded bg-black/10 dark:bg-white/5 p-2 text-[11px] leading-relaxed max-h-32 overflow-y-auto",children:e.input.length>500?e.input.slice(0,500)+"\n... (truncated)":e.input}),(0,n.jsxs)("div",{className:"flex flex-wrap gap-2 pt-1",children:[(0,n.jsx)("button",{ref:s,onClick:()=>t(e.requestId,!0,"allow"),className:"rounded bg-primary px-3 py-1 text-xs font-medium text-primary-foreground hover:bg-primary/90",children:"Allow"}),o?l.map((s,a)=>(0,n.jsx)("button",{onClick:()=>t(e.requestId,!0,"allow_always",a),className:"rounded bg-primary/70 px-3 py-1 text-xs font-medium text-primary-foreground hover:bg-primary/60",title:JSON.stringify(s,null,2),children:function(e){let t=ey[e.destination||""]||e.destination||"session";if("setMode"===e.type&&e.mode)return`${e.mode} mode (${t})`;if("addDirectories"===e.type&&e.directories?.length){let s=e.directories[0],n=(0,m.uk)(s)||s;return`Allow dir ${n} (${t})`}if(!e.rules?.length)return`Always allow (${t})`;let s=e.rules[0],n=s.toolName,a=s.ruleContent;if(!a)return`Always ${n} (${t})`;let r=a.length>30?a.slice(0,30)+"...":a;return`${n}(${r}) (${t})`}(s)},a)):(0,n.jsxs)("button",{onClick:()=>t(e.requestId,!0,"allow_always"),className:"rounded bg-primary/70 px-3 py-1 text-xs font-medium text-primary-foreground hover:bg-primary/60",children:["Always for ",e.toolName]}),(0,n.jsx)("button",{onClick:()=>t(e.requestId,!0,"allow_all"),className:"rounded bg-orange-600 px-3 py-1 text-xs font-medium text-white hover:bg-orange-700",children:"Bypass All"}),(0,n.jsx)("button",{onClick:()=>t(e.requestId,!1,"deny"),className:"rounded bg-muted px-3 py-1 text-xs font-medium text-muted-foreground hover:bg-muted/80",children:"Deny"})]})]})]})})})}var eN=s(36672),eC=s(52750),eS=s(89723);let eD=[{label:"Yes, clear context and auto-accept edits",clearContext:!0,autoAccept:!0},{label:"Yes, clear context and manually approve edits",clearContext:!0,autoAccept:!1},{label:"Yes, auto-accept edits",clearContext:!1,autoAccept:!0},{label:"Yes, manually approve edits",clearContext:!1,autoAccept:!1}];function eA({permission:e,onRespond:t,onSendMessage:s,onSetBypass:a,onSetPlanMode:r}){let[l,o]=(0,i.useState)(0),[c,d]=(0,i.useState)(!1),[u,m]=(0,i.useState)(""),[x,p]=(0,i.useState)(!1),h=(0,i.useRef)(null),f=(0,i.useRef)(null),g=(0,i.useMemo)(()=>{if(!e.input)return[];try{return JSON.parse(e.input).allowedPrompts||[]}catch{return[]}},[e.input]);(0,i.useEffect)(()=>{h.current?.focus()},[]),(0,i.useEffect)(()=>{c&&f.current?.focus()},[c]);let b=(0,i.useCallback)(n=>{let l=eD[n];if(l.autoAccept&&a(!0),l.clearContext){let n=e.planFilePath?` at ${e.planFilePath}`:"";t(e.requestId,!1,"deny"),r(!1),setTimeout(()=>{s("/clear"),setTimeout(()=>s(`Implement the plan${n}`),200)},100)}else t(e.requestId,!0,"allow")},[e.requestId,e.planFilePath,t,s,a,r]),v=(0,i.useCallback)(()=>{t(e.requestId,!1,"deny"),setTimeout(()=>r(!0),100)},[e.requestId,t,r]),w=(0,i.useCallback)(()=>{let n=u.trim();n&&(t(e.requestId,!1,"deny"),setTimeout(()=>s(n),100))},[u,e.requestId,t,s]),j=(0,i.useCallback)(e=>{if(c)return void("Escape"===e.key?(e.preventDefault(),d(!1),h.current?.focus()):"Enter"!==e.key||e.shiftKey||(e.preventDefault(),w()));if("Escape"===e.key){e.preventDefault(),v();return}"ArrowUp"===e.key||"k"===e.key?(e.preventDefault(),o(e=>Math.max(0,e-1))):"ArrowDown"===e.key||"j"===e.key?(e.preventDefault(),o(e=>Math.min(eD.length+1,e+1))):"Enter"===e.key&&(e.preventDefault(),l===eD.length?d(!0):l===eD.length+1?v():b(l))},[c,l,b,w,v]);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"mx-auto max-w-3xl",children:(0,n.jsx)("div",{ref:h,tabIndex:-1,onKeyDown:j,className:"rounded-lg border border-blue-500/50 bg-blue-500/10 p-4 outline-none",children:(0,n.jsxs)("div",{className:"flex items-start gap-3",children:[(0,n.jsx)(eN.A,{className:"h-5 w-5 shrink-0 text-blue-500 mt-0.5"}),(0,n.jsxs)("div",{className:"flex-1 min-w-0 space-y-3",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("div",{className:"text-sm font-medium",children:"Would you like to proceed?"}),e.planContent&&(0,n.jsxs)("button",{onClick:()=>p(!0),className:"flex items-center gap-1 rounded px-1.5 py-0.5 text-xs text-blue-500 hover:bg-blue-500/10",children:[(0,n.jsx)(eC.A,{className:"h-3 w-3"}),"View plan"]})]}),g.length>0&&(0,n.jsxs)("div",{className:"space-y-1",children:[(0,n.jsx)("div",{className:"text-xs text-muted-foreground",children:"Permissions requested for implementation:"}),(0,n.jsx)("ul",{className:"text-xs text-muted-foreground space-y-0.5",children:g.map((e,t)=>(0,n.jsxs)("li",{className:"flex items-center gap-1.5 pl-2",children:[(0,n.jsx)("span",{className:"font-mono text-foreground/70",children:e.tool}),(0,n.jsx)("span",{children:e.prompt})]},t))})]}),(0,n.jsxs)("div",{className:"space-y-0.5",children:[eD.map((e,t)=>(0,n.jsxs)("button",{onClick:()=>b(t),onMouseEnter:()=>o(t),className:`flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-xs transition-colors ${l===t?"bg-blue-600/20 text-foreground":"text-muted-foreground hover:text-foreground"}`,children:[(0,n.jsxs)("span",{className:"shrink-0 font-mono text-blue-500 w-4",children:[t+1,"."]}),(0,n.jsx)("span",{children:e.label}),0===t&&(0,n.jsx)("span",{className:"ml-auto text-[10px] text-muted-foreground hidden sm:inline",children:"default"})]},t)),(0,n.jsxs)("button",{onClick:()=>d(!0),onMouseEnter:()=>o(eD.length),className:`flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-xs transition-colors ${l===eD.length?"bg-blue-600/20 text-foreground":"text-muted-foreground hover:text-foreground"}`,children:[(0,n.jsx)("span",{className:"shrink-0 font-mono text-blue-500 w-4",children:"5."}),(0,n.jsx)("span",{children:"Tell Claude what to change"})]}),(0,n.jsxs)("button",{onClick:v,onMouseEnter:()=>o(eD.length+1),className:`flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-xs transition-colors ${l===eD.length+1?"bg-blue-600/20 text-foreground":"text-muted-foreground hover:text-foreground"}`,children:[(0,n.jsx)("span",{className:"shrink-0 font-mono text-muted-foreground w-4",children:"Esc"}),(0,n.jsx)("span",{children:"Dismiss"})]})]}),c&&(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsx)("textarea",{ref:f,value:u,onChange:e=>m(e.target.value),placeholder:"Describe what you'd like to change about the plan...",className:"w-full rounded border border-border bg-background px-3 py-2 text-xs resize-none focus:outline-none focus:ring-1 focus:ring-blue-500",rows:3}),(0,n.jsxs)("div",{className:"flex gap-2",children:[(0,n.jsxs)("button",{onClick:w,disabled:!u.trim(),className:"flex items-center gap-1.5 rounded bg-blue-600 px-3 py-1.5 text-xs font-medium text-white hover:bg-blue-700 disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,n.jsx)(E.A,{className:"h-3 w-3"}),"Send feedback"]}),(0,n.jsx)("button",{onClick:()=>{d(!1),h.current?.focus()},className:"rounded px-3 py-1.5 text-xs text-muted-foreground hover:bg-muted",children:"Cancel"})]})]})]})]})})}),e.planContent&&e.planFilePath&&(0,n.jsx)(eS.G,{open:x,onOpenChange:p,content:e.planContent,filePath:e.planFilePath})]})}var e$=s(40638),eE=s(67401);function eI(e){try{return JSON.parse(e).questions||[]}catch{return[]}}function eq({tool:e}){let t=(0,i.useMemo)(()=>eI(e.input),[e.input]),s=(0,i.useMemo)(()=>(function(e){let t=new Map;for(let s of e.matchAll(/"([^"]+)"="([^"]+)"/g))t.set(s[1],s[2]);return t})(e.output||""),[e.output]);return 0===t.length?null:(0,n.jsx)("div",{className:"rounded-lg border border-border bg-background/50 p-3 space-y-3",children:t.map((e,t)=>{let a=s.get(e.question),r=a&&!e.options.some(e=>e.label===a);return(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsxs)("div",{className:"text-sm font-medium flex items-center gap-2",children:[(0,n.jsx)(e$.A,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),e.question]}),(0,n.jsxs)("div",{className:"space-y-0.5 pl-6",children:[e.options.map((e,t)=>{let s=a===e.label;return(0,n.jsxs)("div",{className:`flex w-full items-start gap-2.5 rounded-md px-2.5 py-2 text-xs ${s?"bg-primary/10":""}`,children:[s?(0,n.jsx)(eb.A,{className:"h-3.5 w-3.5 shrink-0 mt-0.5 text-primary"}):(0,n.jsx)(eE.A,{className:"h-3.5 w-3.5 shrink-0 mt-0.5 text-muted-foreground/40"}),(0,n.jsxs)("div",{className:"min-w-0",children:[(0,n.jsx)("div",{className:s?"font-medium text-foreground":"text-muted-foreground",children:e.label}),s&&e.description&&(0,n.jsx)("div",{className:"text-muted-foreground text-[11px] mt-0.5",children:e.description})]})]},t)}),r&&(0,n.jsxs)("div",{className:"flex w-full items-start gap-2.5 rounded-md px-2.5 py-2 text-xs bg-primary/10",children:[(0,n.jsx)(en.A,{className:"h-3.5 w-3.5 shrink-0 mt-0.5 text-primary"}),(0,n.jsx)("div",{className:"min-w-0",children:(0,n.jsx)("div",{className:"font-medium text-foreground",children:a})})]})]})]},t)})})}let e_="__other__";function eM({questions:e,requestId:t,onSubmit:s}){let[a,r]=(0,i.useState)({}),[l,o]=(0,i.useState)({}),[c,d]=(0,i.useState)(!1),u=(0,i.useRef)({}),m=(0,i.useCallback)((e,t)=>{c||r(s=>({...s,[e]:s[e]===t?"":t}))},[c]),x=(0,i.useCallback)(e=>{c||(r(t=>({...t,[e]:e_})),setTimeout(()=>u.current[e]?.focus(),0))},[c]),p=e.every(e=>{let t=a[e.question];return!!t&&(t!==e_||!!l[e.question]?.trim())}),h=(0,i.useCallback)(()=>{if(!p||c)return;d(!0);let n={};for(let t of e){let e=a[t.question];n[t.question]=e===e_?l[t.question]:e}s(t,n)},[p,c,t,a,l,e,s]);return(0,n.jsx)("div",{className:"rounded-lg border border-border bg-card p-4",children:(0,n.jsxs)("div",{className:"space-y-3",children:[e.map((e,t)=>{let s=a[e.question],r=s===e_;return(0,n.jsxs)("div",{className:"space-y-2",children:[e.header&&(0,n.jsx)("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground font-medium",children:e.header}),(0,n.jsxs)("div",{className:"text-sm font-medium flex items-center gap-2",children:[(0,n.jsx)(e$.A,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),e.question]}),(0,n.jsxs)("div",{className:"space-y-0.5 pl-6",children:[e.options.map((t,a)=>{let r=s===t.label,l=c?"div":"button";return(0,n.jsxs)(l,{onClick:c?void 0:()=>m(e.question,t.label),className:`flex w-full items-start gap-2.5 rounded-md px-2.5 py-2 text-xs text-left transition-colors ${r?"bg-primary/10":c?"":"hover:bg-muted/50 cursor-pointer"}`,children:[r?(0,n.jsx)(eb.A,{className:"h-3.5 w-3.5 shrink-0 mt-0.5 text-primary"}):(0,n.jsx)(eE.A,{className:"h-3.5 w-3.5 shrink-0 mt-0.5 text-muted-foreground/40"}),(0,n.jsxs)("div",{className:"min-w-0",children:[(0,n.jsx)("div",{className:r?"font-medium text-foreground":c?"text-muted-foreground":"text-foreground",children:t.label}),t.description&&(0,n.jsx)("div",{className:"text-muted-foreground text-[11px] mt-0.5",children:t.description})]})]},a)}),c?r&&(0,n.jsxs)("div",{className:"flex w-full items-start gap-2.5 rounded-md px-2.5 py-2 text-xs bg-primary/10",children:[(0,n.jsx)(eb.A,{className:"h-3.5 w-3.5 shrink-0 mt-0.5 text-primary"}),(0,n.jsx)("div",{className:"min-w-0",children:(0,n.jsx)("div",{className:"font-medium text-foreground",children:l[e.question]})})]}):(0,n.jsxs)("button",{onClick:()=>x(e.question),className:`flex w-full items-start gap-2.5 rounded-md px-2.5 py-2 text-xs text-left transition-colors ${r?"bg-primary/10":"hover:bg-muted/50 cursor-pointer"}`,children:[r?(0,n.jsx)(eb.A,{className:"h-3.5 w-3.5 shrink-0 mt-0.5 text-primary"}):(0,n.jsx)(eE.A,{className:"h-3.5 w-3.5 shrink-0 mt-0.5 text-muted-foreground/40"}),(0,n.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,n.jsx)("div",{className:r?"font-medium text-foreground":"text-foreground",children:"Other"}),r&&(0,n.jsx)("input",{ref:t=>{u.current[e.question]=t},type:"text",value:l[e.question]||"",onChange:t=>o(s=>({...s,[e.question]:t.target.value})),onKeyDown:e=>{"Enter"===e.key&&p&&h()},onClick:e=>e.stopPropagation(),placeholder:"Tell Claude what to do instead...",className:"mt-1 w-full rounded border border-border bg-background px-2 py-1 text-xs text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-primary"})]})]})]})]},t)}),!c&&(0,n.jsx)("div",{className:"flex justify-end pt-1",children:(0,n.jsx)("button",{disabled:!p,onClick:h,className:`rounded px-4 py-1.5 text-xs font-medium transition-colors ${p?"bg-primary text-primary-foreground hover:bg-primary/90":"bg-muted text-muted-foreground cursor-not-allowed"}`,children:"Submit"})})]})})}var eU=s(99314);function eT({count:e,onCopy:t,onCancel:s}){return(0,n.jsx)("div",{className:"fixed bottom-20 left-1/2 -translate-x-1/2 z-50 animate-in slide-in-from-bottom-4 fade-in duration-200",children:(0,n.jsxs)("div",{className:"flex items-center gap-2 rounded-full border bg-background px-4 py-2 shadow-lg",children:[(0,n.jsxs)("span",{className:"text-sm text-muted-foreground whitespace-nowrap",children:[e," selected"]}),(0,n.jsxs)(L.$,{size:"sm",variant:"default",onClick:t,className:"gap-1.5",children:[(0,n.jsx)(eU.A,{className:"h-3.5 w-3.5"}),"Copy"]}),(0,n.jsx)(L.$,{size:"sm",variant:"ghost",onClick:s,children:(0,n.jsx)(h.A,{className:"h-3.5 w-3.5"})})]})})}function eR({sessionId:e,cwd:t,initialName:s,initialContext:p,historyView:h,onSendMessage:f}){let{messages:g,historyLoaded:b,isResponding:v,pendingPermissions:w,pendingQuestions:j,modelPicker:y,currentModel:k,bypassActive:N,planMode:C,thinkingLevel:S,contextUsage:D,rateLimitStatus:A,apiError:$,sessionName:E,initData:I,activeModelId:q,hasQueuedMessage:_,queuedMessages:M,queuePaused:U,backgroundTasks:T,todos:R,btw:P,hasMoreHistory:z,loadingMore:L,requestMoreHistory:F,sendMessage:O,interrupt:W,respondToPermission:B,respondToQuestion:H,selectModel:Q,setModel:K,setBypassAll:J,setPlanMode:V,setThinkingLevel:Y,cancelQueuedMessage:G,deleteQueuedMessage:X,editQueuedMessage:Z,resumeQueue:ee,restoredText:et,clearRestoredText:es,dismissBtw:en,retry:ea,restartSession:er}=function(e,t,s){let{send:n,subscribe:a,connected:r}=(0,d.h)(),[l,o]=(0,i.useState)([]),[c,u]=(0,i.useState)(!1),[m,x]=(0,i.useState)([]),[p,h]=(0,i.useState)([]),[f,g]=(0,i.useState)(null),[b,v]=(0,i.useState)("sonnet"),[w,j]=(0,i.useState)(!1),[y,k]=(0,i.useState)(!1),[N,C]=(0,i.useState)("high"),[S,D]=(0,i.useState)(!1),[A,$]=(0,i.useState)(null),[E,I]=(0,i.useState)(null),[q,_]=(0,i.useState)(null),[M,U]=(0,i.useState)([]),[T,R]=(0,i.useState)(null),[P,z]=(0,i.useState)(null),[L,F]=(0,i.useState)(null),[O,W]=(0,i.useState)([]),[B,H]=(0,i.useState)([]),[Q,K]=(0,i.useState)(null),[J,V]=(0,i.useState)(!1),[Y,G]=(0,i.useState)(!1),[X,Z]=(0,i.useState)(!1),[ee,et]=(0,i.useState)([]),[es,en]=(0,i.useState)(!1),[ea,er]=(0,i.useState)(null),el=(0,i.useRef)(!1),eo=(0,i.useRef)([]),ei=(0,i.useRef)(b),ec=(0,i.useRef)(null),ed=(0,i.useRef)([]),eu=(0,i.useRef)(null),em=(0,i.useRef)([]),ex=(0,i.useRef)(null);null!==ex.current&&ex.current!==e&&(eu.current=null,em.current=[],ex.current=null,V(!1),G(!1)),(0,i.useEffect)(()=>{eo.current=l},[l]),(0,i.useEffect)(()=>{ei.current=b},[b]),(0,i.useEffect)(()=>{if(r){x([]),h([]);let a=ex.current===e;console.log(`[session] sending session:connect for ${e.slice(0,8)}`),window.__sessionConnectTime=performance.now(),n({type:"session:connect",sessionId:e,cwd:t||void 0,lastMessageId:a?eu.current:void 0,historyView:s||void 0})}},[r,e,t,s,n]),(0,i.useEffect)(()=>a(t=>{if(!("sessionId"in t)||t.sessionId===e)switch(t.type){case"history":{let s=t.messages;if(s.length>0&&(eu.current=s[s.length-1].id),t.delta)ec.current=null,ed.current=[],o(e=>{let t=e.filter(e=>"streaming"!==e.id);if(0===s.length)return t.length===e.length?e:t;let n=new Set(t.map(e=>e.id)),a=s.filter(e=>!n.has(e.id));if(0===a.length&&t.length===e.length)return e;let r=new Set(a.filter(e=>"user"===e.role).map(e=>e.content));return[...r.size>0?t.filter(e=>!("user"===e.role&&e.id.startsWith("user-")&&r.has(e.content))):t,...a]});else{let e=new Set,t=s.filter(t=>!e.has(t.id)&&(e.add(t.id),!0));o(t),ec.current=null,ed.current=[];for(let e=t.length-1;e>=0;e--){let s=t[e];if("assistant"===s.role&&s.model){F(s.model);break}}}if(t.status){let e="running"===t.status;u(e),el.current=e,"idle"===t.status&&(ec.current=null,ed.current=[],o(e=>e.filter(e=>"streaming"!==e.id)),h([]),I(null),W(e=>e.some(e=>"running"===e.status)?e.filter(e=>"running"!==e.status):e))}void 0!==t.hasMore&&V(t.hasMore);let n=window.__sessionConnectTime;n&&console.log(`[session] history received for ${e.slice(0,8)} in ${(performance.now()-n).toFixed(0)}ms (${s.length} msgs, delta=${!!t.delta}, hasMore=${!!t.hasMore})`),D(!0),ex.current=e;break}case"history:more":{let e=t.messages;V(t.hasMore),G(!1),e.length>0&&o(t=>{let s=new Set(t.map(e=>e.id)),n=e.filter(e=>!s.has(e.id));return 0===n.length?t:[...n,...t]});break}case"session:streaming_snapshot":{ed.current=t.toolUses.filter(e=>"Agent"===e.name&&"running"===e.status),ec.current={content:t.content,toolUses:t.toolUses,blocks:t.blocks};let e={id:"streaming",role:"assistant",content:t.content,toolUses:t.toolUses,blocks:t.blocks,timestamp:Date.now()};o(s=>[...s.filter(e=>"streaming"!==e.id&&e.id!==t.messageId),e]);break}case"assistant:thinking":{if(ed.current.length>0)break;o(e=>e.filter(e=>"compact-progress"!==e.id)),ec.current||(ec.current={content:"",toolUses:[],blocks:[]});let e=ec.current.blocks,s=e[e.length-1];s&&"thinking"===s.type?(s.text+=t.text,t.tokens&&(s.tokens=(s.tokens??0)+t.tokens),t.redacted&&(s.redacted=!0),t.durationMs&&(s.durationMs=t.durationMs)):e.push({type:"thinking",text:t.text,tokens:t.tokens,redacted:t.redacted,durationMs:t.durationMs});let n=ec.current;o(e=>{let t={id:"streaming",role:"assistant",content:n.content,toolUses:n.toolUses,blocks:[...n.blocks],timestamp:Date.now()},s=e[e.length-1];return s?.id==="streaming"?[...e.slice(0,-1),t]:[...e,t]});break}case"assistant:text":{if(ed.current.length>0)break;o(e=>e.filter(e=>"compact-progress"!==e.id)),ec.current||(ec.current={content:"",toolUses:[],blocks:[]}),ec.current.content+=t.text;let e=ec.current.blocks,s=e[e.length-1];s&&"text"===s.type?s.text+=t.text:e.push({type:"text",text:t.text});let n=ec.current;o(e=>{let t=e[e.length-1],s={id:"streaming",role:"assistant",content:n.content,toolUses:n.toolUses,blocks:[...n.blocks],timestamp:Date.now()};return t?.id==="streaming"?[...e.slice(0,-1),s]:[...e,s]});break}case"assistant:tool_use":{o(e=>e.filter(e=>"compact-progress"!==e.id)),ec.current||(ec.current={content:"",toolUses:[],blocks:[]});let e=ec.current.toolUses.find(e=>e.id===t.toolId&&"running"===e.status);if(e)e.input=t.input,e.status="done";else{let e={id:t.toolId||t.name+"-"+Date.now(),name:t.name,input:t.input||"",output:"",status:t.input?"done":"running"},s="Agent"===e.name,n=ed.current,a=!1!==t.isMainThread;if(n.length>0&&!a){let t=n[n.length-1];t.children||(t.children=[]),t.children.push(e)}else ec.current.toolUses.push(e),ec.current.blocks.push({type:"tool_use",toolUse:e});s&&n.push(e)}let s=ec.current;o(e=>{let t={id:"streaming",role:"assistant",content:s.content,toolUses:[...s.toolUses],blocks:[...s.blocks],timestamp:Date.now()},n=e[e.length-1];return n?.id==="streaming"?[...e.slice(0,-1),t]:[...e,t]});break}case"assistant:tool_result":{if(!ec.current)break;let e=ed.current,s=e.findIndex(e=>e.id===t.toolId);if(-1!==s)e[s].output=t.output,t.filePath&&(e[s].filePath=t.filePath),e[s].status="done",e.splice(s,1);else if(e.length>0)for(let s of e){let e=s.children?.find(e=>e.id===t.toolId);if(e){e.output=t.output,t.filePath&&(e.filePath=t.filePath),e.status="done";break}}else{let e=ec.current.toolUses.find(e=>e.id===t.toolId);e&&(e.output=t.output,t.filePath&&(e.filePath=t.filePath),e.status="done")}let n=ec.current;o(e=>{let t={id:"streaming",role:"assistant",content:n.content,toolUses:[...n.toolUses],blocks:[...n.blocks],timestamp:Date.now()},s=e[e.length-1];return s?.id==="streaming"?[...e.slice(0,-1),t]:[...e,t]});break}case"assistant:message_done":{let e=ec.current?.toolUses||[],s=ec.current?.blocks||[];ec.current=null,ed.current=[],t.message.model&&F(t.message.model),o(n=>{let a=n.filter(e=>"streaming"!==e.id);if(a.some(e=>e.id===t.message.id))return a;let r={...t.message};return 0===r.toolUses.length&&e.length>0&&(r.toolUses=e),(!r.blocks||0===r.blocks.length)&&s.length>0&&(r.blocks=s),eu.current=r.id,[...a,r]});break}case"assistant:tool_progress":{if(!ec.current)break;let e=ed.current,s=e.find(e=>e.id===t.toolId);if(s)s.output+=t.content;else if(e.length>0){let s=!1;for(let n of e){let e=n.children?.find(e=>e.id===t.toolId);if(e){e.output+=t.content,s=!0;break}}if(!s){let e=ec.current.toolUses.find(e=>e.id===t.toolId);e&&(e.output+=t.content)}}else{let e=ec.current.toolUses.find(e=>e.id===t.toolId);e&&(e.output+=t.content)}let n=ec.current;o(e=>{let t={id:"streaming",role:"assistant",content:n.content,toolUses:[...n.toolUses],blocks:[...n.blocks],timestamp:Date.now()},s=e[e.length-1];return s?.id==="streaming"?[...e.slice(0,-1),t]:[...e,t]});break}case"session:rate_limit":"rate_limited"===t.status?I(t.status):I(null);break;case"session:suggestions":U(t.suggestions);break;case"session:init":z(t.data),t.data?.model&&F(t.data.model);break;case"session:todos":H(t.todos);break;case"session:task_update":W(e=>e.find(e=>e.taskId===t.task.taskId)?e.map(e=>e.taskId===t.task.taskId?{...e,status:t.task.status,title:e.title||t.task.title,description:t.task.description||e.description,activity:t.task.activity||e.activity,summary:t.task.summary||e.summary}:e):[...e,t.task]),"completed"===t.task.status&&setTimeout(()=>{W(e=>e.filter(e=>e.taskId!==t.task.taskId))},5e3);break;case"assistant:tool_children":o(e=>e.map(e=>{if(e.id!==t.messageId)return e;let s=e.toolUses.map(e=>e.id===t.toolId?{...e,children:t.children}:e),n=e.blocks.map(e=>"tool_use"===e.type&&e.toolUse.id===t.toolId?{...e,toolUse:{...e.toolUse,children:t.children}}:e);return{...e,toolUses:s,blocks:n}}));break;case"session:status":{let e="running"===t.status;u(e),el.current=e,e&&_(null),"idle"===t.status&&(ec.current=null,ed.current=[],o(e=>e.filter(e=>"streaming"!==e.id)),h([]),I(null),W(e=>0===e.filter(e=>"running"===e.status).length?e:e.filter(e=>"running"!==e.status)));break}case"session:error":{console.error("Session error:",t.error),ec.current=null,ed.current=[];let e=t.error||"Unknown error",s=e.match(/"message"\s*:\s*"([^"]+)"/);_(s?s[1]:e.slice(0,200));break}case"session:queued":if(Z(t.count>0),t.messages&&et(t.messages),void 0!==t.paused&&en(t.paused),t.cancelledText){er(t.cancelledText);let e=em.current,s=e.findIndex(e=>e.text===t.cancelledText);-1!==s&&e.splice(s,1)}if(t.editText&&er(t.editText),t.sentText){let e=em.current,s=e.findIndex(e=>e.text===t.sentText),n=-1!==s?e.splice(s,1)[0]:null,a={id:"user-queued-"+Date.now(),role:"user",content:t.sentText,toolUses:[],blocks:[],timestamp:Date.now(),images:n?.images,documents:n?.documents,textFiles:n?.textFiles};o(e=>[...e,a])}break;case"session:clear":o(e=>[...e,{id:"clear-"+Date.now(),role:"system",content:"__context_reset__",toolUses:[],blocks:[],timestamp:Date.now()}]),eu.current=null,ec.current=null,ed.current=[],W([]),H([]),Z(!1),et([]),en(!1),x([]),h([]);break;case"session:system":{let e="__model_picker::";if(t.text.startsWith(e)){let s=t.text.slice(e.length);g(s),v(s);break}let s="__model::";if(t.text.startsWith(s)){v(t.text.slice(s.length));break}let n="__bypass_state::";if(t.text.startsWith(n)){j("on"===t.text.slice(n.length));break}let a="__plan_state::";if(t.text.startsWith(a)){k("on"===t.text.slice(a.length));break}let r="__thinking_level::";if(t.text.startsWith(r)){C(t.text.slice(r.length));break}if("__compact_boundary__"===t.text){o(e=>{let t="compact-done-"+Date.now();return e.some(e=>"compact-progress"===e.id)?e.map(e=>"compact-progress"===e.id?{...e,id:t,content:"__compacted__"}:e):[...e,{id:t,role:"system",content:"__compacted__",toolUses:[],blocks:[],timestamp:Date.now()}]});break}let l="__compact::";if(t.text.startsWith(l)){let e=t.text.slice(l.length);"start"===e?o(e=>e.some(e=>"compact-progress"===e.id)?e:[...e,{id:"compact-progress",role:"system",content:"__compacting__",toolUses:[],blocks:[],timestamp:Date.now()}]):"done"===e&&o(e=>e.map(e=>"compact-progress"===e.id?{...e,id:"compact-done-"+Date.now(),content:"__compacted__"}:e));break}if(t.text.startsWith("__"))break;let i={id:"system-"+Date.now(),role:"system",content:t.text,toolUses:[],blocks:[],timestamp:Date.now()};o(e=>[...e,i]);break}case"session:info_updated":R(t.info.name),t.info.model&&v(t.info.model);break;case"session:usage":$(t.usage);break;case"permission:request":x(e=>[...e,{requestId:t.requestId,toolName:t.toolName,input:t.input,suggestions:t.suggestions,planFilePath:t.planFilePath,planContent:t.planContent}]);break;case"question:request":h(e=>[...e,{requestId:t.requestId,questions:t.questions}])}}),[e,a]);let ep=(0,i.useCallback)(()=>{if(Y||!J)return;let t=eo.current[0];t&&(G(!0),n({type:"history:request_more",sessionId:e,beforeMessageId:t.id}))},[Y,J,e,n]),eh=(0,i.useRef)(0),ef=(0,i.useCallback)(async()=>{try{let s=new URLSearchParams;t&&s.set("cwd",t);let n=await fetch(`/api/sessions/${e}?${s}`);if(!n.ok)return void console.warn(`[fallback] HTTP check failed (${n.status})`);let a=await n.json();if("idle"===a.session.status){console.log("[fallback] session is idle, recovering");let e=new Set,t=a.messages.filter(t=>!e.has(t.id)&&(e.add(t.id),!0));o(t),t.length>0&&(eu.current=t[t.length-1].id);for(let e=t.length-1;e>=0;e--){let s=t[e];if("assistant"===s.role&&s.model){F(s.model);break}}u(!1),el.current=!1,ec.current=null,ed.current=[]}}catch{}},[e,t]);(0,i.useEffect)(()=>{if(!c){eh.current=0;return}eh.current=Date.now();let t=a(t=>{"sessionId"in t&&t.sessionId===e&&("assistant:text"===t.type||"assistant:thinking"===t.type||"assistant:tool_use"===t.type||"assistant:tool_result"===t.type||"session:status"===t.type)&&(eh.current=Date.now())}),s=setInterval(async()=>{Date.now()-eh.current<1e4||(console.log("[fallback] no events for 10s, checking session via HTTP"),await ef())},5e3),n=()=>{"visible"===document.visibilityState&&el.current&&(console.log("[fallback] page visible while responding, checking session"),ef())};return document.addEventListener("visibilitychange",n),()=>{t(),clearInterval(s),document.removeEventListener("visibilitychange",n)}},[c,e,a,ef]);let eg=(0,i.useCallback)((s,a,r,l)=>{let i=s;if(l?.length&&(i=l.map(e=>`<file path="${e.name}">
2
- ${e.content}
3
- </file>`).join("\n\n")+(s?"\n\n"+s:"")),el.current&&/^\/btw\s/i.test(s.trim())){let e=s.trim().replace(/^\/btw\s+/i,"");if(!e)return;K({question:e,answer:null,loading:!0,error:null}),fetch("/api/btw",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({question:e,context:eo.current.filter(e=>"user"===e.role||"assistant"===e.role).slice(-20).map(e=>({role:e.role,content:e.content.slice(0,2e3)})),model:ei.current,cwd:t})}).then(e=>e.json()).then(e=>{e.error?K(t=>t?{...t,loading:!1,error:e.error}:null):K(t=>t?{...t,loading:!1,answer:e.answer}:null)}).catch(e=>{K(t=>t?{...t,loading:!1,error:e.message}:null)});return}if(el.current){em.current.push({text:s,images:a,documents:r,textFiles:l}),n({type:"message:send",sessionId:e,text:i,images:a?.length?a:void 0,documents:r?.length?r:void 0});return}es&&(em.current=[],et([]),en(!1),Z(!1));let c={id:"user-"+Date.now(),role:"user",content:s,toolUses:[],blocks:[],timestamp:Date.now(),images:a?.length?a:void 0,documents:r?.length?r:void 0,textFiles:l?.length?l:void 0};o(e=>[...e,c]),U([]),n({type:"message:send",sessionId:e,text:i,images:a?.length?a:void 0,documents:r?.length?r:void 0})},[n,e,es,t]),eb=(0,i.useCallback)(()=>{n({type:"session:interrupt",sessionId:e})},[n,e]),ev=(0,i.useCallback)((t,s,a,r)=>{n({type:"permission:response",sessionId:e,requestId:t,allowed:s,permissionMode:a,suggestionIndex:r}),x(e=>e.filter(e=>e.requestId!==t))},[n,e]),ew=(0,i.useCallback)((t,s)=>{n({type:"question:response",sessionId:e,requestId:t,answers:s}),h(e=>e.map(e=>e.requestId===t?{...e,answered:!0}:e))},[n,e]),ej=(0,i.useCallback)(t=>{g(null),v(t),n({type:"message:send",sessionId:e,text:`/model ${t}`})},[n,e]),ey=(0,i.useCallback)(t=>{v(t),n({type:"session:set_model",sessionId:e,model:t})},[n,e]),ek=(0,i.useCallback)(t=>{j(t),n({type:"permission:set_bypass",sessionId:e,enabled:t})},[n,e]),eN=(0,i.useCallback)(t=>{k(t),n({type:"session:set_plan_mode",sessionId:e,enabled:t})},[n,e]),eC=(0,i.useCallback)(t=>{C(t),o(e=>[...e,{id:"thinking-"+Date.now(),role:"system",content:`Thinking: ${t}`,toolUses:[],blocks:[],timestamp:Date.now()}]),n({type:"session:set_thinking",sessionId:e,level:t})},[n,e]),eS=(0,i.useCallback)(()=>{n({type:"message:cancel_queued",sessionId:e})},[n,e]),eD=(0,i.useCallback)(t=>{n({type:"message:delete_queued",sessionId:e,messageId:t})},[n,e]),eA=(0,i.useCallback)(t=>{n({type:"message:edit_queued",sessionId:e,messageId:t})},[n,e]),e$=(0,i.useCallback)(()=>{n({type:"message:resume_queue",sessionId:e})},[n,e]),eE=(0,i.useCallback)(()=>{er(null)},[]),eI=(0,i.useCallback)(()=>{if(Q?.answer){let e=Date.now();o(t=>[...t,{id:`btw-q-${e}`,role:"user",content:`[side question] ${Q.question}`,toolUses:[],blocks:[],timestamp:e},{id:`btw-a-${e}`,role:"assistant",content:Q.answer,toolUses:[],blocks:[],timestamp:e+1}])}K(null)},[Q]);return{messages:l,historyLoaded:S,isResponding:c,pendingPermissions:m,pendingQuestions:p,modelPicker:f,currentModel:b,bypassActive:w,planMode:y,thinkingLevel:N,contextUsage:A,rateLimitStatus:E,apiError:q,suggestions:M,sessionName:T,initData:P,activeModelId:L,hasQueuedMessage:X,queuedMessages:ee,queuePaused:es,backgroundTasks:O,todos:B,btw:Q,hasMoreHistory:J,loadingMore:Y,requestMoreHistory:ep,sendMessage:eg,interrupt:eb,respondToPermission:ev,respondToQuestion:ew,selectModel:ej,setModel:ey,setBypassAll:ek,setPlanMode:eN,setThinkingLevel:eC,cancelQueuedMessage:eS,deleteQueuedMessage:eD,editQueuedMessage:eA,resumeQueue:e$,restoredText:ea,clearRestoredText:eE,dismissBtw:eI,retry:(0,i.useCallback)(()=>{_(null),n({type:"message:send",sessionId:e,text:"Continue from where you left off."})},[n,e]),restartSession:(0,i.useCallback)(()=>{n({type:"session:restart",sessionId:e})},[n,e])}}(e,t,h),{settings:el}=(0,u.t)(),{setHeader:eo,setBackgroundTasks:ei,setTodos:ec,setInitData:ed}=(0,x.E2)(),eu=(0,i.useRef)(null),em=(0,i.useRef)(!0),[ex,ep]=(0,i.useState)(!1),eh=(0,i.useRef)(0),[eb,ev]=(0,i.useState)(50),ej=(0,i.useRef)(0),ey=(0,i.useRef)(0),{selectedIds:eN,selectionMode:eC,enterSelection:eS,toggleSelect:eD,clearSelection:e$,copySelected:eE}=function(){let[e,t]=(0,i.useState)(new Set),s=e.size>0,n=(0,i.useCallback)(e=>{t(new Set([e]))},[]),a=(0,i.useCallback)(e=>{t(t=>{let s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s})},[]),r=(0,i.useCallback)(()=>{t(new Set)},[]),l=(0,i.useCallback)(async s=>{let n=s.filter(t=>e.has(t.id)&&"system"!==t.role).map(c).filter(Boolean).join("\n\n---\n\n");if(n)if(navigator.clipboard?.writeText)await navigator.clipboard.writeText(n);else{let e=document.createElement("textarea");e.value=n,e.style.position="fixed",e.style.opacity="0",document.body.appendChild(e),e.select(),document.execCommand("copy"),document.body.removeChild(e)}t(new Set)},[e]);return{selectedIds:e,selectionMode:s,enterSelection:n,toggleSelect:a,clearSelection:r,copySelected:l}}(),e_=(0,i.useRef)(new Set),[eU,eP]=(0,i.useState)(!1);(0,i.useEffect)(()=>{eP(matchMedia("(pointer: coarse)").matches)},[]);let ez=(0,i.useMemo)(()=>{let e=new Set;return g.filter(t=>!e.has(t.id)&&(e.add(t.id),!0))},[g]),eL=Math.max(0,ez.length-eb),eF=(0,i.useMemo)(()=>ez.slice(eL),[ez,eL]),eO=eL>0;(0,i.useEffect)(()=>{ev(50)},[]);let{send:eW}=(0,d.h)(),eB=(0,i.useCallback)(t=>{eW({type:"message:send",sessionId:e,text:`/rename ${t}`})},[eW,e]);(0,i.useEffect)(()=>{eo({title:E||s||(t?(0,m.uk)(t):"")||"Session",onRename:eB})},[E,s,t,eo,eB]),(0,i.useEffect)(()=>{ei(T)},[T,ei]),(0,i.useEffect)(()=>{ec(R)},[R,ec]),(0,i.useEffect)(()=>{ed(I)},[I,ed]),(0,i.useLayoutEffect)(()=>{let e=eu.current;if(!e||0===ey.current)return;let t=e.scrollHeight-ey.current;t>0&&(e.scrollTop+=t,eh.current=Date.now()+150),ey.current=0},[]);let eH=(0,i.useCallback)(()=>{if(Date.now()<eh.current)return;let e=eu.current;if(!e)return;let t=e.scrollHeight-e.scrollTop-e.clientHeight;em.current=t<80,ep(t>300),e.scrollTop<800&&Date.now()>ej.current&&(ej.current=Date.now()+100,eO?(ey.current=e.scrollHeight,ev(e=>e+30)):z&&!L&&(ey.current=e.scrollHeight,F()))},[eO,z,L,F]),eQ=(0,i.useCallback)(()=>{let e=eu.current;e&&(e.scrollTop=e.scrollHeight),eh.current=Date.now()+150,ep(!1)},[]);(0,i.useEffect)(()=>{em.current&&eQ()},[g,v,j,w,eQ]),(0,i.useEffect)(()=>{let e=window.visualViewport;if(!e)return;let t=()=>{em.current&&eQ()};return e.addEventListener("resize",t),()=>e.removeEventListener("resize",t)},[eQ]),(0,i.useEffect)(()=>{if(eU)return;let e=()=>{document.activeElement?.closest("textarea, input, [contenteditable]")||document.activeElement!==eu.current&&(eu.current?.focus({preventScroll:!0}),em.current&&eQ())},t=()=>{"visible"===document.visibilityState&&em.current&&eQ()};return document.addEventListener("pointermove",e),window.addEventListener("focus",e),document.addEventListener("visibilitychange",t),()=>{document.removeEventListener("pointermove",e),window.removeEventListener("focus",e),document.removeEventListener("visibilitychange",t)}},[eU,eQ]),(0,i.useEffect)(()=>{let e=e=>{if("Escape"!==e.key||!v||document.querySelector(".fixed.inset-0.z-50"))return;let t=e.target?.tagName;"TEXTAREA"!==t&&"INPUT"!==t&&(e.preventDefault(),W())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[v,W]);let eK=(0,i.useRef)(!1),eJ=(0,i.useCallback)((e,t,s,n)=>{em.current=!0,p&&!eK.current&&0===g.length?(eK.current=!0,O(`${e}
4
-
5
- ---
6
- ${p}`,t,s,n)):O(e,t,s,n)},[O,p,g.length]);(0,i.useEffect)(()=>{f&&f(e=>eJ(e))},[f,eJ]);let eV=(0,i.useCallback)(()=>{O("/compact")},[O]),eY=(0,i.useCallback)(()=>{eE(ez)},[eE,ez]);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{ref:eu,tabIndex:eU?void 0:-1,className:"flex-1 min-h-0 overflow-y-auto p-4 outline-none",onScroll:eH,children:(0,n.jsxs)("div",{className:"mx-auto max-w-3xl lg:max-w-4xl xl:max-w-5xl 2xl:max-w-6xl space-y-4",children:[0===ez.length&&(0,n.jsx)("div",{className:"flex flex-col items-center pt-20 text-sm text-muted-foreground",children:b?(0,n.jsx)("p",{children:"Send a message to start the conversation."}):(0,n.jsx)(a.A,{className:"h-5 w-5 animate-spin"})}),(eO||L)&&(0,n.jsx)("div",{className:"flex justify-center py-2",children:(0,n.jsx)(a.A,{className:"h-4 w-4 animate-spin text-muted-foreground"})}),eF.map((e,t)=>{let s=t>0&&"__compacted__"===eF[t-1].content;if("assistant"===e.role){let{before:t,questionBlock:a,after:r}=function(e){let t=e.findIndex(e=>"tool_use"===e.type&&"AskUserQuestion"===e.toolUse.name);if(t<0)return{before:e,questionBlock:null,after:[]};let s=e[t];return{before:e.slice(0,t),questionBlock:s,after:e.slice(t+1).filter(e=>"tool_use"!==e.type||"AskUserQuestion"!==e.toolUse.name)}}(e.blocks||[]);if(a){let l=j.find(()=>!0),o=!!a.toolUse.output;return(0,n.jsxs)("div",{"data-message-id":e.id,className:"space-y-4",children:[t.length>0&&(0,n.jsx)(eg.s,{message:{...e,blocks:t,content:""},collapsedByDefault:s,expandedToolIds:e_,selectionMode:eC,selected:eN.has(e.id),onEnterSelection:eS,onToggleSelect:eD}),(0,n.jsx)("div",{className:"flex w-full justify-start",children:(0,n.jsx)("div",{className:"max-w-[85%]",children:o?(0,n.jsx)(eq,{tool:a.toolUse}):l?(0,n.jsx)(eM,{questions:eI(l.questions),onSubmit:H,requestId:l.requestId}):null})}),r.length>0&&(0,n.jsx)(eg.s,{message:{...e,blocks:r,content:""},collapsedByDefault:!1,expandedToolIds:e_,selectionMode:eC,selected:eN.has(e.id),onEnterSelection:eS,onToggleSelect:eD})]},e.id)}}return(0,n.jsx)("div",{"data-message-id":e.id,className:"space-y-4",children:(0,n.jsx)(eg.s,{message:e,collapsedByDefault:s,expandedToolIds:e_,selectionMode:eC,selected:eN.has(e.id),onEnterSelection:eS,onToggleSelect:eD})},e.id)}),v&&0===w.length&&!j.some(e=>!e.answered)&&(0,n.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,n.jsx)(a.A,{className:"h-4 w-4 animate-spin"}),A&&(0,n.jsx)("span",{className:"text-xs",children:"Rate limited, retrying..."})]}),$&&!v&&(0,n.jsx)("div",{className:"flex w-full justify-start",children:(0,n.jsxs)("div",{className:"max-w-[85%] rounded-lg border border-red-500/30 bg-red-500/5 px-4 py-3",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2 text-red-500 mb-1",children:[(0,n.jsx)(r.A,{className:"h-4 w-4 shrink-0"}),(0,n.jsx)("span",{className:"text-sm font-medium",children:"API Error"})]}),(0,n.jsx)("p",{className:"text-xs text-muted-foreground mb-3",children:$}),(0,n.jsxs)("button",{onClick:ea,className:"flex items-center gap-1.5 rounded-md border px-3 py-1.5 text-xs hover:bg-muted transition-colors",children:[(0,n.jsx)(l.A,{className:"h-3 w-3"}),"Retry"]})]})}),w.map(e=>"ExitPlanMode"===e.toolName?(0,n.jsx)(eA,{permission:e,onRespond:B,onSendMessage:O,onSetBypass:J,onSetPlanMode:V},e.requestId):(0,n.jsx)(ek,{permission:e,onRespond:B},e.requestId)),j.length>0&&!eF.some(e=>"assistant"===e.role&&(e.blocks||[]).some(e=>"tool_use"===e.type&&"AskUserQuestion"===e.toolUse.name))&&j.map(e=>(0,n.jsx)("div",{className:"flex w-full justify-start",children:(0,n.jsx)("div",{className:"max-w-[85%]",children:(0,n.jsx)(eM,{questions:eI(e.questions),onSubmit:H,requestId:e.requestId})})},e.requestId)),null!==y&&(0,n.jsx)(ew,{currentModel:y,activeModelId:q,onSelect:Q}),(0,n.jsx)("div",{})]})}),eC&&(0,n.jsx)(eT,{count:eN.size,onCopy:eY,onCancel:e$}),ex&&(0,n.jsx)("div",{className:"relative z-10 flex justify-center pointer-events-none",style:{marginTop:-52},children:(0,n.jsx)("button",{onClick:()=>{eQ(),em.current=!0,ep(!1)},className:"pointer-events-auto rounded-full border bg-background/90 backdrop-blur p-3 shadow-md text-muted-foreground hover:text-foreground transition-colors",children:(0,n.jsx)(o.A,{className:"h-5 w-5"})})}),(0,n.jsx)("div",{className:"shrink-0",children:(0,n.jsx)(ef,{sessionId:e,onSend:eJ,onInterrupt:W,isResponding:v,bypassActive:N,onSetBypass:J,planMode:C,onSetPlanMode:V,thinkingLevel:S,onSetThinking:Y,currentModel:k,onSetModel:K,contextUsage:D,dismissKeyboard:el.dismissKeyboardOnSend,cwd:t,onCompact:eV,initData:I,activeModelId:q,hasQueuedMessage:_,queuedMessages:M,queuePaused:U,onCancelQueued:G,onDeleteQueued:X,onEditQueued:Z,onResumeQueue:ee,restoredText:et,onClearRestoredText:es,btw:P,onDismissBtw:en,onRestart:er})})]})}}}]);
@@ -1,8 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[63230],{49470:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>p});var r=n(95155),s=n(64577),a=n(99314),o=n(81402),c=n(73321),u=n(12115),l=n(30120),i=n(98757),d=n(45160),f=n(89239),m=n(60529);let h=`---
2
- name: my-agent
3
- description: What this agent does
4
- model: sonnet
5
- ---
6
-
7
- Your system prompt here.
8
- `;function p({params:e}){let{name:t}=(0,u.use)(e),n=(0,c.useSearchParams)(),x=(0,c.useRouter)(),g="new"===t,v=n.get("scope")||"user",w=n.get("cwd")||void 0;(0,l.si)(g?"New Agent":"Edit Agent");let[y,b]=(0,u.useState)(g?"":decodeURIComponent(t)),[N,j]=(0,u.useState)(g?h:""),[C,S]=(0,u.useState)(g?h:""),[k,E]=(0,u.useState)(!g),[R,$]=(0,u.useState)(!1),[L,_]=(0,u.useState)(null),[z,U]=(0,u.useState)(!1),A=N!==C;(0,u.useEffect)(()=>{if(g)return;let e=new URLSearchParams({scope:v});w&&e.set("cwd",w),fetch(`/api/agents/${encodeURIComponent(t)}?${e}`).then(e=>{if(!e.ok)throw Error("Not found");return e.json()}).then(e=>{j(e.content),S(e.content)}).catch(()=>{_("Failed to load agent")}).finally(()=>E(!1))},[g,t,v,w]);let O=(0,u.useCallback)(async()=>{let e=y.trim();if(!e)return void _("Name is required");if(!/^[a-zA-Z0-9_-]+$/.test(e))return void _("Name can only contain letters, numbers, hyphens, and underscores");$(!0),_(null);try{if(!(await fetch(`/api/agents/${encodeURIComponent(e)}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({scope:v,cwd:w,content:N})})).ok)throw Error("Save failed");if(S(N),_("Saved"),g){let t=new URLSearchParams({scope:v});w&&t.set("cwd",w),x.replace(`/agents/${encodeURIComponent(e)}?${t}`)}}catch{_("Failed to save")}finally{$(!1)}},[y,N,v,w,g,x]);return k?(0,r.jsx)("div",{className:"flex-1 min-h-0 p-4",children:(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:"Loading..."})}):(0,r.jsxs)("div",{className:"flex-1 min-h-0 overflow-y-auto p-4 space-y-4",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)("div",{className:"flex-1 min-w-0",children:g?(0,r.jsx)(m.p,{placeholder:"agent-name",value:y,onChange:e=>b(e.target.value),className:"font-mono"}):(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:"font-mono font-bold text-lg",children:y}),(0,r.jsx)(d.E,{variant:"secondary",children:"user"===v?"Global":"Project"})]})}),(0,r.jsxs)(f.$,{size:"sm",variant:"outline",onClick:()=>{let e=document.createElement("textarea");e.value=N,e.style.position="fixed",e.style.opacity="0",document.body.appendChild(e),e.select(),document.execCommand("copy"),document.body.removeChild(e),U(!0),setTimeout(()=>U(!1),1500)},children:[z?(0,r.jsx)(s.A,{className:"h-4 w-4 mr-1"}):(0,r.jsx)(a.A,{className:"h-4 w-4 mr-1"}),z?"Copied":"Copy"]}),(0,r.jsxs)(f.$,{size:"sm",onClick:O,disabled:R||!g&&!A,children:[(0,r.jsx)(o.A,{className:"h-4 w-4 mr-1"}),R?"Saving...":"Save"]})]}),L&&(0,r.jsx)("p",{className:`text-sm ${"Saved"===L?"text-green-600":"text-destructive"}`,children:L}),(0,r.jsx)(i.B,{value:N,onChange:j,language:"markdown",onSave:O,className:"flex-1"})]})}},60470:(e,t,n)=>{Promise.resolve().then(n.bind(n,49470))},98757:(e,t,n)=>{"use strict";n.d(t,{B:()=>h});var r=n(95155),s=n(13748),a=n(53649),o=n(27071),c=n(74059),u=n(89561),l=n(62465),i=n(12115);let d=u.Lz.theme({"&":{backgroundColor:"transparent"},".cm-gutters":{backgroundColor:"transparent",borderRight:"1px solid hsl(var(--border))"}});function f(){return!("u"<typeof document)&&document.documentElement.classList.contains("dark")}function m(e){switch(e){case"markdown":default:return(0,s.wD)();case"yaml":return(0,a.oQ)()}}function h({value:e,onChange:t,language:n,readOnly:s,className:a,onSave:p}){let x=(0,i.useRef)(null),g=(0,i.useRef)(null),v=(0,i.useRef)(new o.xx),w=(0,i.useRef)(new o.xx),y=(0,i.useRef)(new o.xx),b=(0,i.useRef)(t),N=(0,i.useRef)(p),j=(0,i.useRef)(e);return b.current=t,N.current=p,(0,i.useEffect)(()=>{if(!x.current)return;let e=o.$t.create({doc:j.current,extensions:[l.oQ,u.Lz.lineWrapping,v.current.of(f()?c.bM:d),w.current.of(m(n)),y.current.of(o.$t.readOnly.of(!!s)),u.w4.of([{key:"Mod-s",run:()=>(N.current?.(),!0)}]),u.Lz.updateListener.of(e=>{if(e.docChanged){let t=e.state.doc.toString();j.current=t,b.current(t)}})]}),t=new u.Lz({state:e,parent:x.current});return g.current=t,()=>{t.destroy(),g.current=null}},[]),(0,i.useEffect)(()=>{let t=g.current;t&&e!==j.current&&(j.current=e,t.dispatch({changes:{from:0,to:t.state.doc.length,insert:e}}))},[e]),(0,i.useEffect)(()=>{let e=g.current;if(!e)return;let t=new MutationObserver(()=>{e.dispatch({effects:v.current.reconfigure(f()?c.bM:d)})});return t.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),()=>t.disconnect()},[]),(0,i.useEffect)(()=>{let e=g.current;e&&e.dispatch({effects:w.current.reconfigure(m(n))})},[n]),(0,i.useEffect)(()=>{let e=g.current;e&&e.dispatch({effects:y.current.reconfigure(o.$t.readOnly.of(!!s))})},[s]),(0,r.jsx)("div",{ref:x,className:`overflow-auto rounded-md border bg-background text-sm [&_.cm-editor]:min-h-[200px] [&_.cm-editor.cm-focused]:outline-none ${a||""}`})}}},e=>{e.O(0,[6079,989,66997,6802,30120,28441,93794,77358],()=>e(e.s=60470)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[35130],{49194:(e,s,t)=>{Promise.resolve().then(t.bind(t,86646))},86646:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>x});var n=t(95155),a=t(2125),c=t(65738),l=t(73321),r=t(12115),o=t(30120),i=t(45160),d=t(89239),m=t(81477),u=t(42763);function x(){(0,o.si)("Agents");let e="u">typeof localStorage&&localStorage.getItem("cockpit-agents-cwd")||void 0,{agents:s,loading:t,deleteAgent:c}=function(e){let[s,t]=(0,r.useState)([]),[n,a]=(0,r.useState)(!0),c=(0,r.useCallback)(()=>{a(!0);let s=new URLSearchParams;e&&s.set("cwd",e),fetch(`/api/agents?${s}`).then(e=>e.json()).then(e=>t(e.agents)).catch(()=>t([])).finally(()=>a(!1))},[e]);(0,r.useEffect)(()=>{c()},[c]);let l=(0,r.useCallback)(async(s,t)=>{let n=new URLSearchParams({scope:t});"project"===t&&e&&n.set("cwd",e);try{if((await fetch(`/api/agents/${encodeURIComponent(s)}?${n}`,{method:"DELETE"})).ok)return c(),!0;return!1}catch{return!1}},[e,c]);return{agents:s,loading:n,refresh:c,deleteAgent:l}}(e),i=(0,l.useRouter)(),[x,p]=(0,r.useState)(null),[j,f]=(0,r.useState)(!1),g=s.filter(e=>"user"===e.scope),N=s.filter(e=>"project"===e.scope);function b(s){f(!1);let t=new URLSearchParams({scope:s});"project"===s&&e&&t.set("cwd",e),i.push(`/agents/new?${t}`)}function v(s,t){let n=new URLSearchParams({scope:t});"project"===t&&e&&n.set("cwd",e),i.push(`/agents/${encodeURIComponent(s)}?${n}`)}async function w(){x&&(await c(x.name,x.scope),p(null))}return(0,n.jsxs)("div",{className:"flex-1 min-h-0 overflow-y-auto p-4 space-y-4",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[(0,n.jsx)("div",{}),(0,n.jsxs)(d.$,{size:"sm",onClick:()=>f(!0),children:[(0,n.jsx)(a.A,{className:"h-4 w-4 mr-1"}),"New Agent"]})]}),t&&(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"Loading agents..."}),!t&&0===s.length&&(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"No custom agents found. Create one to get started."}),g.length>0&&(0,n.jsxs)(m.Zp,{children:[(0,n.jsx)(m.aR,{children:(0,n.jsx)(m.ZB,{className:"text-base",children:"Global"})}),(0,n.jsx)(m.Wu,{className:"space-y-1",children:g.map(e=>(0,n.jsx)(h,{name:e.name,scope:"user",description:e.description,onClick:()=>v(e.name,"user"),onDelete:()=>p({name:e.name,scope:"user"})},e.name))})]}),N.length>0&&(0,n.jsxs)(m.Zp,{children:[(0,n.jsx)(m.aR,{children:(0,n.jsx)(m.ZB,{className:"text-base",children:"Project"})}),(0,n.jsx)(m.Wu,{className:"space-y-1",children:N.map(e=>(0,n.jsx)(h,{name:e.name,scope:"project",description:e.description,onClick:()=>v(e.name,"project"),onDelete:()=>p({name:e.name,scope:"project"})},e.name))})]}),(0,n.jsx)(u.lG,{open:j,onOpenChange:f,children:(0,n.jsxs)(u.Cf,{children:[(0,n.jsx)(u.c7,{children:(0,n.jsx)(u.L3,{children:"New Agent"})}),(0,n.jsx)("p",{className:"text-sm text-muted-foreground mb-4",children:"Where should this agent be saved?"}),(0,n.jsxs)("div",{className:"flex gap-2",children:[(0,n.jsx)(d.$,{variant:"outline",className:"flex-1",onClick:()=>b("user"),children:"Global"}),(0,n.jsx)(d.$,{variant:"outline",className:"flex-1",onClick:()=>b("project"),disabled:!e,children:"Project"})]})]})}),(0,n.jsx)(u.lG,{open:!!x,onOpenChange:()=>p(null),children:(0,n.jsxs)(u.Cf,{children:[(0,n.jsx)(u.c7,{children:(0,n.jsx)(u.L3,{children:"Delete Agent"})}),(0,n.jsxs)("p",{className:"text-sm text-muted-foreground mb-4",children:["Delete ",(0,n.jsx)("span",{className:"font-mono font-bold",children:x?.name}),"? This cannot be undone."]}),(0,n.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,n.jsx)(d.$,{variant:"outline",onClick:()=>p(null),children:"Cancel"}),(0,n.jsx)(d.$,{variant:"destructive",onClick:w,children:"Delete"})]})]})})]})}function h({name:e,scope:s,description:t,onClick:a,onDelete:l}){return(0,n.jsxs)("div",{className:"flex items-center gap-3 rounded px-2 py-2 hover:bg-muted transition-colors",children:[(0,n.jsxs)("button",{type:"button",className:"flex-1 text-left min-w-0",onClick:a,children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("span",{className:"font-mono font-bold text-sm",children:e}),(0,n.jsx)(i.E,{variant:"secondary",className:"text-[10px]",children:"user"===s?"Global":"Project"})]}),t&&(0,n.jsx)("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:t})]}),(0,n.jsx)("button",{type:"button",className:"shrink-0 p-1 rounded hover:bg-destructive/10 text-muted-foreground hover:text-destructive transition-colors",onClick:e=>{e.stopPropagation(),l()},children:(0,n.jsx)(c.A,{className:"h-4 w-4"})})]})}}},e=>{e.O(0,[989,66997,30120,28441,93794,77358],()=>e(e.s=49194)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[909],{167:(e,t,s)=>{Promise.resolve().then(s.bind(s,55191))},11701:(e,t,s)=>{"use strict";s.d(t,{G:()=>l});var n=s(12115);let a="(min-width: 768px)";function l(){let[e,t]=(0,n.useState)(()=>window.matchMedia(a).matches);return(0,n.useEffect)(()=>{let e=window.matchMedia(a),s=e=>t(e.matches);return e.addEventListener("change",s),()=>e.removeEventListener("change",s)},[]),e}},55191:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>J});var n=s(95155),a=s(73321),l=s(30120),r=s(63690),i=s(20660),o=s(64577),c=s(44354),d=s(83212),u=s(19257),h=s(797),f=s(12363),m=s(92571),x=s(94088),p=s(1275),g=s(15480),j=s(19707),w=s(99537);let k=(0,w.A)("list",[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]]),y=(0,w.A)("arrow-up-from-line",[["path",{d:"m18 9-6-6-6 6",key:"kcunyi"}],["path",{d:"M12 3v14",key:"7cf3v8"}],["path",{d:"M5 21h14",key:"11awu3"}]]),N=(0,w.A)("sparkles",[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]]);var b=s(9383),v=s(65738),C=s(12115),S=s(93273),A=s(57594),E=s(89239),M=s(11701),F=s(22317),z=s(89323),R=s(40980);function P({checked:e,onChange:t,onClick:s}){return(0,n.jsx)("button",{type:"button",role:"checkbox","aria-checked":e,onClick:e=>{s?.(e),t()},className:(0,R.cn)("h-4 w-4 shrink-0 rounded border flex items-center justify-center transition-colors",e?"border-primary bg-primary text-primary-foreground":"border-muted-foreground/40 bg-transparent hover:border-muted-foreground/60"),children:e&&(0,n.jsx)(o.A,{className:"h-3 w-3",strokeWidth:3})})}function L(e){switch(e){case"added":case"untracked":return(0,n.jsx)(c.A,{className:"h-3.5 w-3.5 text-green-500 shrink-0"});case"deleted":return(0,n.jsx)(d.A,{className:"h-3.5 w-3.5 text-red-500 shrink-0"});case"renamed":return(0,n.jsx)(u.A,{className:"h-3.5 w-3.5 text-blue-500 shrink-0"});default:return(0,n.jsx)(h.A,{className:"h-3.5 w-3.5 text-yellow-500 shrink-0"})}}function O(){return!("u"<typeof document)&&document.documentElement.classList.contains("dark")}function T({files:e,selectedFile:t,checkedFiles:s,onFileClick:a,onContextMenu:l,onToggleFile:r,onToggleAll:i}){return 0===e.length?(0,n.jsx)("div",{className:"flex items-center justify-center py-12 text-sm text-muted-foreground",children:"Working tree clean"}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"px-3 py-1.5 border-b flex items-center gap-2",children:[(0,n.jsx)(P,{checked:s.size===e.length,onChange:i}),(0,n.jsx)("span",{className:"text-xs text-muted-foreground",children:"Select all"})]}),e.map(e=>(0,n.jsxs)("div",{className:(0,R.cn)("flex items-center gap-2 px-3 py-1.5 text-sm cursor-pointer border-b last:border-b-0 hover:bg-muted/50",t===e.path&&"bg-muted"),onClick:()=>a(e),onContextMenu:t=>l(t,e),children:[(0,n.jsx)(P,{checked:s.has(e.path),onChange:()=>r(e.path),onClick:e=>e.stopPropagation()}),L(e.status),(0,n.jsx)("span",{className:"font-mono text-xs truncate flex-1 min-w-0 text-left",dir:"rtl",title:e.path,children:(0,n.jsx)("bdo",{dir:"ltr",children:e.path})}),(e.additions>0||e.deletions>0)&&(0,n.jsxs)("span",{className:"text-xs font-mono shrink-0 flex items-center gap-1",children:[e.additions>0&&(0,n.jsxs)("span",{className:"text-green-500",children:["+",e.additions]}),e.deletions>0&&(0,n.jsxs)("span",{className:"text-red-500",children:["-",e.deletions]})]}),(0,n.jsx)("span",{className:(0,R.cn)("text-xs font-mono shrink-0","added"===e.status||"untracked"===e.status?"text-green-500":"deleted"===e.status?"text-red-500":"text-yellow-500"),children:function(e){switch(e){case"added":return"A";case"deleted":return"D";case"renamed":return"R";case"untracked":return"?";default:return"M"}}(e.status)})]},e.path))]})}function $({files:e,cwd:t,diffStyle:s,scrollToFile:a,onScrolled:l,onViewFile:o,checkedFiles:c,onToggleFile:d,refreshKey:u}){let[h,g]=(0,C.useState)(new Map),j=(0,C.useRef)(new Map),w=(0,C.useRef)(new Set),k=(0,C.useRef)(u),[y,N]=(0,C.useState)(new Set),b=(0,C.useCallback)(e=>{g(t=>{let s=new Map(t);return s.set(e,{diff:t.get(e)?.diff||null,fileDiff:t.get(e)?.fileDiff||null,loading:!0}),s}),fetch(`/api/git/diff?cwd=${encodeURIComponent(t)}&file=${encodeURIComponent(e)}`).then(e=>{if(!e.ok)throw Error("Failed");return e.json()}).then(t=>{let s=null;try{let e=(0,r.J2)(t.diff);e.length>0&&e[0].files.length>0&&(s=e[0].files[0],null!=t.oldContent&&(s.deletionLines=t.oldContent.split(/\r?\n/).map(e=>e+"\n")),null!=t.newContent&&(s.additionLines=t.newContent.split(/\r?\n/).map(e=>e+"\n")))}catch{}g(n=>{let a=new Map(n);return a.set(e,{diff:t.diff,fileDiff:s,loading:!1}),a})}).catch(()=>{g(t=>{let s=new Map(t);return s.set(e,{diff:null,fileDiff:null,loading:!1}),s})})},[t]);(0,C.useEffect)(()=>{let t=u!==k.current;k.current=u,t&&w.current.clear();let s=new Set(e.map(e=>e.path));for(let t of e.filter(e=>!w.current.has(e.path)))w.current.add(t.path),b(t.path);for(let e of w.current)s.has(e)||w.current.delete(e)},[e,b,u]),(0,C.useEffect)(()=>{if(!a)return;let e=j.current.get(a);e&&e.scrollIntoView({behavior:"smooth",block:"start"}),l()},[a,l]);let v=(0,C.useCallback)(e=>{N(t=>{let s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s})},[]),S=(0,C.useCallback)(e=>{d(e),c.has(e)||N(t=>new Set(t).add(e))},[d,c]);return 0===e.length?(0,n.jsx)("div",{className:"flex items-center justify-center h-full text-sm text-muted-foreground",children:"No changes"}):(0,n.jsx)("div",{className:"p-4 space-y-3",children:e.map(e=>{let t=h.get(e.path),a=c.has(e.path),l=y.has(e.path);return(0,n.jsx)("div",{ref:t=>{t&&j.current.set(e.path,t)},className:(0,R.cn)("rounded border overflow-clip",a&&!l&&"opacity-60"),children:l?(0,n.jsxs)("div",{className:"flex items-center gap-2 w-full px-4 py-2 text-sm text-muted-foreground",children:[(0,n.jsx)(P,{checked:a,onChange:()=>{d(e.path),a&&N(t=>{let s=new Set(t);return s.delete(e.path),s})},onClick:e=>e.stopPropagation()}),(0,n.jsxs)("button",{onClick:()=>v(e.path),className:"flex items-center gap-2 flex-1 min-w-0 hover:text-foreground transition-colors",children:[(0,n.jsx)(f.A,{className:"h-3.5 w-3.5 shrink-0"}),(0,n.jsx)("span",{className:"font-mono text-xs truncate text-left",dir:"rtl",title:e.path,children:(0,n.jsx)("bdo",{dir:"ltr",children:e.path})})]})]}):t?.loading&&!t.diff?(0,n.jsx)("div",{className:"flex items-center justify-center py-8",children:(0,n.jsx)(m.A,{className:"h-4 w-4 animate-spin text-muted-foreground"})}):t?.diff?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"sticky top-0 z-10 flex items-center gap-2 px-4 py-1.5 text-sm border-b bg-muted/80 backdrop-blur-sm","data-testid":"sticky-diff-header",children:[L(e.status),(0,n.jsx)("span",{className:"font-mono text-xs truncate flex-1 min-w-0 text-left",dir:"rtl",title:e.path,children:(0,n.jsx)("bdo",{dir:"ltr",children:e.path})}),(0,n.jsx)(P,{checked:a,onChange:()=>S(e.path),onClick:e=>e.stopPropagation()}),(0,n.jsx)("button",{onClick:()=>v(e.path),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",title:"Collapse",children:(0,n.jsx)(x.A,{className:"h-3 w-3"})}),(0,n.jsx)("button",{onClick:()=>o(e.path),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:(0,n.jsx)(p.A,{className:"h-3 w-3"})})]}),(0,n.jsx)(A.sU,{fallback:(0,n.jsx)("pre",{className:"p-4 text-xs text-muted-foreground whitespace-pre-wrap",children:t.diff}),children:t.fileDiff?(0,n.jsx)(i.Q,{fileDiff:t.fileDiff,options:{theme:{dark:"pierre-dark",light:"pierre-light"},themeType:O()?"dark":"light",overflow:"wrap",diffStyle:s,disableFileHeader:!0,hunkSeparators:"line-info",expansionLineCount:20,unsafeCSS:A.j8}}):(0,n.jsx)("pre",{className:"p-4 text-xs text-muted-foreground whitespace-pre-wrap",children:t.diff})})]}):(0,n.jsx)("div",{className:"px-4 py-3 text-xs text-muted-foreground",children:"No diff available"})},e.path)})})}function D({onResize:e}){let t=(0,C.useRef)(!1),s=(0,C.useRef)(0),a=(0,C.useCallback)(n=>{n.preventDefault(),t.current=!0,s.current=n.clientX;let a=n=>{if(!t.current)return;let a=s.current-n.clientX;s.current=n.clientX,e(a)},l=()=>{t.current=!1,document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",l),document.body.style.cursor="",document.body.style.userSelect=""};document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",a),document.addEventListener("mouseup",l)},[e]);return(0,n.jsx)("div",{onMouseDown:a,className:"w-1 shrink-0 cursor-col-resize bg-border hover:bg-primary/30 transition-colors"})}let I=new Map;function U({cwd:e,sessionId:t}){let s,c,d,{settings:u}=(0,F.t)(),{setSidebarContent:h,closeSidebar:w}=(0,l.E2)(),{subscribe:J}=(0,z.h)(),_=(0,a.useRouter)(),G=(0,M.G)(),[W,X]=(0,C.useState)(null),[q,H]=(0,C.useState)(!0),[Q,V]=(0,C.useState)(null),K=I.get(e)||{selectedFile:null,checkedFiles:new Set,commitMsg:"",commitPanelOpen:window.matchMedia("(min-width: 768px)").matches,pushOnCommit:!1,stackedMode:!0,chatRatio:.3},[Y,B]=(0,C.useState)(K.selectedFile),[Z,ee]=(0,C.useState)(null),[et,es]=(0,C.useState)(null),[en,ea]=(0,C.useState)(!1),[el,er]=(0,C.useState)(null),[ei,eo]=(0,C.useState)(K.commitMsg),[ec,ed]=(0,C.useState)(!1),[eu,eh]=(0,C.useState)(null),[ef,em]=(0,C.useState)(K.checkedFiles),[ex,ep]=(0,C.useState)(K.pushOnCommit),[eg,ej]=(0,C.useState)(K.commitPanelOpen),[ew,ek]=(0,C.useState)(!1),[ey,eN]=(0,C.useState)(!1),[eb,ev]=(0,C.useState)(null),[eC,eS]=(0,C.useState)(K.stackedMode),[eA,eE]=(0,C.useState)(K.chatRatio),[eM,eF]=(0,C.useState)(null),[ez,eR]=(0,C.useState)(0),eP=(0,C.useRef)(null);(0,C.useEffect)(()=>{I.set(e,{selectedFile:Y,checkedFiles:ef,commitMsg:ei,commitPanelOpen:eg,pushOnCommit:ex,stackedMode:eC,chatRatio:eA})},[e,Y,ef,ei,eg,ex,eC,eA]);let eL=(0,C.useCallback)(t=>{H(!0),V(null);let s=new URLSearchParams({cwd:e});t?.gitFetch&&s.set("fetch","1"),fetch(`/api/git/status?${s}`).then(e=>{if(!e.ok)throw Error("Failed");return e.json()}).then(e=>{X(e)}).catch(()=>V("Not a git repository")).finally(()=>H(!1))},[e]);(0,C.useEffect)(()=>{eL()},[eL]);let eO=(0,C.useRef)(null);(0,C.useEffect)(()=>{if(t)return J(e=>{if("session:status"!==e.type||!("sessionId"in e)||e.sessionId!==t)return;let s=eO.current;eO.current=e.status,"running"===s&&"idle"===e.status&&(eL(),eR(e=>e+1))})},[t,J,eL]);let eT=(0,C.useCallback)(t=>{ea(!0),ee(null),es(null),fetch(`/api/git/diff?cwd=${encodeURIComponent(e)}&file=${encodeURIComponent(t)}`).then(e=>{if(!e.ok)throw Error("Failed");return e.json()}).then(e=>{ee(e.diff);try{let t=(0,r.J2)(e.diff);if(t.length>0&&t[0].files.length>0){let s=t[0].files[0];null!=e.oldContent&&(s.deletionLines=e.oldContent.split(/\r?\n/).map(e=>e+"\n")),null!=e.newContent&&(s.additionLines=e.newContent.split(/\r?\n/).map(e=>e+"\n")),es(s)}}catch{}}).catch(()=>ee(null)).finally(()=>ea(!1))},[e]);(0,C.useEffect)(()=>{Y&&!eC&&eT(Y)},[eC,Y,eT]),(0,C.useEffect)(()=>{if(!W||0===W.files.length||Y||eC)return;let e=W.files[0];B(e.path),eT(e.path)},[W,Y,eC,eT]);let e$=(0,C.useCallback)(e=>{eC?eF(e.path):(B(e.path),eT(e.path),er(null),w())},[eC,eT,w]),eD=(0,C.useCallback)((e,t)=>{e.preventDefault(),er({x:e.clientX,y:e.clientY,file:t})},[]),eI=(0,C.useCallback)(async t=>{er(null);try{if(!(await fetch("/api/git/discard",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cwd:e,file:t.path,status:t.status})})).ok)throw Error("Failed");Y===t.path&&(B(null),ee(null)),eL()}catch{}},[e,Y,eL]),eU=(0,C.useCallback)(async()=>{if(ei.trim()&&0!==ef.size){ed(!0),eh(null);try{let t=await fetch("/api/git/commit",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cwd:e,message:ei.trim(),files:Array.from(ef),push:ex})});if(!t.ok){let e=await t.json();throw Error(e.error||"Failed to commit")}eh({ok:!0,message:ex?"Committed and pushed":"Committed"}),eo(""),em(new Set),B(null),ee(null),eL()}catch(e){eh({ok:!1,message:e instanceof Error?e.message:"Failed"})}finally{ed(!1)}}},[e,ei,ef,ex,eL]),eJ=(0,C.useCallback)(async()=>{if(0!==ef.size){ek(!0);try{let t=await fetch("/api/git/generate-message",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cwd:e,files:Array.from(ef)})}),s=await t.json();if(!t.ok)throw Error(s.error||"Failed");s.message&&eo(s.message)}catch(e){console.error("[generate-message]",e)}finally{ek(!1)}}},[e,ef]),e_=(0,C.useCallback)(async()=>{eN(!0),ev(null);try{let t=await fetch("/api/git/push",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cwd:e})});if(!t.ok){let e=await t.json();throw Error(e.error||"Failed to push")}ev({ok:!0,message:"Pushed"}),eL()}catch(e){ev({ok:!1,message:e instanceof Error?e.message:"Failed"})}finally{eN(!1)}},[e,eL]),eG=(0,C.useCallback)(e=>{em(t=>{let s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s})},[]),eW=(0,C.useCallback)(()=>{if(!W)return;let e=W.files.map(e=>e.path);em(t=>t.size===e.length?new Set:new Set(e))},[W]),eX=(0,C.useCallback)(e=>{let t=window.innerWidth||1;eE(s=>Math.max(.15,Math.min(.5,s+e/t)))},[]),eq=(0,C.useCallback)(()=>{eF(null)},[]),eH=(0,C.useCallback)(t=>{let s=t.startsWith("/")?t:`${e}/${t}`;_.push(`/files?cwd=${encodeURIComponent(e)}&file=${encodeURIComponent(s)}`)},[e,_]);if((0,C.useEffect)(()=>W&&0!==W.files.length?(h((0,n.jsx)(T,{files:W.files,selectedFile:eC?null:Y,checkedFiles:ef,onFileClick:e$,onContextMenu:eD,onToggleFile:eG,onToggleAll:eW})),()=>h(null)):void h(null),[W,Y,ef,eC,e$,eD,eG,eW,h]),(0,C.useEffect)(()=>{if(!el)return;let e=e=>{eP.current&&!eP.current.contains(e.target)&&er(null)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[el]),q)return(0,n.jsx)("div",{className:"flex items-center justify-center flex-1",children:(0,n.jsx)(m.A,{className:"h-6 w-6 animate-spin text-muted-foreground"})});if(Q)return(0,n.jsx)("div",{className:"flex items-center justify-center flex-1",children:(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:Q})});if(!W)return null;let eQ=G&&!!t;return(0,n.jsxs)("div",{className:"flex flex-col flex-1 min-h-0",children:[(0,n.jsxs)("div",{className:"shrink-0 border-b px-4 py-2 flex items-center gap-3",children:[(0,n.jsx)(g.A,{className:"h-4 w-4 text-muted-foreground"}),(0,n.jsx)("span",{className:"font-mono text-sm font-bold",children:W.branch}),(0,n.jsxs)("span",{className:"text-xs text-muted-foreground",children:[W.files.length," file",1!==W.files.length?"s":""," changed"]}),(s=W.files.reduce((e,t)=>e+t.additions,0),c=W.files.reduce((e,t)=>e+t.deletions,0),s>0||c>0?(0,n.jsxs)("span",{className:"text-xs font-mono flex items-center gap-1",children:[s>0&&(0,n.jsxs)("span",{className:"text-green-500",children:["+",s]}),c>0&&(0,n.jsxs)("span",{className:"text-red-500",children:["-",c]})]}):null),W.ahead>0&&(0,n.jsxs)("span",{className:"text-xs text-muted-foreground",children:[W.ahead," unpushed"]}),eb&&(0,n.jsxs)("span",{className:(0,R.cn)("text-xs flex items-center gap-1",eb.ok?"text-green-500":"text-red-500"),children:[eb.ok&&(0,n.jsx)(o.A,{className:"h-3 w-3"}),eb.message]}),(0,n.jsx)("div",{className:"flex-1"}),W.files.length>0&&(0,n.jsxs)("div",{className:"flex items-center gap-0.5 rounded-md border p-0.5",children:[(0,n.jsx)("button",{onClick:()=>eS(!0),className:(0,R.cn)("rounded px-1.5 py-0.5 text-xs transition-colors",eC?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"),title:"Stacked view",children:(0,n.jsx)(j.A,{className:"h-3.5 w-3.5"})}),(0,n.jsx)("button",{onClick:()=>eS(!1),className:(0,R.cn)("rounded px-1.5 py-0.5 text-xs transition-colors",eC?"text-muted-foreground hover:text-foreground":"bg-primary text-primary-foreground"),title:"Single file view",children:(0,n.jsx)(k,{className:"h-3.5 w-3.5"})})]}),W.ahead>0&&(0,n.jsxs)(E.$,{variant:"outline",size:"sm",onClick:e_,disabled:ey,className:"gap-1.5",children:[ey?(0,n.jsx)(m.A,{className:"h-3.5 w-3.5 animate-spin"}):(0,n.jsx)(y,{className:"h-3.5 w-3.5"}),"Push"]}),(0,n.jsx)(E.$,{variant:"ghost",size:"sm",onClick:()=>eL({gitFetch:!0}),children:"Refresh"})]}),(0,n.jsxs)("div",{className:"flex-1 min-h-0 flex flex-row",children:[(0,n.jsxs)("div",{className:"flex-1 min-w-0 flex flex-col",children:[(0,n.jsx)("div",{className:"flex-1 min-h-0 overflow-y-auto",children:eC?(0,n.jsx)($,{files:W.files,cwd:e,diffStyle:u.diffStyle,scrollToFile:eM,onScrolled:eq,onViewFile:eH,checkedFiles:ef,onToggleFile:eG,refreshKey:ez}):en?(0,n.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,n.jsx)(m.A,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):Y&&Z?(0,n.jsx)("div",{className:"p-4",children:(0,n.jsxs)("div",{className:"rounded-lg border overflow-hidden",children:[(d=W.files.find(e=>e.path===Y))?(0,n.jsxs)("div",{className:"sticky top-0 z-10 flex items-center gap-2 px-4 py-1.5 text-sm border-b bg-muted/80 backdrop-blur-sm",children:[L(d.status),(0,n.jsx)("span",{className:"font-mono text-xs truncate flex-1 min-w-0 text-left",dir:"rtl",title:d.path,children:(0,n.jsx)("bdo",{dir:"ltr",children:d.path})}),(0,n.jsx)(P,{checked:ef.has(d.path),onChange:()=>eG(d.path),onClick:e=>e.stopPropagation()}),(0,n.jsx)("button",{onClick:()=>eH(d.path),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",title:"Open in editor",children:(0,n.jsx)(p.A,{className:"h-3 w-3"})})]}):null,(0,n.jsx)(A.sU,{fallback:(0,n.jsx)("pre",{className:"p-4 text-xs text-muted-foreground whitespace-pre-wrap",children:Z}),children:et?(0,n.jsx)(i.Q,{fileDiff:et,options:{theme:{dark:"pierre-dark",light:"pierre-light"},themeType:O()?"dark":"light",overflow:"wrap",diffStyle:u.diffStyle,disableFileHeader:!0,hunkSeparators:"line-info",expansionLineCount:20,unsafeCSS:A.j8}}):(0,n.jsx)("pre",{className:"p-4 text-xs text-muted-foreground whitespace-pre-wrap",children:Z})})]})}):(0,n.jsx)("div",{className:"flex items-center justify-center h-full text-sm text-muted-foreground text-center px-4",children:W.files.length>0?"Select a file from the sidebar to view changes":"No changes"})}),W.files.length>0&&(0,n.jsxs)("div",{className:"shrink-0 border-t",children:[(0,n.jsxs)("button",{onClick:()=>ej(!eg),className:"w-full px-4 py-2 flex items-center gap-2 text-sm font-medium hover:bg-muted/50",children:[eg?(0,n.jsx)(f.A,{className:"h-3.5 w-3.5"}):(0,n.jsx)(x.A,{className:"h-3.5 w-3.5"}),"Commit (",ef.size," file",1!==ef.size?"s":"",")"]}),eg&&(0,n.jsxs)("div",{className:"px-4 pb-3 space-y-2",children:[(0,n.jsx)("textarea",{value:ei,onChange:e=>eo(e.target.value),placeholder:"Commit message...",className:"w-full rounded border bg-background px-3 py-2 text-sm resize-none focus:outline-none focus:ring-1 focus:ring-ring",rows:3}),(0,n.jsxs)("div",{className:"flex items-center gap-3",children:[(0,n.jsxs)(E.$,{size:"sm",variant:"outline",onClick:eJ,disabled:ew||0===ef.size,className:"gap-1.5",children:[ew?(0,n.jsx)(m.A,{className:"h-3.5 w-3.5 animate-spin"}):(0,n.jsx)(N,{className:"h-3.5 w-3.5"}),ew?"Generating...":"Generate"]}),(0,n.jsxs)("label",{className:"flex items-center gap-1.5 text-xs text-muted-foreground cursor-pointer",children:[(0,n.jsx)(P,{checked:ex,onChange:()=>ep(!ex)}),"Push after commit"]}),(0,n.jsx)("div",{className:"flex-1"}),eu&&(0,n.jsxs)("span",{className:(0,R.cn)("text-xs flex items-center gap-1",eu.ok?"text-green-500":"text-red-500"),children:[eu.ok&&(0,n.jsx)(o.A,{className:"h-3 w-3"}),eu.message]}),(0,n.jsxs)(E.$,{size:"sm",onClick:eU,disabled:ec||!ei.trim()||0===ef.size,className:"gap-1.5",children:[ec?(0,n.jsx)(m.A,{className:"h-3.5 w-3.5 animate-spin"}):(0,n.jsx)(b.A,{className:"h-3.5 w-3.5"}),ex?"Commit & Push":"Commit"]})]})]})]})]}),eQ&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(D,{onResize:eX}),(0,n.jsx)("div",{className:"flex flex-col shrink-0 border-l min-h-0",style:{width:`${100*eA}%`},children:(0,n.jsx)(S.I,{sessionId:t,cwd:e})})]})]}),el&&(0,n.jsx)("div",{ref:eP,className:"fixed z-50 rounded border bg-background shadow-lg py-1 min-w-[140px]",style:{left:el.x,top:el.y},children:(0,n.jsxs)("button",{onClick:()=>eI(el.file),className:"w-full px-3 py-1.5 text-sm text-left hover:bg-muted flex items-center gap-2 text-red-500",children:[(0,n.jsx)(v.A,{className:"h-3.5 w-3.5"}),"Discard changes"]})})]})}function J(){let e=(0,a.useSearchParams)(),t=e.get("cwd")||"",s=e.get("sessionId");(0,l.si)("Changes"),(0,l.mq)(t||void 0);let{sessionId:r}=function(e,t){let[s,n]=(0,C.useState)(t||null),[a,l]=(0,C.useState)(!t);return(0,C.useEffect)(()=>{if(t){n(t),l(!1);return}let s=!1;return l(!0),Promise.all([fetch("/api/sessions").then(e=>e.ok?e.json():null),fetch("/api/sessions/pinned").then(e=>e.ok?e.json():null)]).then(([t,a])=>{if(s)return;let r=t?.groups||[],i=new Set(a?.pinned||[]),o=r.find(t=>t.cwd===e);if(!o){n(null),l(!1);return}let c=o.sessions.filter(e=>i.has(e.id)||"running"===e.status).sort((e,t)=>t.lastActiveAt-e.lastActiveAt);n(c.length>0?c[0].id:null),l(!1)}).catch(()=>{s||(n(null),l(!1))}),()=>{s=!0}},[e,t]),{sessionId:s,loading:a}}(t,s);return t?(0,n.jsx)(U,{cwd:t,sessionId:r}):(0,n.jsx)("div",{className:"flex items-center justify-center h-full text-sm text-muted-foreground",children:"No working directory specified."})}}},e=>{e.O(0,[989,66997,22086,30120,93273,28441,93794,77358],()=>e(e.s=167)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[32805],{54669:(e,t,r)=>{Promise.resolve().then(r.bind(r,55165))},55165:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>h});var n=r(95155),s=r(64577),c=r(99314),a=r(81402),l=r(73321),o=r(12115),u=r(30120),d=r(98757),i=r(45160),f=r(89239);let m={user:{title:"~/.claude/CLAUDE.md",badge:"Global"},project:{title:"CLAUDE.md",badge:"Project"},"project-hidden":{title:".claude/CLAUDE.md",badge:"Project"}};function h(){let e=(0,l.useSearchParams)(),t=e.get("scope")||"user",r=e.get("cwd")||void 0,h=m[t];(0,u.si)("Edit CLAUDE.md");let[x,p]=(0,o.useState)(""),[g,v]=(0,o.useState)(""),[b,j]=(0,o.useState)(!0),[w,y]=(0,o.useState)(!1),[C,E]=(0,o.useState)(null),[N,k]=(0,o.useState)(!1),S=x!==g;(0,o.useEffect)(()=>{let e=new URLSearchParams({scope:t});r&&e.set("cwd",r),fetch(`/api/claude-md?${e}`).then(e=>e.json()).then(e=>{p(e.content),v(e.content)}).catch(()=>E("Failed to load")).finally(()=>j(!1))},[t,r]);let L=(0,o.useCallback)(async()=>{y(!0),E(null);try{if(!(await fetch("/api/claude-md",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({scope:t,cwd:r,content:x})})).ok)throw Error("Save failed");v(x),E("Saved")}catch{E("Failed to save")}finally{y(!1)}},[t,r,x]);return b?(0,n.jsx)("div",{className:"flex-1 min-h-0 p-4",children:(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"Loading..."})}):(0,n.jsxs)("div",{className:"flex-1 min-h-0 flex flex-col p-4 gap-3",children:[(0,n.jsxs)("div",{className:"flex items-center gap-3",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[(0,n.jsx)("span",{className:"font-mono font-bold text-sm truncate",children:h.title}),(0,n.jsx)(i.E,{variant:"secondary",className:"shrink-0",children:h.badge})]}),(0,n.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[C&&(0,n.jsx)("p",{className:`text-sm ${"Saved"===C?"text-green-600":"text-destructive"}`,children:C}),(0,n.jsxs)(f.$,{size:"sm",variant:"outline",onClick:()=>{let e=document.createElement("textarea");e.value=x,e.style.position="fixed",e.style.opacity="0",document.body.appendChild(e),e.select(),document.execCommand("copy"),document.body.removeChild(e),k(!0),setTimeout(()=>k(!1),1500)},children:[N?(0,n.jsx)(s.A,{className:"h-4 w-4 mr-1"}):(0,n.jsx)(c.A,{className:"h-4 w-4 mr-1"}),N?"Copied":"Copy"]}),(0,n.jsxs)(f.$,{size:"sm",onClick:L,disabled:w||!S,children:[(0,n.jsx)(a.A,{className:"h-4 w-4 mr-1"}),w?"Saving...":"Save"]})]})]}),(0,n.jsx)("div",{className:"flex-1 min-h-0",children:(0,n.jsx)(d.B,{value:x,onChange:e=>{p(e),E(null)},language:"markdown",onSave:L,className:"h-full [&_.cm-editor]:min-h-[400px]"})})]})}},98757:(e,t,r)=>{"use strict";r.d(t,{B:()=>h});var n=r(95155),s=r(13748),c=r(53649),a=r(27071),l=r(74059),o=r(89561),u=r(62465),d=r(12115);let i=o.Lz.theme({"&":{backgroundColor:"transparent"},".cm-gutters":{backgroundColor:"transparent",borderRight:"1px solid hsl(var(--border))"}});function f(){return!("u"<typeof document)&&document.documentElement.classList.contains("dark")}function m(e){switch(e){case"markdown":default:return(0,s.wD)();case"yaml":return(0,c.oQ)()}}function h({value:e,onChange:t,language:r,readOnly:s,className:c,onSave:x}){let p=(0,d.useRef)(null),g=(0,d.useRef)(null),v=(0,d.useRef)(new a.xx),b=(0,d.useRef)(new a.xx),j=(0,d.useRef)(new a.xx),w=(0,d.useRef)(t),y=(0,d.useRef)(x),C=(0,d.useRef)(e);return w.current=t,y.current=x,(0,d.useEffect)(()=>{if(!p.current)return;let e=a.$t.create({doc:C.current,extensions:[u.oQ,o.Lz.lineWrapping,v.current.of(f()?l.bM:i),b.current.of(m(r)),j.current.of(a.$t.readOnly.of(!!s)),o.w4.of([{key:"Mod-s",run:()=>(y.current?.(),!0)}]),o.Lz.updateListener.of(e=>{if(e.docChanged){let t=e.state.doc.toString();C.current=t,w.current(t)}})]}),t=new o.Lz({state:e,parent:p.current});return g.current=t,()=>{t.destroy(),g.current=null}},[]),(0,d.useEffect)(()=>{let t=g.current;t&&e!==C.current&&(C.current=e,t.dispatch({changes:{from:0,to:t.state.doc.length,insert:e}}))},[e]),(0,d.useEffect)(()=>{let e=g.current;if(!e)return;let t=new MutationObserver(()=>{e.dispatch({effects:v.current.reconfigure(f()?l.bM:i)})});return t.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),()=>t.disconnect()},[]),(0,d.useEffect)(()=>{let e=g.current;e&&e.dispatch({effects:b.current.reconfigure(m(r))})},[r]),(0,d.useEffect)(()=>{let e=g.current;e&&e.dispatch({effects:j.current.reconfigure(a.$t.readOnly.of(!!s))})},[s]),(0,n.jsx)("div",{ref:p,className:`overflow-auto rounded-md border bg-background text-sm [&_.cm-editor]:min-h-[200px] [&_.cm-editor.cm-focused]:outline-none ${c||""}`})}}},e=>{e.O(0,[6079,989,66997,6802,30120,28441,93794,77358],()=>e(e.s=54669)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[29604],{38316:(e,s,t)=>{Promise.resolve().then(t.bind(t,80520))},80520:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>h});var n=t(95155),l=t(2125),c=t(73321),r=t(12115),a=t(30120),i=t(45160),o=t(89239),d=t(81477),u=t(42763),x=t(53972);function h(){(0,a.si)("CLAUDE.md");let{files:e,cwds:s,loading:t}=function(){let[e,s]=(0,r.useState)([]),[t,n]=(0,r.useState)([]),[l,c]=(0,r.useState)(!0),a=(0,r.useCallback)(()=>{c(!0),fetch("/api/claude-md").then(e=>e.json()).then(e=>{s(e.files),n(e.cwds)}).catch(()=>{s([]),n([])}).finally(()=>c(!1))},[]);return(0,r.useEffect)(()=>{a()},[a]),{files:e,cwds:t,loading:l,refresh:a}}(),i=(0,c.useRouter)(),[u,h]=(0,r.useState)(!1);function f(e){let s=new URLSearchParams({scope:e.scope});e.cwd&&s.set("cwd",e.cwd),i.push(`/claude-md/edit?${s}`)}let j=e.find(e=>"user"===e.scope),w=e.filter(e=>"user"!==e.scope),N=new Map;for(let e of w){if(!e.cwd)continue;let s=N.get(e.cwd)||[];s.push(e),N.set(e.cwd,s)}let C=new Set;for(let e of w)e.cwd&&e.exists&&C.add(e.cwd);let g=s.filter(e=>(N.get(e)||[]).filter(e=>e.exists).length<2);return(0,n.jsxs)("div",{className:"flex-1 min-h-0 overflow-y-auto p-4 space-y-4",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[(0,n.jsx)("div",{}),g.length>0&&(0,n.jsxs)(o.$,{size:"sm",onClick:()=>h(!0),children:[(0,n.jsx)(l.A,{className:"h-4 w-4 mr-1"}),"New"]})]}),t&&(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"Loading..."}),!t&&j&&(0,n.jsxs)(d.Zp,{children:[(0,n.jsx)(d.aR,{children:(0,n.jsx)(d.ZB,{className:"text-base",children:"Global"})}),(0,n.jsx)(d.Wu,{className:"space-y-1",children:(0,n.jsx)(m,{file:j,onClick:()=>f(j)})})]}),!t&&Array.from(N.entries()).map(([e,s])=>{let t=s.filter(e=>e.exists);if(0===t.length)return null;let l=(0,x.uk)(e)||e;return(0,n.jsxs)(d.Zp,{children:[(0,n.jsx)(d.aR,{children:(0,n.jsx)(d.ZB,{className:"text-base",children:l})}),(0,n.jsx)(d.Wu,{className:"space-y-1",children:t.map(e=>(0,n.jsx)(m,{file:e,onClick:()=>f(e)},e.scope))})]},e)}),(0,n.jsx)(p,{open:u,onOpenChange:h,cwds:g,byCwd:N,onSelect:function(e,s){h(!1);let t=new URLSearchParams({scope:e,cwd:s});i.push(`/claude-md/edit?${t}`)}})]})}function m({file:e,onClick:s}){return(0,n.jsx)("button",{type:"button",className:"flex w-full items-center gap-3 rounded px-2 py-2 hover:bg-muted transition-colors text-left",onClick:s,children:(0,n.jsx)("div",{className:"flex-1 min-w-0",children:(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("span",{className:"font-mono font-bold text-sm",children:function(e){switch(e){case"user":return"~/.claude/CLAUDE.md";case"project":return"CLAUDE.md";case"project-hidden":return".claude/CLAUDE.md"}}(e.scope)}),(0,n.jsx)(i.E,{variant:"secondary",className:"text-[10px]",children:"user"===e.scope?"Global":"Project"})]})})})}function p({open:e,onOpenChange:s,cwds:t,byCwd:l,onSelect:c}){let[a,i]=(0,r.useState)(null);function d(e){let s=l.get(e)||[],t=[];return s.some(e=>"project"===e.scope&&e.exists)||t.push("project"),s.some(e=>"project-hidden"===e.scope&&e.exists)||t.push("project-hidden"),t}return(0,n.jsx)(u.lG,{open:e,onOpenChange:e=>{s(e),e||i(null)},children:(0,n.jsxs)(u.Cf,{children:[(0,n.jsx)(u.c7,{children:(0,n.jsx)(u.L3,{children:a?"Choose type":"Choose project"})}),!a&&(0,n.jsx)("div",{className:"space-y-1 max-h-64 overflow-y-auto",children:t.map(e=>{let s=(0,x.uk)(e)||e;return(0,n.jsxs)("button",{className:"flex w-full items-center rounded px-3 py-2 text-sm hover:bg-muted transition-colors text-left",onClick:()=>{let s;1===(s=d(e)).length?c(s[0],e):i(e)},children:[(0,n.jsx)("span",{className:"font-mono",children:s}),(0,n.jsx)("span",{className:"ml-2 text-xs text-muted-foreground truncate",children:e})]},e)})}),a&&(0,n.jsx)("div",{className:"flex gap-2",children:d(a).map(e=>(0,n.jsx)(o.$,{variant:"outline",className:"flex-1",onClick:()=>c(e,a),children:"project"===e?"CLAUDE.md":".claude/CLAUDE.md"},e))})]})})}}},e=>{e.O(0,[989,66997,30120,28441,93794,77358],()=>e(e.s=38316)),_N_E=e.O()}]);
@@ -1,6 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[36994],{96326:(e,t,n)=>{Promise.resolve().then(n.bind(n,98334))},98334:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>p});var r=n(95155),s=n(64577),a=n(99314),o=n(81402),c=n(73321),u=n(12115),d=n(30120),l=n(98757),i=n(45160),m=n(89239),f=n(60529);let h=`---
2
- description: What this command does
3
- ---
4
-
5
- Your command prompt here. Use $ARGUMENTS for user input.
6
- `;function p({params:e}){let{name:t}=(0,u.use)(e),n=(0,c.useSearchParams)(),x=(0,c.useRouter)(),v="new"===t,g=n.get("scope")||"user",w=n.get("cwd")||void 0;(0,d.si)(v?"New Command":"Edit Command");let[y,b]=(0,u.useState)(v?"":decodeURIComponent(t)),[N,C]=(0,u.useState)(v?h:""),[j,S]=(0,u.useState)(v?h:""),[E,R]=(0,u.useState)(!v),[k,$]=(0,u.useState)(!1),[L,U]=(0,u.useState)(null),[_,z]=(0,u.useState)(!1),O=N!==j;(0,u.useEffect)(()=>{if(v)return;let e=new URLSearchParams({scope:g});w&&e.set("cwd",w),fetch(`/api/commands/${encodeURIComponent(t)}?${e}`).then(e=>{if(!e.ok)throw Error("Not found");return e.json()}).then(e=>{C(e.content),S(e.content)}).catch(()=>{U("Failed to load command")}).finally(()=>R(!1))},[v,t,g,w]);let P=(0,u.useCallback)(async()=>{let e=y.trim();if(!e)return void U("Name is required");if(!/^[a-zA-Z0-9_-]+$/.test(e))return void U("Name can only contain letters, numbers, hyphens, and underscores");$(!0),U(null);try{if(!(await fetch(`/api/commands/${encodeURIComponent(e)}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({scope:g,cwd:w,content:N})})).ok)throw Error("Save failed");if(S(N),U("Saved"),v){let t=new URLSearchParams({scope:g});w&&t.set("cwd",w),x.replace(`/commands/${encodeURIComponent(e)}?${t}`)}}catch{U("Failed to save")}finally{$(!1)}},[y,N,g,w,v,x]);return E?(0,r.jsx)("div",{className:"flex-1 min-h-0 p-4",children:(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:"Loading..."})}):(0,r.jsxs)("div",{className:"flex-1 min-h-0 overflow-y-auto p-4 space-y-4",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)("div",{className:"flex-1 min-w-0",children:v?(0,r.jsx)(f.p,{placeholder:"command-name",value:y,onChange:e=>b(e.target.value),className:"font-mono"}):(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:"font-mono font-bold text-lg",children:y}),(0,r.jsx)(i.E,{variant:"secondary",children:"user"===g?"Global":"Project"})]})}),(0,r.jsxs)(m.$,{size:"sm",variant:"outline",onClick:()=>{let e=document.createElement("textarea");e.value=N,e.style.position="fixed",e.style.opacity="0",document.body.appendChild(e),e.select(),document.execCommand("copy"),document.body.removeChild(e),z(!0),setTimeout(()=>z(!1),1500)},children:[_?(0,r.jsx)(s.A,{className:"h-4 w-4 mr-1"}):(0,r.jsx)(a.A,{className:"h-4 w-4 mr-1"}),_?"Copied":"Copy"]}),(0,r.jsxs)(m.$,{size:"sm",onClick:P,disabled:k||!v&&!O,children:[(0,r.jsx)(o.A,{className:"h-4 w-4 mr-1"}),k?"Saving...":"Save"]})]}),L&&(0,r.jsx)("p",{className:`text-sm ${"Saved"===L?"text-green-600":"text-destructive"}`,children:L}),(0,r.jsx)(l.B,{value:N,onChange:C,language:"markdown",onSave:P,className:"flex-1"})]})}},98757:(e,t,n)=>{"use strict";n.d(t,{B:()=>h});var r=n(95155),s=n(13748),a=n(53649),o=n(27071),c=n(74059),u=n(89561),d=n(62465),l=n(12115);let i=u.Lz.theme({"&":{backgroundColor:"transparent"},".cm-gutters":{backgroundColor:"transparent",borderRight:"1px solid hsl(var(--border))"}});function m(){return!("u"<typeof document)&&document.documentElement.classList.contains("dark")}function f(e){switch(e){case"markdown":default:return(0,s.wD)();case"yaml":return(0,a.oQ)()}}function h({value:e,onChange:t,language:n,readOnly:s,className:a,onSave:p}){let x=(0,l.useRef)(null),v=(0,l.useRef)(null),g=(0,l.useRef)(new o.xx),w=(0,l.useRef)(new o.xx),y=(0,l.useRef)(new o.xx),b=(0,l.useRef)(t),N=(0,l.useRef)(p),C=(0,l.useRef)(e);return b.current=t,N.current=p,(0,l.useEffect)(()=>{if(!x.current)return;let e=o.$t.create({doc:C.current,extensions:[d.oQ,u.Lz.lineWrapping,g.current.of(m()?c.bM:i),w.current.of(f(n)),y.current.of(o.$t.readOnly.of(!!s)),u.w4.of([{key:"Mod-s",run:()=>(N.current?.(),!0)}]),u.Lz.updateListener.of(e=>{if(e.docChanged){let t=e.state.doc.toString();C.current=t,b.current(t)}})]}),t=new u.Lz({state:e,parent:x.current});return v.current=t,()=>{t.destroy(),v.current=null}},[]),(0,l.useEffect)(()=>{let t=v.current;t&&e!==C.current&&(C.current=e,t.dispatch({changes:{from:0,to:t.state.doc.length,insert:e}}))},[e]),(0,l.useEffect)(()=>{let e=v.current;if(!e)return;let t=new MutationObserver(()=>{e.dispatch({effects:g.current.reconfigure(m()?c.bM:i)})});return t.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),()=>t.disconnect()},[]),(0,l.useEffect)(()=>{let e=v.current;e&&e.dispatch({effects:w.current.reconfigure(f(n))})},[n]),(0,l.useEffect)(()=>{let e=v.current;e&&e.dispatch({effects:y.current.reconfigure(o.$t.readOnly.of(!!s))})},[s]),(0,r.jsx)("div",{ref:x,className:`overflow-auto rounded-md border bg-background text-sm [&_.cm-editor]:min-h-[200px] [&_.cm-editor.cm-focused]:outline-none ${a||""}`})}}},e=>{e.O(0,[6079,989,66997,6802,30120,28441,93794,77358],()=>e(e.s=96326)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[96494],{36456:(e,s,n)=>{"use strict";n.r(s),n.d(s,{default:()=>x});var t=n(95155),a=n(2125),c=n(65738),l=n(73321),o=n(12115),r=n(30120),i=n(45160),d=n(89239),m=n(81477),u=n(42763);function x(){(0,r.si)("Commands");let e="u">typeof localStorage&&localStorage.getItem("cockpit-agents-cwd")||void 0,{commands:s,loading:n,deleteCommand:c}=function(e){let[s,n]=(0,o.useState)([]),[t,a]=(0,o.useState)(!0),c=(0,o.useCallback)(()=>{a(!0);let s=new URLSearchParams;e&&s.set("cwd",e),fetch(`/api/commands?${s}`).then(e=>e.json()).then(e=>n(e.commands)).catch(()=>n([])).finally(()=>a(!1))},[e]);(0,o.useEffect)(()=>{c()},[c]);let l=(0,o.useCallback)(async(s,n)=>{let t=new URLSearchParams({scope:n});"project"===n&&e&&t.set("cwd",e);try{if((await fetch(`/api/commands/${encodeURIComponent(s)}?${t}`,{method:"DELETE"})).ok)return c(),!0;return!1}catch{return!1}},[e,c]);return{commands:s,loading:t,refresh:c,deleteCommand:l}}(e),i=(0,l.useRouter)(),[x,p]=(0,o.useState)(null),[j,f]=(0,o.useState)(!1),N=s.filter(e=>"user"===e.scope),C=s.filter(e=>"project"===e.scope);function b(s){f(!1);let n=new URLSearchParams({scope:s});"project"===s&&e&&n.set("cwd",e),i.push(`/commands/new?${n}`)}function g(s,n){let t=new URLSearchParams({scope:n});"project"===n&&e&&t.set("cwd",e),i.push(`/commands/${encodeURIComponent(s)}?${t}`)}async function v(){x&&(await c(x.name,x.scope),p(null))}return(0,t.jsxs)("div",{className:"flex-1 min-h-0 overflow-y-auto p-4 space-y-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("div",{}),(0,t.jsxs)(d.$,{size:"sm",onClick:()=>f(!0),children:[(0,t.jsx)(a.A,{className:"h-4 w-4 mr-1"}),"New Command"]})]}),n&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"Loading commands..."}),!n&&0===s.length&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"No custom commands found. Create one to get started."}),N.length>0&&(0,t.jsxs)(m.Zp,{children:[(0,t.jsx)(m.aR,{children:(0,t.jsx)(m.ZB,{className:"text-base",children:"Global"})}),(0,t.jsx)(m.Wu,{className:"space-y-1",children:N.map(e=>(0,t.jsx)(h,{name:e.name,scope:"user",description:e.description,onClick:()=>g(e.name,"user"),onDelete:()=>p({name:e.name,scope:"user"})},e.name))})]}),C.length>0&&(0,t.jsxs)(m.Zp,{children:[(0,t.jsx)(m.aR,{children:(0,t.jsx)(m.ZB,{className:"text-base",children:"Project"})}),(0,t.jsx)(m.Wu,{className:"space-y-1",children:C.map(e=>(0,t.jsx)(h,{name:e.name,scope:"project",description:e.description,onClick:()=>g(e.name,"project"),onDelete:()=>p({name:e.name,scope:"project"})},e.name))})]}),(0,t.jsx)(u.lG,{open:j,onOpenChange:f,children:(0,t.jsxs)(u.Cf,{children:[(0,t.jsx)(u.c7,{children:(0,t.jsx)(u.L3,{children:"New Command"})}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground mb-4",children:"Where should this command be saved?"}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(d.$,{variant:"outline",className:"flex-1",onClick:()=>b("user"),children:"Global"}),(0,t.jsx)(d.$,{variant:"outline",className:"flex-1",onClick:()=>b("project"),disabled:!e,children:"Project"})]})]})}),(0,t.jsx)(u.lG,{open:!!x,onOpenChange:()=>p(null),children:(0,t.jsxs)(u.Cf,{children:[(0,t.jsx)(u.c7,{children:(0,t.jsx)(u.L3,{children:"Delete Command"})}),(0,t.jsxs)("p",{className:"text-sm text-muted-foreground mb-4",children:["Delete ",(0,t.jsx)("span",{className:"font-mono font-bold",children:x?.name}),"? This cannot be undone."]}),(0,t.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,t.jsx)(d.$,{variant:"outline",onClick:()=>p(null),children:"Cancel"}),(0,t.jsx)(d.$,{variant:"destructive",onClick:v,children:"Delete"})]})]})})]})}function h({name:e,scope:s,description:n,onClick:a,onDelete:l}){return(0,t.jsxs)("div",{className:"flex items-center gap-3 rounded px-2 py-2 hover:bg-muted transition-colors",children:[(0,t.jsxs)("button",{type:"button",className:"flex-1 text-left min-w-0",onClick:a,children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"font-mono font-bold text-sm",children:e}),(0,t.jsx)(i.E,{variant:"secondary",className:"text-[10px]",children:"user"===s?"Global":"Project"})]}),n&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:n})]}),(0,t.jsx)("button",{type:"button",className:"shrink-0 p-1 rounded hover:bg-destructive/10 text-muted-foreground hover:text-destructive transition-colors",onClick:e=>{e.stopPropagation(),l()},children:(0,t.jsx)(c.A,{className:"h-4 w-4"})})]})}},89850:(e,s,n)=>{Promise.resolve().then(n.bind(n,36456))}},e=>{e.O(0,[989,66997,30120,28441,93794,77358],()=>e(e.s=89850)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[79851],{10793:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>A});var n=s(95155),a=s(73321),r=s(30120),l=s(92571),i=s(25182);let c=(0,s(99537).A)("text-wrap",[["path",{d:"m16 16-3 3 3 3",key:"117b85"}],["path",{d:"M3 12h14.5a1 1 0 0 1 0 7H13",key:"18xa6z"}],["path",{d:"M3 19h6",key:"1ygdsz"}],["path",{d:"M3 5h18",key:"1u36vt"}]]);var u=s(12115),d=s(18189),o=s(12363),h=s(76721),f=s(95660),m=s(14225),x=s(9107),p=s(40980);let g=new Map;async function w(e){let t=g.get(e);if(t)return t;let s=new URLSearchParams({path:e,includeFiles:"true",showHidden:"true"}),n=await fetch(`/api/filesystem/browse?${s}`);if(!n.ok)return[];let a=((await n.json()).entries||[]).map(e=>({name:e.name,path:e.path,type:e.type}));return g.set(e,a),a}let j=new Map;function y(e){let t=j.get(e);return t||(t=new Set,j.set(e,t)),t}function k({node:e,depth:t,selectedFile:s,onSelectFile:a,expandedSet:r,onToggleExpand:i}){let c="directory"===e.type,d=r.has(e.path),[j,y]=(0,u.useState)(g.get(e.path)||[]),[N,v]=(0,u.useState)(!1),b=(0,u.useCallback)(()=>{c?(i(e.path),r.has(e.path)||g.has(e.path)||(v(!0),w(e.path).then(e=>{y(e),v(!1)}))):a(e.path)},[c,e.path,i,a,r]);return(0,u.useEffect)(()=>{if(c&&d&&0===j.length&&!N){let t=g.get(e.path);t?y(t):(v(!0),w(e.path).then(e=>{y(e),v(!1)}))}},[c,d,j.length,N,e.path]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:(0,p.cn)("flex items-center gap-1 px-2 py-1 text-sm cursor-pointer hover:bg-muted/50",!c&&s===e.path&&"bg-muted"),style:{paddingLeft:`${16*t+8}px`},onClick:b,children:[c?(0,n.jsxs)(n.Fragment,{children:[N?(0,n.jsx)(l.A,{className:"h-3.5 w-3.5 shrink-0 animate-spin text-muted-foreground"}):d?(0,n.jsx)(o.A,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}):(0,n.jsx)(h.A,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),d?(0,n.jsx)(f.A,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}):(0,n.jsx)(m.A,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("span",{className:"w-3.5 shrink-0"}),(0,n.jsx)(x.A,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"})]}),(0,n.jsx)("span",{className:"font-mono text-xs truncate",children:e.name})]}),c&&d&&j.map(e=>(0,n.jsx)(k,{node:e,depth:t+1,selectedFile:s,onSelectFile:a,expandedSet:r,onToggleExpand:i},e.path))]})}function N({cwd:e,selectedFile:t,onSelectFile:s}){let[a,r]=(0,u.useState)(g.get(e)||[]),[i,c]=(0,u.useState)(0===a.length),[d,o]=(0,u.useState)(()=>y(e)),h=(0,u.useRef)(e);(0,u.useEffect)(()=>{h.current=e,o(y(e));let t=g.get(e);t?(r(t),c(!1)):(c(!0),w(e).then(t=>{h.current===e&&(r(t),c(!1))}))},[e]);let f=(0,u.useCallback)(t=>{o(s=>{let n=new Set(s);return n.has(t)?n.delete(t):n.add(t),j.set(e,n),n})},[e]);return i?(0,n.jsx)("div",{className:"flex items-center justify-center py-12",children:(0,n.jsx)(l.A,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):0===a.length?(0,n.jsx)("div",{className:"flex items-center justify-center py-12 text-sm text-muted-foreground",children:"Empty directory"}):(0,n.jsx)("div",{className:"py-1",children:a.map(e=>(0,n.jsx)(k,{node:e,depth:0,selectedFile:t,onSelectFile:s,expandedSet:d,onToggleExpand:f},e.path))})}var v=s(64233),b=s(53972);let S=new Map,E=new Map;function F({cwd:e,initialFile:t}){let{setSidebarContent:s,closeSidebar:a}=(0,r.E2)(),[o,h]=(0,u.useState)(()=>t||S.get(e)||null),[f,m]=(0,u.useState)(null),[x,p]=(0,u.useState)(!1),[g,w]=(0,u.useState)(!1),[j,y]=(0,u.useState)(!1),k=(0,u.useRef)(0);(0,u.useEffect)(()=>{"1"===localStorage.getItem("cockpit-files-wrap")&&w(!0),"1"===localStorage.getItem("cockpit-files-preview")&&y(!0)},[]);let A=(0,u.useCallback)(()=>{w(e=>{let t=!e;return localStorage.setItem("cockpit-files-wrap",t?"1":"0"),t})},[]),C=(0,u.useCallback)(()=>{y(e=>{let t=!e;return localStorage.setItem("cockpit-files-preview",t?"1":"0"),t})},[]),M=(0,u.useCallback)(t=>{h(t),S.set(e,t),window.innerWidth<768&&a()},[e,a]);if((0,u.useEffect)(()=>(s((0,n.jsx)(N,{cwd:e,selectedFile:o,onSelectFile:M})),()=>s(null)),[e,o,M,s]),(0,u.useEffect)(()=>{if(!o)return void m(null);let e=E.get(o);if(e)return void m(e);let t=++k.current;p(!0),fetch(`/api/filesystem/read?path=${encodeURIComponent(o)}`).then(e=>{if(!e.ok)throw Error("Failed to read file");return e.json()}).then(e=>{if(k.current===t){if(E.size>=50){let e=E.keys().next().value;void 0!==e&&E.delete(e)}E.set(o,e),m(e)}}).catch(()=>{k.current===t&&m(null)}).finally(()=>{k.current===t&&p(!1)})},[o]),!o)return(0,n.jsx)("div",{className:"flex items-center justify-center h-full text-sm text-muted-foreground",children:"Select a file to view"});if(x)return(0,n.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,n.jsx)(l.A,{className:"h-5 w-5 animate-spin text-muted-foreground"})});if(!f)return(0,n.jsx)("div",{className:"flex items-center justify-center h-full text-sm text-muted-foreground",children:"Failed to read file"});let _=function(e,t){if(t.startsWith(e)){let s=t.slice(e.length);return s.startsWith("/")?s.slice(1):s}return t}(e,o),I=(0,b.uk)(o)||o,$=_.slice(0,_.length-I.length),z=(0,d.WG)(o),R="markdown"===z||"mdx"===z,W=R&&j;return(0,n.jsxs)("div",{className:"flex flex-col h-full min-h-0",children:[(0,n.jsxs)("div",{className:"shrink-0 flex items-center gap-1 border-b px-4 py-2 font-mono text-xs",children:[$&&(0,n.jsx)("span",{className:"text-muted-foreground",children:$}),(0,n.jsx)("span",{className:"font-bold",children:I}),f.truncated&&(0,n.jsx)("span",{className:"ml-2 text-muted-foreground",children:"(truncated to 100KB)"}),(0,n.jsxs)("div",{className:"ml-auto flex items-center gap-1",children:[R&&(0,n.jsx)("button",{type:"button",onClick:C,"aria-label":j?"Show source":"Show preview","aria-pressed":j,title:j?"Show source":"Show preview",className:`flex items-center justify-center rounded p-1 hover:bg-accent ${j?"text-foreground":"text-muted-foreground"}`,children:(0,n.jsx)(i.A,{className:"h-3.5 w-3.5"})}),!W&&(0,n.jsx)("button",{type:"button",onClick:A,"aria-label":g?"Disable line wrap":"Enable line wrap","aria-pressed":g,title:g?"Disable line wrap":"Enable line wrap",className:`flex items-center justify-center rounded p-1 hover:bg-accent ${g?"text-foreground":"text-muted-foreground"}`,children:(0,n.jsx)(c,{className:"h-3.5 w-3.5"})})]})]}),f.binary?(0,n.jsx)("div",{className:"flex items-center justify-center flex-1 text-sm text-muted-foreground",children:"Binary file"}):W?(0,n.jsx)(v.Y,{content:f.content,className:"flex-1 min-h-0 overflow-y-auto p-4"}):(0,n.jsx)("div",{className:"flex-1 min-h-0 overflow-auto",children:(0,n.jsx)(d.NG,{code:f.content,language:z,dark:!("u"<typeof document)&&document.documentElement.classList.contains("dark"),fullHeight:!0,wrap:g})})]})}function A(){let e=(0,a.useSearchParams)(),t=e.get("cwd")||"",s=e.get("file");return((0,r.si)("Files"),(0,r.mq)(t||void 0),t)?(0,n.jsx)(F,{cwd:t,initialFile:s}):(0,n.jsx)("div",{className:"flex items-center justify-center h-full text-sm text-muted-foreground",children:"No working directory specified."})}},25182:(e,t,s)=>{"use strict";s.d(t,{A:()=>n});let n=(0,s(99537).A)("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},88737:(e,t,s)=>{Promise.resolve().then(s.bind(s,10793))}},e=>{e.O(0,[989,66997,30120,28441,93794,77358],()=>e(e.s=88737)),_N_E=e.O()}]);
@@ -1,6 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[78177],{27557:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>x});var a=r(95155),s=r(64577),n=r(99314),o=r(81402),l=r(73321),c=r(12115),u=r(30120),i=r(98757),d=r(45160),f=r(89239);let m=["SessionStart","UserPromptSubmit","PreToolUse","PermissionRequest","PostToolUse","PostToolUseFailure","Stop","SubagentStart","SubagentStop","PreCompact","PostCompact","SessionEnd"],h=[{value:"global",label:"Global"},{value:"project",label:"Project"},{value:"project-local",label:"Local"}],p=`[
2
- {
3
- "type": "command",
4
- "command": "echo hook fired"
5
- }
6
- ]`;function x({params:e}){let{event:t}=(0,c.use)(e),r=(0,l.useSearchParams)(),b="new"===t,g=b?"":decodeURIComponent(t),v=r.get("scope")||"global",j=r.get("filePath")||"",S=r.get("cwd")||void 0;(0,u.si)(b?"New Hook":g);let[y,w]=(0,c.useState)(g),[k,N]=(0,c.useState)(v),[C,E]=(0,c.useState)(b?p:""),[P,R]=(0,c.useState)(b?p:""),[_,L]=(0,c.useState)(!b),[$,O]=(0,c.useState)(!1),[U,z]=(0,c.useState)(null),[T,A]=(0,c.useState)(!1),M=C!==P;(0,c.useEffect)(()=>{if(b)return;let e=new URLSearchParams;S&&e.set("cwd",S),fetch(`/api/hooks?${e}`).then(e=>e.json()).then(e=>{let t=e.hooks.find(e=>e.event===g&&e.scope===v);if(t){let e=JSON.stringify(t.hooks,null,2);E(e),R(e)}else z("Hook not found")}).catch(()=>z("Failed to load")).finally(()=>L(!1))},[b,g,v,S]);let F=(0,c.useCallback)(()=>!b&&j?j:"global"===k?"__global__":"project"===k&&S?`${S}/.claude/settings.json`:"project-local"===k&&S?`${S}/.claude/settings.local.json`:"",[b,j,k,S]),J=(0,c.useCallback)(async()=>{let e,t=b?y:g;if(!t)return void z("Select an event");try{if(e=JSON.parse(C),!Array.isArray(e))throw Error("Must be an array")}catch(e){z("Invalid JSON: must be an array of hook objects");return}O(!0),z(null);let r=F(),a=new URLSearchParams;S&&a.set("cwd",S);try{let s=await fetch(`/api/hooks?${a}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({filePath:r,event:t,hooks:e})});if(!s.ok){let e=await s.json().catch(()=>({}));throw Error(e.error||"Save failed")}R(C),z("Saved")}catch(e){z(e instanceof Error?e.message:"Failed to save")}finally{O(!1)}},[C,b,y,g,S,F]);return _?(0,a.jsx)("div",{className:"flex-1 min-h-0 p-4",children:(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:"Loading..."})}):(0,a.jsxs)("div",{className:"flex-1 min-h-0 overflow-y-auto p-4 space-y-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"flex-1 min-w-0",children:b?(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsxs)("select",{value:y,onChange:e=>w(e.target.value),className:"rounded-md border border-input bg-background px-3 py-1.5 text-sm",children:[(0,a.jsx)("option",{value:"",children:"Select event..."}),m.map(e=>(0,a.jsx)("option",{value:e,children:e},e))]}),(0,a.jsx)("select",{value:k,onChange:e=>N(e.target.value),className:"rounded-md border border-input bg-background px-3 py-1.5 text-sm",children:h.map(e=>(0,a.jsx)("option",{value:e.value,disabled:"global"!==e.value&&!S,children:e.label},e.value))})]}):(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"font-mono font-bold text-lg",children:g}),(0,a.jsx)(d.E,{variant:"secondary",children:"global"===v?"Global":"project"===v?"Project":"Local"})]})}),(0,a.jsxs)(f.$,{size:"sm",variant:"outline",onClick:()=>{let e=document.createElement("textarea");e.value=C,e.style.position="fixed",e.style.opacity="0",document.body.appendChild(e),e.select(),document.execCommand("copy"),document.body.removeChild(e),A(!0),setTimeout(()=>A(!1),1500)},children:[T?(0,a.jsx)(s.A,{className:"h-4 w-4 mr-1"}):(0,a.jsx)(n.A,{className:"h-4 w-4 mr-1"}),T?"Copied":"Copy"]}),(0,a.jsxs)(f.$,{size:"sm",onClick:J,disabled:$||!b&&!M,children:[(0,a.jsx)(o.A,{className:"h-4 w-4 mr-1"}),$?"Saving...":"Save"]})]}),U&&(0,a.jsx)("p",{className:`text-sm ${"Saved"===U?"text-green-600":"text-destructive"}`,children:U}),(0,a.jsx)(i.B,{value:C,onChange:E,language:"json",onSave:J,className:"flex-1"})]})}},58853:(e,t,r)=>{Promise.resolve().then(r.bind(r,27557))},98757:(e,t,r)=>{"use strict";r.d(t,{B:()=>h});var a=r(95155),s=r(13748),n=r(53649),o=r(27071),l=r(74059),c=r(89561),u=r(62465),i=r(12115);let d=c.Lz.theme({"&":{backgroundColor:"transparent"},".cm-gutters":{backgroundColor:"transparent",borderRight:"1px solid hsl(var(--border))"}});function f(){return!("u"<typeof document)&&document.documentElement.classList.contains("dark")}function m(e){switch(e){case"markdown":default:return(0,s.wD)();case"yaml":return(0,n.oQ)()}}function h({value:e,onChange:t,language:r,readOnly:s,className:n,onSave:p}){let x=(0,i.useRef)(null),b=(0,i.useRef)(null),g=(0,i.useRef)(new o.xx),v=(0,i.useRef)(new o.xx),j=(0,i.useRef)(new o.xx),S=(0,i.useRef)(t),y=(0,i.useRef)(p),w=(0,i.useRef)(e);return S.current=t,y.current=p,(0,i.useEffect)(()=>{if(!x.current)return;let e=o.$t.create({doc:w.current,extensions:[u.oQ,c.Lz.lineWrapping,g.current.of(f()?l.bM:d),v.current.of(m(r)),j.current.of(o.$t.readOnly.of(!!s)),c.w4.of([{key:"Mod-s",run:()=>(y.current?.(),!0)}]),c.Lz.updateListener.of(e=>{if(e.docChanged){let t=e.state.doc.toString();w.current=t,S.current(t)}})]}),t=new c.Lz({state:e,parent:x.current});return b.current=t,()=>{t.destroy(),b.current=null}},[]),(0,i.useEffect)(()=>{let t=b.current;t&&e!==w.current&&(w.current=e,t.dispatch({changes:{from:0,to:t.state.doc.length,insert:e}}))},[e]),(0,i.useEffect)(()=>{let e=b.current;if(!e)return;let t=new MutationObserver(()=>{e.dispatch({effects:g.current.reconfigure(f()?l.bM:d)})});return t.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),()=>t.disconnect()},[]),(0,i.useEffect)(()=>{let e=b.current;e&&e.dispatch({effects:v.current.reconfigure(m(r))})},[r]),(0,i.useEffect)(()=>{let e=b.current;e&&e.dispatch({effects:j.current.reconfigure(o.$t.readOnly.of(!!s))})},[s]),(0,a.jsx)("div",{ref:x,className:`overflow-auto rounded-md border bg-background text-sm [&_.cm-editor]:min-h-[200px] [&_.cm-editor.cm-focused]:outline-none ${n||""}`})}}},e=>{e.O(0,[6079,989,66997,6802,30120,28441,93794,77358],()=>e(e.s=58853)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[40992],{64025:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>d});var o=s(95155),n=s(73321),a=s(30120),r=s(45160),l=s(81477),c=s(12115);let i={global:"Global",project:"Project","project-local":"Local"},h=new Set(["UserPromptSubmit","PreToolUse","PermissionRequest","Stop","SubagentStop"]);function d(){(0,a.si)("Hooks");let e="u">typeof localStorage&&localStorage.getItem("cockpit-agents-cwd")||void 0,{hooks:t,loading:s}=function(e){let[t,s]=(0,c.useState)([]),[o,n]=(0,c.useState)([]),[a,r]=(0,c.useState)(!0),l=(0,c.useCallback)(()=>{r(!0);let t=new URLSearchParams;e&&t.set("cwd",e),fetch(`/api/hooks?${t}`).then(e=>e.json()).then(e=>{s(e.hooks),n(e.events)}).catch(()=>s([])).finally(()=>r(!1))},[e]);(0,c.useEffect)(()=>{l()},[l]);let i=(0,c.useCallback)(async(t,s,o)=>{let n=new URLSearchParams;e&&n.set("cwd",e);try{if((await fetch(`/api/hooks?${n}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({filePath:t,event:s,hooks:o})})).ok)return l(),!0;return!1}catch{return!1}},[e,l]);return{hooks:t,events:o,loading:a,refresh:l,saveHooks:i}}(e),d=(0,n.useRouter)(),m={};for(let e of t){let t=e.scope;m[t]||(m[t]=[]),m[t].push(e)}return(0,o.jsxs)("div",{className:"flex-1 min-h-0 overflow-y-auto p-4 space-y-4",children:[(0,o.jsxs)("div",{className:"flex items-center justify-between",children:[(0,o.jsx)("div",{}),(0,o.jsx)("button",{className:"inline-flex items-center rounded-md bg-primary px-3 py-1.5 text-sm font-medium text-primary-foreground hover:bg-primary/90",onClick:function(){let t=new URLSearchParams;e&&t.set("cwd",e),d.push(`/hooks/new?${t}`)},children:"New Hook"})]}),s&&(0,o.jsx)("p",{className:"text-sm text-muted-foreground",children:"Loading hooks..."}),!s&&0===t.length&&(0,o.jsx)("p",{className:"text-sm text-muted-foreground",children:"No hooks configured. Hooks let you run commands, HTTP requests, or prompts at key points in the agent lifecycle."}),Object.entries(m).map(([t,s])=>(0,o.jsxs)(l.Zp,{children:[(0,o.jsx)(l.aR,{children:(0,o.jsx)(l.ZB,{className:"text-base",children:i[t]||t})}),(0,o.jsx)(l.Wu,{className:"space-y-1",children:s.map(t=>(0,o.jsx)("button",{type:"button",className:"flex w-full items-center gap-3 rounded px-2 py-2 hover:bg-muted transition-colors text-left",onClick:()=>{var s;let o;return s=t.event,o=new URLSearchParams({scope:t.scope,filePath:t.filePath}),void(e&&o.set("cwd",e),d.push(`/hooks/${encodeURIComponent(s)}?${o}`))},children:(0,o.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,o.jsxs)("div",{className:"flex items-center gap-2",children:[(0,o.jsx)("span",{className:"font-mono font-bold text-sm",children:t.event}),h.has(t.event)&&(0,o.jsx)(r.E,{variant:"outline",className:"text-[10px]",children:"can block"})]}),(0,o.jsxs)("p",{className:"text-xs text-muted-foreground mt-0.5",children:[t.hooks.length," hook",1!==t.hooks.length?"s":""," — ",t.hooks.map(e=>e.type).join(", ")]})]})},`${t.event}-${t.scope}`))})]},t))]})}},70532:(e,t,s)=>{Promise.resolve().then(s.bind(s,64025))}},e=>{e.O(0,[989,66997,30120,28441,93794,77358],()=>e(e.s=70532)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[58179],{8081:(e,s,t)=>{"use strict";t.d(s,{AX:()=>r,Mi:()=>d,bs:()=>a,iz:()=>o,r5:()=>l,zQ:()=>i});let n=[{alias:"haiku",version:"4.5",modelId:"claude-haiku-4-5-20251001",displayName:"Haiku 4.5",description:"Fastest",supportsExtendedContext:!1,contextWindow:2e5,isDefault:!0},{alias:"sonnet",version:"4.6",modelId:"claude-sonnet-4-6",displayName:"Sonnet 4.6",description:"Balanced",supportsExtendedContext:!0,contextWindow:2e5,isDefault:!0},{alias:"opus",version:"4.6",modelId:"claude-opus-4-6",displayName:"Opus 4.6",description:"Previous generation",supportsExtendedContext:!0,contextWindow:2e5},{alias:"opus",version:"4.7",modelId:"claude-opus-4-7",displayName:"Opus 4.7",description:"Most capable",supportsExtendedContext:!0,contextWindow:2e5,isDefault:!0}];function a(e){if(e)return n.find(s=>s.modelId===e)}function l(e){return n.filter(s=>s.alias===e)}function i(e){return n.find(s=>s.alias===e&&s.isDefault)??l(e)[0]}function r(e){if(!e)return null;let s=e.replace(/\[.*\]$/,"");return"opus"===s||"sonnet"===s||"haiku"===s?i(s)??null:a(s)??null}function o(e){if(!e||"haiku"===e.alias)return[];let s=["low","medium","high"];return"opus"===e.alias&&"4.7"===e.version&&s.push("xhigh"),s.push("max"),s}function d(e){return e&&"haiku"!==e.alias?"opus"===e.alias&&"4.7"===e.version?"xhigh":"sonnet"===e.alias?"medium":"high":null}},10895:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>w});var n=t(95155),a=t(9005),l=t(31966),i=t(2125),r=t(73321),o=t(12115),d=t(30120),c=t(41158),u=t(89239),m=t(81477),x=t(60529),h=t(8081),p=t(84949);let f=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],y=["Read","Write","Edit","Bash","Bash git","Bash npm","Bash ls","Grep","Glob","Agent","WebFetch","WebSearch"],j={low:"Low",medium:"Medium",high:"High",xhigh:"XHigh",max:"Max"},g=(0,h.zQ)("sonnet")?.modelId||"",v="w-full rounded-md border bg-background px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-ring";function b({checked:e,onChange:s}){return(0,n.jsx)("button",{type:"button",role:"switch","aria-checked":e,onClick:()=>s(!e),className:`relative inline-flex h-5 w-9 shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors ${e?"bg-primary":"bg-muted"}`,children:(0,n.jsx)("span",{className:`pointer-events-none inline-block h-4 w-4 rounded-full bg-background shadow-lg transition-transform ${e?"translate-x-4":"translate-x-0"}`})})}function N({value:e,onChange:s,onRemove:t,canRemove:l}){let i="simple"===e.type;return(0,n.jsxs)("div",{className:"border rounded-md p-3 space-y-2",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[(0,n.jsxs)("div",{className:"flex gap-2",children:[(0,n.jsx)(u.$,{variant:i?"default":"outline",size:"sm",onClick:()=>s({type:"simple",frequency:"daily",time:"09:00"}),children:"Simple"}),(0,n.jsx)(u.$,{variant:i?"outline":"default",size:"sm",onClick:()=>s({type:"cron",expression:"0 9 * * *"}),children:"Cron"})]}),l&&(0,n.jsx)("button",{type:"button",onClick:t,className:"text-muted-foreground hover:text-destructive",children:(0,n.jsx)(a.A,{className:"h-4 w-4"})})]}),i?(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsxs)("select",{value:e.frequency,onChange:t=>s({...e,frequency:t.target.value}),className:v,children:[(0,n.jsx)("option",{value:"hourly",children:"Hourly"}),(0,n.jsx)("option",{value:"daily",children:"Daily"}),(0,n.jsx)("option",{value:"weekly",children:"Weekly"}),(0,n.jsx)("option",{value:"monthly",children:"Monthly"})]}),"hourly"!==e.frequency&&(0,n.jsx)(x.p,{type:"time",value:e.time||"09:00",onChange:t=>s({...e,time:t.target.value})}),"weekly"===e.frequency&&(0,n.jsx)("select",{value:e.dayOfWeek??1,onChange:t=>s({...e,dayOfWeek:Number(t.target.value)}),className:v,children:f.map((e,s)=>(0,n.jsx)("option",{value:s,children:e},e))}),"monthly"===e.frequency&&(0,n.jsx)(x.p,{type:"number",min:1,max:31,value:e.dayOfMonth??1,onChange:t=>s({...e,dayOfMonth:Number(t.target.value)}),placeholder:"Day of month"})]}):(0,n.jsx)(x.p,{value:e.expression,onChange:e=>s({type:"cron",expression:e.target.value}),placeholder:"0 9 * * 1-5",className:"font-mono"}),(0,n.jsx)("p",{className:"text-xs text-muted-foreground",children:(0,p.Bg)(e)})]})}function w(){let e=(0,r.useParams)(),s=(0,r.useSearchParams)(),t=e.id,f="new"===t,v=f?s.get("from"):null,w=(0,r.useRouter)();(0,d.si)(v?"Duplicate Job":f?"New Job":"Edit Job");let[k,C]=(0,o.useState)(""),[$,S]=(0,o.useState)(""),[M,W]=(0,o.useState)(""),[D,E]=(0,o.useState)(!0),[T,z]=(0,o.useState)([{type:"simple",frequency:"daily",time:"09:00"}]),[A,O]=(0,o.useState)(g),[I,B]=(0,o.useState)(!1),[P,R]=(0,o.useState)("medium"),[Z,q]=(0,o.useState)(30),[F,J]=(0,o.useState)(!1),[H,K]=(0,o.useState)([]),[L,U]=(0,o.useState)(""),[_,Q]=(0,o.useState)([]),[X,G]=(0,o.useState)({}),[V,Y]=(0,o.useState)({}),[ee,es]=(0,o.useState)(new Set),[et,en]=(0,o.useState)([]),[ea,el]=(0,o.useState)(!1),[ei,er]=(0,o.useState)(90),[eo,ed]=(0,o.useState)(!1),[ec,eu]=(0,o.useState)(!1),[em,ex]=(0,o.useState)(!f||!!v),eh=A?(0,h.bs)(A):null,ep=eh?.alias||null,ef=ep?(0,h.r5)(ep):[],ey=ef.length>1,ej=eh?(0,h.iz)(eh):[],eg=y.filter(e=>!H.includes(e));function ev(e){let s=e.trim();s&&!H.includes(s)&&K([...H,s]),U("")}let eb=(0,o.useCallback)((e,s)=>{C(s?`${e.name} (copy)`:e.name),S(e.cwd),W(e.prompt),E(e.enabled),z((0,p.KU)(e));let t=e.model||"",n=/\[1m\]$/i.test(t),a=t.replace(/\[.*\]$/,""),l=(0,h.AX)(a);O(l?.modelId||g),B(n),R(e.thinkingLevel||(0,h.Mi)(l)||""),q(e.maxDurationMinutes??30),J(e.bypassPermissions??!1),K(e.allowedTools||[]),Q(e.mcpServers||[]),G(e.mcpToolFilters||{}),el(e.skipIfMissed??!1),er(e.retentionDays??90)},[]),eN=(0,o.useCallback)(async()=>{let e=v||(f?null:t);if(e)try{let s=await fetch(`/api/jobs/${e}`);if(!s.ok)return void w.push("/jobs");let t=await s.json();eb(t.job,!!v)}finally{ex(!1)}},[t,f,v,w,eb]);async function ew(){eu(!0);let e=eh?.supportsExtendedContext&&I?`${A}[1m]`:A,s={name:k,cwd:$,prompt:M,enabled:D,schedule:T[0],schedules:T,model:e,thinkingLevel:P||void 0,maxDurationMinutes:Z,bypassPermissions:F,allowedTools:H.length>0?H:void 0,mcpServers:_.length>0?_:void 0,mcpToolFilters:Object.keys(X).length>0?X:void 0,skipIfMissed:ea,retentionDays:ei};try{let e=f?"/api/jobs":`/api/jobs/${t}`,n=f?"POST":"PUT",a=await fetch(e,{method:n,headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});if(a.ok){let e=await a.json(),s=f?e.job.id:t;w.push(`/jobs/${s}`)}}finally{eu(!1)}}return((0,o.useEffect)(()=>{eN()},[eN]),(0,o.useEffect)(()=>{let e=$?`?cwd=${encodeURIComponent($)}`:"";fetch(`/api/jobs/mcp-discover${e}`).then(e=>e.json()).then(e=>en(e.servers)).catch(()=>en([]))},[$]),em)?(0,n.jsx)("div",{className:"flex-1 min-h-0 overflow-y-auto p-4",children:(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"Loading..."})}):(0,n.jsx)("div",{className:"flex-1 min-h-0 overflow-y-auto p-4",children:(0,n.jsxs)("div",{className:"max-w-2xl mx-auto space-y-4 pb-8",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(u.$,{variant:"ghost",size:"icon",onClick:()=>w.push(f?"/jobs":`/jobs/${t}`),children:(0,n.jsx)(l.A,{className:"h-4 w-4"})}),(0,n.jsx)("h2",{className:"font-semibold",children:v?"Duplicate Job":f?"New Job":"Edit Job"})]}),(0,n.jsx)(m.Zp,{children:(0,n.jsxs)(m.Wu,{className:"pt-6 space-y-4",children:[(0,n.jsxs)("div",{className:"space-y-1.5",children:[(0,n.jsx)("label",{className:"text-sm font-medium",children:"Name"}),(0,n.jsx)(x.p,{value:k,onChange:e=>C(e.target.value),placeholder:"Weekly dependency update"})]}),(0,n.jsxs)("div",{className:"space-y-1.5",children:[(0,n.jsx)("label",{className:"text-sm font-medium",children:"Prompt"}),(0,n.jsx)("textarea",{value:M,onChange:e=>W(e.target.value),placeholder:"Check for outdated dependencies and create a PR updating them...",className:"w-full min-h-[120px] rounded-md border bg-background px-3 py-2 text-sm font-mono resize-y focus:outline-none focus:ring-2 focus:ring-ring"})]})]})}),(0,n.jsxs)(m.Zp,{children:[(0,n.jsx)(m.aR,{className:"pb-2",children:(0,n.jsx)(m.ZB,{className:"text-sm font-medium",children:"Working Directory"})}),(0,n.jsxs)(m.Wu,{className:"space-y-2",children:[(0,n.jsxs)("div",{className:"flex gap-2",children:[(0,n.jsx)(x.p,{value:$,onChange:e=>S(e.target.value),placeholder:"Leave empty for scratchpad",className:"flex-1"}),(0,n.jsx)(u.$,{variant:"outline",size:"sm",onClick:()=>ed(!0),children:"Browse"})]}),!$&&(0,n.jsx)("p",{className:"text-xs text-muted-foreground",children:"Uses ~/.cockpit/jobs as a temporary scratchpad directory"}),eo&&(0,n.jsx)("div",{className:"border rounded-md p-3",children:(0,n.jsx)(c.K,{onSelect:e=>{S(e),ed(!1)},onCancel:()=>ed(!1)})})]})]}),(0,n.jsxs)(m.Zp,{children:[(0,n.jsx)(m.aR,{className:"pb-2",children:(0,n.jsx)(m.ZB,{className:"text-sm font-medium",children:"Schedule"})}),(0,n.jsxs)(m.Wu,{className:"space-y-3",children:[T.map((e,s)=>(0,n.jsx)(N,{value:e,onChange:e=>z(T.map((t,n)=>n===s?e:t)),onRemove:()=>z(T.filter((e,t)=>t!==s)),canRemove:T.length>1},s)),(0,n.jsxs)("button",{type:"button",onClick:()=>z([...T,{type:"simple",frequency:"daily",time:"09:00"}]),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-primary transition-colors",children:[(0,n.jsx)(i.A,{className:"h-3 w-3"}),"Add schedule"]})]})]}),(0,n.jsxs)(m.Zp,{children:[(0,n.jsx)(m.aR,{className:"pb-2",children:(0,n.jsx)(m.ZB,{className:"text-sm font-medium",children:"Model"})}),(0,n.jsxs)(m.Wu,{className:"space-y-1",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between px-2 py-2 text-sm",children:[(0,n.jsx)("span",{children:"Model"}),(0,n.jsx)("div",{className:"flex gap-1 flex-wrap justify-end",children:["haiku","sonnet","opus"].map(e=>(0,n.jsx)(u.$,{variant:ep===e?"default":"outline",size:"sm",onClick:()=>{let s;(s=(0,h.zQ)(e))&&(O(s.modelId),B(!1),R((0,h.Mi)(s)||""))},children:e.charAt(0).toUpperCase()+e.slice(1)},e))})]}),ey&&(0,n.jsxs)("div",{className:"flex items-center justify-between px-2 py-2 text-sm",children:[(0,n.jsx)("span",{children:"Version"}),(0,n.jsx)("div",{className:"flex gap-1 flex-wrap justify-end",children:ef.map(e=>(0,n.jsx)(u.$,{variant:eh?.version===e.version?"default":"outline",size:"sm",onClick:()=>(function(e){if(!ep)return;let s=(0,h.r5)(ep).find(s=>s.version===e);if(s){O(s.modelId);let e=(0,h.iz)(s);P&&!e.includes(P)&&R((0,h.Mi)(s)||"")}})(e.version),children:e.version},e.version))})]}),eh?.supportsExtendedContext&&(0,n.jsxs)("div",{className:"flex items-center justify-between px-2 py-2 text-sm",children:[(0,n.jsx)("span",{children:"Context"}),(0,n.jsxs)("div",{className:"flex gap-1",children:[(0,n.jsx)(u.$,{variant:I?"outline":"default",size:"sm",onClick:()=>B(!1),children:"200K"}),(0,n.jsx)(u.$,{variant:I?"default":"outline",size:"sm",onClick:()=>B(!0),children:"1M"})]})]}),ej.length>0&&(0,n.jsxs)("div",{className:"flex items-center justify-between px-2 py-2 text-sm",children:[(0,n.jsx)("span",{children:"Thinking"}),(0,n.jsx)("div",{className:"flex gap-1 flex-wrap justify-end",children:ej.map(e=>(0,n.jsx)(u.$,{variant:P===e?"default":"outline",size:"sm",onClick:()=>R(e),children:j[e]},e))})]})]})]}),(0,n.jsxs)(m.Zp,{children:[(0,n.jsx)(m.aR,{className:"pb-2",children:(0,n.jsx)(m.ZB,{className:"text-sm font-medium",children:"Permissions"})}),(0,n.jsxs)(m.Wu,{className:"space-y-4",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"text-sm font-medium",children:"Bypass Permissions"}),F&&(0,n.jsx)("p",{className:"text-xs text-muted-foreground",children:"All tool permissions will be auto-approved"})]}),(0,n.jsx)(b,{checked:F,onChange:J})]}),!F&&(0,n.jsxs)("div",{className:"space-y-2 border-t pt-4",children:[(0,n.jsx)("label",{className:"text-sm font-medium",children:"Allowed Tools"}),H.length>0&&(0,n.jsx)("div",{className:"flex flex-wrap gap-1.5",children:H.map(e=>(0,n.jsxs)("span",{className:"inline-flex items-center gap-1 text-xs px-2 py-1 rounded-md bg-primary/10 text-primary font-mono",children:[e,(0,n.jsx)("button",{type:"button",onClick:()=>{K(H.filter(s=>s!==e))},className:"hover:text-destructive",children:(0,n.jsx)(a.A,{className:"h-3 w-3"})})]},e))}),(0,n.jsxs)("div",{className:"flex gap-2",children:[(0,n.jsx)(x.p,{value:L,onChange:e=>U(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),ev(L))},placeholder:"Type tool name and press Enter",className:"flex-1 font-mono"}),(0,n.jsx)(u.$,{variant:"outline",size:"sm",onClick:()=>ev(L),disabled:!L.trim(),children:"Add"})]}),eg.length>0&&(0,n.jsx)("div",{className:"flex flex-wrap gap-1",children:eg.map(e=>(0,n.jsxs)("button",{type:"button",onClick:()=>ev(e),className:"text-xs px-2 py-0.5 rounded border border-dashed border-muted-foreground/30 text-muted-foreground hover:border-primary hover:text-primary transition-colors",children:["+ ",e]},e))}),0===H.length&&(0,n.jsx)("p",{className:"text-xs text-muted-foreground",children:"No tools permitted. Add tools this job is allowed to use."})]})]})]}),(0,n.jsxs)(m.Zp,{children:[(0,n.jsx)(m.aR,{className:"pb-2",children:(0,n.jsx)(m.ZB,{className:"text-sm font-medium",children:"MCP Servers"})}),(0,n.jsxs)(m.Wu,{className:"space-y-2",children:[0===et.length&&(0,n.jsx)("p",{className:"text-xs text-muted-foreground",children:"No MCP servers found. Configure servers in Settings."}),et.length>0&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"flex flex-wrap gap-1.5",children:et.map(e=>{let s=_.includes(e);return(0,n.jsx)("button",{type:"button",onClick:()=>{if(s){Q(_.filter(s=>s!==e));let{[e]:s,...t}=X;G(t),es(s=>{let t=new Set(s);return t.delete(e),t})}else Q([..._,e])},className:`inline-flex items-center gap-1 text-xs px-2.5 py-1 rounded-md font-mono transition-colors ${s?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:bg-accent"}`,children:e},e)})}),(0,n.jsx)("p",{className:"text-xs text-muted-foreground",children:0===_.length?"No servers enabled. Select servers to activate.":`${_.length} enabled.`}),_.map(e=>{let s=X[e]||[],t=ee.has(e),l=V[e]||"";return(0,n.jsxs)("div",{className:"border rounded-md p-2 space-y-2",children:[(0,n.jsxs)("button",{type:"button",onClick:()=>es(s=>{let t=new Set(s);return t.has(e)?t.delete(e):t.add(e),t}),className:"w-full flex items-center justify-between text-xs text-muted-foreground hover:text-primary",children:[(0,n.jsx)("span",{className:"font-mono",children:e}),(0,n.jsx)("span",{children:0===s.length?"All tools":`${s.length} tool${1===s.length?"":"s"} filtered`})]}),t&&(0,n.jsxs)("div",{className:"space-y-2 pt-1",children:[s.length>0&&(0,n.jsx)("div",{className:"flex flex-wrap gap-1.5",children:s.map(t=>(0,n.jsxs)("span",{className:"inline-flex items-center gap-1 text-xs px-2 py-1 rounded-md bg-primary/10 text-primary font-mono",children:[t,(0,n.jsx)("button",{type:"button",onClick:()=>{let n=s.filter(e=>e!==t);if(0===n.length){let{[e]:s,...t}=X;G(t)}else G({...X,[e]:n})},className:"hover:text-destructive",children:(0,n.jsx)(a.A,{className:"h-3 w-3"})})]},t))}),(0,n.jsxs)("div",{className:"flex gap-2",children:[(0,n.jsx)(x.p,{value:l,onChange:s=>Y({...V,[e]:s.target.value}),onKeyDown:t=>{if("Enter"===t.key){t.preventDefault();let n=l.trim();n&&!s.includes(n)&&(G({...X,[e]:[...s,n]}),Y({...V,[e]:""}))}},placeholder:"Tool name or server:tool",className:"flex-1 font-mono text-xs"}),(0,n.jsx)(u.$,{variant:"outline",size:"sm",onClick:()=>{let t=l.trim();t&&!s.includes(t)&&(G({...X,[e]:[...s,t]}),Y({...V,[e]:""}))},disabled:!l.trim(),children:"Add"})]}),(0,n.jsx)("p",{className:"text-xs text-muted-foreground",children:"Leave empty to allow all tools. For proxy servers, use server:tool format."})]})]},e)})]})]})]}),(0,n.jsxs)(m.Zp,{children:[(0,n.jsx)(m.aR,{className:"pb-2",children:(0,n.jsx)(m.ZB,{className:"text-sm font-medium",children:"Execution"})}),(0,n.jsxs)(m.Wu,{className:"space-y-4",children:[(0,n.jsxs)("div",{className:"space-y-1.5",children:[(0,n.jsx)("label",{className:"text-sm font-medium",children:"Max Duration (minutes)"}),(0,n.jsx)(x.p,{type:"number",min:1,value:Z,onChange:e=>q(Number(e.target.value))})]}),(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[(0,n.jsx)("label",{className:"text-sm font-medium",children:"Retry missed runs"}),(0,n.jsx)(b,{checked:!ea,onChange:e=>el(!e)})]}),(0,n.jsxs)("div",{className:"space-y-1.5",children:[(0,n.jsx)("label",{className:"text-sm font-medium",children:"Audit log retention (days)"}),(0,n.jsx)(x.p,{type:"number",min:1,value:ei,onChange:e=>er(Number(e.target.value))})]}),(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[(0,n.jsx)("label",{className:"text-sm font-medium",children:"Enabled"}),(0,n.jsx)(b,{checked:D,onChange:E})]})]})]}),(0,n.jsxs)("div",{className:"flex gap-2",children:[(0,n.jsx)(u.$,{onClick:ew,disabled:ec||!k||!M,children:ec?"Saving...":"Save"}),(0,n.jsx)(u.$,{variant:"outline",onClick:()=>w.push(f?"/jobs":`/jobs/${t}`),children:"Cancel"})]})]})})}},31966:(e,s,t)=>{"use strict";t.d(s,{A:()=>n});let n=(0,t(99537).A)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},39071:(e,s,t)=>{Promise.resolve().then(t.bind(t,10895))},84949:(e,s,t)=>{"use strict";function n(e,s,t){let n=[];for(let a of e.split(",")){let e=a.match(/^(.+)\/(\d+)$/),l=e?Number.parseInt(e[2],10):1,i=e?e[1]:a;if("*"===i)for(let e=s;e<=t;e+=l)n.push(e);else if(i.includes("-")){let[e,s]=i.split("-"),t=Number.parseInt(e,10),a=Number.parseInt(s,10);for(let e=t;e<=a;e+=l)n.push(e)}else n.push(Number.parseInt(i,10))}return n}function a(e){if("cron"===e.type)return`cron: ${e.expression}`;let s=e.time||"00:00";switch(e.frequency){case"hourly":return`Every hour at :${s.split(":")[1]||"00"}`;case"daily":return`Daily at ${s}`;case"weekly":return`Weekly on ${["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][e.dayOfWeek??0]} at ${s}`;case"monthly":return`Monthly on day ${e.dayOfMonth??1} at ${s}`}}function l(e){return e.schedules?.length?e.schedules:[e.schedule]}function i(e){return e.map(a).join("; ")}function r(e,s){let t=null;for(let a of e){let e=function(e,s){let t=function(e){let s=e.trim().split(/\s+/);if(5!==s.length)throw Error(`Invalid cron expression: expected 5 fields, got ${s.length}`);return{minute:n(s[0],0,59),hour:n(s[1],0,23),dayOfMonth:n(s[2],1,31),month:n(s[3],1,12),dayOfWeek:n(s[4],0,6)}}("cron"===e.type?e.expression:function(e){let[s,t]=(e.time||"00:00").split(":").map(Number);switch(e.frequency){case"hourly":return`${t} * * * *`;case"daily":return`${t} ${s} * * *`;case"weekly":return`${t} ${s} * * ${e.dayOfWeek??0}`;case"monthly":return`${t} ${s} ${e.dayOfMonth??1} * *`}}(e)),a=new Date(s.getTime());a.setSeconds(0,0),a.setMinutes(a.getMinutes()+1);for(let e=0;e<525960;e++){if(t.minute.includes(a.getMinutes())&&t.hour.includes(a.getHours())&&t.dayOfMonth.includes(a.getDate())&&t.month.includes(a.getMonth()+1)&&t.dayOfWeek.includes(a.getDay()))return a;a.setMinutes(a.getMinutes()+1)}return new Date(s.getTime()+864e5)}(a,s);(!t||e.getTime()<t.getTime())&&(t=new Date(e.getTime()))}return t??new Date(s.getTime()+864e5)}t.d(s,{Bg:()=>a,JH:()=>i,KU:()=>l,ay:()=>r})}},e=>{e.O(0,[989,66997,30120,28441,93794,77358],()=>e(e.s=39071)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[39410],{2330:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>y});var n=t(95155),a=t(31966),i=t(18986),r=t(92571),l=t(36619),o=t(65738),c=t(73321),d=t(12115),u=t(30120),h=t(45160),m=t(89239),x=t(81477),p=t(42763),f=t(67032),j=t(8081),g=t(84949);function y(){let e=(0,c.useParams)().id,s=(0,c.useRouter)(),[t,y]=(0,d.useState)(null),[N,v]=(0,d.useState)(!0),[w,b]=(0,d.useState)(!1),[k,$]=(0,d.useState)(!1);(0,u.si)(t?.name||"Job");let{runs:M,loading:D,loadingMore:E,hasMore:C,refresh:A,loadMore:O}=(0,f.Jm)(e),S=(0,d.useCallback)(async()=>{try{let t=await fetch(`/api/jobs/${e}`);if(!t.ok)return void s.push("/jobs");let n=await t.json();y(n.job)}finally{v(!1)}},[e,s]);async function T(){b(!0),await fetch(`/api/jobs/${e}/trigger`,{method:"POST"}),b(!1),A()}async function W(){(await fetch(`/api/jobs/${e}`,{method:"DELETE"})).ok&&s.push("/jobs")}return((0,d.useEffect)(()=>{S()},[S]),N||!t)?(0,n.jsx)("div",{className:"flex-1 min-h-0 overflow-y-auto p-4",children:(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"Loading..."})}):(0,n.jsx)("div",{className:"flex-1 min-h-0 overflow-y-auto p-4",children:(0,n.jsxs)("div",{className:"max-w-2xl mx-auto space-y-4 pb-8",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(m.$,{variant:"ghost",size:"icon",onClick:()=>s.push("/jobs"),children:(0,n.jsx)(a.A,{className:"h-4 w-4"})}),(0,n.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("h2",{className:"font-semibold truncate",children:t.name}),t.enabled?(0,n.jsx)(h.E,{variant:"default",children:"Active"}):(0,n.jsx)(h.E,{variant:"secondary",children:"Disabled"})]}),(0,n.jsx)("p",{className:"text-xs text-muted-foreground",children:(0,g.JH)((0,g.KU)(t))})]})]}),(0,n.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,n.jsxs)(m.$,{variant:"outline",size:"sm",onClick:()=>s.push(`/jobs/${e}/edit`),children:[(0,n.jsx)(i.A,{className:"h-4 w-4 mr-1"}),"Edit"]}),(0,n.jsxs)(m.$,{variant:"outline",size:"sm",onClick:T,disabled:w,children:[w?(0,n.jsx)(r.A,{className:"h-4 w-4 mr-1 animate-spin"}):(0,n.jsx)(l.A,{className:"h-4 w-4 mr-1"}),"Run Now"]}),(0,n.jsxs)(m.$,{variant:"ghost",size:"sm",className:"text-destructive hover:text-destructive",onClick:()=>$(!0),children:[(0,n.jsx)(o.A,{className:"h-4 w-4 mr-1"}),"Delete"]})]}),(0,n.jsxs)(x.Zp,{children:[(0,n.jsx)(x.aR,{className:"pb-2",children:(0,n.jsx)(x.ZB,{className:"text-sm font-medium",children:"Prompt"})}),(0,n.jsx)(x.Wu,{children:(0,n.jsx)("pre",{className:"text-sm whitespace-pre-wrap break-all font-mono bg-muted rounded p-3",children:t.prompt})})]}),(0,n.jsx)(x.Zp,{children:(0,n.jsx)(x.Wu,{className:"pt-4",children:(0,n.jsxs)("div",{className:"grid grid-cols-2 gap-y-2 text-sm",children:[(0,n.jsx)("span",{className:"text-muted-foreground",children:"Model"}),(0,n.jsx)("span",{className:"text-right",children:function(e){let s=e.model||"",t=s.replace(/\[.*\]$/,""),n=(0,j.bs)(t);if(!n)return s||"Default";let a=n.alias.charAt(0).toUpperCase()+n.alias.slice(1),i=/\[1m\]$/i.test(s)?" (1M)":"";return`${a} ${n.version}${i}`}(t)}),t.thinkingLevel&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("span",{className:"text-muted-foreground",children:"Thinking"}),(0,n.jsx)("span",{className:"text-right capitalize",children:t.thinkingLevel})]}),(0,n.jsx)("span",{className:"text-muted-foreground",children:"Max Duration"}),(0,n.jsxs)("span",{className:"text-right",children:[t.maxDurationMinutes??30," min"]}),t.cwd&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("span",{className:"text-muted-foreground",children:"Directory"}),(0,n.jsx)("span",{className:"text-right font-mono text-xs truncate",children:t.cwd})]}),(0,n.jsx)("span",{className:"text-muted-foreground",children:"Permissions"}),(0,n.jsx)("span",{className:"text-right",children:t.bypassPermissions?"Bypass all":`${(t.allowedTools||[]).length} tools allowed`}),(t.mcpServers||[]).length>0&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("span",{className:"text-muted-foreground",children:"MCP Servers"}),(0,n.jsx)("span",{className:"text-right text-xs font-mono truncate",children:(t.mcpServers||[]).join(", ")})]})]})})}),(0,n.jsxs)(x.Zp,{children:[(0,n.jsx)(x.aR,{className:"pb-2",children:(0,n.jsx)(x.ZB,{className:"text-sm font-medium",children:"Run History"})}),(0,n.jsxs)(x.Wu,{children:[D&&(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"Loading runs..."}),!D&&0===M.length&&(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"No runs yet."}),(0,n.jsx)("div",{className:"space-y-1",children:M.map(t=>(0,n.jsxs)("button",{type:"button",className:"w-full flex items-center gap-3 rounded px-2 py-2 hover:bg-muted transition-colors text-left",onClick:()=>s.push(`/jobs/${e}/runs/${t.id}`),children:[function(e){switch(e){case"success":return(0,n.jsx)(h.E,{className:"bg-green-600 text-white",children:"Success"});case"failure":return(0,n.jsx)(h.E,{variant:"destructive",children:"Failed"});case"timeout":return(0,n.jsx)(h.E,{className:"bg-yellow-600 text-white",children:"Timeout"});case"running":return(0,n.jsx)(h.E,{className:"bg-blue-600 text-white",children:"Running"});default:return(0,n.jsx)(h.E,{variant:"secondary",children:e})}}(t.status),(0,n.jsx)("span",{className:"text-xs text-muted-foreground flex-1",children:new Date(t.startedAt).toLocaleString()}),null!=t.durationMs&&(0,n.jsxs)("span",{className:"text-xs text-muted-foreground",children:[Math.round(t.durationMs/1e3),"s"]})]},t.id))}),C&&(0,n.jsx)(m.$,{variant:"ghost",size:"sm",className:"w-full mt-2",onClick:O,disabled:E,children:E?"Loading...":"Load more"})]})]}),(0,n.jsx)(p.lG,{open:k,onOpenChange:$,children:(0,n.jsxs)(p.Cf,{children:[(0,n.jsx)(p.c7,{children:(0,n.jsx)(p.L3,{children:"Delete Job"})}),(0,n.jsx)("p",{className:"text-sm text-muted-foreground mb-4",children:"Delete this job and all run history? This cannot be undone."}),(0,n.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,n.jsx)(m.$,{variant:"outline",onClick:()=>$(!1),children:"Cancel"}),(0,n.jsx)(m.$,{variant:"destructive",onClick:W,children:"Delete"})]})]})})]})})}},8081:(e,s,t)=>{"use strict";t.d(s,{AX:()=>l,Mi:()=>c,bs:()=>a,iz:()=>o,r5:()=>i,zQ:()=>r});let n=[{alias:"haiku",version:"4.5",modelId:"claude-haiku-4-5-20251001",displayName:"Haiku 4.5",description:"Fastest",supportsExtendedContext:!1,contextWindow:2e5,isDefault:!0},{alias:"sonnet",version:"4.6",modelId:"claude-sonnet-4-6",displayName:"Sonnet 4.6",description:"Balanced",supportsExtendedContext:!0,contextWindow:2e5,isDefault:!0},{alias:"opus",version:"4.6",modelId:"claude-opus-4-6",displayName:"Opus 4.6",description:"Previous generation",supportsExtendedContext:!0,contextWindow:2e5},{alias:"opus",version:"4.7",modelId:"claude-opus-4-7",displayName:"Opus 4.7",description:"Most capable",supportsExtendedContext:!0,contextWindow:2e5,isDefault:!0}];function a(e){if(e)return n.find(s=>s.modelId===e)}function i(e){return n.filter(s=>s.alias===e)}function r(e){return n.find(s=>s.alias===e&&s.isDefault)??i(e)[0]}function l(e){if(!e)return null;let s=e.replace(/\[.*\]$/,"");return"opus"===s||"sonnet"===s||"haiku"===s?r(s)??null:a(s)??null}function o(e){if(!e||"haiku"===e.alias)return[];let s=["low","medium","high"];return"opus"===e.alias&&"4.7"===e.version&&s.push("xhigh"),s.push("max"),s}function c(e){return e&&"haiku"!==e.alias?"opus"===e.alias&&"4.7"===e.version?"xhigh":"sonnet"===e.alias?"medium":"high":null}},18986:(e,s,t)=>{"use strict";t.d(s,{A:()=>n});let n=(0,t(99537).A)("pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]])},31966:(e,s,t)=>{"use strict";t.d(s,{A:()=>n});let n=(0,t(99537).A)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},36619:(e,s,t)=>{"use strict";t.d(s,{A:()=>n});let n=(0,t(99537).A)("play",[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]])},83250:(e,s,t)=>{Promise.resolve().then(t.bind(t,2330))},84949:(e,s,t)=>{"use strict";function n(e,s,t){let n=[];for(let a of e.split(",")){let e=a.match(/^(.+)\/(\d+)$/),i=e?Number.parseInt(e[2],10):1,r=e?e[1]:a;if("*"===r)for(let e=s;e<=t;e+=i)n.push(e);else if(r.includes("-")){let[e,s]=r.split("-"),t=Number.parseInt(e,10),a=Number.parseInt(s,10);for(let e=t;e<=a;e+=i)n.push(e)}else n.push(Number.parseInt(r,10))}return n}function a(e){if("cron"===e.type)return`cron: ${e.expression}`;let s=e.time||"00:00";switch(e.frequency){case"hourly":return`Every hour at :${s.split(":")[1]||"00"}`;case"daily":return`Daily at ${s}`;case"weekly":return`Weekly on ${["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][e.dayOfWeek??0]} at ${s}`;case"monthly":return`Monthly on day ${e.dayOfMonth??1} at ${s}`}}function i(e){return e.schedules?.length?e.schedules:[e.schedule]}function r(e){return e.map(a).join("; ")}function l(e,s){let t=null;for(let a of e){let e=function(e,s){let t=function(e){let s=e.trim().split(/\s+/);if(5!==s.length)throw Error(`Invalid cron expression: expected 5 fields, got ${s.length}`);return{minute:n(s[0],0,59),hour:n(s[1],0,23),dayOfMonth:n(s[2],1,31),month:n(s[3],1,12),dayOfWeek:n(s[4],0,6)}}("cron"===e.type?e.expression:function(e){let[s,t]=(e.time||"00:00").split(":").map(Number);switch(e.frequency){case"hourly":return`${t} * * * *`;case"daily":return`${t} ${s} * * *`;case"weekly":return`${t} ${s} * * ${e.dayOfWeek??0}`;case"monthly":return`${t} ${s} ${e.dayOfMonth??1} * *`}}(e)),a=new Date(s.getTime());a.setSeconds(0,0),a.setMinutes(a.getMinutes()+1);for(let e=0;e<525960;e++){if(t.minute.includes(a.getMinutes())&&t.hour.includes(a.getHours())&&t.dayOfMonth.includes(a.getDate())&&t.month.includes(a.getMonth()+1)&&t.dayOfWeek.includes(a.getDay()))return a;a.setMinutes(a.getMinutes()+1)}return new Date(s.getTime()+864e5)}(a,s);(!t||e.getTime()<t.getTime())&&(t=new Date(e.getTime()))}return t??new Date(s.getTime()+864e5)}t.d(s,{Bg:()=>a,JH:()=>r,KU:()=>i,ay:()=>l})}},e=>{e.O(0,[989,66997,30120,28441,93794,77358],()=>e(e.s=83250)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[15496],{31966:(e,s,t)=>{"use strict";t.d(s,{A:()=>r});let r=(0,t(99537).A)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},46172:(e,s,t)=>{Promise.resolve().then(t.bind(t,60532))},60532:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>g});var r=t(95155),a=t(12363),n=t(76721),l=t(9005),i=t(92571),d=t(31966),c=t(36483),o=t(73321),u=t(12115),x=t(30120),m=t(513),h=t(45160),p=t(89239),j=t(81477);function f({tool:e}){let[s,t]=(0,u.useState)(!1);return(0,r.jsxs)("div",{className:"border rounded-md",children:[(0,r.jsxs)("button",{type:"button",className:"w-full flex items-center gap-2 px-3 py-2 text-left text-sm hover:bg-muted/50 transition-colors",onClick:()=>t(!s),children:[s?(0,r.jsx)(a.A,{className:"h-3 w-3 shrink-0"}):(0,r.jsx)(n.A,{className:"h-3 w-3 shrink-0"}),(0,r.jsx)("span",{className:"font-mono font-medium truncate min-w-0",children:e.name}),void 0!==e.permitted&&(0,r.jsx)(h.E,{variant:e.permitted?"secondary":"destructive",className:"text-[10px]",children:e.permitted?"Allowed":"Denied"}),null!=e.durationMs&&(0,r.jsxs)("span",{className:"text-xs text-muted-foreground ml-auto shrink-0",children:[e.durationMs,"ms"]})]}),s&&(0,r.jsxs)("div",{className:"border-t px-3 py-2 space-y-2",children:[e.input&&(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-xs font-medium text-muted-foreground mb-1",children:"Input"}),(0,r.jsx)("pre",{className:"text-xs bg-muted rounded p-2 overflow-x-auto max-h-48 whitespace-pre-wrap",children:e.input})]}),e.output&&(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-xs font-medium text-muted-foreground mb-1",children:"Output"}),(0,r.jsx)("pre",{className:"text-xs bg-muted rounded p-2 overflow-x-auto max-h-48 whitespace-pre-wrap",children:e.output})]})]})]})}function N({jobId:e,runId:s,onClose:t}){let[a,n]=(0,u.useState)([]),[d,c]=(0,u.useState)(!0),[o,x]=(0,u.useState)(null),h=(0,u.useRef)(new Set);(0,u.useEffect)(()=>{fetch(`/api/jobs/${e}/runs/${s}/transcript`).then(e=>{if(!e.ok)throw Error("Failed to load transcript");return e.json()}).then(e=>{n(e.messages),c(!1)}).catch(e=>{x(e.message),c(!1)})},[e,s]),(0,u.useEffect)(()=>{let e=e=>{"Escape"===e.key&&(e.preventDefault(),e.stopPropagation(),t())};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t]);let f=(0,u.useCallback)(e=>{e.target===e.currentTarget&&t()},[t]);return(0,r.jsx)("div",{className:"fixed inset-0 z-50 bg-black/50 flex items-center justify-center p-4",onClick:f,children:(0,r.jsxs)(j.Zp,{className:"w-full max-w-3xl flex flex-col",style:{maxHeight:"calc(100dvh - 2rem)"},children:[(0,r.jsxs)("div",{className:"flex items-center justify-between px-4 py-2 border-b shrink-0",children:[(0,r.jsx)("span",{className:"text-sm font-medium text-muted-foreground",children:"Run transcript"}),(0,r.jsx)(p.$,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:t,children:(0,r.jsx)(l.A,{className:"h-4 w-4"})})]}),(0,r.jsxs)("div",{className:"flex-1 min-h-0 overflow-y-auto p-4 space-y-4",children:[d&&(0,r.jsx)("div",{className:"flex justify-center py-12",children:(0,r.jsx)(i.A,{className:"h-5 w-5 animate-spin text-muted-foreground"})}),o&&(0,r.jsx)("div",{className:"text-center text-sm text-red-500 py-12",children:o}),!d&&0===a.length&&!o&&(0,r.jsx)("div",{className:"text-center text-sm text-muted-foreground py-12",children:"No transcript found for this run."}),!d&&a.map(e=>(0,r.jsx)("div",{children:(0,r.jsx)(m.s,{message:e,expandedToolIds:h})},e.id))]})]})})}function g(){let e=(0,o.useParams)(),s=e.id,t=e.runId,a=(0,o.useRouter)();(0,x.si)("Run Detail");let[n,l]=(0,u.useState)(null),[i,m]=(0,u.useState)(!0),[g,v]=(0,u.useState)(!1),w=(0,u.useCallback)(async()=>{try{let e=await fetch(`/api/jobs/${s}/runs/${t}`);if(!e.ok)return void a.push(`/jobs/${s}`);let r=await e.json();l(r.run)}finally{m(!1)}},[s,t,a]);return((0,u.useEffect)(()=>{w()},[w]),i||!n)?(0,r.jsx)("div",{className:"flex-1 min-h-0 overflow-y-auto p-4",children:(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:"Loading..."})}):(0,r.jsxs)("div",{className:"flex-1 min-h-0 overflow-y-auto p-4 space-y-4",children:[(0,r.jsx)("div",{className:"flex items-center gap-2",children:(0,r.jsx)(p.$,{variant:"ghost",size:"icon",onClick:()=>a.push(`/jobs/${s}`),children:(0,r.jsx)(d.A,{className:"h-4 w-4"})})}),(0,r.jsxs)(j.Zp,{children:[(0,r.jsx)(j.aR,{children:(0,r.jsxs)(j.ZB,{className:"text-base flex items-center gap-2",children:["Run Summary",function(e){switch(e){case"success":return(0,r.jsx)(h.E,{className:"bg-green-600 text-white",children:"Success"});case"failure":return(0,r.jsx)(h.E,{variant:"destructive",children:"Failed"});case"timeout":return(0,r.jsx)(h.E,{className:"bg-yellow-600 text-white",children:"Timeout"});case"running":return(0,r.jsx)(h.E,{className:"bg-blue-600 text-white",children:"Running"});default:return(0,r.jsx)(h.E,{variant:"secondary",children:e})}}(n.status)]})}),(0,r.jsxs)(j.Wu,{className:"space-y-2 text-sm",children:[(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"text-muted-foreground",children:"Started:"})," ",new Date(n.startedAt).toLocaleString()]}),n.completedAt&&(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"text-muted-foreground",children:"Completed:"})," ",new Date(n.completedAt).toLocaleString()]}),null!=n.durationMs&&(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"text-muted-foreground",children:"Duration:"})," ",Math.round(n.durationMs/1e3),"s"]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"text-muted-foreground",children:"Messages:"})," ",n.messageCount]})]}),n.error&&(0,r.jsx)("div",{className:"mt-2 p-2 rounded bg-destructive/10 text-destructive text-xs",children:n.error}),(0,r.jsxs)("div",{className:"mt-2",children:[(0,r.jsx)("span",{className:"text-muted-foreground",children:"Prompt:"}),(0,r.jsx)("pre",{className:"mt-1 text-xs bg-muted rounded p-2 whitespace-pre-wrap",children:n.prompt})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"text-muted-foreground",children:"Working Directory:"})," ",(0,r.jsx)("span",{className:"font-mono text-xs",children:n.cwd})]}),(0,r.jsx)("div",{className:"pt-2",children:(0,r.jsxs)(p.$,{variant:"outline",size:"sm",onClick:()=>v(!0),children:[(0,r.jsx)(c.A,{className:"h-3 w-3 mr-1"}),"View Transcript"]})})]})]}),(0,r.jsxs)(j.Zp,{children:[(0,r.jsx)(j.aR,{children:(0,r.jsxs)(j.ZB,{className:"text-base",children:["Tool Usage (",n.toolsUsed.length,")"]})}),(0,r.jsxs)(j.Wu,{children:[0===n.toolsUsed.length&&(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:"No tool invocations recorded."}),(0,r.jsx)("div",{className:"space-y-1",children:n.toolsUsed.map((e,s)=>(0,r.jsx)(f,{tool:e},`${e.name}-${e.timestamp}-${s}`))})]})]}),g&&(0,r.jsx)(N,{jobId:s,runId:t,onClose:()=>v(!1)})]})}}},e=>{e.O(0,[989,66997,30120,28441,93794,77358],()=>e(e.s=46172)),_N_E=e.O()}]);