@kaitranntt/ccs 7.68.1-dev.9 → 7.68.2

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 (254) hide show
  1. package/dist/auth/commands/create-command-env.d.ts +0 -1
  2. package/dist/auth/commands/create-command-env.d.ts.map +1 -1
  3. package/dist/ccs.js +2 -55
  4. package/dist/ccs.js.map +1 -1
  5. package/dist/channels/official-channels-runtime.d.ts +0 -1
  6. package/dist/channels/official-channels-runtime.d.ts.map +1 -1
  7. package/dist/channels/official-channels-store.d.ts +0 -1
  8. package/dist/channels/official-channels-store.d.ts.map +1 -1
  9. package/dist/cliproxy/base-config-loader.d.ts +0 -1
  10. package/dist/cliproxy/base-config-loader.d.ts.map +1 -1
  11. package/dist/cliproxy/config/env-builder.d.ts +0 -1
  12. package/dist/cliproxy/config/env-builder.d.ts.map +1 -1
  13. package/dist/cliproxy/config/extended-context-config.d.ts +0 -1
  14. package/dist/cliproxy/config/extended-context-config.d.ts.map +1 -1
  15. package/dist/cliproxy/config/thinking-config.d.ts +0 -1
  16. package/dist/cliproxy/config/thinking-config.d.ts.map +1 -1
  17. package/dist/cliproxy/executor/env-resolver.d.ts +0 -2
  18. package/dist/cliproxy/executor/env-resolver.d.ts.map +1 -1
  19. package/dist/cliproxy/executor/env-resolver.js +1 -2
  20. package/dist/cliproxy/executor/env-resolver.js.map +1 -1
  21. package/dist/cliproxy/executor/index.d.ts.map +1 -1
  22. package/dist/cliproxy/executor/index.js +1 -28
  23. package/dist/cliproxy/executor/index.js.map +1 -1
  24. package/dist/cliproxy/model-id-normalizer.d.ts +0 -1
  25. package/dist/cliproxy/model-id-normalizer.d.ts.map +1 -1
  26. package/dist/cliproxy/routing-strategy-http.d.ts +0 -1
  27. package/dist/cliproxy/routing-strategy-http.d.ts.map +1 -1
  28. package/dist/cliproxy/tool-sanitization-proxy.d.ts.map +1 -1
  29. package/dist/cliproxy/tool-sanitization-proxy.js +3 -0
  30. package/dist/cliproxy/tool-sanitization-proxy.js.map +1 -1
  31. package/dist/cliproxy/types.d.ts +0 -2
  32. package/dist/cliproxy/types.d.ts.map +1 -1
  33. package/dist/commands/cliproxy/catalog-subcommand.d.ts +0 -6
  34. package/dist/commands/cliproxy/catalog-subcommand.d.ts.map +1 -1
  35. package/dist/commands/cliproxy/catalog-subcommand.js +1 -39
  36. package/dist/commands/cliproxy/catalog-subcommand.js.map +1 -1
  37. package/dist/commands/cliproxy/help-subcommand.d.ts.map +1 -1
  38. package/dist/commands/cliproxy/help-subcommand.js +0 -1
  39. package/dist/commands/cliproxy/help-subcommand.js.map +1 -1
  40. package/dist/commands/cliproxy/index.d.ts.map +1 -1
  41. package/dist/commands/cliproxy/index.js +0 -6
  42. package/dist/commands/cliproxy/index.js.map +1 -1
  43. package/dist/commands/command-catalog.d.ts +1 -1
  44. package/dist/commands/command-catalog.d.ts.map +1 -1
  45. package/dist/commands/cursor-command-display.d.ts +0 -2
  46. package/dist/commands/cursor-command-display.d.ts.map +1 -1
  47. package/dist/commands/cursor-command-display.js +3 -24
  48. package/dist/commands/cursor-command-display.js.map +1 -1
  49. package/dist/commands/cursor-command.d.ts.map +1 -1
  50. package/dist/commands/cursor-command.js +1 -31
  51. package/dist/commands/cursor-command.js.map +1 -1
  52. package/dist/config/migration-manager.d.ts.map +1 -1
  53. package/dist/config/migration-manager.js +1 -2
  54. package/dist/config/migration-manager.js.map +1 -1
  55. package/dist/config/unified-config-loader.d.ts +3 -8
  56. package/dist/config/unified-config-loader.d.ts.map +1 -1
  57. package/dist/config/unified-config-loader.js +7 -20
  58. package/dist/config/unified-config-loader.js.map +1 -1
  59. package/dist/config/unified-config-types.d.ts +2 -15
  60. package/dist/config/unified-config-types.d.ts.map +1 -1
  61. package/dist/config/unified-config-types.js +3 -8
  62. package/dist/config/unified-config-types.js.map +1 -1
  63. package/dist/cursor/constants.d.ts +1 -1
  64. package/dist/cursor/constants.d.ts.map +1 -1
  65. package/dist/cursor/constants.js +0 -1
  66. package/dist/cursor/constants.js.map +1 -1
  67. package/dist/cursor/cursor-anthropic-response.d.ts +0 -1
  68. package/dist/cursor/cursor-anthropic-response.d.ts.map +1 -1
  69. package/dist/cursor/cursor-auth.d.ts +0 -1
  70. package/dist/cursor/cursor-auth.d.ts.map +1 -1
  71. package/dist/cursor/cursor-auth.js +32 -154
  72. package/dist/cursor/cursor-auth.js.map +1 -1
  73. package/dist/cursor/cursor-executor.d.ts +1 -2
  74. package/dist/cursor/cursor-executor.d.ts.map +1 -1
  75. package/dist/cursor/cursor-executor.js +160 -295
  76. package/dist/cursor/cursor-executor.js.map +1 -1
  77. package/dist/cursor/cursor-protobuf-decoder.d.ts.map +1 -1
  78. package/dist/cursor/cursor-protobuf-decoder.js +3 -1
  79. package/dist/cursor/cursor-protobuf-decoder.js.map +1 -1
  80. package/dist/cursor/cursor-protobuf-schema.d.ts +3 -12
  81. package/dist/cursor/cursor-protobuf-schema.d.ts.map +1 -1
  82. package/dist/cursor/cursor-protobuf-schema.js +5 -23
  83. package/dist/cursor/cursor-protobuf-schema.js.map +1 -1
  84. package/dist/cursor/cursor-protobuf.d.ts +1 -1
  85. package/dist/cursor/cursor-protobuf.d.ts.map +1 -1
  86. package/dist/cursor/cursor-protobuf.js +4 -2
  87. package/dist/cursor/cursor-protobuf.js.map +1 -1
  88. package/dist/cursor/cursor-stream-parser.d.ts +0 -10
  89. package/dist/cursor/cursor-stream-parser.d.ts.map +1 -1
  90. package/dist/cursor/cursor-stream-parser.js +10 -106
  91. package/dist/cursor/cursor-stream-parser.js.map +1 -1
  92. package/dist/cursor/index.d.ts +0 -1
  93. package/dist/cursor/index.d.ts.map +1 -1
  94. package/dist/cursor/index.js +1 -3
  95. package/dist/cursor/index.js.map +1 -1
  96. package/dist/cursor/types.d.ts +0 -6
  97. package/dist/cursor/types.d.ts.map +1 -1
  98. package/dist/docker/docker-executor.d.ts +0 -1
  99. package/dist/docker/docker-executor.d.ts.map +1 -1
  100. package/dist/management/instance-manager.d.ts.map +1 -1
  101. package/dist/management/instance-manager.js +2 -5
  102. package/dist/management/instance-manager.js.map +1 -1
  103. package/dist/targets/claude-adapter.d.ts +1 -6
  104. package/dist/targets/claude-adapter.d.ts.map +1 -1
  105. package/dist/targets/claude-adapter.js +2 -6
  106. package/dist/targets/claude-adapter.js.map +1 -1
  107. package/dist/targets/codex-adapter.d.ts +0 -1
  108. package/dist/targets/codex-adapter.d.ts.map +1 -1
  109. package/dist/targets/codex-adapter.js +8 -12
  110. package/dist/targets/codex-adapter.js.map +1 -1
  111. package/dist/targets/droid-adapter.d.ts +1 -3
  112. package/dist/targets/droid-adapter.d.ts.map +1 -1
  113. package/dist/targets/droid-adapter.js +2 -3
  114. package/dist/targets/droid-adapter.js.map +1 -1
  115. package/dist/targets/target-adapter.d.ts +0 -5
  116. package/dist/targets/target-adapter.d.ts.map +1 -1
  117. package/dist/types/cli.d.ts +0 -1
  118. package/dist/types/cli.d.ts.map +1 -1
  119. package/dist/ui/assets/{accounts-D9eEaNx9.js → accounts-DjL3iVZW.js} +1 -1
  120. package/dist/ui/assets/{alert-dialog-QyEXocpn.js → alert-dialog-Tc_D1a_B.js} +1 -1
  121. package/dist/ui/assets/{api-7vQe0xOg.js → api-CUtkvXmX.js} +1 -1
  122. package/dist/ui/assets/{auth-section-BszF77uT.js → auth-section-CuKWQHC7.js} +1 -1
  123. package/dist/ui/assets/{backups-section-D6RgaOx1.js → backups-section-BKW2pbb9.js} +1 -1
  124. package/dist/ui/assets/{channels-B1vgnNJX.js → channels-DvWJMdaq.js} +1 -1
  125. package/dist/ui/assets/{checkbox-Dzwkj_Pg.js → checkbox-B0hZxMK5.js} +1 -1
  126. package/dist/ui/assets/{claude-extension-CKO4bJ22.js → claude-extension-Dfqu-rev.js} +1 -1
  127. package/dist/ui/assets/{cliproxy-kHd-oC5W.js → cliproxy-C9RxW-I8.js} +1 -1
  128. package/dist/ui/assets/{cliproxy-ai-providers-CmbFYVoR.js → cliproxy-ai-providers-BXLuuxNf.js} +1 -1
  129. package/dist/ui/assets/{cliproxy-control-panel-M8ZfUq3C.js → cliproxy-control-panel-aQ7cCc2U.js} +1 -1
  130. package/dist/ui/assets/{codex-BJ0RdMuh.js → codex-aq4RI6_n.js} +1 -1
  131. package/dist/ui/assets/{confirm-dialog-BlSaX2gK.js → confirm-dialog-CpDk6eu4.js} +1 -1
  132. package/dist/ui/assets/{copilot-NJKZQXQ_.js → copilot-CQRpGXvY.js} +1 -1
  133. package/dist/ui/assets/cursor-BpXPf6qi.js +1 -0
  134. package/dist/ui/assets/{droid-B9u9ZB-a.js → droid-Cgx-yLjy.js} +1 -1
  135. package/dist/ui/assets/{globalenv-section-DoX37DqB.js → globalenv-section-DsNqG1yB.js} +1 -1
  136. package/dist/ui/assets/{health-D_gdcxnc.js → health-BY-O-JcA.js} +1 -1
  137. package/dist/ui/assets/index-BmSzf0T9.js +72 -0
  138. package/dist/ui/assets/{index-DFEMq3KP.js → index-CLGiPB3A.js} +1 -1
  139. package/dist/ui/assets/{index-CTGpqIx6.js → index-Cet36v1V.js} +1 -1
  140. package/dist/ui/assets/index-DH6L6ybH.js +1 -0
  141. package/dist/ui/assets/{index-BNU4Hhe_.js → index-DsCjnpco.js} +1 -1
  142. package/dist/ui/assets/{index-DoVPk3vW.js → index-TQFuDZdB.js} +1 -1
  143. package/dist/ui/assets/index-teLjoh2T.css +1 -0
  144. package/dist/ui/assets/{logs-DtH4YMt4.js → logs-D5ro-pc7.js} +1 -1
  145. package/dist/ui/assets/{masked-input-C2H-Ax0Z.js → masked-input-h0XkMSwB.js} +1 -1
  146. package/dist/ui/assets/{proxy-status-widget-BOrsn86w.js → proxy-status-widget-yBdrFeb7.js} +1 -1
  147. package/dist/ui/assets/{raw-json-settings-editor-panel-WxTn7-hS.js → raw-json-settings-editor-panel-Cb7ZInQV.js} +1 -1
  148. package/dist/ui/assets/{searchable-select-1zOULoec.js → searchable-select-D4xr5xKS.js} +1 -1
  149. package/dist/ui/assets/{separator-BCfZ54mZ.js → separator-gw5BjIpP.js} +1 -1
  150. package/dist/ui/assets/{shared-DlTbnc9n.js → shared-C-VeA1Z9.js} +1 -1
  151. package/dist/ui/assets/{table-Bx2cnkWN.js → table-Bd4isC18.js} +1 -1
  152. package/dist/ui/assets/{updates-SiZKOnUD.js → updates-DiK8I67C.js} +1 -1
  153. package/dist/ui/index.html +2 -2
  154. package/dist/utils/claude-detector.d.ts +0 -1
  155. package/dist/utils/claude-detector.d.ts.map +1 -1
  156. package/dist/utils/claude-spawner.d.ts +0 -1
  157. package/dist/utils/claude-spawner.d.ts.map +1 -1
  158. package/dist/utils/hooks/image-analysis-runtime-status.js +5 -5
  159. package/dist/utils/hooks/image-analysis-runtime-status.js.map +1 -1
  160. package/dist/utils/image-analysis/claude-tool-args.d.ts +0 -3
  161. package/dist/utils/image-analysis/claude-tool-args.d.ts.map +1 -1
  162. package/dist/utils/image-analysis/claude-tool-args.js +47 -21
  163. package/dist/utils/image-analysis/claude-tool-args.js.map +1 -1
  164. package/dist/utils/package-manager-detector.d.ts +0 -1
  165. package/dist/utils/package-manager-detector.d.ts.map +1 -1
  166. package/dist/utils/shell-executor.d.ts +0 -1
  167. package/dist/utils/shell-executor.d.ts.map +1 -1
  168. package/dist/utils/websearch/claude-tool-args.d.ts +0 -7
  169. package/dist/utils/websearch/claude-tool-args.d.ts.map +1 -1
  170. package/dist/utils/websearch/claude-tool-args.js +50 -27
  171. package/dist/utils/websearch/claude-tool-args.js.map +1 -1
  172. package/dist/utils/websearch/hook-env.d.ts.map +1 -1
  173. package/dist/utils/websearch/hook-env.js +1 -19
  174. package/dist/utils/websearch/hook-env.js.map +1 -1
  175. package/dist/utils/websearch/status.d.ts +1 -1
  176. package/dist/utils/websearch/status.d.ts.map +1 -1
  177. package/dist/utils/websearch/status.js +12 -33
  178. package/dist/utils/websearch/status.js.map +1 -1
  179. package/dist/utils/websearch/trace.d.ts +0 -1
  180. package/dist/utils/websearch/trace.d.ts.map +1 -1
  181. package/dist/utils/websearch/trace.js +5 -20
  182. package/dist/utils/websearch/trace.js.map +1 -1
  183. package/dist/utils/websearch/types.d.ts +2 -12
  184. package/dist/utils/websearch/types.d.ts.map +1 -1
  185. package/dist/utils/websearch/types.js +0 -38
  186. package/dist/utils/websearch/types.js.map +1 -1
  187. package/dist/web-server/health/websearch-checks.js +1 -1
  188. package/dist/web-server/health/websearch-checks.js.map +1 -1
  189. package/dist/web-server/middleware/auth-middleware.d.ts +1 -0
  190. package/dist/web-server/middleware/auth-middleware.d.ts.map +1 -1
  191. package/dist/web-server/routes/cliproxy-local-proxy.d.ts.map +1 -1
  192. package/dist/web-server/routes/cliproxy-local-proxy.js +6 -26
  193. package/dist/web-server/routes/cliproxy-local-proxy.js.map +1 -1
  194. package/dist/web-server/routes/cliproxy-stats-routes.d.ts.map +1 -1
  195. package/dist/web-server/routes/cliproxy-stats-routes.js +1 -8
  196. package/dist/web-server/routes/cliproxy-stats-routes.js.map +1 -1
  197. package/dist/web-server/routes/cursor-routes.d.ts +0 -2
  198. package/dist/web-server/routes/cursor-routes.d.ts.map +1 -1
  199. package/dist/web-server/routes/cursor-routes.js +2 -44
  200. package/dist/web-server/routes/cursor-routes.js.map +1 -1
  201. package/dist/web-server/routes/websearch-routes.d.ts.map +1 -1
  202. package/dist/web-server/routes/websearch-routes.js +0 -37
  203. package/dist/web-server/routes/websearch-routes.js.map +1 -1
  204. package/dist/web-server/services/cliproxy-dashboard-install-service.d.ts.map +1 -1
  205. package/dist/web-server/services/cliproxy-dashboard-install-service.js +0 -14
  206. package/dist/web-server/services/cliproxy-dashboard-install-service.js.map +1 -1
  207. package/dist/web-server/services/codex-dashboard-service.d.ts +0 -1
  208. package/dist/web-server/services/codex-dashboard-service.d.ts.map +1 -1
  209. package/dist/web-server/services/droid-dashboard-service.d.ts +0 -1
  210. package/dist/web-server/services/droid-dashboard-service.d.ts.map +1 -1
  211. package/lib/hooks/websearch-transformer.cjs +0 -136
  212. package/lib/mcp/ccs-websearch-server.cjs +1 -1
  213. package/package.json +1 -2
  214. package/dist/cursor/cursor-runtime-probe.d.ts +0 -12
  215. package/dist/cursor/cursor-runtime-probe.d.ts.map +0 -1
  216. package/dist/cursor/cursor-runtime-probe.js +0 -220
  217. package/dist/cursor/cursor-runtime-probe.js.map +0 -1
  218. package/dist/docker/supervisord-lifecycle.d.ts +0 -17
  219. package/dist/docker/supervisord-lifecycle.d.ts.map +0 -1
  220. package/dist/docker/supervisord-lifecycle.js +0 -58
  221. package/dist/docker/supervisord-lifecycle.js.map +0 -1
  222. package/dist/ui/assets/cursor-BrcDgu6X.js +0 -1
  223. package/dist/ui/assets/index-Cu6e0-ev.css +0 -1
  224. package/dist/ui/assets/index-DOn6k1jF.js +0 -72
  225. package/dist/ui/assets/index-h08p9xL5.js +0 -1
  226. package/dist/utils/browser/chrome-reuse.d.ts +0 -17
  227. package/dist/utils/browser/chrome-reuse.d.ts.map +0 -1
  228. package/dist/utils/browser/chrome-reuse.js +0 -205
  229. package/dist/utils/browser/chrome-reuse.js.map +0 -1
  230. package/dist/utils/browser/claude-tool-args.d.ts +0 -2
  231. package/dist/utils/browser/claude-tool-args.d.ts.map +0 -1
  232. package/dist/utils/browser/claude-tool-args.js +0 -18
  233. package/dist/utils/browser/claude-tool-args.js.map +0 -1
  234. package/dist/utils/browser/index.d.ts +0 -8
  235. package/dist/utils/browser/index.d.ts.map +0 -1
  236. package/dist/utils/browser/index.js +0 -24
  237. package/dist/utils/browser/index.js.map +0 -1
  238. package/dist/utils/browser/mcp-installer.d.ts +0 -14
  239. package/dist/utils/browser/mcp-installer.d.ts.map +0 -1
  240. package/dist/utils/browser/mcp-installer.js +0 -356
  241. package/dist/utils/browser/mcp-installer.js.map +0 -1
  242. package/dist/utils/browser-codex-overrides.d.ts +0 -3
  243. package/dist/utils/browser-codex-overrides.d.ts.map +0 -1
  244. package/dist/utils/browser-codex-overrides.js +0 -29
  245. package/dist/utils/browser-codex-overrides.js.map +0 -1
  246. package/dist/utils/claude-tool-args.d.ts +0 -7
  247. package/dist/utils/claude-tool-args.d.ts.map +0 -1
  248. package/dist/utils/claude-tool-args.js +0 -43
  249. package/dist/utils/claude-tool-args.js.map +0 -1
  250. package/dist/utils/prompt-injection-strategy.d.ts +0 -54
  251. package/dist/utils/prompt-injection-strategy.d.ts.map +0 -1
  252. package/dist/utils/prompt-injection-strategy.js +0 -128
  253. package/dist/utils/prompt-injection-strategy.js.map +0 -1
  254. package/lib/mcp/ccs-browser-server.cjs +0 -877
