@kaitranntt/ccs 6.7.0 → 6.7.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 (623) hide show
  1. package/README.md +45 -23
  2. package/dist/api/index.d.ts +7 -0
  3. package/dist/api/index.d.ts.map +1 -0
  4. package/dist/api/index.js +24 -0
  5. package/dist/api/index.js.map +1 -0
  6. package/dist/api/services/index.d.ts +10 -0
  7. package/dist/api/services/index.d.ts.map +1 -0
  8. package/dist/api/services/index.js +26 -0
  9. package/dist/api/services/index.js.map +1 -0
  10. package/dist/api/services/profile-reader.d.ts +28 -0
  11. package/dist/api/services/profile-reader.d.ts.map +1 -0
  12. package/dist/api/services/profile-reader.js +148 -0
  13. package/dist/api/services/profile-reader.js.map +1 -0
  14. package/dist/api/services/profile-types.d.ts +42 -0
  15. package/dist/api/services/profile-types.d.ts.map +1 -0
  16. package/dist/api/services/profile-types.js +8 -0
  17. package/dist/api/services/profile-types.js.map +1 -0
  18. package/dist/api/services/profile-writer.d.ts +6 -0
  19. package/dist/api/services/profile-writer.d.ts.map +1 -0
  20. package/dist/api/services/profile-writer.js +176 -0
  21. package/dist/api/services/profile-writer.js.map +1 -0
  22. package/dist/api/services/validation-service.d.ts +26 -0
  23. package/dist/api/services/validation-service.d.ts.map +1 -0
  24. package/dist/api/services/validation-service.js +77 -0
  25. package/dist/api/services/validation-service.js.map +1 -0
  26. package/dist/auth/auth-commands.d.ts +16 -22
  27. package/dist/auth/auth-commands.d.ts.map +1 -1
  28. package/dist/auth/auth-commands.js +29 -467
  29. package/dist/auth/auth-commands.js.map +1 -1
  30. package/dist/auth/commands/create-command.d.ts +11 -0
  31. package/dist/auth/commands/create-command.d.ts.map +1 -0
  32. package/dist/auth/commands/create-command.js +137 -0
  33. package/dist/auth/commands/create-command.js.map +1 -0
  34. package/dist/auth/commands/default-command.d.ts +15 -0
  35. package/dist/auth/commands/default-command.d.ts.map +1 -0
  36. package/dist/auth/commands/default-command.js +71 -0
  37. package/dist/auth/commands/default-command.js.map +1 -0
  38. package/dist/auth/commands/index.d.ts +12 -0
  39. package/dist/auth/commands/index.d.ts.map +1 -0
  40. package/dist/auth/commands/index.js +25 -0
  41. package/dist/auth/commands/index.js.map +1 -0
  42. package/dist/auth/commands/list-command.d.ts +11 -0
  43. package/dist/auth/commands/list-command.d.ts.map +1 -0
  44. package/dist/auth/commands/list-command.js +124 -0
  45. package/dist/auth/commands/list-command.js.map +1 -0
  46. package/dist/auth/commands/remove-command.d.ts +11 -0
  47. package/dist/auth/commands/remove-command.d.ts.map +1 -0
  48. package/dist/auth/commands/remove-command.js +102 -0
  49. package/dist/auth/commands/remove-command.js.map +1 -0
  50. package/dist/auth/commands/show-command.d.ts +11 -0
  51. package/dist/auth/commands/show-command.d.ts.map +1 -0
  52. package/dist/auth/commands/show-command.js +103 -0
  53. package/dist/auth/commands/show-command.js.map +1 -0
  54. package/dist/auth/commands/types.d.ts +50 -0
  55. package/dist/auth/commands/types.d.ts.map +1 -0
  56. package/dist/auth/commands/types.js +26 -0
  57. package/dist/auth/commands/types.js.map +1 -0
  58. package/dist/auth/index.d.ts +8 -0
  59. package/dist/auth/index.d.ts.map +1 -0
  60. package/dist/auth/index.js +16 -0
  61. package/dist/auth/index.js.map +1 -0
  62. package/dist/auth/profile-detector.d.ts +0 -5
  63. package/dist/auth/profile-detector.d.ts.map +1 -1
  64. package/dist/auth/profile-detector.js +1 -9
  65. package/dist/auth/profile-detector.js.map +1 -1
  66. package/dist/auth/profile-registry.d.ts +0 -4
  67. package/dist/auth/profile-registry.d.ts.map +1 -1
  68. package/dist/auth/profile-registry.js +3 -10
  69. package/dist/auth/profile-registry.js.map +1 -1
  70. package/dist/ccs.js +21 -4
  71. package/dist/ccs.js.map +1 -1
  72. package/dist/cliproxy/auth/auth-types.d.ts +85 -0
  73. package/dist/cliproxy/auth/auth-types.d.ts.map +1 -0
  74. package/dist/cliproxy/auth/auth-types.js +100 -0
  75. package/dist/cliproxy/auth/auth-types.js.map +1 -0
  76. package/dist/cliproxy/auth/environment-detector.d.ts +30 -0
  77. package/dist/cliproxy/auth/environment-detector.d.ts.map +1 -0
  78. package/dist/cliproxy/auth/environment-detector.js +124 -0
  79. package/dist/cliproxy/auth/environment-detector.js.map +1 -0
  80. package/dist/cliproxy/auth/index.d.ts +11 -0
  81. package/dist/cliproxy/auth/index.d.ts.map +1 -0
  82. package/dist/cliproxy/auth/index.js +35 -0
  83. package/dist/cliproxy/auth/index.js.map +1 -0
  84. package/dist/cliproxy/auth/oauth-handler.d.ts +29 -0
  85. package/dist/cliproxy/auth/oauth-handler.d.ts.map +1 -0
  86. package/dist/cliproxy/auth/oauth-handler.js +205 -0
  87. package/dist/cliproxy/auth/oauth-handler.js.map +1 -0
  88. package/dist/cliproxy/auth/oauth-process.d.ts +27 -0
  89. package/dist/cliproxy/auth/oauth-process.d.ts.map +1 -0
  90. package/dist/cliproxy/auth/oauth-process.js +209 -0
  91. package/dist/cliproxy/auth/oauth-process.js.map +1 -0
  92. package/dist/cliproxy/auth/token-manager.d.ts +53 -0
  93. package/dist/cliproxy/auth/token-manager.d.ts.map +1 -0
  94. package/dist/cliproxy/auth/token-manager.js +250 -0
  95. package/dist/cliproxy/auth/token-manager.js.map +1 -0
  96. package/dist/cliproxy/auth-handler.d.ts +13 -103
  97. package/dist/cliproxy/auth-handler.d.ts.map +1 -1
  98. package/dist/cliproxy/auth-handler.js +35 -766
  99. package/dist/cliproxy/auth-handler.js.map +1 -1
  100. package/dist/cliproxy/binary/downloader.d.ts +29 -0
  101. package/dist/cliproxy/binary/downloader.d.ts.map +1 -0
  102. package/dist/cliproxy/binary/downloader.js +218 -0
  103. package/dist/cliproxy/binary/downloader.js.map +1 -0
  104. package/dist/cliproxy/binary/extractor.d.ts +12 -0
  105. package/dist/cliproxy/binary/extractor.d.ts.map +1 -0
  106. package/dist/cliproxy/binary/extractor.js +27 -0
  107. package/dist/cliproxy/binary/extractor.js.map +1 -0
  108. package/dist/cliproxy/binary/index.d.ts +13 -0
  109. package/dist/cliproxy/binary/index.d.ts.map +1 -0
  110. package/dist/cliproxy/binary/index.js +53 -0
  111. package/dist/cliproxy/binary/index.js.map +1 -0
  112. package/dist/cliproxy/binary/installer.d.ts +24 -0
  113. package/dist/cliproxy/binary/installer.d.ts.map +1 -0
  114. package/dist/cliproxy/binary/installer.js +117 -0
  115. package/dist/cliproxy/binary/installer.js.map +1 -0
  116. package/dist/cliproxy/binary/lifecycle.d.ts +11 -0
  117. package/dist/cliproxy/binary/lifecycle.d.ts.map +1 -0
  118. package/dist/cliproxy/binary/lifecycle.js +106 -0
  119. package/dist/cliproxy/binary/lifecycle.js.map +1 -0
  120. package/dist/cliproxy/binary/tar-extractor.d.ts +9 -0
  121. package/dist/cliproxy/binary/tar-extractor.d.ts.map +1 -0
  122. package/dist/cliproxy/binary/tar-extractor.js +118 -0
  123. package/dist/cliproxy/binary/tar-extractor.js.map +1 -0
  124. package/dist/cliproxy/binary/types.d.ts +24 -0
  125. package/dist/cliproxy/binary/types.d.ts.map +1 -0
  126. package/dist/cliproxy/binary/types.js +14 -0
  127. package/dist/cliproxy/binary/types.js.map +1 -0
  128. package/dist/cliproxy/binary/updater.d.ts +7 -0
  129. package/dist/cliproxy/binary/updater.d.ts.map +1 -0
  130. package/dist/cliproxy/binary/updater.js +18 -0
  131. package/dist/cliproxy/binary/updater.js.map +1 -0
  132. package/dist/cliproxy/binary/verifier.d.ts +18 -0
  133. package/dist/cliproxy/binary/verifier.d.ts.map +1 -0
  134. package/dist/cliproxy/binary/verifier.js +82 -0
  135. package/dist/cliproxy/binary/verifier.js.map +1 -0
  136. package/dist/cliproxy/binary/version-cache.d.ts +46 -0
  137. package/dist/cliproxy/binary/version-cache.d.ts.map +1 -0
  138. package/dist/cliproxy/binary/version-cache.js +171 -0
  139. package/dist/cliproxy/binary/version-cache.js.map +1 -0
  140. package/dist/cliproxy/binary/version-checker.d.ts +19 -0
  141. package/dist/cliproxy/binary/version-checker.d.ts.map +1 -0
  142. package/dist/cliproxy/binary/version-checker.js +77 -0
  143. package/dist/cliproxy/binary/version-checker.js.map +1 -0
  144. package/dist/cliproxy/binary/zip-extractor.d.ts +9 -0
  145. package/dist/cliproxy/binary/zip-extractor.d.ts.map +1 -0
  146. package/dist/cliproxy/binary/zip-extractor.js +110 -0
  147. package/dist/cliproxy/binary/zip-extractor.js.map +1 -0
  148. package/dist/cliproxy/binary-manager.d.ts +16 -170
  149. package/dist/cliproxy/binary-manager.d.ts.map +1 -1
  150. package/dist/cliproxy/binary-manager.js +38 -865
  151. package/dist/cliproxy/binary-manager.js.map +1 -1
  152. package/dist/cliproxy/services/binary-service.d.ts +65 -0
  153. package/dist/cliproxy/services/binary-service.d.ts.map +1 -0
  154. package/dist/cliproxy/services/binary-service.js +140 -0
  155. package/dist/cliproxy/services/binary-service.js.map +1 -0
  156. package/dist/cliproxy/services/index.d.ts +8 -0
  157. package/dist/cliproxy/services/index.d.ts.map +1 -0
  158. package/dist/cliproxy/services/index.js +31 -0
  159. package/dist/cliproxy/services/index.js.map +1 -0
  160. package/dist/cliproxy/services/proxy-lifecycle-service.d.ts +38 -0
  161. package/dist/cliproxy/services/proxy-lifecycle-service.d.ts.map +1 -0
  162. package/dist/cliproxy/services/proxy-lifecycle-service.js +41 -0
  163. package/dist/cliproxy/services/proxy-lifecycle-service.js.map +1 -0
  164. package/dist/cliproxy/services/variant-config-adapter.d.ts +38 -0
  165. package/dist/cliproxy/services/variant-config-adapter.d.ts.map +1 -0
  166. package/dist/cliproxy/services/variant-config-adapter.js +172 -0
  167. package/dist/cliproxy/services/variant-config-adapter.js.map +1 -0
  168. package/dist/cliproxy/services/variant-service.d.ts +37 -0
  169. package/dist/cliproxy/services/variant-service.d.ts.map +1 -0
  170. package/dist/cliproxy/services/variant-service.js +128 -0
  171. package/dist/cliproxy/services/variant-service.js.map +1 -0
  172. package/dist/cliproxy/services/variant-settings.d.ts +32 -0
  173. package/dist/cliproxy/services/variant-settings.d.ts.map +1 -0
  174. package/dist/cliproxy/services/variant-settings.js +128 -0
  175. package/dist/cliproxy/services/variant-settings.js.map +1 -0
  176. package/dist/commands/api-command.d.ts +3 -6
  177. package/dist/commands/api-command.d.ts.map +1 -1
  178. package/dist/commands/api-command.js +84 -445
  179. package/dist/commands/api-command.js.map +1 -1
  180. package/dist/commands/cliproxy-command.d.ts +0 -3
  181. package/dist/commands/cliproxy-command.d.ts.map +1 -1
  182. package/dist/commands/cliproxy-command.js +182 -621
  183. package/dist/commands/cliproxy-command.js.map +1 -1
  184. package/dist/commands/index.d.ts +17 -0
  185. package/dist/commands/index.d.ts.map +1 -0
  186. package/dist/commands/index.js +33 -0
  187. package/dist/commands/index.js.map +1 -0
  188. package/dist/config/unified-config-loader.d.ts +7 -0
  189. package/dist/config/unified-config-loader.d.ts.map +1 -1
  190. package/dist/config/unified-config-loader.js +11 -1
  191. package/dist/config/unified-config-loader.js.map +1 -1
  192. package/dist/delegation/executor/index.d.ts +7 -0
  193. package/dist/delegation/executor/index.d.ts.map +1 -0
  194. package/dist/delegation/executor/index.js +28 -0
  195. package/dist/delegation/executor/index.js.map +1 -0
  196. package/dist/delegation/executor/result-aggregator.d.ts +30 -0
  197. package/dist/delegation/executor/result-aggregator.d.ts.map +1 -0
  198. package/dist/delegation/executor/result-aggregator.js +66 -0
  199. package/dist/delegation/executor/result-aggregator.js.map +1 -0
  200. package/dist/delegation/executor/stream-parser.d.ts +28 -0
  201. package/dist/delegation/executor/stream-parser.d.ts.map +1 -0
  202. package/dist/delegation/executor/stream-parser.js +140 -0
  203. package/dist/delegation/executor/stream-parser.js.map +1 -0
  204. package/dist/delegation/executor/types.d.ts +121 -0
  205. package/dist/delegation/executor/types.d.ts.map +1 -0
  206. package/dist/delegation/executor/types.js +6 -0
  207. package/dist/delegation/executor/types.js.map +1 -0
  208. package/dist/delegation/headless-executor.d.ts +13 -91
  209. package/dist/delegation/headless-executor.d.ts.map +1 -1
  210. package/dist/delegation/headless-executor.js +84 -291
  211. package/dist/delegation/headless-executor.js.map +1 -1
  212. package/dist/delegation/index.d.ts +11 -0
  213. package/dist/delegation/index.d.ts.map +1 -0
  214. package/dist/delegation/index.js +33 -0
  215. package/dist/delegation/index.js.map +1 -0
  216. package/dist/delegation/result-formatter.d.ts +1 -30
  217. package/dist/delegation/result-formatter.d.ts.map +1 -1
  218. package/dist/delegation/result-formatter.js.map +1 -1
  219. package/dist/errors/cleanup-registry.d.ts +64 -0
  220. package/dist/errors/cleanup-registry.d.ts.map +1 -0
  221. package/dist/errors/cleanup-registry.js +141 -0
  222. package/dist/errors/cleanup-registry.js.map +1 -0
  223. package/dist/errors/error-handler.d.ts +45 -0
  224. package/dist/errors/error-handler.d.ts.map +1 -0
  225. package/dist/errors/error-handler.js +150 -0
  226. package/dist/errors/error-handler.js.map +1 -0
  227. package/dist/errors/error-types.d.ts +102 -0
  228. package/dist/errors/error-types.d.ts.map +1 -0
  229. package/dist/errors/error-types.js +158 -0
  230. package/dist/errors/error-types.js.map +1 -0
  231. package/dist/errors/exit-codes.d.ts +49 -0
  232. package/dist/errors/exit-codes.d.ts.map +1 -0
  233. package/dist/errors/exit-codes.js +72 -0
  234. package/dist/errors/exit-codes.js.map +1 -0
  235. package/dist/errors/index.d.ts +29 -0
  236. package/dist/errors/index.d.ts.map +1 -0
  237. package/dist/errors/index.js +62 -0
  238. package/dist/errors/index.js.map +1 -0
  239. package/dist/glmt/glmt-transformer.d.ts +29 -248
  240. package/dist/glmt/glmt-transformer.d.ts.map +1 -1
  241. package/dist/glmt/glmt-transformer.js +63 -718
  242. package/dist/glmt/glmt-transformer.js.map +1 -1
  243. package/dist/glmt/index.d.ts +14 -0
  244. package/dist/glmt/index.d.ts.map +1 -0
  245. package/dist/glmt/index.js +41 -0
  246. package/dist/glmt/index.js.map +1 -0
  247. package/dist/glmt/pipeline/content-transformer.d.ts +39 -0
  248. package/dist/glmt/pipeline/content-transformer.d.ts.map +1 -0
  249. package/dist/glmt/pipeline/content-transformer.js +162 -0
  250. package/dist/glmt/pipeline/content-transformer.js.map +1 -0
  251. package/dist/glmt/pipeline/index.d.ts +12 -0
  252. package/dist/glmt/pipeline/index.d.ts.map +1 -0
  253. package/dist/glmt/pipeline/index.js +20 -0
  254. package/dist/glmt/pipeline/index.js.map +1 -0
  255. package/dist/glmt/pipeline/request-transformer.d.ts +31 -0
  256. package/dist/glmt/pipeline/request-transformer.d.ts.map +1 -0
  257. package/dist/glmt/pipeline/request-transformer.js +116 -0
  258. package/dist/glmt/pipeline/request-transformer.js.map +1 -0
  259. package/dist/glmt/pipeline/response-builder.d.ts +52 -0
  260. package/dist/glmt/pipeline/response-builder.d.ts.map +1 -0
  261. package/dist/glmt/pipeline/response-builder.js +205 -0
  262. package/dist/glmt/pipeline/response-builder.js.map +1 -0
  263. package/dist/glmt/pipeline/stream-parser.d.ts +59 -0
  264. package/dist/glmt/pipeline/stream-parser.d.ts.map +1 -0
  265. package/dist/glmt/pipeline/stream-parser.js +241 -0
  266. package/dist/glmt/pipeline/stream-parser.js.map +1 -0
  267. package/dist/glmt/pipeline/tool-call-handler.d.ts +22 -0
  268. package/dist/glmt/pipeline/tool-call-handler.d.ts.map +1 -0
  269. package/dist/glmt/pipeline/tool-call-handler.js +87 -0
  270. package/dist/glmt/pipeline/tool-call-handler.js.map +1 -0
  271. package/dist/glmt/pipeline/types.d.ts +159 -0
  272. package/dist/glmt/pipeline/types.d.ts.map +1 -0
  273. package/dist/glmt/pipeline/types.js +6 -0
  274. package/dist/glmt/pipeline/types.js.map +1 -0
  275. package/dist/management/checks/cliproxy-check.d.ts +37 -0
  276. package/dist/management/checks/cliproxy-check.d.ts.map +1 -0
  277. package/dist/management/checks/cliproxy-check.js +187 -0
  278. package/dist/management/checks/cliproxy-check.js.map +1 -0
  279. package/dist/management/checks/config-check.d.ts +27 -0
  280. package/dist/management/checks/config-check.d.ts.map +1 -0
  281. package/dist/management/checks/config-check.js +158 -0
  282. package/dist/management/checks/config-check.js.map +1 -0
  283. package/dist/management/checks/env-check.d.ts +17 -0
  284. package/dist/management/checks/env-check.d.ts.map +1 -0
  285. package/dist/management/checks/env-check.js +71 -0
  286. package/dist/management/checks/env-check.js.map +1 -0
  287. package/dist/management/checks/index.d.ts +12 -0
  288. package/dist/management/checks/index.d.ts.map +1 -0
  289. package/dist/management/checks/index.js +48 -0
  290. package/dist/management/checks/index.js.map +1 -0
  291. package/dist/management/checks/oauth-check.d.ts +16 -0
  292. package/dist/management/checks/oauth-check.d.ts.map +1 -0
  293. package/dist/management/checks/oauth-check.js +68 -0
  294. package/dist/management/checks/oauth-check.js.map +1 -0
  295. package/dist/management/checks/profile-check.d.ts +36 -0
  296. package/dist/management/checks/profile-check.d.ts.map +1 -0
  297. package/dist/management/checks/profile-check.js +165 -0
  298. package/dist/management/checks/profile-check.js.map +1 -0
  299. package/dist/management/checks/symlink-check.d.ts +30 -0
  300. package/dist/management/checks/symlink-check.d.ts.map +1 -0
  301. package/dist/management/checks/symlink-check.js +204 -0
  302. package/dist/management/checks/symlink-check.js.map +1 -0
  303. package/dist/management/checks/system-check.d.ts +25 -0
  304. package/dist/management/checks/system-check.d.ts.map +1 -0
  305. package/dist/management/checks/system-check.js +136 -0
  306. package/dist/management/checks/system-check.js.map +1 -0
  307. package/dist/management/checks/types.d.ts +64 -0
  308. package/dist/management/checks/types.d.ts.map +1 -0
  309. package/dist/management/checks/types.js +63 -0
  310. package/dist/management/checks/types.js.map +1 -0
  311. package/dist/management/doctor.d.ts +3 -92
  312. package/dist/management/doctor.d.ts.map +1 -1
  313. package/dist/management/doctor.js +15 -831
  314. package/dist/management/doctor.js.map +1 -1
  315. package/dist/management/index.d.ts +15 -0
  316. package/dist/management/index.d.ts.map +1 -0
  317. package/dist/management/index.js +56 -0
  318. package/dist/management/index.js.map +1 -0
  319. package/dist/management/repair/auto-repair.d.ts +13 -0
  320. package/dist/management/repair/auto-repair.d.ts.map +1 -0
  321. package/dist/management/repair/auto-repair.js +170 -0
  322. package/dist/management/repair/auto-repair.js.map +1 -0
  323. package/dist/management/repair/index.d.ts +5 -0
  324. package/dist/management/repair/index.d.ts.map +1 -0
  325. package/dist/management/repair/index.js +9 -0
  326. package/dist/management/repair/index.js.map +1 -0
  327. package/dist/types/delegation.d.ts +1 -13
  328. package/dist/types/delegation.d.ts.map +1 -1
  329. package/dist/types/utils.d.ts +27 -0
  330. package/dist/types/utils.d.ts.map +1 -1
  331. package/dist/ui/assets/{accounts-p1_nf0Jy.js → accounts-BqDNXZu4.js} +1 -1
  332. package/dist/ui/assets/analytics-DQMyOsqI.js +1 -0
  333. package/dist/ui/assets/api-Bzyq4XP7.js +1 -0
  334. package/dist/ui/assets/{card-CCDc-Mx9.js → card-CIN0KDsX.js} +1 -1
  335. package/dist/ui/assets/cliproxy-5iKdPrEG.js +3 -0
  336. package/dist/ui/assets/cliproxy-control-panel-CJ2CfYod.js +1 -0
  337. package/dist/ui/assets/{code-editor-Br9x-r-E.js → code-editor-CDmNFLQ6.js} +1 -1
  338. package/dist/ui/assets/confirm-dialog-CaiDQikc.js +1 -0
  339. package/dist/ui/assets/copilot-nS6iAyk2.js +4 -0
  340. package/dist/ui/assets/form-utils-DP6ILe7Z.js +20 -0
  341. package/dist/ui/assets/health-DYOQfC7u.js +1 -0
  342. package/dist/ui/assets/{icons-BOsxPbiD.js → icons-ZmwVoUeR.js} +1 -1
  343. package/dist/ui/assets/index-C6Dah-xh.js +46 -0
  344. package/dist/ui/assets/index-It66SkKf.css +1 -0
  345. package/dist/ui/assets/{radix-ui-DFHQr9A5.js → radix-ui-CV3R9pD6.js} +3 -3
  346. package/dist/ui/assets/settings-DABC9b5G.js +1 -0
  347. package/dist/ui/assets/{shared-BfYhSN4-.js → shared-BwU4OKQc.js} +1 -1
  348. package/dist/ui/assets/{switch-CMk95lwf.js → switch-BQ6sBBUv.js} +1 -1
  349. package/dist/ui/assets/{tanstack-C4gT2P7V.js → tanstack-Df9bCj5R.js} +1 -1
  350. package/dist/ui/index.html +6 -6
  351. package/dist/utils/claude-spawner.d.ts +54 -0
  352. package/dist/utils/claude-spawner.d.ts.map +1 -0
  353. package/dist/utils/claude-spawner.js +118 -0
  354. package/dist/utils/claude-spawner.js.map +1 -0
  355. package/dist/utils/delegation-validator.d.ts +8 -4
  356. package/dist/utils/delegation-validator.d.ts.map +1 -1
  357. package/dist/utils/delegation-validator.js.map +1 -1
  358. package/dist/utils/helpers.d.ts +0 -11
  359. package/dist/utils/helpers.d.ts.map +1 -1
  360. package/dist/utils/helpers.js +1 -57
  361. package/dist/utils/helpers.js.map +1 -1
  362. package/dist/utils/index.d.ts +15 -0
  363. package/dist/utils/index.d.ts.map +1 -0
  364. package/dist/utils/index.js +50 -0
  365. package/dist/utils/index.js.map +1 -0
  366. package/dist/utils/time.d.ts +10 -0
  367. package/dist/utils/time.d.ts.map +1 -0
  368. package/dist/utils/time.js +27 -0
  369. package/dist/utils/time.js.map +1 -0
  370. package/dist/utils/ui/boxes.d.ts +24 -0
  371. package/dist/utils/ui/boxes.d.ts.map +1 -0
  372. package/dist/utils/ui/boxes.js +108 -0
  373. package/dist/utils/ui/boxes.js.map +1 -0
  374. package/dist/utils/ui/colors.d.ts +25 -0
  375. package/dist/utils/ui/colors.d.ts.map +1 -0
  376. package/dist/utils/ui/colors.js +70 -0
  377. package/dist/utils/ui/colors.js.map +1 -0
  378. package/dist/utils/ui/index.d.ts +51 -0
  379. package/dist/utils/ui/index.d.ts.map +1 -0
  380. package/dist/utils/ui/index.js +96 -0
  381. package/dist/utils/ui/index.js.map +1 -0
  382. package/dist/utils/ui/indicators.d.ts +23 -0
  383. package/dist/utils/ui/indicators.d.ts.map +1 -0
  384. package/dist/utils/ui/indicators.js +39 -0
  385. package/dist/utils/ui/indicators.js.map +1 -0
  386. package/dist/utils/ui/init.d.ts +30 -0
  387. package/dist/utils/ui/init.d.ts.map +1 -0
  388. package/dist/utils/ui/init.js +102 -0
  389. package/dist/utils/ui/init.js.map +1 -0
  390. package/dist/utils/ui/spinner.d.ts +13 -0
  391. package/dist/utils/ui/spinner.d.ts.map +1 -0
  392. package/dist/utils/ui/spinner.js +89 -0
  393. package/dist/utils/ui/spinner.js.map +1 -0
  394. package/dist/utils/ui/tables.d.ts +12 -0
  395. package/dist/utils/ui/tables.d.ts.map +1 -0
  396. package/dist/utils/ui/tables.js +69 -0
  397. package/dist/utils/ui/tables.js.map +1 -0
  398. package/dist/utils/ui/tasks.d.ts +26 -0
  399. package/dist/utils/ui/tasks.d.ts.map +1 -0
  400. package/dist/utils/ui/tasks.js +102 -0
  401. package/dist/utils/ui/tasks.js.map +1 -0
  402. package/dist/utils/ui/text.d.ts +24 -0
  403. package/dist/utils/ui/text.d.ts.map +1 -0
  404. package/dist/utils/ui/text.js +60 -0
  405. package/dist/utils/ui/text.js.map +1 -0
  406. package/dist/utils/ui/types.d.ts +36 -0
  407. package/dist/utils/ui/types.d.ts.map +1 -0
  408. package/dist/utils/ui/types.js +33 -0
  409. package/dist/utils/ui/types.js.map +1 -0
  410. package/dist/utils/ui.d.ts +3 -138
  411. package/dist/utils/ui.d.ts.map +1 -1
  412. package/dist/utils/ui.js +40 -567
  413. package/dist/utils/ui.js.map +1 -1
  414. package/dist/utils/websearch/gemini-cli.d.ts +36 -0
  415. package/dist/utils/websearch/gemini-cli.d.ts.map +1 -0
  416. package/dist/utils/websearch/gemini-cli.js +132 -0
  417. package/dist/utils/websearch/gemini-cli.js.map +1 -0
  418. package/dist/utils/websearch/grok-cli.d.ts +26 -0
  419. package/dist/utils/websearch/grok-cli.d.ts.map +1 -0
  420. package/dist/utils/websearch/grok-cli.js +81 -0
  421. package/dist/utils/websearch/grok-cli.js.map +1 -0
  422. package/dist/utils/websearch/hook-config.d.ts +21 -0
  423. package/dist/utils/websearch/hook-config.d.ts.map +1 -0
  424. package/dist/utils/websearch/hook-config.js +183 -0
  425. package/dist/utils/websearch/hook-config.js.map +1 -0
  426. package/dist/utils/websearch/hook-env.d.ts +16 -0
  427. package/dist/utils/websearch/hook-env.d.ts.map +1 -0
  428. package/dist/utils/websearch/hook-env.js +62 -0
  429. package/dist/utils/websearch/hook-env.js.map +1 -0
  430. package/dist/utils/websearch/hook-installer.d.ts +27 -0
  431. package/dist/utils/websearch/hook-installer.d.ts.map +1 -0
  432. package/dist/utils/websearch/hook-installer.js +141 -0
  433. package/dist/utils/websearch/hook-installer.js.map +1 -0
  434. package/dist/utils/websearch/index.d.ts +15 -0
  435. package/dist/utils/websearch/index.d.ts.map +1 -0
  436. package/dist/utils/websearch/index.js +44 -0
  437. package/dist/utils/websearch/index.js.map +1 -0
  438. package/dist/utils/websearch/opencode-cli.d.ts +26 -0
  439. package/dist/utils/websearch/opencode-cli.d.ts.map +1 -0
  440. package/dist/utils/websearch/opencode-cli.js +81 -0
  441. package/dist/utils/websearch/opencode-cli.js.map +1 -0
  442. package/dist/utils/websearch/status.d.ts +35 -0
  443. package/dist/utils/websearch/status.d.ts.map +1 -0
  444. package/dist/utils/websearch/status.js +185 -0
  445. package/dist/utils/websearch/status.js.map +1 -0
  446. package/dist/utils/websearch/types.d.ts +85 -0
  447. package/dist/utils/websearch/types.d.ts.map +1 -0
  448. package/dist/utils/websearch/types.js +10 -0
  449. package/dist/utils/websearch/types.js.map +1 -0
  450. package/dist/utils/websearch-manager.d.ts +7 -186
  451. package/dist/utils/websearch-manager.d.ts.map +1 -1
  452. package/dist/utils/websearch-manager.js +37 -710
  453. package/dist/utils/websearch-manager.js.map +1 -1
  454. package/dist/web-server/data-aggregator.d.ts +3 -51
  455. package/dist/web-server/data-aggregator.d.ts.map +1 -1
  456. package/dist/web-server/data-aggregator.js +18 -386
  457. package/dist/web-server/data-aggregator.js.map +1 -1
  458. package/dist/web-server/health/cliproxy-checks.d.ts +23 -0
  459. package/dist/web-server/health/cliproxy-checks.d.ts.map +1 -0
  460. package/dist/web-server/health/cliproxy-checks.js +145 -0
  461. package/dist/web-server/health/cliproxy-checks.js.map +1 -0
  462. package/dist/web-server/health/config-checks.d.ts +19 -0
  463. package/dist/web-server/health/config-checks.d.ts.map +1 -0
  464. package/dist/web-server/health/config-checks.js +174 -0
  465. package/dist/web-server/health/config-checks.js.map +1 -0
  466. package/dist/web-server/health/environment-checks.d.ts +11 -0
  467. package/dist/web-server/health/environment-checks.d.ts.map +1 -0
  468. package/dist/web-server/health/environment-checks.js +40 -0
  469. package/dist/web-server/health/environment-checks.js.map +1 -0
  470. package/dist/web-server/health/index.d.ts +13 -0
  471. package/dist/web-server/health/index.d.ts.map +1 -0
  472. package/dist/web-server/health/index.js +41 -0
  473. package/dist/web-server/health/index.js.map +1 -0
  474. package/dist/web-server/health/oauth-checks.d.ts +11 -0
  475. package/dist/web-server/health/oauth-checks.d.ts.map +1 -0
  476. package/dist/web-server/health/oauth-checks.js +34 -0
  477. package/dist/web-server/health/oauth-checks.js.map +1 -0
  478. package/dist/web-server/health/profile-checks.d.ts +19 -0
  479. package/dist/web-server/health/profile-checks.d.ts.map +1 -0
  480. package/dist/web-server/health/profile-checks.js +152 -0
  481. package/dist/web-server/health/profile-checks.js.map +1 -0
  482. package/dist/web-server/health/symlink-checks.d.ts +15 -0
  483. package/dist/web-server/health/symlink-checks.d.ts.map +1 -0
  484. package/dist/web-server/health/symlink-checks.js +173 -0
  485. package/dist/web-server/health/symlink-checks.js.map +1 -0
  486. package/dist/web-server/health/system-checks.d.ts +19 -0
  487. package/dist/web-server/health/system-checks.d.ts.map +1 -0
  488. package/dist/web-server/health/system-checks.js +127 -0
  489. package/dist/web-server/health/system-checks.js.map +1 -0
  490. package/dist/web-server/health/types.d.ts +34 -0
  491. package/dist/web-server/health/types.d.ts.map +1 -0
  492. package/dist/web-server/health/types.js +8 -0
  493. package/dist/web-server/health/types.js.map +1 -0
  494. package/dist/web-server/health/websearch-checks.d.ts +11 -0
  495. package/dist/web-server/health/websearch-checks.d.ts.map +1 -0
  496. package/dist/web-server/health/websearch-checks.js +53 -0
  497. package/dist/web-server/health/websearch-checks.js.map +1 -0
  498. package/dist/web-server/health-service.d.ts +4 -30
  499. package/dist/web-server/health-service.d.ts.map +1 -1
  500. package/dist/web-server/health-service.js +28 -695
  501. package/dist/web-server/health-service.js.map +1 -1
  502. package/dist/web-server/index.d.ts.map +1 -1
  503. package/dist/web-server/index.js +2 -5
  504. package/dist/web-server/index.js.map +1 -1
  505. package/dist/web-server/routes/cliproxy-auth-routes.d.ts +6 -0
  506. package/dist/web-server/routes/cliproxy-auth-routes.d.ts.map +1 -0
  507. package/dist/web-server/routes/cliproxy-auth-routes.js +202 -0
  508. package/dist/web-server/routes/cliproxy-auth-routes.js.map +1 -0
  509. package/dist/web-server/routes/cliproxy-stats-routes.d.ts +6 -0
  510. package/dist/web-server/routes/cliproxy-stats-routes.d.ts.map +1 -0
  511. package/dist/web-server/routes/cliproxy-stats-routes.js +253 -0
  512. package/dist/web-server/routes/cliproxy-stats-routes.js.map +1 -0
  513. package/dist/web-server/routes/config-routes.d.ts +6 -0
  514. package/dist/web-server/routes/config-routes.d.ts.map +1 -0
  515. package/dist/web-server/routes/config-routes.js +145 -0
  516. package/dist/web-server/routes/config-routes.js.map +1 -0
  517. package/dist/web-server/routes/copilot-routes.d.ts +6 -0
  518. package/dist/web-server/routes/copilot-routes.d.ts.map +1 -0
  519. package/dist/web-server/routes/copilot-routes.js +195 -0
  520. package/dist/web-server/routes/copilot-routes.js.map +1 -0
  521. package/dist/web-server/routes/copilot-settings-routes.d.ts +6 -0
  522. package/dist/web-server/routes/copilot-settings-routes.d.ts.map +1 -0
  523. package/dist/web-server/routes/copilot-settings-routes.js +122 -0
  524. package/dist/web-server/routes/copilot-settings-routes.js.map +1 -0
  525. package/dist/web-server/routes/health-routes.d.ts +6 -0
  526. package/dist/web-server/routes/health-routes.d.ts.map +1 -0
  527. package/dist/web-server/routes/health-routes.js +30 -0
  528. package/dist/web-server/routes/health-routes.js.map +1 -0
  529. package/dist/web-server/routes/index.d.ts +8 -0
  530. package/dist/web-server/routes/index.d.ts.map +1 -0
  531. package/dist/web-server/routes/index.js +54 -0
  532. package/dist/web-server/routes/index.js.map +1 -0
  533. package/dist/web-server/routes/misc-routes.d.ts +6 -0
  534. package/dist/web-server/routes/misc-routes.d.ts.map +1 -0
  535. package/dist/web-server/routes/misc-routes.js +219 -0
  536. package/dist/web-server/routes/misc-routes.js.map +1 -0
  537. package/dist/web-server/routes/profile-routes.d.ts +6 -0
  538. package/dist/web-server/routes/profile-routes.d.ts.map +1 -0
  539. package/dist/web-server/routes/profile-routes.js +164 -0
  540. package/dist/web-server/routes/profile-routes.js.map +1 -0
  541. package/dist/web-server/routes/provider-routes.d.ts +6 -0
  542. package/dist/web-server/routes/provider-routes.d.ts.map +1 -0
  543. package/dist/web-server/routes/provider-routes.js +146 -0
  544. package/dist/web-server/routes/provider-routes.js.map +1 -0
  545. package/dist/web-server/routes/route-helpers.d.ts +55 -0
  546. package/dist/web-server/routes/route-helpers.d.ts.map +1 -0
  547. package/dist/web-server/routes/route-helpers.js +201 -0
  548. package/dist/web-server/routes/route-helpers.js.map +1 -0
  549. package/dist/web-server/routes/settings-routes.d.ts +6 -0
  550. package/dist/web-server/routes/settings-routes.d.ts.map +1 -0
  551. package/dist/web-server/routes/settings-routes.js +207 -0
  552. package/dist/web-server/routes/settings-routes.js.map +1 -0
  553. package/dist/web-server/routes/variant-routes.d.ts +6 -0
  554. package/dist/web-server/routes/variant-routes.d.ts.map +1 -0
  555. package/dist/web-server/routes/variant-routes.js +158 -0
  556. package/dist/web-server/routes/variant-routes.js.map +1 -0
  557. package/dist/web-server/routes/websearch-routes.d.ts +6 -0
  558. package/dist/web-server/routes/websearch-routes.d.ts.map +1 -0
  559. package/dist/web-server/routes/websearch-routes.js +130 -0
  560. package/dist/web-server/routes/websearch-routes.js.map +1 -0
  561. package/dist/web-server/services/index.d.ts +7 -0
  562. package/dist/web-server/services/index.d.ts.map +1 -0
  563. package/dist/web-server/services/index.js +21 -0
  564. package/dist/web-server/services/index.js.map +1 -0
  565. package/dist/web-server/services/usage-aggregator.d.ts +7 -0
  566. package/dist/web-server/services/usage-aggregator.d.ts.map +1 -0
  567. package/dist/web-server/services/usage-aggregator.js +23 -0
  568. package/dist/web-server/services/usage-aggregator.js.map +1 -0
  569. package/dist/web-server/usage/aggregator.d.ts +54 -0
  570. package/dist/web-server/usage/aggregator.d.ts.map +1 -0
  571. package/dist/web-server/usage/aggregator.js +470 -0
  572. package/dist/web-server/usage/aggregator.js.map +1 -0
  573. package/dist/web-server/usage/data-aggregator.d.ts +55 -0
  574. package/dist/web-server/usage/data-aggregator.d.ts.map +1 -0
  575. package/dist/web-server/usage/data-aggregator.js +391 -0
  576. package/dist/web-server/usage/data-aggregator.js.map +1 -0
  577. package/dist/web-server/usage/disk-cache.d.ts +46 -0
  578. package/dist/web-server/usage/disk-cache.d.ts.map +1 -0
  579. package/dist/web-server/usage/disk-cache.js +162 -0
  580. package/dist/web-server/usage/disk-cache.js.map +1 -0
  581. package/dist/web-server/usage/handlers.d.ts +50 -0
  582. package/dist/web-server/usage/handlers.d.ts.map +1 -0
  583. package/dist/web-server/usage/handlers.js +524 -0
  584. package/dist/web-server/usage/handlers.js.map +1 -0
  585. package/dist/web-server/usage/index.d.ts +12 -0
  586. package/dist/web-server/usage/index.d.ts.map +1 -0
  587. package/dist/web-server/usage/index.js +54 -0
  588. package/dist/web-server/usage/index.js.map +1 -0
  589. package/dist/web-server/usage/routes.d.ts +11 -0
  590. package/dist/web-server/usage/routes.d.ts.map +1 -0
  591. package/dist/web-server/usage/routes.js +37 -0
  592. package/dist/web-server/usage/routes.js.map +1 -0
  593. package/dist/web-server/usage/types.d.ts +119 -0
  594. package/dist/web-server/usage/types.d.ts.map +1 -0
  595. package/dist/web-server/usage/types.js +9 -0
  596. package/dist/web-server/usage/types.js.map +1 -0
  597. package/dist/web-server/usage-disk-cache.d.ts +3 -42
  598. package/dist/web-server/usage-disk-cache.d.ts.map +1 -1
  599. package/dist/web-server/usage-disk-cache.js +5 -144
  600. package/dist/web-server/usage-disk-cache.js.map +1 -1
  601. package/dist/web-server/usage-routes.d.ts +3 -31
  602. package/dist/web-server/usage-routes.d.ts.map +1 -1
  603. package/dist/web-server/usage-routes.js +8 -1139
  604. package/dist/web-server/usage-routes.js.map +1 -1
  605. package/dist/web-server/usage-types.d.ts +3 -115
  606. package/dist/web-server/usage-types.d.ts.map +1 -1
  607. package/dist/web-server/usage-types.js +17 -3
  608. package/dist/web-server/usage-types.js.map +1 -1
  609. package/package.json +1 -1
  610. package/dist/ui/assets/analytics-D1k2nYcF.js +0 -1
  611. package/dist/ui/assets/api-D9VVmZ1j.js +0 -1
  612. package/dist/ui/assets/cliproxy-CTt_Nsft.js +0 -1
  613. package/dist/ui/assets/cliproxy-control-panel-DKMAi4_4.js +0 -1
  614. package/dist/ui/assets/copilot-C6F8PT_L.js +0 -4
  615. package/dist/ui/assets/form-utils-BuXDJb0w.js +0 -20
  616. package/dist/ui/assets/health-DiAvJaSn.js +0 -1
  617. package/dist/ui/assets/index-Brq6EBKZ.css +0 -1
  618. package/dist/ui/assets/index-ByU8ZhED.js +0 -48
  619. package/dist/ui/assets/settings-CEomZLGl.js +0 -1
  620. package/dist/web-server/routes.d.ts +0 -7
  621. package/dist/web-server/routes.d.ts.map +0 -1
  622. package/dist/web-server/routes.js +0 -1891
  623. package/dist/web-server/routes.js.map +0 -1
