profclaw 2.0.0 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (477) hide show
  1. package/.env.example +14 -2
  2. package/CHANGELOG.md +37 -0
  3. package/CONTRIBUTING.md +20 -0
  4. package/Dockerfile +39 -23
  5. package/README.md +174 -40
  6. package/dist/agents/agent-summary.d.ts +44 -0
  7. package/dist/agents/agent-summary.js +176 -0
  8. package/dist/agents/auto-memory.d.ts +59 -0
  9. package/dist/agents/auto-memory.js +310 -0
  10. package/dist/agents/checkpoint-manager.d.ts +76 -0
  11. package/dist/agents/checkpoint-manager.js +156 -0
  12. package/dist/agents/circuit-breaker.d.ts +54 -0
  13. package/dist/agents/circuit-breaker.js +153 -0
  14. package/dist/agents/context-compactor.d.ts +70 -0
  15. package/dist/agents/context-compactor.js +361 -0
  16. package/dist/agents/conversation-branch.d.ts +55 -0
  17. package/dist/agents/conversation-branch.js +115 -0
  18. package/dist/agents/error-recovery.d.ts +44 -0
  19. package/dist/agents/error-recovery.js +197 -0
  20. package/dist/agents/events.d.ts +76 -0
  21. package/dist/agents/events.js +8 -0
  22. package/dist/agents/executor.d.ts +35 -1
  23. package/dist/agents/executor.js +573 -124
  24. package/dist/agents/file-snapshots.d.ts +72 -0
  25. package/dist/agents/file-snapshots.js +182 -0
  26. package/dist/agents/index.d.ts +2 -0
  27. package/dist/agents/orchestrator.d.ts +183 -0
  28. package/dist/agents/orchestrator.js +495 -0
  29. package/dist/agents/permissions.d.ts +63 -0
  30. package/dist/agents/permissions.js +138 -0
  31. package/dist/agents/plan-mode.d.ts +71 -0
  32. package/dist/agents/plan-mode.js +186 -0
  33. package/dist/agents/prompt-suggestions.d.ts +33 -0
  34. package/dist/agents/prompt-suggestions.js +208 -0
  35. package/dist/agents/rate-limit-monitor.d.ts +56 -0
  36. package/dist/agents/rate-limit-monitor.js +224 -0
  37. package/dist/agents/result-store.d.ts +37 -0
  38. package/dist/agents/result-store.js +104 -0
  39. package/dist/agents/session-diff.d.ts +43 -0
  40. package/dist/agents/session-diff.js +258 -0
  41. package/dist/agents/tool-loader.d.ts +65 -0
  42. package/dist/agents/tool-loader.js +273 -0
  43. package/dist/agents/transcript.d.ts +96 -0
  44. package/dist/agents/transcript.js +267 -0
  45. package/dist/agents/worktree-manager.d.ts +80 -0
  46. package/dist/agents/worktree-manager.js +203 -0
  47. package/dist/auth/middleware.js +14 -0
  48. package/dist/chat/agentic-executor.d.ts +7 -0
  49. package/dist/chat/agentic-executor.js +253 -30
  50. package/dist/chat/conversations.d.ts +2 -0
  51. package/dist/chat/conversations.js +8 -0
  52. package/dist/chat/execution/executor.d.ts +8 -0
  53. package/dist/chat/execution/executor.js +157 -103
  54. package/dist/chat/execution/index.js +5 -1
  55. package/dist/chat/execution/tool-router.js +40 -14
  56. package/dist/chat/execution/tools/canvas.d.ts +2 -2
  57. package/dist/chat/execution/tools/code-tools.d.ts +66 -0
  58. package/dist/chat/execution/tools/code-tools.js +353 -0
  59. package/dist/chat/execution/tools/complete-task.d.ts +2 -2
  60. package/dist/chat/execution/tools/cron-tool.d.ts +26 -10
  61. package/dist/chat/execution/tools/cron-tool.js +48 -3
  62. package/dist/chat/execution/tools/decompose-task.d.ts +58 -0
  63. package/dist/chat/execution/tools/decompose-task.js +166 -0
  64. package/dist/chat/execution/tools/exec.d.ts +5 -2
  65. package/dist/chat/execution/tools/exec.js +294 -155
  66. package/dist/chat/execution/tools/feed-tools.d.ts +77 -0
  67. package/dist/chat/execution/tools/feed-tools.js +142 -0
  68. package/dist/chat/execution/tools/file-ops.d.ts +1 -1
  69. package/dist/chat/execution/tools/github.d.ts +2 -2
  70. package/dist/chat/execution/tools/index.d.ts +14 -2
  71. package/dist/chat/execution/tools/index.js +86 -12
  72. package/dist/chat/execution/tools/integrations.d.ts +8 -8
  73. package/dist/chat/execution/tools/multi-patch.d.ts +53 -0
  74. package/dist/chat/execution/tools/multi-patch.js +373 -0
  75. package/dist/chat/execution/tools/openai-image-gen.d.ts +2 -2
  76. package/dist/chat/execution/tools/plan-tools.d.ts +80 -0
  77. package/dist/chat/execution/tools/plan-tools.js +134 -0
  78. package/dist/chat/execution/tools/profclaw-ops.d.ts +6 -6
  79. package/dist/chat/execution/tools/repl-tool.d.ts +46 -0
  80. package/dist/chat/execution/tools/repl-tool.js +207 -0
  81. package/dist/chat/execution/tools/sessions-send.d.ts +2 -2
  82. package/dist/chat/execution/tools/slack-actions.d.ts +2 -2
  83. package/dist/chat/execution/tools/system.d.ts +4 -4
  84. package/dist/chat/execution/tools/todo-tool.d.ts +72 -0
  85. package/dist/chat/execution/tools/todo-tool.js +152 -0
  86. package/dist/chat/execution/tools/tool-search.d.ts +50 -0
  87. package/dist/chat/execution/tools/tool-search.js +155 -0
  88. package/dist/chat/execution/types.d.ts +21 -14
  89. package/dist/chat/execution/workflows/executor.d.ts +11 -0
  90. package/dist/chat/execution/workflows/executor.js +99 -1
  91. package/dist/chat/execution/workflows/types.d.ts +35 -2
  92. package/dist/chat/format/index.d.ts +1 -0
  93. package/dist/chat/format/index.js +1 -0
  94. package/dist/chat/format/markdown-convert.d.ts +23 -0
  95. package/dist/chat/format/markdown-convert.js +149 -0
  96. package/dist/chat/index.d.ts +1 -1
  97. package/dist/chat/index.js +1 -1
  98. package/dist/chat/message-handler.js +58 -6
  99. package/dist/chat/proactive/index.d.ts +62 -0
  100. package/dist/chat/proactive/index.js +147 -0
  101. package/dist/chat/prompt-adapter.js +2 -0
  102. package/dist/chat/providers/irc/index.d.ts +2 -2
  103. package/dist/chat/providers/telegram/index.d.ts +2 -0
  104. package/dist/chat/providers/telegram/index.js +21 -2
  105. package/dist/chat/system-prompts.d.ts +3 -3
  106. package/dist/chat/system-prompts.js +116 -61
  107. package/dist/chat/tools.d.ts +6 -6
  108. package/dist/cli/commands/auth.js +64 -1
  109. package/dist/cli/commands/chat.js +1327 -138
  110. package/dist/cli/commands/doctor.js +222 -16
  111. package/dist/cli/commands/history.d.ts +3 -0
  112. package/dist/cli/commands/history.js +138 -0
  113. package/dist/cli/commands/import.d.ts +44 -0
  114. package/dist/cli/commands/import.js +526 -0
  115. package/dist/cli/commands/init.d.ts +13 -0
  116. package/dist/cli/commands/init.js +381 -0
  117. package/dist/cli/commands/onboard.js +210 -30
  118. package/dist/cli/commands/plan.d.ts +13 -0
  119. package/dist/cli/commands/plan.js +184 -0
  120. package/dist/cli/commands/serve.d.ts +7 -0
  121. package/dist/cli/commands/serve.js +77 -18
  122. package/dist/cli/commands/setup.js +84 -3
  123. package/dist/cli/commands/status.js +54 -0
  124. package/dist/cli/commands/tools.js +13 -13
  125. package/dist/cli/commands/tui.js +26 -1
  126. package/dist/cli/index.js +19 -0
  127. package/dist/cli/ink/App.d.ts +13 -0
  128. package/dist/cli/ink/App.js +6 -0
  129. package/dist/cli/ink/ChatApp.d.ts +60 -0
  130. package/dist/cli/ink/ChatApp.js +325 -0
  131. package/dist/cli/ink/DashboardApp.d.ts +3 -0
  132. package/dist/cli/ink/DashboardApp.js +143 -0
  133. package/dist/cli/ink/components/AgentStatus.d.ts +17 -0
  134. package/dist/cli/ink/components/AgentStatus.js +33 -0
  135. package/dist/cli/ink/components/ChannelList.d.ts +17 -0
  136. package/dist/cli/ink/components/ChannelList.js +33 -0
  137. package/dist/cli/ink/components/ConnectionStatus.d.ts +19 -0
  138. package/dist/cli/ink/components/ConnectionStatus.js +50 -0
  139. package/dist/cli/ink/components/CostBar.d.ts +19 -0
  140. package/dist/cli/ink/components/CostBar.js +35 -0
  141. package/dist/cli/ink/components/HookStatus.d.ts +15 -0
  142. package/dist/cli/ink/components/HookStatus.js +7 -0
  143. package/dist/cli/ink/components/PermissionPrompt.d.ts +21 -0
  144. package/dist/cli/ink/components/PermissionPrompt.js +51 -0
  145. package/dist/cli/ink/components/PlanView.d.ts +23 -0
  146. package/dist/cli/ink/components/PlanView.js +26 -0
  147. package/dist/cli/ink/components/ProviderList.d.ts +16 -0
  148. package/dist/cli/ink/components/ProviderList.js +16 -0
  149. package/dist/cli/ink/components/SessionHeader.d.ts +15 -0
  150. package/dist/cli/ink/components/SessionHeader.js +15 -0
  151. package/dist/cli/ink/components/StreamingMessage.d.ts +20 -0
  152. package/dist/cli/ink/components/StreamingMessage.js +27 -0
  153. package/dist/cli/ink/components/SuggestionBar.d.ts +15 -0
  154. package/dist/cli/ink/components/SuggestionBar.js +28 -0
  155. package/dist/cli/ink/components/SystemHealth.d.ts +20 -0
  156. package/dist/cli/ink/components/SystemHealth.js +39 -0
  157. package/dist/cli/ink/components/TaskList.d.ts +17 -0
  158. package/dist/cli/ink/components/TaskList.js +59 -0
  159. package/dist/cli/ink/components/ToolCall.d.ts +17 -0
  160. package/dist/cli/ink/components/ToolCall.js +43 -0
  161. package/dist/cli/ink/index.d.ts +23 -0
  162. package/dist/cli/ink/index.js +15 -0
  163. package/dist/cli/ink/keybindings.d.ts +35 -0
  164. package/dist/cli/ink/keybindings.js +105 -0
  165. package/dist/cli/ink/markdown-renderer.d.ts +47 -0
  166. package/dist/cli/ink/markdown-renderer.js +380 -0
  167. package/dist/cli/ink/output-styles.d.ts +39 -0
  168. package/dist/cli/ink/output-styles.js +119 -0
  169. package/dist/cli/interactive/auto-serve.d.ts +38 -0
  170. package/dist/cli/interactive/auto-serve.js +209 -0
  171. package/dist/cli/interactive/index.d.ts +25 -0
  172. package/dist/cli/interactive/index.js +23 -0
  173. package/dist/cli/interactive/picker.d.ts +28 -0
  174. package/dist/cli/interactive/picker.js +153 -0
  175. package/dist/cli/interactive/renderer.d.ts +26 -0
  176. package/dist/cli/interactive/renderer.js +555 -0
  177. package/dist/cli/interactive/repl.d.ts +14 -0
  178. package/dist/cli/interactive/repl.js +1516 -0
  179. package/dist/cli/interactive/stream-client.d.ts +59 -0
  180. package/dist/cli/interactive/stream-client.js +506 -0
  181. package/dist/cli/interactive/types.d.ts +121 -0
  182. package/dist/cli/interactive/types.js +10 -0
  183. package/dist/cli/utils/api.d.ts +9 -0
  184. package/dist/cli/utils/api.js +58 -2
  185. package/dist/cron/natural-language.d.ts +54 -0
  186. package/dist/cron/natural-language.js +569 -0
  187. package/dist/cron/scheduler.d.ts +34 -4
  188. package/dist/cron/scheduler.js +141 -9
  189. package/dist/cron/templates.d.ts +1 -1
  190. package/dist/cron/templates.js +219 -0
  191. package/dist/feeds/feed-engine.d.ts +149 -0
  192. package/dist/feeds/feed-engine.js +600 -0
  193. package/dist/feeds/index.d.ts +9 -0
  194. package/dist/feeds/index.js +8 -0
  195. package/dist/gateway/router.js +6 -1
  196. package/dist/hooks/built-in/audit-log.d.ts +11 -0
  197. package/dist/hooks/built-in/audit-log.js +84 -0
  198. package/dist/hooks/built-in/cost-warning.d.ts +10 -0
  199. package/dist/hooks/built-in/cost-warning.js +59 -0
  200. package/dist/hooks/built-in/dangerous-tool.d.ts +32 -0
  201. package/dist/hooks/built-in/dangerous-tool.js +80 -0
  202. package/dist/hooks/built-in/index.d.ts +14 -0
  203. package/dist/hooks/built-in/index.js +20 -0
  204. package/dist/hooks/index.d.ts +3 -0
  205. package/dist/hooks/index.js +6 -0
  206. package/dist/hooks/loader.d.ts +17 -0
  207. package/dist/hooks/loader.js +142 -0
  208. package/dist/hooks/registry.d.ts +62 -0
  209. package/dist/hooks/registry.js +127 -0
  210. package/dist/integrations/web-search.js +6 -3
  211. package/dist/memory/index.d.ts +1 -0
  212. package/dist/memory/index.js +2 -0
  213. package/dist/memory/memory-service.js +14 -13
  214. package/dist/memory/observational.d.ts +62 -0
  215. package/dist/memory/observational.js +396 -0
  216. package/dist/middleware/content-filter.d.ts +22 -0
  217. package/dist/middleware/content-filter.js +69 -0
  218. package/dist/middleware/request-validator.d.ts +159 -0
  219. package/dist/middleware/request-validator.js +93 -0
  220. package/dist/plugins/sdk.d.ts +22 -0
  221. package/dist/plugins/sdk.js +17 -1
  222. package/dist/projects/types.d.ts +10 -10
  223. package/dist/providers/ai-sdk.d.ts +11 -0
  224. package/dist/providers/ai-sdk.js +78 -19
  225. package/dist/providers/core/models.js +67 -1
  226. package/dist/providers/core/types.d.ts +3 -0
  227. package/dist/providers/index.d.ts +1 -0
  228. package/dist/providers/index.js +1 -0
  229. package/dist/providers/smart-router.d.ts +118 -0
  230. package/dist/providers/smart-router.js +685 -0
  231. package/dist/providers/types.d.ts +16 -16
  232. package/dist/routes/agents.js +50 -0
  233. package/dist/routes/auth.js +8 -1
  234. package/dist/routes/chat.js +259 -14
  235. package/dist/routes/costs.js +32 -0
  236. package/dist/routes/cron.js +80 -5
  237. package/dist/routes/feeds.d.ts +10 -0
  238. package/dist/routes/feeds.js +168 -0
  239. package/dist/routes/mcp.js +21 -0
  240. package/dist/routes/memory.js +130 -0
  241. package/dist/routes/skills.js +129 -0
  242. package/dist/routes/teams.d.ts +9 -0
  243. package/dist/routes/teams.js +210 -0
  244. package/dist/routes/tools.js +14 -0
  245. package/dist/routes/users.js +2 -0
  246. package/dist/server/route-loader.js +3 -1
  247. package/dist/server/stream-bridge.d.ts +19 -0
  248. package/dist/server/stream-bridge.js +38 -0
  249. package/dist/server.js +310 -36
  250. package/dist/skills/marketplace.d.ts +87 -0
  251. package/dist/skills/marketplace.js +268 -0
  252. package/dist/storage/index.d.ts +14 -0
  253. package/dist/storage/index.js +64 -3
  254. package/dist/storage/schema.d.ts +4 -4
  255. package/dist/storage/schema.js +1 -1
  256. package/dist/teams/index.d.ts +110 -0
  257. package/dist/teams/index.js +365 -0
  258. package/dist/tickets/types.d.ts +39 -39
  259. package/dist/types/summary.d.ts +5 -5
  260. package/dist/utils/auto-update.d.ts +23 -0
  261. package/dist/utils/auto-update.js +157 -0
  262. package/dist/utils/offline-detect.d.ts +55 -0
  263. package/dist/utils/offline-detect.js +121 -0
  264. package/dist/utils/pid-file.d.ts +36 -0
  265. package/dist/utils/pid-file.js +125 -0
  266. package/dist/utils/prevent-sleep.d.ts +27 -0
  267. package/dist/utils/prevent-sleep.js +95 -0
  268. package/dist/utils/sanitizer.d.ts +57 -0
  269. package/dist/utils/sanitizer.js +174 -0
  270. package/docker-compose.yml +13 -137
  271. package/package.json +31 -6
  272. package/skills/deploy-cloudflare/SKILL.md +62 -0
  273. package/skills/deploy-vercel/SKILL.md +67 -0
  274. package/skills/docker-deploy/SKILL.md +158 -0
  275. package/skills/full-stack-builder/SKILL.md +92 -0
  276. package/skills/humanizer/SKILL.md +488 -0
  277. package/skills/profclaw-assistant/SKILL.md +85 -56
  278. package/ui/dist/assets/ActivityView-Da6HQ8ws.js +1 -0
  279. package/ui/dist/assets/AgentList-H58R0kX3.js +1 -0
  280. package/ui/dist/assets/AnalyticsDashboard-B28AeRsc.js +1 -0
  281. package/ui/dist/assets/AreaChart-DwLzeAQ8.js +1 -0
  282. package/ui/dist/assets/CartesianChart-piKQsTAR.js +36 -0
  283. package/ui/dist/assets/ChatView-Dbj8rxU5.js +10 -0
  284. package/ui/dist/assets/CostsDashboard-C6F5df0F.js +1 -0
  285. package/ui/dist/assets/EstimateSelect-wga0rUKX.js +1 -0
  286. package/ui/dist/assets/FeedDashboard-Ef6FEzEf.js +1 -0
  287. package/ui/dist/assets/FloatingChatbot-0yhkUeCq.js +2 -0
  288. package/ui/dist/assets/InviteCodeManagement-tUXfx4Bc.js +2 -0
  289. package/ui/dist/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
  290. package/ui/dist/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
  291. package/ui/dist/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
  292. package/ui/dist/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
  293. package/ui/dist/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
  294. package/ui/dist/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
  295. package/ui/dist/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
  296. package/ui/dist/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
  297. package/ui/dist/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
  298. package/ui/dist/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
  299. package/ui/dist/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
  300. package/ui/dist/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
  301. package/ui/dist/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
  302. package/ui/dist/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
  303. package/ui/dist/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
  304. package/ui/dist/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
  305. package/ui/dist/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
  306. package/ui/dist/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
  307. package/ui/dist/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
  308. package/ui/dist/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
  309. package/ui/dist/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
  310. package/ui/dist/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
  311. package/ui/dist/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
  312. package/ui/dist/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
  313. package/ui/dist/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
  314. package/ui/dist/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
  315. package/ui/dist/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
  316. package/ui/dist/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
  317. package/ui/dist/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
  318. package/ui/dist/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
  319. package/ui/dist/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
  320. package/ui/dist/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
  321. package/ui/dist/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
  322. package/ui/dist/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
  323. package/ui/dist/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
  324. package/ui/dist/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
  325. package/ui/dist/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
  326. package/ui/dist/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
  327. package/ui/dist/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
  328. package/ui/dist/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
  329. package/ui/dist/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
  330. package/ui/dist/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
  331. package/ui/dist/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
  332. package/ui/dist/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
  333. package/ui/dist/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
  334. package/ui/dist/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
  335. package/ui/dist/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
  336. package/ui/dist/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
  337. package/ui/dist/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
  338. package/ui/dist/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
  339. package/ui/dist/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
  340. package/ui/dist/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
  341. package/ui/dist/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
  342. package/ui/dist/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
  343. package/ui/dist/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
  344. package/ui/dist/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
  345. package/ui/dist/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
  346. package/ui/dist/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
  347. package/ui/dist/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
  348. package/ui/dist/assets/MarketplacePage-DGrLtolR.js +1 -0
  349. package/ui/dist/assets/{ProjectDetail--gPfvATB.js → ProjectDetail-BgWvA6UP.js} +2 -2
  350. package/ui/dist/assets/ProjectIcon-TDuliqwg.js +1 -0
  351. package/ui/dist/assets/ProjectList-DXgM4187.js +1 -0
  352. package/ui/dist/assets/{Settings-1kaf7VHE.js → Settings-xA8Zhi3p.js} +3 -3
  353. package/ui/dist/assets/StatusIndicator-B8vfFAxg.js +1 -0
  354. package/ui/dist/assets/{SummaryDetail-DV3AmONk.js → SummaryDetail-eedRfTtF.js} +2 -2
  355. package/ui/dist/assets/SummaryList-CLNX2P84.js +1 -0
  356. package/ui/dist/assets/TaskDetail-BtWclNiR.js +1 -0
  357. package/ui/dist/assets/TaskList-JjODAgSc.js +1 -0
  358. package/ui/dist/assets/TeamsPage-CBK5iAyx.js +1 -0
  359. package/ui/dist/assets/TicketBoard-C9aJNNYp.js +1 -0
  360. package/ui/dist/assets/TicketDetail-CV5JmL31.js +1 -0
  361. package/ui/dist/assets/TicketList-68V4lzUz.js +1 -0
  362. package/ui/dist/assets/UserManagement-DKTb6UpE.js +2 -0
  363. package/ui/dist/assets/ViewSwitcher-BvdQht2Y.js +1 -0
  364. package/ui/dist/assets/alert-dialog-O6qBOv_f.js +1 -0
  365. package/ui/dist/assets/{archive-BsLa7brF.js → archive-CX7UvZpf.js} +1 -1
  366. package/ui/dist/assets/badge-BbfnwDJP.js +1 -0
  367. package/ui/dist/assets/{bug-CmZI7jqM.js → bug-3WX0394-.js} +1 -1
  368. package/ui/dist/assets/{calendar-Bf0t2B82.js → calendar-buq77TaS.js} +1 -1
  369. package/ui/dist/assets/{chevron-up-CoUsOvZj.js → chevron-up-4ymsBJRo.js} +1 -1
  370. package/ui/dist/assets/{circle-x-Dgw11LgT.js → circle-x-ByXtwR6Y.js} +1 -1
  371. package/ui/dist/assets/constants-CVdDh7p0.js +1 -0
  372. package/ui/dist/assets/{cpu-DiPMQICV.js → cpu-CiuoCeDY.js} +1 -1
  373. package/ui/dist/assets/{database-BwTfupDi.js → database-BWXSBg5a.js} +1 -1
  374. package/ui/dist/assets/dialog-lDg4NvMV.js +1 -0
  375. package/ui/dist/assets/dollar-sign-Dmijd6DP.js +1 -0
  376. package/ui/dist/assets/{ellipsis-UJx4Xnf6.js → ellipsis-vT-5SVIp.js} +1 -1
  377. package/ui/dist/assets/{ellipsis-vertical-DoULYEKn.js → ellipsis-vertical-B4tAX_bL.js} +1 -1
  378. package/ui/dist/assets/feature-markdown-DBo5Q7uq.js +289 -0
  379. package/ui/dist/assets/{file-code-B2UrJLwi.js → file-code-ChOWdKXf.js} +1 -1
  380. package/ui/dist/assets/{folder-open-BJi577JH.js → folder-open-CkOUbIiP.js} +1 -1
  381. package/ui/dist/assets/{funnel-PkaD_HSR.js → funnel-uZkoSPP-.js} +1 -1
  382. package/ui/dist/assets/{git-branch-C_K30am0.js → git-branch-CwvUxj7C.js} +1 -1
  383. package/ui/dist/assets/{git-commit-horizontal-IT6ecxWQ.js → git-commit-horizontal-lxPzCvhD.js} +1 -1
  384. package/ui/dist/assets/{globe-f-jjCa_g.js → globe-D_WpJdsj.js} +1 -1
  385. package/ui/dist/assets/{hash-DNEv8Elo.js → hash-CA0hJ7vh.js} +1 -1
  386. package/ui/dist/assets/{history-BQSBo_1Q.js → history-CEWMLELs.js} +1 -1
  387. package/ui/dist/assets/inbox-ehtOptTV.js +1 -0
  388. package/ui/dist/assets/{index-nS3EErDg.js → index-C1rhbml4.js} +3 -3
  389. package/ui/dist/assets/index-CR8gfCHv.js +1 -0
  390. package/ui/dist/assets/index-DVXMpWai.js +1 -0
  391. package/ui/dist/assets/index-DaDJMM2v.js +1 -0
  392. package/ui/dist/assets/index-Djdq_0xu.js +1 -0
  393. package/ui/dist/assets/index-M46Gcb8K.css +1 -0
  394. package/ui/dist/assets/index-sEBN7w8J.js +109 -0
  395. package/ui/dist/assets/layers-C6Mhf8Nk.js +1 -0
  396. package/ui/dist/assets/{layout-dashboard-CcKt1hXw.js → layout-dashboard-BRUM0kpT.js} +1 -1
  397. package/ui/dist/assets/{lightbulb-Jhp7FvbU.js → lightbulb-CN2q1O5l.js} +1 -1
  398. package/ui/dist/assets/{link-2-DdO7ostF.js → link-2-CC4E28yJ.js} +1 -1
  399. package/ui/dist/assets/markdown-renderer-C6ENbB0u.js +10 -0
  400. package/ui/dist/assets/markdown-renderer-CfVKi3_s.css +1 -0
  401. package/ui/dist/assets/{message-square-CBgH65X7.js → message-square-Bbb241am.js} +1 -1
  402. package/ui/dist/assets/package-CwT3IzFx.js +1 -0
  403. package/ui/dist/assets/{pencil-CYXCEPQh.js → pencil-CDmiHzoj.js} +1 -1
  404. package/ui/dist/assets/{play-d1ONaH0-.js → play-tjy5jMQX.js} +1 -1
  405. package/ui/dist/assets/popover-CFHZf3pE.js +1 -0
  406. package/ui/dist/assets/progress-BboUHuLf.js +1 -0
  407. package/ui/dist/assets/{rocket-DhvUetsk.js → rocket--8ZHgdXJ.js} +1 -1
  408. package/ui/dist/assets/select-n108rXny.js +1 -0
  409. package/ui/dist/assets/{send-P0r5D7td.js → send-Cu7MR2Qh.js} +1 -1
  410. package/ui/dist/assets/server-DmodxZp-.js +1 -0
  411. package/ui/dist/assets/{settings-2-ocj5uHGx.js → settings-2-CkRNqkxj.js} +1 -1
  412. package/ui/dist/assets/sheet-7aUJkyzU.js +1 -0
  413. package/ui/dist/assets/{shield-check-DfVdE34l.js → shield-check-ViI3nMKE.js} +1 -1
  414. package/ui/dist/assets/{shield-off-8l0J6R-8.js → shield-off-DN3tagkn.js} +1 -1
  415. package/ui/dist/assets/skeleton-C0E1Nfro.js +1 -0
  416. package/ui/dist/assets/{smartphone-77_g3SQn.js → smartphone-5FghiXpA.js} +1 -1
  417. package/ui/dist/assets/{square-Ckzsr3Rn.js → square-DiNSx8K7.js} +1 -1
  418. package/ui/dist/assets/star-DhdFVidS.js +1 -0
  419. package/ui/dist/assets/switch-CIgVbZqQ.js +1 -0
  420. package/ui/dist/assets/table-BC56FVMV.js +1 -0
  421. package/ui/dist/assets/{tag-C35mgoEv.js → tag-CH_vQliw.js} +1 -1
  422. package/ui/dist/assets/textarea-CxDiKFXZ.js +1 -0
  423. package/ui/dist/assets/{timer-DHJBS2w1.js → timer-CdGVTb60.js} +1 -1
  424. package/ui/dist/assets/tooltip-BuW9A5UO.js +1 -0
  425. package/ui/dist/assets/{trash-2-keO5tKPE.js → trash-2-CucZJL0N.js} +1 -1
  426. package/ui/dist/assets/trending-down-BCezC1z2.js +1 -0
  427. package/ui/dist/assets/{trending-up-BBv8KbrY.js → trending-up-C5OYX2k2.js} +1 -1
  428. package/ui/dist/assets/vendor-query-C0p7b53x.js +4 -0
  429. package/ui/dist/assets/vendor-react-Mc5_kfYG.js +12 -0
  430. package/ui/dist/assets/vendor-ui-CXPAUBFv.js +51 -0
  431. package/ui/dist/assets/{wand-sparkles-BusQ52ZK.js → wand-sparkles-BaH6pJnc.js} +1 -1
  432. package/ui/dist/assets/{wrench-02YaOSiK.js → wrench-CjxjP6ok.js} +1 -1
  433. package/ui/dist/index.html +5 -2
  434. package/ui/dist/assets/ActivityView-BeshZXmE.js +0 -1
  435. package/ui/dist/assets/AgentList-QVHeldPi.js +0 -1
  436. package/ui/dist/assets/AnalyticsDashboard-C9R97dXE.js +0 -1
  437. package/ui/dist/assets/AreaChart-B73gaiVQ.js +0 -1
  438. package/ui/dist/assets/CartesianChart-CXYL2R-A.js +0 -36
  439. package/ui/dist/assets/ChatView-qjZErlrp.js +0 -10
  440. package/ui/dist/assets/CostsDashboard-O4DCLy1i.js +0 -1
  441. package/ui/dist/assets/EstimateSelect-1hQf4Osk.js +0 -1
  442. package/ui/dist/assets/FloatingChatbot-BZBzrJxd.js +0 -2
  443. package/ui/dist/assets/InviteCodeManagement-LEoGqYeA.js +0 -2
  444. package/ui/dist/assets/ProjectIcon-Chd_ofsw.js +0 -1
  445. package/ui/dist/assets/ProjectList-BvUfVB6c.js +0 -4
  446. package/ui/dist/assets/StatusIndicator-pRfkNcdV.js +0 -1
  447. package/ui/dist/assets/SummaryList-B6kXiTxL.js +0 -1
  448. package/ui/dist/assets/TaskDetail-CV6CzbOS.js +0 -1
  449. package/ui/dist/assets/TaskList-DL7brQKd.js +0 -1
  450. package/ui/dist/assets/TicketBoard-CrkkFj7C.js +0 -1
  451. package/ui/dist/assets/TicketDetail-hnnYclpD.js +0 -1
  452. package/ui/dist/assets/TicketList-CsDAyQCL.js +0 -1
  453. package/ui/dist/assets/UserManagement-BGFQyTSr.js +0 -2
  454. package/ui/dist/assets/ViewSwitcher-CnL0OqA8.js +0 -1
  455. package/ui/dist/assets/alert-dialog-SKM6Gjz4.js +0 -7
  456. package/ui/dist/assets/badge-CVHH1a-v.js +0 -1
  457. package/ui/dist/assets/brain-6o_RHVpe.js +0 -1
  458. package/ui/dist/assets/constants-Q5Zivl-a.js +0 -1
  459. package/ui/dist/assets/dialog-BUqN9Psj.js +0 -1
  460. package/ui/dist/assets/index-BUmnwPQr.js +0 -1
  461. package/ui/dist/assets/index-BfF5G4Cw.js +0 -1
  462. package/ui/dist/assets/index-C8N375c2.js +0 -1
  463. package/ui/dist/assets/index-CuxnqVVz.css +0 -1
  464. package/ui/dist/assets/index-CzMM3QOk.js +0 -1
  465. package/ui/dist/assets/index-lJlNPFVJ.js +0 -67
  466. package/ui/dist/assets/layers-jFqVrWMD.js +0 -1
  467. package/ui/dist/assets/markdown-renderer-n1ToC4XQ.js +0 -36
  468. package/ui/dist/assets/popover-CrmZgoWu.js +0 -1
  469. package/ui/dist/assets/progress-uv4SPkL5.js +0 -1
  470. package/ui/dist/assets/select-CeQ8AHGy.js +0 -1
  471. package/ui/dist/assets/server-CVHTZB72.js +0 -1
  472. package/ui/dist/assets/sheet-DuQExSho.js +0 -1
  473. package/ui/dist/assets/skeleton-TFiFJ3nB.js +0 -1
  474. package/ui/dist/assets/switch-CAePkd6k.js +0 -1
  475. package/ui/dist/assets/table-ZjAZ7hkt.js +0 -1
  476. package/ui/dist/assets/textarea-DsVPnSgR.js +0 -1
  477. package/ui/dist/assets/tooltip-BYmQ331W.js +0 -1