@@ -1 +1 @@
1
- import{j as e}from"./radix-ui-Zb8sVEtn.js";import{a as N,c as l,d as p,M as k,N as C,O as S,B as R,S as h}from"./index-DOn6k1jF.js";import{u as W,a as E,b as O}from"./tanstack-CrmUhA7Z.js";import{t as g}from"./notifications-B2HqRBj7.js";import{r as j}from"./react-vendor-CNOkPC89.js";import{b5 as y,C as P,$ as I,o as M,Z as T,i as $,U as H,e as A,b6 as z,s as F,Y as B,R as D}from"./icons-KVCk4_U8.js";import"./utils-CzKF5WmX.js";import"./form-utils-Bcoyqxpq.js";import"./code-highlight-BRUf_pqB.js";const q={sm:{dimension:80,strokeWidth:6,fontSize:"text-lg",labelSize:"text-[10px]"},md:{dimension:120,strokeWidth:8,fontSize:"text-3xl",labelSize:"text-xs"},lg:{dimension:160,strokeWidth:10,fontSize:"text-4xl",labelSize:"text-sm"}},G={ok:{stroke:"#22C55E",glow:"rgba(34, 197, 94, 0.4)"},warning:{stroke:"#EAB308",glow:"rgba(234, 179, 8, 0.4)"},error:{stroke:"#EF4444",glow:"rgba(239, 68, 68, 0.4)"}};function K({passed:s,total:t,status:a,size:r="md"}){const{t:i}=N(),o=q[r],c=G[a],n=t>0?Math.round(s/t*100):0,d=(o.dimension-o.strokeWidth)/2,u=2*Math.PI*d,f=u-n/100*u,x=o.dimension/2;return e.jsxs("div",{className:"relative inline-flex items-center justify-center",children:[e.jsxs("svg",{width:o.dimension,height:o.dimension,className:"transform -rotate-90",style:{filter:`drop-shadow(0 0 8px ${c.glow})`},children:[e.jsx("circle",{cx:x,cy:x,r:d,fill:"none",stroke:"currentColor",strokeWidth:o.strokeWidth,className:"text-muted/30"}),e.jsx("circle",{cx:x,cy:x,r:d,fill:"none",stroke:c.stroke,strokeWidth:o.strokeWidth,strokeLinecap:"round",strokeDasharray:u,strokeDashoffset:f,className:"transition-all duration-1000 ease-out"}),n>0&&e.jsx("circle",{cx:x+d*Math.cos(n/100*2*Math.PI-Math.PI/2),cy:x+d*Math.sin(n/100*2*Math.PI-Math.PI/2),r:o.strokeWidth/2,fill:c.stroke,className:"animate-pulse",style:{filter:`drop-shadow(0 0 4px ${c.glow})`}})]}),e.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[e.jsx("span",{className:l("font-mono font-bold tracking-tight",o.fontSize),children:n}),e.jsx("span",{className:l("font-mono uppercase tracking-widest text-muted-foreground",o.labelSize),children:i("health.healthLabel")})]})]})}function b({label:s,value:t,color:a,bgColor:r}){return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:l("w-2 h-2 rounded-full animate-pulse",r)}),e.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:s}),e.jsx("span",{className:l("font-mono font-bold text-sm",a),children:t})]})}function L({total:s,passed:t,warnings:a,errors:r,info:i}){const{t:o}=N(),c=t/s*100,n=a/s*100,d=r/s*100,u=i/s*100;return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"h-2 rounded-full overflow-hidden bg-muted/50 flex",children:[d>0&&e.jsx("div",{className:"h-full bg-red-500 transition-all duration-500",style:{width:`${d}%`}}),n>0&&e.jsx("div",{className:"h-full bg-yellow-500 transition-all duration-500",style:{width:`${n}%`}}),u>0&&e.jsx("div",{className:"h-full bg-blue-500 transition-all duration-500",style:{width:`${u}%`}}),c>0&&e.jsx("div",{className:"h-full bg-green-500 transition-all duration-500",style:{width:`${c}%`}})]}),e.jsxs("div",{className:"flex items-center justify-between gap-4 flex-wrap",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:o("health.checks")}),e.jsx("span",{className:"font-mono font-bold text-lg",children:s})]}),e.jsxs("div",{className:"flex items-center gap-4 flex-wrap",children:[e.jsx(b,{label:"OK",value:t,color:"text-green-500",bgColor:"bg-green-500"}),e.jsx(b,{label:"WARN",value:a,color:"text-yellow-500",bgColor:"bg-yellow-500"}),e.jsx(b,{label:"ERR",value:r,color:"text-red-500",bgColor:"bg-red-500"}),e.jsx(b,{label:"INFO",value:i,color:"text-blue-500",bgColor:"bg-blue-500"})]})]})]})}function Q(){return W({queryKey:["health"],queryFn:async()=>(await fetch("/api/health")).json(),refetchInterval:3e4})}function U(){const s=E();return O({mutationFn:async t=>{const a=await fetch(`/api/health/fix/${t}`,{method:"POST"}),r=await a.json();if(!a.ok)throw new Error(r.message);return r},onSuccess:t=>{s.invalidateQueries({queryKey:["health"]}),g.success(t.message)},onError:t=>{g.error(t.message)}})}const Z={ok:{dot:"bg-green-500",label:"OK",labelColor:"text-green-500"},warning:{dot:"bg-yellow-500",label:"WARN",labelColor:"text-yellow-500"},error:{dot:"bg-red-500",label:"ERR",labelColor:"text-red-500"},info:{dot:"bg-blue-500",label:"INFO",labelColor:"text-blue-500"}};function Y({check:s}){const{t}=N(),a=U(),r=Z[s.status],[i,o]=j.useState(!1),c=s.details||s.fix,n=d=>{navigator.clipboard.writeText(d),g.success(t("health.copied"))};return c?e.jsx(k,{open:i,onOpenChange:o,children:e.jsxs("div",{className:l("group rounded-lg border transition-all duration-150",i?"border-border bg-muted/30":"border-transparent hover:border-border/50 hover:bg-muted/50"),children:[e.jsx(C,{asChild:!0,children:e.jsxs("button",{className:"w-full flex items-center gap-3 px-3 py-2 text-left",children:[e.jsxs("div",{className:"relative flex items-center justify-center w-4 h-4",children:[e.jsx("div",{className:l("w-2 h-2 rounded-full",r.dot)}),s.status!=="ok"&&e.jsx("div",{className:l("absolute w-2 h-2 rounded-full animate-ping opacity-75",r.dot)})]}),e.jsx("span",{className:"flex-1 text-sm font-medium truncate",children:s.name}),e.jsxs("span",{className:l("font-mono text-xs font-semibold",r.labelColor),children:["[",r.label,"]"]}),e.jsx(P,{className:l("w-4 h-4 text-muted-foreground transition-transform duration-200",i&&"rotate-90")})]})}),e.jsx(S,{children:e.jsxs("div",{className:"px-3 pb-3 pt-1 space-y-2 ml-7",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:s.message}),s.details&&e.jsx("pre",{className:"text-xs font-mono text-muted-foreground bg-background/50 rounded p-2 overflow-x-auto border border-border/50",children:s.details}),s.fix&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{className:"flex-1 flex items-center gap-2 bg-background/50 rounded px-2 py-1.5 border border-border/50",children:[e.jsx(I,{className:"w-3 h-3 text-muted-foreground shrink-0"}),e.jsx("code",{className:"text-xs font-mono flex-1 truncate",children:s.fix}),e.jsx(p,{variant:"ghost",size:"sm",onClick:()=>s.fix&&n(s.fix),className:"h-5 w-5 p-0",children:e.jsx(M,{className:"w-3 h-3"})})]}),s.fixable&&s.status!=="ok"&&e.jsxs(p,{size:"sm",onClick:()=>a.mutate(s.id),disabled:a.isPending,className:"h-7 px-3 text-xs",children:[e.jsx(y,{className:"w-3 h-3 mr-1"}),t("health.applyFix")]})]})]})})]})}):e.jsxs("div",{className:l("group flex items-center gap-3 px-3 py-2 rounded-lg","hover:bg-muted/50 transition-colors duration-150","border border-transparent hover:border-border/50"),children:[e.jsxs("div",{className:"relative flex items-center justify-center w-4 h-4",children:[e.jsx("div",{className:l("w-2 h-2 rounded-full",r.dot)}),s.status!=="ok"&&e.jsx("div",{className:l("absolute w-2 h-2 rounded-full animate-ping opacity-75",r.dot)})]}),e.jsx("span",{className:"flex-1 text-sm font-medium truncate",children:s.name}),e.jsxs("span",{className:l("font-mono text-xs font-semibold",r.labelColor),children:["[",r.label,"]"]}),s.fixable&&s.status!=="ok"&&e.jsxs(p,{size:"sm",variant:"ghost",onClick:()=>a.mutate(s.id),disabled:a.isPending,className:"h-6 px-2 text-xs opacity-0 group-hover:opacity-100 transition-opacity",children:[e.jsx(y,{className:"w-3 h-3 mr-1"}),t("health.fix")]})]})}const J={Monitor:z,Settings:A,Users:H,Shield:$,Zap:T};function V({group:s,defaultOpen:t=!0}){const[a,r]=j.useState(t),i=J[s.icon]||z,o=s.checks.filter(m=>m.status==="ok").length,c=s.checks.length,n=s.checks.some(m=>m.status==="error"),d=s.checks.some(m=>m.status==="warning"),u=Math.round(o/c*100),f=n?"text-red-500":d?"text-yellow-500":"text-green-500",x=n?"bg-red-500":d?"bg-yellow-500":"bg-green-500";return e.jsx(k,{open:a,onOpenChange:r,children:e.jsxs("div",{className:l("rounded-lg border transition-all duration-200",n?"border-red-500/30":d?"border-yellow-500/30":"border-border"),children:[e.jsx(C,{asChild:!0,children:e.jsxs("button",{className:l("w-full flex items-center gap-3 p-3 text-left rounded-lg","hover:bg-muted/50 transition-colors duration-150",a&&"rounded-b-none border-b border-border/50"),children:[e.jsx("div",{className:l("p-1.5 rounded-md",n?"bg-red-500/10 text-red-500":d?"bg-yellow-500/10 text-yellow-500":"bg-muted text-muted-foreground"),children:e.jsx(i,{className:"w-4 h-4"})}),e.jsx("span",{className:"flex-1 text-sm font-semibold",children:s.name}),!a&&e.jsx("div",{className:"flex items-center gap-2",children:e.jsx("div",{className:"w-16 h-1.5 rounded-full bg-muted overflow-hidden",children:e.jsx("div",{className:l("h-full transition-all duration-500",x),style:{width:`${u}%`}})})}),e.jsxs("span",{className:l("font-mono text-xs font-semibold",f),children:[o,"/",c]}),e.jsx(F,{className:l("w-4 h-4 text-muted-foreground transition-transform duration-200",a&&"rotate-180")})]})}),e.jsx(S,{children:e.jsx("div",{className:"p-2 space-y-0.5",children:s.checks.map(m=>e.jsx(Y,{check:m},m.id))})})]})})}function X(s){return s.errors>0?"error":s.warnings>0?"warning":"ok"}function _(s,t){const a=Math.floor((Date.now()-s)/1e3);if(a<5)return t("health.justNow");if(a<60)return t("health.secondsAgo",{count:a});const r=Math.floor(a/60);if(r<60)return t("health.minutesAgo",{count:r});const i=Math.floor(r/60);return t("health.hoursAgo",{count:i})}function ee(s){return[...s].sort((t,a)=>{const r=t.checks.filter(n=>n.status==="error").length,i=a.checks.filter(n=>n.status==="error").length,o=t.checks.filter(n=>n.status==="warning").length,c=a.checks.filter(n=>n.status==="warning").length;return r!==i?i-r:c-o})}function se(){return e.jsxs("div",{className:"font-mono text-sm text-muted-foreground flex items-center gap-2",children:[e.jsx("span",{className:"text-green-500",children:"$"}),e.jsx("span",{children:"ccs doctor"})]})}function te(){return e.jsxs("div",{className:"p-6 max-w-6xl mx-auto space-y-6",children:[e.jsx("div",{className:"rounded-xl border bg-gradient-to-br from-background to-muted/20 p-6",children:e.jsxs("div",{className:"flex items-center gap-6",children:[e.jsx(h,{className:"w-[120px] h-[120px] rounded-full"}),e.jsxs("div",{className:"flex-1 space-y-3",children:[e.jsx(h,{className:"h-5 w-48"}),e.jsx(h,{className:"h-8 w-64"}),e.jsx(h,{className:"h-4 w-32"})]})]})}),e.jsx(h,{className:"h-16 w-full rounded-lg"}),e.jsx("div",{className:"space-y-3",children:[1,2,3,4].map(s=>e.jsx(h,{className:"h-20 rounded-lg"},s))})]})}function xe(){const{t:s}=N(),{data:t,isLoading:a,refetch:r,dataUpdatedAt:i}=Q(),o=i,[c,n]=j.useState(0);j.useEffect(()=>{const m=setInterval(()=>n(v=>v+1),1e3);return()=>clearInterval(m)},[]);const d=()=>{navigator.clipboard.writeText("ccs doctor"),g.success(s("health.copied"))},u=()=>{r(),g.info(s("health.refreshing"))};if(a&&!t)return e.jsx(te,{});const f=t?X(t.summary):"ok",x=t?.groups?ee(t.groups):[];return e.jsxs("div",{className:"p-6 max-w-6xl mx-auto space-y-6",children:[e.jsxs("div",{className:l("relative overflow-hidden rounded-xl border p-6","bg-gradient-to-br from-background via-background to-muted/30"),children:[e.jsx("div",{className:"absolute inset-0 opacity-[0.02] pointer-events-none",style:{backgroundImage:"repeating-linear-gradient(0deg, transparent, transparent 2px, currentColor 2px, currentColor 3px)"}}),e.jsx("div",{className:"absolute inset-0 opacity-[0.03] pointer-events-none",children:e.jsx("div",{className:"absolute inset-0",style:{backgroundImage:"radial-gradient(circle at 1px 1px, currentColor 1px, transparent 0)",backgroundSize:"24px 24px"}})}),e.jsxs("div",{className:"relative flex flex-col md:flex-row items-start md:items-center gap-6",children:[t&&e.jsx("div",{className:"shrink-0",children:e.jsx(K,{passed:t.summary.passed,total:t.summary.total-t.summary.info,status:f,size:"md"})}),e.jsxs("div",{className:"flex-1 space-y-3",children:[e.jsx(se,{}),e.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[e.jsx("h1",{className:"text-2xl font-bold font-mono tracking-tight",children:s("health.systemHealth")}),t?.version&&e.jsx(R,{variant:"outline",className:"font-mono text-xs bg-muted/50",children:s("health.build",{version:t.version})})]}),e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx(B,{className:"w-4 h-4 text-muted-foreground"}),e.jsx("span",{className:"text-muted-foreground",children:s("health.lastScan")}),e.jsx("span",{className:"font-mono",children:o?_(o,s):"--"}),e.jsx("span",{className:"text-muted-foreground",children:"|"}),e.jsx("span",{className:"text-muted-foreground",children:s("health.autoRefresh")}),e.jsx("span",{className:"font-mono text-green-500",children:"30s"})]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsxs(p,{variant:"outline",size:"sm",onClick:d,className:"gap-2 font-mono text-xs",children:[e.jsx(I,{className:"w-3 h-3"}),"ccs doctor",e.jsx(M,{className:"w-3 h-3 opacity-50"})]}),e.jsxs(p,{variant:"outline",size:"sm",onClick:u,disabled:a,className:"gap-2",children:[e.jsx(D,{className:l("w-4 h-4",a&&"animate-spin")}),e.jsx("span",{className:"hidden sm:inline",children:s("health.refresh")}),e.jsx("kbd",{className:"hidden md:inline-flex h-5 items-center gap-1 rounded border bg-muted px-1.5 font-mono text-[10px] font-medium text-muted-foreground",children:"R"})]})]})]})]}),t&&e.jsx("div",{className:"rounded-lg border bg-card p-4",children:e.jsx(L,{total:t.summary.total,passed:t.summary.passed,warnings:t.summary.warnings,errors:t.summary.errors,info:t.summary.info})}),x.length>0&&e.jsx("div",{className:"space-y-3",children:x.map((m,v)=>e.jsx(V,{group:m,defaultOpen:v<2||m.checks.some(w=>w.status==="error"||w.status==="warning")},m.id))}),e.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground border-t pt-4",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("span",{children:[s("health.version")," ",e.jsx("span",{className:"font-mono",children:t?.version??"--"})]}),e.jsxs("span",{children:[s("health.platform")," ",e.jsx("span",{className:"font-mono",children:typeof navigator<"u"?navigator.platform:"linux"})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-2 h-2 rounded-full bg-green-500 animate-pulse"}),e.jsx("span",{children:s("health.liveMonitoring")})]})]})]})}export{xe as HealthPage};
1
+ import{j as e}from"./radix-ui-Zb8sVEtn.js";import{a as N,c as l,d as p,M as k,N as C,O as S,B as R,S as h}from"./index-BmSzf0T9.js";import{u as W,a as E,b as O}from"./tanstack-CrmUhA7Z.js";import{t as g}from"./notifications-B2HqRBj7.js";import{r as j}from"./react-vendor-CNOkPC89.js";import{b5 as y,C as P,$ as I,o as M,Z as T,i as $,U as H,e as A,b6 as z,s as F,Y as B,R as D}from"./icons-KVCk4_U8.js";import"./utils-CzKF5WmX.js";import"./form-utils-Bcoyqxpq.js";import"./code-highlight-BRUf_pqB.js";const q={sm:{dimension:80,strokeWidth:6,fontSize:"text-lg",labelSize:"text-[10px]"},md:{dimension:120,strokeWidth:8,fontSize:"text-3xl",labelSize:"text-xs"},lg:{dimension:160,strokeWidth:10,fontSize:"text-4xl",labelSize:"text-sm"}},G={ok:{stroke:"#22C55E",glow:"rgba(34, 197, 94, 0.4)"},warning:{stroke:"#EAB308",glow:"rgba(234, 179, 8, 0.4)"},error:{stroke:"#EF4444",glow:"rgba(239, 68, 68, 0.4)"}};function K({passed:s,total:t,status:a,size:r="md"}){const{t:i}=N(),o=q[r],c=G[a],n=t>0?Math.round(s/t*100):0,d=(o.dimension-o.strokeWidth)/2,u=2*Math.PI*d,f=u-n/100*u,x=o.dimension/2;return e.jsxs("div",{className:"relative inline-flex items-center justify-center",children:[e.jsxs("svg",{width:o.dimension,height:o.dimension,className:"transform -rotate-90",style:{filter:`drop-shadow(0 0 8px ${c.glow})`},children:[e.jsx("circle",{cx:x,cy:x,r:d,fill:"none",stroke:"currentColor",strokeWidth:o.strokeWidth,className:"text-muted/30"}),e.jsx("circle",{cx:x,cy:x,r:d,fill:"none",stroke:c.stroke,strokeWidth:o.strokeWidth,strokeLinecap:"round",strokeDasharray:u,strokeDashoffset:f,className:"transition-all duration-1000 ease-out"}),n>0&&e.jsx("circle",{cx:x+d*Math.cos(n/100*2*Math.PI-Math.PI/2),cy:x+d*Math.sin(n/100*2*Math.PI-Math.PI/2),r:o.strokeWidth/2,fill:c.stroke,className:"animate-pulse",style:{filter:`drop-shadow(0 0 4px ${c.glow})`}})]}),e.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[e.jsx("span",{className:l("font-mono font-bold tracking-tight",o.fontSize),children:n}),e.jsx("span",{className:l("font-mono uppercase tracking-widest text-muted-foreground",o.labelSize),children:i("health.healthLabel")})]})]})}function b({label:s,value:t,color:a,bgColor:r}){return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:l("w-2 h-2 rounded-full animate-pulse",r)}),e.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:s}),e.jsx("span",{className:l("font-mono font-bold text-sm",a),children:t})]})}function L({total:s,passed:t,warnings:a,errors:r,info:i}){const{t:o}=N(),c=t/s*100,n=a/s*100,d=r/s*100,u=i/s*100;return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"h-2 rounded-full overflow-hidden bg-muted/50 flex",children:[d>0&&e.jsx("div",{className:"h-full bg-red-500 transition-all duration-500",style:{width:`${d}%`}}),n>0&&e.jsx("div",{className:"h-full bg-yellow-500 transition-all duration-500",style:{width:`${n}%`}}),u>0&&e.jsx("div",{className:"h-full bg-blue-500 transition-all duration-500",style:{width:`${u}%`}}),c>0&&e.jsx("div",{className:"h-full bg-green-500 transition-all duration-500",style:{width:`${c}%`}})]}),e.jsxs("div",{className:"flex items-center justify-between gap-4 flex-wrap",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:o("health.checks")}),e.jsx("span",{className:"font-mono font-bold text-lg",children:s})]}),e.jsxs("div",{className:"flex items-center gap-4 flex-wrap",children:[e.jsx(b,{label:"OK",value:t,color:"text-green-500",bgColor:"bg-green-500"}),e.jsx(b,{label:"WARN",value:a,color:"text-yellow-500",bgColor:"bg-yellow-500"}),e.jsx(b,{label:"ERR",value:r,color:"text-red-500",bgColor:"bg-red-500"}),e.jsx(b,{label:"INFO",value:i,color:"text-blue-500",bgColor:"bg-blue-500"})]})]})]})}function Q(){return W({queryKey:["health"],queryFn:async()=>(await fetch("/api/health")).json(),refetchInterval:3e4})}function U(){const s=E();return O({mutationFn:async t=>{const a=await fetch(`/api/health/fix/${t}`,{method:"POST"}),r=await a.json();if(!a.ok)throw new Error(r.message);return r},onSuccess:t=>{s.invalidateQueries({queryKey:["health"]}),g.success(t.message)},onError:t=>{g.error(t.message)}})}const Z={ok:{dot:"bg-green-500",label:"OK",labelColor:"text-green-500"},warning:{dot:"bg-yellow-500",label:"WARN",labelColor:"text-yellow-500"},error:{dot:"bg-red-500",label:"ERR",labelColor:"text-red-500"},info:{dot:"bg-blue-500",label:"INFO",labelColor:"text-blue-500"}};function Y({check:s}){const{t}=N(),a=U(),r=Z[s.status],[i,o]=j.useState(!1),c=s.details||s.fix,n=d=>{navigator.clipboard.writeText(d),g.success(t("health.copied"))};return c?e.jsx(k,{open:i,onOpenChange:o,children:e.jsxs("div",{className:l("group rounded-lg border transition-all duration-150",i?"border-border bg-muted/30":"border-transparent hover:border-border/50 hover:bg-muted/50"),children:[e.jsx(C,{asChild:!0,children:e.jsxs("button",{className:"w-full flex items-center gap-3 px-3 py-2 text-left",children:[e.jsxs("div",{className:"relative flex items-center justify-center w-4 h-4",children:[e.jsx("div",{className:l("w-2 h-2 rounded-full",r.dot)}),s.status!=="ok"&&e.jsx("div",{className:l("absolute w-2 h-2 rounded-full animate-ping opacity-75",r.dot)})]}),e.jsx("span",{className:"flex-1 text-sm font-medium truncate",children:s.name}),e.jsxs("span",{className:l("font-mono text-xs font-semibold",r.labelColor),children:["[",r.label,"]"]}),e.jsx(P,{className:l("w-4 h-4 text-muted-foreground transition-transform duration-200",i&&"rotate-90")})]})}),e.jsx(S,{children:e.jsxs("div",{className:"px-3 pb-3 pt-1 space-y-2 ml-7",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:s.message}),s.details&&e.jsx("pre",{className:"text-xs font-mono text-muted-foreground bg-background/50 rounded p-2 overflow-x-auto border border-border/50",children:s.details}),s.fix&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{className:"flex-1 flex items-center gap-2 bg-background/50 rounded px-2 py-1.5 border border-border/50",children:[e.jsx(I,{className:"w-3 h-3 text-muted-foreground shrink-0"}),e.jsx("code",{className:"text-xs font-mono flex-1 truncate",children:s.fix}),e.jsx(p,{variant:"ghost",size:"sm",onClick:()=>s.fix&&n(s.fix),className:"h-5 w-5 p-0",children:e.jsx(M,{className:"w-3 h-3"})})]}),s.fixable&&s.status!=="ok"&&e.jsxs(p,{size:"sm",onClick:()=>a.mutate(s.id),disabled:a.isPending,className:"h-7 px-3 text-xs",children:[e.jsx(y,{className:"w-3 h-3 mr-1"}),t("health.applyFix")]})]})]})})]})}):e.jsxs("div",{className:l("group flex items-center gap-3 px-3 py-2 rounded-lg","hover:bg-muted/50 transition-colors duration-150","border border-transparent hover:border-border/50"),children:[e.jsxs("div",{className:"relative flex items-center justify-center w-4 h-4",children:[e.jsx("div",{className:l("w-2 h-2 rounded-full",r.dot)}),s.status!=="ok"&&e.jsx("div",{className:l("absolute w-2 h-2 rounded-full animate-ping opacity-75",r.dot)})]}),e.jsx("span",{className:"flex-1 text-sm font-medium truncate",children:s.name}),e.jsxs("span",{className:l("font-mono text-xs font-semibold",r.labelColor),children:["[",r.label,"]"]}),s.fixable&&s.status!=="ok"&&e.jsxs(p,{size:"sm",variant:"ghost",onClick:()=>a.mutate(s.id),disabled:a.isPending,className:"h-6 px-2 text-xs opacity-0 group-hover:opacity-100 transition-opacity",children:[e.jsx(y,{className:"w-3 h-3 mr-1"}),t("health.fix")]})]})}const J={Monitor:z,Settings:A,Users:H,Shield:$,Zap:T};function V({group:s,defaultOpen:t=!0}){const[a,r]=j.useState(t),i=J[s.icon]||z,o=s.checks.filter(m=>m.status==="ok").length,c=s.checks.length,n=s.checks.some(m=>m.status==="error"),d=s.checks.some(m=>m.status==="warning"),u=Math.round(o/c*100),f=n?"text-red-500":d?"text-yellow-500":"text-green-500",x=n?"bg-red-500":d?"bg-yellow-500":"bg-green-500";return e.jsx(k,{open:a,onOpenChange:r,children:e.jsxs("div",{className:l("rounded-lg border transition-all duration-200",n?"border-red-500/30":d?"border-yellow-500/30":"border-border"),children:[e.jsx(C,{asChild:!0,children:e.jsxs("button",{className:l("w-full flex items-center gap-3 p-3 text-left rounded-lg","hover:bg-muted/50 transition-colors duration-150",a&&"rounded-b-none border-b border-border/50"),children:[e.jsx("div",{className:l("p-1.5 rounded-md",n?"bg-red-500/10 text-red-500":d?"bg-yellow-500/10 text-yellow-500":"bg-muted text-muted-foreground"),children:e.jsx(i,{className:"w-4 h-4"})}),e.jsx("span",{className:"flex-1 text-sm font-semibold",children:s.name}),!a&&e.jsx("div",{className:"flex items-center gap-2",children:e.jsx("div",{className:"w-16 h-1.5 rounded-full bg-muted overflow-hidden",children:e.jsx("div",{className:l("h-full transition-all duration-500",x),style:{width:`${u}%`}})})}),e.jsxs("span",{className:l("font-mono text-xs font-semibold",f),children:[o,"/",c]}),e.jsx(F,{className:l("w-4 h-4 text-muted-foreground transition-transform duration-200",a&&"rotate-180")})]})}),e.jsx(S,{children:e.jsx("div",{className:"p-2 space-y-0.5",children:s.checks.map(m=>e.jsx(Y,{check:m},m.id))})})]})})}function X(s){return s.errors>0?"error":s.warnings>0?"warning":"ok"}function _(s,t){const a=Math.floor((Date.now()-s)/1e3);if(a<5)return t("health.justNow");if(a<60)return t("health.secondsAgo",{count:a});const r=Math.floor(a/60);if(r<60)return t("health.minutesAgo",{count:r});const i=Math.floor(r/60);return t("health.hoursAgo",{count:i})}function ee(s){return[...s].sort((t,a)=>{const r=t.checks.filter(n=>n.status==="error").length,i=a.checks.filter(n=>n.status==="error").length,o=t.checks.filter(n=>n.status==="warning").length,c=a.checks.filter(n=>n.status==="warning").length;return r!==i?i-r:c-o})}function se(){return e.jsxs("div",{className:"font-mono text-sm text-muted-foreground flex items-center gap-2",children:[e.jsx("span",{className:"text-green-500",children:"$"}),e.jsx("span",{children:"ccs doctor"})]})}function te(){return e.jsxs("div",{className:"p-6 max-w-6xl mx-auto space-y-6",children:[e.jsx("div",{className:"rounded-xl border bg-gradient-to-br from-background to-muted/20 p-6",children:e.jsxs("div",{className:"flex items-center gap-6",children:[e.jsx(h,{className:"w-[120px] h-[120px] rounded-full"}),e.jsxs("div",{className:"flex-1 space-y-3",children:[e.jsx(h,{className:"h-5 w-48"}),e.jsx(h,{className:"h-8 w-64"}),e.jsx(h,{className:"h-4 w-32"})]})]})}),e.jsx(h,{className:"h-16 w-full rounded-lg"}),e.jsx("div",{className:"space-y-3",children:[1,2,3,4].map(s=>e.jsx(h,{className:"h-20 rounded-lg"},s))})]})}function xe(){const{t:s}=N(),{data:t,isLoading:a,refetch:r,dataUpdatedAt:i}=Q(),o=i,[c,n]=j.useState(0);j.useEffect(()=>{const m=setInterval(()=>n(v=>v+1),1e3);return()=>clearInterval(m)},[]);const d=()=>{navigator.clipboard.writeText("ccs doctor"),g.success(s("health.copied"))},u=()=>{r(),g.info(s("health.refreshing"))};if(a&&!t)return e.jsx(te,{});const f=t?X(t.summary):"ok",x=t?.groups?ee(t.groups):[];return e.jsxs("div",{className:"p-6 max-w-6xl mx-auto space-y-6",children:[e.jsxs("div",{className:l("relative overflow-hidden rounded-xl border p-6","bg-gradient-to-br from-background via-background to-muted/30"),children:[e.jsx("div",{className:"absolute inset-0 opacity-[0.02] pointer-events-none",style:{backgroundImage:"repeating-linear-gradient(0deg, transparent, transparent 2px, currentColor 2px, currentColor 3px)"}}),e.jsx("div",{className:"absolute inset-0 opacity-[0.03] pointer-events-none",children:e.jsx("div",{className:"absolute inset-0",style:{backgroundImage:"radial-gradient(circle at 1px 1px, currentColor 1px, transparent 0)",backgroundSize:"24px 24px"}})}),e.jsxs("div",{className:"relative flex flex-col md:flex-row items-start md:items-center gap-6",children:[t&&e.jsx("div",{className:"shrink-0",children:e.jsx(K,{passed:t.summary.passed,total:t.summary.total-t.summary.info,status:f,size:"md"})}),e.jsxs("div",{className:"flex-1 space-y-3",children:[e.jsx(se,{}),e.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[e.jsx("h1",{className:"text-2xl font-bold font-mono tracking-tight",children:s("health.systemHealth")}),t?.version&&e.jsx(R,{variant:"outline",className:"font-mono text-xs bg-muted/50",children:s("health.build",{version:t.version})})]}),e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx(B,{className:"w-4 h-4 text-muted-foreground"}),e.jsx("span",{className:"text-muted-foreground",children:s("health.lastScan")}),e.jsx("span",{className:"font-mono",children:o?_(o,s):"--"}),e.jsx("span",{className:"text-muted-foreground",children:"|"}),e.jsx("span",{className:"text-muted-foreground",children:s("health.autoRefresh")}),e.jsx("span",{className:"font-mono text-green-500",children:"30s"})]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsxs(p,{variant:"outline",size:"sm",onClick:d,className:"gap-2 font-mono text-xs",children:[e.jsx(I,{className:"w-3 h-3"}),"ccs doctor",e.jsx(M,{className:"w-3 h-3 opacity-50"})]}),e.jsxs(p,{variant:"outline",size:"sm",onClick:u,disabled:a,className:"gap-2",children:[e.jsx(D,{className:l("w-4 h-4",a&&"animate-spin")}),e.jsx("span",{className:"hidden sm:inline",children:s("health.refresh")}),e.jsx("kbd",{className:"hidden md:inline-flex h-5 items-center gap-1 rounded border bg-muted px-1.5 font-mono text-[10px] font-medium text-muted-foreground",children:"R"})]})]})]})]}),t&&e.jsx("div",{className:"rounded-lg border bg-card p-4",children:e.jsx(L,{total:t.summary.total,passed:t.summary.passed,warnings:t.summary.warnings,errors:t.summary.errors,info:t.summary.info})}),x.length>0&&e.jsx("div",{className:"space-y-3",children:x.map((m,v)=>e.jsx(V,{group:m,defaultOpen:v<2||m.checks.some(w=>w.status==="error"||w.status==="warning")},m.id))}),e.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground border-t pt-4",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("span",{children:[s("health.version")," ",e.jsx("span",{className:"font-mono",children:t?.version??"--"})]}),e.jsxs("span",{children:[s("health.platform")," ",e.jsx("span",{className:"font-mono",children:typeof navigator<"u"?navigator.platform:"linux"})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-2 h-2 rounded-full bg-green-500 animate-pulse"}),e.jsx("span",{children:s("health.liveMonitoring")})]})]})]})}export{xe as HealthPage};