@alexjbarnes/cockpit 0.2.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (695) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-path-routes-manifest.json +16 -3
  3. package/.next/build-manifest.json +3 -3
  4. package/.next/prerender-manifest.json +99 -3
  5. package/.next/react-loadable-manifest.json +18 -2
  6. package/.next/required-server-files.js +3 -0
  7. package/.next/required-server-files.json +3 -0
  8. package/.next/routes-manifest.json +86 -0
  9. package/.next/server/app/(app)/agents/[name]/page.js +2 -2
  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 +2 -2
  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 -2
  40. package/.next/server/app/(app)/inbox/[id]/page.js.nft.json +1 -1
  41. package/.next/server/app/(app)/inbox/[id]/page_client-reference-manifest.js +1 -1
  42. package/.next/server/app/(app)/inbox/page.js +2 -2
  43. package/.next/server/app/(app)/inbox/page.js.nft.json +1 -1
  44. package/.next/server/app/(app)/inbox/page_client-reference-manifest.js +1 -1
  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 +10 -10
  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 -2
  82. package/.next/server/app/(app)/settings/notifications/page.js.nft.json +1 -1
  83. package/.next/server/app/(app)/settings/notifications/page_client-reference-manifest.js +1 -1
  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 +2 -2
  169. package/.next/server/app/api/inbox/route.js +2 -2
  170. package/.next/server/app/api/jobs/[id]/route.js +1 -1
  171. package/.next/server/app/api/jobs/[id]/route.js.nft.json +1 -1
  172. package/.next/server/app/api/jobs/[id]/runs/[runId]/route.js +1 -1
  173. package/.next/server/app/api/jobs/[id]/runs/[runId]/transcript/route.js +1 -1
  174. package/.next/server/app/api/jobs/[id]/runs/route.js +1 -1
  175. package/.next/server/app/api/jobs/[id]/trigger/route.js +1 -1
  176. package/.next/server/app/api/jobs/[id]/trigger/route.js.nft.json +1 -1
  177. package/.next/server/app/api/jobs/mcp-discover/route.js +1 -1
  178. package/.next/server/app/api/jobs/mcp-discover/route.js.nft.json +1 -1
  179. package/.next/server/app/api/jobs/route.js +1 -1
  180. package/.next/server/app/api/jobs/route.js.nft.json +1 -1
  181. package/.next/server/app/api/jobs/status/route.js +1 -1
  182. package/.next/server/app/api/mcp-servers/[name]/route.js +1 -1
  183. package/.next/server/app/api/mcp-servers/[name]/test/route.js +1 -1
  184. package/.next/server/app/api/mcp-servers/route.js +1 -1
  185. package/.next/server/app/api/notifications/route.js +1 -1
  186. package/.next/server/app/api/notifications/test/route.js +1 -1
  187. package/.next/server/app/api/providers/[id]/route.js +1 -0
  188. package/.next/server/app/api/providers/[id]/route.js.nft.json +1 -0
  189. package/.next/server/app/api/providers/[id]/route_client-reference-manifest.js +1 -0
  190. package/.next/server/app/api/providers/route.js +1 -0
  191. package/.next/server/app/api/providers/route.js.nft.json +1 -0
  192. package/.next/server/app/api/providers/route_client-reference-manifest.js +1 -0
  193. package/.next/server/app/api/reviews/pinned/route.js +1 -1
  194. package/.next/server/app/api/sessions/[id]/context/route.js +1 -1
  195. package/.next/server/app/api/sessions/[id]/mcp/route.js +1 -1
  196. package/.next/server/app/api/sessions/[id]/mcp/route.js.nft.json +1 -1
  197. package/.next/server/app/api/sessions/[id]/route.js +1 -1
  198. package/.next/server/app/api/sessions/[id]/route.js.nft.json +1 -1
  199. package/.next/server/app/api/sessions/[id]/search/route.js +1 -1
  200. package/.next/server/app/api/sessions/[id]/tabs/route.js +1 -0
  201. package/.next/server/app/api/sessions/[id]/tabs/route.js.nft.json +1 -0
  202. package/.next/server/app/api/sessions/[id]/tabs/route_client-reference-manifest.js +1 -0
  203. package/.next/server/app/api/sessions/bulk-delete/route.js +1 -1
  204. package/.next/server/app/api/sessions/bulk-delete/route.js.nft.json +1 -1
  205. package/.next/server/app/api/sessions/by-ids/route.js +1 -1
  206. package/.next/server/app/api/sessions/by-ids/route.js.nft.json +1 -1
  207. package/.next/server/app/api/sessions/group/route.js +1 -1
  208. package/.next/server/app/api/sessions/group/route.js.nft.json +1 -1
  209. package/.next/server/app/api/sessions/pinned/route.js +1 -1
  210. package/.next/server/app/api/sessions/route.js +1 -1
  211. package/.next/server/app/api/sessions/route.js.nft.json +1 -1
  212. package/.next/server/app/api/sessions/search/route.js +1 -1
  213. package/.next/server/app/api/sessions/thinking/route.js +1 -0
  214. package/.next/server/app/api/sessions/thinking/route.js.nft.json +1 -0
  215. package/.next/server/app/api/sessions/thinking/route_client-reference-manifest.js +1 -0
  216. package/.next/server/app/api/skills/[name]/route.js +1 -1
  217. package/.next/server/app/api/skills/route.js +1 -1
  218. package/.next/server/app/api/terminal/[id]/route.js +1 -0
  219. package/.next/server/app/api/terminal/[id]/route.js.nft.json +1 -0
  220. package/.next/server/app/api/terminal/[id]/route_client-reference-manifest.js +1 -0
  221. package/.next/server/app/api/terminal/route.js +1 -0
  222. package/.next/server/app/api/terminal/route.js.nft.json +1 -0
  223. package/.next/server/app/api/terminal/route_client-reference-manifest.js +1 -0
  224. package/.next/server/app/api/usage/route.js +1 -1
  225. package/.next/server/app/api/version/changelog/route.js +1 -0
  226. package/.next/server/app/api/version/changelog/route.js.nft.json +1 -0
  227. package/.next/server/app/api/version/changelog/route_client-reference-manifest.js +1 -0
  228. package/.next/server/app/api/version/cockpit/changelog/route.js +1 -0
  229. package/.next/server/app/api/version/cockpit/changelog/route.js.nft.json +1 -0
  230. package/.next/server/app/api/version/cockpit/changelog/route_client-reference-manifest.js +1 -0
  231. package/.next/server/app/api/version/cockpit/route.js +1 -1
  232. package/.next/server/app/api/version/route.js +2 -2
  233. package/.next/server/app/changes.html +1 -1
  234. package/.next/server/app/changes.rsc +4 -4
  235. package/.next/server/app/changes.segments/!KGFwcCk/changes/__PAGE__.segment.rsc +2 -2
  236. package/.next/server/app/changes.segments/!KGFwcCk/changes.segment.rsc +1 -1
  237. package/.next/server/app/changes.segments/!KGFwcCk.segment.rsc +2 -2
  238. package/.next/server/app/changes.segments/_full.segment.rsc +4 -4
  239. package/.next/server/app/changes.segments/_head.segment.rsc +1 -1
  240. package/.next/server/app/changes.segments/_index.segment.rsc +2 -2
  241. package/.next/server/app/changes.segments/_tree.segment.rsc +2 -2
  242. package/.next/server/app/claude-md/edit.html +1 -1
  243. package/.next/server/app/claude-md/edit.rsc +4 -4
  244. package/.next/server/app/claude-md/edit.segments/!KGFwcCk/claude-md/edit/__PAGE__.segment.rsc +2 -2
  245. package/.next/server/app/claude-md/edit.segments/!KGFwcCk/claude-md/edit.segment.rsc +1 -1
  246. package/.next/server/app/claude-md/edit.segments/!KGFwcCk/claude-md.segment.rsc +1 -1
  247. package/.next/server/app/claude-md/edit.segments/!KGFwcCk.segment.rsc +2 -2
  248. package/.next/server/app/claude-md/edit.segments/_full.segment.rsc +4 -4
  249. package/.next/server/app/claude-md/edit.segments/_head.segment.rsc +1 -1
  250. package/.next/server/app/claude-md/edit.segments/_index.segment.rsc +2 -2
  251. package/.next/server/app/claude-md/edit.segments/_tree.segment.rsc +2 -2
  252. package/.next/server/app/claude-md.html +1 -1
  253. package/.next/server/app/claude-md.rsc +4 -4
  254. package/.next/server/app/claude-md.segments/!KGFwcCk/claude-md/__PAGE__.segment.rsc +2 -2
  255. package/.next/server/app/claude-md.segments/!KGFwcCk/claude-md.segment.rsc +1 -1
  256. package/.next/server/app/claude-md.segments/!KGFwcCk.segment.rsc +2 -2
  257. package/.next/server/app/claude-md.segments/_full.segment.rsc +4 -4
  258. package/.next/server/app/claude-md.segments/_head.segment.rsc +1 -1
  259. package/.next/server/app/claude-md.segments/_index.segment.rsc +2 -2
  260. package/.next/server/app/claude-md.segments/_tree.segment.rsc +2 -2
  261. package/.next/server/app/commands.html +1 -1
  262. package/.next/server/app/commands.rsc +4 -4
  263. package/.next/server/app/commands.segments/!KGFwcCk/commands/__PAGE__.segment.rsc +2 -2
  264. package/.next/server/app/commands.segments/!KGFwcCk/commands.segment.rsc +1 -1
  265. package/.next/server/app/commands.segments/!KGFwcCk.segment.rsc +2 -2
  266. package/.next/server/app/commands.segments/_full.segment.rsc +4 -4
  267. package/.next/server/app/commands.segments/_head.segment.rsc +1 -1
  268. package/.next/server/app/commands.segments/_index.segment.rsc +2 -2
  269. package/.next/server/app/commands.segments/_tree.segment.rsc +2 -2
  270. package/.next/server/app/files.html +1 -1
  271. package/.next/server/app/files.rsc +4 -4
  272. package/.next/server/app/files.segments/!KGFwcCk/files/__PAGE__.segment.rsc +2 -2
  273. package/.next/server/app/files.segments/!KGFwcCk/files.segment.rsc +1 -1
  274. package/.next/server/app/files.segments/!KGFwcCk.segment.rsc +2 -2
  275. package/.next/server/app/files.segments/_full.segment.rsc +4 -4
  276. package/.next/server/app/files.segments/_head.segment.rsc +1 -1
  277. package/.next/server/app/files.segments/_index.segment.rsc +2 -2
  278. package/.next/server/app/files.segments/_tree.segment.rsc +2 -2
  279. package/.next/server/app/hooks.html +1 -1
  280. package/.next/server/app/hooks.rsc +4 -4
  281. package/.next/server/app/hooks.segments/!KGFwcCk/hooks/__PAGE__.segment.rsc +2 -2
  282. package/.next/server/app/hooks.segments/!KGFwcCk/hooks.segment.rsc +1 -1
  283. package/.next/server/app/hooks.segments/!KGFwcCk.segment.rsc +2 -2
  284. package/.next/server/app/hooks.segments/_full.segment.rsc +4 -4
  285. package/.next/server/app/hooks.segments/_head.segment.rsc +1 -1
  286. package/.next/server/app/hooks.segments/_index.segment.rsc +2 -2
  287. package/.next/server/app/hooks.segments/_tree.segment.rsc +2 -2
  288. package/.next/server/app/inbox.html +1 -1
  289. package/.next/server/app/inbox.rsc +4 -4
  290. package/.next/server/app/inbox.segments/!KGFwcCk/inbox/__PAGE__.segment.rsc +2 -2
  291. package/.next/server/app/inbox.segments/!KGFwcCk/inbox.segment.rsc +1 -1
  292. package/.next/server/app/inbox.segments/!KGFwcCk.segment.rsc +2 -2
  293. package/.next/server/app/inbox.segments/_full.segment.rsc +4 -4
  294. package/.next/server/app/inbox.segments/_head.segment.rsc +1 -1
  295. package/.next/server/app/inbox.segments/_index.segment.rsc +2 -2
  296. package/.next/server/app/inbox.segments/_tree.segment.rsc +2 -2
  297. package/.next/server/app/index.html +1 -1
  298. package/.next/server/app/index.rsc +4 -4
  299. package/.next/server/app/index.segments/!KGFwcCk/__PAGE__.segment.rsc +2 -2
  300. package/.next/server/app/index.segments/!KGFwcCk.segment.rsc +2 -2
  301. package/.next/server/app/index.segments/_full.segment.rsc +4 -4
  302. package/.next/server/app/index.segments/_head.segment.rsc +1 -1
  303. package/.next/server/app/index.segments/_index.segment.rsc +2 -2
  304. package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  305. package/.next/server/app/jobs.html +1 -1
  306. package/.next/server/app/jobs.rsc +4 -4
  307. package/.next/server/app/jobs.segments/!KGFwcCk/jobs/__PAGE__.segment.rsc +2 -2
  308. package/.next/server/app/jobs.segments/!KGFwcCk/jobs.segment.rsc +1 -1
  309. package/.next/server/app/jobs.segments/!KGFwcCk.segment.rsc +2 -2
  310. package/.next/server/app/jobs.segments/_full.segment.rsc +4 -4
  311. package/.next/server/app/jobs.segments/_head.segment.rsc +1 -1
  312. package/.next/server/app/jobs.segments/_index.segment.rsc +2 -2
  313. package/.next/server/app/jobs.segments/_tree.segment.rsc +2 -2
  314. package/.next/server/app/login/page.js +2 -2
  315. package/.next/server/app/login/page_client-reference-manifest.js +1 -1
  316. package/.next/server/app/login.html +1 -1
  317. package/.next/server/app/login.rsc +2 -2
  318. package/.next/server/app/login.segments/_full.segment.rsc +2 -2
  319. package/.next/server/app/login.segments/_head.segment.rsc +1 -1
  320. package/.next/server/app/login.segments/_index.segment.rsc +2 -2
  321. package/.next/server/app/login.segments/_tree.segment.rsc +2 -2
  322. package/.next/server/app/login.segments/login/__PAGE__.segment.rsc +1 -1
  323. package/.next/server/app/login.segments/login.segment.rsc +1 -1
  324. package/.next/server/app/mcp-servers.html +1 -1
  325. package/.next/server/app/mcp-servers.rsc +4 -4
  326. package/.next/server/app/mcp-servers.segments/!KGFwcCk/mcp-servers/__PAGE__.segment.rsc +2 -2
  327. package/.next/server/app/mcp-servers.segments/!KGFwcCk/mcp-servers.segment.rsc +1 -1
  328. package/.next/server/app/mcp-servers.segments/!KGFwcCk.segment.rsc +2 -2
  329. package/.next/server/app/mcp-servers.segments/_full.segment.rsc +4 -4
  330. package/.next/server/app/mcp-servers.segments/_head.segment.rsc +1 -1
  331. package/.next/server/app/mcp-servers.segments/_index.segment.rsc +2 -2
  332. package/.next/server/app/mcp-servers.segments/_tree.segment.rsc +2 -2
  333. package/.next/server/app/reviews.html +1 -1
  334. package/.next/server/app/reviews.rsc +4 -4
  335. package/.next/server/app/reviews.segments/!KGFwcCk/reviews/__PAGE__.segment.rsc +2 -2
  336. package/.next/server/app/reviews.segments/!KGFwcCk/reviews.segment.rsc +1 -1
  337. package/.next/server/app/reviews.segments/!KGFwcCk.segment.rsc +2 -2
  338. package/.next/server/app/reviews.segments/_full.segment.rsc +4 -4
  339. package/.next/server/app/reviews.segments/_head.segment.rsc +1 -1
  340. package/.next/server/app/reviews.segments/_index.segment.rsc +2 -2
  341. package/.next/server/app/reviews.segments/_tree.segment.rsc +2 -2
  342. package/.next/server/app/settings/appearance.html +1 -0
  343. package/.next/server/app/settings/appearance.meta +17 -0
  344. package/.next/server/app/settings/appearance.rsc +23 -0
  345. package/.next/server/app/settings/appearance.segments/!KGFwcCk/settings/appearance/__PAGE__.segment.rsc +9 -0
  346. package/.next/server/app/settings/appearance.segments/!KGFwcCk/settings/appearance.segment.rsc +5 -0
  347. package/.next/server/app/settings/appearance.segments/!KGFwcCk/settings.segment.rsc +5 -0
  348. package/.next/server/app/settings/appearance.segments/!KGFwcCk.segment.rsc +7 -0
  349. package/.next/server/app/settings/appearance.segments/_full.segment.rsc +23 -0
  350. package/.next/server/app/settings/appearance.segments/_head.segment.rsc +6 -0
  351. package/.next/server/app/settings/appearance.segments/_index.segment.rsc +5 -0
  352. package/.next/server/app/settings/appearance.segments/_tree.segment.rsc +2 -0
  353. package/.next/server/app/settings/notifications.html +1 -1
  354. package/.next/server/app/settings/notifications.rsc +4 -4
  355. package/.next/server/app/settings/notifications.segments/!KGFwcCk/settings/notifications/__PAGE__.segment.rsc +2 -2
  356. package/.next/server/app/settings/notifications.segments/!KGFwcCk/settings/notifications.segment.rsc +1 -1
  357. package/.next/server/app/settings/notifications.segments/!KGFwcCk/settings.segment.rsc +1 -1
  358. package/.next/server/app/settings/notifications.segments/!KGFwcCk.segment.rsc +2 -2
  359. package/.next/server/app/settings/notifications.segments/_full.segment.rsc +4 -4
  360. package/.next/server/app/settings/notifications.segments/_head.segment.rsc +1 -1
  361. package/.next/server/app/settings/notifications.segments/_index.segment.rsc +2 -2
  362. package/.next/server/app/settings/notifications.segments/_tree.segment.rsc +2 -2
  363. package/.next/server/app/settings/providers/new.html +1 -0
  364. package/.next/server/app/settings/providers/new.meta +18 -0
  365. package/.next/server/app/settings/providers/new.rsc +23 -0
  366. package/.next/server/app/settings/providers/new.segments/!KGFwcCk/settings/providers/new/__PAGE__.segment.rsc +9 -0
  367. package/.next/server/app/settings/providers/new.segments/!KGFwcCk/settings/providers/new.segment.rsc +5 -0
  368. package/.next/server/app/settings/providers/new.segments/!KGFwcCk/settings/providers.segment.rsc +5 -0
  369. package/.next/server/app/settings/providers/new.segments/!KGFwcCk/settings.segment.rsc +5 -0
  370. package/.next/server/app/settings/providers/new.segments/!KGFwcCk.segment.rsc +7 -0
  371. package/.next/server/app/settings/providers/new.segments/_full.segment.rsc +23 -0
  372. package/.next/server/app/settings/providers/new.segments/_head.segment.rsc +6 -0
  373. package/.next/server/app/settings/providers/new.segments/_index.segment.rsc +5 -0
  374. package/.next/server/app/settings/providers/new.segments/_tree.segment.rsc +2 -0
  375. package/.next/server/app/settings/providers.html +1 -0
  376. package/.next/server/app/settings/providers.meta +17 -0
  377. package/.next/server/app/settings/providers.rsc +23 -0
  378. package/.next/server/app/settings/providers.segments/!KGFwcCk/settings/providers/__PAGE__.segment.rsc +9 -0
  379. package/.next/server/app/settings/providers.segments/!KGFwcCk/settings/providers.segment.rsc +5 -0
  380. package/.next/server/app/settings/providers.segments/!KGFwcCk/settings.segment.rsc +5 -0
  381. package/.next/server/app/settings/providers.segments/!KGFwcCk.segment.rsc +7 -0
  382. package/.next/server/app/settings/providers.segments/_full.segment.rsc +23 -0
  383. package/.next/server/app/settings/providers.segments/_head.segment.rsc +6 -0
  384. package/.next/server/app/settings/providers.segments/_index.segment.rsc +5 -0
  385. package/.next/server/app/settings/providers.segments/_tree.segment.rsc +2 -0
  386. package/.next/server/app/settings/session.html +1 -0
  387. package/.next/server/app/settings/session.meta +17 -0
  388. package/.next/server/app/settings/session.rsc +23 -0
  389. package/.next/server/app/settings/session.segments/!KGFwcCk/settings/session/__PAGE__.segment.rsc +9 -0
  390. package/.next/server/app/settings/session.segments/!KGFwcCk/settings/session.segment.rsc +5 -0
  391. package/.next/server/app/settings/session.segments/!KGFwcCk/settings.segment.rsc +5 -0
  392. package/.next/server/app/settings/session.segments/!KGFwcCk.segment.rsc +7 -0
  393. package/.next/server/app/settings/session.segments/_full.segment.rsc +23 -0
  394. package/.next/server/app/settings/session.segments/_head.segment.rsc +6 -0
  395. package/.next/server/app/settings/session.segments/_index.segment.rsc +5 -0
  396. package/.next/server/app/settings/session.segments/_tree.segment.rsc +2 -0
  397. package/.next/server/app/settings.html +1 -1
  398. package/.next/server/app/settings.rsc +4 -4
  399. package/.next/server/app/settings.segments/!KGFwcCk/settings/__PAGE__.segment.rsc +2 -2
  400. package/.next/server/app/settings.segments/!KGFwcCk/settings.segment.rsc +1 -1
  401. package/.next/server/app/settings.segments/!KGFwcCk.segment.rsc +2 -2
  402. package/.next/server/app/settings.segments/_full.segment.rsc +4 -4
  403. package/.next/server/app/settings.segments/_head.segment.rsc +1 -1
  404. package/.next/server/app/settings.segments/_index.segment.rsc +2 -2
  405. package/.next/server/app/settings.segments/_tree.segment.rsc +2 -2
  406. package/.next/server/app/skills.html +1 -1
  407. package/.next/server/app/skills.rsc +4 -4
  408. package/.next/server/app/skills.segments/!KGFwcCk/skills/__PAGE__.segment.rsc +2 -2
  409. package/.next/server/app/skills.segments/!KGFwcCk/skills.segment.rsc +1 -1
  410. package/.next/server/app/skills.segments/!KGFwcCk.segment.rsc +2 -2
  411. package/.next/server/app/skills.segments/_full.segment.rsc +4 -4
  412. package/.next/server/app/skills.segments/_head.segment.rsc +1 -1
  413. package/.next/server/app/skills.segments/_index.segment.rsc +2 -2
  414. package/.next/server/app/skills.segments/_tree.segment.rsc +2 -2
  415. package/.next/server/app-paths-manifest.json +16 -3
  416. package/.next/server/chunks/1002.js +18 -0
  417. package/.next/server/chunks/1011.js +1 -0
  418. package/.next/server/chunks/1659.js +1 -1
  419. package/.next/server/chunks/1979.js +2 -2
  420. package/.next/server/chunks/2408.js +1 -1
  421. package/.next/server/chunks/{7627.js → 3006.js} +3 -3
  422. package/.next/server/chunks/3434.js +1 -0
  423. package/.next/server/chunks/{5920.js → 4342.js} +1 -1
  424. package/.next/server/chunks/4352.js +1 -0
  425. package/.next/server/chunks/4445.js +1 -1
  426. package/.next/server/chunks/7782.js +6 -0
  427. package/.next/server/chunks/8148.js +1 -0
  428. package/.next/server/chunks/9599.js +11 -0
  429. package/.next/server/middleware-build-manifest.js +1 -1
  430. package/.next/server/middleware-react-loadable-manifest.js +1 -1
  431. package/.next/server/pages/404.html +1 -1
  432. package/.next/server/pages/500.html +1 -1
  433. package/.next/server/server-reference-manifest.json +1 -1
  434. package/.next/static/I-rxZaJEzhe3ZUTjSqB11/_buildManifest.js +1 -0
  435. package/.next/static/chunks/{35922.5bdf78a760129504.js → 13541.056c34ca7fde6869.js} +1 -1
  436. package/.next/static/chunks/26126-97874904b42befb8.js +1 -0
  437. package/.next/static/chunks/31010-6e87f77b97544424.js +1 -0
  438. package/.next/static/chunks/3765-d323c6675307a63e.js +20 -0
  439. package/.next/static/chunks/{11242-d240a18d4e59390b.js → 41487-d802643f4a8fad3c.js} +5 -5
  440. package/.next/static/chunks/48273-fb393846bb4333c0.js +6 -0
  441. package/.next/static/chunks/63606.a387b0261d6523ab.js +1 -0
  442. package/.next/static/chunks/6935-f436a624267529fb.js +1 -0
  443. package/.next/static/chunks/{69427.0f379c6bdea95405.js → 69427.a0b463c808aa54c8.js} +1 -1
  444. package/.next/static/chunks/86939-dfc6f8eb395caa89.js +1 -0
  445. package/.next/static/chunks/app/(app)/agents/[name]/page-8bdd0359043537d4.js +8 -0
  446. package/.next/static/chunks/app/(app)/agents/page-6fcfd7ab6781814e.js +1 -0
  447. package/.next/static/chunks/app/(app)/changes/page-4549a5bd72d77e3e.js +1 -0
  448. package/.next/static/chunks/app/(app)/claude-md/edit/page-08e6e120e71979f4.js +1 -0
  449. package/.next/static/chunks/app/(app)/claude-md/page-cd9e2176a12ba241.js +1 -0
  450. package/.next/static/chunks/app/(app)/commands/[name]/page-7cdfdef29ded0aa0.js +6 -0
  451. package/.next/static/chunks/app/(app)/commands/page-f126b608b04747ac.js +1 -0
  452. package/.next/static/chunks/app/(app)/files/page-f526eb95821e000e.js +1 -0
  453. package/.next/static/chunks/app/(app)/hooks/[event]/page-28038323fd29adfa.js +6 -0
  454. package/.next/static/chunks/app/(app)/hooks/page-f1f39284e53c0344.js +1 -0
  455. package/.next/static/chunks/app/(app)/inbox/[id]/page-bc1ff3a0db0114a4.js +1 -0
  456. package/.next/static/chunks/app/(app)/inbox/page-82e03870103ce9bd.js +1 -0
  457. package/.next/static/chunks/app/(app)/jobs/[id]/edit/page-7fb788f772ff2129.js +1 -0
  458. package/.next/static/chunks/app/(app)/jobs/[id]/page-a5856b9ae967ff59.js +1 -0
  459. package/.next/static/chunks/app/(app)/jobs/[id]/runs/[runId]/page-b7c513402db11db6.js +1 -0
  460. package/.next/static/chunks/app/(app)/jobs/page-e9bbd6c116b9699f.js +1 -0
  461. package/.next/static/chunks/app/(app)/{layout-81c1899969de11e6.js → layout-ce9e1be301c60fe5.js} +1 -1
  462. package/.next/static/chunks/app/(app)/mcp-servers/[name]/page-d6d805a27ec0b0c0.js +1 -0
  463. package/.next/static/chunks/app/(app)/mcp-servers/page-4b7276d43451cd43.js +1 -0
  464. package/.next/static/chunks/app/(app)/page-027a5382da30ddb9.js +1 -0
  465. package/.next/static/chunks/app/(app)/reviews/[owner]/[repo]/[number]/page-9ab2955c455bb5fa.js +13 -0
  466. package/.next/static/chunks/app/(app)/reviews/[owner]/[repo]/{page-c7473a899c7c59c3.js → page-c5fd013309ab3eba.js} +1 -1
  467. package/.next/static/chunks/app/(app)/reviews/{page-0e6e7395a4f62b50.js → page-47530d93bb9d4a76.js} +1 -1
  468. package/.next/static/chunks/app/(app)/sessions/[id]/page-94f891e1b54fd05f.js +1 -0
  469. package/.next/static/chunks/app/(app)/settings/appearance/page-95902da748ac5f1e.js +1 -0
  470. package/.next/static/chunks/app/(app)/settings/notifications/{page-a28db2ebc9fd0de8.js → page-229f1db6beb1d19c.js} +1 -1
  471. package/.next/static/chunks/app/(app)/settings/page-8ed16a66fdde10cd.js +1 -0
  472. package/.next/static/chunks/app/(app)/settings/providers/[id]/page-13654263246617b3.js +1 -0
  473. package/.next/static/chunks/app/(app)/settings/providers/new/page-e1798e321ccbc6df.js +1 -0
  474. package/.next/static/chunks/app/(app)/settings/providers/page-0bb4c1db2ee35b3d.js +1 -0
  475. package/.next/static/chunks/app/(app)/settings/session/page-ab216a8fa37a0f76.js +1 -0
  476. package/.next/static/chunks/app/(app)/skills/[name]/page-8ab85d5090967ee4.js +6 -0
  477. package/.next/static/chunks/app/(app)/skills/page-c52773eacb27c04e.js +1 -0
  478. package/.next/static/chunks/app/_global-error/page-fc747760bd4c8a4b.js +1 -0
  479. package/.next/static/chunks/app/api/agents/[name]/route-fc747760bd4c8a4b.js +1 -0
  480. package/.next/static/chunks/app/api/agents/route-fc747760bd4c8a4b.js +1 -0
  481. package/.next/static/chunks/app/api/auth/check/route-fc747760bd4c8a4b.js +1 -0
  482. package/.next/static/chunks/app/api/auth/login/route-fc747760bd4c8a4b.js +1 -0
  483. package/.next/static/chunks/app/api/auth/setup/route-fc747760bd4c8a4b.js +1 -0
  484. package/.next/static/chunks/app/api/auth/ws-token/route-fc747760bd4c8a4b.js +1 -0
  485. package/.next/static/chunks/app/api/btw/route-fc747760bd4c8a4b.js +1 -0
  486. package/.next/static/chunks/app/api/claude-md/route-fc747760bd4c8a4b.js +1 -0
  487. package/.next/static/chunks/app/api/commands/[name]/route-fc747760bd4c8a4b.js +1 -0
  488. package/.next/static/chunks/app/api/commands/route-fc747760bd4c8a4b.js +1 -0
  489. package/.next/static/chunks/app/api/defaults/route-fc747760bd4c8a4b.js +1 -0
  490. package/.next/static/chunks/app/api/filesystem/browse/route-fc747760bd4c8a4b.js +1 -0
  491. package/.next/static/chunks/app/api/filesystem/files/route-fc747760bd4c8a4b.js +1 -0
  492. package/.next/static/chunks/app/api/filesystem/mkdir/route-fc747760bd4c8a4b.js +1 -0
  493. package/.next/static/chunks/app/api/filesystem/read/route-fc747760bd4c8a4b.js +1 -0
  494. package/.next/static/chunks/app/api/git/clone/route-fc747760bd4c8a4b.js +1 -0
  495. package/.next/static/chunks/app/api/git/commit/route-fc747760bd4c8a4b.js +1 -0
  496. package/.next/static/chunks/app/api/git/diff/route-fc747760bd4c8a4b.js +1 -0
  497. package/.next/static/chunks/app/api/git/discard/route-fc747760bd4c8a4b.js +1 -0
  498. package/.next/static/chunks/app/api/git/generate-message/route-fc747760bd4c8a4b.js +1 -0
  499. package/.next/static/chunks/app/api/git/push/route-fc747760bd4c8a4b.js +1 -0
  500. package/.next/static/chunks/app/api/git/status/route-fc747760bd4c8a4b.js +1 -0
  501. package/.next/static/chunks/app/api/github/file-content/route-fc747760bd4c8a4b.js +1 -0
  502. package/.next/static/chunks/app/api/github/orgs/route-fc747760bd4c8a4b.js +1 -0
  503. package/.next/static/chunks/app/api/github/prs/checks/route-fc747760bd4c8a4b.js +1 -0
  504. package/.next/static/chunks/app/api/github/prs/diff/route-fc747760bd4c8a4b.js +1 -0
  505. package/.next/static/chunks/app/api/github/prs/review/route-fc747760bd4c8a4b.js +1 -0
  506. package/.next/static/chunks/app/api/github/prs/route-fc747760bd4c8a4b.js +1 -0
  507. package/.next/static/chunks/app/api/github/prs/view/route-fc747760bd4c8a4b.js +1 -0
  508. package/.next/static/chunks/app/api/github/repos/route-fc747760bd4c8a4b.js +1 -0
  509. package/.next/static/chunks/app/api/github/review-session/route-fc747760bd4c8a4b.js +1 -0
  510. package/.next/static/chunks/app/api/health/route-fc747760bd4c8a4b.js +1 -0
  511. package/.next/static/chunks/app/api/hooks/route-fc747760bd4c8a4b.js +1 -0
  512. package/.next/static/chunks/app/api/inbox/[id]/route-fc747760bd4c8a4b.js +1 -0
  513. package/.next/static/chunks/app/api/inbox/route-fc747760bd4c8a4b.js +1 -0
  514. package/.next/static/chunks/app/api/jobs/[id]/route-fc747760bd4c8a4b.js +1 -0
  515. package/.next/static/chunks/app/api/jobs/[id]/runs/[runId]/route-fc747760bd4c8a4b.js +1 -0
  516. package/.next/static/chunks/app/api/jobs/[id]/runs/[runId]/transcript/route-fc747760bd4c8a4b.js +1 -0
  517. package/.next/static/chunks/app/api/jobs/[id]/runs/route-fc747760bd4c8a4b.js +1 -0
  518. package/.next/static/chunks/app/api/jobs/[id]/trigger/route-fc747760bd4c8a4b.js +1 -0
  519. package/.next/static/chunks/app/api/jobs/mcp-discover/route-fc747760bd4c8a4b.js +1 -0
  520. package/.next/static/chunks/app/api/jobs/route-fc747760bd4c8a4b.js +1 -0
  521. package/.next/static/chunks/app/api/jobs/status/route-fc747760bd4c8a4b.js +1 -0
  522. package/.next/static/chunks/app/api/mcp-servers/[name]/route-fc747760bd4c8a4b.js +1 -0
  523. package/.next/static/chunks/app/api/mcp-servers/[name]/test/route-fc747760bd4c8a4b.js +1 -0
  524. package/.next/static/chunks/app/api/mcp-servers/route-fc747760bd4c8a4b.js +1 -0
  525. package/.next/static/chunks/app/api/notifications/route-fc747760bd4c8a4b.js +1 -0
  526. package/.next/static/chunks/app/api/notifications/test/route-fc747760bd4c8a4b.js +1 -0
  527. package/.next/static/chunks/app/api/providers/[id]/route-fc747760bd4c8a4b.js +1 -0
  528. package/.next/static/chunks/app/api/providers/route-fc747760bd4c8a4b.js +1 -0
  529. package/.next/static/chunks/app/api/reviews/pinned/route-fc747760bd4c8a4b.js +1 -0
  530. package/.next/static/chunks/app/api/sessions/[id]/context/route-fc747760bd4c8a4b.js +1 -0
  531. package/.next/static/chunks/app/api/sessions/[id]/mcp/route-fc747760bd4c8a4b.js +1 -0
  532. package/.next/static/chunks/app/api/sessions/[id]/route-fc747760bd4c8a4b.js +1 -0
  533. package/.next/static/chunks/app/api/sessions/[id]/search/route-fc747760bd4c8a4b.js +1 -0
  534. package/.next/static/chunks/app/api/sessions/[id]/tabs/route-fc747760bd4c8a4b.js +1 -0
  535. package/.next/static/chunks/app/api/sessions/bulk-delete/route-fc747760bd4c8a4b.js +1 -0
  536. package/.next/static/chunks/app/api/sessions/by-ids/route-fc747760bd4c8a4b.js +1 -0
  537. package/.next/static/chunks/app/api/sessions/group/route-fc747760bd4c8a4b.js +1 -0
  538. package/.next/static/chunks/app/api/sessions/pinned/route-fc747760bd4c8a4b.js +1 -0
  539. package/.next/static/chunks/app/api/sessions/route-fc747760bd4c8a4b.js +1 -0
  540. package/.next/static/chunks/app/api/sessions/search/route-fc747760bd4c8a4b.js +1 -0
  541. package/.next/static/chunks/app/api/sessions/thinking/route-fc747760bd4c8a4b.js +1 -0
  542. package/.next/static/chunks/app/api/skills/[name]/route-fc747760bd4c8a4b.js +1 -0
  543. package/.next/static/chunks/app/api/skills/route-fc747760bd4c8a4b.js +1 -0
  544. package/.next/static/chunks/app/api/terminal/[id]/route-fc747760bd4c8a4b.js +1 -0
  545. package/.next/static/chunks/app/api/terminal/route-fc747760bd4c8a4b.js +1 -0
  546. package/.next/static/chunks/app/api/usage/route-fc747760bd4c8a4b.js +1 -0
  547. package/.next/static/chunks/app/api/version/changelog/route-fc747760bd4c8a4b.js +1 -0
  548. package/.next/static/chunks/app/api/version/cockpit/changelog/route-fc747760bd4c8a4b.js +1 -0
  549. package/.next/static/chunks/app/api/version/cockpit/route-fc747760bd4c8a4b.js +1 -0
  550. package/.next/static/chunks/app/api/version/route-fc747760bd4c8a4b.js +1 -0
  551. package/.next/static/chunks/e868780c.f24b6da08e62c7b2.js +18 -0
  552. package/.next/static/chunks/next/dist/client/components/builtin/app-error-fc747760bd4c8a4b.js +1 -0
  553. package/.next/static/chunks/next/dist/client/components/builtin/forbidden-fc747760bd4c8a4b.js +1 -0
  554. package/.next/static/chunks/next/dist/client/components/builtin/not-found-fc747760bd4c8a4b.js +1 -0
  555. package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-fc747760bd4c8a4b.js +1 -0
  556. package/.next/static/chunks/webpack-e31bb45fa59caed8.js +1 -0
  557. package/.next/static/css/3f8af4ae6f812d5c.css +1 -0
  558. package/README.md +12 -3
  559. package/bin/cockpit-hook-bridge.mjs +170 -0
  560. package/dist/server.js +11 -1
  561. package/dist/src/lib/models.js +48 -7
  562. package/dist/src/server/auth.js +32 -10
  563. package/dist/src/server/claude-settings.js +153 -0
  564. package/dist/src/server/cli-init-fetch.js +86 -0
  565. package/dist/src/server/cron-utils.js +16 -5
  566. package/dist/src/server/debug-logger.js +2 -2
  567. package/dist/src/server/defaults.js +16 -7
  568. package/dist/src/server/fs-watcher.js +50 -0
  569. package/dist/src/server/hook-bridge-path.js +34 -0
  570. package/dist/src/server/hook-event-translator.js +211 -0
  571. package/dist/src/server/hook-router.js +150 -0
  572. package/dist/src/server/inbox.js +14 -10
  573. package/dist/src/server/job-lock.js +103 -0
  574. package/dist/src/server/job-scheduler.js +23 -8
  575. package/dist/src/server/job-storage.js +28 -13
  576. package/dist/src/server/notification-settings.js +13 -9
  577. package/dist/src/server/paths.js +23 -0
  578. package/dist/src/server/plans.js +8 -5
  579. package/dist/src/server/providers.js +128 -0
  580. package/dist/src/server/pty-runtime.js +324 -0
  581. package/dist/src/server/pty-session.js +178 -0
  582. package/dist/src/server/session-manager.js +727 -144
  583. package/dist/src/server/session-prefs.js +33 -8
  584. package/dist/src/server/singleton.js +18 -0
  585. package/dist/src/server/stream-processor.js +61 -48
  586. package/dist/src/server/terminal-manager.js +153 -0
  587. package/dist/src/server/todo-watcher.js +178 -0
  588. package/dist/src/server/transcript-watcher.js +91 -0
  589. package/dist/src/server/transcript.js +177 -11
  590. package/dist/src/server/ws-handler.js +235 -61
  591. package/next.config.ts +1 -0
  592. package/package.json +10 -3
  593. package/public/fonts/symbols-nerd-font-mono.woff2 +0 -0
  594. package/.next/server/chunks/1941.js +0 -9
  595. package/.next/server/chunks/2444.js +0 -6
  596. package/.next/static/brzairTqHmHwvfgKpdkYX/_buildManifest.js +0 -1
  597. package/.next/static/chunks/3765-a4c7a493ec83f918.js +0 -20
  598. package/.next/static/chunks/75866-76a3987dda1295ae.js +0 -1
  599. package/.next/static/chunks/93273-87110c1449e1e7fd.js +0 -6
  600. package/.next/static/chunks/app/(app)/agents/[name]/page-3ec9a3460e8e9006.js +0 -8
  601. package/.next/static/chunks/app/(app)/agents/page-d6d504e7d7757ea2.js +0 -1
  602. package/.next/static/chunks/app/(app)/changes/page-a09bf4742aa8b5ce.js +0 -1
  603. package/.next/static/chunks/app/(app)/claude-md/edit/page-ab42921ba2618dc3.js +0 -1
  604. package/.next/static/chunks/app/(app)/claude-md/page-c4c8b20aa002a94a.js +0 -1
  605. package/.next/static/chunks/app/(app)/commands/[name]/page-2124ffed9a4e95a3.js +0 -6
  606. package/.next/static/chunks/app/(app)/commands/page-d5bf1bddd17e31dd.js +0 -1
  607. package/.next/static/chunks/app/(app)/files/page-04e4e5bf1ca89945.js +0 -1
  608. package/.next/static/chunks/app/(app)/hooks/[event]/page-d988623e739973b5.js +0 -6
  609. package/.next/static/chunks/app/(app)/hooks/page-818242d7db432578.js +0 -1
  610. package/.next/static/chunks/app/(app)/inbox/[id]/page-c33dc94e309ff117.js +0 -1
  611. package/.next/static/chunks/app/(app)/inbox/page-ca3e1724b5072734.js +0 -1
  612. package/.next/static/chunks/app/(app)/jobs/[id]/edit/page-3a1c927d76333bf0.js +0 -1
  613. package/.next/static/chunks/app/(app)/jobs/[id]/page-8e698e00b90968b0.js +0 -1
  614. package/.next/static/chunks/app/(app)/jobs/[id]/runs/[runId]/page-f942df0b7c1d280b.js +0 -1
  615. package/.next/static/chunks/app/(app)/jobs/page-7a88cc6ac34550c2.js +0 -1
  616. package/.next/static/chunks/app/(app)/mcp-servers/[name]/page-3541bf3ccdef9145.js +0 -1
  617. package/.next/static/chunks/app/(app)/mcp-servers/page-3927dfd03d921040.js +0 -1
  618. package/.next/static/chunks/app/(app)/page-594120e0ea1df527.js +0 -1
  619. package/.next/static/chunks/app/(app)/reviews/[owner]/[repo]/[number]/page-74c23b04f5c3ff88.js +0 -13
  620. package/.next/static/chunks/app/(app)/sessions/[id]/page-435e9fb4dd34007d.js +0 -1
  621. package/.next/static/chunks/app/(app)/settings/page-f8ada7997c0d5b03.js +0 -1
  622. package/.next/static/chunks/app/(app)/skills/[name]/page-5dbe1e7682880145.js +0 -6
  623. package/.next/static/chunks/app/(app)/skills/page-fd1986ad7e060f4d.js +0 -1
  624. package/.next/static/chunks/app/_global-error/page-65c661eddfc65f5b.js +0 -1
  625. package/.next/static/chunks/app/api/agents/[name]/route-65c661eddfc65f5b.js +0 -1
  626. package/.next/static/chunks/app/api/agents/route-65c661eddfc65f5b.js +0 -1
  627. package/.next/static/chunks/app/api/auth/check/route-65c661eddfc65f5b.js +0 -1
  628. package/.next/static/chunks/app/api/auth/login/route-65c661eddfc65f5b.js +0 -1
  629. package/.next/static/chunks/app/api/auth/setup/route-65c661eddfc65f5b.js +0 -1
  630. package/.next/static/chunks/app/api/auth/ws-token/route-65c661eddfc65f5b.js +0 -1
  631. package/.next/static/chunks/app/api/btw/route-65c661eddfc65f5b.js +0 -1
  632. package/.next/static/chunks/app/api/claude-md/route-65c661eddfc65f5b.js +0 -1
  633. package/.next/static/chunks/app/api/commands/[name]/route-65c661eddfc65f5b.js +0 -1
  634. package/.next/static/chunks/app/api/commands/route-65c661eddfc65f5b.js +0 -1
  635. package/.next/static/chunks/app/api/defaults/route-65c661eddfc65f5b.js +0 -1
  636. package/.next/static/chunks/app/api/filesystem/browse/route-65c661eddfc65f5b.js +0 -1
  637. package/.next/static/chunks/app/api/filesystem/files/route-65c661eddfc65f5b.js +0 -1
  638. package/.next/static/chunks/app/api/filesystem/mkdir/route-65c661eddfc65f5b.js +0 -1
  639. package/.next/static/chunks/app/api/filesystem/read/route-65c661eddfc65f5b.js +0 -1
  640. package/.next/static/chunks/app/api/git/clone/route-65c661eddfc65f5b.js +0 -1
  641. package/.next/static/chunks/app/api/git/commit/route-65c661eddfc65f5b.js +0 -1
  642. package/.next/static/chunks/app/api/git/diff/route-65c661eddfc65f5b.js +0 -1
  643. package/.next/static/chunks/app/api/git/discard/route-65c661eddfc65f5b.js +0 -1
  644. package/.next/static/chunks/app/api/git/generate-message/route-65c661eddfc65f5b.js +0 -1
  645. package/.next/static/chunks/app/api/git/push/route-65c661eddfc65f5b.js +0 -1
  646. package/.next/static/chunks/app/api/git/status/route-65c661eddfc65f5b.js +0 -1
  647. package/.next/static/chunks/app/api/github/file-content/route-65c661eddfc65f5b.js +0 -1
  648. package/.next/static/chunks/app/api/github/orgs/route-65c661eddfc65f5b.js +0 -1
  649. package/.next/static/chunks/app/api/github/prs/checks/route-65c661eddfc65f5b.js +0 -1
  650. package/.next/static/chunks/app/api/github/prs/diff/route-65c661eddfc65f5b.js +0 -1
  651. package/.next/static/chunks/app/api/github/prs/review/route-65c661eddfc65f5b.js +0 -1
  652. package/.next/static/chunks/app/api/github/prs/route-65c661eddfc65f5b.js +0 -1
  653. package/.next/static/chunks/app/api/github/prs/view/route-65c661eddfc65f5b.js +0 -1
  654. package/.next/static/chunks/app/api/github/repos/route-65c661eddfc65f5b.js +0 -1
  655. package/.next/static/chunks/app/api/github/review-session/route-65c661eddfc65f5b.js +0 -1
  656. package/.next/static/chunks/app/api/health/route-65c661eddfc65f5b.js +0 -1
  657. package/.next/static/chunks/app/api/hooks/route-65c661eddfc65f5b.js +0 -1
  658. package/.next/static/chunks/app/api/inbox/[id]/route-65c661eddfc65f5b.js +0 -1
  659. package/.next/static/chunks/app/api/inbox/route-65c661eddfc65f5b.js +0 -1
  660. package/.next/static/chunks/app/api/jobs/[id]/route-65c661eddfc65f5b.js +0 -1
  661. package/.next/static/chunks/app/api/jobs/[id]/runs/[runId]/route-65c661eddfc65f5b.js +0 -1
  662. package/.next/static/chunks/app/api/jobs/[id]/runs/[runId]/transcript/route-65c661eddfc65f5b.js +0 -1
  663. package/.next/static/chunks/app/api/jobs/[id]/runs/route-65c661eddfc65f5b.js +0 -1
  664. package/.next/static/chunks/app/api/jobs/[id]/trigger/route-65c661eddfc65f5b.js +0 -1
  665. package/.next/static/chunks/app/api/jobs/mcp-discover/route-65c661eddfc65f5b.js +0 -1
  666. package/.next/static/chunks/app/api/jobs/route-65c661eddfc65f5b.js +0 -1
  667. package/.next/static/chunks/app/api/jobs/status/route-65c661eddfc65f5b.js +0 -1
  668. package/.next/static/chunks/app/api/mcp-servers/[name]/route-65c661eddfc65f5b.js +0 -1
  669. package/.next/static/chunks/app/api/mcp-servers/[name]/test/route-65c661eddfc65f5b.js +0 -1
  670. package/.next/static/chunks/app/api/mcp-servers/route-65c661eddfc65f5b.js +0 -1
  671. package/.next/static/chunks/app/api/notifications/route-65c661eddfc65f5b.js +0 -1
  672. package/.next/static/chunks/app/api/notifications/test/route-65c661eddfc65f5b.js +0 -1
  673. package/.next/static/chunks/app/api/reviews/pinned/route-65c661eddfc65f5b.js +0 -1
  674. package/.next/static/chunks/app/api/sessions/[id]/context/route-65c661eddfc65f5b.js +0 -1
  675. package/.next/static/chunks/app/api/sessions/[id]/mcp/route-65c661eddfc65f5b.js +0 -1
  676. package/.next/static/chunks/app/api/sessions/[id]/route-65c661eddfc65f5b.js +0 -1
  677. package/.next/static/chunks/app/api/sessions/[id]/search/route-65c661eddfc65f5b.js +0 -1
  678. package/.next/static/chunks/app/api/sessions/bulk-delete/route-65c661eddfc65f5b.js +0 -1
  679. package/.next/static/chunks/app/api/sessions/by-ids/route-65c661eddfc65f5b.js +0 -1
  680. package/.next/static/chunks/app/api/sessions/group/route-65c661eddfc65f5b.js +0 -1
  681. package/.next/static/chunks/app/api/sessions/pinned/route-65c661eddfc65f5b.js +0 -1
  682. package/.next/static/chunks/app/api/sessions/route-65c661eddfc65f5b.js +0 -1
  683. package/.next/static/chunks/app/api/sessions/search/route-65c661eddfc65f5b.js +0 -1
  684. package/.next/static/chunks/app/api/skills/[name]/route-65c661eddfc65f5b.js +0 -1
  685. package/.next/static/chunks/app/api/skills/route-65c661eddfc65f5b.js +0 -1
  686. package/.next/static/chunks/app/api/usage/route-65c661eddfc65f5b.js +0 -1
  687. package/.next/static/chunks/app/api/version/cockpit/route-65c661eddfc65f5b.js +0 -1
  688. package/.next/static/chunks/app/api/version/route-65c661eddfc65f5b.js +0 -1
  689. package/.next/static/chunks/next/dist/client/components/builtin/app-error-65c661eddfc65f5b.js +0 -1
  690. package/.next/static/chunks/next/dist/client/components/builtin/forbidden-65c661eddfc65f5b.js +0 -1
  691. package/.next/static/chunks/next/dist/client/components/builtin/not-found-65c661eddfc65f5b.js +0 -1
  692. package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-65c661eddfc65f5b.js +0 -1
  693. package/.next/static/chunks/webpack-3461a05957b13f46.js +0 -1
  694. package/.next/static/css/f04f303b5708dd90.css +0 -1
  695. /package/.next/static/{brzairTqHmHwvfgKpdkYX → I-rxZaJEzhe3ZUTjSqB11}/_ssgManifest.js +0 -0
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[75866],{1275:(e,a,t)=>{t.d(a,{A:()=>h});let h=(0,t(99537).A)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]])},8962:(e,a,t)=>{t.d(a,{A:()=>h});let h=(0,t(99537).A)("maximize-2",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]])},9383:(e,a,t)=>{t.d(a,{A:()=>h});let h=(0,t(99537).A)("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]])},11012:(e,a,t)=>{t.d(a,{A:()=>h});let h=(0,t(99537).A)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},12651:(e,a,t)=>{t.d(a,{A:()=>h});let h=(0,t(99537).A)("cpu",[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]])},14283:(e,a,t)=>{t.d(a,{A:()=>h});let h=(0,t(99537).A)("hammer",[["path",{d:"m15 12-9.373 9.373a1 1 0 0 1-3.001-3L12 9",key:"1hayfq"}],["path",{d:"m18 15 4-4",key:"16gjal"}],["path",{d:"m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172v-.344a2 2 0 0 0-.586-1.414l-1.657-1.657A6 6 0 0 0 12.516 3H9l1.243 1.243A6 6 0 0 1 12 8.485V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5",key:"15ts47"}]])},15561:(e,a,t)=>{t.d(a,{A:()=>h});let h=(0,t(99537).A)("paperclip",[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]])},18402:(e,a,t)=>{t.d(a,{A:()=>h});let h=(0,t(99537).A)("power-off",[["path",{d:"M18.36 6.64A9 9 0 0 1 20.77 15",key:"dxknvb"}],["path",{d:"M6.16 6.16a9 9 0 1 0 12.68 12.68",key:"1x7qb5"}],["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]])},18986:(e,a,t)=>{t.d(a,{A:()=>h});let h=(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"}]])},19707:(e,a,t)=>{t.d(a,{A:()=>h});let h=(0,t(99537).A)("layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]])},19805:(e,a,t)=>{t.d(a,{A:()=>h});let h=(0,t(99537).A)("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]])},20660:(e,a,t)=>{t.d(a,{Q:()=>l});var h=t(26210),d=t(70569),y=t(82627),p=t(65431),k=t(95155);function l({fileDiff:e,options:a,metrics:t,lineAnnotations:A,selectedLines:M,className:r,style:c,prerenderedHTML:i,renderAnnotation:m,renderCustomHeader:v,renderHeaderPrefix:s,renderHeaderMetadata:u,renderGutterUtility:x,renderHoverUtility:o,disableWorkerPool:n=!1}){let{ref:f,getHoveredLine:w}=(0,p.S)({fileDiff:e,options:a,metrics:t,lineAnnotations:A,selectedLines:M,prerenderedHTML:i,hasGutterRenderUtility:null!=x||null!=o,hasCustomHeader:null!=v,disableWorkerPool:n});return(0,k.jsx)(h.mZ,{ref:f,className:r,style:c,children:(0,d.$)((0,y.z)({fileDiff:e,renderCustomHeader:v,renderHeaderPrefix:s,renderHeaderMetadata:u,renderAnnotation:m,renderGutterUtility:x,lineAnnotations:A,renderHoverUtility:o,getHoveredLine:w}),i)})}},25182:(e,a,t)=>{t.d(a,{A:()=>h});let h=(0,t(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"}]])},25494:(e,a,t)=>{t.d(a,{A:()=>h});let h=(0,t(99537).A)("message-square",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]])},28750:(e,a,t)=>{t.d(a,{A:()=>h});let h=(0,t(99537).A)("shield-off",[["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M5 5a1 1 0 0 0-1 1v7c0 5 3.5 7.5 7.67 8.94a1 1 0 0 0 .67.01c2.35-.82 4.48-1.97 5.9-3.71",key:"1jlk70"}],["path",{d:"M9.309 3.652A12.252 12.252 0 0 0 11.24 2.28a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1v7a9.784 9.784 0 0 1-.08 1.264",key:"18rp1v"}]])},30966:(e,a,t)=>{t.d(a,{A:()=>h});let h=(0,t(99537).A)("power",[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]])},36619:(e,a,t)=>{t.d(a,{A:()=>h});let h=(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"}]])},36672:(e,a,t)=>{t.d(a,{A:()=>h});let h=(0,t(99537).A)("clipboard-check",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"m9 14 2 2 4-4",key:"df797q"}]])},40638:(e,a,t)=>{t.d(a,{A:()=>h});let h=(0,t(99537).A)("message-circle-question-mark",[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},40852:(e,a,t)=>{t.d(a,{A:()=>h});let h=(0,t(99537).A)("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]])},50981:(e,a,t)=>{t.d(a,{A:()=>h});let h=(0,t(99537).A)("shield-check",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},55737:(e,a,t)=>{t.d(a,{A:()=>h});let h=(0,t(99537).A)("plug",[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z",key:"1xoxul"}],["path",{d:"M9 8V2",key:"14iosj"}]])},64350:(e,a,t)=>{t.d(a,{A:()=>h});let h=(0,t(99537).A)("shrink",[["path",{d:"m15 15 6 6m-6-6v4.8m0-4.8h4.8",key:"17vawe"}],["path",{d:"M9 19.8V15m0 0H4.2M9 15l-6 6",key:"chjx8e"}],["path",{d:"M15 4.2V9m0 0h4.8M15 9l6-6",key:"lav6yq"}],["path",{d:"M9 4.2V9m0 0H4.2M9 9 3 3",key:"1pxi2q"}]])},66763:(e,a,t)=>{t.d(a,{A:()=>h});let h=(0,t(99537).A)("settings-2",[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]])},69203:(e,a,t)=>{t.d(a,{A:()=>h});let h=(0,t(99537).A)("shield-alert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]])},92298:(e,a,t)=>{t.d(a,{A:()=>h});let h=(0,t(99537).A)("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]])},94088:(e,a,t)=>{t.d(a,{A:()=>h});let h=(0,t(99537).A)("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]])}}]);
@@ -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(3765),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-2 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)("div",{className:`rounded-md transition-colors ${r?"bg-primary/10":"hover:bg-muted/50"}`,children:[(0,n.jsxs)("button",{type:"button",onClick:()=>x(e.question),className:"flex w-full items-start gap-2.5 px-2.5 py-2 text-xs text-left 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.jsx)("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)("div",{className:"px-2.5 pb-2 pl-9",children:(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&&(e.preventDefault(),h())},placeholder:"Tell Claude what to do instead...",className:"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(3765),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,11242,6802,3765,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(3765),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,11242,3765,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:()=>_});var n=s(95155),a=s(73321),l=s(3765),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),L=s(40980);function R({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,L.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 I(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 P(){return!("u"<typeof document)&&document.documentElement.classList.contains("dark")}function O(e,t,s){let n=t.split(/\r?\n/).map(e=>e+"\n"),a=s.split(/\r?\n/).map(e=>e+"\n");for(let t of e.hunks){let e=t.deletionStart-1-t.deletionLineIndex,s=t.additionStart-1-t.additionLineIndex;for(let n of(t.deletionLineIndex=t.deletionStart-1,t.additionLineIndex=t.additionStart-1,t.hunkContent))n.deletionLineIndex+=e,n.additionLineIndex+=s}e.deletionLines=n,e.additionLines=a,e.isPartial=!1}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)(R,{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,L.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)(R,{checked:s.has(e.path),onChange:()=>r(e.path),onClick:e=>e.stopPropagation()}),I(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,L.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&&null!=t.newContent&&O(s,t.oldContent,t.newContent))}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,L.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)(R,{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:[I(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)(R,{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:P()?"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 U=new Map;function J({cwd:e,sessionId:t}){let s,c,d,{settings:u}=(0,F.t)(),{setSidebarSection:h,removeSidebarSection:w,closeSidebar:_}=(0,l.E2)(),{subscribe:G}=(0,z.h)(),W=(0,a.useRouter)(),X=(0,M.G)(),[q,H]=(0,C.useState)(null),[Q,V]=(0,C.useState)(!0),[K,Y]=(0,C.useState)(null),B=U.get(e)||{selectedFile:null,checkedFiles:new Set,commitMsg:"",commitPanelOpen:window.matchMedia("(min-width: 768px)").matches,pushOnCommit:!1,stackedMode:!0,chatRatio:.3},[Z,ee]=(0,C.useState)(B.selectedFile),[et,es]=(0,C.useState)(null),[en,ea]=(0,C.useState)(null),[el,er]=(0,C.useState)(!1),[ei,eo]=(0,C.useState)(null),[ec,ed]=(0,C.useState)(B.commitMsg),[eu,eh]=(0,C.useState)(!1),[ef,em]=(0,C.useState)(null),[ex,ep]=(0,C.useState)(B.checkedFiles),[eg,ej]=(0,C.useState)(B.pushOnCommit),[ew,ek]=(0,C.useState)(B.commitPanelOpen),[ey,eN]=(0,C.useState)(!1),[eb,ev]=(0,C.useState)(!1),[eC,eS]=(0,C.useState)(null),[eA,eE]=(0,C.useState)(B.stackedMode),[eM,eF]=(0,C.useState)(B.chatRatio),[ez,eL]=(0,C.useState)(null),[eR,eI]=(0,C.useState)(0),eP=(0,C.useRef)(null);(0,C.useEffect)(()=>{U.set(e,{selectedFile:Z,checkedFiles:ex,commitMsg:ec,commitPanelOpen:ew,pushOnCommit:eg,stackedMode:eA,chatRatio:eM})},[e,Z,ex,ec,ew,eg,eA,eM]);let eO=(0,C.useCallback)(t=>{V(!0),Y(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=>{H(e)}).catch(()=>Y("Not a git repository")).finally(()=>V(!1))},[e]);(0,C.useEffect)(()=>{eO()},[eO]);let eT=(0,C.useRef)(null);(0,C.useEffect)(()=>{if(t)return G(e=>{if("session:status"!==e.type||!("sessionId"in e)||e.sessionId!==t)return;let s=eT.current;eT.current=e.status,"running"===s&&"idle"===e.status&&(eO(),eI(e=>e+1))})},[t,G,eO]);let e$=(0,C.useCallback)(t=>{er(!0),es(null),ea(null),fetch(`/api/git/diff?cwd=${encodeURIComponent(e)}&file=${encodeURIComponent(t)}`).then(e=>{if(!e.ok)throw Error("Failed");return e.json()}).then(e=>{es(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&&null!=e.newContent&&O(s,e.oldContent,e.newContent),ea(s)}}catch{}}).catch(()=>es(null)).finally(()=>er(!1))},[e]);(0,C.useEffect)(()=>{Z&&!eA&&e$(Z)},[eA,Z,e$]),(0,C.useEffect)(()=>{if(!q||0===q.files.length||Z||eA)return;let e=q.files[0];ee(e.path),e$(e.path)},[q,Z,eA,e$]);let eD=(0,C.useCallback)(e=>{eA?eL(e.path):(ee(e.path),e$(e.path),eo(null),_())},[eA,e$,_]),eU=(0,C.useCallback)((e,t)=>{e.preventDefault(),eo({x:e.clientX,y:e.clientY,file:t})},[]),eJ=(0,C.useCallback)(async t=>{eo(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");Z===t.path&&(ee(null),es(null)),eO()}catch{}},[e,Z,eO]),e_=(0,C.useCallback)(async()=>{if(ec.trim()&&0!==ex.size){eh(!0),em(null);try{let t=await fetch("/api/git/commit",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cwd:e,message:ec.trim(),files:Array.from(ex),push:eg})});if(!t.ok){let e=await t.json();throw Error(e.error||"Failed to commit")}em({ok:!0,message:eg?"Committed and pushed":"Committed"}),ed(""),ep(new Set),ee(null),es(null),eO()}catch(e){em({ok:!1,message:e instanceof Error?e.message:"Failed"})}finally{eh(!1)}}},[e,ec,ex,eg,eO]),eG=(0,C.useCallback)(async()=>{if(0!==ex.size){eN(!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(ex)})}),s=await t.json();if(!t.ok)throw Error(s.error||"Failed");s.message&&ed(s.message)}catch(e){console.error("[generate-message]",e)}finally{eN(!1)}}},[e,ex]),eW=(0,C.useCallback)(async()=>{ev(!0),eS(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")}eS({ok:!0,message:"Pushed"}),eO()}catch(e){eS({ok:!1,message:e instanceof Error?e.message:"Failed"})}finally{ev(!1)}},[e,eO]),eX=(0,C.useCallback)(e=>{ep(t=>{let s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s})},[]),eq=(0,C.useCallback)(()=>{if(!q)return;let e=q.files.map(e=>e.path);ep(t=>t.size===e.length?new Set:new Set(e))},[q]),eH=(0,C.useCallback)(e=>{let t=window.innerWidth||1;eF(s=>Math.max(.15,Math.min(.5,s+e/t)))},[]),eQ=(0,C.useCallback)(()=>{eL(null)},[]),eV=(0,C.useCallback)(t=>{let s=t.startsWith("/")?t:`${e}/${t}`;W.push(`/files?cwd=${encodeURIComponent(e)}&file=${encodeURIComponent(s)}`)},[e,W]);if((0,C.useEffect)(()=>q&&0!==q.files.length?(h({id:"git-changes",title:"Changes",order:20,badge:String(q.files.length),content:(0,n.jsx)(T,{files:q.files,selectedFile:eA?null:Z,checkedFiles:ex,onFileClick:eD,onContextMenu:eU,onToggleFile:eX,onToggleAll:eq})}),()=>w("git-changes")):void w("git-changes"),[q,Z,ex,eA,eD,eU,eX,eq,h,w]),(0,C.useEffect)(()=>{if(!ei)return;let e=e=>{eP.current&&!eP.current.contains(e.target)&&eo(null)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[ei]),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(K)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:K})});if(!q)return null;let eK=X&&!!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:q.branch}),(0,n.jsxs)("span",{className:"text-xs text-muted-foreground",children:[q.files.length," file",1!==q.files.length?"s":""," changed"]}),(s=q.files.reduce((e,t)=>e+t.additions,0),c=q.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),q.ahead>0&&(0,n.jsxs)("span",{className:"text-xs text-muted-foreground",children:[q.ahead," unpushed"]}),eC&&(0,n.jsxs)("span",{className:(0,L.cn)("text-xs flex items-center gap-1",eC.ok?"text-green-500":"text-red-500"),children:[eC.ok&&(0,n.jsx)(o.A,{className:"h-3 w-3"}),eC.message]}),(0,n.jsx)("div",{className:"flex-1"}),q.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:()=>eE(!0),className:(0,L.cn)("rounded px-1.5 py-0.5 text-xs transition-colors",eA?"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:()=>eE(!1),className:(0,L.cn)("rounded px-1.5 py-0.5 text-xs transition-colors",eA?"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"})})]}),q.ahead>0&&(0,n.jsxs)(E.$,{variant:"outline",size:"sm",onClick:eW,disabled:eb,className:"gap-1.5",children:[eb?(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:()=>eO({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:eA?(0,n.jsx)($,{files:q.files,cwd:e,diffStyle:u.diffStyle,scrollToFile:ez,onScrolled:eQ,onViewFile:eV,checkedFiles:ex,onToggleFile:eX,refreshKey:eR}):el?(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"})}):Z&&et?(0,n.jsx)("div",{className:"p-4",children:(0,n.jsxs)("div",{className:"rounded-lg border overflow-hidden",children:[(d=q.files.find(e=>e.path===Z))?(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:[I(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)(R,{checked:ex.has(d.path),onChange:()=>eX(d.path),onClick:e=>e.stopPropagation()}),(0,n.jsx)("button",{onClick:()=>eV(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:et}),children:en?(0,n.jsx)(i.Q,{fileDiff:en,options:{theme:{dark:"pierre-dark",light:"pierre-light"},themeType:P()?"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:et})})]})}):(0,n.jsx)("div",{className:"flex items-center justify-center h-full text-sm text-muted-foreground text-center px-4",children:q.files.length>0?"Select a file from the sidebar to view changes":"No changes"})}),q.files.length>0&&(0,n.jsxs)("div",{className:"shrink-0 border-t",children:[(0,n.jsxs)("button",{onClick:()=>ek(!ew),className:"w-full px-4 py-2 flex items-center gap-2 text-sm font-medium hover:bg-muted/50",children:[ew?(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 (",ex.size," file",1!==ex.size?"s":"",")"]}),ew&&(0,n.jsxs)("div",{className:"px-4 pb-3 space-y-2",children:[(0,n.jsx)("textarea",{value:ec,onChange:e=>ed(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:eG,disabled:ey||0===ex.size,className:"gap-1.5",children:[ey?(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"}),ey?"Generating...":"Generate"]}),(0,n.jsxs)("label",{className:"flex items-center gap-1.5 text-xs text-muted-foreground cursor-pointer",children:[(0,n.jsx)(R,{checked:eg,onChange:()=>ej(!eg)}),"Push after commit"]}),(0,n.jsx)("div",{className:"flex-1"}),ef&&(0,n.jsxs)("span",{className:(0,L.cn)("text-xs flex items-center gap-1",ef.ok?"text-green-500":"text-red-500"),children:[ef.ok&&(0,n.jsx)(o.A,{className:"h-3 w-3"}),ef.message]}),(0,n.jsxs)(E.$,{size:"sm",onClick:e_,disabled:eu||!ec.trim()||0===ex.size,className:"gap-1.5",children:[eu?(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"}),eg?"Commit & Push":"Commit"]})]})]})]})]}),eK&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(D,{onResize:eH}),(0,n.jsx)("div",{className:"flex flex-col shrink-0 border-l min-h-0",style:{width:`${100*eM}%`},children:(0,n.jsx)(S.I,{sessionId:t,cwd:e})})]})]}),ei&&(0,n.jsx)("div",{ref:eP,className:"fixed z-50 rounded border bg-background shadow-lg py-1 min-w-[140px]",style:{left:ei.x,top:ei.y},children:(0,n.jsxs)("button",{onClick:()=>eJ(ei.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 _(){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)(J,{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,11242,75866,3765,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(3765),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,11242,6802,3765,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(3765),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,11242,3765,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(3765),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,11242,6802,3765,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(3765),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,11242,3765,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],{25182:(e,t,l)=>{"use strict";l.d(t,{A:()=>r});let r=(0,l(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,l)=>{Promise.resolve().then(l.bind(l,97616))},97616:(e,t,l)=>{"use strict";l.r(t),l.d(t,{default:()=>w});var r=l(95155),s=l(73321),n=l(3765),i=l(92571),a=l(25182);let c=(0,l(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 o=l(12115),u=l(18189),d=l(96301),f=l(64233),m=l(53972);let h=new Map,x=new Map;function p({cwd:e,initialFile:t}){let{setSidebarSection:l,removeSidebarSection:s,closeSidebar:w}=(0,n.E2)(),[g,j]=(0,o.useState)(()=>t||h.get(e)||null),[v,k]=(0,o.useState)(null),[y,b]=(0,o.useState)(!1),[N,S]=(0,o.useState)(!1),[E,C]=(0,o.useState)(!1),F=(0,o.useRef)(0);(0,o.useEffect)(()=>{"1"===localStorage.getItem("cockpit-files-wrap")&&S(!0),"1"===localStorage.getItem("cockpit-files-preview")&&C(!0)},[]);let M=(0,o.useCallback)(()=>{S(e=>{let t=!e;return localStorage.setItem("cockpit-files-wrap",t?"1":"0"),t})},[]),_=(0,o.useCallback)(()=>{C(e=>{let t=!e;return localStorage.setItem("cockpit-files-preview",t?"1":"0"),t})},[]),A=(0,o.useCallback)(t=>{j(t),h.set(e,t),window.innerWidth<768&&w()},[e,w]);if((0,o.useEffect)(()=>(l({id:"file-tree",title:"Files",content:(0,r.jsx)(d.h,{cwd:e,selectedFile:g,onSelectFile:A}),order:30}),()=>s("file-tree")),[e,g,A,l,s]),(0,o.useEffect)(()=>{if(!g)return void k(null);let e=x.get(g);if(e)return void k(e);let t=++F.current;b(!0),fetch(`/api/filesystem/read?path=${encodeURIComponent(g)}`).then(e=>{if(!e.ok)throw Error("Failed to read file");return e.json()}).then(e=>{if(F.current===t){if(x.size>=50){let e=x.keys().next().value;void 0!==e&&x.delete(e)}x.set(g,e),k(e)}}).catch(()=>{F.current===t&&k(null)}).finally(()=>{F.current===t&&b(!1)})},[g]),!g)return(0,r.jsx)("div",{className:"flex items-center justify-center h-full text-sm text-muted-foreground",children:"Select a file to view"});if(y)return(0,r.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,r.jsx)(i.A,{className:"h-5 w-5 animate-spin text-muted-foreground"})});if(!v)return(0,r.jsx)("div",{className:"flex items-center justify-center h-full text-sm text-muted-foreground",children:"Failed to read file"});let I=function(e,t){if(t.startsWith(e)){let l=t.slice(e.length);return l.startsWith("/")?l.slice(1):l}return t}(e,g),z=(0,m.uk)(g)||g,W=I.slice(0,I.length-z.length),$=(0,u.WG)(g),B="markdown"===$||"mdx"===$,D=B&&E;return(0,r.jsxs)("div",{className:"flex flex-col h-full min-h-0",children:[(0,r.jsxs)("div",{className:"shrink-0 flex items-center gap-1 border-b px-4 py-2 font-mono text-xs",children:[W&&(0,r.jsx)("span",{className:"text-muted-foreground",children:W}),(0,r.jsx)("span",{className:"font-bold",children:z}),v.truncated&&(0,r.jsx)("span",{className:"ml-2 text-muted-foreground",children:"(truncated to 100KB)"}),(0,r.jsxs)("div",{className:"ml-auto flex items-center gap-1",children:[B&&(0,r.jsx)("button",{type:"button",onClick:_,"aria-label":E?"Show source":"Show preview","aria-pressed":E,title:E?"Show source":"Show preview",className:`flex items-center justify-center rounded p-1 hover:bg-accent ${E?"text-foreground":"text-muted-foreground"}`,children:(0,r.jsx)(a.A,{className:"h-3.5 w-3.5"})}),!D&&(0,r.jsx)("button",{type:"button",onClick:M,"aria-label":N?"Disable line wrap":"Enable line wrap","aria-pressed":N,title:N?"Disable line wrap":"Enable line wrap",className:`flex items-center justify-center rounded p-1 hover:bg-accent ${N?"text-foreground":"text-muted-foreground"}`,children:(0,r.jsx)(c,{className:"h-3.5 w-3.5"})})]})]}),v.binary?(0,r.jsx)("div",{className:"flex items-center justify-center flex-1 text-sm text-muted-foreground",children:"Binary file"}):D?(0,r.jsx)(f.Y,{content:v.content,className:"flex-1 min-h-0 overflow-y-auto p-4"}):(0,r.jsx)("div",{className:"flex-1 min-h-0 overflow-auto",children:(0,r.jsx)(u.NG,{code:v.content,language:$,dark:!("u"<typeof document)&&document.documentElement.classList.contains("dark"),fullHeight:!0,wrap:N})})]})}function w(){let e=(0,s.useSearchParams)(),t=e.get("cwd")||"",l=e.get("file");return((0,n.si)("Files"),(0,n.mq)(t||void 0),t)?(0,r.jsx)(p,{cwd:t,initialFile:l}):(0,r.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,11242,3765,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(3765),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,11242,6802,3765,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(3765),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,11242,3765,28441,93794,77358],()=>e(e.s=70532)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[58346],{11012:(e,s,t)=>{"use strict";t.d(s,{A:()=>a});let a=(0,t(99537).A)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},14577:(e,s,t)=>{"use strict";t.d(s,{A:()=>a});let a=(0,t(99537).A)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]])},31966:(e,s,t)=>{"use strict";t.d(s,{A:()=>a});let a=(0,t(99537).A)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},35484:(e,s,t)=>{"use strict";t.d(s,{A:()=>a});let a=(0,t(99537).A)("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},54722:(e,s,t)=>{Promise.resolve().then(t.bind(t,96218))},96218:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>f});var a=t(95155),i=t(35484),l=t(11012),n=t(14577),r=t(92571),c=t(31966),d=t(65738),x=t(73321),h=t(12115),o=t(3765),m=t(64233),u=t(89239),j=t(42763);function f(){(0,o.si)("Inbox");let{id:e}=(0,x.useParams)(),s=(0,x.useRouter)(),[t,f]=(0,h.useState)(null),[p,y]=(0,h.useState)(!0),[k,v]=(0,h.useState)(!1),N=(0,h.useCallback)(async()=>{let s=await fetch("/api/inbox");if(s.ok){let t=((await s.json()).messages||[]).find(s=>s.id===e);f(t||null),t&&!t.read&&await fetch(`/api/inbox/${t.id}`,{method:"PATCH"})}y(!1)},[e]);(0,h.useEffect)(()=>{N()},[N]);let b=async()=>{await fetch(`/api/inbox/${e}`,{method:"DELETE"}),s.push("/inbox")};return p?(0,a.jsx)("div",{className:"flex items-center justify-center py-12",children:(0,a.jsx)(r.A,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):t?(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 justify-between",children:[(0,a.jsxs)(u.$,{variant:"ghost",size:"sm",onClick:()=>s.push("/inbox"),children:[(0,a.jsx)(c.A,{className:"h-4 w-4 mr-1"}),"Back"]}),(0,a.jsxs)(u.$,{variant:"ghost",size:"sm",className:"text-destructive hover:text-destructive",onClick:()=>v(!0),children:[(0,a.jsx)(d.A,{className:"h-4 w-4 mr-1"}),"Delete"]})]}),(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[function(e){switch(e){case"error":return(0,a.jsx)(i.A,{className:"h-5 w-5 text-destructive shrink-0"});case"warning":return(0,a.jsx)(l.A,{className:"h-5 w-5 text-yellow-500 shrink-0"});default:return(0,a.jsx)(n.A,{className:"h-5 w-5 text-blue-500 shrink-0"})}}(t.priority),(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"text-lg font-semibold",children:t.title}),(0,a.jsxs)("div",{className:"flex items-center gap-2 mt-1 text-xs text-muted-foreground",children:[t.jobName&&(0,a.jsx)("span",{children:t.jobName}),(0,a.jsx)("span",{children:new Date(t.createdAt).toLocaleString()})]})]})]}),(0,a.jsx)("div",{className:"border-t pt-4",children:(0,a.jsx)(m.Y,{content:t.body,variant:"full"})}),(0,a.jsx)(j.lG,{open:k,onOpenChange:()=>v(!1),children:(0,a.jsxs)(j.Cf,{children:[(0,a.jsx)(j.c7,{children:(0,a.jsx)(j.L3,{children:"Delete Message"})}),(0,a.jsx)("p",{className:"text-sm text-muted-foreground mb-4",children:"Delete this message? This cannot be undone."}),(0,a.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,a.jsx)(u.$,{variant:"outline",onClick:()=>v(!1),children:"Cancel"}),(0,a.jsx)(u.$,{variant:"destructive",onClick:b,children:"Delete"})]})]})})]}):(0,a.jsxs)("div",{className:"flex-1 p-4",children:[(0,a.jsxs)(u.$,{variant:"ghost",size:"sm",onClick:()=>s.push("/inbox"),children:[(0,a.jsx)(c.A,{className:"h-4 w-4 mr-1"}),"Back"]}),(0,a.jsx)("p",{className:"text-sm text-muted-foreground mt-8 text-center",children:"Message not found."})]})}}},e=>{e.O(0,[989,11242,3765,28441,93794,77358],()=>e(e.s=54722)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[10576],{11012:(e,s,t)=>{"use strict";t.d(s,{A:()=>a});let a=(0,t(99537).A)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},14577:(e,s,t)=>{"use strict";t.d(s,{A:()=>a});let a=(0,t(99537).A)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]])},34454:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>j});var a=t(95155),n=t(35484),l=t(11012),r=t(14577);let i=(0,t(99537).A)("check-check",[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]]);var c=t(65738),d=t(92571),o=t(64577),h=t(73321),x=t(12115),m=t(3765),u=t(89239),f=t(42763);function j(){(0,m.si)("Inbox");let e=(0,h.useRouter)(),[s,t]=(0,x.useState)([]),[j,p]=(0,x.useState)(!0),[g,y]=(0,x.useState)(null),[N,k]=(0,x.useState)(!1),v=(0,x.useCallback)(async()=>{let e=await fetch("/api/inbox");e.ok&&t((await e.json()).messages||[]),p(!1)},[]);(0,x.useEffect)(()=>{v()},[v]);let b=async()=>{g&&(await fetch(`/api/inbox/${g}`,{method:"DELETE"}),t(e=>e.filter(e=>e.id!==g)),y(null))},w=async()=>{await fetch("/api/inbox",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"mark_all_read"})}),t(e=>e.map(e=>({...e,read:!0})))},C=async()=>{await fetch("/api/inbox",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"clear"})}),t([]),k(!1)},A=s.filter(e=>!e.read).length;return(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 justify-between",children:[(0,a.jsx)("div",{className:"text-sm text-muted-foreground",children:s.length>0&&(0,a.jsxs)(a.Fragment,{children:[s.length," message",1!==s.length?"s":"",A>0&&` (${A} unread)`]})}),s.length>0&&(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[A>0&&(0,a.jsxs)(u.$,{variant:"outline",size:"sm",onClick:w,children:[(0,a.jsx)(i,{className:"h-3.5 w-3.5 mr-1"}),"Mark all read"]}),(0,a.jsxs)(u.$,{variant:"outline",size:"sm",onClick:()=>k(!0),children:[(0,a.jsx)(c.A,{className:"h-3.5 w-3.5 mr-1"}),"Clear all"]})]})]}),j&&(0,a.jsx)("div",{className:"flex items-center justify-center py-12",children:(0,a.jsx)(d.A,{className:"h-5 w-5 animate-spin text-muted-foreground"})}),!j&&0===s.length&&(0,a.jsxs)("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[(0,a.jsx)(o.A,{className:"h-12 w-12 text-muted-foreground/50 mb-4"}),(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:"No messages."}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:"Messages from scheduled jobs will appear here."})]}),(0,a.jsx)("div",{className:"space-y-2",children:s.map(s=>(0,a.jsx)("div",{className:`rounded-lg border bg-card transition-colors cursor-pointer hover:bg-accent/50 ${!s.read?"border-l-2 border-l-blue-500":""}`,role:"button",onClick:()=>e.push(`/inbox/${s.id}`),children:(0,a.jsxs)("div",{className:"flex items-center gap-3 p-4",children:[function(e){switch(e){case"error":return(0,a.jsx)(n.A,{className:"h-4 w-4 text-destructive shrink-0"});case"warning":return(0,a.jsx)(l.A,{className:"h-4 w-4 text-yellow-500 shrink-0"});default:return(0,a.jsx)(r.A,{className:"h-4 w-4 text-blue-500 shrink-0"})}}(s.priority),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("div",{className:"flex items-center gap-2",children:(0,a.jsx)("span",{className:`text-sm truncate ${!s.read?"font-semibold":""}`,children:s.title})}),(0,a.jsxs)("div",{className:"flex items-center gap-2 mt-0.5 text-xs text-muted-foreground",children:[s.jobName&&(0,a.jsx)("span",{children:s.jobName}),(0,a.jsx)("span",{children:function(e){let s=Math.floor((Date.now()-e)/6e4);if(s<1)return"just now";if(s<60)return`${s}m ago`;let t=Math.floor(s/60);if(t<24)return`${t}h ago`;let a=Math.floor(t/24);return`${a}d ago`}(s.createdAt)})]})]}),(0,a.jsx)(u.$,{variant:"ghost",size:"icon",className:"h-8 w-8 shrink-0 text-muted-foreground hover:text-destructive",onClick:e=>{var t;return t=s.id,void(e.stopPropagation(),y(t))},children:(0,a.jsx)(c.A,{className:"h-3.5 w-3.5"})})]})},s.id))}),(0,a.jsx)(f.lG,{open:!!g,onOpenChange:()=>y(null),children:(0,a.jsxs)(f.Cf,{children:[(0,a.jsx)(f.c7,{children:(0,a.jsx)(f.L3,{children:"Delete Message"})}),(0,a.jsx)("p",{className:"text-sm text-muted-foreground mb-4",children:"Delete this message? This cannot be undone."}),(0,a.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,a.jsx)(u.$,{variant:"outline",onClick:()=>y(null),children:"Cancel"}),(0,a.jsx)(u.$,{variant:"destructive",onClick:b,children:"Delete"})]})]})}),(0,a.jsx)(f.lG,{open:N,onOpenChange:()=>k(!1),children:(0,a.jsxs)(f.Cf,{children:[(0,a.jsx)(f.c7,{children:(0,a.jsx)(f.L3,{children:"Clear All Messages"})}),(0,a.jsx)("p",{className:"text-sm text-muted-foreground mb-4",children:"Delete all inbox messages? This cannot be undone."}),(0,a.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,a.jsx)(u.$,{variant:"outline",onClick:()=>k(!1),children:"Cancel"}),(0,a.jsx)(u.$,{variant:"destructive",onClick:C,children:"Clear All"})]})]})})]})}},35484:(e,s,t)=>{"use strict";t.d(s,{A:()=>a});let a=(0,t(99537).A)("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},46728:(e,s,t)=>{Promise.resolve().then(t.bind(t,34454))}},e=>{e.O(0,[989,11242,3765,28441,93794,77358],()=>e(e.s=46728)),_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(3765),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"],j=["Read","Write","Edit","Bash","Bash git","Bash npm","Bash ls","Grep","Glob","Agent","WebFetch","WebSearch"],y={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=f?s.get("cwd"):null,k=(0,r.useRouter)();(0,d.si)(v?"Duplicate Job":f?"New Job":"Edit Job");let[C,$]=(0,o.useState)(""),[S,M]=(0,o.useState)(w||""),[W,D]=(0,o.useState)(""),[E,A]=(0,o.useState)(!0),[O,T]=(0,o.useState)([{type:"simple",frequency:"daily",time:"09:00"}]),[z,I]=(0,o.useState)(g),[B,Z]=(0,o.useState)(!1),[P,R]=(0,o.useState)("medium"),[q,J]=(0,o.useState)(30),[F,H]=(0,o.useState)(!1),[K,L]=(0,o.useState)([]),[U,_]=(0,o.useState)(""),[Q,X]=(0,o.useState)([]),[G,V]=(0,o.useState)({}),[Y,ee]=(0,o.useState)({}),[es,et]=(0,o.useState)(new Set),[en,ea]=(0,o.useState)([]),[el,ei]=(0,o.useState)(!1),[er,eo]=(0,o.useState)(90),[ed,ec]=(0,o.useState)(!1),[eu,em]=(0,o.useState)([]),[ex,eh]=(0,o.useState)([]),[ep,ef]=(0,o.useState)(!1),[ej,ey]=(0,o.useState)(!1),[eg,ev]=(0,o.useState)(!f||!!v),eb=z?(0,h.bs)(z):null,eN=eb?.alias||null,ew=eN?(0,h.r5)(eN):[],ek=ew.length>1,eC=eb?(0,h.iz)(eb):[],e$=j.filter(e=>!K.includes(e));function eS(e){let s=e.trim();s&&!K.includes(s)&&L([...K,s]),_("")}let eM=(0,o.useCallback)((e,s)=>{$(s?`${e.name} (copy)`:e.name),M(e.cwd),D(e.prompt),A(e.enabled),T((0,p.KU)(e));let t=e.model||"",n=/\[1m\]$/i.test(t),a=t.replace(/\[.*\]$/,""),l=(0,h.AX)(a);I(l?.modelId||g),Z(n),R(e.thinkingLevel||(0,h.Mi)(l)||""),J(e.maxDurationMinutes??30),H(e.bypassPermissions??!1),L(e.allowedTools||[]),X(e.mcpServers||[]),V(e.mcpToolFilters||{}),ei(e.skipIfMissed??!1),eo(e.retentionDays??90),ec(e.inboxOutput??!1),em(e.notifyProviders||[])},[]),eW=(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 k.push("/jobs");let t=await s.json();eM(t.job,!!v)}finally{ev(!1)}},[t,f,v,k,eM]);async function eD(){ey(!0);let e=eb?.supportsExtendedContext&&B?`${z}[1m]`:z,s={name:C,cwd:S,prompt:W,enabled:E,schedule:O[0],schedules:O,model:e,thinkingLevel:P||void 0,maxDurationMinutes:q,bypassPermissions:F,allowedTools:K,mcpServers:Q,mcpToolFilters:G,skipIfMissed:el,retentionDays:er,inboxOutput:ed,notifyProviders:eu};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;k.push(`/jobs/${s}`)}}finally{ey(!1)}}return((0,o.useEffect)(()=>{eW()},[eW]),(0,o.useEffect)(()=>{let e=S?`?cwd=${encodeURIComponent(S)}`:"";fetch(`/api/jobs/mcp-discover${e}`).then(e=>e.json()).then(e=>ea(e.servers)).catch(()=>ea([]))},[S]),(0,o.useEffect)(()=>{fetch("/api/notifications").then(e=>e.json()).then(e=>eh((e.providers||[]).filter(e=>e.enabled))).catch(()=>eh([]))},[]),eg)?(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:()=>k.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:C,onChange:e=>$(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:W,onChange:e=>D(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:S,onChange:e=>M(e.target.value),placeholder:"Leave empty for scratchpad",className:"flex-1"}),(0,n.jsx)(u.$,{variant:"outline",size:"sm",onClick:()=>ef(!0),children:"Browse"})]}),!S&&(0,n.jsx)("p",{className:"text-xs text-muted-foreground",children:"Uses ~/.cockpit/jobs as a temporary scratchpad directory"}),ep&&(0,n.jsx)("div",{className:"border rounded-md p-3",children:(0,n.jsx)(c.K,{onSelect:e=>{M(e),ef(!1)},onCancel:()=>ef(!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:[O.map((e,s)=>(0,n.jsx)(N,{value:e,onChange:e=>T(O.map((t,n)=>n===s?e:t)),onRemove:()=>T(O.filter((e,t)=>t!==s)),canRemove:O.length>1},s)),(0,n.jsxs)("button",{type:"button",onClick:()=>T([...O,{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:eN===e?"default":"outline",size:"sm",onClick:()=>{let s;(s=(0,h.zQ)(e))&&(I(s.modelId),Z(!1),R((0,h.Mi)(s)||""))},children:e.charAt(0).toUpperCase()+e.slice(1)},e))})]}),ek&&(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:ew.map(e=>(0,n.jsx)(u.$,{variant:eb?.version===e.version?"default":"outline",size:"sm",onClick:()=>(function(e){if(!eN)return;let s=(0,h.r5)(eN).find(s=>s.version===e);if(s){I(s.modelId);let e=(0,h.iz)(s);P&&!e.includes(P)&&R((0,h.Mi)(s)||"")}})(e.version),children:e.version},e.version))})]}),eb?.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:B?"outline":"default",size:"sm",onClick:()=>Z(!1),children:"200K"}),(0,n.jsx)(u.$,{variant:B?"default":"outline",size:"sm",onClick:()=>Z(!0),children:"1M"})]})]}),eC.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:eC.map(e=>(0,n.jsx)(u.$,{variant:P===e?"default":"outline",size:"sm",onClick:()=>R(e),children:y[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:H})]}),!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"}),K.length>0&&(0,n.jsx)("div",{className:"flex flex-wrap gap-1.5",children:K.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:()=>{L(K.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:U,onChange:e=>_(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),eS(U))},placeholder:"Type tool name and press Enter",className:"flex-1 font-mono"}),(0,n.jsx)(u.$,{variant:"outline",size:"sm",onClick:()=>eS(U),disabled:!U.trim(),children:"Add"})]}),e$.length>0&&(0,n.jsx)("div",{className:"flex flex-wrap gap-1",children:e$.map(e=>(0,n.jsxs)("button",{type:"button",onClick:()=>eS(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===K.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===en.length&&(0,n.jsx)("p",{className:"text-xs text-muted-foreground",children:"No MCP servers found. Configure servers in Settings."}),en.length>0&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"flex flex-wrap gap-1.5",children:en.map(e=>{let s=Q.includes(e);return(0,n.jsx)("button",{type:"button",onClick:()=>{if(s){X(Q.filter(s=>s!==e));let{[e]:s,...t}=G;V(t),et(s=>{let t=new Set(s);return t.delete(e),t})}else X([...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===Q.length?"No servers enabled. Select servers to activate.":`${Q.length} enabled.`}),Q.map(e=>{let s=G[e]||[],t=es.has(e),l=Y[e]||"";return(0,n.jsxs)("div",{className:"border rounded-md p-2 space-y-2",children:[(0,n.jsxs)("button",{type:"button",onClick:()=>et(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}=G;V(t)}else V({...G,[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=>ee({...Y,[e]:s.target.value}),onKeyDown:t=>{if("Enter"===t.key){t.preventDefault();let n=l.trim();n&&!s.includes(n)&&(V({...G,[e]:[...s,n]}),ee({...Y,[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)&&(V({...G,[e]:[...s,t]}),ee({...Y,[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:q,onChange:e=>J(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:!el,onChange:e=>ei(!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:er,onChange:e=>eo(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:E,onChange:A})]})]})]}),(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:"Output"})}),(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:"Send to Inbox"}),(0,n.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:"The agent will format its final output as a structured message delivered to your Cockpit inbox."})]}),(0,n.jsx)(b,{checked:ed,onChange:ec})]}),ed&&ex.length>0&&(0,n.jsxs)("div",{className:"mt-4 pt-4 border-t",children:[(0,n.jsx)("label",{className:"text-sm font-medium",children:"External notifications"}),(0,n.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5 mb-2",children:"Also send to these providers when a message is delivered."}),(0,n.jsx)("div",{className:"space-y-1.5",children:ex.map(e=>(0,n.jsxs)("label",{className:"flex items-center gap-2 text-sm cursor-pointer",children:[(0,n.jsx)("input",{type:"checkbox",checked:eu.includes(e.id),onChange:s=>em(t=>s.target.checked?[...t,e.id]:t.filter(s=>s!==e.id)),className:"rounded border-input"}),(0,n.jsx)("span",{children:e.name}),(0,n.jsxs)("span",{className:"text-xs text-muted-foreground",children:["(",e.type,")"]})]},e.id))})]})]})]}),(0,n.jsxs)("div",{className:"flex gap-2",children:[(0,n.jsx)(u.$,{onClick:eD,disabled:ej||!C||!W,children:ej?"Saving...":"Save"}),(0,n.jsx)(u.$,{variant:"outline",onClick:()=>k.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,11242,3765,28441,93794,77358],()=>e(e.s=39071)),_N_E=e.O()}]);