@@ -1 +1 @@
1
- import{c as e}from"./index-lJlNPFVJ.js";const a=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]],t=e("file-code",a);export{t as F};
1
+ import{c as e}from"./index-sEBN7w8J.js";const a=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]],t=e("file-code",a);export{t as F};
@@ -1 +1 @@
1
- import{c as a}from"./index-lJlNPFVJ.js";const o=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],c=a("folder-open",o);export{c as F};
1
+ import{c as a}from"./index-sEBN7w8J.js";const o=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],c=a("folder-open",o);export{c as F};
@@ -1 +1 @@
1
- import{c}from"./index-lJlNPFVJ.js";const e=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],o=c("funnel",e);export{o as F};
1
+ import{c}from"./index-sEBN7w8J.js";const e=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],o=c("funnel",e);export{o as F};
@@ -1 +1 @@
1
- import{c}from"./index-lJlNPFVJ.js";const e=[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]],y=c("git-branch",e);export{y as G};
1
+ import{c}from"./index-sEBN7w8J.js";const e=[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]],y=c("git-branch",e);export{y as G};
@@ -1 +1 @@
1
- import{c as o}from"./index-lJlNPFVJ.js";const c=[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]],t=o("git-commit-horizontal",c);export{t as G};
1
+ import{c as o}from"./index-sEBN7w8J.js";const c=[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]],t=o("git-commit-horizontal",c);export{t as G};
@@ -1 +1 @@
1
- import{c}from"./index-lJlNPFVJ.js";const e=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],a=c("globe",e);export{a as G};
1
+ import{c}from"./index-sEBN7w8J.js";const e=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],a=c("globe",e);export{a as G};
@@ -1 +1 @@
1
- import{c as e}from"./index-lJlNPFVJ.js";const y=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],o=e("hash",y);export{o as H};
1
+ import{c as e}from"./index-sEBN7w8J.js";const y=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],o=e("hash",y);export{o as H};
@@ -1 +1 @@
1
- import{c as o}from"./index-lJlNPFVJ.js";const t=[["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"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],a=o("history",t);export{a as H};
1
+ import{c as o}from"./index-sEBN7w8J.js";const t=[["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"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],a=o("history",t);export{a as H};
@@ -0,0 +1 @@
1
+ import{c as o}from"./index-sEBN7w8J.js";const c=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],t=o("circle",c);const e=[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]],i=o("inbox",e);export{t as C,i as I};
@@ -1,7 +1,7 @@
1
- import{u as S,m as T,j as e,i as x,r as j,K as g,O as f,Q as b,b as d,f as c,d as N,Z as z,e as v,$ as E,aj as u,k as w,J as I,t as O}from"./index-lJlNPFVJ.js";import{B as L}from"./badge-CVHH1a-v.js";import{S as U}from"./skeleton-TFiFJ3nB.js";import{S as H}from"./StatusIndicator-pRfkNcdV.js";import{L as B}from"./link-2-DdO7ostF.js";function P(){return S({queryKey:["integrations","status"],queryFn:()=>T.integrations.status(),staleTime:6e4})}function R({children:s,language:t,filename:r,showLineNumbers:a=!1,className:n}){const[l,i]=j.useState(!1),o=async()=>{await navigator.clipboard.writeText(s),i(!0),setTimeout(()=>i(!1),2e3)},k=s.trim().split(`
2
- `);return e.jsxs("div",{className:x("rounded-xl overflow-hidden border border-zinc-800",n),children:[(r||t)&&e.jsxs("div",{className:"bg-zinc-900 px-4 py-2 flex items-center justify-between border-b border-zinc-800",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(g,{className:"h-4 w-4 text-zinc-500"}),e.jsx("span",{className:"text-xs font-medium text-zinc-400",children:r||t})]}),e.jsx(p,{copied:l,onCopy:o})]}),e.jsxs("div",{className:"relative bg-zinc-950 group",children:[!r&&!t&&e.jsx("div",{className:"absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity",children:e.jsx(p,{copied:l,onCopy:o})}),e.jsx("pre",{className:"p-4 overflow-x-auto",children:e.jsx("code",{className:"text-sm font-mono text-zinc-200 leading-relaxed",children:a?k.map((C,h)=>e.jsxs("div",{className:"flex",children:[e.jsx("span",{className:"select-none w-8 text-zinc-600 text-right pr-4",children:h+1}),e.jsx("span",{children:C||" "})]},h)):s.trim()})})]})]})}function F({children:s,className:t}){return e.jsx("code",{className:x("relative rounded bg-zinc-900 px-[0.4rem] py-[0.2rem] font-mono text-sm text-zinc-200",t),children:s})}function p({copied:s,onCopy:t}){return e.jsx("button",{onClick:t,className:x("flex items-center gap-1.5 px-2 py-1 rounded-md text-xs transition-colors",s?"bg-emerald-500/20 text-emerald-400":"bg-zinc-800 text-zinc-400 hover:text-zinc-200 hover:bg-zinc-700"),children:s?e.jsxs(e.Fragment,{children:[e.jsx(f,{className:"h-3 w-3"}),"Copied"]}):e.jsxs(e.Fragment,{children:[e.jsx(b,{className:"h-3 w-3"}),"Copy"]})})}const W={github:E,jira:()=>e.jsx("svg",{viewBox:"0 0 24 24",className:"h-full w-full",fill:"currentColor",children:e.jsx("path",{d:"M11.75 0a11.75 11.75 0 1 0 0 23.5 11.75 11.75 0 0 0 0-23.5zM3.29 12.94l7.63-7.63a.65.65 0 0 1 .94 0l.47.47-6.2 6.2a.65.65 0 0 0 0 .94l.94.94a.65.65 0 0 0 .94 0l6.2-6.2.47.47a.65.65 0 0 1 0 .94l-7.63 7.63a1.29 1.29 0 0 1-1.88 0l-1.88-1.88a1.29 1.29 0 0 1 0-1.88z"})}),linear:()=>e.jsx("svg",{viewBox:"0 0 24 24",className:"h-full w-full",fill:"currentColor",children:e.jsx("path",{d:"M3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12ZM12 1C5.92487 1 1 5.92487 1 12C1 18.0751 5.92487 23 12 23C18.0751 23 23 18.0751 23 12C23 5.92487 18.0751 1 12 1ZM7 12L12 7V10.5H17V13.5H12V17L7 12Z"})})},Z={github:"from-gray-700 to-gray-900",jira:"from-blue-600 to-blue-800",linear:"from-indigo-500 to-indigo-600"};function y({text:s,label:t}){const[r,a]=j.useState(!1),n=()=>{navigator.clipboard.writeText(s),a(!0),O.success(`${t} copied to clipboard`),setTimeout(()=>a(!1),2e3)};return e.jsx(w,{variant:"ghost",size:"icon",className:"h-7 w-7 rounded-lg",onClick:n,children:r?e.jsx(f,{className:"h-3.5 w-3.5 text-green-500"}):e.jsx(b,{className:"h-3.5 w-3.5"})})}function q({name:s,icon:t,description:r,configured:a,webhookUrl:n,oauthUrl:l}){const i=W[t]||u,o=Z[t]||"from-gray-500 to-gray-700";return e.jsxs(d,{className:"glass rounded-[24px] overflow-hidden border-white/5 group hover-lift transition-liquid",children:[e.jsx(N,{className:"pb-3",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:x("h-10 w-10 rounded-xl flex items-center justify-center bg-gradient-to-br shadow-lg",o),children:e.jsx("div",{className:"h-5 w-5 text-white",children:e.jsx(i,{})})}),e.jsxs("div",{children:[e.jsx(v,{className:"text-base font-bold",children:s}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:r})]})]}),e.jsx(H,{status:a?"online":"offline",label:a?"CONFIGURED":"NOT SET",showLabel:!0})]})}),e.jsxs(c,{className:"space-y-3",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("label",{className:"text-[10px] font-bold uppercase tracking-widest text-muted-foreground flex items-center gap-1.5",children:[e.jsx(u,{className:"h-3 w-3"}),"Webhook URL"]}),e.jsxs("div",{className:"flex items-center gap-2 p-2.5 rounded-xl glass-heavy border border-white/5",children:[e.jsx("code",{className:"flex-1 text-[11px] text-muted-foreground truncate font-mono",children:n}),e.jsx(y,{text:n,label:"Webhook URL"})]})]}),e.jsxs("div",{className:"flex items-center justify-between pt-2 border-t border-white/5",children:[e.jsx("span",{className:"text-[10px] font-bold uppercase tracking-widest text-muted-foreground",children:"OAuth Connect"}),e.jsxs(w,{variant:"outline",size:"sm",className:"h-8 rounded-xl text-[11px] font-bold",onClick:()=>window.open(l,"_blank"),disabled:!a,children:[e.jsx(I,{className:"h-3.5 w-3.5 mr-1.5"}),a?"Connect":"Setup Required"]})]})]})]})}function m({name:s,endpoint:t,description:r}){return e.jsxs("div",{className:"flex items-center justify-between p-4 rounded-2xl glass-heavy border border-white/5",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"h-8 w-8 rounded-lg glass flex items-center justify-center",children:e.jsx(g,{className:"h-4 w-4 text-indigo-400"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-bold",children:s}),e.jsx("p",{className:"text-[10px] text-muted-foreground",children:r})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("code",{className:"text-[10px] text-muted-foreground font-mono px-2 py-1 rounded-lg bg-black/20 max-w-[200px] truncate",children:t}),e.jsx(y,{text:t,label:"Endpoint"})]})]})}function _(){const{data:s,isLoading:t,error:r}=P();if(t)return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("header",{children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:"Integrations"}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Loading webhook status..."})]}),e.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:[1,2,3].map(i=>e.jsx(U,{className:"h-48 rounded-[24px] skeleton-glass"},i))})]});if(r)return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("header",{children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:"Integrations"}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Webhook and OAuth configuration"})]}),e.jsx(d,{className:"glass rounded-[28px] border-red-500/10",children:e.jsx(c,{className:"p-8 text-center",children:e.jsx("p",{className:"text-red-400",children:"Failed to load integration status"})})})]});const a=s?.integrations??{},n=s?.hookEndpoints,l=Object.values(a).filter(i=>i.configured).length;return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("header",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:"Integrations"}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Webhook and OAuth configuration for external services."})]}),e.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 rounded-full glass border-white/10",children:[e.jsx(B,{className:"h-4 w-4 text-blue-400"}),e.jsxs("span",{className:"text-[10px] font-bold uppercase tracking-widest",children:[l,"/",Object.keys(a).length," Connected"]})]})]}),e.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:Object.entries(a).map(([i,o])=>e.jsx(q,{name:o.name,icon:o.icon,description:o.description,configured:o.configured,webhookUrl:o.webhookUrl,oauthUrl:o.oauthUrl},i))}),e.jsxs(d,{className:"glass rounded-[28px] border-white/5",children:[e.jsx(N,{children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"h-10 w-10 rounded-xl flex items-center justify-center bg-gradient-to-br from-orange-500 to-red-600 shadow-lg",children:e.jsx(z,{className:"h-5 w-5 text-white"})}),e.jsxs("div",{children:[e.jsx(v,{className:"text-lg font-bold",children:"Claude Code Hooks"}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Zero-token activity tracking endpoints"})]})]})}),e.jsxs(c,{className:"space-y-3",children:[n&&e.jsxs(e.Fragment,{children:[e.jsx(m,{name:"Tool Use Hook",endpoint:n.toolUse,description:"POST after each tool call"}),e.jsx(m,{name:"Session End Hook",endpoint:n.sessionEnd,description:"POST when session completes"}),e.jsx(m,{name:"Prompt Submit Hook",endpoint:n.promptSubmit,description:"POST on user prompt"})]}),e.jsxs("div",{className:"mt-4 p-4 rounded-2xl bg-muted/50 border border-border",children:[e.jsx("p",{className:"text-[11px] font-bold uppercase tracking-widest text-muted-foreground mb-2",children:"Quick Setup"}),e.jsxs("p",{className:"text-[12px] text-muted-foreground mb-3",children:["Add this to your ",e.jsx(F,{children:"~/.claude/settings.json"}),":"]}),e.jsx(R,{filename:"~/.claude/settings.json",language:"json",children:`{
1
+ import{j as e,r as j}from"./vendor-react-Mc5_kfYG.js";import{b as S}from"./vendor-query-C0p7b53x.js";import{k as T,h as x,u as g,x as f,y as b,b as c,f as d,d as N,Z as z,e as v,N as E,ac as u,i as w,E as I,t as O}from"./index-sEBN7w8J.js";import{B as L}from"./badge-BbfnwDJP.js";import{S as U}from"./skeleton-C0E1Nfro.js";import{S as H}from"./StatusIndicator-B8vfFAxg.js";import{L as B}from"./link-2-CC4E28yJ.js";import"./vendor-ui-CXPAUBFv.js";function P(){return S({queryKey:["integrations","status"],queryFn:()=>T.integrations.status(),staleTime:6e4})}function R({children:s,language:t,filename:r,showLineNumbers:a=!1,className:n}){const[l,i]=j.useState(!1),o=async()=>{await navigator.clipboard.writeText(s),i(!0),setTimeout(()=>i(!1),2e3)},k=s.trim().split(`
2
+ `);return e.jsxs("div",{className:x("rounded-xl overflow-hidden border border-zinc-800",n),children:[(r||t)&&e.jsxs("div",{className:"bg-zinc-900 px-4 py-2 flex items-center justify-between border-b border-zinc-800",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(g,{className:"h-4 w-4 text-zinc-500"}),e.jsx("span",{className:"text-xs font-medium text-zinc-400",children:r||t})]}),e.jsx(p,{copied:l,onCopy:o})]}),e.jsxs("div",{className:"relative bg-zinc-950 group",children:[!r&&!t&&e.jsx("div",{className:"absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity",children:e.jsx(p,{copied:l,onCopy:o})}),e.jsx("pre",{className:"p-4 overflow-x-auto",children:e.jsx("code",{className:"text-sm font-mono text-zinc-200 leading-relaxed",children:a?k.map((C,h)=>e.jsxs("div",{className:"flex",children:[e.jsx("span",{className:"select-none w-8 text-zinc-600 text-right pr-4",children:h+1}),e.jsx("span",{children:C||" "})]},h)):s.trim()})})]})]})}function F({children:s,className:t}){return e.jsx("code",{className:x("relative rounded bg-zinc-900 px-[0.4rem] py-[0.2rem] font-mono text-sm text-zinc-200",t),children:s})}function p({copied:s,onCopy:t}){return e.jsx("button",{onClick:t,className:x("flex items-center gap-1.5 px-2 py-1 rounded-md text-xs transition-colors",s?"bg-emerald-500/20 text-emerald-400":"bg-zinc-800 text-zinc-400 hover:text-zinc-200 hover:bg-zinc-700"),children:s?e.jsxs(e.Fragment,{children:[e.jsx(f,{className:"h-3 w-3"}),"Copied"]}):e.jsxs(e.Fragment,{children:[e.jsx(b,{className:"h-3 w-3"}),"Copy"]})})}const W={github:E,jira:()=>e.jsx("svg",{viewBox:"0 0 24 24",className:"h-full w-full",fill:"currentColor",children:e.jsx("path",{d:"M11.75 0a11.75 11.75 0 1 0 0 23.5 11.75 11.75 0 0 0 0-23.5zM3.29 12.94l7.63-7.63a.65.65 0 0 1 .94 0l.47.47-6.2 6.2a.65.65 0 0 0 0 .94l.94.94a.65.65 0 0 0 .94 0l6.2-6.2.47.47a.65.65 0 0 1 0 .94l-7.63 7.63a1.29 1.29 0 0 1-1.88 0l-1.88-1.88a1.29 1.29 0 0 1 0-1.88z"})}),linear:()=>e.jsx("svg",{viewBox:"0 0 24 24",className:"h-full w-full",fill:"currentColor",children:e.jsx("path",{d:"M3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12ZM12 1C5.92487 1 1 5.92487 1 12C1 18.0751 5.92487 23 12 23C18.0751 23 23 18.0751 23 12C23 5.92487 18.0751 1 12 1ZM7 12L12 7V10.5H17V13.5H12V17L7 12Z"})})},Z={github:"from-gray-700 to-gray-900",jira:"from-blue-600 to-blue-800",linear:"from-indigo-500 to-indigo-600"};function y({text:s,label:t}){const[r,a]=j.useState(!1),n=()=>{navigator.clipboard.writeText(s),a(!0),O.success(`${t} copied to clipboard`),setTimeout(()=>a(!1),2e3)};return e.jsx(w,{variant:"ghost",size:"icon",className:"h-7 w-7 rounded-lg",onClick:n,children:r?e.jsx(f,{className:"h-3.5 w-3.5 text-green-500"}):e.jsx(b,{className:"h-3.5 w-3.5"})})}function q({name:s,icon:t,description:r,configured:a,webhookUrl:n,oauthUrl:l}){const i=W[t]||u,o=Z[t]||"from-gray-500 to-gray-700";return e.jsxs(c,{className:"glass rounded-[24px] overflow-hidden border-white/5 group hover-lift transition-liquid",children:[e.jsx(N,{className:"pb-3",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:x("h-10 w-10 rounded-xl flex items-center justify-center bg-gradient-to-br shadow-lg",o),children:e.jsx("div",{className:"h-5 w-5 text-white",children:e.jsx(i,{})})}),e.jsxs("div",{children:[e.jsx(v,{className:"text-base font-bold",children:s}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:r})]})]}),e.jsx(H,{status:a?"online":"offline",label:a?"CONFIGURED":"NOT SET",showLabel:!0})]})}),e.jsxs(d,{className:"space-y-3",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("label",{className:"text-[10px] font-bold uppercase tracking-widest text-muted-foreground flex items-center gap-1.5",children:[e.jsx(u,{className:"h-3 w-3"}),"Webhook URL"]}),e.jsxs("div",{className:"flex items-center gap-2 p-2.5 rounded-xl glass-heavy border border-white/5",children:[e.jsx("code",{className:"flex-1 text-[11px] text-muted-foreground truncate font-mono",children:n}),e.jsx(y,{text:n,label:"Webhook URL"})]})]}),e.jsxs("div",{className:"flex items-center justify-between pt-2 border-t border-white/5",children:[e.jsx("span",{className:"text-[10px] font-bold uppercase tracking-widest text-muted-foreground",children:"OAuth Connect"}),e.jsxs(w,{variant:"outline",size:"sm",className:"h-8 rounded-xl text-[11px] font-bold",onClick:()=>window.open(l,"_blank"),disabled:!a,children:[e.jsx(I,{className:"h-3.5 w-3.5 mr-1.5"}),a?"Connect":"Setup Required"]})]})]})]})}function m({name:s,endpoint:t,description:r}){return e.jsxs("div",{className:"flex items-center justify-between p-4 rounded-2xl glass-heavy border border-white/5",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"h-8 w-8 rounded-lg glass flex items-center justify-center",children:e.jsx(g,{className:"h-4 w-4 text-indigo-400"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-bold",children:s}),e.jsx("p",{className:"text-[10px] text-muted-foreground",children:r})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("code",{className:"text-[10px] text-muted-foreground font-mono px-2 py-1 rounded-lg bg-black/20 max-w-[200px] truncate",children:t}),e.jsx(y,{text:t,label:"Endpoint"})]})]})}function X(){const{data:s,isLoading:t,error:r}=P();if(t)return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("header",{children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:"Integrations"}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Loading webhook status..."})]}),e.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:[1,2,3].map(i=>e.jsx(U,{className:"h-48 rounded-[24px] skeleton-glass"},i))})]});if(r)return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("header",{children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:"Integrations"}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Webhook and OAuth configuration"})]}),e.jsx(c,{className:"glass rounded-[28px] border-red-500/10",children:e.jsx(d,{className:"p-8 text-center",children:e.jsx("p",{className:"text-red-400",children:"Failed to load integration status"})})})]});const a=s?.integrations??{},n=s?.hookEndpoints,l=Object.values(a).filter(i=>i.configured).length;return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("header",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:"Integrations"}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Webhook and OAuth configuration for external services."})]}),e.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 rounded-full glass border-white/10",children:[e.jsx(B,{className:"h-4 w-4 text-blue-400"}),e.jsxs("span",{className:"text-[10px] font-bold uppercase tracking-widest",children:[l,"/",Object.keys(a).length," Connected"]})]})]}),e.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:Object.entries(a).map(([i,o])=>e.jsx(q,{name:o.name,icon:o.icon,description:o.description,configured:o.configured,webhookUrl:o.webhookUrl,oauthUrl:o.oauthUrl},i))}),e.jsxs(c,{className:"glass rounded-[28px] border-white/5",children:[e.jsx(N,{children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"h-10 w-10 rounded-xl flex items-center justify-center bg-gradient-to-br from-orange-500 to-red-600 shadow-lg",children:e.jsx(z,{className:"h-5 w-5 text-white"})}),e.jsxs("div",{children:[e.jsx(v,{className:"text-lg font-bold",children:"Claude Code Hooks"}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Zero-token activity tracking endpoints"})]})]})}),e.jsxs(d,{className:"space-y-3",children:[n&&e.jsxs(e.Fragment,{children:[e.jsx(m,{name:"Tool Use Hook",endpoint:n.toolUse,description:"POST after each tool call"}),e.jsx(m,{name:"Session End Hook",endpoint:n.sessionEnd,description:"POST when session completes"}),e.jsx(m,{name:"Prompt Submit Hook",endpoint:n.promptSubmit,description:"POST on user prompt"})]}),e.jsxs("div",{className:"mt-4 p-4 rounded-2xl bg-muted/50 border border-border",children:[e.jsx("p",{className:"text-[11px] font-bold uppercase tracking-widest text-muted-foreground mb-2",children:"Quick Setup"}),e.jsxs("p",{className:"text-[12px] text-muted-foreground mb-3",children:["Add this to your ",e.jsx(F,{children:"~/.claude/settings.json"}),":"]}),e.jsx(R,{filename:"~/.claude/settings.json",language:"json",children:`{
3
3
  "hooks": {
4
4
  "PostToolUse": "curl -X POST ${n?.toolUse||"http://localhost:3000/api/hook/tool-use"}",
5
5
  "Stop": "curl -X POST ${n?.sessionEnd||"http://localhost:3000/api/hook/session-end"}"
6
6
  }
7
- }`})]})]})]}),e.jsx(d,{className:"glass rounded-[24px] border-white/5",children:e.jsx(c,{className:"p-6",children:e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx("div",{className:"h-10 w-10 rounded-xl glass-heavy flex items-center justify-center flex-shrink-0",children:e.jsx(L,{variant:"secondary",className:"text-[10px] px-2 py-0.5",children:"?"})}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm font-bold",children:"How to configure integrations"}),e.jsxs("ol",{className:"text-[12px] text-muted-foreground space-y-1.5 list-decimal list-inside",children:[e.jsx("li",{children:"Set the required environment variables (CLIENT_ID and CLIENT_SECRET)"}),e.jsx("li",{children:"Copy the webhook URL and add it to your service's webhook settings"}),e.jsx("li",{children:"Use the OAuth connect button to authenticate your account"}),e.jsx("li",{children:"Tasks will automatically be created from issues and tickets"})]})]})]})})})]})}export{_ as WebhookStatus,P as useIntegrationsStatus};
7
+ }`})]})]})]}),e.jsx(c,{className:"glass rounded-[24px] border-white/5",children:e.jsx(d,{className:"p-6",children:e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx("div",{className:"h-10 w-10 rounded-xl glass-heavy flex items-center justify-center flex-shrink-0",children:e.jsx(L,{variant:"secondary",className:"text-[10px] px-2 py-0.5",children:"?"})}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm font-bold",children:"How to configure integrations"}),e.jsxs("ol",{className:"text-[12px] text-muted-foreground space-y-1.5 list-decimal list-inside",children:[e.jsx("li",{children:"Set the required environment variables (CLIENT_ID and CLIENT_SECRET)"}),e.jsx("li",{children:"Copy the webhook URL and add it to your service's webhook settings"}),e.jsx("li",{children:"Use the OAuth connect button to authenticate your account"}),e.jsx("li",{children:"Tasks will automatically be created from issues and tickets"})]})]})]})})})]})}export{X as WebhookStatus,P as useIntegrationsStatus};
@@ -0,0 +1 @@
1
+ import{r as p,j as e}from"./vendor-react-Mc5_kfYG.js";import{b as Q,u as w,c as b}from"./vendor-query-C0p7b53x.js";import{c as A,k as f,b as i,f as c,i as j,s as k,ad as y,h as C,z as L,g as D,Y as z,R as v,t as h}from"./index-sEBN7w8J.js";import{B as q}from"./badge-BbfnwDJP.js";import{S as I}from"./skeleton-C0E1Nfro.js";import{C as B}from"./circle-x-ByXtwR6Y.js";import{C as K}from"./chevron-up-4ymsBJRo.js";import{T as M}from"./trash-2-CucZJL0N.js";import"./vendor-ui-CXPAUBFv.js";const E=[["path",{d:"m12.5 17-.5-1-.5 1h1z",key:"3me087"}],["path",{d:"M15 22a1 1 0 0 0 1-1v-1a2 2 0 0 0 1.56-3.25 8 8 0 1 0-11.12 0A2 2 0 0 0 8 20v1a1 1 0 0 0 1 1z",key:"1o5pge"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}]],_=A("skull",E);function U(){return Q({queryKey:["dlq"],queryFn:()=>f.dlq.list(),refetchInterval:1e4})}function X(){const t=w();return b({mutationFn:n=>f.dlq.retry(n),onSuccess:()=>{t.invalidateQueries({queryKey:["dlq"]}),t.invalidateQueries({queryKey:["tasks"]})}})}function Y(){const t=w();return b({mutationFn:n=>f.dlq.remove(n),onSuccess:()=>{t.invalidateQueries({queryKey:["dlq"]})}})}function G({task:t,onRetry:n,onRemove:u,isRetrying:o,isRemoving:x}){const[l,m]=p.useState(!1);return e.jsx(i,{className:"glass rounded-[20px] overflow-hidden border-red-500/10 group hover-lift transition-liquid",children:e.jsx(c,{className:"p-4",children:e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx("div",{className:"h-8 w-8 rounded-xl bg-red-500/10 flex items-center justify-center flex-shrink-0",children:e.jsx(B,{className:"h-4 w-4 text-red-400"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h3",{className:"font-bold truncate",children:t.title}),e.jsxs("div",{className:"flex items-center gap-3 text-[10px] text-muted-foreground",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(D,{className:"h-3 w-3"}),new Date(t.failedAt).toLocaleString()]}),e.jsxs(q,{variant:"secondary",className:"text-[9px] px-1.5 py-0",children:[t.attempts," ",t.attempts===1?"attempt":"attempts"]})]})]})]}),e.jsx("button",{onClick:()=>m(!l),className:"w-full text-left",children:e.jsxs("div",{className:"flex items-center gap-2 text-[11px] text-muted-foreground",children:[l?e.jsx(K,{className:"h-3 w-3"}):e.jsx(z,{className:"h-3 w-3"}),e.jsx("span",{className:C("transition-all",l?"":"truncate"),children:t.error})]})}),l&&e.jsx("div",{className:"mt-3 p-3 rounded-xl bg-red-500/5 border border-red-500/10",children:e.jsx("pre",{className:"text-[10px] text-red-300 whitespace-pre-wrap font-mono overflow-x-auto",children:t.error})})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[e.jsxs(j,{variant:"outline",size:"sm",className:"h-8 rounded-xl text-[11px] font-bold border-green-500/20 text-green-400 hover:bg-green-500/10",onClick:n,disabled:o,children:[o?e.jsx(v,{className:"h-3.5 w-3.5 mr-1.5 animate-spin"}):e.jsx(k,{className:"h-3.5 w-3.5 mr-1.5"}),"Retry"]}),e.jsxs(j,{variant:"outline",size:"sm",className:"h-8 rounded-xl text-[11px] font-bold border-red-500/20 text-red-400 hover:bg-red-500/10",onClick:u,disabled:x,children:[x?e.jsx(v,{className:"h-3.5 w-3.5 mr-1.5 animate-spin"}):e.jsx(M,{className:"h-3.5 w-3.5 mr-1.5"}),"Remove"]})]})]})})})}function se(){const{data:t,isLoading:n,error:u}=U(),o=X(),x=Y(),[l,m]=p.useState(new Set),[R,g]=p.useState(new Set),N=async s=>{m(a=>new Set(a).add(s));try{await o.mutateAsync(s),h.success("Task queued for retry")}catch{h.error("Failed to retry task")}finally{m(a=>{const d=new Set(a);return d.delete(s),d})}},S=async s=>{g(a=>new Set(a).add(s));try{await x.mutateAsync(s),h.success("Task removed from DLQ")}catch{h.error("Failed to remove task")}finally{g(a=>{const d=new Set(a);return d.delete(s),d})}},T=async()=>{if(t?.tasks)for(const s of t.tasks)await N(s.id)};if(n)return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("header",{children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:"Failed Tasks"}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Loading dead letter queue..."})]}),e.jsx("div",{className:"space-y-4",children:[1,2,3].map(s=>e.jsx(I,{className:"h-24 rounded-[20px] skeleton-glass"},s))})]});if(u)return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("header",{children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:"Failed Tasks"}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Dead Letter Queue"})]}),e.jsx(i,{className:"glass rounded-[28px] border-red-500/10",children:e.jsx(c,{className:"p-8 text-center",children:e.jsx("p",{className:"text-red-400",children:"Failed to load dead letter queue"})})})]});const F=t?.tasks??[],r=t?.count??0;return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("header",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:"Failed Tasks"}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Tasks that failed processing and need attention."})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[r>0&&e.jsxs(j,{variant:"outline",size:"sm",className:"rounded-xl text-[11px] font-bold",onClick:T,children:[e.jsx(k,{className:"h-3.5 w-3.5 mr-1.5"}),"Retry All (",r,")"]}),e.jsx("div",{className:C("flex items-center gap-2 px-4 py-2 rounded-full glass border-white/10",r>0?"border-red-500/20":"border-green-500/20"),children:r>0?e.jsxs(e.Fragment,{children:[e.jsx(_,{className:"h-4 w-4 text-red-400"}),e.jsxs("span",{className:"text-[10px] font-bold uppercase tracking-widest text-red-400",children:[r," Failed"]})]}):e.jsxs(e.Fragment,{children:[e.jsx(y,{className:"h-4 w-4 text-green-400"}),e.jsx("span",{className:"text-[10px] font-bold uppercase tracking-widest text-green-400",children:"All Clear"})]})})]})]}),r>0&&e.jsx(i,{className:"glass rounded-[24px] border-yellow-500/10 overflow-hidden",children:e.jsx(c,{className:"p-4",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"h-12 w-12 rounded-2xl bg-gradient-to-br from-yellow-500 to-orange-600 flex items-center justify-center shadow-lg shadow-yellow-500/20",children:e.jsx(L,{className:"h-6 w-6 text-white"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-bold",children:"Attention Required"}),e.jsxs("p",{className:"text-[11px] text-muted-foreground",children:[r," ",r===1?"task has":"tasks have"," failed and been moved to the dead letter queue. Review the errors and retry or remove them."]})]})]})})}),r===0?e.jsx(i,{className:"glass rounded-[28px] border-white/5",children:e.jsx(c,{className:"p-12",children:e.jsxs("div",{className:"flex flex-col items-center justify-center text-center",children:[e.jsx("div",{className:"h-20 w-20 rounded-full glass-heavy flex items-center justify-center mb-6 border border-green-500/20",children:e.jsx(y,{className:"h-10 w-10 text-green-400"})}),e.jsx("h3",{className:"text-xl font-bold mb-2",children:"No Failed Tasks"}),e.jsx("p",{className:"text-muted-foreground max-w-md",children:"All tasks are processing normally. Failed tasks will appear here if any agent encounters an error during execution."})]})})}):e.jsx("div",{className:"space-y-3",children:F.map(s=>e.jsx(G,{task:s,onRetry:()=>N(s.id),onRemove:()=>S(s.id),isRetrying:l.has(s.id),isRemoving:R.has(s.id)},s.id))}),e.jsx(i,{className:"glass rounded-[24px] border-white/5",children:e.jsx(c,{className:"p-6",children:e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx("div",{className:"h-10 w-10 rounded-xl glass-heavy flex items-center justify-center flex-shrink-0",children:e.jsx(q,{variant:"secondary",className:"text-[10px] px-2 py-0.5",children:"?"})}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm font-bold",children:"About the Dead Letter Queue"}),e.jsxs("ul",{className:"text-[12px] text-muted-foreground space-y-1.5 list-disc list-inside",children:[e.jsx("li",{children:"Tasks are moved here after failing multiple retry attempts"}),e.jsxs("li",{children:[e.jsx("strong",{children:"Retry"})," puts the task back in the main queue for another attempt"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Remove"})," permanently deletes the task from the queue"]}),e.jsx("li",{children:"Check the error message to understand why the task failed"})]})]})]})})})]})}export{se as DLQDashboard,U as useDLQTasks,Y as useRemoveDLQTask,X as useRetryDLQTask};
@@ -0,0 +1 @@
1
+ import{r,j as e}from"./vendor-react-Mc5_kfYG.js";import{b as we,u as Ce,c as z}from"./vendor-query-C0p7b53x.js";import{c as le,u as he,C as Q,g as I,h as i,D as Oe,o as Je,i as A,p as Le,q,Z as xe,ah as os,R as ne,L as G,z as pe,k as J,S as Se,Q as $e,v as gs,aj as bs,P as fs,x as Ps,j as As,l as v,av as qe,ac as Ds,I as C,m as ke,K as Rs,aW as Fs,A as Is,X as Os,aY as ds,b as Js,n as Ls}from"./index-sEBN7w8J.js";import{A as qs,a as zs,b as $s,c as Hs,d as _s,e as Us,f as Ks,g as Qs}from"./alert-dialog-O6qBOv_f.js";import{M as Te}from"./message-square-Bbb241am.js";import{W as X}from"./wrench-CjxjP6ok.js";import{G as Ee}from"./globe-D_WpJdsj.js";import{A as He}from"./archive-CX7UvZpf.js";import{C as re}from"./circle-x-ByXtwR6Y.js";import{E as Gs}from"./ellipsis-vertical-B4tAX_bL.js";import{P as Ws}from"./pencil-CDmiHzoj.js";import{H as Bs}from"./history-CEWMLELs.js";import{P as ue}from"./play-tjy5jMQX.js";import{T as vs}from"./trash-2-CucZJL0N.js";import{T as js}from"./tag-CH_vQliw.js";import{T as ge,C as Re,I as ze,S as Vs}from"./timer-CdGVTb60.js";import{D as _e,b as Ue,c as Ke,d as Qe,a as Ys}from"./dialog-lDg4NvMV.js";import{S as ys}from"./settings-2-CkRNqkxj.js";import{L as Xs}from"./link-2-CC4E28yJ.js";import{W as Zs}from"./wand-sparkles-BaH6pJnc.js";import{G as et}from"./git-branch-CwvUxj7C.js";import{D as st}from"./database-BWXSBg5a.js";import{F as tt}from"./file-code-ChOWdKXf.js";import{C as Me}from"./calendar-buq77TaS.js";import{L as at}from"./lightbulb-CN2q1O5l.js";import{S as rt}from"./send-Cu7MR2Qh.js";import{T as nt}from"./trending-up-C5OYX2k2.js";import{F as lt}from"./funnel-uZkoSPP-.js";import"./vendor-ui-CXPAUBFv.js";const it=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h2",key:"tvwodi"}],["path",{d:"M20 8v11a2 2 0 0 1-2 2h-2",key:"1gkqxj"}],["path",{d:"m9 15 3-3 3 3",key:"1pd0qc"}],["path",{d:"M12 12v9",key:"192myk"}]],ot=le("archive-restore",it);const dt=[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]],ct=le("hard-drive",dt);const mt=[["path",{d:"M11 6a13 13 0 0 0 8.4-2.8A1 1 0 0 1 21 4v12a1 1 0 0 1-1.6.8A13 13 0 0 0 11 14H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2z",key:"q8bfy3"}],["path",{d:"M6 14a12 12 0 0 0 2.4 7.2 2 2 0 0 0 3.2-2.4A8 8 0 0 1 10 14",key:"1853fq"}],["path",{d:"M8 6v8",key:"15ugcq"}]],xt=le("megaphone",mt);const ut=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],be=le("pause",ut);const ht=[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}]],cs=le("refresh-ccw",ht);const pt=[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]],gt=le("sliders-horizontal",pt),bt={http:Ee,tool:X,script:he,message:Te},ft={active:{color:"text-green-500",bg:"bg-green-500/10",icon:Q,label:"Active"},paused:{color:"text-amber-500",bg:"bg-amber-500/10",icon:be,label:"Paused"},completed:{color:"text-blue-500",bg:"bg-blue-500/10",icon:Q,label:"Completed"},failed:{color:"text-red-500",bg:"bg-red-500/10",icon:re,label:"Failed"},archived:{color:"text-muted-foreground",bg:"bg-muted/50",icon:He,label:"Archived"}},vt={color:"text-muted-foreground",bg:"bg-muted/50",icon:I,label:"Unknown"};function jt(t){if(!t)return"Not scheduled";const c=new Date(t),o=new Date,l=c.getTime()-o.getTime();return l<0?"Overdue":l<6e4?"In less than a minute":l<36e5?`In ${Math.round(l/6e4)} min`:l<864e5?`In ${Math.round(l/36e5)} hours`:c.toLocaleDateString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function yt(t){if(!t)return"Never";const c=new Date(t),l=new Date().getTime()-c.getTime();return l<6e4?"Just now":l<36e5?`${Math.round(l/6e4)} min ago`:l<864e5?`${Math.round(l/36e5)} hours ago`:c.toLocaleDateString(void 0,{month:"short",day:"numeric"})}function Nt({job:t,onTrigger:c,onPause:o,onResume:l,onDelete:j,onViewHistory:u,onEdit:b,onArchive:m,onRestore:p}){const[x,d]=r.useState(!1),h=bt[t.jobType]||X,g=ft[t.status]||vt,R=g.icon,w=t.status==="archived",L=async()=>{d(!0);try{await c(t.id)}finally{d(!1)}},k=t.runCount>0?Math.round(t.successCount/t.runCount*100):0;return e.jsxs("div",{className:"group relative rounded-2xl border border-border/50 bg-card/50 backdrop-blur-sm p-4 hover:border-border hover:shadow-lg transition-all duration-200",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3 mb-3",children:[e.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[e.jsx("div",{className:i("h-10 w-10 rounded-xl flex items-center justify-center shrink-0",g.bg),children:e.jsx(h,{className:i("h-5 w-5",g.color)})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h3",{className:"font-semibold text-sm truncate",children:t.name}),t.description&&e.jsx("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:t.description})]})]}),e.jsxs(Oe,{children:[e.jsx(Je,{asChild:!0,children:e.jsx(A,{variant:"ghost",size:"icon",className:"h-8 w-8 shrink-0 opacity-0 group-hover:opacity-100",children:e.jsx(Gs,{className:"h-4 w-4"})})}),e.jsxs(Le,{align:"end",className:"w-48",children:[!w&&e.jsxs(e.Fragment,{children:[e.jsxs(q,{onClick:L,disabled:x,children:[e.jsx(xe,{className:"h-4 w-4 mr-2"}),"Run Now"]}),b&&e.jsxs(q,{onClick:()=>b(t),children:[e.jsx(Ws,{className:"h-4 w-4 mr-2"}),"Edit Job"]})]}),e.jsxs(q,{onClick:()=>u(t.id),children:[e.jsx(Bs,{className:"h-4 w-4 mr-2"}),"View History"]}),e.jsx(os,{}),!w&&t.status==="active"&&e.jsxs(q,{onClick:()=>o(t.id),children:[e.jsx(be,{className:"h-4 w-4 mr-2"}),"Pause Job"]}),!w&&t.status==="paused"&&e.jsxs(q,{onClick:()=>l(t.id),children:[e.jsx(ue,{className:"h-4 w-4 mr-2"}),"Resume Job"]}),w&&p&&e.jsxs(q,{onClick:()=>p(t.id),children:[e.jsx(ot,{className:"h-4 w-4 mr-2"}),"Restore Job"]}),e.jsx(os,{}),!w&&m&&e.jsxs(q,{onClick:()=>m(t.id),className:"text-amber-500 focus:text-amber-500",children:[e.jsx(He,{className:"h-4 w-4 mr-2"}),"Archive Job"]}),e.jsxs(q,{onClick:()=>j(t.id),className:"text-red-500 focus:text-red-500",children:[e.jsx(vs,{className:"h-4 w-4 mr-2"}),"Delete Permanently"]})]})]})]}),e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsxs("span",{className:i("inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[10px] font-semibold",g.bg,g.color),children:[e.jsx(R,{className:"h-3 w-3"}),g.label]}),e.jsx("span",{className:"text-[10px] text-muted-foreground font-mono",children:t.cronExpression||`Every ${Math.round((t.intervalMs||0)/1e3)}s`})]}),t.labels&&t.labels.length>0&&e.jsxs("div",{className:"flex flex-wrap gap-1 mb-3",children:[t.labels.slice(0,3).map(F=>e.jsxs("span",{className:"inline-flex items-center gap-0.5 px-1.5 py-0.5 rounded bg-primary/10 text-primary text-[9px]",children:[e.jsx(js,{className:"h-2.5 w-2.5"}),F]},F)),t.labels.length>3&&e.jsxs("span",{className:"text-[9px] text-muted-foreground",children:["+",t.labels.length-3]})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-3 mb-3",children:[e.jsxs("div",{className:"text-center p-2 rounded-lg bg-muted/50",children:[e.jsx("div",{className:"text-lg font-bold",children:t.runCount}),e.jsx("div",{className:"text-[10px] text-muted-foreground",children:"Total Runs"})]}),e.jsxs("div",{className:"text-center p-2 rounded-lg bg-muted/50",children:[e.jsxs("div",{className:i("text-lg font-bold",k>=80?"text-green-500":k>=50?"text-amber-500":"text-red-500"),children:[k,"%"]}),e.jsx("div",{className:"text-[10px] text-muted-foreground",children:"Success"})]}),e.jsxs("div",{className:"text-center p-2 rounded-lg bg-muted/50",children:[e.jsx("div",{className:"text-lg font-bold text-red-500",children:t.failureCount}),e.jsx("div",{className:"text-[10px] text-muted-foreground",children:"Failures"})]})]}),e.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground border-t border-border/50 pt-3",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(I,{className:"h-3.5 w-3.5"}),e.jsxs("span",{children:["Last: ",yt(t.lastRunAt)]}),t.lastRunStatus&&e.jsx("span",{className:i("h-1.5 w-1.5 rounded-full",t.lastRunStatus==="success"?"bg-green-500":"bg-red-500")})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(ge,{className:"h-3.5 w-3.5"}),e.jsx("span",{children:jt(t.nextRunAt)})]})]}),e.jsx(A,{variant:"outline",size:"sm",className:"w-full mt-3 h-8 text-xs",onClick:L,disabled:x||t.status==="completed",children:x?e.jsxs(e.Fragment,{children:[e.jsx(ne,{className:"h-3.5 w-3.5 mr-1.5 animate-spin"}),"Running..."]}):e.jsxs(e.Fragment,{children:[e.jsx(xe,{className:"h-3.5 w-3.5 mr-1.5"}),"Run Now"]})})]})}const wt={pending:{color:"text-amber-500",bg:"bg-amber-500/10",icon:I,label:"Pending"},running:{color:"text-blue-500",bg:"bg-blue-500/10",icon:G,label:"Running"},success:{color:"text-green-500",bg:"bg-green-500/10",icon:Q,label:"Success"},failure:{color:"text-red-500",bg:"bg-red-500/10",icon:re,label:"Failed"},error:{color:"text-red-500",bg:"bg-red-500/10",icon:re,label:"Error"},timeout:{color:"text-orange-500",bg:"bg-orange-500/10",icon:pe,label:"Timeout"},cancelled:{color:"text-muted-foreground",bg:"bg-muted/50",icon:re,label:"Cancelled"}},kt={color:"text-muted-foreground",bg:"bg-muted/50",icon:pe,label:"Unknown"};function Ct(t){return t?t<1e3?`${t}ms`:t<6e4?`${(t/1e3).toFixed(1)}s`:`${Math.round(t/6e4)}m ${Math.round(t%6e4/1e3)}s`:"-"}function St(t){return new Date(t).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"})}function Tt({jobId:t,jobName:c,open:o,onOpenChange:l}){const{data:j,isLoading:u,error:b,refetch:m}=we({queryKey:["cron-history",t],queryFn:()=>J.cron.history(t,50),enabled:!!t&&o,refetchInterval:5e3}),p=j?.history||[],x=j?.job;return e.jsx(_e,{open:o,onOpenChange:l,children:e.jsxs(Ue,{className:"max-w-2xl max-h-[80vh] flex flex-col",children:[e.jsx(Ke,{className:"flex-shrink-0",children:e.jsxs(Qe,{className:"flex items-center gap-2",children:[e.jsx(he,{className:"h-5 w-5 text-primary"}),"Job History: ",c||t?.slice(0,8)]})}),x&&e.jsxs("div",{className:"flex items-center gap-4 p-3 rounded-xl bg-muted/50 border border-border/50 mb-4",children:[e.jsxs("div",{className:"flex-1 text-center",children:[e.jsx("div",{className:"text-2xl font-bold",children:x.runCount}),e.jsx("div",{className:"text-[10px] text-muted-foreground",children:"Total Runs"})]}),e.jsx("div",{className:"h-8 w-px bg-border"}),e.jsxs("div",{className:"flex-1 text-center",children:[e.jsx("div",{className:"text-2xl font-bold text-green-500",children:x.successCount}),e.jsx("div",{className:"text-[10px] text-muted-foreground",children:"Successes"})]}),e.jsx("div",{className:"h-8 w-px bg-border"}),e.jsxs("div",{className:"flex-1 text-center",children:[e.jsx("div",{className:"text-2xl font-bold text-red-500",children:x.failureCount}),e.jsx("div",{className:"text-[10px] text-muted-foreground",children:"Failures"})]}),e.jsx("div",{className:"h-8 w-px bg-border"}),e.jsxs("div",{className:"flex-1 text-center",children:[e.jsxs("div",{className:"text-2xl font-bold",children:[x.runCount>0?Math.round(x.successCount/x.runCount*100):0,"%"]}),e.jsx("div",{className:"text-[10px] text-muted-foreground",children:"Success Rate"})]})]}),e.jsx("div",{className:"flex-1 overflow-y-auto -mx-6 px-6",children:u?e.jsxs("div",{className:"flex flex-col items-center justify-center py-12",children:[e.jsx(G,{className:"h-8 w-8 animate-spin text-primary mb-3"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading history..."})]}):b?e.jsxs("div",{className:"flex flex-col items-center justify-center py-12",children:[e.jsx(pe,{className:"h-8 w-8 text-red-500 mb-3"}),e.jsx("p",{className:"text-sm text-red-500",children:"Failed to load history"}),e.jsxs(A,{variant:"outline",size:"sm",onClick:()=>m(),className:"mt-3",children:[e.jsx(ne,{className:"h-4 w-4 mr-2"}),"Retry"]})]}):p.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center py-12",children:[e.jsx(I,{className:"h-8 w-8 text-muted-foreground mb-3"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"No runs yet"}),e.jsx("p",{className:"text-xs text-muted-foreground/70 mt-1",children:"History will appear here after the first execution"})]}):e.jsx("div",{className:"space-y-2",children:p.map((d,h)=>{const g=wt[d.status]||kt,R=g.icon,w=d.status==="running";return e.jsxs("div",{className:i("rounded-xl border p-3 transition-colors",h===0?"border-primary/30 bg-primary/5":"border-border/50 bg-card/50"),children:[e.jsxs("div",{className:"flex items-start justify-between gap-3 mb-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:i("inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[10px] font-semibold",g.bg,g.color),children:[e.jsx(R,{className:i("h-3 w-3",w&&"animate-spin")}),g.label]}),h===0&&e.jsx("span",{className:"px-1.5 py-0.5 rounded text-[9px] font-medium bg-primary/10 text-primary",children:"Latest"})]}),e.jsxs("div",{className:"flex items-center gap-3 text-xs text-muted-foreground",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(ge,{className:"h-3.5 w-3.5"}),Ct(d.durationMs)]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(I,{className:"h-3.5 w-3.5"}),St(d.startedAt)]})]})]}),(d.output||d.error)&&e.jsx("div",{className:i("mt-2 p-2 rounded-lg text-xs font-mono overflow-x-auto",d.error?"bg-red-500/10 text-red-400":"bg-muted/50 text-muted-foreground"),children:e.jsx("pre",{className:"whitespace-pre-wrap break-words max-h-32 overflow-y-auto",children:d.error||d.output})})]},d.id)})})}),e.jsxs("div",{className:"flex items-center justify-between pt-4 border-t border-border/50 mt-4",children:[e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Showing ",p.length," runs"]}),e.jsxs(A,{variant:"outline",size:"sm",onClick:()=>m(),children:[e.jsx(ne,{className:"h-3.5 w-3.5 mr-1.5"}),"Refresh"]})]})]})})}const Y=[{id:"type",label:"Type",icon:Se,description:"What kind of job?"},{id:"schedule",label:"Schedule",icon:I,description:"When to run?"},{id:"config",label:"Configure",icon:ys,description:"Job details"},{id:"review",label:"Review",icon:$e,description:"Confirm & create"}],ms=[{id:"health-check",name:"Health Check",category:"monitoring",icon:gs,description:"Monitor service health with HTTP pings",jobType:"http",suggestedCron:"*/5 * * * *",payload:{url:"https://your-api.com/health",method:"GET"},guide:"Regularly checks if your service is responding. Great for uptime monitoring."},{id:"db-backup",name:"Database Backup",category:"maintenance",icon:ct,description:"Schedule automated database backups",jobType:"script",suggestedCron:"0 2 * * *",payload:{command:"pg_dump",args:["-h","localhost","mydb"]},guide:"Runs daily at 2 AM. Adjust the command for your database type.",warning:"Ensure backup storage has sufficient space."},{id:"git-sync",name:"Git Repository Sync",category:"development",icon:ne,description:"Pull latest changes from remote",jobType:"tool",suggestedCron:"*/30 * * * *",payload:{tool:"git_pull",params:{branch:"main"}},guide:"Keeps local repositories in sync with remote."},{id:"slack-standup",name:"Daily Standup Reminder",category:"notifications",icon:xt,description:"Send daily standup reminders to Slack",jobType:"message",suggestedCron:"0 9 * * 1-5",payload:{channel:"#team",message:"Good morning! Time for standup!"},guide:"Sends at 9 AM on weekdays. Change channel and message as needed."},{id:"api-sync",name:"External API Sync",category:"integration",icon:Xs,description:"Sync data from external APIs",jobType:"http",suggestedCron:"0 */4 * * *",payload:{url:"https://api.example.com/sync",method:"POST",headers:{"Content-Type":"application/json"}},guide:"Runs every 4 hours. Add authentication headers if required."},{id:"cleanup",name:"Cleanup Old Files",category:"maintenance",icon:vs,description:"Remove temporary and old files",jobType:"script",suggestedCron:"0 3 * * 0",payload:{command:"find",args:["/tmp","-mtime","+7","-delete"]},guide:"Runs weekly on Sunday at 3 AM.",warning:"Double-check paths before enabling to avoid data loss."},{id:"report-gen",name:"Generate Reports",category:"analytics",icon:bs,description:"Generate and send automated reports",jobType:"tool",suggestedCron:"0 8 * * 1",payload:{tool:"generate_report",params:{type:"weekly",format:"pdf"}},guide:"Generates weekly reports every Monday at 8 AM."},{id:"webhook-trigger",name:"Webhook Trigger",category:"integration",icon:xe,description:"Trigger external webhooks on schedule",jobType:"http",suggestedCron:"0 */6 * * *",payload:{url:"https://hooks.example.com/trigger",method:"POST",body:{event:"scheduled"}},guide:"Triggers every 6 hours. Customize the webhook URL and payload."}],Et=[{id:"all",label:"All",icon:Se},{id:"monitoring",label:"Monitoring",icon:$e},{id:"maintenance",label:"Maintenance",icon:X},{id:"development",label:"Development",icon:et},{id:"notifications",label:"Notifications",icon:qe},{id:"integration",label:"Integration",icon:Ds},{id:"analytics",label:"Analytics",icon:st}],ae=[{type:"http",label:"HTTP Request",icon:Ee,description:"Call an API endpoint",color:"from-blue-500/20 to-cyan-500/20",examples:["Sync data from API","Health checks","Webhook triggers"],defaultPayload:{url:"https://api.example.com/endpoint",method:"POST",headers:{}},guide:"Make HTTP requests to external services. Supports GET, POST, PUT, DELETE methods."},{type:"tool",label:"Tool Execution",icon:X,description:"Run a profClaw tool",color:"from-indigo-500/20 to-pink-500/20",examples:["Git operations","File sync","Database backups"],defaultPayload:{tool:"git_status",params:{}},guide:"Execute any registered profClaw tool with custom parameters."},{type:"script",label:"Shell Script",icon:he,description:"Execute a command",color:"from-green-500/20 to-emerald-500/20",examples:["Build scripts","Cleanup tasks","System checks"],defaultPayload:{command:'echo "Hello World"',args:[]},guide:"Run shell commands on the server. Use with caution.",warning:"Scripts run with server permissions. Avoid sensitive operations."},{type:"message",label:"Notification",icon:Te,description:"Send a message",color:"from-orange-500/20 to-amber-500/20",examples:["Daily standup reminder","Status reports","Alerts"],defaultPayload:{channel:"#general",message:"Scheduled notification"},guide:"Send messages to Slack channels, email, or webhooks."}],Mt=[{type:"cron",label:"Cron",icon:I,description:"Classic cron syntax"},{type:"interval",label:"Interval",icon:ge,description:"Every X seconds"},{type:"oneshot",label:"One-Time",icon:Me,description:"Run once"},{type:"event",label:"Event",icon:xe,description:"On trigger"}],Ns=[{label:"Every minute",value:"* * * * *",humanize:"Runs every minute"},{label:"Every 5 min",value:"*/5 * * * *",humanize:"Runs every 5 minutes"},{label:"Every 15 min",value:"*/15 * * * *",humanize:"Runs every 15 minutes"},{label:"Hourly",value:"0 * * * *",humanize:"Runs at the start of every hour"},{label:"Daily midnight",value:"0 0 * * *",humanize:"Runs daily at midnight"},{label:"Weekdays 9am",value:"0 9 * * 1-5",humanize:"Runs at 9am on weekdays"}],Fe=[{label:"30 sec",value:30,humanize:"Every 30 seconds"},{label:"1 min",value:60,humanize:"Every minute"},{label:"5 min",value:300,humanize:"Every 5 minutes"},{label:"15 min",value:900,humanize:"Every 15 minutes"},{label:"30 min",value:1800,humanize:"Every 30 minutes"},{label:"1 hour",value:3600,humanize:"Every hour"}],Pt=[{type:"webhook",label:"Webhook",description:"HTTP webhook endpoint"},{type:"ticket",label:"Ticket",description:"Ticket changes"},{type:"github",label:"GitHub",description:"Push, PR, issues"},{type:"file",label:"File",description:"File changes"}];function H({children:t,type:c="info"}){const o={info:"bg-blue-500/10 border-blue-500/20 text-blue-700 dark:text-blue-300",warning:"bg-amber-500/10 border-amber-500/20 text-amber-700 dark:text-amber-300",tip:"bg-green-500/10 border-green-500/20 text-green-700 dark:text-green-300"},j={info:ze,warning:pe,tip:at}[c];return e.jsxs("div",{className:i("flex items-start gap-2 p-3 rounded-lg border text-xs",o[c]),children:[e.jsx(j,{className:"h-4 w-4 shrink-0 mt-0.5"}),e.jsx("div",{children:t})]})}function Ie({children:t,content:c}){return e.jsxs("span",{className:"relative group",children:[t,e.jsx("span",{className:"absolute bottom-full left-1/2 -translate-x-1/2 mb-2 px-2 py-1 rounded bg-popover border text-xs whitespace-nowrap opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none z-50",children:c})]})}function xs(t){const c=Ns.find(p=>p.value===t);if(c)return c.humanize;const o=t.split(" ");if(o.length!==5)return`Cron: ${t}`;const[l,j,u,b,m]=o;return l.startsWith("*/")&&j==="*"&&u==="*"&&b==="*"&&m==="*"?`Every ${l.slice(2)} minutes`:l==="0"&&j.startsWith("*/")&&u==="*"&&b==="*"&&m==="*"?`Every ${j.slice(2)} hours`:l==="0"&&j==="0"&&u==="*"&&b==="*"&&m==="*"?"Daily at midnight":`Cron: ${t}`}function At(t){try{return{valid:!0,parsed:JSON.parse(t)}}catch{return{valid:!1,error:"Invalid JSON syntax"}}}function us({open:t,onOpenChange:c}){const o=Ce(),[l,j]=r.useState(!1),u=t??l,b=c??j,[m,p]=r.useState("simple"),[x,d]=r.useState("type"),h=Y.findIndex(s=>s.id===x),[g,R]=r.useState("all"),[w,L]=r.useState(""),[k,F]=r.useState(""),[f,_]=r.useState(null),[y,E]=r.useState(null),[M,$]=r.useState("*/5 * * * *"),[D,U]=r.useState(300),[T,n]=r.useState(""),[P,fe]=r.useState(""),[K,ve]=r.useState("webhook"),[je,ye]=r.useState("{}"),[W,Z]=r.useState("{}"),[O,ee]=r.useState(null),[a,se]=r.useState("UTC"),[ie,Ge]=r.useState(!0),[Pe,We]=r.useState(3),[Ae,Be]=r.useState("exponential"),[oe,Ve]=r.useState(!1),[B,Ye]=r.useState(""),[Xe,Ze]=r.useState(!1),[es,ss]=r.useState(!0),[ts,as]=r.useState(!1),[de,rs]=r.useState(null),[De,ns]=r.useState(null),ce=r.useMemo(()=>At(W),[W]),{data:ws}=we({queryKey:["cron-templates"],queryFn:()=>J.cron.listTemplates?.()||Promise.resolve({templates:[]}),enabled:u}),ls=ws?.templates||[],ks=r.useMemo(()=>g==="all"?ms:ms.filter(s=>s.category===g),[g]);r.useEffect(()=>{if(f&&!O){const s=ae.find(N=>N.type===f);s&&Z(JSON.stringify(s.defaultPayload,null,2))}},[f,O]);const is=s=>{if(O?.id===s.id){ee(null);return}ee(s),L(s.name),F(s.description??""),_(s.jobType),Z(JSON.stringify(s.payload,null,2)),s.suggestedCron&&(E("cron"),$(s.suggestedCron))},te=z({mutationFn:()=>{const s=JSON.parse(W);let N;y==="oneshot"&&T&&P&&(N=new Date(`${T}T${P}`).toISOString());let S;if(y==="event")try{S={type:K,config:JSON.parse(je)}}catch{S={type:K,config:{}}}let V;return m==="advanced"&&oe&&B&&(V={channels:[{type:B.includes("@")?"email":B.startsWith("http")?"webhook":"slack",target:B,onSuccess:Xe,onFailure:es}]}),J.cron.create({name:w,description:k||void 0,jobType:f,cronExpression:y==="cron"?M:void 0,intervalMs:y==="interval"?D*1e3:void 0,runAt:N,eventTrigger:S,payload:s,timezone:m==="advanced"?a:"UTC",deleteOnComplete:y==="oneshot"?ts:void 0,retryPolicy:m==="advanced"?{enabled:ie,maxRetries:Pe,backoff:Ae}:void 0,delivery:V,maxRuns:m==="advanced"&&de||void 0,maxFailures:m==="advanced"&&De||void 0})},onSuccess:()=>{o.invalidateQueries({queryKey:["cron-jobs"]}),o.invalidateQueries({queryKey:["cron-stats"]}),b(!1),Cs()}}),Cs=()=>{d("type"),p("simple"),R("all"),L(""),F(""),_(null),E(null),$("*/5 * * * *"),U(300),n(""),fe(""),ve("webhook"),ye("{}"),Z("{}"),ee(null),se("UTC"),Ge(!0),We(3),Be("exponential"),Ve(!1),Ye(""),Ze(!1),ss(!0),as(!1),rs(null),ns(null)},Ss=r.useMemo(()=>{switch(x){case"type":return f!==null;case"schedule":return y?y==="oneshot"?T&&P:!0:!1;case"config":return w.trim().length>0&&ce.valid;case"review":return!0;default:return!1}},[x,f,y,T,P,w,ce]),Ts=()=>{h<Y.length-1&&d(Y[h+1].id)},Es=()=>{h>0&&d(Y[h-1].id)},Ms=r.useMemo(()=>{switch(y){case"cron":return xs(M);case"interval":return Fe.find(s=>s.value===D)?.humanize||`Every ${D} seconds`;case"oneshot":return T&&P?`Once at ${new Date(`${T}T${P}`).toLocaleString()}`:"One-time (not scheduled)";case"event":return`On ${K} event`;default:return"Not configured"}},[y,M,D,T,P,K]),Ne=ae.find(s=>s.type===f);return e.jsxs(_e,{open:u,onOpenChange:b,children:[e.jsx(Ys,{asChild:!0,children:e.jsxs(A,{className:"gap-2 shadow-lg shadow-primary/20 hover:shadow-primary/30 transition-shadow",children:[e.jsx(fs,{className:"h-4 w-4"}),"Create Job"]})}),e.jsxs(Ue,{className:"max-w-4xl w-[90vw] max-h-[85vh] my-8 flex flex-col p-0 overflow-hidden shadow-2xl border-border/40 [&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none]",children:[e.jsxs("div",{className:"border-b border-border/30 bg-gradient-to-r from-primary/8 via-primary/4 to-transparent",children:[e.jsx(Ke,{className:"px-6 pt-5 pb-3",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(Qe,{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-2 rounded-xl bg-primary/10",children:e.jsx(I,{className:"h-5 w-5 text-primary"})}),e.jsxs("div",{children:[e.jsx("span",{className:"block",children:"Create Scheduled Job"}),e.jsx("span",{className:"text-xs font-normal text-muted-foreground",children:Y[h].description})]})]}),e.jsxs("div",{className:"flex items-center gap-1 p-1 rounded-lg bg-muted",children:[e.jsxs("button",{onClick:()=>p("simple"),className:i("flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs font-medium transition-all",m==="simple"?"bg-background shadow-sm text-foreground":"text-muted-foreground hover:text-foreground"),children:[e.jsx(Zs,{className:"h-3 w-3"}),"Simple"]}),e.jsxs("button",{onClick:()=>p("advanced"),className:i("flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs font-medium transition-all",m==="advanced"?"bg-background shadow-sm text-foreground":"text-muted-foreground hover:text-foreground"),children:[e.jsx(gt,{className:"h-3 w-3"}),"Advanced"]})]})]})}),e.jsx("div",{className:"px-6 pb-4",children:e.jsx("div",{className:"flex items-center gap-2",children:Y.map((s,N)=>{const S=s.icon,V=s.id===x,me=N<h;return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("button",{onClick:()=>N<=h&&d(s.id),disabled:N>h,className:i("flex items-center gap-2 px-3 py-1.5 rounded-full text-xs font-medium transition-all",V&&"bg-primary text-primary-foreground shadow-md shadow-primary/30",me&&"bg-primary/20 text-primary hover:bg-primary/30",!V&&!me&&"bg-accent text-muted-foreground border border-border/30",N>h&&"opacity-50 cursor-not-allowed"),children:[me?e.jsx(Ps,{className:"h-3 w-3"}):e.jsx(S,{className:"h-3 w-3"}),e.jsx("span",{className:"hidden sm:inline",children:s.label})]}),N<Y.length-1&&e.jsx(As,{className:i("h-4 w-4",N<h?"text-primary":"text-muted-foreground/50")})]},s.id)})})})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-6 [&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none]",children:[x==="type"&&e.jsxs("div",{className:"space-y-6 animate-in fade-in slide-in-from-right-4 duration-300",children:[m==="simple"&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx(v,{className:"text-xs uppercase tracking-wider text-muted-foreground",children:"Quick Start Templates"}),e.jsx(Ie,{content:"Pre-configured jobs for common tasks",children:e.jsx(Re,{className:"h-3.5 w-3.5 text-muted-foreground cursor-help"})})]}),e.jsx("div",{className:"flex flex-wrap gap-1.5 mb-4",children:Et.map(s=>{const N=s.icon,S=g===s.id;return e.jsxs("button",{onClick:()=>R(s.id),className:i("flex items-center gap-1.5 px-2.5 py-1 rounded-full text-[10px] font-medium transition-all",S?"bg-foreground text-background shadow-sm":"bg-accent text-muted-foreground hover:bg-accent/80 border border-border/30"),children:[e.jsx(N,{className:"h-3 w-3"}),s.label]},s.id)})}),e.jsx("div",{className:"grid grid-cols-2 gap-2",children:ks.map(s=>{const N=s.icon;return e.jsxs("button",{onClick:()=>is(s),className:i("flex items-start gap-3 p-3 rounded-xl text-left transition-all hover:scale-[1.01] border",O?.id===s.id?"bg-primary/10 ring-2 ring-primary/30 border-primary/20 shadow-sm":"bg-card hover:bg-accent/50 border-border/50 hover:border-border hover:shadow-sm"),children:[e.jsx("div",{className:i("p-1.5 rounded-lg shrink-0",O?.id===s.id?"bg-primary/20 text-primary shadow-sm":"bg-accent text-muted-foreground"),children:e.jsx(N,{className:"h-4 w-4"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"font-medium text-sm truncate",children:s.name}),e.jsx("div",{className:"text-[10px] text-muted-foreground line-clamp-2",children:s.description})]})]},s.id)})}),ls.length>0&&e.jsxs("div",{className:"mt-4 pt-4 border-t",children:[e.jsx(v,{className:"text-xs text-muted-foreground",children:"Your Templates"}),e.jsx("div",{className:"flex flex-wrap gap-2 mt-2",children:ls.slice(0,4).map(s=>e.jsxs("button",{onClick:()=>is({id:s.id,name:s.name,category:s.category,description:s.description,jobType:s.jobType,payload:s.payloadTemplate,suggestedCron:s.suggestedCron}),className:"flex items-center gap-2 px-3 py-1.5 rounded-lg bg-card hover:bg-accent/50 border border-border/40 text-xs hover:shadow-sm",children:[e.jsx(tt,{className:"h-3 w-3 text-primary"}),s.name]},s.id))})]}),e.jsx("div",{className:"mt-4",children:e.jsx(H,{type:"tip",children:"Select a template to get started quickly, or choose a job type below for custom configuration."})})]}),e.jsxs("div",{children:[e.jsx("div",{className:"flex items-center justify-between mb-3",children:e.jsx(v,{className:"text-xs uppercase tracking-wider text-muted-foreground",children:m==="simple"?"Or Choose Job Type":"Job Type"})}),e.jsx("div",{className:"grid grid-cols-2 gap-3",children:ae.map(s=>{const N=s.icon,S=f===s.type;return e.jsxs("button",{onClick:()=>{_(s.type),ee(null)},className:i("relative overflow-hidden group p-4 rounded-2xl text-left transition-all duration-200 border",S?"bg-primary/10 ring-2 ring-primary/30 scale-[1.02] border-primary/20 shadow-md":"bg-card hover:bg-accent/50 hover:scale-[1.01] border-border/50 hover:border-border hover:shadow-sm"),children:[e.jsx("div",{className:i("absolute inset-0 bg-linear-to-br opacity-0 transition-opacity",s.color,S&&"opacity-100","group-hover:opacity-50")}),e.jsxs("div",{className:"relative",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx("div",{className:i("p-2 rounded-lg transition-colors shadow-sm",S?"bg-primary text-primary-foreground":"bg-accent border border-border/30"),children:e.jsx(N,{className:"h-5 w-5"})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("div",{className:i("font-semibold",S&&"text-primary"),children:s.label}),e.jsx("div",{className:"text-xs text-muted-foreground",children:s.description})]}),S&&e.jsx(Q,{className:"h-5 w-5 text-primary"})]}),m==="advanced"&&e.jsx("div",{className:"flex flex-wrap gap-1 mt-3",children:s.examples.map((V,me)=>e.jsx("span",{className:"px-2 py-0.5 rounded-full bg-accent text-[10px] text-muted-foreground border border-border/20",children:V},me))})]})]},s.type)})}),Ne&&e.jsxs("div",{className:"mt-4 space-y-2",children:[e.jsx(H,{type:"info",children:Ne.guide}),Ne.warning&&e.jsx(H,{type:"warning",children:Ne.warning})]})]})]}),x==="schedule"&&e.jsxs("div",{className:"space-y-6 animate-in fade-in slide-in-from-right-4 duration-300",children:[e.jsxs("div",{children:[e.jsx(v,{className:"text-xs uppercase tracking-wider text-muted-foreground",children:"When to Run?"}),e.jsx("div",{className:"grid grid-cols-4 gap-2 mt-3",children:Mt.map(s=>{const N=s.icon,S=y===s.type;return e.jsxs("button",{onClick:()=>E(s.type),className:i("flex flex-col items-center gap-2 p-4 rounded-xl transition-all",S?"bg-primary/10 ring-2 ring-primary/30 shadow-sm border border-primary/20":"bg-card hover:bg-accent/50 border border-border/40 hover:shadow-sm"),children:[e.jsx(N,{className:i("h-6 w-6",S?"text-primary":"text-muted-foreground")}),e.jsx("span",{className:i("text-xs font-medium",S&&"text-primary"),children:s.label})]},s.type)})})]}),y==="cron"&&e.jsxs("div",{className:"space-y-4 animate-in fade-in duration-200",children:[e.jsxs("div",{children:[e.jsx(v,{htmlFor:"cron",children:"Cron Expression"}),e.jsx(C,{id:"cron",placeholder:"*/5 * * * *",value:M,onChange:s=>$(s.target.value),className:"mt-2 font-mono text-sm"}),e.jsx("div",{className:"mt-2 px-3 py-2 rounded-lg bg-primary/5 border border-primary/20",children:e.jsxs("div",{className:"flex items-center gap-2 text-sm text-primary",children:[e.jsx(ue,{className:"h-4 w-4"}),e.jsx("span",{className:"font-medium",children:xs(M)})]})})]}),e.jsxs("div",{children:[e.jsx(v,{className:"text-xs text-muted-foreground",children:"Presets"}),e.jsx("div",{className:"flex flex-wrap gap-1.5 mt-2",children:Ns.map(s=>e.jsx("button",{onClick:()=>$(s.value),className:i("px-3 py-1.5 rounded-lg text-xs font-medium transition-all",M===s.value?"bg-primary text-primary-foreground shadow-md":"bg-accent hover:bg-accent/80 border border-border/30"),children:s.label},s.value))})]}),e.jsxs(H,{type:"info",children:["Cron format: ",e.jsx("code",{className:"font-mono bg-accent px-1.5 py-0.5 rounded border border-border/20",children:"minute hour day month weekday"}),e.jsx("br",{}),"Use ",e.jsx("code",{className:"font-mono bg-accent px-1.5 py-0.5 rounded border border-border/20",children:"*"})," for any value, ",e.jsx("code",{className:"font-mono bg-accent px-1.5 py-0.5 rounded border border-border/20",children:"*/N"})," for every N units."]})]}),y==="interval"&&e.jsxs("div",{className:"space-y-4 animate-in fade-in duration-200",children:[e.jsxs("div",{children:[e.jsx(v,{htmlFor:"interval",children:"Interval (seconds)"}),e.jsx(C,{id:"interval",type:"number",min:1,value:D,onChange:s=>U(parseInt(s.target.value)||60),className:"mt-2"}),e.jsx("div",{className:"mt-2 px-3 py-2 rounded-lg bg-primary/5 border border-primary/20",children:e.jsxs("div",{className:"flex items-center gap-2 text-sm text-primary",children:[e.jsx(ge,{className:"h-4 w-4"}),e.jsx("span",{className:"font-medium",children:Fe.find(s=>s.value===D)?.humanize||`Every ${D} seconds`})]})})]}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:Fe.map(s=>e.jsx("button",{onClick:()=>U(s.value),className:i("px-3 py-1.5 rounded-lg text-xs font-medium transition-all",D===s.value?"bg-primary text-primary-foreground shadow-md":"bg-accent hover:bg-accent/80 border border-border/30"),children:s.label},s.value))})]}),y==="oneshot"&&e.jsxs("div",{className:"space-y-4 animate-in fade-in duration-200",children:[e.jsxs("div",{children:[e.jsx(v,{children:"Run At"}),e.jsxs("div",{className:"grid grid-cols-2 gap-3 mt-2",children:[e.jsxs("div",{children:[e.jsx(C,{type:"date",value:T,onChange:s=>n(s.target.value),min:new Date().toISOString().split("T")[0]}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"Date"})]}),e.jsxs("div",{children:[e.jsx(C,{type:"time",value:P,onChange:s=>fe(s.target.value)}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"Time"})]})]}),T&&P&&e.jsx("div",{className:"mt-2 px-3 py-2 rounded-lg bg-primary/5 border border-primary/20",children:e.jsxs("div",{className:"flex items-center gap-2 text-sm text-primary",children:[e.jsx(Me,{className:"h-4 w-4"}),e.jsx("span",{className:"font-medium",children:new Date(`${T}T${P}`).toLocaleString()})]})})]}),e.jsxs("label",{className:"flex items-center gap-2 text-sm cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:ts,onChange:s=>as(s.target.checked),className:"rounded"}),e.jsx("span",{className:"text-muted-foreground",children:"Auto-delete after completion"})]}),e.jsx(H,{type:"info",children:"One-shot jobs run exactly once at the specified time and can optionally be deleted afterward."})]}),y==="event"&&e.jsxs("div",{className:"space-y-4 animate-in fade-in duration-200",children:[e.jsxs("div",{children:[e.jsx(v,{children:"Event Type"}),e.jsx("div",{className:"grid grid-cols-4 gap-2 mt-2",children:Pt.map(s=>e.jsxs("button",{onClick:()=>ve(s.type),className:i("flex flex-col items-center p-3 rounded-xl text-center transition-all",K===s.type?"bg-primary/5 ring-2 ring-primary/20":"bg-muted/30 hover:bg-muted/50"),children:[e.jsx("span",{className:i("text-xs font-medium",K===s.type&&"text-primary"),children:s.label}),e.jsx("span",{className:"text-[9px] text-muted-foreground mt-0.5",children:s.description})]},s.type))})]}),m==="advanced"&&e.jsxs("div",{children:[e.jsx(v,{htmlFor:"eventConfig",children:"Event Config (JSON)"}),e.jsx(C,{id:"eventConfig",placeholder:'{"source": "webhook"}',value:je,onChange:s=>ye(s.target.value),className:"mt-2 font-mono text-xs"})]}),e.jsx(H,{type:"info",children:"Event-triggered jobs run when specific events occur, like webhooks or file changes."})]}),m==="advanced"&&y==="cron"&&e.jsxs("div",{children:[e.jsx(v,{htmlFor:"timezone",children:"Timezone"}),e.jsx(C,{id:"timezone",placeholder:"UTC",value:a,onChange:s=>se(s.target.value),className:"mt-2"}),e.jsx("p",{className:"text-[10px] text-muted-foreground mt-1",children:"Default: UTC. Use IANA timezone names (e.g., America/New_York)."})]})]}),x==="config"&&e.jsxs("div",{className:"space-y-6 animate-in fade-in slide-in-from-right-4 duration-300",children:[O?.guide&&e.jsxs(H,{type:"tip",children:[e.jsxs("strong",{children:[O.name,":"]})," ",O.guide]}),O?.warning&&e.jsx(H,{type:"warning",children:O.warning}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(v,{htmlFor:"name",className:"text-xs uppercase tracking-wider text-muted-foreground",children:"Job Name *"}),e.jsx(C,{id:"name",placeholder:"e.g., Sync GitHub Issues",value:w,onChange:s=>L(s.target.value),className:"mt-2 text-lg font-medium"})]}),e.jsxs("div",{children:[e.jsx(v,{htmlFor:"description",className:"text-xs uppercase tracking-wider text-muted-foreground",children:"Description"}),e.jsx(C,{id:"description",placeholder:"What this job does...",value:k,onChange:s=>F(s.target.value),className:"mt-2"})]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx(v,{htmlFor:"payload",className:"text-xs uppercase tracking-wider text-muted-foreground",children:"Payload (JSON)"}),ce.valid?e.jsxs("span",{className:"flex items-center gap-1 text-xs text-green-600",children:[e.jsx(Q,{className:"h-3 w-3"})," Valid"]}):e.jsxs("span",{className:"flex items-center gap-1 text-xs text-red-500",children:[e.jsx(ke,{className:"h-3 w-3"})," ",ce.error]})]}),e.jsx("textarea",{id:"payload",value:W,onChange:s=>Z(s.target.value),className:i("w-full p-4 rounded-xl bg-muted/40 font-mono text-sm resize-none h-32 transition-colors focus:outline-none focus:ring-1 focus:ring-primary/30",!ce.valid&&"ring-1 ring-red-500"),placeholder:'{"url": "https://..."}'})]}),m==="advanced"&&e.jsxs("div",{className:"p-4 rounded-xl bg-card border border-border/40 shadow-sm space-y-4",children:[e.jsxs("div",{className:"text-xs uppercase tracking-wider text-muted-foreground font-medium flex items-center gap-2",children:[e.jsx(ys,{className:"h-3.5 w-3.5"}),"Advanced Options"]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(cs,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("span",{className:"text-sm",children:"Retry on failure"})]}),e.jsx("input",{type:"checkbox",checked:ie,onChange:s=>Ge(s.target.checked),className:"rounded"})]}),ie&&e.jsxs("div",{className:"grid grid-cols-2 gap-3 pl-6",children:[e.jsxs("div",{children:[e.jsx(v,{className:"text-xs",children:"Max Retries"}),e.jsx(C,{type:"number",min:1,max:10,value:Pe,onChange:s=>We(parseInt(s.target.value)||3),className:"mt-1 h-8 text-xs"})]}),e.jsxs("div",{children:[e.jsx(v,{className:"text-xs",children:"Backoff"}),e.jsxs("select",{value:Ae,onChange:s=>Be(s.target.value),className:"w-full mt-1 h-8 px-2 rounded-md border bg-background text-xs",children:[e.jsx("option",{value:"exponential",children:"Exponential"}),e.jsx("option",{value:"linear",children:"Linear"}),e.jsx("option",{value:"fixed",children:"Fixed"})]})]})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(qe,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("span",{className:"text-sm",children:"Send notifications"})]}),e.jsx("input",{type:"checkbox",checked:oe,onChange:s=>Ve(s.target.checked),className:"rounded"})]}),oe&&e.jsxs("div",{className:"pl-6 space-y-2",children:[e.jsx(C,{placeholder:"Slack channel, webhook URL, or email",value:B,onChange:s=>Ye(s.target.value),className:"text-xs"}),e.jsxs("div",{className:"flex items-center gap-4 text-xs",children:[e.jsxs("label",{className:"flex items-center gap-1",children:[e.jsx("input",{type:"checkbox",checked:Xe,onChange:s=>Ze(s.target.checked),className:"rounded"}),"On success"]}),e.jsxs("label",{className:"flex items-center gap-1",children:[e.jsx("input",{type:"checkbox",checked:es,onChange:s=>ss(s.target.checked),className:"rounded"}),"On failure"]})]})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsxs(v,{className:"text-xs flex items-center gap-1",children:["Max Runs",e.jsx(Ie,{content:"Stop after N runs",children:e.jsx(Re,{className:"h-3 w-3"})})]}),e.jsx(C,{type:"number",min:1,placeholder:"Unlimited",value:de||"",onChange:s=>rs(s.target.value?parseInt(s.target.value):null),className:"mt-1 h-8 text-xs"})]}),e.jsxs("div",{children:[e.jsxs(v,{className:"text-xs flex items-center gap-1",children:["Max Failures",e.jsx(Ie,{content:"Pause after N consecutive failures",children:e.jsx(Re,{className:"h-3 w-3"})})]}),e.jsx(C,{type:"number",min:1,placeholder:"Unlimited",value:De||"",onChange:s=>ns(s.target.value?parseInt(s.target.value):null),className:"mt-1 h-8 text-xs"})]})]})]})]}),x==="review"&&e.jsxs("div",{className:"space-y-6 animate-in fade-in slide-in-from-right-4 duration-300",children:[e.jsxs("div",{className:"text-center mb-6",children:[e.jsx("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-2xl bg-linear-to-br from-primary/20 to-primary/5 mb-3",children:e.jsx(Q,{className:"h-8 w-8 text-primary"})}),e.jsx("h3",{className:"text-lg font-semibold",children:"Ready to Create"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Review your job configuration"})]}),e.jsxs("div",{className:"p-5 rounded-2xl bg-linear-to-br from-muted/50 to-transparent space-y-4",children:[e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-xs text-muted-foreground uppercase tracking-wider",children:"Job Name"}),e.jsx("div",{className:"text-lg font-semibold mt-1",children:w||"Untitled Job"}),k&&e.jsx("div",{className:"text-sm text-muted-foreground mt-0.5",children:k})]}),f&&e.jsx("div",{className:i("p-2 rounded-lg",f==="http"&&"bg-blue-500/20",f==="tool"&&"bg-indigo-500/20",f==="script"&&"bg-green-500/20",f==="message"&&"bg-orange-500/20"),children:ae.find(s=>s.type===f)?.icon&&(()=>{const s=ae.find(N=>N.type===f).icon;return e.jsx(s,{className:"h-5 w-5"})})()})]}),e.jsx("hr",{className:"border-border/50"}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-xs text-muted-foreground uppercase tracking-wider",children:"Type"}),e.jsx("div",{className:"text-sm font-medium mt-1",children:ae.find(s=>s.type===f)?.label})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs text-muted-foreground uppercase tracking-wider",children:"Schedule"}),e.jsx("div",{className:"text-sm font-medium mt-1",children:Ms})]})]}),e.jsx("hr",{className:"border-border/50"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs text-muted-foreground uppercase tracking-wider mb-2",children:"Payload"}),e.jsx("pre",{className:"p-3 rounded-lg bg-accent border border-border/30 text-xs font-mono overflow-x-auto max-h-24",children:W})]}),m==="advanced"&&(ie||oe||de||De)&&e.jsxs(e.Fragment,{children:[e.jsx("hr",{className:"border-border/50"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[ie&&e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 rounded-full bg-muted text-xs",children:[e.jsx(cs,{className:"h-3 w-3"}),Pe,"x ",Ae," retries"]}),oe&&B&&e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 rounded-full bg-muted text-xs",children:[e.jsx(qe,{className:"h-3 w-3"}),"Notify: ",B.slice(0,15),"..."]}),de&&e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 rounded-full bg-muted text-xs",children:[e.jsx(Rs,{className:"h-3 w-3"}),"Max ",de," runs"]})]})]})]}),f==="script"&&e.jsxs(H,{type:"warning",children:[e.jsx("strong",{children:"Security Notice:"})," Script jobs execute shell commands with server permissions. Ensure your command is safe before creating."]}),te.isError&&e.jsxs("div",{className:"flex items-center gap-2 p-4 rounded-xl bg-red-500/10 border border-red-500/20 text-red-500 text-sm",children:[e.jsx(ke,{className:"h-5 w-5 shrink-0"}),e.jsx("span",{children:te.error instanceof Error?te.error.message:"Failed to create job"})]})]})]}),e.jsxs("div",{className:"border-t border-border/30 p-4 flex items-center justify-between bg-gradient-to-r from-accent/50 to-transparent",children:[e.jsxs(A,{variant:"ghost",onClick:h===0?()=>b(!1):Es,className:"gap-2",children:[e.jsx(Fs,{className:"h-4 w-4"}),h===0?"Cancel":"Back"]}),x==="review"?e.jsx(A,{onClick:()=>te.mutate(),disabled:te.isPending,className:"gap-2 min-w-35 shadow-lg shadow-primary/20",children:te.isPending?e.jsxs(e.Fragment,{children:[e.jsx(G,{className:"h-4 w-4 animate-spin"}),"Creating..."]}):e.jsxs(e.Fragment,{children:[e.jsx(Se,{className:"h-4 w-4"}),"Create Job"]})}):e.jsxs(A,{onClick:Ts,disabled:!Ss,className:"gap-2",children:["Continue",e.jsx(Is,{className:"h-4 w-4"})]})]})]})]})}const Dt=[{value:"http",label:"HTTP Request",icon:Ee},{value:"tool",label:"Tool Execution",icon:X},{value:"script",label:"Shell Script",icon:he},{value:"message",label:"Notification",icon:Te}],Rt=[{label:"1 min",value:"* * * * *"},{label:"5 min",value:"*/5 * * * *"},{label:"15 min",value:"*/15 * * * *"},{label:"30 min",value:"*/30 * * * *"},{label:"Hourly",value:"0 * * * *"},{label:"Daily",value:"0 0 * * *"},{label:"Weekly",value:"0 0 * * 0"}];function Ft(t){return{"* * * * *":"Every minute","*/5 * * * *":"Every 5 minutes","*/15 * * * *":"Every 15 minutes","*/30 * * * *":"Every 30 minutes","0 * * * *":"Every hour","0 0 * * *":"Daily at midnight","0 0 * * 0":"Weekly on Sunday","0 9 * * 1-5":"Weekdays at 9 AM"}[t]||t}function It({type:t,children:c}){const o={info:{icon:ze,bg:"bg-blue-500/10",border:"border-blue-500/20",text:"text-blue-400"},warning:{icon:ke,bg:"bg-amber-500/10",border:"border-amber-500/20",text:"text-amber-400"},tip:{icon:ze,bg:"bg-green-500/10",border:"border-green-500/20",text:"text-green-400"}},{icon:l,bg:j,border:u,text:b}=o[t];return e.jsxs("div",{className:i("flex items-start gap-2 p-3 rounded-lg border text-xs",j,u,b),children:[e.jsx(l,{className:"h-4 w-4 shrink-0 mt-0.5"}),e.jsx("div",{children:c})]})}function Ot({job:t,open:c,onOpenChange:o}){const l=Ce(),[j,u]=r.useState(""),[b,m]=r.useState(""),[p,x]=r.useState("cron"),[d,h]=r.useState("*/5 * * * *"),[g,R]=r.useState(300),[w,L]=r.useState("{}"),[k,F]=r.useState([]),[f,_]=r.useState(""),[y,E]=r.useState("active");r.useEffect(()=>{t&&(u(t.name),m(t.description||""),x(t.cronExpression?"cron":"interval"),h(t.cronExpression||"*/5 * * * *"),R(t.intervalMs?Math.round(t.intervalMs/1e3):300),L(JSON.stringify(t.payload||{},null,2)),F(t.labels||[]),E(t.status==="paused"?"paused":"active"))},[t]);const M=z({mutationFn:()=>{if(!t)throw new Error("No job to update");const n=JSON.parse(w);return J.cron.update(t.id,{name:j,description:b||void 0,cronExpression:p==="cron"?d:void 0,intervalMs:p==="interval"?g*1e3:void 0,payload:n,labels:k,status:y})},onSuccess:()=>{l.invalidateQueries({queryKey:["cron-jobs"]}),l.invalidateQueries({queryKey:["cron-stats"]}),o(!1)}}),$=j.trim().length>0&&(p==="cron"&&d.trim().length>0||p==="interval"&&g>=1),D=()=>{const n=f.trim().toLowerCase();n&&!k.includes(n)&&(F([...k,n]),_(""))},U=n=>{F(k.filter(P=>P!==n))};if(!t)return null;const T=Dt.find(n=>n.value===t.jobType)?.icon||X;return e.jsx(_e,{open:c,onOpenChange:o,children:e.jsxs(Ue,{className:"max-w-2xl max-h-[85vh] flex flex-col overflow-hidden",children:[e.jsx(Ke,{children:e.jsxs(Qe,{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-2 rounded-xl bg-primary/10",children:e.jsx(T,{className:"h-5 w-5 text-primary"})}),e.jsxs("div",{children:[e.jsx("span",{className:"block",children:"Edit Scheduled Job"}),e.jsxs("span",{className:"text-xs font-normal text-muted-foreground",children:[t.jobType.toUpperCase()," • Created ",new Date(t.createdAt).toLocaleDateString()]})]})]})}),e.jsxs("div",{className:"flex-1 overflow-y-auto space-y-6 py-4",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(v,{htmlFor:"name",children:"Job Name"}),e.jsx(C,{id:"name",value:j,onChange:n=>u(n.target.value),placeholder:"My Scheduled Job",className:"mt-1.5"})]}),e.jsxs("div",{children:[e.jsx(v,{htmlFor:"description",children:"Description (optional)"}),e.jsx(C,{id:"description",value:b,onChange:n=>m(n.target.value),placeholder:"What this job does...",className:"mt-1.5"})]})]}),e.jsxs("div",{children:[e.jsx(v,{className:"text-xs uppercase tracking-wider text-muted-foreground mb-2 block",children:"Status"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("button",{onClick:()=>E("active"),className:i("flex items-center gap-2 px-4 py-2 rounded-xl border transition-all",y==="active"?"border-green-500/50 bg-green-500/10 text-green-500":"border-border/50 hover:border-border"),children:[e.jsx(ue,{className:"h-4 w-4"}),"Active"]}),e.jsxs("button",{onClick:()=>E("paused"),className:i("flex items-center gap-2 px-4 py-2 rounded-xl border transition-all",y==="paused"?"border-amber-500/50 bg-amber-500/10 text-amber-500":"border-border/50 hover:border-border"),children:[e.jsx(be,{className:"h-4 w-4"}),"Paused"]})]})]}),e.jsxs("div",{children:[e.jsx(v,{className:"text-xs uppercase tracking-wider text-muted-foreground mb-2 block",children:"Schedule"}),e.jsxs("div",{className:"flex gap-2 mb-4",children:[e.jsxs("button",{onClick:()=>x("cron"),className:i("flex items-center gap-2 px-3 py-2 rounded-lg text-sm transition-all",p==="cron"?"bg-primary text-primary-foreground":"bg-muted hover:bg-muted/80"),children:[e.jsx(I,{className:"h-4 w-4"}),"Cron"]}),e.jsxs("button",{onClick:()=>x("interval"),className:i("flex items-center gap-2 px-3 py-2 rounded-lg text-sm transition-all",p==="interval"?"bg-primary text-primary-foreground":"bg-muted hover:bg-muted/80"),children:[e.jsx(ge,{className:"h-4 w-4"}),"Interval"]})]}),p==="cron"?e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx(C,{value:d,onChange:n=>h(n.target.value),placeholder:"*/5 * * * *",className:"font-mono"}),e.jsx("div",{className:"mt-2 px-3 py-2 rounded-lg bg-primary/5 border border-primary/20",children:e.jsxs("div",{className:"flex items-center gap-2 text-sm text-primary",children:[e.jsx(ue,{className:"h-4 w-4"}),e.jsx("span",{className:"font-medium",children:Ft(d)})]})})]}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:Rt.map(n=>e.jsx("button",{onClick:()=>h(n.value),className:i("px-3 py-1.5 rounded-lg text-xs font-medium transition-all",d===n.value?"bg-primary text-primary-foreground":"bg-muted hover:bg-muted/80"),children:n.label},n.value))})]}):e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"Every"}),e.jsx(C,{type:"number",min:1,value:g,onChange:n=>R(parseInt(n.target.value)||60),className:"w-24"}),e.jsx("span",{className:"text-sm text-muted-foreground",children:"seconds"})]}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:[30,60,300,600,1800,3600].map(n=>e.jsx("button",{onClick:()=>R(n),className:i("px-3 py-1.5 rounded-lg text-xs font-medium transition-all",g===n?"bg-primary text-primary-foreground":"bg-muted hover:bg-muted/80"),children:n<60?`${n}s`:n<3600?`${n/60}m`:`${n/3600}h`},n))})]})]}),e.jsxs("div",{children:[e.jsx(v,{className:"text-xs uppercase tracking-wider text-muted-foreground mb-2 block",children:"Labels"}),e.jsx("div",{className:"flex flex-wrap gap-2 mb-2",children:k.map(n=>e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 rounded-lg bg-primary/10 text-primary text-xs",children:[e.jsx(js,{className:"h-3 w-3"}),n,e.jsx("button",{onClick:()=>U(n),className:"ml-1 hover:text-red-500",children:e.jsx(Os,{className:"h-3 w-3"})})]},n))}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(C,{value:f,onChange:n=>_(n.target.value),placeholder:"Add label...",className:"flex-1",onKeyDown:n=>n.key==="Enter"&&(n.preventDefault(),D())}),e.jsx(A,{variant:"outline",size:"sm",onClick:D,disabled:!f.trim(),children:e.jsx(fs,{className:"h-4 w-4"})})]})]}),e.jsxs("div",{children:[e.jsx(v,{htmlFor:"payload",children:"Payload (JSON)"}),e.jsx("textarea",{id:"payload",value:w,onChange:n=>L(n.target.value),rows:6,className:"w-full mt-1.5 px-3 py-2 rounded-lg border border-border bg-background font-mono text-sm resize-none focus:outline-none focus:ring-2 focus:ring-primary/50"}),e.jsx(It,{type:"info",children:"Payload is specific to job type. HTTP jobs need url/method, tool jobs need tool/params."})]})]}),e.jsxs("div",{className:"flex items-center justify-between pt-4 border-t",children:[e.jsx(A,{variant:"ghost",onClick:()=>o(!1),children:"Cancel"}),e.jsx(A,{onClick:()=>M.mutate(),disabled:!$||M.isPending,className:"gap-2",children:M.isPending?e.jsxs(e.Fragment,{children:[e.jsx(G,{className:"h-4 w-4 animate-spin"}),"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(Vs,{className:"h-4 w-4"}),"Save Changes"]})})]}),M.isError&&e.jsxs("div",{className:"mt-2 p-3 rounded-lg bg-red-500/10 border border-red-500/20 text-red-400 text-sm",children:[e.jsx(ke,{className:"h-4 w-4 inline mr-2"}),M.error.message]})]})})}function Jt(){const[t,c]=r.useState(""),[o,l]=r.useState(null),j=Ce(),u=z({mutationFn:d=>ds("/cron/automate?dryRun=true",{method:"POST",body:JSON.stringify({input:d})}),onSuccess:d=>l(d)}),b=z({mutationFn:d=>ds("/cron/automate",{method:"POST",body:JSON.stringify({input:d})}),onSuccess:()=>{c(""),l(null),j.invalidateQueries({queryKey:["cron"]})}}),m=()=>{t.trim().length<5||u.mutate(t)},p=()=>{t.trim().length<5||b.mutate(t)},x=["every morning at 8am summarize GitHub notifications","daily at 9am send AI news digest to telegram","every friday at 5pm send sprint report to slack","check server health every 30 minutes","nightly at 2am clean up old logs"];return e.jsxs(Js,{className:"p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(Se,{className:"h-4 w-4 text-primary"}),e.jsx("h3",{className:"font-medium text-sm",children:"Quick Automate"})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{type:"text",value:t,onChange:d=>{c(d.target.value),l(null)},onKeyDown:d=>{d.key==="Enter"&&m()},placeholder:"e.g., every morning at 8am send AI news digest to telegram",className:"flex-1 px-3 py-2 text-sm rounded-lg border bg-background focus:outline-none focus:ring-2 focus:ring-primary/50"}),e.jsxs("button",{onClick:m,disabled:t.trim().length<5||u.isPending,className:"px-3 py-2 text-sm rounded-lg bg-muted hover:bg-muted/80 disabled:opacity-50 flex items-center gap-1.5",children:[u.isPending?e.jsx(G,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx($e,{className:"h-3.5 w-3.5"}),"Preview"]}),e.jsxs("button",{onClick:p,disabled:!o?.success||b.isPending,className:"px-3 py-2 text-sm rounded-lg bg-primary text-primary-foreground hover:bg-primary/90 disabled:opacity-50 flex items-center gap-1.5",children:[b.isPending?e.jsx(G,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(ue,{className:"h-3.5 w-3.5"}),"Create"]})]}),o&&e.jsx("div",{className:`mt-3 p-3 rounded-lg text-sm ${o.success?"bg-emerald-50 dark:bg-emerald-950/20 border border-emerald-200 dark:border-emerald-800":"bg-red-50 dark:bg-red-950/20 border border-red-200 dark:border-red-800"}`,children:o.success?e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("div",{className:"font-medium text-emerald-800 dark:text-emerald-200",children:o.message}),o.parsed?.cronExpression&&e.jsxs("div",{className:"flex items-center gap-2 text-xs text-emerald-600 dark:text-emerald-400",children:[e.jsx(I,{className:"h-3 w-3"}),e.jsx("span",{children:o.parsed.cronExplained??o.parsed.cronExpression})]}),o.delivery&&e.jsxs("div",{className:"flex items-center gap-2 text-xs text-emerald-600 dark:text-emerald-400",children:[e.jsx(rt,{className:"h-3 w-3"}),e.jsxs("span",{children:["Deliver to ",o.delivery.channel," (",o.delivery.target,")"]})]})]}):e.jsxs("div",{children:[e.jsx("div",{className:"font-medium text-red-800 dark:text-red-200",children:o.error}),o.hint&&e.jsx("div",{className:"text-xs text-red-600 dark:text-red-400 mt-1",children:o.hint})]})}),b.isSuccess&&e.jsx("div",{className:"mt-3 p-3 rounded-lg bg-emerald-100 dark:bg-emerald-900/30 text-sm text-emerald-800 dark:text-emerald-200",children:"Automation created successfully!"}),!t&&!o&&e.jsx("div",{className:"mt-3 flex flex-wrap gap-1.5",children:x.map((d,h)=>e.jsx("button",{onClick:()=>{c(d),l(null)},className:"px-2 py-1 text-xs rounded-full bg-muted/50 hover:bg-muted text-muted-foreground hover:text-foreground transition-colors",children:d},h))})]})}const hs=[{value:"all",label:"All Status",icon:I},{value:"active",label:"Active",icon:Q},{value:"paused",label:"Paused",icon:be},{value:"completed",label:"Completed",icon:Q},{value:"failed",label:"Failed",icon:re},{value:"archived",label:"Archived",icon:He}],ps=[{value:"all",label:"All Types",icon:Me},{value:"http",label:"HTTP",icon:Ee},{value:"tool",label:"Tool",icon:X},{value:"script",label:"Script",icon:he},{value:"message",label:"Message",icon:Te}];function ua(){const t=Ce(),[c,o]=r.useState(""),[l,j]=r.useState("all"),[u,b]=r.useState("all"),[m,p]=r.useState(null),[x,d]=r.useState(""),[h,g]=r.useState(null),[R,w]=r.useState(null),{data:L,isLoading:k,error:F,refetch:f}=we({queryKey:["cron-jobs",l,u],queryFn:()=>J.cron.list({status:l!=="all"?l:void 0,jobType:u!=="all"?u:void 0,limit:100}),refetchInterval:1e4}),{data:_}=we({queryKey:["cron-stats"],queryFn:()=>J.cron.stats(),refetchInterval:3e4}),y=L?.jobs||[],E=_?.stats,M=y.filter(a=>c?a.name.toLowerCase().includes(c.toLowerCase())||a.description?.toLowerCase().includes(c.toLowerCase()):!0),$=z({mutationFn:a=>J.cron.trigger(a),onSuccess:()=>{t.invalidateQueries({queryKey:["cron-jobs"]})}}),D=z({mutationFn:a=>J.cron.pause(a),onSuccess:()=>{t.invalidateQueries({queryKey:["cron-jobs"]}),t.invalidateQueries({queryKey:["cron-stats"]})}}),U=z({mutationFn:a=>J.cron.resume(a),onSuccess:()=>{t.invalidateQueries({queryKey:["cron-jobs"]}),t.invalidateQueries({queryKey:["cron-stats"]})}}),T=z({mutationFn:a=>J.cron.delete(a),onSuccess:()=>{t.invalidateQueries({queryKey:["cron-jobs"]}),t.invalidateQueries({queryKey:["cron-stats"]}),g(null)}}),n=z({mutationFn:a=>J.cron.archive(a),onSuccess:()=>{t.invalidateQueries({queryKey:["cron-jobs"]}),t.invalidateQueries({queryKey:["cron-stats"]})}}),P=z({mutationFn:a=>J.cron.restore(a),onSuccess:()=>{t.invalidateQueries({queryKey:["cron-jobs"]}),t.invalidateQueries({queryKey:["cron-stats"]})}}),fe=r.useCallback(a=>{$.mutate(a)},[$]),K=r.useCallback(a=>{D.mutate(a)},[D]),ve=r.useCallback(a=>{U.mutate(a)},[U]),je=r.useCallback(a=>{p(a.id),d(a.name)},[]),ye=r.useCallback(a=>{g(a)},[]),W=r.useCallback(a=>{w(a)},[]),Z=r.useCallback(a=>{n.mutate(a)},[n]),O=r.useCallback(a=>{P.mutate(a)},[P]),ee=()=>{h&&T.mutate(h)};return F?e.jsxs("div",{className:"glass rounded-[28px] p-12 text-center",children:[e.jsx(pe,{className:"h-12 w-12 mx-auto text-red-400 mb-4"}),e.jsx("p",{className:"text-lg font-bold text-red-400",children:"Error loading scheduled jobs"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:F.message}),e.jsxs(A,{variant:"outline",onClick:()=>f(),className:"mt-4",children:[e.jsx(ne,{className:"h-4 w-4 mr-2"}),"Retry"]})]}):e.jsxs("div",{className:"space-y-6",children:[e.jsxs("header",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"text-2xl font-bold tracking-tight flex items-center gap-2",children:[e.jsx(I,{className:"h-6 w-6 text-primary"}),"Scheduled Jobs"]}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Manage automated tasks with cron schedules or fixed intervals"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs(A,{variant:"outline",size:"sm",onClick:()=>f(),disabled:k,children:[e.jsx(ne,{className:i("h-4 w-4 mr-2",k&&"animate-spin")}),"Refresh"]}),e.jsx(us,{})]})]}),e.jsx(Jt,{}),E&&e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-6 gap-4",children:[e.jsxs("div",{className:"glass rounded-2xl p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground mb-1",children:[e.jsx(Me,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs",children:"Total Jobs"})]}),e.jsx("div",{className:"text-2xl font-bold",children:E.total})]}),e.jsxs("div",{className:"glass rounded-2xl p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 text-green-500 mb-1",children:[e.jsx(gs,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs",children:"Active"})]}),e.jsx("div",{className:"text-2xl font-bold text-green-500",children:E.active})]}),e.jsxs("div",{className:"glass rounded-2xl p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 text-amber-500 mb-1",children:[e.jsx(be,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs",children:"Paused"})]}),e.jsx("div",{className:"text-2xl font-bold text-amber-500",children:E.paused})]}),e.jsxs("div",{className:"glass rounded-2xl p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground mb-1",children:[e.jsx(xe,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs",children:"Total Runs"})]}),e.jsx("div",{className:"text-2xl font-bold",children:E.totalRuns})]}),e.jsxs("div",{className:"glass rounded-2xl p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 text-green-500 mb-1",children:[e.jsx(nt,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs",children:"Successes"})]}),e.jsx("div",{className:"text-2xl font-bold text-green-500",children:E.totalSuccesses})]}),e.jsxs("div",{className:"glass rounded-2xl p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 text-red-500 mb-1",children:[e.jsx(re,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs",children:"Failures"})]}),e.jsx("div",{className:"text-2xl font-bold text-red-500",children:E.totalFailures})]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsxs("div",{className:"relative flex-1 min-w-[200px] max-w-sm",children:[e.jsx(Ls,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(C,{placeholder:"Search jobs...",value:c,onChange:a=>o(a.target.value),className:"pl-10 bg-white/5 border-white/10 rounded-xl"})]}),e.jsxs(Oe,{children:[e.jsx(Je,{asChild:!0,children:e.jsxs(A,{variant:"outline",size:"sm",className:"gap-2",children:[e.jsx(lt,{className:"h-4 w-4"}),hs.find(a=>a.value===l)?.label]})}),e.jsx(Le,{align:"start",children:hs.map(a=>{const se=a.icon;return e.jsxs(q,{onClick:()=>j(a.value),className:i(l===a.value&&"bg-primary/10"),children:[e.jsx(se,{className:"h-4 w-4 mr-2"}),a.label]},a.value)})})]}),e.jsxs(Oe,{children:[e.jsx(Je,{asChild:!0,children:e.jsxs(A,{variant:"outline",size:"sm",className:"gap-2",children:[e.jsx(bs,{className:"h-4 w-4"}),ps.find(a=>a.value===u)?.label]})}),e.jsx(Le,{align:"start",children:ps.map(a=>{const se=a.icon;return e.jsxs(q,{onClick:()=>b(a.value),className:i(u===a.value&&"bg-primary/10"),children:[e.jsx(se,{className:"h-4 w-4 mr-2"}),a.label]},a.value)})})]})]}),k?e.jsxs("div",{className:"glass rounded-[28px] p-12 flex flex-col items-center justify-center",children:[e.jsx(G,{className:"h-8 w-8 animate-spin text-primary mb-3"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading scheduled jobs..."})]}):M.length===0?e.jsxs("div",{className:"glass rounded-[28px] p-12 text-center",children:[e.jsx(I,{className:"h-12 w-12 mx-auto text-muted-foreground mb-4"}),e.jsx("h3",{className:"text-lg font-semibold mb-1",children:c||l!=="all"||u!=="all"?"No jobs match your filters":"No scheduled jobs yet"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:c||l!=="all"||u!=="all"?"Try adjusting your search or filters":"Create your first scheduled job to automate tasks"}),!(c||l!=="all"||u!=="all")&&e.jsx(us,{})]}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:M.map(a=>e.jsx(Nt,{job:a,onTrigger:fe,onPause:K,onResume:ve,onDelete:ye,onViewHistory:()=>je(a),onEdit:W,onArchive:Z,onRestore:O},a.id))}),e.jsx(Tt,{jobId:m,jobName:x,open:!!m,onOpenChange:a=>!a&&p(null)}),e.jsx(Ot,{job:R,open:!!R,onOpenChange:a=>!a&&w(null)}),e.jsx(qs,{open:!!h,onOpenChange:a=>!a&&g(null),children:e.jsxs(zs,{children:[e.jsxs($s,{children:[e.jsx(Hs,{children:"Delete Scheduled Job?"}),e.jsx(_s,{children:"This will permanently delete this job and all its run history. This action cannot be undone."})]}),e.jsxs(Us,{children:[e.jsx(Ks,{children:"Cancel"}),e.jsx(Qs,{onClick:ee,className:"bg-red-500 hover:bg-red-600",disabled:T.isPending,children:T.isPending?e.jsxs(e.Fragment,{children:[e.jsx(G,{className:"h-4 w-4 mr-2 animate-spin"}),"Deleting..."]}):"Delete Job"})]})]})})]})}export{us as CreateJobModal,ua as CronDashboard,Ot as EditJobModal,Nt as JobCard,Tt as JobHistoryModal};
@@ -0,0 +1 @@
1
+ import{j as e,L as s}from"./vendor-react-Mc5_kfYG.js";import{r,K as o,i as t,w as i}from"./index-sEBN7w8J.js";import"./vendor-query-C0p7b53x.js";import"./vendor-ui-CXPAUBFv.js";function m(){return e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx("header",{className:"border-b border-border bg-card/50 backdrop-blur-sm sticky top-0 z-10",children:e.jsxs("div",{className:"max-w-4xl mx-auto px-6 py-4 flex items-center justify-between",children:[e.jsxs(s,{to:"/",className:"flex items-center gap-2 text-muted-foreground hover:text-foreground transition-colors",children:[e.jsx(r,{className:"h-4 w-4"}),e.jsx("span",{className:"text-sm",children:"Back to profClaw"})]}),void 0]})}),e.jsxs("main",{className:"max-w-4xl mx-auto px-6 py-12",children:[e.jsxs("div",{className:"flex items-center gap-4 mb-8",children:[e.jsx("div",{className:"h-12 w-12 rounded-xl bg-primary/10 flex items-center justify-center",children:e.jsx(o,{className:"h-6 w-6 text-primary"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-bold tracking-tight",children:"Privacy Policy"}),e.jsx("p",{className:"text-muted-foreground",children:"Last updated: February 2026"})]})]}),e.jsxs("div",{className:"prose prose-neutral dark:prose-invert max-w-none",children:[e.jsxs("section",{className:"mb-8",children:[e.jsx("h2",{className:"text-xl font-semibold mb-4",children:"1. Introduction"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:'profClaw ("we", "our", or "us") is committed to protecting your privacy. This Privacy Policy explains how we collect, use, disclose, and safeguard your information when you use our AI task management platform.'})]}),e.jsxs("section",{className:"mb-8",children:[e.jsx("h2",{className:"text-xl font-semibold mb-4",children:"2. Information We Collect"}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"p-4 rounded-lg bg-muted/50 border border-border",children:[e.jsx("h3",{className:"font-medium mb-2",children:"Account Information"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Email address, name, and authentication data when you create an account or sign in via GitHub OAuth."})]}),e.jsxs("div",{className:"p-4 rounded-lg bg-muted/50 border border-border",children:[e.jsx("h3",{className:"font-medium mb-2",children:"Task & Project Data"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Tasks, tickets, projects, and AI-generated summaries you create within the platform."})]}),e.jsxs("div",{className:"p-4 rounded-lg bg-muted/50 border border-border",children:[e.jsx("h3",{className:"font-medium mb-2",children:"Usage Data"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Token usage, API calls, and interaction data for cost tracking and service improvement."})]}),e.jsxs("div",{className:"p-4 rounded-lg bg-muted/50 border border-border",children:[e.jsx("h3",{className:"font-medium mb-2",children:"AI Provider Credentials"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"API keys you provide for AI services (Anthropic, OpenAI, etc.) are stored encrypted and used only to make requests on your behalf."})]})]})]}),e.jsxs("section",{className:"mb-8",children:[e.jsx("h2",{className:"text-xl font-semibold mb-4",children:"3. How We Use Your Information"}),e.jsxs("ul",{className:"list-disc list-inside space-y-2 text-muted-foreground",children:[e.jsx("li",{children:"To provide and maintain our service"}),e.jsx("li",{children:"To route tasks to AI agents and track their execution"}),e.jsx("li",{children:"To calculate and display token costs"}),e.jsx("li",{children:"To sync with external platforms (Jira, Linear, GitHub) when connected"}),e.jsx("li",{children:"To improve our platform based on usage patterns"})]})]}),e.jsxs("section",{className:"mb-8",children:[e.jsx("h2",{className:"text-xl font-semibold mb-4",children:"4. Data Storage & Security"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"Your data is stored locally in SQLite by default. When using cloud sync features, data is encrypted in transit and at rest. API keys are stored with encryption and are never logged or exposed."})]}),e.jsxs("section",{className:"mb-8",children:[e.jsx("h2",{className:"text-xl font-semibold mb-4",children:"5. Third-Party Services"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"We integrate with AI providers (Anthropic, OpenAI, Google, etc.) and project management tools (GitHub, Jira, Linear). Your data shared with these services is governed by their respective privacy policies."})]}),e.jsxs("section",{className:"mb-8",children:[e.jsx("h2",{className:"text-xl font-semibold mb-4",children:"6. Your Rights"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"You can export, delete, or modify your data at any time through the Settings page. For data deletion requests, contact us at the address below."})]}),e.jsxs("section",{className:"mb-8",children:[e.jsx("h2",{className:"text-xl font-semibold mb-4",children:"7. Contact Us"}),e.jsxs("p",{className:"text-muted-foreground leading-relaxed",children:["For questions about this Privacy Policy, contact us at:"," ",e.jsx("a",{href:"mailto:support@profclaw.ai",className:"text-primary hover:underline",children:"support@profclaw.ai"})]})]})]}),e.jsx("div",{className:"mt-12 pt-8 border-t border-border",children:e.jsx(s,{to:"/",children:e.jsxs(t,{variant:"outline",className:"gap-2",children:[e.jsx(r,{className:"h-4 w-4"}),"Back to Dashboard"]})})})]})]})}function x(){return e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx("header",{className:"border-b border-border bg-card/50 backdrop-blur-sm sticky top-0 z-10",children:e.jsxs("div",{className:"max-w-4xl mx-auto px-6 py-4 flex items-center justify-between",children:[e.jsxs(s,{to:"/",className:"flex items-center gap-2 text-muted-foreground hover:text-foreground transition-colors",children:[e.jsx(r,{className:"h-4 w-4"}),e.jsx("span",{className:"text-sm",children:"Back to profClaw"})]}),void 0]})}),e.jsxs("main",{className:"max-w-4xl mx-auto px-6 py-12",children:[e.jsxs("div",{className:"flex items-center gap-4 mb-8",children:[e.jsx("div",{className:"h-12 w-12 rounded-xl bg-primary/10 flex items-center justify-center",children:e.jsx(i,{className:"h-6 w-6 text-primary"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-bold tracking-tight",children:"Terms of Service"}),e.jsx("p",{className:"text-muted-foreground",children:"Last updated: February 2026"})]})]}),e.jsxs("div",{className:"prose prose-neutral dark:prose-invert max-w-none",children:[e.jsxs("section",{className:"mb-8",children:[e.jsx("h2",{className:"text-xl font-semibold mb-4",children:"1. Acceptance of Terms"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:'By accessing or using profClaw ("the Service"), you agree to be bound by these Terms of Service. If you do not agree to these terms, please do not use the Service.'})]}),e.jsxs("section",{className:"mb-8",children:[e.jsx("h2",{className:"text-xl font-semibold mb-4",children:"2. Description of Service"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"profClaw is an AI-native task management and agent orchestration platform. It allows users to create, track, and manage tasks that can be executed by various AI agents, with bi-directional sync to external project management tools."})]}),e.jsxs("section",{className:"mb-8",children:[e.jsx("h2",{className:"text-xl font-semibold mb-4",children:"3. User Accounts"}),e.jsxs("ul",{className:"list-disc list-inside space-y-2 text-muted-foreground",children:[e.jsx("li",{children:"You must provide accurate information when creating an account"}),e.jsx("li",{children:"You are responsible for maintaining the security of your account credentials"}),e.jsx("li",{children:"You are responsible for all activities under your account"}),e.jsx("li",{children:"You must notify us immediately of any unauthorized use"})]})]}),e.jsxs("section",{className:"mb-8",children:[e.jsx("h2",{className:"text-xl font-semibold mb-4",children:"4. API Keys & Third-Party Services"}),e.jsx("div",{className:"p-4 rounded-lg bg-amber-500/10 border border-amber-500/30 mb-4",children:e.jsx("p",{className:"text-sm text-amber-600 dark:text-amber-400 font-medium",children:"Important: You are responsible for your own API keys and usage costs"})}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"When you provide API keys for AI providers (Anthropic, OpenAI, Google, etc.), you are responsible for compliance with those providers' terms of service and for any costs incurred. profClaw is not responsible for charges from third-party AI providers."})]}),e.jsxs("section",{className:"mb-8",children:[e.jsx("h2",{className:"text-xl font-semibold mb-4",children:"5. Acceptable Use"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed mb-4",children:"You agree not to use the Service to:"}),e.jsxs("ul",{className:"list-disc list-inside space-y-2 text-muted-foreground",children:[e.jsx("li",{children:"Violate any laws or regulations"}),e.jsx("li",{children:"Generate harmful, illegal, or abusive content via AI agents"}),e.jsx("li",{children:"Attempt to bypass security measures or rate limits"}),e.jsx("li",{children:"Interfere with the proper functioning of the Service"}),e.jsx("li",{children:"Access other users' data without authorization"})]})]}),e.jsxs("section",{className:"mb-8",children:[e.jsx("h2",{className:"text-xl font-semibold mb-4",children:"6. Tool Execution & Security"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"profClaw provides tool execution capabilities for AI agents. By enabling tools, you acknowledge that AI-generated commands will be executed on your behalf. Always review tool executions, especially those modifying files or systems."})]}),e.jsxs("section",{className:"mb-8",children:[e.jsx("h2",{className:"text-xl font-semibold mb-4",children:"7. Intellectual Property"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"You retain ownership of all content you create within profClaw. AI-generated content is subject to the terms of the underlying AI provider. profClaw's software and branding remain our property."})]}),e.jsxs("section",{className:"mb-8",children:[e.jsx("h2",{className:"text-xl font-semibold mb-4",children:"8. Limitation of Liability"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:'profClaw is provided "as is" without warranties. We are not liable for any damages arising from your use of the Service, including but not limited to AI-generated outputs, tool execution results, or integration failures.'})]}),e.jsxs("section",{className:"mb-8",children:[e.jsx("h2",{className:"text-xl font-semibold mb-4",children:"9. Changes to Terms"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"We may update these Terms from time to time. Continued use of the Service after changes constitutes acceptance of the new Terms."})]}),e.jsxs("section",{className:"mb-8",children:[e.jsx("h2",{className:"text-xl font-semibold mb-4",children:"10. Contact"}),e.jsxs("p",{className:"text-muted-foreground leading-relaxed",children:["For questions about these Terms, contact us at:"," ",e.jsx("a",{href:"mailto:support@profclaw.ai",className:"text-primary hover:underline",children:"support@profclaw.ai"})]})]})]}),e.jsx("div",{className:"mt-12 pt-8 border-t border-border",children:e.jsx(s,{to:"/",children:e.jsxs(t,{variant:"outline",className:"gap-2",children:[e.jsx(r,{className:"h-4 w-4"}),"Back to Dashboard"]})})})]})]})}export{m as PrivacyPolicy,x as TermsOfService};
@@ -0,0 +1 @@
1
+ import{r as m,j as e}from"./vendor-react-Mc5_kfYG.js";import{u as Z,b as v,c as X}from"./vendor-query-C0p7b53x.js";import{k as u,v as J,g as T,b as r,d as n,e as c,f as d,Z as Y,ad as _,af as N,l as y,I as ee,i as se}from"./index-sEBN7w8J.js";import{B as i}from"./badge-BbfnwDJP.js";import{T as te}from"./textarea-CxDiKFXZ.js";import{S as M,a as q,b as A,c as D,d as w}from"./select-n108rXny.js";import{P as ae}from"./progress-BboUHuLf.js";import{C as R}from"./circle-x-ByXtwR6Y.js";import{S as ie,R as le}from"./server-DmodxZp-.js";import{T as re}from"./trending-up-C5OYX2k2.js";import{C as ne}from"./cpu-CiuoCeDY.js";import{D as F}from"./dollar-sign-Dmijd6DP.js";import"./vendor-ui-CXPAUBFv.js";import"./chevron-up-4ymsBJRo.js";function we(){const k=Z(),[o,P]=m.useState(""),[C,L]=m.useState(""),[h,$]=m.useState("__auto__"),[j,E]=m.useState("__auto__"),[t,K]=m.useState(null),{data:B,isLoading:I}=v({queryKey:["gateway","agents"],queryFn:()=>u.gateway.agents(),refetchInterval:3e4}),{data:U,isLoading:W}=v({queryKey:["gateway","workflows"],queryFn:()=>u.gateway.workflows()}),{data:Q}=v({queryKey:["gateway","config"],queryFn:()=>u.gateway.config()}),{data:z,isLoading:G}=v({queryKey:["gateway","status"],queryFn:()=>u.gateway.status(),refetchInterval:5e3}),b=X({mutationFn:s=>u.gateway.execute(s),onSuccess:s=>{K(s),k.invalidateQueries({queryKey:["tasks"]}),k.invalidateQueries({queryKey:["stats"]})}}),V=()=>{if(!o.trim())return;const s={task:{title:o,prompt:C||o,source:"gateway-ui",priority:3},workflow:h&&h!=="__auto__"?h:void 0,preferredAgent:j&&j!=="__auto__"?j:void 0,autonomous:!0};b.mutate(s)},x=B?.agents||[],g=U?.workflows||[],H=Q?.config,a=z,O=s=>{const l=Math.floor(s/1e3),f=Math.floor(l/60),p=Math.floor(f/60),S=Math.floor(p/24);return S>0?`${S}d ${p%24}h`:p>0?`${p}h ${f%60}m`:f>0?`${f}m ${l%60}s`:`${l}s`};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold",children:"Gateway"}),e.jsx("p",{className:"text-muted-foreground",children:"Execute tasks through the unified routing system"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[G?e.jsx(i,{variant:"secondary",children:"Checking..."}):a?.status.online?e.jsxs(i,{variant:"default",className:"gap-1",children:[e.jsx(J,{className:"h-3 w-3"}),"Online"]}):e.jsxs(i,{variant:"destructive",className:"gap-1",children:[e.jsx(R,{className:"h-3 w-3"}),"Offline"]}),a&&e.jsxs(i,{variant:"outline",className:"gap-1",children:[e.jsx(T,{className:"h-3 w-3"}),O(a.status.uptime)]})]})]}),a&&e.jsxs(r,{className:"shadow-elevated",children:[e.jsx(n,{className:"pb-2",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(c,{className:"flex items-center gap-2",children:[e.jsx(ie,{className:"h-5 w-5"}),"Gateway Status"]}),e.jsxs(i,{variant:a.status.activeRequests>0?"default":"secondary",children:[a.status.activeRequests," active request",a.status.activeRequests!==1?"s":""]})]})}),e.jsxs(d,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:"Capacity Utilization"}),e.jsxs("span",{className:"font-medium",children:[a.status.utilizationPercent,"%"]})]}),e.jsx(ae,{value:a.status.utilizationPercent,className:"h-2"}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[a.status.activeRequests," / ",a.status.maxConcurrent," concurrent slots used"]})]}),e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[e.jsxs("div",{className:"rounded-lg bg-muted/50 p-3 text-center",children:[e.jsxs("div",{className:"flex items-center justify-center gap-1 text-muted-foreground text-xs mb-1",children:[e.jsx(Y,{className:"h-3 w-3"}),"Total Tasks"]}),e.jsx("div",{className:"text-xl font-bold",children:a.metrics.totalTasks})]}),e.jsxs("div",{className:"rounded-lg bg-muted/50 p-3 text-center",children:[e.jsxs("div",{className:"flex items-center justify-center gap-1 text-muted-foreground text-xs mb-1",children:[e.jsx(_,{className:"h-3 w-3"}),"Success Rate"]}),e.jsxs("div",{className:"text-xl font-bold",children:[a.metrics.successRate,"%"]})]}),e.jsxs("div",{className:"rounded-lg bg-muted/50 p-3 text-center",children:[e.jsxs("div",{className:"flex items-center justify-center gap-1 text-muted-foreground text-xs mb-1",children:[e.jsx(T,{className:"h-3 w-3"}),"Avg Duration"]}),e.jsx("div",{className:"text-xl font-bold",children:a.metrics.averageDurationMs>6e4?`${Math.round(a.metrics.averageDurationMs/6e4)}m`:`${Math.round(a.metrics.averageDurationMs/1e3)}s`})]}),e.jsxs("div",{className:"rounded-lg bg-muted/50 p-3 text-center",children:[e.jsxs("div",{className:"flex items-center justify-center gap-1 text-muted-foreground text-xs mb-1",children:[e.jsx(re,{className:"h-3 w-3"}),"Total Load"]}),e.jsx("div",{className:"text-xl font-bold",children:a.agents.totalLoad})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{className:"font-medium",children:"Connected Agents"}),e.jsxs("span",{className:"text-muted-foreground",children:[a.agents.healthy,"/",a.agents.total," healthy"]})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[a.agents.list.map(s=>e.jsxs(i,{variant:s.healthy?"outline":"destructive",className:"gap-1",children:[s.healthy?e.jsx(_,{className:"h-3 w-3 text-green-500"}):e.jsx(R,{className:"h-3 w-3"}),s.name,s.load>0&&e.jsxs("span",{className:"text-xs opacity-70",children:["(",s.load,")"]}),s.latencyMs!==void 0&&e.jsxs("span",{className:"text-xs opacity-70",children:[s.latencyMs,"ms"]})]},s.type)),a.agents.list.length===0&&e.jsx("span",{className:"text-sm text-muted-foreground",children:"No agents connected"})]})]})]})]}),e.jsxs("div",{className:"grid gap-4 md:grid-cols-3",children:[e.jsxs(r,{children:[e.jsx(n,{className:"pb-2",children:e.jsx(c,{className:"text-sm font-medium",children:"Available Agents"})}),e.jsxs(d,{children:[e.jsx("div",{className:"text-2xl font-bold",children:x.length}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[x.filter(s=>s.health.healthy).length," healthy"]})]})]}),e.jsxs(r,{children:[e.jsx(n,{className:"pb-2",children:e.jsx(c,{className:"text-sm font-medium",children:"Workflows"})}),e.jsxs(d,{children:[e.jsx("div",{className:"text-2xl font-bold",children:g.length}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Available templates"})]})]}),e.jsxs(r,{children:[e.jsx(n,{className:"pb-2",children:e.jsx(c,{className:"text-sm font-medium",children:"Config"})}),e.jsxs(d,{children:[e.jsx("div",{className:"text-2xl font-bold",children:H?.enableScoring?"Smart":"Basic"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Routing mode"})]})]})]}),e.jsxs("div",{className:"grid gap-6 lg:grid-cols-2",children:[e.jsxs(r,{children:[e.jsxs(n,{children:[e.jsx(c,{children:"Execute Task"}),e.jsx(N,{children:"Route a task through the gateway for intelligent agent selection"})]}),e.jsxs(d,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(y,{htmlFor:"title",children:"Task Title"}),e.jsx(ee,{id:"title",placeholder:"Fix authentication bug",value:o,onChange:s=>P(s.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(y,{htmlFor:"prompt",children:"Task Prompt (optional)"}),e.jsx(te,{id:"prompt",placeholder:"Detailed description of the task...",value:C,onChange:s=>L(s.target.value),rows:3})]}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(y,{children:"Workflow"}),e.jsxs(M,{value:h,onValueChange:$,children:[e.jsx(q,{children:e.jsx(A,{placeholder:"Auto-detect"})}),e.jsxs(D,{children:[e.jsx(w,{value:"__auto__",children:"Auto-detect"}),g.map(s=>e.jsx(w,{value:s.type,children:s.name},s.type))]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(y,{children:"Preferred Agent"}),e.jsxs(M,{value:j,onValueChange:E,children:[e.jsx(q,{children:e.jsx(A,{placeholder:"Auto-select"})}),e.jsxs(D,{children:[e.jsx(w,{value:"__auto__",children:"Auto-select"}),x.map(s=>e.jsxs(w,{value:s.type,disabled:!s.health.healthy,children:[s.name," ",!s.health.healthy&&"(unhealthy)"]},s.type))]})]})]})]}),e.jsx(se,{onClick:V,disabled:!o.trim()||b.isPending,className:"w-full",children:b.isPending?"Executing...":"Execute Task"})]})]}),e.jsxs(r,{children:[e.jsxs(n,{children:[e.jsx(c,{children:"Execution Result"}),e.jsx(N,{children:t?"Last execution result":"Execute a task to see results"})]}),e.jsx(d,{children:t?e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx(i,{variant:t.success?"default":"destructive",children:t.success?"Success":"Failed"}),t.agent&&e.jsxs(i,{variant:"outline",className:"gap-1",children:[e.jsx(ne,{className:"h-3 w-3"}),t.agent]}),t.workflow&&e.jsx(i,{variant:"secondary",children:t.workflow}),t.cost!==void 0&&t.cost>0&&e.jsxs(i,{variant:"outline",className:"gap-1 text-emerald-600 border-emerald-200 bg-emerald-50 dark:bg-emerald-950/20 dark:border-emerald-800 dark:text-emerald-400",children:[e.jsx(F,{className:"h-3 w-3"}),t.cost<.001?`$${(t.cost*1e3).toFixed(3)}m`:`$${t.cost.toFixed(4)}`]})]}),(t.model??t.provider)&&e.jsxs("div",{className:"rounded-lg bg-muted/50 border border-border/50 p-3 space-y-1",children:[e.jsx("div",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:"Model Used"}),e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[t.model&&e.jsx("span",{className:"text-sm font-mono font-medium",children:t.model}),t.provider&&e.jsx(i,{variant:"secondary",className:"text-xs",children:t.provider})]})]}),t.routing&&e.jsxs("div",{className:"rounded-lg bg-muted p-3 space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(le,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("div",{className:"text-sm font-medium",children:"Routing Decision"}),t.routing.tier&&e.jsx(i,{variant:"outline",className:"text-xs ml-auto",children:t.routing.tier})]}),e.jsx("div",{className:"text-sm text-muted-foreground",children:t.routing.reason}),t.routing.savingsPercent!==void 0&&t.routing.savingsPercent>0&&e.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-emerald-600 dark:text-emerald-400 font-medium",children:[e.jsx(F,{className:"h-3 w-3"}),"Saved ",t.routing.savingsPercent.toFixed(0),"% vs default routing"]}),t.routing.scores.length>0&&e.jsxs("div",{className:"mt-2 space-y-1",children:[e.jsx("div",{className:"text-xs font-medium",children:"Scores:"}),t.routing.scores.map(s=>e.jsxs("div",{className:"flex justify-between text-xs",children:[e.jsx("span",{children:s.agent}),e.jsx("span",{className:"font-mono",children:s.score.toFixed(1)})]},s.agent))]})]}),t.metrics&&e.jsxs("div",{className:"grid grid-cols-3 gap-2 text-center",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-xs text-muted-foreground",children:"Total"}),e.jsxs("div",{className:"font-mono text-sm",children:[(t.metrics.totalDuration/1e3).toFixed(2),"s"]})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs text-muted-foreground",children:"Routing"}),e.jsxs("div",{className:"font-mono text-sm",children:[t.metrics.routingDuration,"ms"]})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs text-muted-foreground",children:"Execution"}),e.jsxs("div",{className:"font-mono text-sm",children:[(t.metrics.executionDuration/1e3).toFixed(2),"s"]})]})]}),t.error&&e.jsx("div",{className:"rounded-lg bg-destructive/10 p-3 text-sm text-destructive",children:t.error})]}):e.jsx("div",{className:"flex h-32 items-center justify-center text-muted-foreground",children:"No execution yet"})})]})]}),e.jsxs(r,{children:[e.jsxs(n,{children:[e.jsx(c,{children:"Available Agents"}),e.jsx(N,{children:"Agents registered with the gateway for task execution"})]}),e.jsx(d,{children:I?e.jsx("div",{className:"text-muted-foreground",children:"Loading agents..."}):x.length===0?e.jsx("div",{className:"text-muted-foreground",children:"No agents available"}):e.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:x.map(s=>e.jsxs("div",{className:"rounded-lg bg-card/50 shadow-sm p-4 space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{className:"font-medium",children:s.name}),e.jsx(i,{variant:s.health.healthy?"default":"destructive",children:s.health.healthy?"Healthy":"Unhealthy"})]}),e.jsx("div",{className:"text-sm text-muted-foreground",children:s.description}),e.jsxs("div",{className:"flex flex-wrap gap-1",children:[s.capabilities.slice(0,4).map(l=>e.jsx(i,{variant:"outline",className:"text-xs",children:l},l)),s.capabilities.length>4&&e.jsxs(i,{variant:"outline",className:"text-xs",children:["+",s.capabilities.length-4]})]}),s.health.latencyMs!==void 0&&e.jsxs("div",{className:"text-xs text-muted-foreground",children:["Latency: ",s.health.latencyMs,"ms"]})]},s.type))})})]}),e.jsxs(r,{children:[e.jsxs(n,{children:[e.jsx(c,{children:"Workflow Templates"}),e.jsx(N,{children:"Pre-defined workflows for common task types"})]}),e.jsx(d,{children:W?e.jsx("div",{className:"text-muted-foreground",children:"Loading workflows..."}):g.length===0?e.jsx("div",{className:"text-muted-foreground",children:"No workflows available"}):e.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:g.map(s=>e.jsxs("div",{className:"rounded-lg bg-card/50 shadow-sm p-4 space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{className:"font-medium",children:s.name}),e.jsxs(i,{variant:"secondary",children:[s.steps," steps"]})]}),e.jsx("div",{className:"text-sm text-muted-foreground",children:s.description}),e.jsx("div",{className:"flex flex-wrap gap-1",children:s.requiredCapabilities.map(l=>e.jsx(i,{variant:"outline",className:"text-xs",children:l},l))}),s.defaultTimeoutMs&&e.jsxs("div",{className:"text-xs text-muted-foreground",children:["Timeout: ",Math.round(s.defaultTimeoutMs/1e3/60),"min"]})]},s.type))})})]})]})}export{we as GatewayDashboard};