@@ -1 +0,0 @@
1
- import{j as e}from"./radix-ui-DFHQr9A5.js";import{k as as,r}from"./react-vendor-FspHSO0w.js";import{a3 as ie,a4 as rs,a5 as Ge,X as ls,Y as ns,Z as me,a6 as os,B as w,a7 as be,a8 as fe,i as ge,I as G,z as cs,A as ds,E as is,F as ms,G as _e}from"./index-ByU8ZhED.js";import{S as O}from"./switch-CMk95lwf.js";import{CodeEditor as xs}from"./code-editor-Br9x-r-E.js";import{J as k,am as us,z as hs,a6 as ps,k as bs,an as Fe,j as fs,o as gs,ac as je,l as le,t as xe,x as ue,y as he,D as pe,N as js,V as vs,ao as Ns,ap as ze,e as ys,W as ws}from"./icons-BOsxPbiD.js";import"./tanstack-C4gT2P7V.js";import"./notifications-B2Pz7lik.js";import"./utils-CzKF5WmX.js";import"./form-utils-BuXDJb0w.js";import"./code-highlight-BoHWVYut.js";function Ms(){const[t]=as(),x=t.get("tab"),o=x==="globalenv"?"globalenv":x==="proxy"?"proxy":"websearch",[u,v]=r.useState(o),[l,h]=r.useState(null),[d,C]=r.useState(!0),[_,N]=r.useState(!1),[S,f]=r.useState(null),[F,c]=r.useState(!1),[E,W]=r.useState(null),[U,V]=r.useState(!0),[y,g]=r.useState(null),[T,z]=r.useState(!1),[D,M]=r.useState(!1),[I,L]=r.useState(""),[j,Y]=r.useState(""),[K,X]=r.useState(!1),[P,A]=r.useState(!1),[Z,Q]=r.useState(!1),[p,H]=r.useState(null),[ne,ee]=r.useState(!0),[n,$]=r.useState(!1),[se,te]=r.useState(null),[Me,ve]=r.useState(!1),[oe,Ne]=r.useState(""),[ye,we]=r.useState(""),[R,ae]=r.useState(null),[$e,ke]=r.useState(!0),[Be,Ce]=r.useState(!1),[Oe,B]=r.useState(null),[Ve,Se]=r.useState(!1),[De,ce]=r.useState(null),[He,Ee]=r.useState(!1);r.useEffect(()=>{Pe(),Te(),q(),Ie(),Le()},[]),r.useEffect(()=>{l&&(L(l.providers?.gemini?.model??"gemini-2.5-flash"),Y(l.providers?.opencode?.model??"opencode/grok-code"))},[l]);const Pe=async()=>{try{C(!0),f(null);const s=await fetch("/api/websearch");if(!s.ok)throw new Error("Failed to load WebSearch config");const a=await s.json();h(a)}catch(s){f(s.message)}finally{C(!1)}},Te=async()=>{try{V(!0);const s=await fetch("/api/websearch/status");if(!s.ok)throw new Error("Failed to load status");const a=await s.json();W(a)}catch(s){console.error("Failed to fetch WebSearch status:",s)}finally{V(!1)}},q=async()=>{try{z(!0);const s=await fetch("/api/config/raw");if(!s.ok){g(null);return}const a=await s.text();g(a)}catch(s){console.error("Failed to fetch raw config:",s),g(null)}finally{z(!1)}},Ie=async()=>{try{ee(!0),te(null);const s=await fetch("/api/global-env");if(!s.ok)throw new Error("Failed to load Global Env config");const a=await s.json();H(a)}catch(s){te(s.message)}finally{ee(!1)}},Le=async()=>{try{ke(!0),B(null);const s=await ie.cliproxyServer.get();ae(s)}catch(s){B(s.message)}finally{ke(!1)}},We=async()=>{if(y)try{await navigator.clipboard.writeText(y),M(!0),setTimeout(()=>M(!1),2e3)}catch(s){console.error("Failed to copy:",s)}},Ue=()=>{const s=l?.providers||{},a=s.gemini?.enabled??!1,i=s.grok?.enabled??!1,b=s.opencode?.enabled??!1;J({enabled:!a||i||b,providers:{...s,gemini:{...s.gemini,enabled:!a}}})},J=async s=>{if(!l)return;const a={...l,...s};h(a);try{N(!0),f(null);const i=await fetch("/api/websearch",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});if(!i.ok){const m=await i.json();throw new Error(m.error||"Failed to save")}const b=await i.json();h(b.websearch),c(!0),setTimeout(()=>c(!1),1500),fetch("/api/config/raw").then(m=>m.ok?m.text():null).then(m=>m&&g(m)).catch(()=>{})}catch(i){h(l),f(i.message)}finally{N(!1)}},de=l?.providers?.gemini?.enabled??!1,Ae=l?.providers?.grok?.enabled??!1,Re=l?.providers?.opencode?.enabled??!1,Ye=()=>{const s=l?.providers||{},a=s.grok?.enabled??!1;J({enabled:de||!a||Re,providers:{...s,grok:{...s.grok,enabled:!a}}})},qe=()=>{const s=l?.providers||{},a=s.opencode?.enabled??!1;J({enabled:de||Ae||!a,providers:{...s,opencode:{...s.opencode,enabled:!a}}})},Je=()=>{const s=l?.providers?.gemini?.model??"gemini-2.5-flash";if(I!==s){const a=l?.providers||{};J({providers:{...a,gemini:{...a.gemini,model:I}}})}},Ke=()=>{const s=l?.providers?.opencode?.model??"opencode/grok-code";if(j!==s){const a=l?.providers||{};J({providers:{...a,opencode:{...a.opencode,model:j}}})}},re=async s=>{if(!p)return;const a={...p,...s};H(a);try{$(!0),te(null);const i=await fetch("/api/global-env",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});if(!i.ok){const m=await i.json();throw new Error(m.error||"Failed to save")}const b=await i.json();H(b.config),ve(!0),setTimeout(()=>ve(!1),1500),fetch("/api/config/raw").then(m=>m.ok?m.text():null).then(m=>m&&g(m)).catch(()=>{})}catch(i){H(p),te(i.message)}finally{$(!1)}},Xe=()=>{re({enabled:!p?.enabled})},Ze=()=>{if(!oe.trim()||!p)return;const s={...p.env,[oe.trim()]:ye};re({env:s}),Ne(""),we("")},Qe=s=>{if(!p)return;const a={...p.env};delete a[s],re({env:a})},es=(s,a)=>{if(!p)return;const i={...p.env,[s]:a};re({env:i})},ss=async s=>{if(!R)return;const a={remote:{...R.remote,...s.remote},fallback:{...R.fallback,...s.fallback},local:{...R.local,...s.local}};ae(a),ce(null);try{Ce(!0),B(null);const i=await ie.cliproxyServer.update(s);ae(i),Se(!0),setTimeout(()=>Se(!1),1500),fetch("/api/config/raw").then(b=>b.ok?b.text():null).then(b=>b&&g(b)).catch(()=>{})}catch(i){ae(R),B(i.message)}finally{Ce(!1)}},ts=async()=>{if(!R)return;const{host:s,port:a,protocol:i,auth_token:b}=R.remote;if(!s){B("Host is required");return}try{Ee(!0),B(null),ce(null);const m=await ie.cliproxyServer.test({host:s,port:a||void 0,protocol:i,authToken:b||void 0});ce(m)}catch(m){B(m.message)}finally{Ee(!1)}};return d?e.jsx("div",{className:"h-[calc(100vh-100px)] flex items-center justify-center",children:e.jsxs("div",{className:"flex items-center gap-3 text-muted-foreground",children:[e.jsx(k,{className:"w-5 h-5 animate-spin"}),e.jsx("span",{className:"text-lg",children:"Loading configuration..."})]})}):e.jsx("div",{className:"h-[calc(100vh-100px)]",children:e.jsxs(rs,{direction:"horizontal",className:"h-full",children:[e.jsx(Ge,{defaultSize:40,minSize:30,maxSize:55,children:e.jsxs("div",{className:"h-full border-r flex flex-col bg-muted/30 relative",children:[e.jsx("div",{className:"p-5 border-b bg-background",children:e.jsx(ls,{value:u,onValueChange:s=>v(s),children:e.jsxs(ns,{className:"w-full",children:[e.jsxs(me,{value:"websearch",className:"flex-1 gap-2",children:[e.jsx(us,{className:"w-4 h-4"}),"WebSearch"]}),e.jsxs(me,{value:"globalenv",className:"flex-1 gap-2",children:[e.jsx(hs,{className:"w-4 h-4"}),"Global Env"]}),e.jsxs(me,{value:"proxy",className:"flex-1 gap-2",children:[e.jsx(ps,{className:"w-4 h-4"}),"Proxy"]})]})})}),u==="websearch"?e.jsx(ks,{config:l,status:E,statusLoading:U,saving:_,error:S,success:F,isGeminiEnabled:de,isGrokEnabled:Ae,isOpenCodeEnabled:Re,geminiModelInput:I,opencodeModelInput:j,showGeminiHint:K,showOpencodeHint:P,showGrokHint:Z,setGeminiModelInput:L,setOpencodeModelInput:Y,setShowGeminiHint:X,setShowOpencodeHint:A,setShowGrokHint:Q,toggleGemini:Ue,toggleGrok:Ye,toggleOpenCode:qe,saveGeminiModel:Je,saveOpencodeModel:Ke,fetchStatus:Te,fetchConfig:Pe,fetchRawConfig:q,loading:d}):u==="globalenv"?e.jsx(Cs,{config:p,loading:ne,saving:n,error:se,success:Me,newEnvKey:oe,newEnvValue:ye,setNewEnvKey:Ne,setNewEnvValue:we,toggleGlobalEnv:Xe,addEnvVar:Ze,removeEnvVar:Qe,updateEnvValue:es,fetchGlobalEnvConfig:Ie,fetchRawConfig:q}):e.jsx(Ss,{config:R,loading:$e,saving:Be,error:Oe,success:Ve,testResult:De,testing:He,saveCliproxyServerConfig:ss,handleTestConnection:ts,fetchCliproxyServerConfig:Le,fetchRawConfig:q})]})}),e.jsx(os,{className:"w-2 bg-border hover:bg-primary/20 transition-colors cursor-col-resize flex items-center justify-center group",children:e.jsx(bs,{className:"w-3 h-3 text-muted-foreground group-hover:text-primary"})}),e.jsx(Ge,{defaultSize:60,minSize:35,children:e.jsxs("div",{className:"h-full flex flex-col",children:[e.jsxs("div",{className:"p-4 border-b bg-background flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Fe,{className:"w-5 h-5 text-primary"}),e.jsxs("div",{children:[e.jsx("h2",{className:"font-semibold",children:"config.yaml"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"~/.ccs/config.yaml"})]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(w,{variant:"outline",size:"sm",onClick:We,disabled:!y,children:D?e.jsxs(e.Fragment,{children:[e.jsx(fs,{className:"w-4 h-4 mr-1"}),"Copied"]}):e.jsxs(e.Fragment,{children:[e.jsx(gs,{className:"w-4 h-4 mr-1"}),"Copy"]})}),e.jsx(w,{variant:"outline",size:"sm",onClick:q,disabled:T,children:e.jsx(k,{className:`w-4 h-4 ${T?"animate-spin":""}`})})]})]}),e.jsx("div",{className:"flex-1 overflow-auto",children:T?e.jsxs("div",{className:"flex items-center justify-center h-full text-muted-foreground",children:[e.jsx(k,{className:"w-5 h-5 animate-spin mr-2"}),"Loading..."]}):y?e.jsx(xs,{value:y,onChange:()=>{},language:"yaml",readonly:!0,minHeight:"auto",className:"min-h-full"}):e.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground",children:e.jsxs("div",{className:"text-center",children:[e.jsx(Fe,{className:"w-12 h-12 mx-auto mb-3 opacity-30"}),e.jsx("p",{children:"Config file not found"}),e.jsx("code",{className:"text-sm bg-muted px-2 py-1 rounded mt-2 inline-block",children:"ccs migrate"})]})})})]})})]})})}function ks({status:t,statusLoading:x,saving:o,error:u,success:v,isGeminiEnabled:l,isGrokEnabled:h,isOpenCodeEnabled:d,geminiModelInput:C,opencodeModelInput:_,showGeminiHint:N,showOpencodeHint:S,showGrokHint:f,setGeminiModelInput:F,setOpencodeModelInput:c,setShowGeminiHint:E,setShowOpencodeHint:W,setShowGrokHint:U,toggleGemini:V,toggleGrok:y,toggleOpenCode:g,saveGeminiModel:T,saveOpencodeModel:z,fetchStatus:D,fetchConfig:M,fetchRawConfig:I,loading:L}){return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:`absolute left-5 right-5 top-20 z-10 transition-all duration-200 ease-out ${u||v?"opacity-100 translate-y-0":"opacity-0 -translate-y-2 pointer-events-none"}`,children:[u&&e.jsxs(be,{variant:"destructive",className:"py-2 shadow-lg",children:[e.jsx(je,{className:"h-4 w-4"}),e.jsx(fe,{children:u})]}),v&&e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded-md border border-green-200 bg-green-50 text-green-700 shadow-lg dark:border-green-900/50 dark:bg-green-900/90 dark:text-green-300",children:[e.jsx(le,{className:"h-4 w-4 shrink-0"}),e.jsx("span",{className:"text-sm font-medium",children:"Saved"})]})]}),e.jsx(ge,{className:"flex-1",children:e.jsxs("div",{className:"p-5 space-y-6",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"CLI-based web search for third-party profiles (gemini, codex, agy, etc.)"}),e.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg bg-muted/50",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:l?"WebSearch enabled":"WebSearch disabled"}),x?e.jsx("p",{className:"text-sm text-muted-foreground",children:"Checking status..."}):t?.readiness?e.jsx("p",{className:"text-sm text-muted-foreground",children:t.readiness.message}):null]}),e.jsx(w,{variant:"ghost",size:"sm",onClick:D,disabled:x,children:e.jsx(k,{className:`w-4 h-4 ${x?"animate-spin":""}`})})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h3",{className:"text-base font-medium",children:"Providers"}),e.jsxs("div",{className:`rounded-lg border transition-colors ${l?"border-primary border-l-4":"border-border"}`,children:[e.jsxs("div",{className:"flex items-center justify-between p-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(xe,{className:`w-5 h-5 ${l?"text-primary":"text-muted-foreground"}`}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("p",{className:"font-mono font-medium",children:"gemini"}),e.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-green-500/10 text-green-600 font-medium",children:"FREE"}),t?.geminiCli?.installed?e.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-green-500/10 text-green-600 font-medium",children:"installed"}):e.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-amber-500/10 text-amber-600 font-medium",children:"not installed"})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Google Gemini CLI (1000 req/day free)"})]})]}),e.jsx(O,{checked:l,onCheckedChange:V,disabled:o||!t?.geminiCli?.installed})]}),l&&e.jsx("div",{className:"px-4 pb-4 pt-0",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("label",{className:"text-sm text-muted-foreground whitespace-nowrap",children:"Model:"}),e.jsx(G,{value:C,onChange:j=>F(j.target.value),onBlur:T,placeholder:"gemini-2.5-flash",className:"h-8 text-sm font-mono",disabled:o})]})}),!t?.geminiCli?.installed&&!x&&e.jsxs("div",{className:"px-4 pb-4 pt-0 border-t border-border/50",children:[e.jsxs("button",{onClick:()=>E(!N),className:"flex items-center gap-2 text-sm text-amber-600 dark:text-amber-400 hover:underline w-full py-2",children:[N?e.jsx(ue,{className:"w-4 h-4"}):e.jsx(he,{className:"w-4 h-4"}),"How to install Gemini CLI"]}),N&&e.jsxs("div",{className:"mt-2 p-3 rounded-md bg-amber-50 dark:bg-amber-900/20 text-sm",children:[e.jsx("p",{className:"text-amber-700 dark:text-amber-300 mb-2",children:"Install globally (FREE tier available):"}),e.jsx("code",{className:"text-sm bg-amber-100 dark:bg-amber-900/40 px-2 py-1 rounded font-mono block mb-2",children:"npm install -g @google/gemini-cli"}),e.jsxs("a",{href:"https://github.com/google-gemini/gemini-cli",target:"_blank",rel:"noopener noreferrer",className:"text-amber-700 dark:text-amber-300 hover:underline inline-flex items-center gap-1",children:[e.jsx(pe,{className:"w-3 h-3"}),"View documentation"]})]})]})]}),e.jsxs("div",{className:`rounded-lg border transition-colors ${d?"border-primary border-l-4":"border-border"}`,children:[e.jsxs("div",{className:"flex items-center justify-between p-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(xe,{className:`w-5 h-5 ${d?"text-primary":"text-muted-foreground"}`}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("p",{className:"font-mono font-medium",children:"opencode"}),e.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-green-500/10 text-green-600 font-medium",children:"FREE"}),t?.opencodeCli?.installed?e.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-green-500/10 text-green-600 font-medium",children:"installed"}):e.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-amber-500/10 text-amber-600 font-medium",children:"not installed"})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"OpenCode (web search via Zen)"})]})]}),e.jsx(O,{checked:d,onCheckedChange:g,disabled:o||!t?.opencodeCli?.installed})]}),d&&e.jsx("div",{className:"px-4 pb-4 pt-0",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("label",{className:"text-sm text-muted-foreground whitespace-nowrap",children:"Model:"}),e.jsx(G,{value:_,onChange:j=>c(j.target.value),onBlur:z,placeholder:"opencode/grok-code",className:"h-8 text-sm font-mono",disabled:o})]})}),!t?.opencodeCli?.installed&&!x&&e.jsxs("div",{className:"px-4 pb-4 pt-0 border-t border-border/50",children:[e.jsxs("button",{onClick:()=>W(!S),className:"flex items-center gap-2 text-sm text-purple-600 dark:text-purple-400 hover:underline w-full py-2",children:[S?e.jsx(ue,{className:"w-4 h-4"}):e.jsx(he,{className:"w-4 h-4"}),"How to install OpenCode"]}),S&&e.jsxs("div",{className:"mt-2 p-3 rounded-md bg-purple-50 dark:bg-purple-900/20 text-sm",children:[e.jsx("p",{className:"text-purple-700 dark:text-purple-300 mb-2",children:"Install globally (FREE tier available):"}),e.jsx("code",{className:"text-sm bg-purple-100 dark:bg-purple-900/40 px-2 py-1 rounded font-mono block mb-2",children:"curl -fsSL https://opencode.ai/install | bash"}),e.jsxs("a",{href:"https://github.com/sst/opencode",target:"_blank",rel:"noopener noreferrer",className:"text-purple-700 dark:text-purple-300 hover:underline inline-flex items-center gap-1",children:[e.jsx(pe,{className:"w-3 h-3"}),"View documentation"]})]})]})]}),e.jsxs("div",{className:`rounded-lg border transition-colors ${h?"border-primary border-l-4":"border-border"}`,children:[e.jsxs("div",{className:"flex items-center justify-between p-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(xe,{className:`w-5 h-5 ${h?"text-primary":"text-muted-foreground"}`}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("p",{className:"font-mono font-medium",children:"grok"}),e.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-blue-500/10 text-blue-600 font-medium",children:"GROK_API_KEY"}),t?.grokCli?.installed?e.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-green-500/10 text-green-600 font-medium",children:"installed"}):e.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-amber-500/10 text-amber-600 font-medium",children:"not installed"})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"xAI Grok CLI (web + X search)"})]})]}),e.jsx(O,{checked:h,onCheckedChange:y,disabled:o||!t?.grokCli?.installed})]}),!t?.grokCli?.installed&&!x&&e.jsxs("div",{className:"px-4 pb-4 pt-0 border-t border-border/50",children:[e.jsxs("button",{onClick:()=>U(!f),className:"flex items-center gap-2 text-sm text-blue-600 dark:text-blue-400 hover:underline w-full py-2",children:[f?e.jsx(ue,{className:"w-4 h-4"}):e.jsx(he,{className:"w-4 h-4"}),"How to install Grok CLI"]}),f&&e.jsxs("div",{className:"mt-2 p-3 rounded-md bg-blue-50 dark:bg-blue-900/20 text-sm",children:[e.jsx("p",{className:"text-blue-700 dark:text-blue-300 mb-2",children:"Install globally (requires xAI API key):"}),e.jsx("code",{className:"text-sm bg-blue-100 dark:bg-blue-900/40 px-2 py-1 rounded font-mono block mb-2",children:"npm install -g @vibe-kit/grok-cli"}),e.jsxs("a",{href:"https://github.com/superagent-ai/grok-cli",target:"_blank",rel:"noopener noreferrer",className:"text-blue-700 dark:text-blue-300 hover:underline inline-flex items-center gap-1",children:[e.jsx(pe,{className:"w-3 h-3"}),"View documentation"]})]})]})]})]})]})}),e.jsx("div",{className:"p-4 border-t bg-background",children:e.jsxs(w,{variant:"outline",size:"sm",onClick:()=>{M(),I()},disabled:L||o,className:"w-full",children:[e.jsx(k,{className:`w-4 h-4 mr-2 ${L?"animate-spin":""}`}),"Refresh"]})})]})}function Cs({config:t,loading:x,saving:o,error:u,success:v,newEnvKey:l,newEnvValue:h,setNewEnvKey:d,setNewEnvValue:C,toggleGlobalEnv:_,addEnvVar:N,removeEnvVar:S,fetchGlobalEnvConfig:f,fetchRawConfig:F}){return x?e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsxs("div",{className:"flex items-center gap-3 text-muted-foreground",children:[e.jsx(k,{className:"w-5 h-5 animate-spin"}),e.jsx("span",{children:"Loading..."})]})}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:`absolute left-5 right-5 top-20 z-10 transition-all duration-200 ease-out ${u||v?"opacity-100 translate-y-0":"opacity-0 -translate-y-2 pointer-events-none"}`,children:[u&&e.jsxs(be,{variant:"destructive",className:"py-2 shadow-lg",children:[e.jsx(je,{className:"h-4 w-4"}),e.jsx(fe,{children:u})]}),v&&e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded-md border border-green-200 bg-green-50 text-green-700 shadow-lg dark:border-green-900/50 dark:bg-green-900/90 dark:text-green-300",children:[e.jsx(le,{className:"h-4 w-4 shrink-0"}),e.jsx("span",{className:"text-sm font-medium",children:"Saved"})]})]}),e.jsx(ge,{className:"flex-1",children:e.jsxs("div",{className:"p-5 space-y-6",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Environment variables injected into all non-Claude subscription profiles (gemini, codex, agy, copilot, etc.)"}),e.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg bg-muted/50",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:t?.enabled?"Global Env enabled":"Global Env disabled"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:t?.enabled?"Env vars will be injected into third-party profiles":"Env vars will not be injected"})]}),e.jsx(O,{checked:t?.enabled??!0,onCheckedChange:_})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h3",{className:"text-base font-medium",children:"Environment Variables"}),t?.env&&Object.keys(t.env).length>0?e.jsx("div",{className:"space-y-2",children:Object.entries(t.env).map(([c,E])=>e.jsxs("div",{className:"flex items-center gap-2 p-3 rounded-lg border bg-background",children:[e.jsx("code",{className:"flex-1 font-mono text-sm truncate",children:c}),e.jsx("span",{className:"text-muted-foreground",children:"="}),e.jsx("code",{className:"font-mono text-sm px-2 py-1 bg-muted rounded",children:E}),e.jsx(w,{variant:"ghost",size:"sm",onClick:()=>S(c),disabled:o,className:"h-8 w-8 p-0 text-destructive hover:text-destructive hover:bg-destructive/10",children:e.jsx(js,{className:"w-4 h-4"})})]},c))}):e.jsx("div",{className:"p-4 rounded-lg border border-dashed text-center text-muted-foreground",children:e.jsx("p",{children:"No environment variables configured"})}),e.jsxs("div",{className:"p-4 rounded-lg border bg-muted/30",children:[e.jsx("h4",{className:"text-sm font-medium mb-3",children:"Add New Variable"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(G,{value:l,onChange:c=>d(c.target.value.toUpperCase()),placeholder:"KEY_NAME",className:"flex-1 font-mono text-sm h-9",disabled:o}),e.jsx("span",{className:"flex items-center text-muted-foreground",children:"="}),e.jsx(G,{value:h,onChange:c=>C(c.target.value),placeholder:"value",className:"flex-1 font-mono text-sm h-9",disabled:o}),e.jsxs(w,{size:"sm",onClick:N,disabled:o||!l.trim(),className:"h-9",children:[e.jsx(vs,{className:"w-4 h-4 mr-1"}),"Add"]})]})]}),e.jsxs("div",{className:"p-4 rounded-lg border bg-muted/30",children:[e.jsx("h4",{className:"text-sm font-medium mb-3",children:"Quick Add Common Variables"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[[{key:"DISABLE_BUG_COMMAND",value:"1"},{key:"DISABLE_ERROR_REPORTING",value:"1"},{key:"DISABLE_TELEMETRY",value:"1"}].map(({key:c,value:E})=>!t?.env?.[c]&&e.jsxs(w,{variant:"outline",size:"sm",onClick:()=>{d(c),C(E)},className:"text-xs font-mono",children:["+ ",c]},c)),t?.env&&["DISABLE_BUG_COMMAND","DISABLE_ERROR_REPORTING","DISABLE_TELEMETRY"].every(c=>t.env[c])&&e.jsx("span",{className:"text-sm text-muted-foreground",children:"All common variables are configured"})]})]})]})]})}),e.jsx("div",{className:"p-4 border-t bg-background",children:e.jsxs(w,{variant:"outline",size:"sm",onClick:()=>{f(),F()},disabled:x||o,className:"w-full",children:[e.jsx(k,{className:`w-4 h-4 mr-2 ${x?"animate-spin":""}`}),"Refresh"]})})]})}function Ss({config:t,loading:x,saving:o,error:u,success:v,testResult:l,testing:h,saveCliproxyServerConfig:d,handleTestConnection:C,fetchCliproxyServerConfig:_,fetchRawConfig:N}){const S={enabled:!1,host:"",port:void 0,protocol:"http",auth_token:""},f={enabled:!0,auto_start:!0},F={port:8317,auto_start:!0},c=n=>n==="https"?443:80,E=t?.remote.host??"",W=t?.remote.port!==void 0?t.remote.port.toString():"",U=t?.remote.auth_token??"",V=(t?.local.port??8317).toString(),[y,g]=r.useState(null),[T,z]=r.useState(null),[D,M]=r.useState(null),[I,L]=r.useState(null),j=y??E,Y=T??W,K=D??U,X=I??V;if(x)return e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsxs("div",{className:"flex items-center gap-3 text-muted-foreground",children:[e.jsx(k,{className:"w-5 h-5 animate-spin"}),e.jsx("span",{children:"Loading..."})]})});const P=t?.remote.enabled??!1,A=t?.remote??S,Z=t?.fallback??f,Q=t?.local??F,p=()=>{const n=y??j;n!==t?.remote.host&&d({remote:{...A,host:n}}),g(null)},H=()=>{const n=T??Y,$=n===""?void 0:parseInt(n,10),se=$&&!isNaN($)&&$>0?$:void 0;se!==t?.remote.port&&d({remote:{...A,port:se}}),z(null)},ne=()=>{const n=D??K;n!==t?.remote.auth_token&&d({remote:{...A,auth_token:n}}),M(null)},ee=()=>{const n=parseInt(I??X,10);!isNaN(n)&&n!==t?.local.port&&d({local:{...Q,port:n}}),L(null)};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:`absolute left-5 right-5 top-20 z-10 transition-all duration-200 ease-out ${u||v?"opacity-100 translate-y-0":"opacity-0 -translate-y-2 pointer-events-none"}`,children:[u&&e.jsxs(be,{variant:"destructive",className:"py-2 shadow-lg",children:[e.jsx(je,{className:"h-4 w-4"}),e.jsx(fe,{children:u})]}),v&&e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded-md border border-green-200 bg-green-50 text-green-700 shadow-lg dark:border-green-900/50 dark:bg-green-900/90 dark:text-green-300",children:[e.jsx(le,{className:"h-4 w-4 shrink-0"}),e.jsx("span",{className:"text-sm font-medium",children:"Saved"})]})]}),e.jsx(ge,{className:"flex-1",children:e.jsxs("div",{className:"p-5 space-y-6",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Configure local or remote CLIProxyAPI connection for proxy-based profiles"}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h3",{className:"text-base font-medium",children:"Connection Mode"}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("button",{onClick:()=>d({remote:{...A,enabled:!1}}),disabled:o,className:`p-4 rounded-lg border-2 text-left transition-all ${P?"border-border hover:border-muted-foreground/50":"border-primary bg-primary/5"}`,children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx(Ns,{className:`w-5 h-5 ${P?"text-muted-foreground":"text-primary"}`}),e.jsx("span",{className:"font-medium",children:"Local"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Run CLIProxyAPI binary on this machine"})]}),e.jsxs("button",{onClick:()=>d({remote:{...A,enabled:!0}}),disabled:o,className:`p-4 rounded-lg border-2 text-left transition-all ${P?"border-primary bg-primary/5":"border-border hover:border-muted-foreground/50"}`,children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx(ze,{className:`w-5 h-5 ${P?"text-primary":"text-muted-foreground"}`}),e.jsx("span",{className:"font-medium",children:"Remote"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Connect to a remote CLIProxyAPI server"})]})]})]}),P&&e.jsxs("div",{className:"space-y-4 p-4 rounded-lg border bg-muted/30",children:[e.jsxs("h4",{className:"text-sm font-medium flex items-center gap-2",children:[e.jsx(ze,{className:"w-4 h-4"}),"Remote Server Configuration"]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"text-sm text-muted-foreground",children:"Host"}),e.jsx(G,{value:j,onChange:n=>g(n.target.value),onBlur:p,placeholder:"192.168.1.100 or proxy.example.com",className:"font-mono",disabled:o})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("label",{className:"text-sm text-muted-foreground",children:["Port"," ",e.jsxs("span",{className:"text-xs opacity-70",children:["(default: ",c(t?.remote.protocol||"http"),")"]})]}),e.jsx(G,{type:"text",inputMode:"numeric",value:Y,onChange:n=>z(n.target.value.replace(/\D/g,"")),onBlur:H,placeholder:`Leave empty for ${c(t?.remote.protocol||"http")}`,className:"font-mono",disabled:o})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"text-sm text-muted-foreground",children:"Protocol"}),e.jsxs(cs,{value:t?.remote.protocol||"http",onValueChange:n=>d({remote:{...A,protocol:n}}),disabled:o,children:[e.jsx(ds,{children:e.jsx(is,{})}),e.jsxs(ms,{children:[e.jsx(_e,{value:"http",children:"HTTP"}),e.jsx(_e,{value:"https",children:"HTTPS"})]})]})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"text-sm text-muted-foreground",children:"Auth Token (optional)"}),e.jsx(G,{type:"password",value:K,onChange:n=>M(n.target.value),onBlur:ne,placeholder:"Bearer token for authentication",className:"font-mono",disabled:o})]}),e.jsxs("div",{className:"space-y-3 pt-2",children:[e.jsx(w,{onClick:C,disabled:h||!j,variant:"outline",className:"w-full",children:h?e.jsxs(e.Fragment,{children:[e.jsx(k,{className:"w-4 h-4 mr-2 animate-spin"}),"Testing..."]}):e.jsxs(e.Fragment,{children:[e.jsx(ys,{className:"w-4 h-4 mr-2"}),"Test Connection"]})}),l&&e.jsx("div",{className:`p-3 rounded-md ${l.reachable?"bg-green-50 border border-green-200 dark:bg-green-900/20 dark:border-green-900/50":"bg-red-50 border border-red-200 dark:bg-red-900/20 dark:border-red-900/50"}`,children:e.jsx("div",{className:"flex items-center gap-2",children:l.reachable?e.jsxs(e.Fragment,{children:[e.jsx(le,{className:"w-4 h-4 text-green-600 dark:text-green-400"}),e.jsxs("span",{className:"text-sm font-medium text-green-700 dark:text-green-300",children:["Connected (",l.latencyMs,"ms)"]})]}):e.jsxs(e.Fragment,{children:[e.jsx(ws,{className:"w-4 h-4 text-red-600 dark:text-red-400"}),e.jsx("span",{className:"text-sm font-medium text-red-700 dark:text-red-300",children:l.error||"Connection failed"})]})})})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h3",{className:"text-base font-medium",children:"Fallback Settings"}),e.jsxs("div",{className:"space-y-3 p-4 rounded-lg border bg-muted/30",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-sm",children:"Enable fallback to local"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Use local proxy if remote is unreachable"})]}),e.jsx(O,{checked:t?.fallback.enabled??!0,onCheckedChange:n=>d({fallback:{...Z,enabled:n}}),disabled:o||!P})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-sm",children:"Auto-start local proxy"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Automatically start local proxy on fallback"})]}),e.jsx(O,{checked:t?.fallback.auto_start??!1,onCheckedChange:n=>d({fallback:{...Z,auto_start:n}}),disabled:o||!P||!t?.fallback.enabled})]})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h3",{className:"text-base font-medium",children:"Local Proxy"}),e.jsxs("div",{className:"space-y-3 p-4 rounded-lg border bg-muted/30",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"text-sm text-muted-foreground",children:"Port"}),e.jsx(G,{type:"number",value:X,onChange:n=>L(n.target.value),onBlur:ee,placeholder:"8317",className:"font-mono max-w-32",disabled:o})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-sm",children:"Auto-start"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Start local proxy automatically when needed"})]}),e.jsx(O,{checked:t?.local.auto_start??!0,onCheckedChange:n=>d({local:{...Q,auto_start:n}}),disabled:o})]})]})]})]})}),e.jsx("div",{className:"p-4 border-t bg-background",children:e.jsxs(w,{variant:"outline",size:"sm",onClick:()=>{_(),N()},disabled:x||o,className:"w-full",children:[e.jsx(k,{className:`w-4 h-4 mr-2 ${x?"animate-spin":""}`}),"Refresh"]})})]})}export{Ms as SettingsPage};
@@ -1,7 +0,0 @@
1
- /**
2
- * REST API Routes (Phase 03)
3
- *
4
- * Implements CRUD operations for profiles, cliproxy variants, and accounts.
5
- */
6
- export declare const apiRoutes: import("express-serve-static-core").Router;
7
- //# sourceMappingURL=routes.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../src/web-server/routes.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAwEH,eAAO,MAAM,SAAS,4CAAW,CAAC"}