profclaw 0.0.1-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (942) hide show
  1. package/.env.example +215 -0
  2. package/CHANGELOG.md +49 -0
  3. package/CONTRIBUTING.md +119 -0
  4. package/Dockerfile +107 -0
  5. package/LICENSE +661 -0
  6. package/README.md +196 -0
  7. package/config/agents.yml +55 -0
  8. package/config/budget.yml +15 -0
  9. package/config/pricing.yml +46 -0
  10. package/config/settings.yml +168 -0
  11. package/dist/adapters/claude-code.d.ts +46 -0
  12. package/dist/adapters/claude-code.js +215 -0
  13. package/dist/adapters/index.d.ts +4 -0
  14. package/dist/adapters/index.js +4 -0
  15. package/dist/adapters/ollama.d.ts +45 -0
  16. package/dist/adapters/ollama.js +277 -0
  17. package/dist/adapters/openclaw.d.ts +60 -0
  18. package/dist/adapters/openclaw.js +289 -0
  19. package/dist/adapters/registry.d.ts +56 -0
  20. package/dist/adapters/registry.js +163 -0
  21. package/dist/agents/executor.d.ts +78 -0
  22. package/dist/agents/executor.js +657 -0
  23. package/dist/agents/index.d.ts +10 -0
  24. package/dist/agents/index.js +27 -0
  25. package/dist/agents/stop-conditions.d.ts +108 -0
  26. package/dist/agents/stop-conditions.js +299 -0
  27. package/dist/agents/types.d.ts +185 -0
  28. package/dist/agents/types.js +14 -0
  29. package/dist/ai/embedding-service.d.ts +96 -0
  30. package/dist/ai/embedding-service.js +333 -0
  31. package/dist/auth/api-tokens.d.ts +71 -0
  32. package/dist/auth/api-tokens.js +235 -0
  33. package/dist/auth/auth-service.d.ts +75 -0
  34. package/dist/auth/auth-service.js +557 -0
  35. package/dist/auth/device-identity.d.ts +96 -0
  36. package/dist/auth/device-identity.js +250 -0
  37. package/dist/auth/github-oauth.d.ts +20 -0
  38. package/dist/auth/github-oauth.js +59 -0
  39. package/dist/auth/jira-oauth.d.ts +25 -0
  40. package/dist/auth/jira-oauth.js +75 -0
  41. package/dist/auth/linear-oauth.d.ts +21 -0
  42. package/dist/auth/linear-oauth.js +59 -0
  43. package/dist/auth/middleware.d.ts +44 -0
  44. package/dist/auth/middleware.js +190 -0
  45. package/dist/auth/pairing-codes.d.ts +109 -0
  46. package/dist/auth/pairing-codes.js +274 -0
  47. package/dist/auth/password.d.ts +53 -0
  48. package/dist/auth/password.js +126 -0
  49. package/dist/auth/qr-pairing.d.ts +36 -0
  50. package/dist/auth/qr-pairing.js +138 -0
  51. package/dist/auth/slack-oauth.d.ts +31 -0
  52. package/dist/auth/slack-oauth.js +80 -0
  53. package/dist/backup/index.d.ts +50 -0
  54. package/dist/backup/index.js +184 -0
  55. package/dist/browser/adapters.d.ts +25 -0
  56. package/dist/browser/adapters.js +32 -0
  57. package/dist/browser/cli.d.ts +19 -0
  58. package/dist/browser/cli.js +277 -0
  59. package/dist/browser/compression.d.ts +32 -0
  60. package/dist/browser/compression.js +269 -0
  61. package/dist/browser/extensions.d.ts +144 -0
  62. package/dist/browser/extensions.js +251 -0
  63. package/dist/browser/index.d.ts +37 -0
  64. package/dist/browser/index.js +43 -0
  65. package/dist/browser/refs.d.ts +46 -0
  66. package/dist/browser/refs.js +120 -0
  67. package/dist/browser/search.d.ts +36 -0
  68. package/dist/browser/search.js +193 -0
  69. package/dist/browser/service.d.ts +94 -0
  70. package/dist/browser/service.js +358 -0
  71. package/dist/browser/snapshot.d.ts +19 -0
  72. package/dist/browser/snapshot.js +250 -0
  73. package/dist/browser/tools.d.ts +259 -0
  74. package/dist/browser/tools.js +463 -0
  75. package/dist/browser/types.d.ts +134 -0
  76. package/dist/browser/types.js +17 -0
  77. package/dist/chat/agentic-executor.d.ts +108 -0
  78. package/dist/chat/agentic-executor.js +739 -0
  79. package/dist/chat/api-key-detector.d.ts +41 -0
  80. package/dist/chat/api-key-detector.js +290 -0
  81. package/dist/chat/auto-reply.d.ts +90 -0
  82. package/dist/chat/auto-reply.js +272 -0
  83. package/dist/chat/conversations.d.ts +91 -0
  84. package/dist/chat/conversations.js +297 -0
  85. package/dist/chat/execution/audit.d.ts +192 -0
  86. package/dist/chat/execution/audit.js +323 -0
  87. package/dist/chat/execution/executor.d.ts +56 -0
  88. package/dist/chat/execution/executor.js +654 -0
  89. package/dist/chat/execution/guardrails.d.ts +98 -0
  90. package/dist/chat/execution/guardrails.js +571 -0
  91. package/dist/chat/execution/index.d.ts +61 -0
  92. package/dist/chat/execution/index.js +129 -0
  93. package/dist/chat/execution/model-capability.d.ts +34 -0
  94. package/dist/chat/execution/model-capability.js +96 -0
  95. package/dist/chat/execution/process-pool.d.ts +110 -0
  96. package/dist/chat/execution/process-pool.js +290 -0
  97. package/dist/chat/execution/pty.d.ts +92 -0
  98. package/dist/chat/execution/pty.js +285 -0
  99. package/dist/chat/execution/rate-limiter.d.ts +87 -0
  100. package/dist/chat/execution/rate-limiter.js +305 -0
  101. package/dist/chat/execution/registry.d.ts +54 -0
  102. package/dist/chat/execution/registry.js +220 -0
  103. package/dist/chat/execution/sandbox.d.ts +109 -0
  104. package/dist/chat/execution/sandbox.js +684 -0
  105. package/dist/chat/execution/secrets.d.ts +45 -0
  106. package/dist/chat/execution/secrets.js +338 -0
  107. package/dist/chat/execution/security.d.ts +179 -0
  108. package/dist/chat/execution/security.js +739 -0
  109. package/dist/chat/execution/self-correction.d.ts +162 -0
  110. package/dist/chat/execution/self-correction.js +557 -0
  111. package/dist/chat/execution/session-manager.d.ts +79 -0
  112. package/dist/chat/execution/session-manager.js +356 -0
  113. package/dist/chat/execution/session-spawn/config.d.ts +37 -0
  114. package/dist/chat/execution/session-spawn/config.js +83 -0
  115. package/dist/chat/execution/session-spawn/index.d.ts +10 -0
  116. package/dist/chat/execution/session-spawn/index.js +10 -0
  117. package/dist/chat/execution/session-spawn/manager.d.ts +35 -0
  118. package/dist/chat/execution/session-spawn/manager.js +418 -0
  119. package/dist/chat/execution/session-spawn/types.d.ts +117 -0
  120. package/dist/chat/execution/session-spawn/types.js +16 -0
  121. package/dist/chat/execution/smart-prompts.d.ts +34 -0
  122. package/dist/chat/execution/smart-prompts.js +151 -0
  123. package/dist/chat/execution/stream-results.d.ts +65 -0
  124. package/dist/chat/execution/stream-results.js +156 -0
  125. package/dist/chat/execution/tool-router.d.ts +76 -0
  126. package/dist/chat/execution/tool-router.js +296 -0
  127. package/dist/chat/execution/tools/agents-list.d.ts +49 -0
  128. package/dist/chat/execution/tools/agents-list.js +165 -0
  129. package/dist/chat/execution/tools/browser.d.ts +12 -0
  130. package/dist/chat/execution/tools/browser.js +14 -0
  131. package/dist/chat/execution/tools/canvas.d.ts +61 -0
  132. package/dist/chat/execution/tools/canvas.js +150 -0
  133. package/dist/chat/execution/tools/complete-task.d.ts +72 -0
  134. package/dist/chat/execution/tools/complete-task.js +104 -0
  135. package/dist/chat/execution/tools/cron-tool.d.ts +204 -0
  136. package/dist/chat/execution/tools/cron-tool.js +680 -0
  137. package/dist/chat/execution/tools/discord-actions.d.ts +120 -0
  138. package/dist/chat/execution/tools/discord-actions.js +361 -0
  139. package/dist/chat/execution/tools/exec.d.ts +43 -0
  140. package/dist/chat/execution/tools/exec.js +223 -0
  141. package/dist/chat/execution/tools/file-ops.d.ts +175 -0
  142. package/dist/chat/execution/tools/file-ops.js +723 -0
  143. package/dist/chat/execution/tools/git.d.ts +143 -0
  144. package/dist/chat/execution/tools/git.js +395 -0
  145. package/dist/chat/execution/tools/github.d.ts +42 -0
  146. package/dist/chat/execution/tools/github.js +184 -0
  147. package/dist/chat/execution/tools/glinr-ops.d.ts +202 -0
  148. package/dist/chat/execution/tools/glinr-ops.js +694 -0
  149. package/dist/chat/execution/tools/image-analyze.d.ts +29 -0
  150. package/dist/chat/execution/tools/image-analyze.js +127 -0
  151. package/dist/chat/execution/tools/index.d.ts +64 -0
  152. package/dist/chat/execution/tools/index.js +245 -0
  153. package/dist/chat/execution/tools/integrations.d.ts +109 -0
  154. package/dist/chat/execution/tools/integrations.js +237 -0
  155. package/dist/chat/execution/tools/link-understand.d.ts +34 -0
  156. package/dist/chat/execution/tools/link-understand.js +307 -0
  157. package/dist/chat/execution/tools/maintenance.d.ts +29 -0
  158. package/dist/chat/execution/tools/maintenance.js +105 -0
  159. package/dist/chat/execution/tools/memory-tools.d.ts +76 -0
  160. package/dist/chat/execution/tools/memory-tools.js +278 -0
  161. package/dist/chat/execution/tools/openai-image-gen.d.ts +51 -0
  162. package/dist/chat/execution/tools/openai-image-gen.js +212 -0
  163. package/dist/chat/execution/tools/profclaw-ops.d.ts +204 -0
  164. package/dist/chat/execution/tools/profclaw-ops.js +665 -0
  165. package/dist/chat/execution/tools/session-spawn.d.ts +146 -0
  166. package/dist/chat/execution/tools/session-spawn.js +544 -0
  167. package/dist/chat/execution/tools/session-status.d.ts +38 -0
  168. package/dist/chat/execution/tools/session-status.js +185 -0
  169. package/dist/chat/execution/tools/sessions-list.d.ts +49 -0
  170. package/dist/chat/execution/tools/sessions-list.js +153 -0
  171. package/dist/chat/execution/tools/sessions-send.d.ts +48 -0
  172. package/dist/chat/execution/tools/sessions-send.js +207 -0
  173. package/dist/chat/execution/tools/sessions-spawn.d.ts +51 -0
  174. package/dist/chat/execution/tools/sessions-spawn.js +137 -0
  175. package/dist/chat/execution/tools/slack-actions.d.ts +90 -0
  176. package/dist/chat/execution/tools/slack-actions.js +272 -0
  177. package/dist/chat/execution/tools/subagent-orchestrate.d.ts +66 -0
  178. package/dist/chat/execution/tools/subagent-orchestrate.js +313 -0
  179. package/dist/chat/execution/tools/system.d.ts +121 -0
  180. package/dist/chat/execution/tools/system.js +415 -0
  181. package/dist/chat/execution/tools/telegram-actions.d.ts +126 -0
  182. package/dist/chat/execution/tools/telegram-actions.js +339 -0
  183. package/dist/chat/execution/tools/test-run.d.ts +43 -0
  184. package/dist/chat/execution/tools/test-run.js +391 -0
  185. package/dist/chat/execution/tools/tts-speak.d.ts +39 -0
  186. package/dist/chat/execution/tools/tts-speak.js +199 -0
  187. package/dist/chat/execution/tools/web-fetch.d.ts +42 -0
  188. package/dist/chat/execution/tools/web-fetch.js +247 -0
  189. package/dist/chat/execution/tools/web-search.d.ts +53 -0
  190. package/dist/chat/execution/tools/web-search.js +130 -0
  191. package/dist/chat/execution/types.d.ts +337 -0
  192. package/dist/chat/execution/types.js +8 -0
  193. package/dist/chat/execution/workflows/built-in.d.ts +10 -0
  194. package/dist/chat/execution/workflows/built-in.js +249 -0
  195. package/dist/chat/execution/workflows/executor.d.ts +13 -0
  196. package/dist/chat/execution/workflows/executor.js +259 -0
  197. package/dist/chat/execution/workflows/index.d.ts +5 -0
  198. package/dist/chat/execution/workflows/index.js +5 -0
  199. package/dist/chat/execution/workflows/trigger.d.ts +15 -0
  200. package/dist/chat/execution/workflows/trigger.js +111 -0
  201. package/dist/chat/execution/workflows/types.d.ts +80 -0
  202. package/dist/chat/execution/workflows/types.js +2 -0
  203. package/dist/chat/failover/error.d.ts +73 -0
  204. package/dist/chat/failover/error.js +412 -0
  205. package/dist/chat/failover/index.d.ts +10 -0
  206. package/dist/chat/failover/index.js +11 -0
  207. package/dist/chat/failover/model-fallback.d.ts +97 -0
  208. package/dist/chat/failover/model-fallback.js +328 -0
  209. package/dist/chat/failover/types.d.ts +47 -0
  210. package/dist/chat/failover/types.js +8 -0
  211. package/dist/chat/format/chunk.d.ts +59 -0
  212. package/dist/chat/format/chunk.js +253 -0
  213. package/dist/chat/format/index.d.ts +7 -0
  214. package/dist/chat/format/index.js +7 -0
  215. package/dist/chat/format/tool-result-formatter.d.ts +30 -0
  216. package/dist/chat/format/tool-result-formatter.js +177 -0
  217. package/dist/chat/group.d.ts +232 -0
  218. package/dist/chat/group.js +311 -0
  219. package/dist/chat/index.d.ts +21 -0
  220. package/dist/chat/index.js +30 -0
  221. package/dist/chat/memory.d.ts +108 -0
  222. package/dist/chat/memory.js +343 -0
  223. package/dist/chat/message-handler.d.ts +38 -0
  224. package/dist/chat/message-handler.js +274 -0
  225. package/dist/chat/proactive/index.d.ts +167 -0
  226. package/dist/chat/proactive/index.js +721 -0
  227. package/dist/chat/prompt-adapter.d.ts +52 -0
  228. package/dist/chat/prompt-adapter.js +245 -0
  229. package/dist/chat/providers/dingtalk/index.d.ts +69 -0
  230. package/dist/chat/providers/dingtalk/index.js +225 -0
  231. package/dist/chat/providers/discord/index.d.ts +264 -0
  232. package/dist/chat/providers/discord/index.js +657 -0
  233. package/dist/chat/providers/feishu/index.d.ts +97 -0
  234. package/dist/chat/providers/feishu/index.js +362 -0
  235. package/dist/chat/providers/googlechat/index.d.ts +269 -0
  236. package/dist/chat/providers/googlechat/index.js +634 -0
  237. package/dist/chat/providers/imessage/index.d.ts +61 -0
  238. package/dist/chat/providers/imessage/index.js +166 -0
  239. package/dist/chat/providers/index.d.ts +76 -0
  240. package/dist/chat/providers/index.js +430 -0
  241. package/dist/chat/providers/irc/index.d.ts +101 -0
  242. package/dist/chat/providers/irc/index.js +557 -0
  243. package/dist/chat/providers/line/index.d.ts +113 -0
  244. package/dist/chat/providers/line/index.js +434 -0
  245. package/dist/chat/providers/matrix/index.d.ts +161 -0
  246. package/dist/chat/providers/matrix/index.js +559 -0
  247. package/dist/chat/providers/mattermost/index.d.ts +106 -0
  248. package/dist/chat/providers/mattermost/index.js +425 -0
  249. package/dist/chat/providers/msteams/index.d.ts +198 -0
  250. package/dist/chat/providers/msteams/index.js +694 -0
  251. package/dist/chat/providers/nextcloud/index.d.ts +52 -0
  252. package/dist/chat/providers/nextcloud/index.js +156 -0
  253. package/dist/chat/providers/nostr/index.d.ts +60 -0
  254. package/dist/chat/providers/nostr/index.js +200 -0
  255. package/dist/chat/providers/qq/index.d.ts +57 -0
  256. package/dist/chat/providers/qq/index.js +260 -0
  257. package/dist/chat/providers/registry.d.ts +89 -0
  258. package/dist/chat/providers/registry.js +213 -0
  259. package/dist/chat/providers/signal/index.d.ts +88 -0
  260. package/dist/chat/providers/signal/index.js +357 -0
  261. package/dist/chat/providers/slack/index.d.ts +52 -0
  262. package/dist/chat/providers/slack/index.js +477 -0
  263. package/dist/chat/providers/synology/index.d.ts +50 -0
  264. package/dist/chat/providers/synology/index.js +138 -0
  265. package/dist/chat/providers/telegram/index.d.ts +148 -0
  266. package/dist/chat/providers/telegram/index.js +492 -0
  267. package/dist/chat/providers/tlon/index.d.ts +44 -0
  268. package/dist/chat/providers/tlon/index.js +243 -0
  269. package/dist/chat/providers/twitch/index.d.ts +79 -0
  270. package/dist/chat/providers/twitch/index.js +349 -0
  271. package/dist/chat/providers/types.d.ts +437 -0
  272. package/dist/chat/providers/types.js +14 -0
  273. package/dist/chat/providers/webchat/index.d.ts +38 -0
  274. package/dist/chat/providers/webchat/index.js +214 -0
  275. package/dist/chat/providers/wecom/index.d.ts +62 -0
  276. package/dist/chat/providers/wecom/index.js +228 -0
  277. package/dist/chat/providers/whatsapp/index.d.ts +147 -0
  278. package/dist/chat/providers/whatsapp/index.js +396 -0
  279. package/dist/chat/providers/zalo/index.d.ts +54 -0
  280. package/dist/chat/providers/zalo/index.js +158 -0
  281. package/dist/chat/providers/zalo-personal/index.d.ts +53 -0
  282. package/dist/chat/providers/zalo-personal/index.js +212 -0
  283. package/dist/chat/skills.d.ts +82 -0
  284. package/dist/chat/skills.js +410 -0
  285. package/dist/chat/system-prompts.d.ts +76 -0
  286. package/dist/chat/system-prompts.js +407 -0
  287. package/dist/chat/tool-handler.d.ts +57 -0
  288. package/dist/chat/tool-handler.js +336 -0
  289. package/dist/chat/tools.d.ts +373 -0
  290. package/dist/chat/tools.js +512 -0
  291. package/dist/cli/commands/agent.d.ts +3 -0
  292. package/dist/cli/commands/agent.js +108 -0
  293. package/dist/cli/commands/auth.d.ts +12 -0
  294. package/dist/cli/commands/auth.js +301 -0
  295. package/dist/cli/commands/browser.d.ts +3 -0
  296. package/dist/cli/commands/browser.js +138 -0
  297. package/dist/cli/commands/canvas.d.ts +3 -0
  298. package/dist/cli/commands/canvas.js +155 -0
  299. package/dist/cli/commands/channels.d.ts +3 -0
  300. package/dist/cli/commands/channels.js +167 -0
  301. package/dist/cli/commands/chat.d.ts +9 -0
  302. package/dist/cli/commands/chat.js +360 -0
  303. package/dist/cli/commands/completion.d.ts +3 -0
  304. package/dist/cli/commands/completion.js +170 -0
  305. package/dist/cli/commands/config.d.ts +3 -0
  306. package/dist/cli/commands/config.js +193 -0
  307. package/dist/cli/commands/cost.d.ts +3 -0
  308. package/dist/cli/commands/cost.js +134 -0
  309. package/dist/cli/commands/daemon.d.ts +3 -0
  310. package/dist/cli/commands/daemon.js +381 -0
  311. package/dist/cli/commands/devices.d.ts +3 -0
  312. package/dist/cli/commands/devices.js +150 -0
  313. package/dist/cli/commands/doctor.d.ts +3 -0
  314. package/dist/cli/commands/doctor.js +295 -0
  315. package/dist/cli/commands/logs.d.ts +3 -0
  316. package/dist/cli/commands/logs.js +139 -0
  317. package/dist/cli/commands/mcp.d.ts +15 -0
  318. package/dist/cli/commands/mcp.js +157 -0
  319. package/dist/cli/commands/memory.d.ts +3 -0
  320. package/dist/cli/commands/memory.js +170 -0
  321. package/dist/cli/commands/models.d.ts +3 -0
  322. package/dist/cli/commands/models.js +197 -0
  323. package/dist/cli/commands/nodes.d.ts +3 -0
  324. package/dist/cli/commands/nodes.js +193 -0
  325. package/dist/cli/commands/onboard.d.ts +13 -0
  326. package/dist/cli/commands/onboard.js +360 -0
  327. package/dist/cli/commands/plugin.d.ts +15 -0
  328. package/dist/cli/commands/plugin.js +226 -0
  329. package/dist/cli/commands/provider.d.ts +16 -0
  330. package/dist/cli/commands/provider.js +320 -0
  331. package/dist/cli/commands/security.d.ts +3 -0
  332. package/dist/cli/commands/security.js +180 -0
  333. package/dist/cli/commands/serve.d.ts +3 -0
  334. package/dist/cli/commands/serve.js +179 -0
  335. package/dist/cli/commands/session.d.ts +3 -0
  336. package/dist/cli/commands/session.js +172 -0
  337. package/dist/cli/commands/setup.d.ts +13 -0
  338. package/dist/cli/commands/setup.js +636 -0
  339. package/dist/cli/commands/skill.d.ts +15 -0
  340. package/dist/cli/commands/skill.js +191 -0
  341. package/dist/cli/commands/status.d.ts +3 -0
  342. package/dist/cli/commands/status.js +71 -0
  343. package/dist/cli/commands/summary.d.ts +3 -0
  344. package/dist/cli/commands/summary.js +160 -0
  345. package/dist/cli/commands/task.d.ts +3 -0
  346. package/dist/cli/commands/task.js +170 -0
  347. package/dist/cli/commands/ticket.d.ts +3 -0
  348. package/dist/cli/commands/ticket.js +421 -0
  349. package/dist/cli/commands/tools.d.ts +9 -0
  350. package/dist/cli/commands/tools.js +508 -0
  351. package/dist/cli/commands/tui.d.ts +3 -0
  352. package/dist/cli/commands/tui.js +158 -0
  353. package/dist/cli/commands/tunnel.d.ts +3 -0
  354. package/dist/cli/commands/tunnel.js +135 -0
  355. package/dist/cli/commands/webhooks.d.ts +3 -0
  356. package/dist/cli/commands/webhooks.js +191 -0
  357. package/dist/cli/index.d.ts +3 -0
  358. package/dist/cli/index.js +127 -0
  359. package/dist/cli/utils/api.d.ts +17 -0
  360. package/dist/cli/utils/api.js +63 -0
  361. package/dist/cli/utils/config.d.ts +31 -0
  362. package/dist/cli/utils/config.js +81 -0
  363. package/dist/cli/utils/output.d.ts +58 -0
  364. package/dist/cli/utils/output.js +148 -0
  365. package/dist/core/deployment.d.ts +30 -0
  366. package/dist/core/deployment.js +114 -0
  367. package/dist/core/sandbox-config.d.ts +63 -0
  368. package/dist/core/sandbox-config.js +148 -0
  369. package/dist/costs/budget.d.ts +28 -0
  370. package/dist/costs/budget.js +57 -0
  371. package/dist/costs/persistence.d.ts +77 -0
  372. package/dist/costs/persistence.js +210 -0
  373. package/dist/costs/pricing.d.ts +16 -0
  374. package/dist/costs/pricing.js +39 -0
  375. package/dist/costs/token-tracker.d.ts +34 -0
  376. package/dist/costs/token-tracker.js +141 -0
  377. package/dist/cron/heartbeat.d.ts +23 -0
  378. package/dist/cron/heartbeat.js +109 -0
  379. package/dist/cron/index.d.ts +22 -0
  380. package/dist/cron/index.js +37 -0
  381. package/dist/cron/issue-poller.d.ts +15 -0
  382. package/dist/cron/issue-poller.js +174 -0
  383. package/dist/cron/scheduler.d.ts +315 -0
  384. package/dist/cron/scheduler.js +1008 -0
  385. package/dist/cron/stale-checker.d.ts +16 -0
  386. package/dist/cron/stale-checker.js +61 -0
  387. package/dist/cron/templates.d.ts +107 -0
  388. package/dist/cron/templates.js +395 -0
  389. package/dist/diagnostics/exporters.d.ts +21 -0
  390. package/dist/diagnostics/exporters.js +138 -0
  391. package/dist/diagnostics/index.d.ts +10 -0
  392. package/dist/diagnostics/index.js +9 -0
  393. package/dist/diagnostics/middleware.d.ts +12 -0
  394. package/dist/diagnostics/middleware.js +58 -0
  395. package/dist/diagnostics/tracer.d.ts +133 -0
  396. package/dist/diagnostics/tracer.js +257 -0
  397. package/dist/discovery/index.d.ts +8 -0
  398. package/dist/discovery/index.js +7 -0
  399. package/dist/discovery/mdns.d.ts +40 -0
  400. package/dist/discovery/mdns.js +249 -0
  401. package/dist/gateway/index.d.ts +35 -0
  402. package/dist/gateway/index.js +36 -0
  403. package/dist/gateway/router.d.ts +110 -0
  404. package/dist/gateway/router.js +649 -0
  405. package/dist/gateway/types.d.ts +275 -0
  406. package/dist/gateway/types.js +2 -0
  407. package/dist/gateway/workflows.d.ts +37 -0
  408. package/dist/gateway/workflows.js +748 -0
  409. package/dist/hooks/agent-webhook.d.ts +277 -0
  410. package/dist/hooks/agent-webhook.js +197 -0
  411. package/dist/hooks/index.d.ts +13 -0
  412. package/dist/hooks/index.js +15 -0
  413. package/dist/hooks/prompt-submit.d.ts +45 -0
  414. package/dist/hooks/prompt-submit.js +111 -0
  415. package/dist/hooks/schemas.d.ts +563 -0
  416. package/dist/hooks/schemas.js +108 -0
  417. package/dist/hooks/session-end.d.ts +25 -0
  418. package/dist/hooks/session-end.js +153 -0
  419. package/dist/hooks/tool-use.d.ts +41 -0
  420. package/dist/hooks/tool-use.js +201 -0
  421. package/dist/hooks/types.d.ts +76 -0
  422. package/dist/hooks/types.js +7 -0
  423. package/dist/integrations/cloudflare-tunnel.d.ts +78 -0
  424. package/dist/integrations/cloudflare-tunnel.js +268 -0
  425. package/dist/integrations/github-client.d.ts +27 -0
  426. package/dist/integrations/github-client.js +79 -0
  427. package/dist/integrations/github-projects.d.ts +97 -0
  428. package/dist/integrations/github-projects.js +433 -0
  429. package/dist/integrations/github-ticket-sync.d.ts +82 -0
  430. package/dist/integrations/github-ticket-sync.js +352 -0
  431. package/dist/integrations/github.d.ts +11 -0
  432. package/dist/integrations/github.js +241 -0
  433. package/dist/integrations/jira-client.d.ts +30 -0
  434. package/dist/integrations/jira-client.js +67 -0
  435. package/dist/integrations/jira.d.ts +13 -0
  436. package/dist/integrations/jira.js +108 -0
  437. package/dist/integrations/linear-client.d.ts +23 -0
  438. package/dist/integrations/linear-client.js +52 -0
  439. package/dist/integrations/linear.d.ts +15 -0
  440. package/dist/integrations/linear.js +312 -0
  441. package/dist/integrations/tailscale.d.ts +68 -0
  442. package/dist/integrations/tailscale.js +173 -0
  443. package/dist/integrations/web-search.d.ts +112 -0
  444. package/dist/integrations/web-search.js +287 -0
  445. package/dist/intelligence/index.d.ts +8 -0
  446. package/dist/intelligence/index.js +8 -0
  447. package/dist/intelligence/ollama.d.ts +50 -0
  448. package/dist/intelligence/ollama.js +213 -0
  449. package/dist/intelligence/rules.d.ts +39 -0
  450. package/dist/intelligence/rules.js +308 -0
  451. package/dist/labels/index.d.ts +93 -0
  452. package/dist/labels/index.js +248 -0
  453. package/dist/mcp/browser-tools.d.ts +10 -0
  454. package/dist/mcp/browser-tools.js +16 -0
  455. package/dist/mcp/client.d.ts +54 -0
  456. package/dist/mcp/client.js +153 -0
  457. package/dist/mcp/index.d.ts +12 -0
  458. package/dist/mcp/index.js +13 -0
  459. package/dist/mcp/server.d.ts +40 -0
  460. package/dist/mcp/server.js +826 -0
  461. package/dist/mcp/tool-adapter.d.ts +49 -0
  462. package/dist/mcp/tool-adapter.js +193 -0
  463. package/dist/memory/experience-store.d.ts +121 -0
  464. package/dist/memory/experience-store.js +439 -0
  465. package/dist/memory/index.d.ts +8 -0
  466. package/dist/memory/index.js +25 -0
  467. package/dist/memory/memory-service.d.ts +312 -0
  468. package/dist/memory/memory-service.js +1172 -0
  469. package/dist/memory/memory-watcher.d.ts +116 -0
  470. package/dist/memory/memory-watcher.js +239 -0
  471. package/dist/middleware/logging.d.ts +34 -0
  472. package/dist/middleware/logging.js +184 -0
  473. package/dist/middleware/rate-limit.d.ts +29 -0
  474. package/dist/middleware/rate-limit.js +91 -0
  475. package/dist/notifications/in-app.d.ts +28 -0
  476. package/dist/notifications/in-app.js +53 -0
  477. package/dist/notifications/index.d.ts +3 -0
  478. package/dist/notifications/index.js +3 -0
  479. package/dist/notifications/push.d.ts +74 -0
  480. package/dist/notifications/push.js +175 -0
  481. package/dist/notifications/slack.d.ts +32 -0
  482. package/dist/notifications/slack.js +157 -0
  483. package/dist/plugins/clawhub.d.ts +70 -0
  484. package/dist/plugins/clawhub.js +260 -0
  485. package/dist/plugins/loader.d.ts +23 -0
  486. package/dist/plugins/loader.js +140 -0
  487. package/dist/plugins/marketplace.d.ts +77 -0
  488. package/dist/plugins/marketplace.js +275 -0
  489. package/dist/plugins/registry.d.ts +122 -0
  490. package/dist/plugins/registry.js +352 -0
  491. package/dist/plugins/sandbox.d.ts +77 -0
  492. package/dist/plugins/sandbox.js +287 -0
  493. package/dist/plugins/scaffolder.d.ts +28 -0
  494. package/dist/plugins/scaffolder.js +409 -0
  495. package/dist/plugins/sdk.d.ts +35 -0
  496. package/dist/plugins/sdk.js +8 -0
  497. package/dist/plugins/search/brave.d.ts +9 -0
  498. package/dist/plugins/search/brave.js +157 -0
  499. package/dist/plugins/search/duckduckgo.d.ts +9 -0
  500. package/dist/plugins/search/duckduckgo.js +171 -0
  501. package/dist/plugins/search/index.d.ts +13 -0
  502. package/dist/plugins/search/index.js +23 -0
  503. package/dist/plugins/search/searxng.d.ts +9 -0
  504. package/dist/plugins/search/searxng.js +170 -0
  505. package/dist/plugins/search/serper.d.ts +9 -0
  506. package/dist/plugins/search/serper.js +135 -0
  507. package/dist/plugins/search/tavily.d.ts +9 -0
  508. package/dist/plugins/search/tavily.js +146 -0
  509. package/dist/plugins/types.d.ts +174 -0
  510. package/dist/plugins/types.js +8 -0
  511. package/dist/projects/index.d.ts +133 -0
  512. package/dist/projects/index.js +897 -0
  513. package/dist/projects/types.d.ts +444 -0
  514. package/dist/projects/types.js +207 -0
  515. package/dist/providers/adapters/anthropic.d.ts +26 -0
  516. package/dist/providers/adapters/anthropic.js +306 -0
  517. package/dist/providers/adapters/base.d.ts +53 -0
  518. package/dist/providers/adapters/base.js +99 -0
  519. package/dist/providers/adapters/ollama.d.ts +30 -0
  520. package/dist/providers/adapters/ollama.js +292 -0
  521. package/dist/providers/ai-sdk.d.ts +178 -0
  522. package/dist/providers/ai-sdk.js +1552 -0
  523. package/dist/providers/core/index.d.ts +8 -0
  524. package/dist/providers/core/index.js +10 -0
  525. package/dist/providers/core/models.d.ts +31 -0
  526. package/dist/providers/core/models.js +949 -0
  527. package/dist/providers/core/types.d.ts +117 -0
  528. package/dist/providers/core/types.js +83 -0
  529. package/dist/providers/index.d.ts +7 -0
  530. package/dist/providers/index.js +7 -0
  531. package/dist/providers/registry.d.ts +93 -0
  532. package/dist/providers/registry.js +228 -0
  533. package/dist/providers/schema-utils.d.ts +23 -0
  534. package/dist/providers/schema-utils.js +545 -0
  535. package/dist/providers/types.d.ts +609 -0
  536. package/dist/providers/types.js +279 -0
  537. package/dist/queue/failure-handler.d.ts +93 -0
  538. package/dist/queue/failure-handler.js +379 -0
  539. package/dist/queue/index.d.ts +23 -0
  540. package/dist/queue/index.js +86 -0
  541. package/dist/queue/memory-queue.d.ts +30 -0
  542. package/dist/queue/memory-queue.js +429 -0
  543. package/dist/queue/notifications.d.ts +6 -0
  544. package/dist/queue/notifications.js +128 -0
  545. package/dist/queue/task-queue.d.ts +55 -0
  546. package/dist/queue/task-queue.js +518 -0
  547. package/dist/queue/webhook-queue.d.ts +47 -0
  548. package/dist/queue/webhook-queue.js +158 -0
  549. package/dist/routes/agents.d.ts +4 -0
  550. package/dist/routes/agents.js +45 -0
  551. package/dist/routes/auth.d.ts +19 -0
  552. package/dist/routes/auth.js +492 -0
  553. package/dist/routes/backup.d.ts +6 -0
  554. package/dist/routes/backup.js +71 -0
  555. package/dist/routes/chat.d.ts +10 -0
  556. package/dist/routes/chat.js +1678 -0
  557. package/dist/routes/clawhub.d.ts +8 -0
  558. package/dist/routes/clawhub.js +89 -0
  559. package/dist/routes/costs.d.ts +4 -0
  560. package/dist/routes/costs.js +78 -0
  561. package/dist/routes/cron.d.ts +11 -0
  562. package/dist/routes/cron.js +708 -0
  563. package/dist/routes/devices.d.ts +9 -0
  564. package/dist/routes/devices.js +490 -0
  565. package/dist/routes/discord.d.ts +15 -0
  566. package/dist/routes/discord.js +524 -0
  567. package/dist/routes/dlq.d.ts +4 -0
  568. package/dist/routes/dlq.js +64 -0
  569. package/dist/routes/gateway.d.ts +4 -0
  570. package/dist/routes/gateway.js +253 -0
  571. package/dist/routes/health.d.ts +29 -0
  572. package/dist/routes/health.js +296 -0
  573. package/dist/routes/hooks.d.ts +4 -0
  574. package/dist/routes/hooks.js +170 -0
  575. package/dist/routes/import.d.ts +9 -0
  576. package/dist/routes/import.js +540 -0
  577. package/dist/routes/index.d.ts +38 -0
  578. package/dist/routes/index.js +39 -0
  579. package/dist/routes/integrations.d.ts +10 -0
  580. package/dist/routes/integrations.js +200 -0
  581. package/dist/routes/labels.d.ts +8 -0
  582. package/dist/routes/labels.js +240 -0
  583. package/dist/routes/mcp.d.ts +14 -0
  584. package/dist/routes/mcp.js +125 -0
  585. package/dist/routes/memory.d.ts +10 -0
  586. package/dist/routes/memory.js +622 -0
  587. package/dist/routes/notifications.d.ts +9 -0
  588. package/dist/routes/notifications.js +154 -0
  589. package/dist/routes/oobe.d.ts +10 -0
  590. package/dist/routes/oobe.js +405 -0
  591. package/dist/routes/openapi.d.ts +9 -0
  592. package/dist/routes/openapi.js +537 -0
  593. package/dist/routes/plugins.d.ts +8 -0
  594. package/dist/routes/plugins.js +108 -0
  595. package/dist/routes/projects.d.ts +8 -0
  596. package/dist/routes/projects.js +592 -0
  597. package/dist/routes/push.d.ts +8 -0
  598. package/dist/routes/push.js +75 -0
  599. package/dist/routes/search.d.ts +4 -0
  600. package/dist/routes/search.js +189 -0
  601. package/dist/routes/security.d.ts +10 -0
  602. package/dist/routes/security.js +189 -0
  603. package/dist/routes/settings.d.ts +4 -0
  604. package/dist/routes/settings.js +119 -0
  605. package/dist/routes/setup.d.ts +11 -0
  606. package/dist/routes/setup.js +525 -0
  607. package/dist/routes/skills.d.ts +13 -0
  608. package/dist/routes/skills.js +152 -0
  609. package/dist/routes/slack.d.ts +12 -0
  610. package/dist/routes/slack.js +999 -0
  611. package/dist/routes/states.d.ts +8 -0
  612. package/dist/routes/states.js +123 -0
  613. package/dist/routes/stats.d.ts +6 -0
  614. package/dist/routes/stats.js +369 -0
  615. package/dist/routes/summaries.d.ts +4 -0
  616. package/dist/routes/summaries.js +344 -0
  617. package/dist/routes/sync.d.ts +13 -0
  618. package/dist/routes/sync.js +268 -0
  619. package/dist/routes/tasks.d.ts +4 -0
  620. package/dist/routes/tasks.js +473 -0
  621. package/dist/routes/telegram.d.ts +14 -0
  622. package/dist/routes/telegram.js +420 -0
  623. package/dist/routes/tickets.d.ts +4 -0
  624. package/dist/routes/tickets.js +1090 -0
  625. package/dist/routes/tokens.d.ts +4 -0
  626. package/dist/routes/tokens.js +83 -0
  627. package/dist/routes/tools.d.ts +14 -0
  628. package/dist/routes/tools.js +790 -0
  629. package/dist/routes/tunnels.d.ts +8 -0
  630. package/dist/routes/tunnels.js +145 -0
  631. package/dist/routes/users.d.ts +15 -0
  632. package/dist/routes/users.js +998 -0
  633. package/dist/routes/voice.d.ts +8 -0
  634. package/dist/routes/voice.js +127 -0
  635. package/dist/routes/webchat.d.ts +11 -0
  636. package/dist/routes/webchat.js +173 -0
  637. package/dist/routes/webhook-dedup.d.ts +11 -0
  638. package/dist/routes/webhook-dedup.js +49 -0
  639. package/dist/routes/webhooks.d.ts +4 -0
  640. package/dist/routes/webhooks.js +71 -0
  641. package/dist/routes/whatsapp.d.ts +14 -0
  642. package/dist/routes/whatsapp.js +391 -0
  643. package/dist/security/audit-scanner.d.ts +32 -0
  644. package/dist/security/audit-scanner.js +217 -0
  645. package/dist/security/fs-guard.d.ts +41 -0
  646. package/dist/security/fs-guard.js +206 -0
  647. package/dist/security/prompt-guard.d.ts +47 -0
  648. package/dist/security/prompt-guard.js +198 -0
  649. package/dist/security/ssrf-guard.d.ts +38 -0
  650. package/dist/security/ssrf-guard.js +266 -0
  651. package/dist/security/types.d.ts +92 -0
  652. package/dist/security/types.js +8 -0
  653. package/dist/server/route-loader.d.ts +15 -0
  654. package/dist/server/route-loader.js +135 -0
  655. package/dist/server.d.ts +5 -0
  656. package/dist/server.js +835 -0
  657. package/dist/settings/index.d.ts +841 -0
  658. package/dist/settings/index.js +451 -0
  659. package/dist/skills/compiler.d.ts +83 -0
  660. package/dist/skills/compiler.js +358 -0
  661. package/dist/skills/frontmatter.d.ts +33 -0
  662. package/dist/skills/frontmatter.js +175 -0
  663. package/dist/skills/index.d.ts +19 -0
  664. package/dist/skills/index.js +24 -0
  665. package/dist/skills/installer.d.ts +22 -0
  666. package/dist/skills/installer.js +220 -0
  667. package/dist/skills/loader.d.ts +72 -0
  668. package/dist/skills/loader.js +484 -0
  669. package/dist/skills/prompt-builder.d.ts +48 -0
  670. package/dist/skills/prompt-builder.js +135 -0
  671. package/dist/skills/registry.d.ts +115 -0
  672. package/dist/skills/registry.js +225 -0
  673. package/dist/skills/types.d.ts +202 -0
  674. package/dist/skills/types.js +24 -0
  675. package/dist/states/index.d.ts +64 -0
  676. package/dist/states/index.js +142 -0
  677. package/dist/storage/adapter.d.ts +146 -0
  678. package/dist/storage/adapter.js +2 -0
  679. package/dist/storage/index.d.ts +48 -0
  680. package/dist/storage/index.js +135 -0
  681. package/dist/storage/libsql.d.ts +99 -0
  682. package/dist/storage/libsql.js +1873 -0
  683. package/dist/storage/migrations.d.ts +65 -0
  684. package/dist/storage/migrations.js +289 -0
  685. package/dist/storage/schema.d.ts +10185 -0
  686. package/dist/storage/schema.js +1113 -0
  687. package/dist/summaries/extractor.d.ts +56 -0
  688. package/dist/summaries/extractor.js +377 -0
  689. package/dist/summaries/index.d.ts +13 -0
  690. package/dist/summaries/index.js +14 -0
  691. package/dist/summaries/storage.d.ts +51 -0
  692. package/dist/summaries/storage.js +101 -0
  693. package/dist/summaries/templates.d.ts +68 -0
  694. package/dist/summaries/templates.js +245 -0
  695. package/dist/sync/adapters/base.d.ts +42 -0
  696. package/dist/sync/adapters/base.js +142 -0
  697. package/dist/sync/adapters/github.d.ts +45 -0
  698. package/dist/sync/adapters/github.js +445 -0
  699. package/dist/sync/adapters/linear.d.ts +40 -0
  700. package/dist/sync/adapters/linear.js +434 -0
  701. package/dist/sync/config.d.ts +388 -0
  702. package/dist/sync/config.js +281 -0
  703. package/dist/sync/engine.d.ts +112 -0
  704. package/dist/sync/engine.js +623 -0
  705. package/dist/sync/index.d.ts +31 -0
  706. package/dist/sync/index.js +34 -0
  707. package/dist/sync/integration.d.ts +53 -0
  708. package/dist/sync/integration.js +231 -0
  709. package/dist/sync/types.d.ts +249 -0
  710. package/dist/sync/types.js +30 -0
  711. package/dist/tickets/index.d.ts +139 -0
  712. package/dist/tickets/index.js +1406 -0
  713. package/dist/tickets/types.d.ts +817 -0
  714. package/dist/tickets/types.js +310 -0
  715. package/dist/tools/adapters.d.ts +56 -0
  716. package/dist/tools/adapters.js +183 -0
  717. package/dist/tools/index.d.ts +66 -0
  718. package/dist/tools/index.js +105 -0
  719. package/dist/tools/types.d.ts +117 -0
  720. package/dist/tools/types.js +20 -0
  721. package/dist/types/agent.d.ts +101 -0
  722. package/dist/types/agent.js +2 -0
  723. package/dist/types/errors.d.ts +150 -0
  724. package/dist/types/errors.js +338 -0
  725. package/dist/types/index.d.ts +3 -0
  726. package/dist/types/index.js +3 -0
  727. package/dist/types/summary.d.ts +638 -0
  728. package/dist/types/summary.js +137 -0
  729. package/dist/types/task.d.ts +123 -0
  730. package/dist/types/task.js +46 -0
  731. package/dist/utils/ai-cache.d.ts +72 -0
  732. package/dist/utils/ai-cache.js +204 -0
  733. package/dist/utils/ai-inference.d.ts +57 -0
  734. package/dist/utils/ai-inference.js +190 -0
  735. package/dist/utils/ai-responder.d.ts +44 -0
  736. package/dist/utils/ai-responder.js +272 -0
  737. package/dist/utils/circuit-breaker.d.ts +139 -0
  738. package/dist/utils/circuit-breaker.js +281 -0
  739. package/dist/utils/config-loader.d.ts +12 -0
  740. package/dist/utils/config-loader.js +44 -0
  741. package/dist/utils/crypto.d.ts +10 -0
  742. package/dist/utils/crypto.js +59 -0
  743. package/dist/utils/env-validator.d.ts +44 -0
  744. package/dist/utils/env-validator.js +236 -0
  745. package/dist/utils/file-lock.d.ts +85 -0
  746. package/dist/utils/file-lock.js +204 -0
  747. package/dist/utils/logger.d.ts +153 -0
  748. package/dist/utils/logger.js +282 -0
  749. package/dist/utils/metrics.d.ts +183 -0
  750. package/dist/utils/metrics.js +345 -0
  751. package/dist/utils/security.d.ts +90 -0
  752. package/dist/utils/security.js +347 -0
  753. package/dist/voice/index.d.ts +79 -0
  754. package/dist/voice/index.js +144 -0
  755. package/dist/voice/stt/whisper.d.ts +13 -0
  756. package/dist/voice/stt/whisper.js +116 -0
  757. package/dist/voice/tts/elevenlabs.d.ts +18 -0
  758. package/dist/voice/tts/elevenlabs.js +178 -0
  759. package/dist/voice/tts/openai-tts.d.ts +19 -0
  760. package/dist/voice/tts/openai-tts.js +127 -0
  761. package/dist/voice/tts/system.d.ts +26 -0
  762. package/dist/voice/tts/system.js +146 -0
  763. package/dist/voice/wake-word.d.ts +44 -0
  764. package/dist/voice/wake-word.js +145 -0
  765. package/docker-compose.yml +222 -0
  766. package/package.json +154 -0
  767. package/profclaw.mjs +24 -0
  768. package/skills/1password/SKILL.md +155 -0
  769. package/skills/api-tester/SKILL.md +177 -0
  770. package/skills/apple-notes/SKILL.md +167 -0
  771. package/skills/apple-reminders/SKILL.md +178 -0
  772. package/skills/bear-notes/SKILL.md +166 -0
  773. package/skills/blogwatcher/SKILL.md +177 -0
  774. package/skills/camsnap/SKILL.md +130 -0
  775. package/skills/code-generation/SKILL.md +139 -0
  776. package/skills/code-review/SKILL.md +116 -0
  777. package/skills/coding-agent/SKILL.md +184 -0
  778. package/skills/cron-manager/SKILL.md +141 -0
  779. package/skills/debug-helper/SKILL.md +134 -0
  780. package/skills/docker-ops/SKILL.md +246 -0
  781. package/skills/file-manager/SKILL.md +160 -0
  782. package/skills/git-workflow/SKILL.md +171 -0
  783. package/skills/github-issues/SKILL.md +244 -0
  784. package/skills/gog/SKILL.md +191 -0
  785. package/skills/goplaces/SKILL.md +156 -0
  786. package/skills/healthcheck/SKILL.md +270 -0
  787. package/skills/himalaya/SKILL.md +165 -0
  788. package/skills/mcp-discovery/SKILL.md +109 -0
  789. package/skills/memory-manager/SKILL.md +151 -0
  790. package/skills/model-usage/SKILL.md +177 -0
  791. package/skills/nano-banana-pro/SKILL.md +214 -0
  792. package/skills/nano-pdf/SKILL.md +165 -0
  793. package/skills/notion/SKILL.md +147 -0
  794. package/skills/obsidian/SKILL.md +163 -0
  795. package/skills/openai-image-gen/SKILL.md +194 -0
  796. package/skills/openai-whisper/SKILL.md +98 -0
  797. package/skills/openai-whisper-api/SKILL.md +130 -0
  798. package/skills/openhue/SKILL.md +203 -0
  799. package/skills/oracle/SKILL.md +236 -0
  800. package/skills/phone-control/SKILL.md +201 -0
  801. package/skills/profclaw-assistant/SKILL.md +81 -0
  802. package/skills/profclaw-projects/SKILL.md +68 -0
  803. package/skills/profclaw-tickets/SKILL.md +91 -0
  804. package/skills/session-logs/SKILL.md +216 -0
  805. package/skills/sherpa-onnx-tts/SKILL.md +134 -0
  806. package/skills/skill-creator/SKILL.md +183 -0
  807. package/skills/songsee/SKILL.md +170 -0
  808. package/skills/spotify-player/SKILL.md +254 -0
  809. package/skills/summarize/SKILL.md +155 -0
  810. package/skills/system-admin/SKILL.md +179 -0
  811. package/skills/things-mac/SKILL.md +179 -0
  812. package/skills/tmux/SKILL.md +170 -0
  813. package/skills/trello/SKILL.md +154 -0
  814. package/skills/video-frames/SKILL.md +127 -0
  815. package/skills/weather/SKILL.md +186 -0
  816. package/skills/web-research/SKILL.md +128 -0
  817. package/skills/xurl/SKILL.md +198 -0
  818. package/ui/README.md +73 -0
  819. package/ui/dist/assets/ActivityView-CkPgKhwm.js +1 -0
  820. package/ui/dist/assets/AgentList-C3SVdeEz.js +1 -0
  821. package/ui/dist/assets/AnalyticsDashboard-DVU--vlP.js +1 -0
  822. package/ui/dist/assets/AreaChart-B5qMEGWj.js +1 -0
  823. package/ui/dist/assets/CartesianChart-B50bcUJi.js +36 -0
  824. package/ui/dist/assets/ChatView-BZFJs7w_.js +10 -0
  825. package/ui/dist/assets/CostsDashboard-ChfH8BlG.js +1 -0
  826. package/ui/dist/assets/EstimateSelect-CLpB4NQO.js +1 -0
  827. package/ui/dist/assets/FloatingChatbot-CBzBY9a0.js +2 -0
  828. package/ui/dist/assets/InviteCodeManagement-DsbdPa6W.js +2 -0
  829. package/ui/dist/assets/ProjectDetail-BEM3tFXg.js +2 -0
  830. package/ui/dist/assets/ProjectDetail-D1-0B2xV.css +1 -0
  831. package/ui/dist/assets/ProjectIcon-CN1FmFAk.js +1 -0
  832. package/ui/dist/assets/ProjectList-DSDaNhxQ.js +4 -0
  833. package/ui/dist/assets/Settings-dPVcqC_d.js +6 -0
  834. package/ui/dist/assets/StatusIndicator-DA3NAo_b.js +1 -0
  835. package/ui/dist/assets/SummaryDetail-Bjnf9lT8.js +27 -0
  836. package/ui/dist/assets/SummaryList-ENwKDBKW.js +1 -0
  837. package/ui/dist/assets/TaskDetail-DnwG6MzB.js +1 -0
  838. package/ui/dist/assets/TaskList-D9Ug_HiV.js +1 -0
  839. package/ui/dist/assets/TicketBoard-CviH1571.js +1 -0
  840. package/ui/dist/assets/TicketDetail-8Jk8O-33.js +1 -0
  841. package/ui/dist/assets/TicketList-B-iV4rRA.js +1 -0
  842. package/ui/dist/assets/UserManagement-CPZ8s7s2.js +2 -0
  843. package/ui/dist/assets/ViewSwitcher-BUyOOWDI.js +1 -0
  844. package/ui/dist/assets/alert-dialog-BOmnTkN-.js +7 -0
  845. package/ui/dist/assets/archive-D5my9zOG.js +1 -0
  846. package/ui/dist/assets/badge-B4ov81_m.js +1 -0
  847. package/ui/dist/assets/brain-C53ElFLD.js +1 -0
  848. package/ui/dist/assets/bug-D0TJoCYn.js +1 -0
  849. package/ui/dist/assets/calendar-BkWIhKa1.js +1 -0
  850. package/ui/dist/assets/chevron-up-BRTtndUZ.js +1 -0
  851. package/ui/dist/assets/circle-x-BN89YhbS.js +1 -0
  852. package/ui/dist/assets/constants-fc7TFI7u.js +1 -0
  853. package/ui/dist/assets/cpu-B41x1-vV.js +1 -0
  854. package/ui/dist/assets/database-D9Cnfmzj.js +1 -0
  855. package/ui/dist/assets/defineProperty-CoXUr7_6.js +2 -0
  856. package/ui/dist/assets/dialog-DrWB4EYD.js +1 -0
  857. package/ui/dist/assets/element-adapter-DL0DQilL.js +4 -0
  858. package/ui/dist/assets/ellipsis-NuUWekvu.js +1 -0
  859. package/ui/dist/assets/ellipsis-vertical-BueMfuCw.js +1 -0
  860. package/ui/dist/assets/file-code-HR9829Jc.js +1 -0
  861. package/ui/dist/assets/folder-open-C_7oYEqe.js +1 -0
  862. package/ui/dist/assets/funnel-B5gmNXGf.js +1 -0
  863. package/ui/dist/assets/git-branch-BRMiJmV3.js +1 -0
  864. package/ui/dist/assets/git-commit-horizontal-CXOUQeJI.js +1 -0
  865. package/ui/dist/assets/globe-CCspjvus.js +1 -0
  866. package/ui/dist/assets/hash-g3102kPC.js +1 -0
  867. package/ui/dist/assets/history-CNqcBBrV.js +1 -0
  868. package/ui/dist/assets/index-27mTPKuh.js +1 -0
  869. package/ui/dist/assets/index-BMx3fH-e.js +1 -0
  870. package/ui/dist/assets/index-C9jNQXzL.js +1 -0
  871. package/ui/dist/assets/index-CEZ6R2Uw.js +7 -0
  872. package/ui/dist/assets/index-DURTouJI.js +1 -0
  873. package/ui/dist/assets/index-WclMPci1.css +1 -0
  874. package/ui/dist/assets/index-kb4AJXUB.js +67 -0
  875. package/ui/dist/assets/layers-CLXiHN6o.js +1 -0
  876. package/ui/dist/assets/layout-dashboard-B07MFhBs.js +1 -0
  877. package/ui/dist/assets/lightbulb-B2dgG5ks.js +1 -0
  878. package/ui/dist/assets/link-2-BxNmr9hL.js +1 -0
  879. package/ui/dist/assets/markdown-renderer-CjU6hBcW.js +36 -0
  880. package/ui/dist/assets/message-square-Bf2-CVbt.js +1 -0
  881. package/ui/dist/assets/pencil-D096Ey62.js +1 -0
  882. package/ui/dist/assets/play-DfdcSI3x.js +1 -0
  883. package/ui/dist/assets/popover-BV0QJDQq.js +1 -0
  884. package/ui/dist/assets/progress-DjPEDJfI.js +1 -0
  885. package/ui/dist/assets/rocket-CPsTc-5G.js +1 -0
  886. package/ui/dist/assets/select-LsO16slr.js +1 -0
  887. package/ui/dist/assets/send-BDYBZDUZ.js +1 -0
  888. package/ui/dist/assets/server-B3k6noce.js +1 -0
  889. package/ui/dist/assets/settings-2-Cu4xTjhG.js +1 -0
  890. package/ui/dist/assets/sheet-BScLnPKX.js +1 -0
  891. package/ui/dist/assets/shield-check-CQqkwufI.js +1 -0
  892. package/ui/dist/assets/shield-off-ZFruH9KO.js +1 -0
  893. package/ui/dist/assets/skeleton-CtkIA_MU.js +1 -0
  894. package/ui/dist/assets/smartphone-DnoksVkc.js +1 -0
  895. package/ui/dist/assets/square-uD9ZHMfW.js +1 -0
  896. package/ui/dist/assets/switch-MQPnwGJK.js +1 -0
  897. package/ui/dist/assets/table-B8cqlywA.js +1 -0
  898. package/ui/dist/assets/tag-wEJQRWlV.js +1 -0
  899. package/ui/dist/assets/textarea-D5LJCOGl.js +1 -0
  900. package/ui/dist/assets/timer-mbGHegmr.js +1 -0
  901. package/ui/dist/assets/tooltip-Df1CunSp.js +1 -0
  902. package/ui/dist/assets/trash-2-B4oAXsX-.js +1 -0
  903. package/ui/dist/assets/trending-up-BGWxvlmZ.js +1 -0
  904. package/ui/dist/assets/wand-sparkles-CZy4xvL3.js +1 -0
  905. package/ui/dist/assets/wrench-ByZkjO6m.js +1 -0
  906. package/ui/dist/audio-worklets/vad-processor.js +132 -0
  907. package/ui/dist/brand/profclaw-appicon-192.png +0 -0
  908. package/ui/dist/brand/profclaw-appicon-512.png +0 -0
  909. package/ui/dist/brand/profclaw-appicon-shadow.svg +51 -0
  910. package/ui/dist/brand/profclaw-appicon.svg +50 -0
  911. package/ui/dist/brand/profclaw-favicon-coral-bg-128.png +0 -0
  912. package/ui/dist/brand/profclaw-favicon-coral-bg-64.png +0 -0
  913. package/ui/dist/brand/profclaw-favicon-coral-bg.svg +52 -0
  914. package/ui/dist/brand/profclaw-favicon-coral-body-128.png +0 -0
  915. package/ui/dist/brand/profclaw-favicon-coral-body.svg +41 -0
  916. package/ui/dist/brand/profclaw-favicon-shadow-128.png +0 -0
  917. package/ui/dist/brand/profclaw-favicon-shadow-64.png +0 -0
  918. package/ui/dist/brand/profclaw-favicon-shadow.svg +51 -0
  919. package/ui/dist/brand/profclaw-mark-coral-256.png +0 -0
  920. package/ui/dist/brand/profclaw-mark-coral-64.png +0 -0
  921. package/ui/dist/brand/profclaw-mark-coral.svg +31 -0
  922. package/ui/dist/brand/profclaw-mono-white.svg +18 -0
  923. package/ui/dist/brand/profclaw-text-dark.svg +18 -0
  924. package/ui/dist/brand/profclaw-text-light.svg +18 -0
  925. package/ui/dist/brand/profclaw-wordmark-dark.svg +48 -0
  926. package/ui/dist/brand/profclaw-wordmark-light.svg +48 -0
  927. package/ui/dist/brand/safari-pinned-tab.svg +15 -0
  928. package/ui/dist/favicon/android-chrome-192x192.png +0 -0
  929. package/ui/dist/favicon/android-chrome-384x384.png +0 -0
  930. package/ui/dist/favicon/android-chrome-512x512.png +0 -0
  931. package/ui/dist/favicon/apple-touch-icon.png +0 -0
  932. package/ui/dist/favicon/browserconfig.xml +9 -0
  933. package/ui/dist/favicon/favicon-16x16.png +0 -0
  934. package/ui/dist/favicon/favicon-32x32.png +0 -0
  935. package/ui/dist/favicon/favicon.ico +0 -0
  936. package/ui/dist/favicon/mstile-150x150.png +0 -0
  937. package/ui/dist/favicon/safari-pinned-tab.svg +46 -0
  938. package/ui/dist/favicon/site.webmanifest +22 -0
  939. package/ui/dist/index.html +32 -0
  940. package/ui/dist/manifest.json +49 -0
  941. package/ui/dist/sw.js +124 -0
  942. package/ui/dist/vite.svg +1 -0
@@ -0,0 +1 @@
1
+ import{j as s,i as l}from"./index-kb4AJXUB.js";function h({status:e,label:a,size:n="md",pulse:r=!0,showLabel:d=!0,className:t}){const o={online:{color:"bg-green-500",shadow:"shadow-[0_0_10px_oklch(0.6_0.2_150)]",defaultLabel:"Online"},processing:{color:"bg-blue-500",shadow:"shadow-[0_0_10px_oklch(0.6_0.2_250)]",defaultLabel:"Processing"},error:{color:"bg-red-500",shadow:"shadow-[0_0_10px_oklch(0.6_0.2_20)]",defaultLabel:"Error"},offline:{color:"bg-slate-400",shadow:"shadow-none",defaultLabel:"Offline"}}[e],c={sm:"h-1.5 w-1.5",md:"h-2 w-2",lg:"h-3 w-3"};return s.jsxs("div",{className:l("flex items-center gap-2",t),children:[s.jsx("div",{className:l(c[n],"rounded-full",o.color,o.shadow,r&&e!=="offline"&&"animate-pulse")}),d&&s.jsx("span",{className:l("text-[10px] font-bold uppercase tracking-widest",e==="offline"?"text-muted-foreground":"text-foreground/80"),children:a||o.defaultLabel})]})}export{h as S};
@@ -0,0 +1,27 @@
1
+ import{E as k,r as $,u as L,j as e,h as o,k as u,G as S,l as j,O as T,Q as B,b as r,f as l,B as F,g as I,d as i,e as n,U as N,J as A,t as D,i as f,m as E}from"./index-kb4AJXUB.js";import{B as d}from"./badge-B4ov81_m.js";import{S as x}from"./skeleton-CtkIA_MU.js";import{F as g}from"./file-code-HR9829Jc.js";import{C as b}from"./cpu-B41x1-vV.js";import{L as W}from"./link-2-BxNmr9hL.js";import{L as w}from"./lightbulb-B2dgG5ks.js";function G(){const{id:c}=k(),[m,h]=$.useState(!1),{data:s,isLoading:y,error:v}=L({queryKey:["summaries",c],queryFn:()=>E.summaries.get(c),enabled:!!c}),C=async()=>{if(!s)return;const t=`# ${s.title}
2
+
3
+ ## What Changed
4
+ ${s.whatChanged}
5
+
6
+ ${s.whyChanged?`## Why Changed
7
+ ${s.whyChanged}
8
+ `:""}
9
+ ${s.howChanged?`## How Changed
10
+ ${s.howChanged}
11
+ `:""}
12
+ ${s.filesChanged.length>0?`## Files Changed
13
+ ${s.filesChanged.map(a=>typeof a=="string"?`- ${a}`:`- ${a.path}`).join(`
14
+ `)}
15
+ `:""}
16
+ ${s.decisions.length>0?`## Key Decisions
17
+ ${s.decisions.map(a=>typeof a=="string"?`- ${a}`:`- ${a.description}`).join(`
18
+ `)}
19
+ `:""}
20
+ ${s.blockers.length>0?`## Blockers
21
+ ${s.blockers.map(a=>typeof a=="string"?`- ${a}`:`- ${a.description}`).join(`
22
+ `)}
23
+ `:""}
24
+ ---
25
+ Agent: ${s.agent}${s.model?` | Model: ${s.model}`:""}
26
+ Created: ${new Date(s.createdAt).toLocaleString()}
27
+ `;await navigator.clipboard.writeText(t),h(!0),D.success("Summary copied to clipboard"),setTimeout(()=>h(!1),2e3)};return y?e.jsxs("div",{className:"max-w-5xl mx-auto space-y-6",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(x,{className:"h-8 w-8 rounded-full skeleton-glass"}),e.jsx(x,{className:"h-4 w-32 skeleton-glass"})]}),e.jsx(x,{className:"h-48 rounded-[24px] skeleton-glass"}),e.jsxs("div",{className:"grid gap-6 md:grid-cols-2",children:[e.jsx(x,{className:"h-64 rounded-[24px] skeleton-glass"}),e.jsx(x,{className:"h-64 rounded-[24px] skeleton-glass"})]})]}):v||!s?e.jsxs("div",{className:"max-w-5xl mx-auto glass rounded-[24px] p-20 text-center",children:[e.jsx(g,{className:"h-16 w-16 mx-auto text-red-500 mb-4 opacity-20"}),e.jsx("h3",{className:"text-xl font-bold",children:"Summary Not Found"}),e.jsx("p",{className:"text-muted-foreground mb-6",children:"The summary you're looking for doesn't exist."}),e.jsx(o,{to:"/summaries",children:e.jsx(u,{variant:"outline",className:"rounded-xl px-6",children:"Back to Summaries"})})]}):e.jsxs("div",{className:"max-w-5xl mx-auto space-y-6",children:[e.jsxs("nav",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(o,{to:"/summaries",className:"p-2 hover:bg-white/5 rounded-full transition-colors group",children:e.jsx(S,{className:"h-4 w-4 group-hover:-translate-x-1 transition-transform"})}),e.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-semibold uppercase tracking-widest text-muted-foreground",children:[e.jsx(o,{to:"/summaries",className:"hover:text-foreground transition-colors",children:"Summaries"}),e.jsx(j,{className:"h-3 w-3"}),e.jsx("span",{className:"text-foreground truncate max-w-[200px]",children:s.title})]})]}),e.jsxs(u,{variant:"outline",size:"sm",onClick:C,className:"rounded-xl glass border-white/5 hover:bg-white/5",children:[m?e.jsx(T,{className:"h-4 w-4 mr-2 text-green-400"}):e.jsx(B,{className:"h-4 w-4 mr-2"}),m?"Copied!":"Copy"]})]}),e.jsxs(r,{className:"glass rounded-[32px] overflow-hidden border-white/5 relative",children:[e.jsx("div",{className:"absolute -top-24 -right-24 w-64 h-64 rounded-full blur-[100px] opacity-10 bg-indigo-500"}),e.jsxs(l,{className:"p-8",children:[e.jsx("div",{className:"flex items-start justify-between mb-6",children:e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsxs(d,{className:"bg-indigo-500/10 text-indigo-400 border-indigo-500/20",children:[e.jsx(F,{className:"h-3 w-3 mr-1"}),s.agent]}),s.model&&e.jsxs(d,{variant:"outline",className:"border-white/10",children:[e.jsx(b,{className:"h-3 w-3 mr-1"}),s.model]})]}),e.jsx("h1",{className:"text-3xl font-extrabold tracking-tight leading-tight",children:s.title})]})}),e.jsxs("div",{className:"flex flex-wrap gap-4 pt-6 border-t border-white/5",children:[e.jsx(p,{icon:I,label:"Created",value:new Date(s.createdAt).toLocaleString()}),s.taskId&&e.jsx(o,{to:`/tasks/${s.taskId}`,className:"hover:opacity-80 transition-opacity",children:e.jsx(p,{icon:W,label:"Task",value:`#${s.taskId.split("-")[0]}`,isLink:!0})}),e.jsx(p,{icon:g,label:"Files",value:`${s.filesChanged.length} changed`})]})]})]}),e.jsxs(r,{className:"glass rounded-[28px] border-white/5",children:[e.jsx(i,{className:"border-b border-white/5 bg-white/[0.02]",children:e.jsxs(n,{className:"flex items-center gap-3 text-lg font-bold",children:[e.jsx("div",{className:"h-8 w-8 rounded-xl bg-blue-500/10 flex items-center justify-center",children:e.jsx(g,{className:"h-4 w-4 text-blue-400"})}),"What Changed"]})}),e.jsx(l,{className:"p-6",children:e.jsx("p",{className:"text-muted-foreground leading-relaxed whitespace-pre-wrap",children:s.whatChanged})})]}),e.jsxs("div",{className:"grid gap-6 md:grid-cols-2",children:[s.whyChanged&&e.jsxs(r,{className:"glass rounded-[28px] border-white/5",children:[e.jsx(i,{className:"border-b border-white/5 bg-white/[0.02]",children:e.jsxs(n,{className:"flex items-center gap-3 text-lg font-bold",children:[e.jsx("div",{className:"h-8 w-8 rounded-xl bg-amber-500/10 flex items-center justify-center",children:e.jsx(w,{className:"h-4 w-4 text-amber-400"})}),"Why Changed"]})}),e.jsx(l,{className:"p-6",children:e.jsx("p",{className:"text-muted-foreground leading-relaxed whitespace-pre-wrap",children:s.whyChanged})})]}),s.howChanged&&e.jsxs(r,{className:"glass rounded-[28px] border-white/5",children:[e.jsx(i,{className:"border-b border-white/5 bg-white/[0.02]",children:e.jsxs(n,{className:"flex items-center gap-3 text-lg font-bold",children:[e.jsx("div",{className:"h-8 w-8 rounded-xl bg-green-500/10 flex items-center justify-center",children:e.jsx(b,{className:"h-4 w-4 text-green-400"})}),"How Changed"]})}),e.jsx(l,{className:"p-6",children:e.jsx("p",{className:"text-muted-foreground leading-relaxed whitespace-pre-wrap",children:s.howChanged})})]})]}),s.filesChanged.length>0&&e.jsxs(r,{className:"glass rounded-[28px] border-white/5",children:[e.jsx(i,{className:"border-b border-white/5 bg-white/[0.02]",children:e.jsxs(n,{className:"flex items-center gap-3 text-lg font-bold",children:[e.jsx("div",{className:"h-8 w-8 rounded-xl bg-cyan-500/10 flex items-center justify-center",children:e.jsx(g,{className:"h-4 w-4 text-cyan-400"})}),"Files Changed",e.jsx(d,{variant:"secondary",className:"ml-auto",children:s.filesChanged.length})]})}),e.jsx(l,{className:"p-6",children:e.jsx("div",{className:"flex flex-wrap gap-2",children:s.filesChanged.map((t,a)=>e.jsx(d,{variant:"outline",className:"font-mono text-xs px-3 py-1.5 bg-white/[0.02] border-white/10 hover:bg-white/5 transition-colors",children:typeof t=="string"?t:t.path},a))})})]}),e.jsxs("div",{className:"grid gap-6 md:grid-cols-2",children:[s.decisions.length>0&&e.jsxs(r,{className:"glass rounded-[28px] border-white/5",children:[e.jsx(i,{className:"border-b border-white/5 bg-white/[0.02]",children:e.jsxs(n,{className:"flex items-center gap-3 text-lg font-bold",children:[e.jsx("div",{className:"h-8 w-8 rounded-xl bg-indigo-500/10 flex items-center justify-center",children:e.jsx(w,{className:"h-4 w-4 text-indigo-400"})}),"Key Decisions",e.jsx(d,{variant:"secondary",className:"ml-auto",children:s.decisions.length})]})}),e.jsx(l,{className:"p-6",children:e.jsx("ul",{className:"space-y-3",children:s.decisions.map((t,a)=>e.jsxs("li",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"h-5 w-5 rounded-full bg-indigo-500/10 flex items-center justify-center flex-shrink-0 mt-0.5",children:e.jsx("span",{className:"text-[10px] font-bold text-indigo-400",children:a+1})}),e.jsx("span",{className:"text-muted-foreground text-sm leading-relaxed",children:typeof t=="string"?t:t.description})]},a))})})]}),s.blockers.length>0&&e.jsxs(r,{className:"glass rounded-[28px] border-white/5 border-red-500/10",children:[e.jsx(i,{className:"border-b border-white/5 bg-red-500/[0.02]",children:e.jsxs(n,{className:"flex items-center gap-3 text-lg font-bold",children:[e.jsx("div",{className:"h-8 w-8 rounded-xl bg-red-500/10 flex items-center justify-center",children:e.jsx(N,{className:"h-4 w-4 text-red-400"})}),e.jsx("span",{className:"text-red-400",children:"Blockers"}),e.jsx(d,{className:"ml-auto bg-red-500/10 text-red-400 border-red-500/20",children:s.blockers.length})]})}),e.jsx(l,{className:"p-6",children:e.jsx("ul",{className:"space-y-3",children:s.blockers.map((t,a)=>e.jsxs("li",{className:"flex items-start gap-3",children:[e.jsx(N,{className:"h-4 w-4 text-red-400 flex-shrink-0 mt-0.5"}),e.jsx("span",{className:"text-red-300 text-sm leading-relaxed",children:typeof t=="string"?t:t.description})]},a))})})]})]}),s.taskId&&e.jsx(r,{className:"glass rounded-[20px] border-white/5 hover-lift transition-liquid",children:e.jsx(o,{to:`/tasks/${s.taskId}`,className:"block p-4",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:"h-10 w-10 rounded-xl bg-blue-500/10 flex items-center justify-center",children:e.jsx(A,{className:"h-5 w-5 text-blue-400"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-bold uppercase tracking-widest text-muted-foreground",children:"Related Task"}),e.jsxs("p",{className:"font-semibold",children:["View Task #",s.taskId.split("-")[0]]})]})]}),e.jsx(j,{className:"h-5 w-5 text-muted-foreground"})]})})})]})}function p({icon:c,label:m,value:h,isLink:s}){return e.jsxs("div",{className:"flex items-center gap-2 group/meta",children:[e.jsx("div",{className:"h-8 w-8 rounded-lg glass-heavy flex items-center justify-center border-white/5",children:e.jsx(c,{className:f("h-3.5 w-3.5 text-muted-foreground",s&&"group-hover/meta:text-blue-400 transition-colors")})}),e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"premium-label",children:m}),e.jsx("span",{className:f("text-[11px] font-bold truncate max-w-[120px]",s&&"text-blue-400"),children:h})]})]})}export{G as SummaryDetail};
@@ -0,0 +1 @@
1
+ import{r as m,u as f,j as e,b as l,f as i,d as N,e as v,w,I as b,L as C,N as x,h as S,B as L,l as A,m as k}from"./index-kb4AJXUB.js";import{B as r}from"./badge-B4ov81_m.js";import{S as F,a as y,b as B,c as I,d as h}from"./select-LsO16slr.js";import{C as q}from"./cpu-B41x1-vV.js";import"./chevron-up-BRTtndUZ.js";function V(){const[t,u]=m.useState("all"),[a,j]=m.useState(""),{data:g,isLoading:p,error:n}=f({queryKey:["summaries",{agent:t==="all"?void 0:t,limit:50}],queryFn:()=>k.summaries.list({agent:t==="all"?void 0:t,limit:50})}),c=g?.summaries??[],d=Array.from(new Set(c.map(s=>s.agent))),o=c.filter(s=>a?s.title.toLowerCase().includes(a.toLowerCase())||s.whatChanged.toLowerCase().includes(a.toLowerCase()):!0);return n?e.jsx(l,{children:e.jsx(i,{className:"p-6",children:e.jsxs("p",{className:"text-center text-destructive",children:["Error loading summaries: ",n.message]})})}):e.jsx("div",{className:"space-y-4",children:e.jsxs(l,{children:[e.jsx(N,{children:e.jsx(v,{children:"AI Summaries"})}),e.jsxs(i,{children:[e.jsxs("div",{className:"mb-4 flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(w,{className:"absolute left-2 top-2.5 h-4 w-4 text-muted-foreground"}),e.jsx(b,{placeholder:"Search summaries...",value:a,onChange:s=>j(s.target.value),className:"pl-8"})]}),d.length>0&&e.jsxs(F,{value:t,onValueChange:u,children:[e.jsx(y,{className:"w-[180px]",children:e.jsx(B,{placeholder:"Filter by agent"})}),e.jsxs(I,{children:[e.jsx(h,{value:"all",children:"All Agents"}),d.map(s=>e.jsx(h,{value:s,children:s},s))]})]})]}),p?e.jsx("div",{className:"flex h-40 items-center justify-center",children:e.jsx(C,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):o.length===0?e.jsxs("div",{className:"flex h-40 flex-col items-center justify-center",children:[e.jsx(x,{className:"h-12 w-12 text-muted-foreground mb-2"}),e.jsx("p",{className:"text-muted-foreground",children:"No summaries found"})]}):e.jsx("div",{className:"space-y-3",children:o.map(s=>e.jsx(S,{to:`/summaries/${s.id}`,className:"block",children:e.jsx(l,{className:"glass rounded-[16px] hover-lift transition-liquid group border-white/5",children:e.jsx(i,{className:"p-4",children:e.jsxs("div",{className:"flex items-start justify-between",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("h3",{className:"font-semibold truncate group-hover:text-primary transition-colors",children:s.title}),e.jsxs(r,{className:"bg-indigo-500/10 text-indigo-400 border-indigo-500/20",children:[e.jsx(L,{className:"h-3 w-3 mr-1"}),s.agent]}),s.model&&e.jsxs(r,{variant:"outline",className:"text-xs border-white/10",children:[e.jsx(q,{className:"h-3 w-3 mr-1"}),s.model]})]}),e.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:s.whatChanged}),e.jsxs("div",{className:"flex items-center gap-2 mt-3",children:[s.filesChanged?.length>0&&e.jsxs(r,{variant:"outline",className:"text-[10px] border-white/10",children:[e.jsx(x,{className:"h-3 w-3 mr-1"}),s.filesChanged.length," files"]}),s.blockers?.length>0&&e.jsxs(r,{className:"text-[10px] bg-red-500/10 text-red-400 border-red-500/20",children:[s.blockers.length," blockers"]})]})]}),e.jsxs("div",{className:"flex items-center gap-2 ml-4",children:[e.jsx("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:new Date(s.createdAt).toLocaleDateString()}),e.jsx(A,{className:"h-4 w-4 text-muted-foreground group-hover:translate-x-1 transition-transform"})]})]})})})},s.id))})]})]})})}export{V as SummaryList};
@@ -0,0 +1 @@
1
+ import{u as b,E as w,s as k,n as y,o as g,t as o,m as f,j as e,h as m,k as c,G as T,l as _,i as N,L as x,H as A,J as S,K as C,M as P}from"./index-kb4AJXUB.js";import{S as L}from"./StatusIndicator-DA3NAo_b.js";import{H as j}from"./hash-g3102kPC.js";import{S as D}from"./square-uD9ZHMfW.js";import{P as F}from"./play-DfdcSI3x.js";import{C as q}from"./calendar-BkWIhKa1.js";import{H as E}from"./history-CNqcBBrV.js";const M="http://localhost:3000";function I(t){return b({queryKey:["tasks",t],queryFn:async()=>{const a=await fetch(`${M}/api/tasks/${t}`);if(!a.ok)throw new Error("Task not found");return(await a.json()).task},enabled:!!t})}function U(){const{id:t}=w(),a=k(),r=y(),{data:s,isLoading:n,error:v}=I(t||""),d=g({mutationFn:()=>f.tasks.cancel(t),onSuccess:()=>{o.success("Task cancelled"),r.invalidateQueries({queryKey:["tasks"]})},onError:l=>{o.error(l.message||"Failed to cancel task")}}),i=g({mutationFn:()=>f.tasks.retry(t),onSuccess:l=>{o.success("Task queued for retry"),r.invalidateQueries({queryKey:["tasks"]}),a(`/tasks/${l.task.id}`)},onError:l=>{o.error(l.message||"Failed to retry task")}});return n?e.jsxs("div",{className:"max-w-5xl mx-auto space-y-6",children:[e.jsx("div",{className:"h-8 w-32 glass animate-pulse rounded-lg"}),e.jsx("div",{className:"h-64 glass animate-pulse rounded-[24px]"})]}):v||!s?e.jsxs("div",{className:"max-w-5xl mx-auto glass rounded-[24px] p-20 text-center",children:[e.jsx(j,{className:"h-16 w-16 mx-auto text-red-500 mb-4 opacity-20"}),e.jsx("h3",{className:"text-xl font-bold",children:"Task Not Found"}),e.jsx("p",{className:"text-muted-foreground mb-6",children:"The task you're looking for doesn't exist or has been archived."}),e.jsx(m,{to:"/tasks",children:e.jsx(c,{variant:"outline",className:"rounded-xl px-6",children:"Back to Tasks"})})]}):e.jsxs("div",{className:"max-w-6xl mx-auto flex flex-col gap-8",children:[e.jsxs("nav",{className:"flex items-center gap-2",children:[e.jsx(m,{to:"/tasks",className:"p-2 hover:bg-white/5 rounded-full transition-colors group",children:e.jsx(T,{className:"h-4 w-4 group-hover:-translate-x-1 transition-transform"})}),e.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-semibold uppercase tracking-widest text-muted-foreground",children:[e.jsx(m,{to:"/tasks",className:"hover:text-foreground transition-colors",children:"Tasks"}),e.jsx(_,{className:"h-3 w-3"}),e.jsx("span",{className:"text-foreground truncate max-w-[200px]",children:s.title})]})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-8 items-start",children:[e.jsxs("div",{className:"lg:col-span-2 space-y-8",children:[e.jsxs("div",{className:"glass rounded-[32px] p-8 relative overflow-hidden",children:[e.jsx("div",{className:N("absolute -top-24 -right-24 w-64 h-64 rounded-full blur-[100px] opacity-10",s.status==="completed"?"bg-green-500":s.status==="failed"?"bg-red-500":"bg-blue-500")}),e.jsxs("div",{className:"flex items-start justify-between mb-6",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx(L,{status:s.status==="completed"?"online":s.status==="failed"?"error":s.status==="in_progress"?"processing":"offline",label:s.status,size:"md"}),e.jsxs("span",{className:"text-xs font-mono text-muted-foreground opacity-50",children:["#",s.id.split("-")[0]]})]}),e.jsx("h1",{className:"text-3xl font-extrabold tracking-tight leading-tight",children:s.title})]}),e.jsxs("div",{className:"flex gap-2",children:[(s.status==="failed"||s.status==="completed")&&e.jsx(c,{variant:"outline",size:"icon",onClick:()=>i.mutate(),disabled:i.isPending,title:"Retry task",children:i.isPending?e.jsx(x,{className:"h-4 w-4 animate-spin"}):e.jsx(A,{className:"h-4 w-4"})}),(s.status==="in_progress"||s.status==="pending")&&e.jsxs(c,{variant:"destructive",onClick:()=>d.mutate(),disabled:d.isPending,children:[d.isPending?e.jsx(x,{className:"mr-2 h-4 w-4 animate-spin"}):e.jsx(D,{className:"mr-2 h-4 w-4 fill-current"}),"Cancel"]}),(s.status==="failed"||s.status==="completed")&&e.jsxs(c,{onClick:()=>i.mutate(),disabled:i.isPending,children:[i.isPending?e.jsx(x,{className:"mr-2 h-4 w-4 animate-spin"}):e.jsx(F,{className:"mr-2 h-4 w-4 fill-current"}),"Run Again"]})]})]}),e.jsx("p",{className:"text-muted-foreground leading-relaxed mb-6",children:s.description||"No description provided for this task."}),e.jsxs("div",{className:"flex flex-wrap gap-4 pt-6 border-t border-white/5",children:[e.jsx(u,{label:"Source",value:s.source,icon:S,...s.sourceUrl?{href:s.sourceUrl}:{}}),e.jsx(u,{label:"Priority",value:`P${s.priority}`,icon:j}),e.jsx(u,{label:"Created",value:new Date(s.createdAt).toLocaleDateString(),icon:q})]})]}),e.jsxs("div",{className:"glass rounded-[24px] overflow-hidden shadow-inner",children:[e.jsxs("div",{className:"flex items-center gap-3 px-6 py-4 bg-primary/5",children:[e.jsx("div",{className:"h-8 w-8 rounded-lg glass-heavy flex items-center justify-center shadow-sm",children:e.jsx(C,{className:"h-4 w-4 text-primary"})}),e.jsx("h3",{className:"text-sm font-black uppercase tracking-[0.2em] text-foreground/80",children:"Instruction Prompt"})]}),e.jsx("div",{className:"p-6 recessed-card font-mono text-xs leading-relaxed text-foreground/80 overflow-x-auto whitespace-pre-wrap selection:bg-primary/20",children:s.prompt})]})]}),e.jsxs("div",{className:"space-y-8",children:[e.jsxs("div",{className:"glass rounded-[28px] p-6",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[e.jsx(E,{className:"h-4 w-4 text-indigo-400"}),e.jsx("h3",{className:"text-sm font-bold uppercase tracking-widest",children:"Task Timeline"})]}),e.jsxs("div",{className:"relative pl-6 space-y-8 before:absolute before:left-[11px] before:top-2 before:bottom-2 before:w-[2px] before:bg-white/5",children:[e.jsx(p,{title:"Task Created",time:new Date(s.createdAt).toLocaleTimeString(),status:"completed"}),s.startedAt&&e.jsx(p,{title:"Optimization Started",time:new Date(s.startedAt).toLocaleTimeString(),status:"completed"}),e.jsx(p,{title:s.status==="pending"?"Queued":s.status==="in_progress"?"In Progress":s.status==="completed"?"Success":"Failed",time:s.completedAt?new Date(s.completedAt).toLocaleTimeString():"Current Step",status:s.status==="completed"?"completed":s.status==="failed"?"error":"processing"})]})]}),e.jsxs("div",{className:"glass rounded-[28px] p-6",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[e.jsx(P,{className:"h-4 w-4 text-emerald-400"}),e.jsx("h3",{className:"text-sm font-bold uppercase tracking-widest",children:"Work Metrics"})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx(h,{label:"Status",value:s.status.toUpperCase()}),e.jsx(h,{label:"Duration",value:s.completedAt?`${((new Date(s.completedAt).getTime()-new Date(s.startedAt||s.createdAt).getTime())/1e3).toFixed(1)}s`:"--"}),e.jsx(h,{label:"Assigned Agent",value:s.assignedAgent??"Unassigned"})]})]})]})]})]})}function u({label:t,value:a,icon:r,href:s}){const n=e.jsxs("div",{className:"flex items-center gap-2 group/meta cursor-default",children:[e.jsx("div",{className:"h-8 w-8 rounded-lg glass-heavy flex items-center justify-center border-white/5",children:e.jsx(r,{className:"h-3.5 w-3.5 text-muted-foreground group-hover/meta:text-[var(--primary)] transition-colors"})}),e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"premium-label",children:t}),e.jsx("span",{className:"text-[11px] font-bold truncate max-w-[120px]",children:a})]})]});return s?e.jsx("a",{href:s,target:"_blank",rel:"noopener noreferrer",className:"hover:opacity-80 transition-opacity",children:n}):n}function p({title:t,time:a,status:r}){return e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:N("absolute -left-[23px] top-1.5 h-3.5 w-3.5 rounded-full border-2 border-background z-10",r==="completed"?"bg-green-500 shadow-[0_0_8px_oklch(0.6_0.2_150)]":r==="error"?"bg-red-500 shadow-[0_0_8px_oklch(0.6_0.2_20)]":"bg-blue-500 shadow-[0_0_8px_oklch(0.6_0.2_250)] animate-pulse")}),e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"text-[13px] font-bold",children:t}),e.jsx("span",{className:"text-[10px] text-muted-foreground font-medium",children:a})]})]})}function h({label:t,value:a}){return e.jsxs("div",{className:"flex items-center justify-between py-2 border-b border-white/5 last:border-0",children:[e.jsx("span",{className:"text-[11px] font-medium text-muted-foreground",children:t}),e.jsx("span",{className:"text-[11px] font-extrabold uppercase tracking-tight",children:a})]})}export{U as TaskDetail};
@@ -0,0 +1 @@
1
+ import{r as d,n as K,o as J,t as D,m as Q,j as e,k as p,P as X,p as S,I as R,q as W,s as Y,u as Z,v as M,w as ee,a as O,g as q,C as U,X as se,L as ae,D as te,x as re,y as le,z as ie}from"./index-kb4AJXUB.js";import{B as _}from"./badge-B4ov81_m.js";import{S as T,a as P,b as k,c as A,d as i}from"./select-LsO16slr.js";import{T as ne,a as oe,b as B,c as f,d as ce,e as v}from"./table-B8cqlywA.js";import{D as de,a as xe,b as ue,c as me,d as he,e as ge,f as pe}from"./dialog-DrWB4EYD.js";import{T as H}from"./textarea-D5LJCOGl.js";import{P as E}from"./play-DfdcSI3x.js";import{F as je}from"./funnel-B5gmNXGf.js";import{E as Ne}from"./ellipsis-NuUWekvu.js";import"./chevron-up-BRTtndUZ.js";function fe(){const[u,j]=d.useState(!1),[N,r]=d.useState(""),[n,l]=d.useState(""),[t,b]=d.useState(""),[o,m]=d.useState("manual"),[c,h]=d.useState("3"),F=K(),{mutate:w,isPending:C}=J({mutationFn:a=>Q.tasks.create(a),onSuccess:()=>{D.success("Task created successfully!"),F.invalidateQueries({queryKey:["tasks"]}),j(!1),r(""),l(""),b(""),m("manual"),h("3")},onError:a=>{D.error(`Failed to create task: ${a.message}`)}}),L=a=>{if(a.preventDefault(),!N.trim()){D.error("Title is required");return}if(!t.trim()){D.error("Prompt is required");return}w({title:N,description:n||void 0,prompt:t,source:o,priority:parseInt(c),labels:[]})};return e.jsxs(de,{open:u,onOpenChange:j,children:[e.jsx(xe,{asChild:!0,children:e.jsxs(p,{children:[e.jsx(X,{className:"mr-2 h-4 w-4"}),"Create Task"]})}),e.jsx(ue,{className:"sm:max-w-[525px] glass rounded-[24px] border-white/10",children:e.jsxs("form",{onSubmit:L,children:[e.jsxs(me,{children:[e.jsx(he,{className:"text-xl font-bold",children:"Create New Task"}),e.jsx(ge,{className:"text-muted-foreground",children:"Create a new task for the AI agents to execute"})]}),e.jsxs("div",{className:"grid gap-4 py-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(S,{htmlFor:"title",className:"text-sm font-semibold",children:"Title *"}),e.jsx(R,{id:"title",value:N,onChange:a=>r(a.target.value),placeholder:"Fix bug in authentication",className:"bg-white/5 border-white/10 rounded-xl"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(S,{htmlFor:"description",className:"text-sm font-semibold",children:"Description"}),e.jsx(H,{id:"description",value:n,onChange:a=>l(a.target.value),placeholder:"Optional description...",rows:3,className:"bg-white/5 border-white/10 rounded-xl resize-none"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(S,{htmlFor:"prompt",className:"text-sm font-semibold",children:"AI Prompt *"}),e.jsx(H,{id:"prompt",value:t,onChange:a=>b(a.target.value),placeholder:"Detailed instructions for the AI agent...",rows:4,className:"bg-white/5 border-white/10 rounded-xl resize-none"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(S,{htmlFor:"source",className:"text-sm font-semibold",children:"Source"}),e.jsxs(T,{value:o,onValueChange:m,children:[e.jsx(P,{id:"source",className:"bg-white/5 border-white/10 rounded-xl",children:e.jsx(k,{})}),e.jsxs(A,{className:"glass-heavy rounded-xl border-white/10",children:[e.jsx(i,{value:"manual",children:"Manual"}),e.jsx(i,{value:"github_issue",children:"GitHub Issue"}),e.jsx(i,{value:"jira",children:"Jira"}),e.jsx(i,{value:"linear",children:"Linear"})]})]})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(S,{htmlFor:"priority",className:"text-sm font-semibold",children:"Priority"}),e.jsxs(T,{value:c,onValueChange:h,children:[e.jsx(P,{id:"priority",className:"bg-white/5 border-white/10 rounded-xl",children:e.jsx(k,{})}),e.jsxs(A,{className:"glass-heavy rounded-xl border-white/10",children:[e.jsx(i,{value:"1",children:"Critical (P1)"}),e.jsx(i,{value:"2",children:"High (P2)"}),e.jsx(i,{value:"3",children:"Medium (P3)"}),e.jsx(i,{value:"4",children:"Low (P4)"})]})]})]})]})]}),e.jsxs(pe,{className:"gap-2",children:[e.jsx(p,{type:"button",variant:"outline",onClick:()=>j(!1),children:"Cancel"}),e.jsx(p,{type:"submit",disabled:C,children:C?"Creating...":"Create Task"})]})]})})]})}const ve=[{value:"all",label:"All Status",icon:O},{value:"pending",label:"Pending",icon:q},{value:"in_progress",label:"Running",icon:E},{value:"completed",label:"Completed",icon:U},{value:"failed",label:"Failed",icon:M}],be=["all","github","jira","linear","manual","webhook"],we=["all","openclaw","claude-code","auto"];function ze(){const[u,j]=W(),N=Y(),r=u.get("status")||"all",n=u.get("source")||"all",l=u.get("agent")||"all",[t,b]=d.useState(u.get("q")||""),[o,m]=d.useState(0),c=20,h=(s,x)=>{const g=new URLSearchParams(u);x==="all"||x===""?g.delete(s):g.set(s,x),j(g),m(0)},F=()=>{j({}),b(""),m(0)},w=r!=="all"||n!=="all"||l!=="all"||t,{data:C,isLoading:L,error:a}=Z({queryKey:["tasks",{status:r==="all"?void 0:r,limit:c,offset:o*c}],queryFn:()=>Q.tasks.list({status:r==="all"?void 0:r,limit:c,offset:o*c})}),V=C?.tasks??[],z=C?.total??0,y=d.useMemo(()=>V.filter(s=>{const x=!t||s.title.toLowerCase().includes(t.toLowerCase())||s.description?.toLowerCase().includes(t.toLowerCase()),g=n==="all"||s.source.toLowerCase()===n,I=l==="all"||s.assignedAgent?.toLowerCase()===l||l==="auto"&&!s.assignedAgent;return x&&g&&I}),[V,t,n,l]),$=s=>{const g={completed:{variant:"success",icon:U},failed:{variant:"destructive",icon:M},running:{variant:"info",icon:E},pending:{variant:"secondary",icon:q},in_progress:{variant:"info",icon:E}}[s]||{variant:"secondary",icon:q},{variant:I,icon:G}=g;return e.jsxs(_,{variant:I,className:"gap-1.5 px-2 py-0.5 font-medium",children:[e.jsx(G,{className:"h-3 w-3"}),e.jsx("span",{className:"capitalize",children:s.replace("_"," ")})]})};return a?e.jsxs("div",{className:"glass rounded-[28px] p-12 text-center",children:[e.jsx(M,{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 tasks"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:a.message})]}):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:"Tasks"}),e.jsxs("p",{className:"text-muted-foreground text-sm",children:[z," total tasks • ",y.length," showing"]})]}),e.jsx(fe,{})]}),e.jsxs("div",{className:"glass rounded-[20px] p-4",children:[e.jsxs("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-center",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(ee,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(R,{placeholder:"Search tasks...",value:t,onChange:s=>{b(s.target.value),h("q",s.target.value)},className:"pl-10 bg-white/5 border-white/10 rounded-xl h-10"})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs(T,{value:r,onValueChange:s=>h("status",s),children:[e.jsx(P,{className:"w-[140px] bg-white/5 border-white/10 rounded-xl",children:e.jsx(k,{placeholder:"Status"})}),e.jsx(A,{className:"glass-heavy rounded-xl border-white/10",children:ve.map(s=>e.jsx(i,{value:s.value,children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(s.icon,{className:"h-3.5 w-3.5"}),s.label]})},s.value))})]}),e.jsxs(T,{value:n,onValueChange:s=>h("source",s),children:[e.jsx(P,{className:"w-[130px] bg-white/5 border-white/10 rounded-xl",children:e.jsx(k,{placeholder:"Source"})}),e.jsx(A,{className:"glass-heavy rounded-xl border-white/10",children:be.map(s=>e.jsx(i,{value:s,className:"capitalize",children:s==="all"?"All Sources":s},s))})]}),e.jsxs(T,{value:l,onValueChange:s=>h("agent",s),children:[e.jsx(P,{className:"w-[140px] bg-white/5 border-white/10 rounded-xl",children:e.jsx(k,{placeholder:"Agent"})}),e.jsx(A,{className:"glass-heavy rounded-xl border-white/10",children:we.map(s=>e.jsx(i,{value:s,className:"capitalize",children:s==="all"?"All Agents":s},s))})]}),w&&e.jsxs(p,{variant:"ghost",size:"sm",onClick:F,className:"rounded-xl text-muted-foreground hover:text-foreground",children:[e.jsx(se,{className:"h-4 w-4 mr-1"}),"Clear"]})]})]}),w&&e.jsxs("div",{className:"flex flex-wrap gap-2 mt-3 pt-3 border-t border-white/5",children:[e.jsx(je,{className:"h-4 w-4 text-muted-foreground"}),r!=="all"&&e.jsxs("span",{className:"px-2 py-0.5 rounded-lg bg-blue-500/10 text-blue-400 text-xs font-medium",children:["Status: ",r]}),n!=="all"&&e.jsxs("span",{className:"px-2 py-0.5 rounded-lg bg-indigo-500/10 text-indigo-400 text-xs font-medium capitalize",children:["Source: ",n]}),l!=="all"&&e.jsxs("span",{className:"px-2 py-0.5 rounded-lg bg-green-500/10 text-green-400 text-xs font-medium capitalize",children:["Agent: ",l]}),t&&e.jsxs("span",{className:"px-2 py-0.5 rounded-lg bg-orange-500/10 text-orange-400 text-xs font-medium",children:['Search: "',t,'"']})]})]}),e.jsx("div",{className:"glass-heavy rounded-[24px] overflow-hidden border border-white/10 shadow-float",children:L?e.jsx("div",{className:"flex items-center justify-center p-12",children:e.jsx(ae,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):y.length===0?e.jsxs("div",{className:"p-12 text-center",children:[e.jsx(O,{className:"h-12 w-12 mx-auto text-muted-foreground/40 mb-4"}),e.jsx("p",{className:"text-lg font-bold text-muted-foreground",children:"No tasks found"}),e.jsx("p",{className:"text-sm text-muted-foreground/60 mt-1",children:w?"Try adjusting your filters":"Create a task to get started"})]}):e.jsxs(ne,{children:[e.jsx(oe,{className:"bg-muted/30",children:e.jsxs(B,{className:"hover:bg-transparent border-white/5",children:[e.jsx(f,{className:"w-[400px]",children:"Task"}),e.jsx(f,{className:"w-[140px]",children:"Status"}),e.jsx(f,{children:"Agent"}),e.jsx(f,{children:"Source"}),e.jsx(f,{className:"text-right",children:"Created"}),e.jsx(f,{className:"w-[50px]"})]})}),e.jsx(ce,{children:y.map(s=>e.jsxs(B,{className:"group cursor-pointer hover:bg-white/5 border-white/5",onClick:()=>N(`/tasks/${s.id}`),children:[e.jsx(v,{className:"font-medium",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-2 rounded-lg bg-primary/10 text-primary",children:e.jsx(O,{className:"h-4 w-4"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"truncate font-semibold text-foreground group-hover:text-primary transition-colors",children:s.title}),s.description&&e.jsx("div",{className:"text-xs text-muted-foreground truncate max-w-[300px]",children:s.description})]})]})}),e.jsx(v,{children:$(s.status)}),e.jsx(v,{children:s.assignedAgent?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"h-6 w-6 rounded-full bg-gradient-to-br from-indigo-500 to-purple-500 flex items-center justify-center text-[10px] uppercase text-white font-bold",children:s.assignedAgent[0]}),e.jsx("span",{className:"text-sm capitalize",children:s.assignedAgent})]}):e.jsx("span",{className:"text-sm text-muted-foreground italic",children:"Unassigned"})}),e.jsx(v,{children:e.jsx(_,{variant:"outline",className:"capitalize bg-muted/50",children:s.source})}),e.jsx(v,{className:"text-right text-muted-foreground text-sm font-mono",children:new Date(s.createdAt).toLocaleDateString()}),e.jsx(v,{onClick:x=>x.stopPropagation(),children:e.jsxs(te,{children:[e.jsx(re,{asChild:!0,children:e.jsx(p,{variant:"ghost",size:"icon",className:"h-8 w-8 opacity-0 group-hover:opacity-100 transition-opacity",children:e.jsx(Ne,{className:"h-4 w-4"})})}),e.jsx(le,{align:"end",children:e.jsx(ie,{onClick:()=>N(`/tasks/${s.id}`),children:"View Details"})})]})})]},s.id))})]})}),y.length>0&&e.jsxs("div",{className:"flex items-center justify-between border-t border-white/10 pt-4",children:[e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Page ",o+1," • Showing ",Math.min(y.length,c)," of ",z]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(p,{variant:"outline",size:"sm",onClick:()=>m(o-1),disabled:o===0,className:"rounded-xl border-white/10",children:"Previous"}),e.jsx(p,{variant:"outline",size:"sm",onClick:()=>m(o+1),disabled:(o+1)*c>=z,className:"rounded-xl border-white/10",children:"Next"})]})]})]})}export{ze as TaskList};
@@ -0,0 +1 @@
1
+ import{c as O,r as m,S as I,C as k,j as e,i as x,h as R,B as _,s as $,n as z,q as U,u as S,o as V,m as N,a1 as G,v as W,D as H,x as J,k as Q,a5 as X,y as Y,z as w,aw as B,w as Z,I as ee,L as P,P as se}from"./index-kb4AJXUB.js";import{d as re,a as ae}from"./element-adapter-DL0DQilL.js";import{a as L,B as te}from"./bug-D0TJoCYn.js";import{C,L as oe,I as ne}from"./layers-CLXiHN6o.js";import{V as ce,C as ie}from"./ViewSwitcher-BUyOOWDI.js";import{P as le}from"./play-DfdcSI3x.js";import{F as q}from"./folder-open-C_7oYEqe.js";import"./defineProperty-CoXUr7_6.js";import"./textarea-D5LJCOGl.js";import"./badge-B4ov81_m.js";import"./dialog-DrWB4EYD.js";import"./select-LsO16slr.js";import"./chevron-up-BRTtndUZ.js";import"./EstimateSelect-CLpB4NQO.js";import"./hash-g3102kPC.js";import"./brain-C53ElFLD.js";import"./wand-sparkles-CZy4xvL3.js";import"./link-2-BxNmr9hL.js";import"./lightbulb-B2dgG5ks.js";const de=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],me=O("grip-vertical",de),M={task:{icon:k,color:"text-blue-400"},bug:{icon:te,color:"text-red-400"},feature:{icon:I,color:"text-cyan-400"},epic:{icon:oe,color:"text-orange-400"},story:{icon:L,color:"text-green-400"},subtask:{icon:C,color:"text-gray-400"},enhancement:{icon:I,color:"text-indigo-400"},documentation:{icon:L,color:"text-cyan-400"}},xe={urgent:"bg-red-500",high:"bg-orange-500",medium:"bg-yellow-500",low:"bg-blue-500",none:"bg-gray-400"};function pe({ticket:r,isDragging:i}){const l=m.useRef(null),[g,o]=m.useState(!1);m.useEffect(()=>{const n=l.current;if(n)return re({element:n,getInitialData:()=>({ticketId:r.id,status:r.status}),onDragStart:()=>o(!0),onDrop:()=>o(!1)})},[r.id,r.status]);const p=M[r.type]?.icon||C,a=M[r.type]?.color||"text-gray-400",h=r.projectKey||"PROFCLAW";return e.jsxs("div",{ref:l,className:x("group relative rounded-xl bg-[var(--card)] border border-[var(--border)] p-3 cursor-grab active:cursor-grabbing transition-all duration-200",(g||i)&&"opacity-50 scale-95 rotate-2","hover:border-[var(--primary)]/30 hover:shadow-lg hover:shadow-[var(--primary)]/5"),children:[e.jsx("div",{className:"absolute left-1 top-1/2 -translate-y-1/2 opacity-0 group-hover:opacity-50 transition-opacity",children:e.jsx(me,{className:"h-4 w-4 text-[var(--muted-foreground)]"})}),e.jsx("div",{className:x("absolute top-0 left-3 w-6 h-1 rounded-b-full",xe[r.priority]),title:r.priority}),e.jsxs(R,{to:`/tickets/${r.id}`,className:"block space-y-2",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("span",{className:"text-[10px] font-mono text-[var(--muted-foreground)]",children:[h,"-",r.sequence]}),e.jsx(p,{className:x("h-3.5 w-3.5 shrink-0",a)})]}),e.jsx("h4",{className:"text-sm font-medium leading-tight line-clamp-2 group-hover:text-[var(--primary)] transition-colors",children:r.title}),e.jsxs("div",{className:"flex items-center justify-between gap-2 pt-1",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[r.assigneeAgent&&e.jsxs("span",{className:"flex items-center gap-1 text-[9px] font-bold uppercase tracking-wider text-[var(--primary)]/80 px-1.5 py-0.5 rounded bg-[var(--primary)]/10",children:[e.jsx(_,{className:"h-2.5 w-2.5"}),r.assigneeAgent]}),r.labels.slice(0,1).map(n=>e.jsx("span",{className:"text-[9px] px-1.5 py-0.5 rounded bg-[var(--muted)]/50 text-[var(--muted-foreground)] truncate max-w-[60px]",children:n},n))]}),r.createdBy==="ai"&&e.jsx("span",{className:"text-[8px] font-bold uppercase tracking-wider text-blue-400",children:"AI"})]})]})]})}const E=[{status:"backlog",label:"Backlog",icon:ne,color:"text-gray-400",bgColor:"bg-gray-500/10"},{status:"todo",label:"Todo",icon:C,color:"text-blue-400",bgColor:"bg-blue-500/10"},{status:"in_progress",label:"In Progress",icon:le,color:"text-amber-400",bgColor:"bg-amber-500/10"},{status:"in_review",label:"In Review",icon:G,color:"text-indigo-400",bgColor:"bg-indigo-500/10"},{status:"done",label:"Done",icon:k,color:"text-green-400",bgColor:"bg-green-500/10"}];function ue({status:r,label:i,icon:l,color:g,bgColor:o,tickets:p,onDrop:a}){const h=m.useRef(null),[n,u]=m.useState(!1);return m.useEffect(()=>{const c=h.current;if(c)return ae({element:c,getData:()=>({status:r}),canDrop:({source:j})=>j.data.status!==r,onDragEnter:()=>u(!0),onDragLeave:()=>u(!1),onDrop:({source:j})=>{u(!1);const y=j.data.ticketId;y&&a(y,r)}})},[r,a]),e.jsxs("div",{ref:h,className:x("flex flex-col min-w-[280px] max-w-[320px] rounded-2xl border transition-all duration-200",n?"border-[var(--primary)] bg-[var(--primary)]/5 scale-[1.02]":"border-[var(--border)] bg-[var(--card)]/50"),children:[e.jsxs("div",{className:x("flex items-center justify-between px-4 py-3 rounded-t-2xl",o),children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(l,{className:x("h-4 w-4",g)}),e.jsx("span",{className:"text-sm font-semibold",children:i}),e.jsx("span",{className:"flex items-center justify-center h-5 min-w-5 px-1.5 rounded-full bg-[var(--background)]/50 text-[10px] font-bold",children:p.length})]}),e.jsx(Q,{variant:"ghost",size:"icon",className:"h-7 w-7 rounded-lg opacity-0 group-hover:opacity-100",children:e.jsx(se,{className:"h-3.5 w-3.5"})})]}),e.jsx("div",{className:"flex-1 p-2 space-y-2 overflow-y-auto max-h-[calc(100vh-280px)] scrollbar-thin",children:p.length===0?e.jsxs("div",{className:x("flex flex-col items-center justify-center py-8 px-4 rounded-xl border-2 border-dashed transition-colors",n?"border-[var(--primary)] bg-[var(--primary)]/5":"border-[var(--border)]/50"),children:[e.jsx(l,{className:x("h-8 w-8 mb-2 opacity-30",g)}),e.jsx("span",{className:"text-xs text-[var(--muted-foreground)]",children:n?"Drop here":"No tickets"})]}):p.map(c=>e.jsx(pe,{ticket:c},c.id))})]})}function Ee(){const r=$(),i=z(),[l,g]=U(),[o,p]=m.useState(l.get("q")||""),[a,h]=m.useState(l.get("projectId")||void 0),{data:n}=S({queryKey:["projects"],queryFn:()=>N.projects.list({limit:50})}),u=n?.projects||[],c=u.find(s=>s.id===a),j=s=>{h(s);const t=new URLSearchParams(l);s?t.set("projectId",s):t.delete("projectId"),g(t)},{data:y,isLoading:F,error:D}=S({queryKey:["tickets","board",{search:o||void 0,projectId:a}],queryFn:()=>N.tickets.list({search:o||void 0,projectId:a||void 0,limit:200})}),b=V({mutationFn:({id:s,status:t})=>N.tickets.update(s,{status:t}),onMutate:async({id:s,status:t})=>{await i.cancelQueries({queryKey:["tickets","board"]});const d=i.getQueryData(["tickets","board",{search:o||void 0,projectId:a}]);return i.setQueryData(["tickets","board",{search:o||void 0,projectId:a}],f=>f?.tickets?{...f,tickets:f.tickets.map(v=>v.id===s?{...v,status:t}:v)}:f),{previousData:d}},onError:(s,t,d)=>{d?.previousData&&i.setQueryData(["tickets","board",{search:o||void 0,projectId:a}],d.previousData)},onSettled:()=>{i.invalidateQueries({queryKey:["tickets"]})}}),A=m.useCallback((s,t)=>{b.mutate({id:s,status:t})},[b]),T=y?.tickets??[],K=E.reduce((s,t)=>(s[t.status]=T.filter(d=>d.status===t.status).map(d=>({...d,createdBy:d.createdBy??"human"})),s),{});return D?e.jsxs("div",{className:"premium-card rounded-[28px] p-12 text-center",children:[e.jsx(W,{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 board"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:D.message})]}):e.jsxs("div",{className:"space-y-6 h-full",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.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:"Ticket Board"}),e.jsx("p",{className:"text-muted-foreground text-sm",children:a?`Showing ${c?.name||"Project"} tickets`:"Showing all tickets across projects"})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsxs(H,{children:[e.jsx(J,{asChild:!0,children:e.jsxs(Q,{variant:"outline",size:"sm",className:"gap-2 h-9",children:[e.jsx(q,{className:"h-4 w-4"}),c?e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx("span",{children:c.icon}),e.jsx("span",{className:"max-w-[120px] truncate",children:c.name})]}):"All Projects",e.jsx(X,{className:"h-3 w-3"})]})}),e.jsxs(Y,{align:"end",className:"w-56",children:[e.jsx(w,{onClick:()=>j(void 0),children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(q,{className:"h-4 w-4"}),"All Projects"]})}),e.jsx(B,{}),u.map(s=>e.jsxs(w,{onClick:()=>j(s.id),children:[e.jsx("span",{className:"mr-2",children:s.icon}),e.jsx("span",{className:"truncate",children:s.name}),s.id===a&&e.jsx(k,{className:"h-4 w-4 ml-auto text-primary"})]},s.id)),u.length>0&&c&&e.jsxs(e.Fragment,{children:[e.jsx(B,{}),e.jsx(w,{onClick:()=>r(`/projects/${a}`),children:e.jsx("span",{className:"text-primary",children:"Go to Project Board →"})})]})]})]}),e.jsxs("div",{className:"relative w-48 sm:w-64",children:[e.jsx(Z,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(ee,{placeholder:"Search tickets...",value:o,onChange:s=>p(s.target.value),className:"pl-10 h-9"})]}),e.jsx(ce,{view:"board",onChange:s=>{if(s==="list"){const t=a?`?projectId=${a}`:"";r(`/tickets${t}`)}}}),e.jsx(ie,{})]})]}),F?e.jsx("div",{className:"premium-card rounded-[28px] p-12 flex items-center justify-center",children:e.jsx(P,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):e.jsx("div",{className:"flex gap-4 overflow-x-auto pb-4 -mx-4 px-4 scrollbar-thin",children:E.map(s=>e.jsx(ue,{...s,tickets:K[s.status]??[],onDrop:A},s.status))}),b.isPending&&e.jsxs("div",{className:"fixed bottom-4 right-4 flex items-center gap-2 px-4 py-2 rounded-xl glass-heavy text-sm",children:[e.jsx(P,{className:"h-4 w-4 animate-spin"}),"Updating..."]})]})}export{Ee as TicketBoard};
@@ -0,0 +1 @@
1
+ import{c as ye,r as l,ao as ds,j as e,ap as ve,aq as ms,ar as xs,as as us,at as hs,au as ps,av as js,n as be,u as K,o as q,m as f,X as G,k as h,P as te,I as we,O as gs,i as H,L as D,t as x,a5 as fs,l as Ns,h as V,Q as ze,A as Ae,w as ys,E as vs,s as bs,G as Le,v as ws,D as oe,x as de,y as me,z as Q,J as Re,aw as ks,an as xe,B as ue,a1 as Qe,C as J,T as De,S as Fe}from"./index-kb4AJXUB.js";import{B}from"./badge-B4ov81_m.js";import{T as Ee}from"./textarea-D5LJCOGl.js";import{S as X,a as Y,b as Z,c as ee,d as P}from"./select-LsO16slr.js";import{D as Ve,b as He,c as Ge,d as Ue,e as We,f as Je}from"./dialog-DrWB4EYD.js";import{A as Cs,a as Ss,b as Ts,c as Ps,d as As,e as Ls,f as Rs,g as Ds}from"./alert-dialog-BOmnTkN-.js";import{P as Fs,a as Es,b as Is}from"./popover-BV0QJDQq.js";import{T as Xe}from"./tag-wEJQRWlV.js";import{a as Ie}from"./EstimateSelect-CLpB4NQO.js";import{L as fe}from"./link-2-BxNmr9hL.js";import{P as qs}from"./pencil-D096Ey62.js";import{E as Ms}from"./ellipsis-vertical-BueMfuCw.js";import{T as Os}from"./trash-2-B4oAXsX-.js";import{G as qe}from"./git-branch-BRMiJmV3.js";import{G as _s}from"./git-commit-horizontal-CXOUQeJI.js";import{M as Me}from"./message-square-Bf2-CVbt.js";import{H as he}from"./history-CNqcBBrV.js";import{B as pe}from"./brain-C53ElFLD.js";import{S as Oe}from"./send-BDYBZDUZ.js";import{I as Ye,C as se,L as je}from"./layers-CLXiHN6o.js";import{P as Ne}from"./play-DfdcSI3x.js";import{C as $s}from"./calendar-BkWIhKa1.js";import{L as Bs}from"./lightbulb-B2dgG5ks.js";import{a as _e,B as Ks}from"./bug-D0TJoCYn.js";import"./chevron-up-BRTtndUZ.js";import"./hash-g3102kPC.js";const zs=[["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],$e=ye("ban",zs);const Qs=[["path",{d:"M2 9V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-1",key:"fm4g5t"}],["path",{d:"M2 13h10",key:"pgb2dq"}],["path",{d:"m9 16 3-3-3-3",key:"6m91ic"}]],Be=ye("folder-input",Qs);const Vs=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],ge=ye("link",Vs);var ne="Collapsible",[Hs]=js(ne),[Gs,ke]=Hs(ne),Ze=l.forwardRef((a,o)=>{const{__scopeCollapsible:m,open:c,defaultOpen:u,disabled:y,onOpenChange:j,...L}=a,[g,N]=ds({prop:c,defaultProp:u??!1,onChange:j,caller:ne});return e.jsx(Gs,{scope:m,disabled:y,contentId:ms(),open:g,onOpenToggle:l.useCallback(()=>N(F=>!F),[N]),children:e.jsx(ve.div,{"data-state":Se(g),"data-disabled":y?"":void 0,...L,ref:o})})});Ze.displayName=ne;var es="CollapsibleTrigger",ss=l.forwardRef((a,o)=>{const{__scopeCollapsible:m,...c}=a,u=ke(es,m);return e.jsx(ve.button,{type:"button","aria-controls":u.contentId,"aria-expanded":u.open||!1,"data-state":Se(u.open),"data-disabled":u.disabled?"":void 0,disabled:u.disabled,...c,ref:o,onClick:xs(a.onClick,u.onOpenToggle)})});ss.displayName=es;var Ce="CollapsibleContent",ts=l.forwardRef((a,o)=>{const{forceMount:m,...c}=a,u=ke(Ce,a.__scopeCollapsible);return e.jsx(us,{present:m||u.open,children:({present:y})=>e.jsx(Us,{...c,ref:o,present:y})})});ts.displayName=Ce;var Us=l.forwardRef((a,o)=>{const{__scopeCollapsible:m,present:c,children:u,...y}=a,j=ke(Ce,m),[L,g]=l.useState(c),N=l.useRef(null),F=hs(o,N),d=l.useRef(0),w=d.current,r=l.useRef(0),M=r.current,k=j.open||L,R=l.useRef(k),C=l.useRef(void 0);return l.useEffect(()=>{const v=requestAnimationFrame(()=>R.current=!1);return()=>cancelAnimationFrame(v)},[]),ps(()=>{const v=N.current;if(v){C.current=C.current||{transitionDuration:v.style.transitionDuration,animationName:v.style.animationName},v.style.transitionDuration="0s",v.style.animationName="none";const O=v.getBoundingClientRect();d.current=O.height,r.current=O.width,R.current||(v.style.transitionDuration=C.current.transitionDuration,v.style.animationName=C.current.animationName),g(c)}},[j.open,c]),e.jsx(ve.div,{"data-state":Se(j.open),"data-disabled":j.disabled?"":void 0,id:j.contentId,hidden:!k,...y,ref:F,style:{"--radix-collapsible-content-height":w?`${w}px`:void 0,"--radix-collapsible-content-width":M?`${M}px`:void 0,...a.style},children:k&&u})});function Se(a){return a?"open":"closed"}var Ws=Ze;const Ke=["#EF4444","#F97316","#EAB308","#22C55E","#06B6D4","#3B82F6","#8B5CF6","#EC4899"];function Js({ticketId:a,projectId:o,selectedLabels:m=[],onChange:c,disabled:u=!1,className:y}){const[j,L]=l.useState(!1),[g,N]=l.useState(""),[F,d]=l.useState(!1),[w,r]=l.useState(""),[M,k]=l.useState(Ke[0]),R=be(),{data:C,isLoading:v}=K({queryKey:["labels",o],queryFn:()=>f.labels.list(o,{includeGlobal:!0}),enabled:!!o}),{data:O}=K({queryKey:["ticket-labels",a],queryFn:()=>f.labels.getTicketLabels(a),enabled:!!a}),_=q({mutationFn:i=>f.labels.setTicketLabels(a,i),onSuccess:()=>{R.invalidateQueries({queryKey:["ticket-labels",a]}),R.invalidateQueries({queryKey:["tickets"]})}}),n=q({mutationFn:()=>f.labels.create(o,{name:w,color:M}),onSuccess:i=>{R.invalidateQueries({queryKey:["labels",o]});const p=i.label,I=b.map(z=>z.id);c?c([...b,p]):_.mutate([...I,p.id]),d(!1),N(""),r(""),L(!1)}}),A=C?.labels??[],b=O?.labels??m,S=new Set(b.map(i=>i.id)),E=A.filter(i=>i.name.toLowerCase().includes(g.toLowerCase())||i.description?.toLowerCase().includes(g.toLowerCase())),ie=i=>{const p=new Set(S);p.has(i.id)?p.delete(i.id):p.add(i.id);const I=A.filter(z=>p.has(z.id));c?c(I):_.mutate([...p])},$=i=>{const p=new Set(S);p.delete(i);const I=A.filter(z=>p.has(z.id));c?c(I):_.mutate([...p])};return e.jsxs("div",{className:H("flex flex-wrap items-center gap-1",y),children:[b.map(i=>e.jsxs(B,{variant:"outline",className:"gap-1 pr-1",style:{backgroundColor:`${i.color}20`,borderColor:i.color,color:i.color},children:[e.jsx("span",{className:"h-2 w-2 rounded-full",style:{backgroundColor:i.color}}),i.name,!u&&e.jsx("button",{type:"button",onClick:p=>{p.stopPropagation(),$(i.id)},className:"ml-1 rounded-full hover:bg-muted/50",children:e.jsx(G,{className:"h-3 w-3"})})]},i.id)),!u&&e.jsxs(Fs,{open:j,onOpenChange:i=>{L(i),i||(d(!1),N(""))},children:[e.jsx(Es,{asChild:!0,children:e.jsxs(h,{variant:"ghost",size:"sm",className:"h-6 gap-1 px-2 text-muted-foreground hover:text-foreground",children:[e.jsx(te,{className:"h-3 w-3"}),e.jsx(Xe,{className:"h-3 w-3"})]})}),e.jsxs(Is,{className:"w-64 p-0",align:"start",children:[e.jsx("div",{className:"p-2",children:e.jsx(we,{type:"text",placeholder:"Search labels...",value:g,onChange:i=>N(i.target.value),className:"h-8 text-xs px-2"})}),e.jsx("div",{className:"max-h-64 overflow-y-auto p-1",children:v?e.jsx("div",{className:"p-2 text-center text-sm text-muted-foreground",children:"Loading..."}):E.length===0&&!g?e.jsx("div",{className:"p-2 text-center text-sm text-muted-foreground",children:"No labels found"}):e.jsxs(e.Fragment,{children:[E.map(i=>e.jsxs("button",{type:"button",onClick:()=>ie(i),className:"flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-sm hover:bg-muted",children:[e.jsx("span",{className:"h-3 w-3 rounded-full",style:{backgroundColor:i.color}}),e.jsx("span",{className:"flex-1 text-left",children:i.name}),S.has(i.id)&&e.jsx(gs,{className:"h-4 w-4 text-primary"})]},i.id)),g&&e.jsx("div",{className:"mt-1 border-t pt-1",children:F?e.jsxs("div",{className:"p-2 space-y-2",children:[e.jsx("div",{className:"flex gap-1.5",children:Ke.map(i=>e.jsx("button",{type:"button",onClick:()=>k(i),className:H("h-4 w-4 rounded-full transition-transform hover:scale-110",M===i&&"ring-1 ring-primary ring-offset-1 ring-offset-background"),style:{backgroundColor:i}},i))}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(h,{size:"sm",className:"h-7 text-[10px] flex-1",onClick:()=>n.mutate(),disabled:n.isPending,children:n.isPending?e.jsx(D,{className:"h-3 w-3 animate-spin"}):"Create"}),e.jsx(h,{size:"sm",variant:"ghost",className:"h-7 text-[10px]",onClick:()=>{d(!1),N("")},children:"Cancel"})]})]}):e.jsxs("button",{type:"button",onClick:()=>{d(!0),r(g)},className:"flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-sm text-primary hover:bg-primary/5",children:[e.jsx(te,{className:"h-3 w-3"}),e.jsxs("span",{children:['Create "',g,'"']})]})})]})})]})]})]})}const Xs=Ws,Ys=ss,Zs=ts,ae=[{value:"blocks",label:"Blocks",icon:$e,color:"text-red-400",description:"This ticket blocks another"},{value:"blocked_by",label:"Blocked by",icon:$e,color:"text-orange-400",description:"This ticket is blocked by another"},{value:"relates_to",label:"Relates to",icon:fe,color:"text-blue-400",description:"Related tickets"},{value:"duplicates",label:"Duplicates",icon:ze,color:"text-purple-400",description:"This ticket duplicates another"},{value:"start_before",label:"Start before",icon:Ae,color:"text-cyan-400",description:"Must start before another ticket"},{value:"finish_before",label:"Finish before",icon:Ae,color:"text-emerald-400",description:"Must finish before another ticket"}];function et(a){return ae.find(o=>o.value===a)||ae[2]}function st({ticketId:a,relations:o=[]}){const m=be(),[c,u]=l.useState(!0),[y,j]=l.useState(!1),[L,g]=l.useState("relates_to"),[N,F]=l.useState(""),[d,w]=l.useState(null),{data:r,isLoading:M}=K({queryKey:["tickets-search",N],queryFn:()=>f.tickets.list({search:N,limit:10}),enabled:N.length>=2,staleTime:1e4}),k=r?.tickets?.filter(n=>n.id!==a)||[],R=q({mutationFn:({targetTicketId:n,type:A})=>f.tickets.addRelation(a,n,A),onSuccess:()=>{m.invalidateQueries({queryKey:["ticket",a]}),j(!1),F(""),w(null),x.success("Relation added")},onError:n=>{x.error(`Failed to add relation: ${n.message}`)}}),C=q({mutationFn:n=>f.tickets.removeRelation(a,n),onSuccess:()=>{m.invalidateQueries({queryKey:["ticket",a]}),x.success("Relation removed")},onError:n=>{x.error(`Failed to remove relation: ${n.message}`)}}),v=()=>{if(!d){x.error("Please select a ticket");return}R.mutate({targetTicketId:d,type:L})},O=o.reduce((n,A)=>{const b=A.relationType;return n[b]||(n[b]=[]),n[b].push(A),n},{}),_=o.length;return e.jsxs("div",{className:"glass rounded-[20px] p-4",children:[e.jsxs(Xs,{open:c,onOpenChange:u,children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(Ys,{asChild:!0,children:e.jsxs("button",{className:"flex items-center gap-2 text-sm font-semibold hover:text-primary transition-colors",children:[c?e.jsx(fs,{className:"h-4 w-4"}):e.jsx(Ns,{className:"h-4 w-4"}),e.jsx(fe,{className:"h-4 w-4"}),"Relations",_>0&&e.jsx(B,{variant:"secondary",className:"text-[10px] px-1.5 py-0",children:_})]})}),e.jsx(h,{variant:"ghost",size:"sm",onClick:()=>j(!0),className:"h-7 w-7 p-0 rounded-lg",children:e.jsx(te,{className:"h-4 w-4"})})]}),e.jsx(Zs,{className:"pt-3 space-y-3",children:_===0?e.jsxs("div",{className:"text-center py-4",children:[e.jsx(fe,{className:"h-8 w-8 mx-auto mb-2 text-muted-foreground/40"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"No relations"}),e.jsxs(h,{variant:"outline",size:"sm",onClick:()=>j(!0),className:"mt-2 h-7 text-xs gap-1",children:[e.jsx(te,{className:"h-3 w-3"}),"Add relation"]})]}):Object.entries(O).map(([n,A])=>{const b=et(n);return e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("div",{className:H("flex items-center gap-1.5 text-xs font-medium",b.color),children:[e.jsx(b.icon,{className:"h-3 w-3"}),b.label]}),e.jsx("div",{className:"space-y-1",children:A.map(S=>{const E=S.sourceTicketId===a?S.targetTicket:S.sourceTicket;return E?e.jsxs("div",{className:"flex items-center justify-between gap-2 p-2 rounded-lg bg-white/5 group",children:[e.jsx(V,{to:`/tickets/${E.id}`,className:"flex-1 min-w-0 hover:text-primary transition-colors",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"text-[10px] font-mono text-muted-foreground",children:[E.projectKey||"PROFCLAW","-",E.sequence]}),e.jsx("span",{className:"text-xs truncate",children:E.title})]})}),e.jsx(h,{variant:"ghost",size:"sm",onClick:()=>C.mutate(S.id),disabled:C.isPending,className:"h-6 w-6 p-0 opacity-0 group-hover:opacity-100 transition-opacity",children:C.isPending?e.jsx(D,{className:"h-3 w-3 animate-spin"}):e.jsx(G,{className:"h-3 w-3 text-muted-foreground hover:text-red-400"})})]},S.id):null})})]},n)})})]}),e.jsx(Ve,{open:y,onOpenChange:j,children:e.jsxs(He,{className:"sm:max-w-[425px]",children:[e.jsxs(Ge,{children:[e.jsx(Ue,{children:"Add Relation"}),e.jsx(We,{children:"Link this ticket to another ticket."})]}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:"Relation Type"}),e.jsxs(X,{value:L,onValueChange:n=>g(n),children:[e.jsx(Y,{children:e.jsx(Z,{})}),e.jsx(ee,{children:ae.map(n=>e.jsx(P,{value:n.value,children:e.jsxs("span",{className:H("flex items-center gap-2",n.color),children:[e.jsx(n.icon,{className:"h-4 w-4"}),n.label]})},n.value))})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:ae.find(n=>n.value===L)?.description})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:"Search Ticket"}),e.jsxs("div",{className:"relative",children:[e.jsx(ys,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(we,{placeholder:"Search by title or ID...",value:N,onChange:n=>F(n.target.value),className:"pl-9"})]})]}),N.length>=2&&e.jsx("div",{className:"bg-muted/30 rounded-lg divide-y divide-border/20 max-h-48 overflow-y-auto",children:M?e.jsx("div",{className:"p-4 text-center",children:e.jsx(D,{className:"h-4 w-4 animate-spin mx-auto"})}):k.length===0?e.jsx("div",{className:"p-4 text-center text-sm text-muted-foreground",children:"No tickets found"}):k.map(n=>e.jsx("button",{type:"button",onClick:()=>w(n.id),className:H("w-full text-left p-3 hover:bg-muted/50 transition-colors",d===n.id&&"bg-primary/10"),children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"text-xs font-mono text-muted-foreground",children:[n.projectKey||"PROFCLAW","-",n.sequence]}),e.jsx("span",{className:"text-sm truncate",children:n.title})]})},n.id))}),d&&e.jsxs("div",{className:"p-3 rounded-lg bg-primary/10 border border-primary/20",children:[e.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:"Selected:"}),e.jsx("p",{className:"text-sm font-medium",children:k.find(n=>n.id===d)?.title||"Ticket selected"})]})]}),e.jsxs(Je,{children:[e.jsx(h,{variant:"outline",onClick:()=>j(!1),children:"Cancel"}),e.jsxs(h,{onClick:v,disabled:!d||R.isPending,children:[R.isPending&&e.jsx(D,{className:"h-4 w-4 mr-2 animate-spin"}),"Add Relation"]})]})]})})]})}const tt=[{value:"backlog",label:"Backlog",icon:Ye},{value:"todo",label:"Todo",icon:se},{value:"in_progress",label:"In Progress",icon:Ne},{value:"in_review",label:"In Review",icon:Qe},{value:"done",label:"Done",icon:J},{value:"cancelled",label:"Cancelled",icon:G}];function At(){const{id:a}=vs(),o=bs(),m=be(),[c,u]=l.useState(""),[y,j]=l.useState("comments"),[L,g]=l.useState(!1),[N,F]=l.useState(!1),[d,w]=l.useState({title:"",description:"",priority:"medium",type:"task",estimate:null}),{data:r,isLoading:M,error:k}=K({queryKey:["ticket",a],queryFn:()=>f.tickets.get(a,!0),enabled:!!a}),{data:R}=K({queryKey:["projects"],queryFn:()=>f.projects.list({limit:50})}),{data:C,isLoading:v}=K({queryKey:["ticket-similar",a],queryFn:()=>f.tickets.ai.similar(a,5),enabled:!!a&&!!r}),{data:O,isLoading:_}=K({queryKey:["ticket-summary",a],queryFn:()=>f.tickets.ai.summary(a),enabled:!!a&&!!r,staleTime:3e5}),{data:n}=K({queryKey:["ai-status"],queryFn:()=>f.tickets.ai.status(),staleTime:6e4}),A=n?.available??!1,b=q({mutationFn:s=>f.tickets.transition(a,s),onSuccess:()=>{m.invalidateQueries({queryKey:["ticket",a]}),m.invalidateQueries({queryKey:["tickets"]}),x.success("Status updated")},onError:s=>{x.error(`Failed to update status: ${s.message}`)}}),S=q({mutationFn:s=>f.tickets.update(a,s),onSuccess:()=>{m.invalidateQueries({queryKey:["ticket",a]}),m.invalidateQueries({queryKey:["tickets"]}),g(!1),x.success("Ticket updated")},onError:s=>{x.error(`Failed to update ticket: ${s.message}`)}}),E=q({mutationFn:()=>f.tickets.delete(a),onSuccess:()=>{m.invalidateQueries({queryKey:["tickets"]}),x.success("Ticket deleted"),o("/tickets")},onError:s=>{x.error(`Failed to delete ticket: ${s.message}`)}}),ie=q({mutationFn:s=>f.tickets.update(a,{projectId:s}),onSuccess:()=>{m.invalidateQueries({queryKey:["ticket",a]}),m.invalidateQueries({queryKey:["tickets"]}),x.success("Ticket moved to project")},onError:s=>{x.error(`Failed to move ticket: ${s.message}`)}}),$=q({mutationFn:s=>f.tickets.addComment(a,s),onSuccess:()=>{m.invalidateQueries({queryKey:["ticket",a]}),u(""),x.success("Comment added")},onError:s=>{x.error(`Failed to add comment: ${s.message}`)}}),i=q({mutationFn:s=>f.tickets.ai.respond(a,s),onSuccess:s=>{s.posted&&s.comment?(m.invalidateQueries({queryKey:["ticket",a]}),x.success("AI response posted")):s.response?(I(s.response),U(s.confidence),x.success(`AI generated response (${Math.round(s.confidence*100)}% confidence)`)):s.skipped&&x.info(s.reason||"AI chose not to respond")},onError:s=>{x.error(`AI response failed: ${s.message}`)}}),[p,I]=l.useState(null),[z,U]=l.useState(0),as=async()=>{p&&(await $.mutateAsync(p),I(null),U(0))},ns=()=>{c.trim()&&$.mutate(c)},is=()=>{r&&(w({title:r.title,description:r.description||"",priority:r.priority,type:r.type,estimate:r.estimate??null}),g(!0))},ls=()=>{S.mutate({...d,estimate:d.estimate??void 0,estimateUnit:d.estimate!==null?"points":void 0})},Te=s=>{ie.mutate(s)},rs=async()=>{if(r)try{const s=await f.tickets.create({title:`${r.title} (Copy)`,description:r.description,type:r.type,priority:r.priority,labels:r.labels,projectId:r.projectId});x.success("Ticket duplicated"),o(`/tickets/${s.ticket.id}`)}catch{x.error("Failed to duplicate ticket")}},cs=s=>{const le={done:{variant:"success",icon:J},cancelled:{variant:"destructive",icon:G},in_progress:{variant:"info",icon:Ne},in_review:{variant:"warning",icon:Qe},todo:{variant:"secondary",icon:se},backlog:{variant:"secondary",icon:Ye}}[s],{variant:re,icon:ce}=le;return e.jsxs(B,{variant:re,className:"gap-1 text-sm px-3 py-1",children:[e.jsx(ce,{className:"h-4 w-4"}),s.replace("_"," ")]})},Pe=s=>{const le={task:{icon:J,color:"text-blue-500"},bug:{icon:Ks,color:"text-red-500"},feature:{icon:Fe,color:"text-cyan-500"},enhancement:{icon:Fe,color:"text-indigo-500"},documentation:{icon:_e,color:"text-cyan-500"},epic:{icon:je,color:"text-orange-500"},story:{icon:_e,color:"text-green-500"},subtask:{icon:se,color:"text-gray-500"}}[s],{icon:re,color:ce}=le;return e.jsxs("span",{className:`flex items-center gap-1.5 text-sm ${ce}`,children:[e.jsx(re,{className:"h-4 w-4"}),s]})},os=s=>({urgent:"text-red-500",high:"text-orange-500",medium:"text-yellow-500",low:"text-blue-500",none:"text-gray-400"})[s]||"text-gray-400";if(M)return e.jsx("div",{className:"glass rounded-[28px] p-12 flex items-center justify-center",children:e.jsx(D,{className:"h-8 w-8 animate-spin text-muted-foreground"})});if(k||!r)return e.jsxs("div",{className:"space-y-4",children:[e.jsxs(h,{variant:"ghost",onClick:()=>o("/tickets"),className:"gap-2",children:[e.jsx(Le,{className:"h-4 w-4"}),"Back to Tickets"]}),e.jsxs("div",{className:"glass rounded-[28px] p-12 text-center",children:[e.jsx(ws,{className:"h-12 w-12 mx-auto text-red-400 mb-4"}),e.jsx("p",{className:"text-lg font-bold text-red-400",children:k?"Error loading ticket":"Ticket not found"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:k?k.message:`No ticket found with ID: ${a}`})]})]});const t=r,W=R?.projects||[];return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(h,{variant:"ghost",onClick:()=>o("/tickets"),className:"gap-2",children:[e.jsx(Le,{className:"h-4 w-4"}),"Back to Tickets"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(h,{variant:"outline",size:"sm",onClick:is,className:"gap-2",children:[e.jsx(qs,{className:"h-4 w-4"}),"Edit"]}),e.jsxs(oe,{children:[e.jsx(de,{asChild:!0,children:e.jsxs(h,{variant:"outline",size:"sm",className:"gap-2",children:[e.jsx(Be,{className:"h-4 w-4"}),"Move to Project"]})}),e.jsx(me,{align:"end",className:"w-56",children:W.length===0?e.jsx("div",{className:"px-2 py-4 text-center text-sm text-muted-foreground",children:"No projects available"}):W.map(s=>e.jsxs(Q,{onClick:()=>Te(s.id),disabled:s.id===t.projectId,children:[e.jsx("span",{className:"mr-2",children:s.icon}),s.name,s.id===t.projectId&&e.jsx("span",{className:"ml-auto text-xs text-muted-foreground",children:"(current)"})]},s.id))})]}),e.jsxs(oe,{children:[e.jsx(de,{asChild:!0,children:e.jsx(h,{variant:"outline",size:"icon",className:"h-9 w-9",children:e.jsx(Ms,{className:"h-4 w-4"})})}),e.jsxs(me,{align:"end",children:[e.jsxs(Q,{onClick:rs,children:[e.jsx(ze,{className:"h-4 w-4 mr-2"}),"Duplicate Ticket"]}),e.jsxs(Q,{onClick:()=>{const s=t.externalLinks?.find(T=>T.platform==="jira");s?.externalUrl?window.open(s.externalUrl,"_blank"):x.info("No Jira link found. Link this ticket to Jira first.")},children:[e.jsx(Re,{className:"h-4 w-4 mr-2"}),"Open in Jira"]}),e.jsx(ks,{}),e.jsxs(Q,{className:"text-red-500 focus:text-red-500",onClick:()=>F(!0),children:[e.jsx(Os,{className:"h-4 w-4 mr-2"}),"Delete Ticket"]})]})]})]})]}),e.jsx(Ve,{open:L,onOpenChange:g,children:e.jsxs(He,{className:"sm:max-w-[500px]",children:[e.jsxs(Ge,{children:[e.jsx(Ue,{children:"Edit Ticket"}),e.jsx(We,{children:"Make changes to the ticket details."})]}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:"Title"}),e.jsx(we,{value:d.title,onChange:s=>w(T=>({...T,title:s.target.value})),placeholder:"Ticket title"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:"Description"}),e.jsx(Ee,{value:d.description,onChange:s=>w(T=>({...T,description:s.target.value})),placeholder:"Ticket description",rows:4})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:"Priority"}),e.jsxs(X,{value:d.priority,onValueChange:s=>w(T=>({...T,priority:s})),children:[e.jsx(Y,{children:e.jsx(Z,{})}),e.jsxs(ee,{children:[e.jsx(P,{value:"urgent",children:"Urgent"}),e.jsx(P,{value:"high",children:"High"}),e.jsx(P,{value:"medium",children:"Medium"}),e.jsx(P,{value:"low",children:"Low"}),e.jsx(P,{value:"none",children:"None"})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:"Type"}),e.jsxs(X,{value:d.type,onValueChange:s=>w(T=>({...T,type:s})),children:[e.jsx(Y,{children:e.jsx(Z,{})}),e.jsxs(ee,{children:[e.jsx(P,{value:"task",children:"Task"}),e.jsx(P,{value:"bug",children:"Bug"}),e.jsx(P,{value:"feature",children:"Feature"}),e.jsx(P,{value:"enhancement",children:"Enhancement"}),e.jsx(P,{value:"epic",children:"Epic"}),e.jsx(P,{value:"story",children:"Story"}),e.jsx(P,{value:"subtask",children:"Subtask"})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:"Estimate"}),e.jsx(Ie,{value:d.estimate,onChange:s=>w(T=>({...T,estimate:s})),placeholder:"Points"})]})]})]}),e.jsxs(Je,{children:[e.jsx(h,{variant:"outline",onClick:()=>g(!1),children:"Cancel"}),e.jsxs(h,{onClick:ls,disabled:S.isPending,children:[S.isPending&&e.jsx(D,{className:"h-4 w-4 mr-2 animate-spin"}),"Save Changes"]})]})]})}),e.jsx(Cs,{open:N,onOpenChange:F,children:e.jsxs(Ss,{children:[e.jsxs(Ts,{children:[e.jsx(Ps,{children:"Delete Ticket"}),e.jsxs(As,{children:['Are you sure you want to delete "',t.title,'"? This action cannot be undone.']})]}),e.jsxs(Ls,{children:[e.jsx(Rs,{children:"Cancel"}),e.jsxs(Ds,{onClick:()=>E.mutate(),className:"bg-red-500 hover:bg-red-600",children:[E.isPending&&e.jsx(D,{className:"h-4 w-4 mr-2 animate-spin"}),"Delete"]})]})]})}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[e.jsxs("div",{className:"lg:col-span-2 space-y-6",children:[e.jsxs("div",{className:"glass rounded-[20px] p-6",children:[e.jsxs("div",{className:"flex items-start justify-between mb-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-sm font-mono text-muted-foreground bg-white/5 px-2 py-1 rounded-md",children:[t.projectKey||"PROFCLAW","-",t.sequence]}),!t.projectId&&e.jsx("span",{className:"text-[9px] font-bold uppercase tracking-wider text-amber-400 px-1.5 py-0.5 rounded bg-amber-500/10 border border-amber-500/20",children:"No Project"}),Pe(t.type)]}),cs(t.status)]}),e.jsx("h1",{className:"text-2xl font-bold mb-4",children:t.title}),t.description&&e.jsx("div",{className:"prose prose-sm prose-invert max-w-none",children:e.jsx("p",{className:"text-muted-foreground whitespace-pre-wrap",children:t.description})}),(t.linkedPRs.length>0||t.linkedCommits.length>0||t.linkedBranch)&&e.jsxs("div",{className:"flex flex-wrap gap-4 mt-4 pt-4 border-t border-white/5",children:[t.linkedBranch&&e.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[e.jsx(qe,{className:"h-3.5 w-3.5"}),t.linkedBranch]}),t.linkedPRs.length>0&&e.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[e.jsx(qe,{className:"h-3.5 w-3.5"}),t.linkedPRs.length," PR(s)"]}),t.linkedCommits.length>0&&e.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[e.jsx(_s,{className:"h-3.5 w-3.5"}),t.linkedCommits.length," commit(s)"]})]})]}),e.jsxs("div",{className:"glass rounded-[20px] overflow-hidden",children:[e.jsxs("div",{className:"flex border-b border-white/5",children:[e.jsxs("button",{onClick:()=>j("comments"),className:`flex items-center gap-2 px-4 py-3 text-sm font-medium transition-colors ${y==="comments"?"bg-white/5 text-foreground":"text-muted-foreground hover:text-foreground"}`,children:[e.jsx(Me,{className:"h-4 w-4"}),"Comments (",t.comments?.length||0,")"]}),e.jsxs("button",{onClick:()=>j("history"),className:`flex items-center gap-2 px-4 py-3 text-sm font-medium transition-colors ${y==="history"?"bg-white/5 text-foreground":"text-muted-foreground hover:text-foreground"}`,children:[e.jsx(he,{className:"h-4 w-4"}),"History (",t.history?.length||0,")"]}),e.jsxs("button",{onClick:()=>j("links"),className:`flex items-center gap-2 px-4 py-3 text-sm font-medium transition-colors ${y==="links"?"bg-white/5 text-foreground":"text-muted-foreground hover:text-foreground"}`,children:[e.jsx(ge,{className:"h-4 w-4"}),"Links (",t.externalLinks?.length||0,")"]})]}),e.jsxs("div",{className:"p-4",children:[y==="comments"&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex gap-3",children:[e.jsx("div",{className:"h-8 w-8 rounded-full bg-primary/20 flex items-center justify-center shrink-0",children:e.jsx(xe,{className:"h-4 w-4 text-primary"})}),e.jsxs("div",{className:"flex-1",children:[e.jsx(Ee,{placeholder:"Add a comment...",value:c,onChange:s=>u(s.target.value),className:"min-h-20"}),e.jsxs("div",{className:"flex justify-end mt-2 gap-2",children:[A&&t.comments&&t.comments.length>0&&e.jsxs(h,{size:"sm",variant:"outline",onClick:()=>i.mutate({}),disabled:i.isPending,className:"gap-2",children:[i.isPending?e.jsx(D,{className:"h-4 w-4 animate-spin"}):e.jsx(pe,{className:"h-4 w-4"}),"AI Respond"]}),e.jsxs(h,{size:"sm",variant:"black",onClick:ns,disabled:!c.trim()||$.isPending,className:"gap-2",children:[$.isPending?e.jsx(D,{className:"h-4 w-4 animate-spin"}):e.jsx(Oe,{className:"h-4 w-4"}),"Comment"]})]})]})]}),p&&e.jsxs("div",{className:"rounded-xl bg-primary/5 border border-primary/20 p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("span",{className:"flex items-center gap-2 text-sm font-medium text-primary",children:[e.jsx(pe,{className:"h-4 w-4"}),"AI Generated Response",e.jsxs(B,{variant:"outline",className:"text-[10px] px-1.5 py-0",children:[Math.round(z*100),"% confidence"]})]}),e.jsx(h,{variant:"ghost",size:"sm",onClick:()=>{I(null),U(0)},className:"h-6 w-6 p-0 rounded-lg",children:e.jsx(G,{className:"h-3 w-3"})})]}),e.jsx("p",{className:"text-sm text-muted-foreground whitespace-pre-wrap",children:p}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(h,{size:"sm",variant:"outline",onClick:()=>{u(p),I(null),U(0)},className:"gap-1 rounded-xl border-white/10 text-xs",children:"Edit First"}),e.jsxs(h,{size:"sm",onClick:as,disabled:$.isPending,className:"gap-1 rounded-xl text-xs",children:[$.isPending?e.jsx(D,{className:"h-3 w-3 animate-spin"}):e.jsx(Oe,{className:"h-3 w-3"}),"Post Response"]})]})]}),t.comments&&t.comments.length>0?e.jsx("div",{className:"space-y-4 pt-4 border-t border-white/5",children:t.comments.map(s=>e.jsxs("div",{className:"flex gap-3",children:[e.jsx("div",{className:`h-8 w-8 rounded-full flex items-center justify-center flex-shrink-0 ${s.author.type==="ai","bg-blue-500/20"}`,children:s.author.type==="ai"?e.jsx(ue,{className:"h-4 w-4 text-blue-500"}):e.jsx(xe,{className:"h-4 w-4 text-blue-400"})}),e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("span",{className:"font-medium text-sm",children:s.author.name}),e.jsx("span",{className:"text-xs text-muted-foreground",children:new Date(s.createdAt).toLocaleString()}),s.source!=="profclaw"&&e.jsx(B,{variant:"outline",className:"text-[10px] px-1.5 py-0",children:s.source})]}),e.jsx("p",{className:"text-sm text-muted-foreground whitespace-pre-wrap",children:s.content})]})]},s.id))}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(Me,{className:"h-8 w-8 mx-auto mb-2 opacity-40"}),e.jsx("p",{className:"text-sm",children:"No comments yet"})]})]}),y==="history"&&e.jsx("div",{className:"space-y-3",children:t.history&&t.history.length>0?t.history.map(s=>e.jsxs("div",{className:"flex items-start gap-3 py-2",children:[e.jsx("div",{className:"h-6 w-6 rounded-full bg-white/5 flex items-center justify-center flex-shrink-0 mt-0.5",children:e.jsx(he,{className:"h-3 w-3 text-muted-foreground"})}),e.jsxs("div",{className:"flex-1",children:[e.jsxs("p",{className:"text-sm",children:[e.jsx("span",{className:"font-medium",children:s.changedBy.name}),e.jsx("span",{className:"text-muted-foreground",children:" changed "}),e.jsx("span",{className:"font-medium",children:s.field}),s.oldValue&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-muted-foreground",children:" from "}),e.jsx("span",{className:"text-red-400/80",children:s.oldValue})]}),s.newValue&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-muted-foreground",children:" to "}),e.jsx("span",{className:"text-green-400/80",children:s.newValue})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:new Date(s.timestamp).toLocaleString()})]})]},s.id)):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(he,{className:"h-8 w-8 mx-auto mb-2 opacity-40"}),e.jsx("p",{className:"text-sm",children:"No history yet"})]})}),y==="links"&&e.jsx("div",{className:"space-y-3",children:t.externalLinks&&t.externalLinks.length>0?t.externalLinks.map(s=>e.jsxs("div",{className:"flex items-center justify-between p-3 rounded-xl bg-white/5",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"h-8 w-8 rounded-lg bg-white/5 flex items-center justify-center",children:e.jsx(ge,{className:"h-4 w-4 text-muted-foreground"})}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-sm capitalize",children:s.platform}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s.externalId})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(B,{variant:s.syncEnabled?"success":"secondary",className:"text-[10px]",children:s.syncDirection}),s.externalUrl&&e.jsx("a",{href:s.externalUrl,target:"_blank",rel:"noopener noreferrer",className:"p-2 hover:bg-white/5 rounded-lg transition-colors",children:e.jsx(Re,{className:"h-4 w-4 text-muted-foreground"})})]})]},s.id)):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(ge,{className:"h-8 w-8 mx-auto mb-2 opacity-40"}),e.jsx("p",{className:"text-sm",children:"No external links yet"})]})})]})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"glass rounded-[20px] p-4",children:[e.jsx("h3",{className:"text-sm font-semibold mb-3",children:"Status"}),e.jsxs(X,{value:t.status,onValueChange:s=>b.mutate(s),disabled:b.isPending,children:[e.jsx(Y,{className:"w-full bg-white/5 border-white/10 rounded-xl",children:e.jsx(Z,{})}),e.jsx(ee,{className:"glass-heavy rounded-xl border-white/10",children:tt.map(s=>e.jsx(P,{value:s.value,children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(s.icon,{className:"h-4 w-4"}),s.label]})},s.value))})]})]}),e.jsxs("div",{className:"glass rounded-[20px] p-4 space-y-4",children:[e.jsx("h3",{className:"text-sm font-semibold",children:"Details"}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"Project"}),t.projectId?e.jsx(V,{to:`/projects/${t.projectId}`,className:"text-sm font-medium text-primary hover:underline",children:t.projectName||t.projectKey||"View Project"}):e.jsx("span",{className:"text-sm text-muted-foreground italic",children:"No project"})]}),e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"Priority"}),e.jsx("span",{className:`text-sm font-medium capitalize ${os(t.priority)}`,children:t.priority})]}),e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"Type"}),Pe(t.type)]}),e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"Created By"}),e.jsx("span",{className:"flex items-center gap-1.5 text-sm",children:t.createdBy==="ai"?e.jsxs(e.Fragment,{children:[e.jsx(ue,{className:"h-3.5 w-3.5 text-indigo-400"}),"AI"]}):e.jsxs(e.Fragment,{children:[e.jsx(xe,{className:"h-3.5 w-3.5 text-blue-400"}),"Human"]})})]}),t.assigneeAgent&&e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"Assigned Agent"}),e.jsxs("span",{className:"flex items-center gap-1.5 text-sm text-primary",children:[e.jsx(ue,{className:"h-3.5 w-3.5"}),t.assigneeAgent]})]}),t.aiAgent&&e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"AI Agent"}),e.jsx("span",{className:"text-sm",children:t.aiAgent})]}),e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"Estimate"}),e.jsx(Ie,{value:t.estimate??null,onChange:s=>{S.mutate({estimate:s??void 0,estimateUnit:s!==null?"points":void 0})},compact:!0,placeholder:"—",className:"w-[90px] h-8 text-xs"})]}),t.dueDate&&e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"Due Date"}),e.jsxs("span",{className:"flex items-center gap-1.5 text-sm",children:[e.jsx($s,{className:"h-3.5 w-3.5"}),new Date(t.dueDate).toLocaleDateString()]})]})]})]}),e.jsxs("div",{className:"glass rounded-[20px] p-4 space-y-3",children:[e.jsxs("h3",{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(Xe,{className:"h-4 w-4"}),"Labels"]}),t.projectId?e.jsx(Js,{ticketId:t.id,projectId:t.projectId}):e.jsxs("div",{className:"text-center py-3",children:[e.jsx("p",{className:"text-xs text-muted-foreground mb-2",children:"Assign to a project to add labels"}),e.jsxs(oe,{children:[e.jsx(de,{asChild:!0,children:e.jsxs(h,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1",children:[e.jsx(Be,{className:"h-3 w-3"}),"Select Project"]})}),e.jsx(me,{align:"center",className:"w-48",children:W.length===0?e.jsx("div",{className:"px-2 py-3 text-center text-xs text-muted-foreground",children:"No projects available"}):W.map(s=>e.jsxs(Q,{onClick:()=>Te(s.id),className:"text-sm",children:[e.jsx("span",{className:"mr-2",children:s.icon}),s.name]},s.id))})]})]})]}),e.jsx(st,{ticketId:t.id,relations:t.relations||[]}),t.parent&&e.jsxs("div",{className:"glass rounded-[20px] p-4 space-y-3",children:[e.jsxs("h3",{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(je,{className:"h-4 w-4 text-amber-400"}),"Parent Ticket"]}),e.jsxs(V,{to:`/tickets/${t.parent.id}`,className:"block p-3 rounded-xl bg-white/5 hover:bg-white/10 transition-colors group",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsxs("span",{className:"text-xs font-mono text-muted-foreground",children:[t.parent.projectKey||"PROFCLAW","-",t.parent.sequence]}),t.parent.type==="epic"&&e.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-amber-500/20 text-amber-400 font-medium",children:"EPIC"})]}),e.jsx("p",{className:"text-sm font-medium group-hover:text-primary transition-colors",children:t.parent.title})]})]}),t.children&&t.children.length>0&&e.jsxs("div",{className:"glass rounded-[20px] p-4 space-y-3",children:[e.jsxs("h3",{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(je,{className:"h-4 w-4 text-primary"}),"Child Tickets (",t.children.length,")",e.jsxs("span",{className:"ml-auto text-xs text-muted-foreground",children:[t.children.filter(s=>s.status==="done").length,"/",t.children.length," done"]})]}),e.jsx("div",{className:"h-2 bg-muted rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full bg-gradient-to-r from-green-500 to-emerald-400 transition-all",style:{width:`${t.children.filter(s=>s.status==="done").length/t.children.length*100}%`}})}),e.jsx("div",{className:"space-y-2 max-h-[300px] overflow-y-auto",children:t.children.map(s=>e.jsxs(V,{to:`/tickets/${s.id}`,className:"flex items-center gap-3 p-2 rounded-lg bg-white/5 hover:bg-white/10 transition-colors group",children:[e.jsx("div",{className:`flex-shrink-0 ${s.status==="done"?"text-green-500":s.status==="in_progress"?"text-blue-500":"text-muted-foreground"}`,children:s.status==="done"?e.jsx(J,{className:"h-4 w-4"}):s.status==="in_progress"?e.jsx(Ne,{className:"h-4 w-4"}):e.jsx(se,{className:"h-4 w-4"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("p",{className:"text-xs font-mono text-muted-foreground mb-0.5",children:[s.projectKey||"PROFCLAW","-",s.sequence]}),e.jsx("p",{className:`text-sm truncate group-hover:text-primary transition-colors ${s.status==="done"?"line-through text-muted-foreground":""}`,children:s.title})]}),e.jsx("span",{className:"text-[10px] text-muted-foreground capitalize",children:s.type})]},s.id))})]}),e.jsxs("div",{className:"glass rounded-[20px] p-4 space-y-3",children:[e.jsx("h3",{className:"text-sm font-semibold",children:"Timestamps"}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("span",{className:"text-xs text-muted-foreground",children:"Created"}),e.jsx("span",{className:"text-xs",children:new Date(t.createdAt).toLocaleString()})]}),e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("span",{className:"text-xs text-muted-foreground",children:"Updated"}),e.jsx("span",{className:"text-xs",children:new Date(t.updatedAt).toLocaleString()})]}),t.startedAt&&e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("span",{className:"text-xs text-muted-foreground",children:"Started"}),e.jsx("span",{className:"text-xs",children:new Date(t.startedAt).toLocaleString()})]}),t.completedAt&&e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("span",{className:"text-xs text-muted-foreground",children:"Completed"}),e.jsx("span",{className:"text-xs",children:new Date(t.completedAt).toLocaleString()})]})]})]}),A&&e.jsxs("div",{className:"glass rounded-[20px] p-4 space-y-3",children:[e.jsxs("h3",{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(Bs,{className:"h-4 w-4 text-primary"}),"AI Summary"]}),_?e.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[e.jsx(D,{className:"h-3 w-3 animate-spin"}),"Generating summary..."]}):O?.summary?e.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:O.summary}):e.jsx("p",{className:"text-xs text-muted-foreground italic",children:"Summary not available"})]}),e.jsxs("div",{className:"glass rounded-[20px] p-4 space-y-3",children:[e.jsxs("h3",{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(pe,{className:"h-4 w-4 text-primary"}),"Similar Tickets"]}),v?e.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[e.jsx(D,{className:"h-3 w-3 animate-spin"}),"Finding similar tickets..."]}):C?.similar&&C.similar.length>0?e.jsx("div",{className:"space-y-2",children:C.similar.map(s=>e.jsxs(V,{to:`/tickets/${s.id}`,className:"block p-2 rounded-lg bg-white/5 hover:bg-white/10 transition-colors group",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-0.5",children:[e.jsx(De,{className:"h-3 w-3 text-muted-foreground"}),e.jsxs("span",{className:"text-[10px] font-mono text-muted-foreground",children:[s.projectKey||"PROFCLAW","-",s.sequence]})]}),e.jsx("p",{className:"text-xs font-medium truncate group-hover:text-primary transition-colors",children:s.title})]}),e.jsxs(B,{variant:"outline",className:"text-[10px] px-1.5 py-0 flex-shrink-0 tabular-nums",children:[Math.round(s.similarity*100),"%"]})]}),e.jsxs("div",{className:"flex items-center gap-1.5 mt-1",children:[e.jsx(B,{variant:s.status==="done"?"success":s.status==="in_progress"?"info":"secondary",className:"text-[9px] px-1 py-0",children:s.status.replace("_"," ")}),e.jsx("span",{className:"text-[10px] text-muted-foreground capitalize",children:s.type})]})]},s.id))}):e.jsxs("div",{className:"text-center py-4 text-muted-foreground",children:[e.jsx(De,{className:"h-6 w-6 mx-auto mb-1 opacity-40"}),e.jsx("p",{className:"text-xs",children:"No similar tickets found"})]})]})]})]})]})}export{At as TicketDetail};
@@ -0,0 +1 @@
1
+ import{s as oe,q as ie,r as L,u as O,j as e,v as ce,w as de,I as U,T as k,a1 as Y,C as N,X as P,S as E,F as xe,an as M,B as H,k as S,L as me,h as ue,g as pe,m as q}from"./index-kb4AJXUB.js";import{B as Q}from"./badge-B4ov81_m.js";import{S as j,a as b,b as v,c as f,d as h}from"./select-LsO16slr.js";import{P as he,a as ge,b as je}from"./popover-BV0QJDQq.js";import{V as be,C as ve}from"./ViewSwitcher-BUyOOWDI.js";import{E as fe}from"./EstimateSelect-CLpB4NQO.js";import{I as G,C as T,L as W}from"./layers-CLXiHN6o.js";import{P as X}from"./play-DfdcSI3x.js";import{B as J,a as _}from"./bug-D0TJoCYn.js";import{T as Ne}from"./tag-wEJQRWlV.js";import{F as ye}from"./funnel-B5gmNXGf.js";import"./chevron-up-BRTtndUZ.js";import"./textarea-D5LJCOGl.js";import"./dialog-DrWB4EYD.js";import"./brain-C53ElFLD.js";import"./wand-sparkles-CZy4xvL3.js";import"./folder-open-C_7oYEqe.js";import"./link-2-BxNmr9hL.js";import"./hash-g3102kPC.js";import"./lightbulb-B2dgG5ks.js";const we=[{value:"all",label:"All Status",icon:k},{value:"backlog",label:"Backlog",icon:G},{value:"todo",label:"Todo",icon:T},{value:"in_progress",label:"In Progress",icon:X},{value:"in_review",label:"In Review",icon:Y},{value:"done",label:"Done",icon:N},{value:"cancelled",label:"Cancelled",icon:P}],Ce=[{value:"all",label:"All Types",icon:k},{value:"task",label:"Task",icon:N},{value:"bug",label:"Bug",icon:J},{value:"feature",label:"Feature",icon:E},{value:"epic",label:"Epic",icon:W},{value:"story",label:"Story",icon:_},{value:"subtask",label:"Subtask",icon:T}],Se=[{value:"all",label:"All Priorities",color:"text-muted-foreground"},{value:"urgent",label:"Urgent",color:"text-red-500"},{value:"high",label:"High",color:"text-orange-500"},{value:"medium",label:"Medium",color:"text-yellow-500"},{value:"low",label:"Low",color:"text-blue-500"},{value:"none",label:"None",color:"text-gray-500"}],Pe=[{value:"all",label:"All Authors",icon:M},{value:"human",label:"Human",icon:M},{value:"ai",label:"AI",icon:H}];function Ye(){const Z=oe(),[r,V]=ie(),n=r.get("status")||"all",o=r.get("type")||"all",i=r.get("priority")||"all",l=r.get("project")||"all",c=r.get("createdBy")||"all",t=r.get("label")||"",[u,z]=L.useState(r.get("q")||""),[R,y]=L.useState(""),[x,w]=L.useState(0),p=20,{data:ee}=O({queryKey:["projects-list"],queryFn:()=>q.projects.list({limit:100})}),C=ee?.projects??[],{data:ae}=O({queryKey:["labels-global"],queryFn:async()=>{const a=C[0];return a?q.labels.list(a.id,{includeGlobal:!0}):{labels:[],total:0}},enabled:C.length>0}),D=ae?.labels??[],d=(a,s)=>{const m=new URLSearchParams(r);s==="all"||s===""?m.delete(a):m.set(a,s),V(m),w(0)},se=()=>{V({}),z(""),y(""),w(0)},I=n!=="all"||o!=="all"||i!=="all"||l!=="all"||c!=="all"||t||u,{data:$,isLoading:le,error:K}=O({queryKey:["tickets",{status:n==="all"?void 0:n,type:o==="all"?void 0:o,priority:i==="all"?void 0:i,projectId:l==="all"?void 0:l,createdBy:c==="all"?void 0:c,label:t||void 0,search:u||void 0,limit:p,offset:x*p}],queryFn:()=>q.tickets.list({status:n==="all"?void 0:n,type:o==="all"?void 0:o,priority:i==="all"?void 0:i,projectId:l==="all"?void 0:l,createdBy:c==="all"?void 0:c,label:t||void 0,search:u||void 0,limit:p,offset:x*p})}),g=$?.tickets??[],B=$?.total??0,te=a=>{const m={done:{variant:"success",icon:N},cancelled:{variant:"destructive",icon:P},in_progress:{variant:"info",icon:X},in_review:{variant:"warning",icon:Y},todo:{variant:"secondary",icon:T},backlog:{variant:"secondary",icon:G}}[a]||{variant:"secondary",icon:pe},{variant:A,icon:F}=m;return e.jsxs(Q,{variant:A,className:"gap-1",children:[e.jsx(F,{className:"h-3 w-3"}),a.replace("_"," ")]})},re=a=>{const m={task:{icon:N,color:"text-blue-500"},bug:{icon:J,color:"text-red-500"},feature:{icon:E,color:"text-cyan-500"},enhancement:{icon:E,color:"text-indigo-500"},documentation:{icon:_,color:"text-cyan-500"},epic:{icon:W,color:"text-orange-500"},story:{icon:_,color:"text-green-500"},subtask:{icon:T,color:"text-gray-500"}}[a]||{icon:k,color:"text-gray-500"},{icon:A,color:F}=m;return e.jsxs("span",{className:`flex items-center gap-1 text-xs ${F}`,children:[e.jsx(A,{className:"h-3 w-3"}),a]})},ne=a=>{const s={urgent:"bg-red-500",high:"bg-orange-500",medium:"bg-yellow-500",low:"bg-blue-500",none:"bg-gray-400"};return e.jsx("div",{className:`h-2 w-2 rounded-full ${s[a]}`,title:a})};return K?e.jsxs("div",{className:"premium-card rounded-[24px] p-12 text-center",children:[e.jsx(ce,{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 tickets"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:K.message})]}):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:"Tickets"}),e.jsxs("p",{className:"text-muted-foreground text-sm",children:[B," total tickets • ",g.length," showing"]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(be,{view:"list",onChange:a=>{a==="board"&&Z("/tickets/board")}}),e.jsx(ve,{})]})]}),e.jsxs("div",{className:"premium-card rounded-[20px] p-4 bg-muted/20",children:[e.jsxs("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-center",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(de,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(U,{placeholder:"Search tickets by title or description...",value:u,onChange:a=>{z(a.target.value),d("q",a.target.value)},className:"pl-10 h-10"})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs(j,{value:n,onValueChange:a=>d("status",a),children:[e.jsx(b,{className:"w-[140px]",children:e.jsx(v,{placeholder:"Status"})}),e.jsx(f,{className:"glass-heavy rounded-xl border-white/10",children:we.map(a=>e.jsx(h,{value:a.value,children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(a.icon,{className:"h-3.5 w-3.5"}),a.label]})},a.value))})]}),e.jsxs(j,{value:o,onValueChange:a=>d("type",a),children:[e.jsx(b,{className:"w-[130px]",children:e.jsx(v,{placeholder:"Type"})}),e.jsx(f,{className:"glass-heavy rounded-xl border-white/10",children:Ce.map(a=>e.jsx(h,{value:a.value,children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(a.icon,{className:"h-3.5 w-3.5"}),a.label]})},a.value))})]}),e.jsxs(j,{value:i,onValueChange:a=>d("priority",a),children:[e.jsx(b,{className:"w-[140px]",children:e.jsx(v,{placeholder:"Priority"})}),e.jsx(f,{className:"glass-heavy rounded-xl border-white/10",children:Se.map(a=>e.jsx(h,{value:a.value,children:e.jsx("span",{className:`flex items-center gap-2 ${a.color}`,children:a.label})},a.value))})]}),e.jsxs(j,{value:l,onValueChange:a=>d("project",a),children:[e.jsx(b,{className:"w-[150px]",children:e.jsx(v,{placeholder:"Project"})}),e.jsxs(f,{className:"glass-heavy rounded-xl border-white/10",children:[e.jsx(h,{value:"all",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(xe,{className:"h-3.5 w-3.5"}),"All Projects"]})}),C.map(a=>e.jsx(h,{value:a.id,children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx("span",{children:a.icon}),a.name]})},a.id))]})]}),e.jsxs(j,{value:c,onValueChange:a=>d("createdBy",a),children:[e.jsx(b,{className:"w-[130px]",children:e.jsx(v,{placeholder:"Author"})}),e.jsx(f,{className:"glass-heavy rounded-xl border-white/10",children:Pe.map(a=>e.jsx(h,{value:a.value,children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(a.icon,{className:"h-3.5 w-3.5"}),a.label]})},a.value))})]}),e.jsxs(he,{children:[e.jsx(ge,{asChild:!0,children:e.jsxs(S,{variant:"outline",size:"sm",className:`w-[130px] justify-start ${t?"text-primary":""}`,children:[e.jsx(Ne,{className:"h-3.5 w-3.5 mr-2"}),t||"Label"]})}),e.jsxs(je,{className:"w-64 p-0 glass-heavy rounded-xl border-white/10",align:"start",children:[e.jsx("div",{className:"p-2 border-b border-white/5",children:e.jsx(U,{placeholder:"Search labels...",value:R,onChange:a=>y(a.target.value),className:"h-8 bg-transparent border-white/10"})}),e.jsxs("div",{className:"max-h-64 overflow-y-auto p-1",children:[e.jsxs("button",{type:"button",onClick:()=>{d("label",""),y("")},className:"flex w-full items-center gap-2 rounded-lg px-2 py-1.5 text-sm hover:bg-white/5",children:[e.jsx(P,{className:"h-3.5 w-3.5 text-muted-foreground"}),e.jsx("span",{children:"Clear label filter"})]}),D.filter(a=>a.name.toLowerCase().includes(R.toLowerCase())).map(a=>e.jsxs("button",{type:"button",onClick:()=>{d("label",a.name),y("")},className:`flex w-full items-center gap-2 rounded-lg px-2 py-1.5 text-sm hover:bg-white/5 ${t===a.name?"bg-primary/10":""}`,children:[e.jsx("span",{className:"h-3 w-3 rounded-full shrink-0",style:{backgroundColor:a.color}}),e.jsx("span",{className:"truncate",children:a.name}),t===a.name&&e.jsx(N,{className:"h-3.5 w-3.5 ml-auto text-primary"})]},a.id)),D.length===0&&e.jsx("p",{className:"p-2 text-sm text-muted-foreground text-center",children:"No labels available"})]})]})]}),I&&e.jsxs(S,{variant:"ghost",size:"sm",onClick:se,className:"rounded-xl text-muted-foreground hover:text-foreground",children:[e.jsx(P,{className:"h-4 w-4 mr-1"}),"Clear"]})]})]}),I&&e.jsxs("div",{className:"flex flex-wrap gap-2 mt-3 pt-3 border-t border-white/5",children:[e.jsx(ye,{className:"h-4 w-4 text-muted-foreground"}),n!=="all"&&e.jsxs("span",{className:"px-2 py-0.5 rounded-lg bg-blue-500/10 text-blue-400 text-xs font-medium",children:["Status: ",n]}),o!=="all"&&e.jsxs("span",{className:"px-2 py-0.5 rounded-lg bg-indigo-500/10 text-indigo-400 text-xs font-medium capitalize",children:["Type: ",o]}),i!=="all"&&e.jsxs("span",{className:"px-2 py-0.5 rounded-lg bg-orange-500/10 text-orange-400 text-xs font-medium capitalize",children:["Priority: ",i]}),l!=="all"&&e.jsxs("span",{className:"px-2 py-0.5 rounded-lg bg-indigo-500/10 text-indigo-400 text-xs font-medium",children:["Project: ",C.find(a=>a.id===l)?.name||l]}),c!=="all"&&e.jsxs("span",{className:"px-2 py-0.5 rounded-lg bg-cyan-500/10 text-cyan-400 text-xs font-medium capitalize",children:["Author: ",c]}),t&&e.jsxs("span",{className:"px-2 py-0.5 rounded-lg bg-pink-500/10 text-pink-400 text-xs font-medium",children:["Label: ",t]}),u&&e.jsxs("span",{className:"px-2 py-0.5 rounded-lg bg-green-500/10 text-green-400 text-xs font-medium",children:['Search: "',u,'"']})]})]}),le?e.jsx("div",{className:"premium-card rounded-[28px] p-12 flex items-center justify-center",children:e.jsx(me,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):g.length===0?e.jsxs("div",{className:"premium-card rounded-[24px] p-12 text-center",children:[e.jsx(k,{className:"h-12 w-12 mx-auto text-muted-foreground/40 mb-4"}),e.jsx("p",{className:"text-lg font-bold text-muted-foreground",children:"No tickets found"}),e.jsx("p",{className:"text-sm text-muted-foreground/60 mt-1",children:I?"Try adjusting your filters":"Create a ticket to get started"})]}):e.jsx("div",{className:"space-y-2",children:g.map(a=>e.jsx(ue,{to:`/tickets/${a.id}`,className:"block premium-card border-none hover:bg-muted/30 transition-all group",children:e.jsx("div",{className:"flex items-start justify-between gap-4",children:e.jsxs("div",{className:"flex items-start gap-3 flex-1 min-w-0",children:[e.jsx("div",{className:"pt-1",children:ne(a.priority)}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-1",children:[e.jsxs("span",{className:"text-xs font-mono text-muted-foreground",children:[a.projectKey||"PROFCLAW","-",a.sequence]}),!a.projectId&&e.jsx("span",{className:"text-[9px] font-bold uppercase tracking-wider text-amber-400 px-1.5 py-0.5 rounded bg-amber-500/10 border border-amber-500/20",children:"No Project"}),e.jsx("h3",{className:"font-semibold truncate group-hover:text-primary transition-colors",children:a.title})]}),a.description&&e.jsx("p",{className:"text-sm text-muted-foreground line-clamp-1 mb-2",children:a.description}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[re(a.type),te(a.status),a.assigneeAgent&&e.jsxs("span",{className:"flex items-center gap-1 text-[10px] font-bold uppercase tracking-wider text-primary/80 px-2 py-0.5 rounded-md bg-primary/10",children:[e.jsx(H,{className:"h-3 w-3"}),a.assigneeAgent]}),a.createdBy==="ai"&&e.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider text-blue-400 px-2 py-0.5 rounded-md bg-blue-500/10",children:"AI Created"}),a.labels.slice(0,3).map(s=>e.jsx(Q,{variant:"outline",className:"text-[10px] px-1.5 py-0",children:s},s)),a.estimate!=null&&e.jsx(fe,{value:a.estimate}),e.jsx("span",{className:"text-[10px] text-muted-foreground/50 ml-auto",children:new Date(a.createdAt).toLocaleDateString()})]})]})]})})},a.id))}),g.length>0&&e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Page ",x+1," • Showing ",Math.min(g.length,p)," of ",B]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(S,{variant:"outline",size:"sm",onClick:()=>w(x-1),disabled:x===0,className:"rounded-xl border-white/10",children:"Previous"}),e.jsx(S,{variant:"outline",size:"sm",onClick:()=>w(x+1),disabled:(x+1)*p>=B,className:"rounded-xl border-white/10",children:"Next"})]})]})]})}export{Ye as TicketList};
@@ -0,0 +1,2 @@
1
+ import{n as _,r as l,u as X,o as w,t as a,j as e,U,ad as G,k as r,R as V,i as N,w as W,L as T,bJ as Y,C as R,D as Z,x as ee,y as se,bo as te,aw as v,z as m,_ as ae,ai as E,O as F,Q as P}from"./index-kb4AJXUB.js";import{A as re,a as le,b as ne,c as de,d as ie,e as oe,f as ce,g as me}from"./alert-dialog-BOmnTkN-.js";import{C as M}from"./circle-x-BN89YhbS.js";import{E as xe}from"./ellipsis-NuUWekvu.js";import{S as ue}from"./shield-off-ZFruH9KO.js";import{T as he}from"./trash-2-B4oAXsX-.js";const x="http://localhost:3000";function ve(){const u=_(),[h,L]=l.useState(""),[n,Q]=l.useState(null),[$,p]=l.useState(!1),[d,b]=l.useState(null),[y,C]=l.useState(null),[i,j]=l.useState(null),{data:o,isLoading:g,error:k,refetch:q}=X({queryKey:["admin","users"],queryFn:async()=>{const s=await fetch(`${x}/api/users/admin/list`,{credentials:"include"});if(!s.ok)throw s.status===403?new Error("Admin access required"):new Error("Failed to fetch users");return s.json()}}),S=w({mutationFn:async({userId:s,updates:t})=>{const c=await fetch(`${x}/api/users/admin/${s}`,{method:"PATCH",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(t)});if(!c.ok)throw new Error("Failed to update user");return c.json()},onSuccess:()=>{u.invalidateQueries({queryKey:["admin","users"]}),a.success("User updated")},onError:()=>a.error("Failed to update user")}),f=w({mutationFn:async s=>{const t=await fetch(`${x}/api/users/admin/${s}/reset-password`,{method:"POST",credentials:"include"});if(!t.ok)throw new Error("Failed to reset password");return t.json()},onSuccess:s=>{b({password:s.temporaryPassword,codes:s.recoveryCodes}),u.invalidateQueries({queryKey:["admin","users"]}),a.success("Password reset successfully")},onError:()=>a.error("Failed to reset password")}),I=w({mutationFn:async s=>{const t=await fetch(`${x}/api/users/admin/${s}`,{method:"DELETE",credentials:"include"});if(!t.ok){const c=await t.json().catch(()=>({error:"Failed to delete user"}));throw new Error(c.error||"Failed to delete user")}return t.json()},onSuccess:()=>{u.invalidateQueries({queryKey:["admin","users"]}),a.success("User deleted")},onError:s=>a.error(s.message)}),A=(s,t)=>{navigator.clipboard.writeText(s),C(t),setTimeout(()=>C(null),2e3),a.success(`${t} copied`)},D=o?.users?.filter(s=>s.name.toLowerCase().includes(h.toLowerCase())||s.email.toLowerCase().includes(h.toLowerCase()))||[],z=s=>{const t=s.role==="admin"?"user":"admin";S.mutate({userId:s.id,updates:{role:t}})},K=s=>{const t=s.status==="active"?"suspended":"active";S.mutate({userId:s.id,updates:{status:t}})},O=s=>{Q(s),p(!0),b(null)},B=()=>{n&&f.mutate(n.id)},H=s=>{j(s)},J=()=>{i&&(I.mutate(i.id),j(null))};return k?e.jsx("div",{className:"p-6",children:e.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[e.jsx(U,{className:"h-12 w-12 text-destructive mb-4"}),e.jsx("h2",{className:"text-xl font-semibold mb-2",children:"Access Denied"}),e.jsx("p",{className:"text-muted-foreground",children:k.message})]})}):e.jsxs("div",{className:"p-6 space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"text-2xl font-bold flex items-center gap-3",children:[e.jsx(G,{className:"h-6 w-6"}),"User Management"]}),e.jsx("p",{className:"text-muted-foreground mt-1",children:"Manage user accounts, roles, and permissions"})]}),e.jsxs(r,{variant:"outline",onClick:()=>q(),disabled:g,className:"rounded-xl",children:[e.jsx(V,{className:N("h-4 w-4 mr-2",g&&"animate-spin")}),"Refresh"]})]}),e.jsxs("div",{className:"relative max-w-md",children:[e.jsx(W,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx("input",{type:"text",placeholder:"Search users...",value:h,onChange:s=>L(s.target.value),className:"w-full pl-10 pr-4 py-2 field-lg"})]}),e.jsx("div",{className:"rounded-2xl glass shadow-lg overflow-hidden",children:e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-white/5 bg-muted/30",children:[e.jsx("th",{className:"text-left p-4 text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:"User"}),e.jsx("th",{className:"text-left p-4 text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:"Role"}),e.jsx("th",{className:"text-left p-4 text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:"Status"}),e.jsx("th",{className:"text-left p-4 text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:"Created"}),e.jsx("th",{className:"text-right p-4 text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:"Actions"})]})}),e.jsx("tbody",{children:g?e.jsx("tr",{children:e.jsx("td",{colSpan:5,className:"p-8 text-center",children:e.jsx(T,{className:"h-6 w-6 animate-spin mx-auto text-muted-foreground"})})}):D.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:5,className:"p-8 text-center text-muted-foreground",children:"No users found"})}):D.map(s=>e.jsxs("tr",{className:"border-b border-white/5 last:border-0 hover:bg-muted/20 transition-colors",children:[e.jsx("td",{className:"p-4",children:e.jsxs("div",{className:"flex items-center gap-3",children:[s.avatarUrl?e.jsx("img",{src:s.avatarUrl,alt:s.name,className:"h-10 w-10 rounded-full ring-1 ring-white/10"}):e.jsx("div",{className:"h-10 w-10 rounded-full bg-gradient-to-br from-primary to-primary/60 ring-1 ring-white/10 flex items-center justify-center text-sm font-medium text-white",children:s.name.charAt(0).toUpperCase()}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:s.name}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s.email})]})]})}),e.jsx("td",{className:"p-4",children:e.jsxs("span",{className:N("inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full text-xs font-semibold",s.role==="admin"?"bg-red-500/10 text-red-500":"bg-blue-500/10 text-blue-500"),children:[s.role==="admin"&&e.jsx(Y,{className:"h-3 w-3"}),s.role]})}),e.jsx("td",{className:"p-4",children:e.jsxs("span",{className:N("inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full text-xs font-semibold",s.status==="active"?"bg-green-500/10 text-green-500":"bg-amber-500/10 text-amber-500"),children:[s.status==="active"?e.jsx(R,{className:"h-3 w-3"}):e.jsx(M,{className:"h-3 w-3"}),s.status]})}),e.jsx("td",{className:"p-4 text-sm text-muted-foreground",children:new Date(s.createdAt).toLocaleDateString()}),e.jsx("td",{className:"p-4",children:e.jsx("div",{className:"flex items-center justify-end gap-2",children:e.jsxs(Z,{children:[e.jsx(ee,{asChild:!0,children:e.jsx(r,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 rounded-lg",children:e.jsx(xe,{className:"h-4 w-4"})})}),e.jsxs(se,{align:"end",className:"w-48",children:[e.jsx(te,{children:"Actions"}),e.jsx(v,{}),e.jsx(m,{onClick:()=>z(s),children:s.role==="admin"?e.jsxs(e.Fragment,{children:[e.jsx(ue,{className:"h-4 w-4 mr-2"}),"Remove Admin"]}):e.jsxs(e.Fragment,{children:[e.jsx(ae,{className:"h-4 w-4 mr-2"}),"Make Admin"]})}),e.jsx(m,{onClick:()=>K(s),children:s.status==="active"?e.jsxs(e.Fragment,{children:[e.jsx(M,{className:"h-4 w-4 mr-2"}),"Suspend User"]}):e.jsxs(e.Fragment,{children:[e.jsx(R,{className:"h-4 w-4 mr-2"}),"Activate User"]})}),e.jsx(v,{}),e.jsxs(m,{onClick:()=>O(s),children:[e.jsx(E,{className:"h-4 w-4 mr-2"}),"Reset Password"]}),e.jsx(v,{}),e.jsxs(m,{onClick:()=>H(s),className:"text-destructive focus:text-destructive",children:[e.jsx(he,{className:"h-4 w-4 mr-2"}),"Delete User"]})]})]})})})]},s.id))})]})})}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[e.jsxs("div",{className:"p-4 rounded-2xl glass shadow-lg",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Total Users"}),e.jsx("p",{className:"text-2xl font-bold",children:o?.total||0})]}),e.jsxs("div",{className:"p-4 rounded-2xl glass shadow-lg",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Admins"}),e.jsx("p",{className:"text-2xl font-bold text-red-500",children:o?.users?.filter(s=>s.role==="admin").length||0})]}),e.jsxs("div",{className:"p-4 rounded-2xl glass shadow-lg",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Active"}),e.jsx("p",{className:"text-2xl font-bold text-green-500",children:o?.users?.filter(s=>s.status==="active").length||0})]})]}),e.jsx(re,{open:!!i,onOpenChange:s=>!s&&j(null),children:e.jsxs(le,{children:[e.jsxs(ne,{children:[e.jsx(de,{children:"Delete User"}),e.jsxs(ie,{children:["Are you sure you want to delete ",e.jsx("strong",{children:i?.name}),"? This action cannot be undone and will remove all associated data."]})]}),e.jsxs(oe,{children:[e.jsx(ce,{className:"rounded-xl",children:"Cancel"}),e.jsx(me,{onClick:J,className:"rounded-xl bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete User"})]})]})}),$&&n&&e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm",children:e.jsxs("div",{className:"glass-heavy rounded-2xl shadow-2xl w-full max-w-md mx-4 p-6",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[e.jsx("div",{className:"h-12 w-12 rounded-full bg-amber-500/10 flex items-center justify-center",children:e.jsx(E,{className:"h-6 w-6 text-amber-500"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold",children:"Reset Password"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:n.name})]})]}),d?e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"p-4 rounded-xl bg-muted/30",children:[e.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:"Temporary Password"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("code",{className:"flex-1 font-mono text-sm",children:d.password}),e.jsx(r,{size:"sm",variant:"ghost",className:"h-8 w-8 p-0",onClick:()=>A(d.password,"Password"),children:y==="Password"?e.jsx(F,{className:"h-4 w-4 text-green-500"}):e.jsx(P,{className:"h-4 w-4"})})]})]}),e.jsxs("div",{className:"p-4 rounded-xl bg-muted/30",children:[e.jsx("p",{className:"text-xs text-muted-foreground mb-2",children:"Recovery Codes"}),e.jsx("div",{className:"grid grid-cols-2 gap-2",children:d.codes.map((s,t)=>e.jsx("code",{className:"text-xs font-mono bg-background px-2 py-1 rounded",children:s},t))}),e.jsxs(r,{size:"sm",variant:"outline",className:"w-full mt-3 rounded-xl",onClick:()=>A(d.codes.join(`
2
+ `),"Codes"),children:[y==="Codes"?e.jsx(F,{className:"h-4 w-4 mr-2 text-green-500"}):e.jsx(P,{className:"h-4 w-4 mr-2"}),"Copy All Codes"]})]}),e.jsxs("p",{className:"text-xs text-amber-500 flex items-start gap-2",children:[e.jsx(U,{className:"h-4 w-4 flex-shrink-0 mt-0.5"}),"Share these credentials securely. The user must change their password on next login."]}),e.jsx(r,{className:"w-full rounded-xl",onClick:()=>p(!1),children:"Done"})]}):e.jsxs("div",{className:"space-y-4",children:[e.jsxs("p",{className:"text-sm text-muted-foreground",children:["This will generate a new temporary password and recovery codes for"," ",e.jsx("strong",{children:n.email}),". All existing sessions will be revoked."]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(r,{variant:"outline",className:"flex-1 rounded-xl",onClick:()=>p(!1),children:"Cancel"}),e.jsx(r,{className:"flex-1 rounded-xl",onClick:B,disabled:f.isPending,children:f.isPending?e.jsx(T,{className:"h-4 w-4 animate-spin"}):"Reset Password"})]})]})]})})]})}export{ve as UserManagement};
@@ -0,0 +1 @@
1
+ import{c as se,r as a,n as xe,u as E,o as B,t as n,m,j as e,k as l,P as X,p as c,I as J,L as f,i as V,C as ue,S as he,X as ge,O}from"./index-kb4AJXUB.js";import{T as pe}from"./textarea-D5LJCOGl.js";import{B as q}from"./badge-B4ov81_m.js";import{D as je,a as Ne,b as fe,c as be,d as ve,e as ye,f as we}from"./dialog-DrWB4EYD.js";import{S as b,a as v,b as y,c as w,d as x}from"./select-LsO16slr.js";import{a as ke}from"./EstimateSelect-CLpB4NQO.js";import{B as Ce}from"./brain-C53ElFLD.js";import{W as Z}from"./wand-sparkles-CZy4xvL3.js";import{F as Se}from"./folder-open-C_7oYEqe.js";import{L as _e}from"./link-2-BxNmr9hL.js";import{L as te,C as ze}from"./layers-CLXiHN6o.js";import{a as ae,B as Ie}from"./bug-D0TJoCYn.js";import{H as Ae}from"./hash-g3102kPC.js";import{L as ee}from"./lightbulb-B2dgG5ks.js";const Te=[["path",{d:"M5 3v14",key:"9nsxs2"}],["path",{d:"M12 3v8",key:"1h2ygw"}],["path",{d:"M19 3v18",key:"1sk56x"}]],Le=se("kanban",Te);const Pe=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],Fe=se("list",Pe),Me=[{value:"task",label:"Task",icon:ue},{value:"bug",label:"Bug",icon:Ie},{value:"feature",label:"Feature",icon:he},{value:"epic",label:"Epic",icon:te},{value:"story",label:"Story",icon:ae},{value:"subtask",label:"Subtask",icon:ze}],De=[{value:"urgent",label:"Urgent",color:"text-red-500"},{value:"high",label:"High",color:"text-orange-500"},{value:"medium",label:"Medium",color:"text-yellow-500"},{value:"low",label:"Low",color:"text-blue-500"},{value:"none",label:"None",color:"text-gray-500"}];function Xe({defaultProjectId:u,defaultParentId:h}={}){const[K,R]=a.useState(!1),[i,k]=a.useState(""),[g,C]=a.useState(""),[S,_]=a.useState("task"),[$,z]=a.useState("medium"),[H,p]=a.useState(""),[I,W]=a.useState(null),[j,Q]=a.useState(u),[U,A]=a.useState(h),[T,L]=a.useState(null),[t,Y]=a.useState(null),[ie,P]=a.useState(!1),re=xe(),{data:ne}=E({queryKey:["ai-status"],queryFn:()=>m.tickets.ai.status(),staleTime:6e4}),{data:le}=E({queryKey:["projects"],queryFn:()=>m.projects.list({limit:50})}),{data:ce}=E({queryKey:["tickets","parents",j],queryFn:()=>m.tickets.list({projectId:j||void 0,type:["epic","story"],limit:50}),enabled:K}),oe=le?.projects||[],N=ce?.tickets||[],o=ne?.available??!1,d=B({mutationFn:()=>m.tickets.ai.categorize(i,g||void 0),onSuccess:s=>{s.categorization?(L(s.categorization),_(s.categorization.type),z(s.categorization.priority),s.categorization.labels.length>0&&p(s.categorization.labels.join(", ")),n.success(`AI categorized with ${Math.round(s.categorization.confidence*100)}% confidence`)):n.error("AI could not categorize this ticket")},onError:()=>{n.error("AI categorization failed")}}),F=B({mutationFn:()=>m.tickets.ai.suggest(i,g||void 0,S),onSuccess:s=>{s.suggestions?(Y(s.suggestions),P(!0)):n.error("AI could not generate suggestions")},onError:()=>{n.error("AI suggestion failed")}});a.useEffect(()=>{if(o&&i.length>=10&&!T&&!d.isPending){const s=setTimeout(()=>{d.mutate()},1e3);return()=>clearTimeout(s)}},[i,o]);const M=(s,r)=>{s==="title"&&typeof r=="string"?k(r):s==="description"&&typeof r=="string"?C(r):s==="suggestedLabels"&&Array.isArray(r)&&p(r.join(", ")),n.success(`Applied AI suggestion for ${s}`)},D=B({mutationFn:s=>m.tickets.create(s),onSuccess:s=>{re.invalidateQueries({queryKey:["tickets"]}),n.success(`Ticket PROFCLAW-${s.ticket.sequence} created`),G()},onError:s=>{n.error(`Failed to create ticket: ${s.message}`)}}),G=()=>{R(!1),k(""),C(""),_("task"),z("medium"),p(""),W(null),Q(u),A(h),L(null),Y(null),P(!1)},de=s=>{if(s.preventDefault(),!i.trim()){n.error("Title is required");return}const r=H.split(",").map(me=>me.trim()).filter(Boolean);D.mutate({title:i.trim(),description:g.trim()||void 0,type:S,priority:$,labels:r.length>0?r:void 0,estimate:I??void 0,estimateUnit:I!==null?"points":void 0,projectId:j||void 0,parentId:U||void 0,createdBy:"human"})};return e.jsxs(je,{open:K,onOpenChange:R,children:[e.jsx(Ne,{asChild:!0,children:e.jsxs(l,{className:"gap-2 rounded-xl",children:[e.jsx(X,{className:"h-4 w-4"}),"Create Ticket"]})}),e.jsx(fe,{className:"glass-heavy rounded-[20px] border-white/10 sm:max-w-[500px]",children:e.jsxs("form",{onSubmit:de,children:[e.jsxs(be,{children:[e.jsxs(ve,{className:"flex items-center gap-2",children:["Create Ticket",o&&e.jsxs(q,{variant:"outline",className:"text-xs font-normal gap-1 border-primary/30 text-primary",children:[e.jsx(Ce,{className:"h-3 w-3"}),"AI Assist"]})]}),e.jsxs(ye,{children:["Create a new ticket for your project. ",o?"AI will help categorize and suggest improvements.":"AI agents can pick this up and work on it."]})]}),e.jsxs("div",{className:"grid gap-4 py-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(c,{htmlFor:"title",children:"Title *"}),e.jsx(J,{id:"title",placeholder:"Brief description of the ticket...",value:i,onChange:s=>{k(s.target.value),L(null)},className:"bg-white/5 border-white/10 rounded-xl",autoFocus:!0}),o&&i.length>=10&&e.jsx("div",{className:"flex items-center gap-2 text-xs",children:d.isPending?e.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground",children:[e.jsx(f,{className:"h-3 w-3 animate-spin"}),"AI analyzing..."]}):T?e.jsxs("span",{className:"flex items-center gap-1 text-green-400",children:[e.jsx(Z,{className:"h-3 w-3"}),"AI categorized (",Math.round(T.confidence*100),"% confidence)"]}):null})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(c,{htmlFor:"description",children:"Description"}),e.jsx(pe,{id:"description",placeholder:"Detailed description, acceptance criteria, etc...",value:g,onChange:s=>C(s.target.value),className:"bg-white/5 border-white/10 rounded-xl min-h-[100px] resize-none"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsxs(c,{className:"flex items-center gap-1.5",children:[e.jsx(Se,{className:"h-3.5 w-3.5 text-muted-foreground"}),"Project"]}),e.jsxs(b,{value:j||"__none__",onValueChange:s=>{Q(s==="__none__"?void 0:s),A(void 0)},children:[e.jsx(v,{className:"bg-white/5 border-white/10 rounded-xl",children:e.jsx(y,{placeholder:"Select project..."})}),e.jsxs(w,{className:"glass-heavy rounded-xl border-white/10",children:[e.jsx(x,{value:"__none__",children:e.jsx("span",{className:"text-muted-foreground",children:"No project"})}),oe.map(s=>e.jsx(x,{value:s.id,children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx("span",{children:s.icon}),e.jsx("span",{className:"truncate",children:s.name}),e.jsx("span",{className:"text-[10px] font-mono text-muted-foreground",children:s.key})]})},s.id))]})]})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsxs(c,{className:"flex items-center gap-1.5",children:[e.jsx(_e,{className:"h-3.5 w-3.5 text-muted-foreground"}),"Parent (Epic/Story)"]}),e.jsxs(b,{value:U||"__none__",onValueChange:s=>A(s==="__none__"?void 0:s),disabled:N.length===0,children:[e.jsx(v,{className:V("bg-white/5 border-white/10 rounded-xl",N.length===0&&"opacity-50"),children:e.jsx(y,{placeholder:N.length===0?"No epics/stories":"Select parent..."})}),e.jsxs(w,{className:"glass-heavy rounded-xl border-white/10 max-h-[200px]",children:[e.jsx(x,{value:"__none__",children:e.jsx("span",{className:"text-muted-foreground",children:"No parent"})}),N.map(s=>e.jsx(x,{value:s.id,children:e.jsxs("span",{className:"flex items-center gap-2",children:[s.type==="epic"?e.jsx(te,{className:"h-3.5 w-3.5 text-amber-400"}):e.jsx(ae,{className:"h-3.5 w-3.5 text-cyan-400"}),e.jsxs("span",{className:"text-[10px] font-mono text-muted-foreground",children:[s.projectKey||"PROFCLAW","-",s.sequence]}),e.jsx("span",{className:"truncate max-w-[140px]",children:s.title})]})},s.id))]})]})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(c,{children:"Type"}),e.jsxs(b,{value:S,onValueChange:s=>_(s),children:[e.jsx(v,{className:"bg-white/5 border-white/10 rounded-xl",children:e.jsx(y,{})}),e.jsx(w,{className:"glass-heavy rounded-xl border-white/10",children:Me.map(s=>e.jsx(x,{value:s.value,children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(s.icon,{className:"h-4 w-4"}),s.label]})},s.value))})]})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(c,{children:"Priority"}),e.jsxs(b,{value:$,onValueChange:s=>z(s),children:[e.jsx(v,{className:"bg-white/5 border-white/10 rounded-xl",children:e.jsx(y,{})}),e.jsx(w,{className:"glass-heavy rounded-xl border-white/10",children:De.map(s=>e.jsx(x,{value:s.value,children:e.jsx("span",{className:`flex items-center gap-2 ${s.color}`,children:s.label})},s.value))})]})]})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsxs("div",{className:"col-span-2 grid gap-2",children:[e.jsx(c,{htmlFor:"labels",children:"Labels"}),e.jsx(J,{id:"labels",placeholder:"Comma-separated labels (e.g., frontend, auth)",value:H,onChange:s=>p(s.target.value),className:"bg-white/5 border-white/10 rounded-xl"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsxs(c,{className:"flex items-center gap-1.5",children:[e.jsx(Ae,{className:"h-3.5 w-3.5 text-muted-foreground"}),"Estimate"]}),e.jsx(ke,{value:I,onChange:W,placeholder:"Points"})]})]}),o&&i.length>=5&&e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(l,{type:"button",variant:"outline",size:"sm",onClick:()=>d.mutate(),disabled:d.isPending,className:"flex-1 gap-1 rounded-xl border-white/10 text-xs",children:[d.isPending?e.jsx(f,{className:"h-3 w-3 animate-spin"}):e.jsx(Z,{className:"h-3 w-3"}),"Re-categorize"]}),e.jsxs(l,{type:"button",variant:"outline",size:"sm",onClick:()=>F.mutate(),disabled:F.isPending,className:"flex-1 gap-1 rounded-xl border-white/10 text-xs",children:[F.isPending?e.jsx(f,{className:"h-3 w-3 animate-spin"}):e.jsx(ee,{className:"h-3 w-3"}),"Get AI Suggestions"]})]}),ie&&t&&e.jsxs("div",{className:"rounded-xl bg-primary/5 border border-primary/20 p-3 space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("span",{className:"flex items-center gap-1 text-sm font-medium text-primary",children:[e.jsx(ee,{className:"h-4 w-4"}),"AI Suggestions"]}),e.jsx(l,{type:"button",variant:"ghost",size:"sm",onClick:()=>P(!1),className:"h-6 w-6 p-0 rounded-lg",children:e.jsx(ge,{className:"h-3 w-3"})})]}),t.title&&t.title!==i&&e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:"Improved title:"}),e.jsx("p",{className:"text-sm truncate",children:t.title})]}),e.jsx(l,{type:"button",variant:"ghost",size:"sm",onClick:()=>M("title",t.title),className:"h-6 px-2 rounded-lg text-xs text-green-400 hover:text-green-300",children:e.jsx(O,{className:"h-3 w-3"})})]}),t.description&&e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:"Suggested description:"}),e.jsx("p",{className:"text-sm line-clamp-2",children:t.description})]}),e.jsx(l,{type:"button",variant:"ghost",size:"sm",onClick:()=>M("description",t.description),className:"h-6 px-2 rounded-lg text-xs text-green-400 hover:text-green-300",children:e.jsx(O,{className:"h-3 w-3"})})]}),t.acceptanceCriteria&&t.acceptanceCriteria.length>0&&e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:"Acceptance criteria:"}),e.jsx("ul",{className:"text-xs space-y-0.5 text-muted-foreground",children:t.acceptanceCriteria.slice(0,3).map((s,r)=>e.jsxs("li",{className:"flex items-start gap-1",children:[e.jsx("span",{className:"text-primary",children:"-"}),s]},r))})]}),t.suggestedLabels&&t.suggestedLabels.length>0&&e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:"Suggested labels:"}),e.jsx("div",{className:"flex flex-wrap gap-1",children:t.suggestedLabels.map(s=>e.jsx(q,{variant:"secondary",className:"text-[10px] px-1.5 py-0",children:s},s))})]}),e.jsx(l,{type:"button",variant:"ghost",size:"sm",onClick:()=>M("suggestedLabels",t.suggestedLabels),className:"h-6 px-2 rounded-lg text-xs text-green-400 hover:text-green-300",children:e.jsx(O,{className:"h-3 w-3"})})]}),t.estimatedEffort&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:"Estimated effort:"}),e.jsx(q,{variant:"outline",className:"text-[10px] capitalize",children:t.estimatedEffort})]})]})]}),e.jsxs(we,{children:[e.jsx(l,{type:"button",variant:"ghost",onClick:G,className:"rounded-xl",children:"Cancel"}),e.jsx(l,{type:"submit",disabled:!i.trim()||D.isPending,className:"gap-2 rounded-xl",children:D.isPending?e.jsxs(e.Fragment,{children:[e.jsx(f,{className:"h-4 w-4 animate-spin"}),"Creating..."]}):e.jsxs(e.Fragment,{children:[e.jsx(X,{className:"h-4 w-4"}),"Create Ticket"]})})]})]})})]})}function Je({view:u,onChange:h}){return e.jsxs("div",{className:"flex items-center gap-1 p-1 rounded-xl bg-[var(--muted)]/30 border border-[var(--border)]",children:[e.jsxs("button",{onClick:()=>h("list"),className:V("flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm font-medium transition-all",u==="list"?"bg-[var(--background)] text-[var(--foreground)] shadow-sm":"text-[var(--muted-foreground)] hover:text-[var(--foreground)]"),children:[e.jsx(Fe,{className:"h-4 w-4"}),e.jsx("span",{className:"hidden sm:inline",children:"List"})]}),e.jsxs("button",{onClick:()=>h("board"),className:V("flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm font-medium transition-all",u==="board"?"bg-[var(--background)] text-[var(--foreground)] shadow-sm":"text-[var(--muted-foreground)] hover:text-[var(--foreground)]"),children:[e.jsx(Le,{className:"h-4 w-4"}),e.jsx("span",{className:"hidden sm:inline",children:"Board"})]})]})}export{Xe as C,Je as V};
@@ -0,0 +1,7 @@
1
+ import{j as o,by as L,bK as m,bD as G,r as s,at as u,bL as H,bz as B,ar as V,bB as W,bC as Y,bA as A,bE as k,bl as q,bF as K,av as J,i as n,bM as D}from"./index-kb4AJXUB.js";var v="AlertDialog",[Q]=J(v,[m]),i=m(),x=e=>{const{__scopeAlertDialog:a,...t}=e,r=i(a);return o.jsx(L,{...r,...t,modal:!0})};x.displayName=v;var U="AlertDialogTrigger",N=s.forwardRef((e,a)=>{const{__scopeAlertDialog:t,...r}=e,l=i(t);return o.jsx(K,{...l,...r,ref:a})});N.displayName=U;var X="AlertDialogPortal",y=e=>{const{__scopeAlertDialog:a,...t}=e,r=i(a);return o.jsx(G,{...r,...t})};y.displayName=X;var Z="AlertDialogOverlay",b=s.forwardRef((e,a)=>{const{__scopeAlertDialog:t,...r}=e,l=i(t);return o.jsx(k,{...l,...r,ref:a})});b.displayName=Z;var c="AlertDialogContent",[ee,ae]=Q(c),te=q("AlertDialogContent"),R=s.forwardRef((e,a)=>{const{__scopeAlertDialog:t,children:r,...l}=e,g=i(t),p=s.useRef(null),z=u(a,p),f=s.useRef(null);return o.jsx(H,{contentName:c,titleName:_,docsSlug:"alert-dialog",children:o.jsx(ee,{scope:t,cancelRef:f,children:o.jsxs(B,{role:"alertdialog",...g,...l,ref:z,onOpenAutoFocus:V(l.onOpenAutoFocus,d=>{d.preventDefault(),f.current?.focus({preventScroll:!0})}),onPointerDownOutside:d=>d.preventDefault(),onInteractOutside:d=>d.preventDefault(),children:[o.jsx(te,{children:r}),o.jsx(re,{contentRef:p})]})})})});R.displayName=c;var _="AlertDialogTitle",j=s.forwardRef((e,a)=>{const{__scopeAlertDialog:t,...r}=e,l=i(t);return o.jsx(W,{...l,...r,ref:a})});j.displayName=_;var h="AlertDialogDescription",C=s.forwardRef((e,a)=>{const{__scopeAlertDialog:t,...r}=e,l=i(t);return o.jsx(Y,{...l,...r,ref:a})});C.displayName=h;var oe="AlertDialogAction",E=s.forwardRef((e,a)=>{const{__scopeAlertDialog:t,...r}=e,l=i(t);return o.jsx(A,{...l,...r,ref:a})});E.displayName=oe;var w="AlertDialogCancel",P=s.forwardRef((e,a)=>{const{__scopeAlertDialog:t,...r}=e,{cancelRef:l}=ae(w,t),g=i(t),p=u(a,l);return o.jsx(A,{...g,...r,ref:p})});P.displayName=w;var re=({contentRef:e})=>{const a=`\`${c}\` requires a description for the component to be accessible for screen reader users.
2
+
3
+ You can add a description to the \`${c}\` by passing a \`${h}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
4
+
5
+ Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${c}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
6
+
7
+ For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return s.useEffect(()=>{document.getElementById(e.current?.getAttribute("aria-describedby"))||console.warn(a)},[a,e]),null},se=x,le=N,ie=y,S=b,T=R,O=E,$=P,M=j,I=C;const De=se,ve=le,ne=ie,F=s.forwardRef(({className:e,...a},t)=>o.jsx(S,{className:n("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...a,ref:t}));F.displayName=S.displayName;const ce=s.forwardRef(({className:e,...a},t)=>o.jsxs(ne,{children:[o.jsx(F,{}),o.jsx(T,{ref:t,className:n("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 p-6 shadow-2xl modal-glass duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-2xl",e),...a})]}));ce.displayName=T.displayName;const de=({className:e,...a})=>o.jsx("div",{className:n("flex flex-col space-y-2 text-center sm:text-left",e),...a});de.displayName="AlertDialogHeader";const pe=({className:e,...a})=>o.jsx("div",{className:n("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...a});pe.displayName="AlertDialogFooter";const ge=s.forwardRef(({className:e,...a},t)=>o.jsx(M,{ref:t,className:n("text-lg font-semibold",e),...a}));ge.displayName=M.displayName;const fe=s.forwardRef(({className:e,...a},t)=>o.jsx(I,{ref:t,className:n("text-sm text-muted-foreground",e),...a}));fe.displayName=I.displayName;const me=s.forwardRef(({className:e,...a},t)=>o.jsx(O,{ref:t,className:n(D(),e),...a}));me.displayName=O.displayName;const ue=s.forwardRef(({className:e,...a},t)=>o.jsx($,{ref:t,className:n(D({variant:"outline"}),"mt-2 sm:mt-0",e),...a}));ue.displayName=$.displayName;export{De as A,ce as a,de as b,ge as c,fe as d,pe as e,ue as f,me as g,ve as h};
@@ -0,0 +1 @@
1
+ import{c as e}from"./index-kb4AJXUB.js";const c=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]],a=e("archive",c);export{a as A};
@@ -0,0 +1 @@
1
+ import{j as n,i as o,bI as s}from"./index-kb4AJXUB.js";const a=s("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-[var(--ring)] focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow-sm hover:brightness-110",secondary:"border-transparent bg-secondary text-secondary-foreground",destructive:"border-transparent bg-destructive text-destructive-foreground shadow-sm",outline:"border-border text-foreground hover:bg-muted/50",success:"border-transparent bg-success/10 text-success border border-success/20",warning:"border-transparent bg-warning/10 text-warning border border-warning/20",info:"border-transparent bg-info/10 text-info border border-info/20"}},defaultVariants:{variant:"default"}});function i({className:r,variant:e,...t}){return n.jsx("div",{className:o(a({variant:e}),r),...t})}export{i as B};
@@ -0,0 +1 @@
1
+ import{c as a}from"./index-kb4AJXUB.js";const e=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],t=a("brain",e);export{t as B};
@@ -0,0 +1 @@
1
+ import{c as a}from"./index-kb4AJXUB.js";const t=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],p=a("book-open",t);const e=[["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z",key:"uouzyp"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M21 21a4 4 0 0 0-3.81-4",key:"1b0z45"}],["path",{d:"M21 5a4 4 0 0 1-3.55 3.97",key:"5cxbf6"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M3 21a4 4 0 0 1 3.81-4",key:"1fjd4g"}],["path",{d:"M3 5a4 4 0 0 0 3.55 3.97",key:"1d7oge"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M9 7.13V6a3 3 0 1 1 6 0v1.13",key:"1vgav8"}]],d=a("bug",e);export{d as B,p as a};
@@ -0,0 +1 @@
1
+ import{c as e}from"./index-kb4AJXUB.js";const t=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],a=e("calendar",t);export{a as C};
@@ -0,0 +1 @@
1
+ import{c as o}from"./index-kb4AJXUB.js";const c=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],n=o("chevron-up",c);export{n as C};
@@ -0,0 +1 @@
1
+ import{c}from"./index-kb4AJXUB.js";const e=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],o=c("circle-x",e);export{o as C};
@@ -0,0 +1 @@
1
+ import{c as e,an as s,aK as i,S as l,ai as r,_ as c,aB as p,aC as n,aE as d,aF as u,aL as m,aM as g,aN as y,aH as h,aG as k,aO as b,aP as L,aQ as v,aR as M,aS as A,aT as f,aU as I,aV as x,aI as w,aD as U,aW as S,aJ as _,aX as C,aY as P,aZ as G,a_ as z,a$ as N,b0 as T,b1 as V,b2 as B,b3 as R,b4 as q,b5 as D,b6 as E,b7 as O,b8 as H}from"./index-kb4AJXUB.js";import{S as F}from"./settings-2-Cu4xTjhG.js";import{T as K}from"./tag-wEJQRWlV.js";import{S as W}from"./smartphone-DnoksVkc.js";import{B as $}from"./brain-C53ElFLD.js";import{W as Q}from"./wrench-ByZkjO6m.js";import{D as j}from"./database-D9Cnfmzj.js";import{G as X}from"./globe-CCspjvus.js";import{C as Z}from"./cpu-B41x1-vV.js";const J=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],Ie=e("code-xml",J);const Y=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]],ee=e("message-circle",Y);const oe=[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["rect",{x:"9",y:"2",width:"6",height:"13",rx:"3",key:"s6n7sd"}]],ae=e("mic",oe);const te=[["path",{d:"M18 8V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h8",key:"10dyio"}],["path",{d:"M10 19v-3.96 3.15",key:"1irgej"}],["path",{d:"M7 19h5",key:"qswx4l"}],["rect",{width:"6",height:"10",x:"16",y:"12",rx:"2",key:"1egngj"}]],se=e("monitor-smartphone",te);const ie=[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z",key:"1xoxul"}],["path",{d:"M9 8V2",key:"14iosj"}]],le=e("plug",ie);const re=[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]],ce=e("puzzle",re);const pe=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],xe=e("shield-alert",pe);const ne=[["path",{d:"M15 21v-5a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v5",key:"slp6dd"}],["path",{d:"M17.774 10.31a1.12 1.12 0 0 0-1.549 0 2.5 2.5 0 0 1-3.451 0 1.12 1.12 0 0 0-1.548 0 2.5 2.5 0 0 1-3.452 0 1.12 1.12 0 0 0-1.549 0 2.5 2.5 0 0 1-3.77-3.248l2.889-4.184A2 2 0 0 1 7 2h10a2 2 0 0 1 1.653.873l2.895 4.192a2.5 2.5 0 0 1-3.774 3.244",key:"o0xfot"}],["path",{d:"M4 10.95V19a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8.05",key:"wn3emo"}]],de=e("store",ne);const ue=[["path",{d:"M14.5 2v17.5c0 1.4-1.1 2.5-2.5 2.5c-1.4 0-2.5-1.1-2.5-2.5V2",key:"125lnx"}],["path",{d:"M8.5 2h7",key:"csnxdl"}],["path",{d:"M14.5 16h-5",key:"1ox875"}]],we=e("test-tube",ue);const me=[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]],Ue=e("volume-2",me),Se=[{id:"general",label:"General",icon:F,description:"Appearance and preferences"},{id:"account",label:"Account",icon:s,description:"Profile and recovery codes"},{id:"notifications",label:"Notifications",icon:i,description:"Alert preferences"},{id:"ai-providers",label:"AI Providers",icon:l,description:"Configure AI models"},{id:"labels",label:"Labels",icon:K,description:"Manage project labels"},{id:"integrations",label:"Integrations",icon:r,description:"API keys and services"},{id:"messaging",label:"Messaging",icon:ee,description:"Telegram, Discord, WhatsApp"},{id:"devices",label:"Devices",icon:W,description:"Manage paired devices"},{id:"memory",label:"Memory",icon:$,description:"Semantic memory system"},{id:"skills",label:"Skills",icon:ce,description:"Modular AI capabilities"},{id:"tools",label:"Tools",icon:Q,description:"AI tool configuration"},{id:"security",label:"Security",icon:c,description:"Tool execution security"},{id:"plugins",label:"Plugins & MCP",icon:le,description:"Extensions and MCP"},{id:"marketplace",label:"Marketplace",icon:de,description:"Browse and install plugins & skills"},{id:"storage",label:"Storage",icon:j,description:"Data and backup"},{id:"voice",label:"Voice",icon:ae,description:"Speech recognition and synthesis"},{id:"pwa",label:"App & Notifications",icon:se,description:"Install app, push notifications"},{id:"tunnels",label:"Tunnels",icon:X,description:"Remote access via Tailscale or Cloudflare"},{id:"system",label:"System",icon:Z,description:"Advanced settings"}],_e=[{type:"anthropic",name:"Anthropic",description:"Claude Opus, Sonnet, Haiku",Logo:p,setupUrl:"https://console.anthropic.com/settings/keys",placeholder:"sk-ant-...",category:"cloud",models:[]},{type:"openai",name:"OpenAI",description:"GPT-4.5, o1, o3-mini",Logo:n,setupUrl:"https://platform.openai.com/api-keys",placeholder:"sk-...",category:"cloud",models:[]},{type:"google",name:"Google AI",description:"Gemini 2.5 Pro, Flash",Logo:d,setupUrl:"https://makersuite.google.com/app/apikey",placeholder:"AIza...",category:"cloud",models:[]},{type:"xai",name:"xAI (Grok)",description:"Grok 2, Grok 3 models",Logo:u,setupUrl:"https://console.x.ai/",placeholder:"xai-...",category:"cloud",models:[]},{type:"mistral",name:"Mistral AI",description:"Mistral Large, Medium, Codestral",Logo:m,setupUrl:"https://console.mistral.ai/api-keys/",placeholder:"your-key...",category:"cloud",models:[]},{type:"cohere",name:"Cohere",description:"Command R, R+",Logo:g,setupUrl:"https://dashboard.cohere.com/api-keys",placeholder:"your-key...",category:"cloud",models:[]},{type:"perplexity",name:"Perplexity",description:"Sonar models with search",Logo:y,setupUrl:"https://www.perplexity.ai/settings/api",placeholder:"pplx-...",category:"cloud",models:[]},{type:"deepseek",name:"DeepSeek",description:"DeepSeek Chat, Coder, R1",Logo:h,setupUrl:"https://platform.deepseek.com/api_keys",placeholder:"sk-...",category:"cloud",models:[]},{type:"groq",name:"Groq",description:"Ultra-fast Llama & Mixtral",Logo:k,setupUrl:"https://console.groq.com/keys",placeholder:"gsk_...",category:"cloud",models:[]},{type:"together",name:"Together AI",description:"Fast open-source models",Logo:b,setupUrl:"https://api.together.xyz/settings/api-keys",placeholder:"your-key...",category:"cloud",models:[]},{type:"cerebras",name:"Cerebras",description:"Fastest Llama inference",Logo:L,setupUrl:"https://cloud.cerebras.ai/",placeholder:"csk-...",category:"cloud",models:[]},{type:"fireworks",name:"Fireworks",description:"Fast serverless inference",Logo:v,setupUrl:"https://fireworks.ai/account/api-keys",placeholder:"fw-...",category:"cloud",models:[]},{type:"replicate",name:"Replicate",description:"Hosted open-source models (Llama, Mixtral)",Logo:M,setupUrl:"https://replicate.com/account/api-tokens",placeholder:"r8_...",category:"cloud",models:[],status:"beta"},{type:"github-models",name:"GitHub Models",description:"GPT-4o, Phi-4, Llama via GitHub",Logo:A,setupUrl:"https://github.com/marketplace/models",placeholder:"ghp_...",category:"cloud",models:[],status:"beta"},{type:"zhipu",name:"Zhipu AI",description:"GLM-5, GLM-4.7, GLM-4 series",Logo:f,setupUrl:"https://open.bigmodel.cn/usercenter/apikeys",placeholder:"your-key...",category:"cloud",models:[],status:"beta"},{type:"moonshot",name:"Moonshot (Kimi)",description:"Long-context Kimi models (1M tokens)",Logo:I,setupUrl:"https://platform.moonshot.cn/console/api-keys",placeholder:"sk-...",category:"cloud",models:[],status:"beta"},{type:"qwen",name:"Qwen (Alibaba)",description:"Qwen-Max, Qwen-Plus, Qwen-Turbo",Logo:x,setupUrl:"https://dashscope.console.aliyun.com/apiKey",placeholder:"sk-...",category:"cloud",models:[],status:"beta"},{type:"openrouter",name:"OpenRouter",description:"300+ models via one API",Logo:w,setupUrl:"https://openrouter.ai/keys",placeholder:"sk-or-...",category:"cloud",models:[]},{type:"azure",name:"Azure OpenAI",description:"Enterprise GPT-4 via Azure / Foundry",Logo:U,setupUrl:"https://portal.azure.com/",placeholder:"your-key...",category:"enterprise",models:[],requiresBaseUrl:!0},{type:"bedrock",name:"AWS Bedrock",description:"Claude, Llama, Mistral via AWS",Logo:S,setupUrl:"https://console.aws.amazon.com/bedrock/",placeholder:"AKIA...",category:"enterprise",models:[],status:"stable"},{type:"ollama",name:"Ollama (Local)",description:"Run models locally - free",Logo:_,setupUrl:"https://ollama.ai/download",placeholder:"http://localhost:11434",category:"local",models:[],requiresBaseUrl:!0},{type:"copilot",name:"GitHub Copilot",description:"Use your Copilot subscription (experimental)",Logo:C,setupUrl:"https://github.com/ericc-ch/copilot-api",placeholder:"http://localhost:4141",category:"local",models:[],requiresBaseUrl:!0,status:"experimental"},{type:"volcengine",name:"Volcengine Doubao",description:"Bytedance Doubao Pro/Lite models",Logo:P,setupUrl:"https://console.volcengine.com/ark/region:ark+cn-beijing/apiKey",placeholder:"your-key...",category:"cloud",models:[],status:"beta"},{type:"byteplus",name:"BytePlus",description:"International Bytedance AI models",Logo:G,setupUrl:"https://console.byteplus.com/",placeholder:"your-key...",category:"cloud",models:[],status:"beta"},{type:"qianfan",name:"Baidu Qianfan",description:"ERNIE Bot 4.0, ERNIE Speed",Logo:z,setupUrl:"https://console.bce.baidu.com/qianfan/ais/console/applicationConsole/application",placeholder:"your-key...",category:"cloud",models:[],status:"beta"},{type:"modelstudio",name:"ModelStudio",description:"Alibaba DashScope compatible mode",Logo:N,setupUrl:"https://dashscope.console.aliyun.com/apiKey",placeholder:"sk-...",category:"cloud",models:[],status:"experimental"},{type:"minimax",name:"Minimax",description:"abab6.5, abab5.5 models (245k context)",Logo:T,setupUrl:"https://www.minimaxi.com/user-center/basic-information/interface-key",placeholder:"your-key...",category:"cloud",models:[],status:"beta"},{type:"xiaomi",name:"Xiaomi MiLM",description:"Xiaomi AI language models",Logo:V,setupUrl:"https://ai.xiaomi.com/",placeholder:"your-key...",category:"cloud",models:[],status:"experimental"},{type:"huggingface",name:"HuggingFace",description:"Llama, Mistral, and 1000s of open models",Logo:B,setupUrl:"https://huggingface.co/settings/tokens",placeholder:"hf_...",category:"cloud",models:[],status:"beta"},{type:"nvidia-nim",name:"NVIDIA NIM",description:"Llama 3.1 405B, Mixtral via NVIDIA",Logo:R,setupUrl:"https://build.nvidia.com/explore/discover",placeholder:"nvapi-...",category:"cloud",models:[],status:"beta"},{type:"venice",name:"Venice AI",description:"Privacy-preserving AI inference",Logo:q,setupUrl:"https://venice.ai/settings/api",placeholder:"your-key...",category:"cloud",models:[],status:"experimental"},{type:"kilocode",name:"Kilocode",description:"AI-powered code assistance",Logo:D,setupUrl:"https://kilocode.ai/",placeholder:"your-key...",category:"cloud",models:[],status:"experimental"},{type:"vercel-ai",name:"Vercel AI Gateway",description:"Unified gateway for multiple AI providers",Logo:E,setupUrl:"https://vercel.com/docs/ai/gateway",placeholder:"your-key...",category:"cloud",models:[],status:"beta"},{type:"cloudflare-ai",name:"Cloudflare AI Gateway",description:"Route AI calls via Cloudflare Workers AI",Logo:O,setupUrl:"https://dash.cloudflare.com/?to=/:account/ai/ai-gateway",placeholder:"your-token...",category:"cloud",models:[],requiresBaseUrl:!0,status:"beta"},{type:"watsonx",name:"IBM Watsonx",description:"Granite enterprise AI models",Logo:H,setupUrl:"https://dataplatform.cloud.ibm.com/wx/home",placeholder:"your-key...",category:"enterprise",models:[],status:"stable"}],Ce=[{value:"2024-10-21",label:"2024-10-21 (Recommended - Stable)"},{value:"2024-12-01-preview",label:"2024-12-01-preview (For o1/o1-mini)"},{value:"2025-01-01-preview",label:"2025-01-01-preview (Latest Preview)"},{value:"2024-08-01-preview",label:"2024-08-01-preview"},{value:"2024-02-15-preview",label:"2024-02-15-preview (Legacy)"}];function Pe(o){if(!o)return{valid:!0};try{if(!new URL(o).protocol.startsWith("https"))return{valid:!1,message:"Must use HTTPS"};const a=o.includes("openai.azure.com"),t=o.includes("cognitive.microsoft.com")||o.includes("cognitiveservices.azure.com");return a||t?{valid:!0}:{valid:!1,message:"Must be an Azure endpoint (e.g., https://your-resource.openai.azure.com or https://eastus.api.cognitive.microsoft.com)"}}catch{return{valid:!1,message:"Invalid URL format"}}}const Ge="http://localhost:3000";export{Ce as A,Ie as C,ae as M,ce as P,xe as S,we as T,Ue as V,_e as a,Ge as b,le as c,de as d,Se as e,ee as f,Pe as v};
@@ -0,0 +1 @@
1
+ import{c as h}from"./index-kb4AJXUB.js";const t=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],d=h("cpu",t);export{d as C};
@@ -0,0 +1 @@
1
+ import{c as e}from"./index-kb4AJXUB.js";const a=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],s=e("database",a);export{s as D};
@@ -0,0 +1,2 @@
1
+ function i(r,t){(t==null||t>r.length)&&(t=r.length);for(var e=0,o=Array(t);e<t;e++)o[e]=r[e];return o}function u(r){if(Array.isArray(r))return i(r)}function a(r){if(typeof Symbol<"u"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}function l(r,t){if(r){if(typeof r=="string")return i(r,t);var e={}.toString.call(r).slice(8,-1);return e==="Object"&&r.constructor&&(e=r.constructor.name),e==="Map"||e==="Set"?Array.from(r):e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?i(r,t):void 0}}function y(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
2
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function c(r){return u(r)||a(r)||l(r)||y()}function n(r){"@babel/helpers - typeof";return n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(r)}function f(r,t){if(n(r)!="object"||!r)return r;var e=r[Symbol.toPrimitive];if(e!==void 0){var o=e.call(r,t);if(n(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(r)}function b(r){var t=f(r,"string");return n(t)=="symbol"?t:t+""}function m(r,t,e){return(t=b(t))in r?Object.defineProperty(r,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):r[t]=e,r}export{l as _,m as a,c as b};
@@ -0,0 +1 @@
1
+ import{by as f,bF as p,r as l,j as t,bD as g,bz as i,bA as x,X as u,i as o,bB as d,bC as n,bE as r}from"./index-kb4AJXUB.js";const w=f,R=p,y=g,c=l.forwardRef(({className:a,...e},s)=>t.jsx(r,{ref:s,className:o("fixed inset-0 z-50 bg-black/40 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",a),...e}));c.displayName=r.displayName;const N=l.forwardRef(({className:a,children:e,...s},m)=>t.jsxs(y,{children:[t.jsx(c,{}),t.jsxs(i,{ref:m,className:o("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 p-6 shadow-2xl modal-glass duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-2xl",a),...s,children:[e,t.jsxs(x,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-[var(--background)] transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-[var(--ring)] focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-[var(--accent)] data-[state=open]:text-[var(--muted-foreground)]",children:[t.jsx(u,{className:"h-4 w-4"}),t.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));N.displayName=i.displayName;const b=({className:a,...e})=>t.jsx("div",{className:o("flex flex-col space-y-1.5 text-center sm:text-left",a),...e});b.displayName="DialogHeader";const D=({className:a,...e})=>t.jsx("div",{className:o("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",a),...e});D.displayName="DialogFooter";const j=l.forwardRef(({className:a,...e},s)=>t.jsx(d,{ref:s,className:o("text-lg font-semibold leading-none tracking-tight",a),...e}));j.displayName=d.displayName;const v=l.forwardRef(({className:a,...e},s)=>t.jsx(n,{ref:s,className:o("text-sm text-[var(--muted-foreground)]",a),...e}));v.displayName=n.displayName;export{w as D,R as a,N as b,b as c,j as d,v as e,D as f};