@kaitranntt/ccs 8.4.0 → 8.5.0-dev.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 (767) hide show
  1. package/README.md +5 -2
  2. package/config/base-claude.settings.json +1 -1
  3. package/config/base-glm.settings.json +4 -4
  4. package/config/base-glmt.settings.json +4 -4
  5. package/config/base-km.settings.json +4 -4
  6. package/config/base-mm.settings.json +4 -4
  7. package/dist/api/services/cliproxy-profile-bridge.d.ts.map +1 -1
  8. package/dist/api/services/cliproxy-profile-bridge.js +20 -9
  9. package/dist/api/services/cliproxy-profile-bridge.js.map +1 -1
  10. package/dist/api/services/profile-lifecycle-validation.d.ts.map +1 -1
  11. package/dist/api/services/profile-lifecycle-validation.js +2 -0
  12. package/dist/api/services/profile-lifecycle-validation.js.map +1 -1
  13. package/dist/api/services/profile-writer.d.ts.map +1 -1
  14. package/dist/api/services/profile-writer.js +18 -8
  15. package/dist/api/services/profile-writer.js.map +1 -1
  16. package/dist/auth/commands/backup-command.d.ts.map +1 -1
  17. package/dist/auth/commands/backup-command.js +0 -1
  18. package/dist/auth/commands/backup-command.js.map +1 -1
  19. package/dist/auth/commands/create-command.d.ts.map +1 -1
  20. package/dist/auth/commands/create-command.js +4 -14
  21. package/dist/auth/commands/create-command.js.map +1 -1
  22. package/dist/auth/commands/default-command.d.ts.map +1 -1
  23. package/dist/auth/commands/default-command.js +0 -1
  24. package/dist/auth/commands/default-command.js.map +1 -1
  25. package/dist/auth/commands/index.d.ts +2 -1
  26. package/dist/auth/commands/index.d.ts.map +1 -1
  27. package/dist/auth/commands/index.js +0 -1
  28. package/dist/auth/commands/index.js.map +1 -1
  29. package/dist/auth/commands/remove-command.d.ts.map +1 -1
  30. package/dist/auth/commands/remove-command.js +0 -2
  31. package/dist/auth/commands/remove-command.js.map +1 -1
  32. package/dist/auth/commands/resources-command.d.ts.map +1 -1
  33. package/dist/auth/commands/resources-command.js +0 -1
  34. package/dist/auth/commands/resources-command.js.map +1 -1
  35. package/dist/auth/commands/show-command.d.ts.map +1 -1
  36. package/dist/auth/commands/show-command.js +0 -1
  37. package/dist/auth/commands/show-command.js.map +1 -1
  38. package/dist/auth/commands/types.d.ts.map +1 -1
  39. package/dist/auth/commands/types.js +0 -1
  40. package/dist/auth/commands/types.js.map +1 -1
  41. package/dist/auth/profile-registry.d.ts +3 -1
  42. package/dist/auth/profile-registry.d.ts.map +1 -1
  43. package/dist/auth/profile-registry.js +21 -15
  44. package/dist/auth/profile-registry.js.map +1 -1
  45. package/dist/ccs.js +27 -21
  46. package/dist/ccs.js.map +1 -1
  47. package/dist/cliproxy/accounts/account-safety.d.ts.map +1 -1
  48. package/dist/cliproxy/accounts/account-safety.js +56 -56
  49. package/dist/cliproxy/accounts/account-safety.js.map +1 -1
  50. package/dist/cliproxy/auth/antigravity-responsibility.d.ts.map +1 -1
  51. package/dist/cliproxy/auth/antigravity-responsibility.js +15 -15
  52. package/dist/cliproxy/auth/antigravity-responsibility.js.map +1 -1
  53. package/dist/cliproxy/auth/auth-token-manager.d.ts.map +1 -1
  54. package/dist/cliproxy/auth/auth-token-manager.js +2 -1
  55. package/dist/cliproxy/auth/auth-token-manager.js.map +1 -1
  56. package/dist/cliproxy/auth/auth-types.d.ts.map +1 -1
  57. package/dist/cliproxy/auth/auth-types.js +3 -2
  58. package/dist/cliproxy/auth/auth-types.js.map +1 -1
  59. package/dist/cliproxy/auth/oauth-handler.d.ts.map +1 -1
  60. package/dist/cliproxy/auth/oauth-handler.js +16 -5
  61. package/dist/cliproxy/auth/oauth-handler.js.map +1 -1
  62. package/dist/cliproxy/auth/provider-refreshers/index.d.ts +2 -1
  63. package/dist/cliproxy/auth/provider-refreshers/index.d.ts.map +1 -1
  64. package/dist/cliproxy/auth/provider-refreshers/index.js +4 -2
  65. package/dist/cliproxy/auth/provider-refreshers/index.js.map +1 -1
  66. package/dist/cliproxy/auth/token-manager.d.ts +2 -1
  67. package/dist/cliproxy/auth/token-manager.d.ts.map +1 -1
  68. package/dist/cliproxy/auth/token-manager.js +2 -1
  69. package/dist/cliproxy/auth/token-manager.js.map +1 -1
  70. package/dist/cliproxy/binary/lifecycle.d.ts.map +1 -1
  71. package/dist/cliproxy/binary/lifecycle.js +3 -2
  72. package/dist/cliproxy/binary/lifecycle.js.map +1 -1
  73. package/dist/cliproxy/binary/platform-detector.d.ts +1 -1
  74. package/dist/cliproxy/binary/platform-detector.d.ts.map +1 -1
  75. package/dist/cliproxy/config/env-builder.d.ts +7 -2
  76. package/dist/cliproxy/config/env-builder.d.ts.map +1 -1
  77. package/dist/cliproxy/config/env-builder.js +53 -18
  78. package/dist/cliproxy/config/env-builder.js.map +1 -1
  79. package/dist/cliproxy/config/model-config.d.ts.map +1 -1
  80. package/dist/cliproxy/config/model-config.js +32 -32
  81. package/dist/cliproxy/config/model-config.js.map +1 -1
  82. package/dist/cliproxy/config/provider-route.d.ts +13 -0
  83. package/dist/cliproxy/config/provider-route.d.ts.map +1 -0
  84. package/dist/cliproxy/config/provider-route.js +38 -0
  85. package/dist/cliproxy/config/provider-route.js.map +1 -0
  86. package/dist/cliproxy/executor/arg-parser.d.ts.map +1 -1
  87. package/dist/cliproxy/executor/arg-parser.js +26 -26
  88. package/dist/cliproxy/executor/arg-parser.js.map +1 -1
  89. package/dist/cliproxy/executor/auth-coordinator.d.ts.map +1 -1
  90. package/dist/cliproxy/executor/auth-coordinator.js +15 -14
  91. package/dist/cliproxy/executor/auth-coordinator.js.map +1 -1
  92. package/dist/cliproxy/executor/browser-launch-setup.d.ts.map +1 -1
  93. package/dist/cliproxy/executor/browser-launch-setup.js +6 -2
  94. package/dist/cliproxy/executor/browser-launch-setup.js.map +1 -1
  95. package/dist/cliproxy/executor/env-resolver.d.ts.map +1 -1
  96. package/dist/cliproxy/executor/env-resolver.js +5 -1
  97. package/dist/cliproxy/executor/env-resolver.js.map +1 -1
  98. package/dist/cliproxy/executor/index.d.ts.map +1 -1
  99. package/dist/cliproxy/executor/index.js +27 -17
  100. package/dist/cliproxy/executor/index.js.map +1 -1
  101. package/dist/cliproxy/executor/lifecycle-manager.d.ts.map +1 -1
  102. package/dist/cliproxy/executor/lifecycle-manager.js +18 -16
  103. package/dist/cliproxy/executor/lifecycle-manager.js.map +1 -1
  104. package/dist/cliproxy/executor/model-warnings.d.ts.map +1 -1
  105. package/dist/cliproxy/executor/model-warnings.js +24 -13
  106. package/dist/cliproxy/executor/model-warnings.js.map +1 -1
  107. package/dist/cliproxy/executor/proxy-chain-builder.d.ts.map +1 -1
  108. package/dist/cliproxy/executor/proxy-chain-builder.js +5 -1
  109. package/dist/cliproxy/executor/proxy-chain-builder.js.map +1 -1
  110. package/dist/cliproxy/executor/retry-handler.d.ts.map +1 -1
  111. package/dist/cliproxy/executor/retry-handler.js +13 -11
  112. package/dist/cliproxy/executor/retry-handler.js.map +1 -1
  113. package/dist/cliproxy/executor/session-bridge.d.ts.map +1 -1
  114. package/dist/cliproxy/executor/session-bridge.js +18 -10
  115. package/dist/cliproxy/executor/session-bridge.js.map +1 -1
  116. package/dist/cliproxy/management/remote-token-uploader.d.ts.map +1 -1
  117. package/dist/cliproxy/management/remote-token-uploader.js +11 -11
  118. package/dist/cliproxy/management/remote-token-uploader.js.map +1 -1
  119. package/dist/cliproxy/provider-capabilities.d.ts +6 -0
  120. package/dist/cliproxy/provider-capabilities.d.ts.map +1 -1
  121. package/dist/cliproxy/provider-capabilities.js +28 -3
  122. package/dist/cliproxy/provider-capabilities.js.map +1 -1
  123. package/dist/cliproxy/proxy/https-tunnel-proxy.d.ts +5 -1
  124. package/dist/cliproxy/proxy/https-tunnel-proxy.d.ts.map +1 -1
  125. package/dist/cliproxy/proxy/https-tunnel-proxy.js +22 -10
  126. package/dist/cliproxy/proxy/https-tunnel-proxy.js.map +1 -1
  127. package/dist/cliproxy/proxy/tool-sanitization-proxy.d.ts +0 -12
  128. package/dist/cliproxy/proxy/tool-sanitization-proxy.d.ts.map +1 -1
  129. package/dist/cliproxy/proxy/tool-sanitization-proxy.js +42 -72
  130. package/dist/cliproxy/proxy/tool-sanitization-proxy.js.map +1 -1
  131. package/dist/cliproxy/quota/quota-fetcher/account-quota-fetcher.d.ts +21 -0
  132. package/dist/cliproxy/quota/quota-fetcher/account-quota-fetcher.d.ts.map +1 -0
  133. package/dist/cliproxy/quota/quota-fetcher/account-quota-fetcher.js +154 -0
  134. package/dist/cliproxy/quota/quota-fetcher/account-quota-fetcher.js.map +1 -0
  135. package/dist/cliproxy/quota/quota-fetcher/all-accounts-fetcher.d.ts +35 -0
  136. package/dist/cliproxy/quota/quota-fetcher/all-accounts-fetcher.d.ts.map +1 -0
  137. package/dist/cliproxy/quota/quota-fetcher/all-accounts-fetcher.js +98 -0
  138. package/dist/cliproxy/quota/quota-fetcher/all-accounts-fetcher.js.map +1 -0
  139. package/dist/cliproxy/quota/quota-fetcher/auth-file-reader.d.ts +22 -0
  140. package/dist/cliproxy/quota/quota-fetcher/auth-file-reader.d.ts.map +1 -0
  141. package/dist/cliproxy/quota/quota-fetcher/auth-file-reader.js +111 -0
  142. package/dist/cliproxy/quota/quota-fetcher/auth-file-reader.js.map +1 -0
  143. package/dist/cliproxy/quota/quota-fetcher/available-models-fetcher.d.ts +17 -0
  144. package/dist/cliproxy/quota/quota-fetcher/available-models-fetcher.d.ts.map +1 -0
  145. package/dist/cliproxy/quota/quota-fetcher/available-models-fetcher.js +85 -0
  146. package/dist/cliproxy/quota/quota-fetcher/available-models-fetcher.js.map +1 -0
  147. package/dist/cliproxy/quota/quota-fetcher/constants.d.ts +25 -0
  148. package/dist/cliproxy/quota/quota-fetcher/constants.d.ts.map +1 -0
  149. package/dist/cliproxy/quota/quota-fetcher/constants.js +31 -0
  150. package/dist/cliproxy/quota/quota-fetcher/constants.js.map +1 -0
  151. package/dist/cliproxy/quota/quota-fetcher/http-client.d.ts +29 -0
  152. package/dist/cliproxy/quota/quota-fetcher/http-client.d.ts.map +1 -0
  153. package/dist/cliproxy/quota/quota-fetcher/http-client.js +199 -0
  154. package/dist/cliproxy/quota/quota-fetcher/http-client.js.map +1 -0
  155. package/dist/cliproxy/quota/quota-fetcher/project-lookup.d.ts +16 -0
  156. package/dist/cliproxy/quota/quota-fetcher/project-lookup.d.ts.map +1 -0
  157. package/dist/cliproxy/quota/quota-fetcher/project-lookup.js +89 -0
  158. package/dist/cliproxy/quota/quota-fetcher/project-lookup.js.map +1 -0
  159. package/dist/cliproxy/quota/quota-fetcher/status-classifier.d.ts +29 -0
  160. package/dist/cliproxy/quota/quota-fetcher/status-classifier.d.ts.map +1 -0
  161. package/dist/cliproxy/quota/quota-fetcher/status-classifier.js +168 -0
  162. package/dist/cliproxy/quota/quota-fetcher/status-classifier.js.map +1 -0
  163. package/dist/cliproxy/quota/quota-fetcher/types.d.ts +165 -0
  164. package/dist/cliproxy/quota/quota-fetcher/types.d.ts.map +1 -0
  165. package/dist/cliproxy/quota/quota-fetcher/types.js +9 -0
  166. package/dist/cliproxy/quota/quota-fetcher/types.js.map +1 -0
  167. package/dist/cliproxy/quota/quota-fetcher-claude.d.ts.map +1 -1
  168. package/dist/cliproxy/quota/quota-fetcher-claude.js +14 -3
  169. package/dist/cliproxy/quota/quota-fetcher-claude.js.map +1 -1
  170. package/dist/cliproxy/quota/quota-fetcher-codex.d.ts.map +1 -1
  171. package/dist/cliproxy/quota/quota-fetcher-codex.js +36 -9
  172. package/dist/cliproxy/quota/quota-fetcher-codex.js.map +1 -1
  173. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/auth-file-discovery.d.ts +26 -0
  174. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/auth-file-discovery.d.ts.map +1 -0
  175. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/auth-file-discovery.js +132 -0
  176. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/auth-file-discovery.js.map +1 -0
  177. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/bucket-building.d.ts +23 -0
  178. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/bucket-building.d.ts.map +1 -0
  179. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/bucket-building.js +54 -0
  180. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/bucket-building.js.map +1 -0
  181. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/constants.d.ts +26 -0
  182. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/constants.d.ts.map +1 -0
  183. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/constants.js +29 -0
  184. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/constants.js.map +1 -0
  185. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/error-parsing.d.ts +61 -0
  186. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/error-parsing.d.ts.map +1 -0
  187. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/error-parsing.js +259 -0
  188. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/error-parsing.js.map +1 -0
  189. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/index.d.ts +20 -0
  190. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/index.d.ts.map +1 -0
  191. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/index.js +38 -0
  192. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/index.js.map +1 -0
  193. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/managed-request.d.ts +82 -0
  194. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/managed-request.d.ts.map +1 -0
  195. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/managed-request.js +263 -0
  196. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/managed-request.js.map +1 -0
  197. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/quota-fetcher.d.ts +46 -0
  198. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/quota-fetcher.d.ts.map +1 -0
  199. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/quota-fetcher.js +188 -0
  200. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/quota-fetcher.js.map +1 -0
  201. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/shared-utils.d.ts +35 -0
  202. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/shared-utils.d.ts.map +1 -0
  203. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/shared-utils.js +65 -0
  204. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/shared-utils.js.map +1 -0
  205. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/supplementary-metadata.d.ts +37 -0
  206. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/supplementary-metadata.d.ts.map +1 -0
  207. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/supplementary-metadata.js +117 -0
  208. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/supplementary-metadata.js.map +1 -0
  209. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/token-parsing.d.ts +31 -0
  210. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/token-parsing.d.ts.map +1 -0
  211. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/token-parsing.js +77 -0
  212. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/token-parsing.js.map +1 -0
  213. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/types.d.ts +114 -0
  214. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/types.d.ts.map +1 -0
  215. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/types.js +10 -0
  216. package/dist/cliproxy/quota/quota-fetcher-gemini-cli/types.js.map +1 -0
  217. package/dist/cliproxy/quota/quota-fetcher-gemini-cli.d.ts +13 -58
  218. package/dist/cliproxy/quota/quota-fetcher-gemini-cli.d.ts.map +1 -1
  219. package/dist/cliproxy/quota/quota-fetcher-gemini-cli.js +20 -819
  220. package/dist/cliproxy/quota/quota-fetcher-gemini-cli.js.map +1 -1
  221. package/dist/cliproxy/quota/quota-fetcher-ghcp.d.ts.map +1 -1
  222. package/dist/cliproxy/quota/quota-fetcher-ghcp.js +19 -4
  223. package/dist/cliproxy/quota/quota-fetcher-ghcp.js.map +1 -1
  224. package/dist/cliproxy/quota/quota-fetcher.d.ts +12 -108
  225. package/dist/cliproxy/quota/quota-fetcher.d.ts.map +1 -1
  226. package/dist/cliproxy/quota/quota-fetcher.js +23 -766
  227. package/dist/cliproxy/quota/quota-fetcher.js.map +1 -1
  228. package/dist/cliproxy/quota/quota-manager.d.ts.map +1 -1
  229. package/dist/cliproxy/quota/quota-manager.js +7 -3
  230. package/dist/cliproxy/quota/quota-manager.js.map +1 -1
  231. package/dist/cliproxy/routing/routing-strategy.d.ts.map +1 -1
  232. package/dist/cliproxy/routing/routing-strategy.js +11 -3
  233. package/dist/cliproxy/routing/routing-strategy.js.map +1 -1
  234. package/dist/commands/api-command/create-command.d.ts.map +1 -1
  235. package/dist/commands/api-command/create-command.js +17 -8
  236. package/dist/commands/api-command/create-command.js.map +1 -1
  237. package/dist/commands/bar/bar-server-probe.d.ts +16 -3
  238. package/dist/commands/bar/bar-server-probe.d.ts.map +1 -1
  239. package/dist/commands/bar/bar-server-probe.js +83 -18
  240. package/dist/commands/bar/bar-server-probe.js.map +1 -1
  241. package/dist/commands/bar/help-subcommand.d.ts.map +1 -1
  242. package/dist/commands/bar/help-subcommand.js +3 -2
  243. package/dist/commands/bar/help-subcommand.js.map +1 -1
  244. package/dist/commands/bar/index.d.ts.map +1 -1
  245. package/dist/commands/bar/index.js +1 -0
  246. package/dist/commands/bar/index.js.map +1 -1
  247. package/dist/commands/bar/install-subcommand.d.ts +4 -10
  248. package/dist/commands/bar/install-subcommand.d.ts.map +1 -1
  249. package/dist/commands/bar/install-subcommand.js +44 -53
  250. package/dist/commands/bar/install-subcommand.js.map +1 -1
  251. package/dist/commands/bar/launch-subcommand.d.ts +11 -1
  252. package/dist/commands/bar/launch-subcommand.d.ts.map +1 -1
  253. package/dist/commands/bar/launch-subcommand.js +82 -15
  254. package/dist/commands/bar/launch-subcommand.js.map +1 -1
  255. package/dist/commands/cliproxy/help-subcommand.js +5 -5
  256. package/dist/commands/cliproxy/help-subcommand.js.map +1 -1
  257. package/dist/commands/cliproxy/index.d.ts.map +1 -1
  258. package/dist/commands/cliproxy/index.js +7 -2
  259. package/dist/commands/cliproxy/index.js.map +1 -1
  260. package/dist/commands/cliproxy/pool-subcommand.d.ts.map +1 -1
  261. package/dist/commands/cliproxy/pool-subcommand.js +4 -2
  262. package/dist/commands/cliproxy/pool-subcommand.js.map +1 -1
  263. package/dist/commands/cliproxy/proxy-lifecycle-subcommand.d.ts +1 -1
  264. package/dist/commands/cliproxy/proxy-lifecycle-subcommand.d.ts.map +1 -1
  265. package/dist/commands/cliproxy/proxy-lifecycle-subcommand.js +13 -1
  266. package/dist/commands/cliproxy/proxy-lifecycle-subcommand.js.map +1 -1
  267. package/dist/commands/cliproxy/quota-subcommand/claude-window-helpers.d.ts +26 -0
  268. package/dist/commands/cliproxy/quota-subcommand/claude-window-helpers.d.ts.map +1 -0
  269. package/dist/commands/cliproxy/quota-subcommand/claude-window-helpers.js +82 -0
  270. package/dist/commands/cliproxy/quota-subcommand/claude-window-helpers.js.map +1 -0
  271. package/dist/commands/cliproxy/quota-subcommand/codex-window-helpers.d.ts +41 -0
  272. package/dist/commands/cliproxy/quota-subcommand/codex-window-helpers.d.ts.map +1 -0
  273. package/dist/commands/cliproxy/quota-subcommand/codex-window-helpers.js +202 -0
  274. package/dist/commands/cliproxy/quota-subcommand/codex-window-helpers.js.map +1 -0
  275. package/dist/commands/cliproxy/quota-subcommand/format-helpers.d.ts +32 -0
  276. package/dist/commands/cliproxy/quota-subcommand/format-helpers.d.ts.map +1 -0
  277. package/dist/commands/cliproxy/quota-subcommand/format-helpers.js +90 -0
  278. package/dist/commands/cliproxy/quota-subcommand/format-helpers.js.map +1 -0
  279. package/dist/commands/cliproxy/quota-subcommand/handlers.d.ts +25 -0
  280. package/dist/commands/cliproxy/quota-subcommand/handlers.d.ts.map +1 -0
  281. package/dist/commands/cliproxy/quota-subcommand/handlers.js +245 -0
  282. package/dist/commands/cliproxy/quota-subcommand/handlers.js.map +1 -0
  283. package/dist/commands/cliproxy/quota-subcommand/profile-args.d.ts +10 -0
  284. package/dist/commands/cliproxy/quota-subcommand/profile-args.d.ts.map +1 -0
  285. package/dist/commands/cliproxy/quota-subcommand/profile-args.js +37 -0
  286. package/dist/commands/cliproxy/quota-subcommand/profile-args.js.map +1 -0
  287. package/dist/commands/cliproxy/quota-subcommand/provider-runtime.d.ts +12 -0
  288. package/dist/commands/cliproxy/quota-subcommand/provider-runtime.d.ts.map +1 -0
  289. package/dist/commands/cliproxy/quota-subcommand/provider-runtime.js +64 -0
  290. package/dist/commands/cliproxy/quota-subcommand/provider-runtime.js.map +1 -0
  291. package/dist/commands/cliproxy/quota-subcommand/quota-failure-display.d.ts +27 -0
  292. package/dist/commands/cliproxy/quota-subcommand/quota-failure-display.d.ts.map +1 -0
  293. package/dist/commands/cliproxy/quota-subcommand/quota-failure-display.js +74 -0
  294. package/dist/commands/cliproxy/quota-subcommand/quota-failure-display.js.map +1 -0
  295. package/dist/commands/cliproxy/quota-subcommand/sections/antigravity.d.ts +10 -0
  296. package/dist/commands/cliproxy/quota-subcommand/sections/antigravity.d.ts.map +1 -0
  297. package/dist/commands/cliproxy/quota-subcommand/sections/antigravity.js +46 -0
  298. package/dist/commands/cliproxy/quota-subcommand/sections/antigravity.js.map +1 -0
  299. package/dist/commands/cliproxy/quota-subcommand/sections/claude.d.ts +14 -0
  300. package/dist/commands/cliproxy/quota-subcommand/sections/claude.d.ts.map +1 -0
  301. package/dist/commands/cliproxy/quota-subcommand/sections/claude.js +68 -0
  302. package/dist/commands/cliproxy/quota-subcommand/sections/claude.js.map +1 -0
  303. package/dist/commands/cliproxy/quota-subcommand/sections/codex.d.ts +14 -0
  304. package/dist/commands/cliproxy/quota-subcommand/sections/codex.d.ts.map +1 -0
  305. package/dist/commands/cliproxy/quota-subcommand/sections/codex.js +82 -0
  306. package/dist/commands/cliproxy/quota-subcommand/sections/codex.js.map +1 -0
  307. package/dist/commands/cliproxy/quota-subcommand/sections/gemini-cli.d.ts +14 -0
  308. package/dist/commands/cliproxy/quota-subcommand/sections/gemini-cli.d.ts.map +1 -0
  309. package/dist/commands/cliproxy/quota-subcommand/sections/gemini-cli.js +61 -0
  310. package/dist/commands/cliproxy/quota-subcommand/sections/gemini-cli.js.map +1 -0
  311. package/dist/commands/cliproxy/quota-subcommand/sections/ghcp.d.ts +13 -0
  312. package/dist/commands/cliproxy/quota-subcommand/sections/ghcp.d.ts.map +1 -0
  313. package/dist/commands/cliproxy/quota-subcommand/sections/ghcp.js +63 -0
  314. package/dist/commands/cliproxy/quota-subcommand/sections/ghcp.js.map +1 -0
  315. package/dist/commands/cliproxy/quota-subcommand/test-exports.d.ts +19 -0
  316. package/dist/commands/cliproxy/quota-subcommand/test-exports.d.ts.map +1 -0
  317. package/dist/commands/cliproxy/quota-subcommand/test-exports.js +22 -0
  318. package/dist/commands/cliproxy/quota-subcommand/test-exports.js.map +1 -0
  319. package/dist/commands/cliproxy/quota-subcommand/types.d.ts +42 -0
  320. package/dist/commands/cliproxy/quota-subcommand/types.d.ts.map +1 -0
  321. package/dist/commands/cliproxy/quota-subcommand/types.js +9 -0
  322. package/dist/commands/cliproxy/quota-subcommand/types.js.map +1 -0
  323. package/dist/commands/cliproxy/quota-subcommand.d.ts +14 -36
  324. package/dist/commands/cliproxy/quota-subcommand.d.ts.map +1 -1
  325. package/dist/commands/cliproxy/quota-subcommand.js +21 -872
  326. package/dist/commands/cliproxy/quota-subcommand.js.map +1 -1
  327. package/dist/commands/command-catalog.js +1 -1
  328. package/dist/commands/command-catalog.js.map +1 -1
  329. package/dist/commands/config-channels-command.d.ts +1 -1
  330. package/dist/commands/config-channels-command.d.ts.map +1 -1
  331. package/dist/commands/config-channels-command.js +3 -3
  332. package/dist/commands/config-channels-command.js.map +1 -1
  333. package/dist/commands/config-command-options.d.ts.map +1 -1
  334. package/dist/commands/config-command-options.js +11 -2
  335. package/dist/commands/config-command-options.js.map +1 -1
  336. package/dist/commands/persist-command/arg-parsing.d.ts +14 -0
  337. package/dist/commands/persist-command/arg-parsing.d.ts.map +1 -0
  338. package/dist/commands/persist-command/arg-parsing.js +84 -0
  339. package/dist/commands/persist-command/arg-parsing.js.map +1 -0
  340. package/dist/commands/persist-command/backup-rotation.d.ts +23 -0
  341. package/dist/commands/persist-command/backup-rotation.d.ts.map +1 -0
  342. package/dist/commands/persist-command/backup-rotation.js +265 -0
  343. package/dist/commands/persist-command/backup-rotation.js.map +1 -0
  344. package/dist/commands/persist-command/handler.d.ts +10 -0
  345. package/dist/commands/persist-command/handler.d.ts.map +1 -0
  346. package/dist/commands/persist-command/handler.js +267 -0
  347. package/dist/commands/persist-command/handler.js.map +1 -0
  348. package/dist/commands/persist-command/help.d.ts +9 -0
  349. package/dist/commands/persist-command/help.d.ts.map +1 -0
  350. package/dist/commands/persist-command/help.js +86 -0
  351. package/dist/commands/persist-command/help.js.map +1 -0
  352. package/dist/commands/persist-command/receipt.d.ts +13 -0
  353. package/dist/commands/persist-command/receipt.d.ts.map +1 -0
  354. package/dist/commands/persist-command/receipt.js +102 -0
  355. package/dist/commands/persist-command/receipt.js.map +1 -0
  356. package/dist/commands/persist-command/secret-detection.d.ts +11 -0
  357. package/dist/commands/persist-command/secret-detection.d.ts.map +1 -0
  358. package/dist/commands/persist-command/secret-detection.js +54 -0
  359. package/dist/commands/persist-command/secret-detection.js.map +1 -0
  360. package/dist/commands/persist-command/secure-file.d.ts +21 -0
  361. package/dist/commands/persist-command/secure-file.d.ts.map +1 -0
  362. package/dist/commands/persist-command/secure-file.js +231 -0
  363. package/dist/commands/persist-command/secure-file.js.map +1 -0
  364. package/dist/commands/persist-command/types.d.ts +42 -0
  365. package/dist/commands/persist-command/types.d.ts.map +1 -0
  366. package/dist/commands/persist-command/types.js +34 -0
  367. package/dist/commands/persist-command/types.js.map +1 -0
  368. package/dist/commands/persist-command.d.ts +7 -2
  369. package/dist/commands/persist-command.d.ts.map +1 -1
  370. package/dist/commands/persist-command.js +17 -933
  371. package/dist/commands/persist-command.js.map +1 -1
  372. package/dist/commands/proxy-command.d.ts.map +1 -1
  373. package/dist/commands/proxy-command.js +7 -1
  374. package/dist/commands/proxy-command.js.map +1 -1
  375. package/dist/commands/setup-command.d.ts.map +1 -1
  376. package/dist/commands/setup-command.js +11 -1
  377. package/dist/commands/setup-command.js.map +1 -1
  378. package/dist/commands/tokens-command.d.ts.map +1 -1
  379. package/dist/commands/tokens-command.js +6 -0
  380. package/dist/commands/tokens-command.js.map +1 -1
  381. package/dist/config/config-loader-facade.d.ts +1 -1
  382. package/dist/config/config-loader-facade.d.ts.map +1 -1
  383. package/dist/config/config-loader-facade.js +3 -1
  384. package/dist/config/config-loader-facade.js.map +1 -1
  385. package/dist/config/loader/config-getters.d.ts +16 -0
  386. package/dist/config/loader/config-getters.d.ts.map +1 -1
  387. package/dist/config/loader/config-getters.js +33 -1
  388. package/dist/config/loader/config-getters.js.map +1 -1
  389. package/dist/config/loader/defaults-merger.d.ts.map +1 -1
  390. package/dist/config/loader/defaults-merger.js +4 -0
  391. package/dist/config/loader/defaults-merger.js.map +1 -1
  392. package/dist/config/loader/yaml-serializer.d.ts.map +1 -1
  393. package/dist/config/loader/yaml-serializer.js +13 -0
  394. package/dist/config/loader/yaml-serializer.js.map +1 -1
  395. package/dist/config/schemas/index.d.ts +2 -0
  396. package/dist/config/schemas/index.d.ts.map +1 -1
  397. package/dist/config/schemas/index.js +5 -1
  398. package/dist/config/schemas/index.js.map +1 -1
  399. package/dist/config/schemas/runtime.d.ts +57 -0
  400. package/dist/config/schemas/runtime.d.ts.map +1 -0
  401. package/dist/config/schemas/runtime.js +51 -0
  402. package/dist/config/schemas/runtime.js.map +1 -0
  403. package/dist/config/schemas/unified-config.d.ts +3 -0
  404. package/dist/config/schemas/unified-config.d.ts.map +1 -1
  405. package/dist/config/schemas/unified-config.js.map +1 -1
  406. package/dist/config/unified-config-loader.d.ts +1 -1
  407. package/dist/config/unified-config-loader.d.ts.map +1 -1
  408. package/dist/config/unified-config-loader.js +25 -13
  409. package/dist/config/unified-config-loader.js.map +1 -1
  410. package/dist/copilot/copilot-executor.js +25 -25
  411. package/dist/copilot/copilot-executor.js.map +1 -1
  412. package/dist/cursor/cursor-daemon-entry.d.ts.map +1 -1
  413. package/dist/cursor/cursor-daemon-entry.js +34 -9
  414. package/dist/cursor/cursor-daemon-entry.js.map +1 -1
  415. package/dist/cursor/cursor-daemon.d.ts.map +1 -1
  416. package/dist/cursor/cursor-daemon.js +1 -0
  417. package/dist/cursor/cursor-daemon.js.map +1 -1
  418. package/dist/cursor/cursor-profile-executor.d.ts.map +1 -1
  419. package/dist/cursor/cursor-profile-executor.js +18 -17
  420. package/dist/cursor/cursor-profile-executor.js.map +1 -1
  421. package/dist/delegation/delegation-handler.d.ts.map +1 -1
  422. package/dist/delegation/delegation-handler.js +29 -23
  423. package/dist/delegation/delegation-handler.js.map +1 -1
  424. package/dist/delegation/headless-executor.d.ts +1 -0
  425. package/dist/delegation/headless-executor.d.ts.map +1 -1
  426. package/dist/delegation/headless-executor.js +36 -15
  427. package/dist/delegation/headless-executor.js.map +1 -1
  428. package/dist/delegation/session-manager.d.ts.map +1 -1
  429. package/dist/delegation/session-manager.js +12 -4
  430. package/dist/delegation/session-manager.js.map +1 -1
  431. package/dist/dispatcher/cli-argument-parser.d.ts +1 -1
  432. package/dist/dispatcher/cli-argument-parser.d.ts.map +1 -1
  433. package/dist/dispatcher/cli-argument-parser.js +24 -23
  434. package/dist/dispatcher/cli-argument-parser.js.map +1 -1
  435. package/dist/dispatcher/flows/cliproxy-flow.d.ts.map +1 -1
  436. package/dist/dispatcher/flows/cliproxy-flow.js +12 -15
  437. package/dist/dispatcher/flows/cliproxy-flow.js.map +1 -1
  438. package/dist/dispatcher/flows/copilot-flow.js +1 -1
  439. package/dist/dispatcher/flows/copilot-flow.js.map +1 -1
  440. package/dist/dispatcher/flows/cursor-flow.js +1 -1
  441. package/dist/dispatcher/flows/cursor-flow.js.map +1 -1
  442. package/dist/dispatcher/flows/settings-flow.d.ts.map +1 -1
  443. package/dist/dispatcher/flows/settings-flow.js +32 -29
  444. package/dist/dispatcher/flows/settings-flow.js.map +1 -1
  445. package/dist/dispatcher/pre-dispatch.d.ts.map +1 -1
  446. package/dist/dispatcher/pre-dispatch.js +26 -10
  447. package/dist/dispatcher/pre-dispatch.js.map +1 -1
  448. package/dist/dispatcher/profile-resolver.d.ts +1 -1
  449. package/dist/dispatcher/profile-resolver.d.ts.map +1 -1
  450. package/dist/dispatcher/profile-resolver.js +36 -23
  451. package/dist/dispatcher/profile-resolver.js.map +1 -1
  452. package/dist/docker/supervisord-lifecycle.d.ts.map +1 -1
  453. package/dist/docker/supervisord-lifecycle.js +5 -1
  454. package/dist/docker/supervisord-lifecycle.js.map +1 -1
  455. package/dist/errors/error-types.d.ts +26 -22
  456. package/dist/errors/error-types.d.ts.map +1 -1
  457. package/dist/errors/error-types.js +15 -12
  458. package/dist/errors/error-types.js.map +1 -1
  459. package/dist/errors/exit-codes.d.ts +20 -13
  460. package/dist/errors/exit-codes.d.ts.map +1 -1
  461. package/dist/errors/exit-codes.js +32 -28
  462. package/dist/errors/exit-codes.js.map +1 -1
  463. package/dist/glmt/delta-accumulator.d.ts +1 -0
  464. package/dist/glmt/delta-accumulator.d.ts.map +1 -1
  465. package/dist/glmt/delta-accumulator.js +12 -4
  466. package/dist/glmt/delta-accumulator.js.map +1 -1
  467. package/dist/glmt/glmt-proxy.d.ts.map +1 -1
  468. package/dist/glmt/glmt-proxy.js +39 -10
  469. package/dist/glmt/glmt-proxy.js.map +1 -1
  470. package/dist/glmt/glmt-transformer.d.ts.map +1 -1
  471. package/dist/glmt/glmt-transformer.js +1 -4
  472. package/dist/glmt/glmt-transformer.js.map +1 -1
  473. package/dist/glmt/pipeline/request-transformer.d.ts.map +1 -1
  474. package/dist/glmt/pipeline/request-transformer.js +5 -1
  475. package/dist/glmt/pipeline/request-transformer.js.map +1 -1
  476. package/dist/glmt/pipeline/response-builder.d.ts.map +1 -1
  477. package/dist/glmt/pipeline/response-builder.js +7 -3
  478. package/dist/glmt/pipeline/response-builder.js.map +1 -1
  479. package/dist/glmt/pipeline/stream-parser.d.ts.map +1 -1
  480. package/dist/glmt/pipeline/stream-parser.js +11 -5
  481. package/dist/glmt/pipeline/stream-parser.js.map +1 -1
  482. package/dist/glmt/pipeline/tool-call-handler.d.ts.map +1 -1
  483. package/dist/glmt/pipeline/tool-call-handler.js +7 -1
  484. package/dist/glmt/pipeline/tool-call-handler.js.map +1 -1
  485. package/dist/glmt/sse-parser.d.ts +1 -0
  486. package/dist/glmt/sse-parser.d.ts.map +1 -1
  487. package/dist/glmt/sse-parser.js +7 -3
  488. package/dist/glmt/sse-parser.js.map +1 -1
  489. package/dist/management/checks/cliproxy-check.d.ts.map +1 -1
  490. package/dist/management/checks/cliproxy-check.js +15 -1
  491. package/dist/management/checks/cliproxy-check.js.map +1 -1
  492. package/dist/management/checks/config-check.d.ts.map +1 -1
  493. package/dist/management/checks/config-check.js +4 -1
  494. package/dist/management/checks/config-check.js.map +1 -1
  495. package/dist/management/checks/profile-check.d.ts.map +1 -1
  496. package/dist/management/checks/profile-check.js +10 -6
  497. package/dist/management/checks/profile-check.js.map +1 -1
  498. package/dist/management/doctor.d.ts +7 -0
  499. package/dist/management/doctor.d.ts.map +1 -1
  500. package/dist/management/doctor.js +31 -9
  501. package/dist/management/doctor.js.map +1 -1
  502. package/dist/management/shared-manager/fs-helpers.d.ts +69 -0
  503. package/dist/management/shared-manager/fs-helpers.d.ts.map +1 -0
  504. package/dist/management/shared-manager/fs-helpers.js +241 -0
  505. package/dist/management/shared-manager/fs-helpers.js.map +1 -0
  506. package/dist/management/shared-manager/migrations.d.ts +21 -0
  507. package/dist/management/shared-manager/migrations.d.ts.map +1 -0
  508. package/dist/management/shared-manager/migrations.js +187 -0
  509. package/dist/management/shared-manager/migrations.js.map +1 -0
  510. package/dist/management/shared-manager/orchestrator.d.ts +87 -0
  511. package/dist/management/shared-manager/orchestrator.d.ts.map +1 -0
  512. package/dist/management/shared-manager/orchestrator.js +161 -0
  513. package/dist/management/shared-manager/orchestrator.js.map +1 -0
  514. package/dist/management/shared-manager/plugin-layout-internals.d.ts +42 -0
  515. package/dist/management/shared-manager/plugin-layout-internals.d.ts.map +1 -0
  516. package/dist/management/shared-manager/plugin-layout-internals.js +192 -0
  517. package/dist/management/shared-manager/plugin-layout-internals.js.map +1 -0
  518. package/dist/management/shared-manager/plugin-metadata-normalizer.d.ts +53 -0
  519. package/dist/management/shared-manager/plugin-metadata-normalizer.d.ts.map +1 -0
  520. package/dist/management/shared-manager/plugin-metadata-normalizer.js +253 -0
  521. package/dist/management/shared-manager/plugin-metadata-normalizer.js.map +1 -0
  522. package/dist/management/shared-manager/project-context-sync.d.ts +36 -0
  523. package/dist/management/shared-manager/project-context-sync.d.ts.map +1 -0
  524. package/dist/management/shared-manager/project-context-sync.js +204 -0
  525. package/dist/management/shared-manager/project-context-sync.js.map +1 -0
  526. package/dist/management/shared-manager/project-memory-sync.d.ts +21 -0
  527. package/dist/management/shared-manager/project-memory-sync.d.ts.map +1 -0
  528. package/dist/management/shared-manager/project-memory-sync.js +113 -0
  529. package/dist/management/shared-manager/project-memory-sync.js.map +1 -0
  530. package/dist/management/shared-manager/shared-dir-linker.d.ts +41 -0
  531. package/dist/management/shared-manager/shared-dir-linker.d.ts.map +1 -0
  532. package/dist/management/shared-manager/shared-dir-linker.js +227 -0
  533. package/dist/management/shared-manager/shared-dir-linker.js.map +1 -0
  534. package/dist/management/shared-manager/symlink-helpers.d.ts +61 -0
  535. package/dist/management/shared-manager/symlink-helpers.d.ts.map +1 -0
  536. package/dist/management/shared-manager/symlink-helpers.js +243 -0
  537. package/dist/management/shared-manager/symlink-helpers.js.map +1 -0
  538. package/dist/management/shared-manager/types.d.ts +45 -0
  539. package/dist/management/shared-manager/types.d.ts.map +1 -0
  540. package/dist/management/shared-manager/types.js +57 -0
  541. package/dist/management/shared-manager/types.js.map +1 -0
  542. package/dist/management/shared-manager.d.ts +13 -160
  543. package/dist/management/shared-manager.d.ts.map +1 -1
  544. package/dist/management/shared-manager.js +18 -1294
  545. package/dist/management/shared-manager.js.map +1 -1
  546. package/dist/proxy/proxy-daemon-entry.js +1 -1
  547. package/dist/proxy/proxy-daemon-entry.js.map +1 -1
  548. package/dist/proxy/server/messages-route.d.ts +10 -0
  549. package/dist/proxy/server/messages-route.d.ts.map +1 -1
  550. package/dist/proxy/server/messages-route.js +34 -7
  551. package/dist/proxy/server/messages-route.js.map +1 -1
  552. package/dist/proxy/server/proxy-server.d.ts.map +1 -1
  553. package/dist/proxy/server/proxy-server.js +1 -1
  554. package/dist/proxy/server/proxy-server.js.map +1 -1
  555. package/dist/proxy/transformers/sse-stream-transformer.d.ts.map +1 -1
  556. package/dist/proxy/transformers/sse-stream-transformer.js +12 -17
  557. package/dist/proxy/transformers/sse-stream-transformer.js.map +1 -1
  558. package/dist/services/logging/index.d.ts +1 -1
  559. package/dist/services/logging/index.d.ts.map +1 -1
  560. package/dist/services/logging/index.js +6 -1
  561. package/dist/services/logging/index.js.map +1 -1
  562. package/dist/services/logging/log-context.d.ts +27 -2
  563. package/dist/services/logging/log-context.d.ts.map +1 -1
  564. package/dist/services/logging/log-context.js +43 -4
  565. package/dist/services/logging/log-context.js.map +1 -1
  566. package/dist/services/logging/log-redaction.d.ts +9 -0
  567. package/dist/services/logging/log-redaction.d.ts.map +1 -1
  568. package/dist/services/logging/log-redaction.js +31 -3
  569. package/dist/services/logging/log-redaction.js.map +1 -1
  570. package/dist/services/logging/logger.js +2 -2
  571. package/dist/services/logging/logger.js.map +1 -1
  572. package/dist/shared/provider-preset-catalog.d.ts +1 -1
  573. package/dist/shared/provider-preset-catalog.d.ts.map +1 -1
  574. package/dist/shared/provider-preset-catalog.js +21 -7
  575. package/dist/shared/provider-preset-catalog.js.map +1 -1
  576. package/dist/targets/claude-adapter.d.ts.map +1 -1
  577. package/dist/targets/claude-adapter.js +5 -0
  578. package/dist/targets/claude-adapter.js.map +1 -1
  579. package/dist/targets/codex-adapter.d.ts.map +1 -1
  580. package/dist/targets/codex-adapter.js +11 -10
  581. package/dist/targets/codex-adapter.js.map +1 -1
  582. package/dist/targets/codex-cliproxy-provider-config.d.ts.map +1 -1
  583. package/dist/targets/codex-cliproxy-provider-config.js +51 -14
  584. package/dist/targets/codex-cliproxy-provider-config.js.map +1 -1
  585. package/dist/targets/codex-detector.d.ts.map +1 -1
  586. package/dist/targets/codex-detector.js +14 -0
  587. package/dist/targets/codex-detector.js.map +1 -1
  588. package/dist/targets/droid-adapter.d.ts.map +1 -1
  589. package/dist/targets/droid-adapter.js +12 -12
  590. package/dist/targets/droid-adapter.js.map +1 -1
  591. package/dist/ui/assets/{Trans-RG_sMDEu.js → Trans-GYzYLs2D.js} +1 -1
  592. package/dist/ui/assets/{accounts-yTXURc-q.js → accounts-DC1QuyI9.js} +1 -1
  593. package/dist/ui/assets/{alert-dialog-DjvPgzFs.js → alert-dialog-6SiedqmE.js} +1 -1
  594. package/dist/ui/assets/{api-Ck1dtNEM.js → api-3s21dbNJ.js} +1 -1
  595. package/dist/ui/assets/{auth-section-DBnY_LPz.js → auth-section-XBfNgVN4.js} +1 -1
  596. package/dist/ui/assets/{backups-section-Ci-uL4Of.js → backups-section-BidiiVlq.js} +1 -1
  597. package/dist/ui/assets/{channels-BeS9O5q0.js → channels-pfgPUDGt.js} +1 -1
  598. package/dist/ui/assets/{checkbox-DFeFDZBp.js → checkbox-CJw_-nvC.js} +1 -1
  599. package/dist/ui/assets/{claude-extension-DS5qN19Z.js → claude-extension-BIIUOvTJ.js} +1 -1
  600. package/dist/ui/assets/{cliproxy-D7HJH4mZ.js → cliproxy-Cq8OX0Pu.js} +1 -1
  601. package/dist/ui/assets/{cliproxy-ai-providers-oJQZXrtc.js → cliproxy-ai-providers-DI760ZF0.js} +1 -1
  602. package/dist/ui/assets/{cliproxy-control-panel-2mRPEcRj.js → cliproxy-control-panel-CBqvpOqj.js} +1 -1
  603. package/dist/ui/assets/{codex-D0AUQ6jA.js → codex-DL4OLBUu.js} +1 -1
  604. package/dist/ui/assets/{confirm-dialog-B37-CVuq.js → confirm-dialog-CC_Cc3EO.js} +1 -1
  605. package/dist/ui/assets/{copilot-KaaW-mko.js → copilot-D2kEhTXR.js} +1 -1
  606. package/dist/ui/assets/{cursor-BKiTgYi5.js → cursor-BashLrYk.js} +1 -1
  607. package/dist/ui/assets/{droid-DHdqGnFw.js → droid-DaKTINFL.js} +1 -1
  608. package/dist/ui/assets/{globalenv-section-SfZO97nU.js → globalenv-section-BQicL8L0.js} +1 -1
  609. package/dist/ui/assets/{health-CSRS9O0D.js → health-bRbE_ADg.js} +1 -1
  610. package/dist/ui/assets/{index-CGgavq2X.js → index-B2JEyN3d.js} +36 -36
  611. package/dist/ui/assets/{index-Cu_F55_O.js → index-BwZdl1HU.js} +1 -1
  612. package/dist/ui/assets/{index-DWUuSBUe.js → index-CgeAb1-K.js} +1 -1
  613. package/dist/ui/assets/{index-iQuEEGbH.js → index-DAQ0qIQ_.js} +1 -1
  614. package/dist/ui/assets/{index-ChTYEBCZ.js → index-O2x1grGh.js} +1 -1
  615. package/dist/ui/assets/{index-DycwEe96.js → index-WA7tK6np.js} +1 -1
  616. package/dist/ui/assets/{index-DJ66NrBH.js → index-mf2X1GwS.js} +1 -1
  617. package/dist/ui/assets/{logs-tiZ_51mo.js → logs-qrBHUJ0H.js} +1 -1
  618. package/dist/ui/assets/{masked-input-D9FVoeMA.js → masked-input-CXwQ4E-g.js} +1 -1
  619. package/dist/ui/assets/{proxy-status-widget-2k26d8pS.js → proxy-status-widget-DPz4nCzR.js} +1 -1
  620. package/dist/ui/assets/{raw-json-settings-editor-panel-CguBh93H.js → raw-json-settings-editor-panel-CcvsWVh1.js} +1 -1
  621. package/dist/ui/assets/{searchable-select-C4wShshD.js → searchable-select-EXSjNCRu.js} +1 -1
  622. package/dist/ui/assets/{separator-mvGlDdEW.js → separator-D2CTfWBQ.js} +1 -1
  623. package/dist/ui/assets/{shared-Ck0yAwbs.js → shared-DpgzhFqe.js} +1 -1
  624. package/dist/ui/assets/{table-DrUJOxKL.js → table-DwbiGRYk.js} +1 -1
  625. package/dist/ui/assets/{updates-BVHBFcq8.js → updates-D8jfIb2y.js} +1 -1
  626. package/dist/ui/assets/{use-accounts-DLtuaniS.js → use-accounts-Bwtpnx-x.js} +1 -1
  627. package/dist/ui/index.html +1 -1
  628. package/dist/utils/bar-auth-token.d.ts +4 -0
  629. package/dist/utils/bar-auth-token.d.ts.map +1 -0
  630. package/dist/utils/bar-auth-token.js +60 -0
  631. package/dist/utils/bar-auth-token.js.map +1 -0
  632. package/dist/utils/browser/browser-settings.d.ts +3 -1
  633. package/dist/utils/browser/browser-settings.d.ts.map +1 -1
  634. package/dist/utils/browser/browser-settings.js +2 -2
  635. package/dist/utils/browser/browser-settings.js.map +1 -1
  636. package/dist/utils/browser/browser-setup.d.ts.map +1 -1
  637. package/dist/utils/browser/browser-setup.js +3 -1
  638. package/dist/utils/browser/browser-setup.js.map +1 -1
  639. package/dist/utils/browser/browser-status.d.ts.map +1 -1
  640. package/dist/utils/browser/browser-status.js +4 -2
  641. package/dist/utils/browser/browser-status.js.map +1 -1
  642. package/dist/utils/fetch-proxy-setup.d.ts +3 -2
  643. package/dist/utils/fetch-proxy-setup.d.ts.map +1 -1
  644. package/dist/utils/fetch-proxy-setup.js +10 -6
  645. package/dist/utils/fetch-proxy-setup.js.map +1 -1
  646. package/dist/utils/image-analysis/mcp-installer.d.ts.map +1 -1
  647. package/dist/utils/image-analysis/mcp-installer.js +16 -13
  648. package/dist/utils/image-analysis/mcp-installer.js.map +1 -1
  649. package/dist/utils/websearch/index.d.ts +1 -1
  650. package/dist/utils/websearch/index.d.ts.map +1 -1
  651. package/dist/utils/websearch/index.js +2 -1
  652. package/dist/utils/websearch/index.js.map +1 -1
  653. package/dist/utils/websearch/mcp-installer.d.ts +8 -0
  654. package/dist/utils/websearch/mcp-installer.d.ts.map +1 -1
  655. package/dist/utils/websearch/mcp-installer.js +34 -13
  656. package/dist/utils/websearch/mcp-installer.js.map +1 -1
  657. package/dist/utils/websearch-manager.d.ts +1 -1
  658. package/dist/utils/websearch-manager.d.ts.map +1 -1
  659. package/dist/utils/websearch-manager.js +2 -1
  660. package/dist/utils/websearch-manager.js.map +1 -1
  661. package/dist/web-server/middleware/request-logging-middleware.d.ts.map +1 -1
  662. package/dist/web-server/middleware/request-logging-middleware.js +14 -9
  663. package/dist/web-server/middleware/request-logging-middleware.js.map +1 -1
  664. package/dist/web-server/model-pricing.d.ts.map +1 -1
  665. package/dist/web-server/model-pricing.js +22 -2
  666. package/dist/web-server/model-pricing.js.map +1 -1
  667. package/dist/web-server/routes/bar-routes.d.ts +12 -1
  668. package/dist/web-server/routes/bar-routes.d.ts.map +1 -1
  669. package/dist/web-server/routes/bar-routes.js +22 -6
  670. package/dist/web-server/routes/bar-routes.js.map +1 -1
  671. package/dist/web-server/routes/claude-extension-routes.d.ts.map +1 -1
  672. package/dist/web-server/routes/claude-extension-routes.js +3 -2
  673. package/dist/web-server/routes/claude-extension-routes.js.map +1 -1
  674. package/dist/web-server/routes/cliproxy-auth-routes.d.ts +1 -0
  675. package/dist/web-server/routes/cliproxy-auth-routes.d.ts.map +1 -1
  676. package/dist/web-server/routes/cliproxy-auth-routes.js +20 -5
  677. package/dist/web-server/routes/cliproxy-auth-routes.js.map +1 -1
  678. package/dist/web-server/routes/cliproxy-stats-routes/config-routes.d.ts +16 -0
  679. package/dist/web-server/routes/cliproxy-stats-routes/config-routes.d.ts.map +1 -0
  680. package/dist/web-server/routes/cliproxy-stats-routes/config-routes.js +219 -0
  681. package/dist/web-server/routes/cliproxy-stats-routes/config-routes.js.map +1 -0
  682. package/dist/web-server/routes/cliproxy-stats-routes/error-log-routes.d.ts +12 -0
  683. package/dist/web-server/routes/cliproxy-stats-routes/error-log-routes.d.ts.map +1 -0
  684. package/dist/web-server/routes/cliproxy-stats-routes/error-log-routes.js +153 -0
  685. package/dist/web-server/routes/cliproxy-stats-routes/error-log-routes.js.map +1 -0
  686. package/dist/web-server/routes/cliproxy-stats-routes/quota-helpers.d.ts +19 -0
  687. package/dist/web-server/routes/cliproxy-stats-routes/quota-helpers.d.ts.map +1 -0
  688. package/dist/web-server/routes/cliproxy-stats-routes/quota-helpers.js +38 -0
  689. package/dist/web-server/routes/cliproxy-stats-routes/quota-helpers.js.map +1 -0
  690. package/dist/web-server/routes/cliproxy-stats-routes/quota-routes.d.ts +13 -0
  691. package/dist/web-server/routes/cliproxy-stats-routes/quota-routes.d.ts.map +1 -0
  692. package/dist/web-server/routes/cliproxy-stats-routes/quota-routes.js +195 -0
  693. package/dist/web-server/routes/cliproxy-stats-routes/quota-routes.js.map +1 -0
  694. package/dist/web-server/routes/cliproxy-stats-routes/restart-route.d.ts +17 -0
  695. package/dist/web-server/routes/cliproxy-stats-routes/restart-route.d.ts.map +1 -0
  696. package/dist/web-server/routes/cliproxy-stats-routes/restart-route.js +34 -0
  697. package/dist/web-server/routes/cliproxy-stats-routes/restart-route.js.map +1 -0
  698. package/dist/web-server/routes/cliproxy-stats-routes/router.d.ts +10 -0
  699. package/dist/web-server/routes/cliproxy-stats-routes/router.d.ts.map +1 -0
  700. package/dist/web-server/routes/cliproxy-stats-routes/router.js +245 -0
  701. package/dist/web-server/routes/cliproxy-stats-routes/router.js.map +1 -0
  702. package/dist/web-server/routes/cliproxy-stats-routes/shared.d.ts +35 -0
  703. package/dist/web-server/routes/cliproxy-stats-routes/shared.d.ts.map +1 -0
  704. package/dist/web-server/routes/cliproxy-stats-routes/shared.js +59 -0
  705. package/dist/web-server/routes/cliproxy-stats-routes/shared.js.map +1 -0
  706. package/dist/web-server/routes/cliproxy-stats-routes/version-helpers.d.ts +44 -0
  707. package/dist/web-server/routes/cliproxy-stats-routes/version-helpers.d.ts.map +1 -0
  708. package/dist/web-server/routes/cliproxy-stats-routes/version-helpers.js +66 -0
  709. package/dist/web-server/routes/cliproxy-stats-routes/version-helpers.js.map +1 -0
  710. package/dist/web-server/routes/cliproxy-stats-routes.d.ts +16 -57
  711. package/dist/web-server/routes/cliproxy-stats-routes.d.ts.map +1 -1
  712. package/dist/web-server/routes/cliproxy-stats-routes.js +25 -926
  713. package/dist/web-server/routes/cliproxy-stats-routes.js.map +1 -1
  714. package/dist/web-server/routes/cliproxy-sync-routes.d.ts.map +1 -1
  715. package/dist/web-server/routes/cliproxy-sync-routes.js +9 -2
  716. package/dist/web-server/routes/cliproxy-sync-routes.js.map +1 -1
  717. package/dist/web-server/routes/copilot-settings-routes.d.ts.map +1 -1
  718. package/dist/web-server/routes/copilot-settings-routes.js +2 -1
  719. package/dist/web-server/routes/copilot-settings-routes.js.map +1 -1
  720. package/dist/web-server/routes/cursor-routes.d.ts.map +1 -1
  721. package/dist/web-server/routes/cursor-routes.js +3 -1
  722. package/dist/web-server/routes/cursor-routes.js.map +1 -1
  723. package/dist/web-server/routes/image-analysis-routes.d.ts.map +1 -1
  724. package/dist/web-server/routes/image-analysis-routes.js +2 -1
  725. package/dist/web-server/routes/image-analysis-routes.js.map +1 -1
  726. package/dist/web-server/routes/index.d.ts.map +1 -1
  727. package/dist/web-server/routes/index.js +6 -0
  728. package/dist/web-server/routes/index.js.map +1 -1
  729. package/dist/web-server/routes/persist-routes.d.ts.map +1 -1
  730. package/dist/web-server/routes/persist-routes.js +8 -1
  731. package/dist/web-server/routes/persist-routes.js.map +1 -1
  732. package/dist/web-server/routes/proxy-routes.d.ts.map +1 -1
  733. package/dist/web-server/routes/proxy-routes.js +33 -5
  734. package/dist/web-server/routes/proxy-routes.js.map +1 -1
  735. package/dist/web-server/routes/route-helpers.d.ts.map +1 -1
  736. package/dist/web-server/routes/route-helpers.js +18 -6
  737. package/dist/web-server/routes/route-helpers.js.map +1 -1
  738. package/dist/web-server/routes/settings-routes.d.ts.map +1 -1
  739. package/dist/web-server/routes/settings-routes.js +7 -6
  740. package/dist/web-server/routes/settings-routes.js.map +1 -1
  741. package/dist/web-server/usage/aggregator.d.ts.map +1 -1
  742. package/dist/web-server/usage/aggregator.js +8 -8
  743. package/dist/web-server/usage/aggregator.js.map +1 -1
  744. package/dist/web-server/usage/bar-analytics.d.ts +21 -0
  745. package/dist/web-server/usage/bar-analytics.d.ts.map +1 -1
  746. package/dist/web-server/usage/bar-analytics.js +78 -9
  747. package/dist/web-server/usage/bar-analytics.js.map +1 -1
  748. package/dist/web-server/usage/cliproxy-usage-transformer.d.ts.map +1 -1
  749. package/dist/web-server/usage/cliproxy-usage-transformer.js +9 -4
  750. package/dist/web-server/usage/cliproxy-usage-transformer.js.map +1 -1
  751. package/dist/web-server/usage/codex-local-quota-collector.d.ts +2 -2
  752. package/dist/web-server/usage/codex-local-quota-collector.d.ts.map +1 -1
  753. package/dist/web-server/usage/codex-local-quota-collector.js +39 -11
  754. package/dist/web-server/usage/codex-local-quota-collector.js.map +1 -1
  755. package/dist/web-server/usage/handlers.d.ts.map +1 -1
  756. package/dist/web-server/usage/handlers.js +1 -1
  757. package/dist/web-server/usage/handlers.js.map +1 -1
  758. package/dist/web-server/usage/native-quota-collector.d.ts +37 -9
  759. package/dist/web-server/usage/native-quota-collector.d.ts.map +1 -1
  760. package/dist/web-server/usage/native-quota-collector.js +226 -23
  761. package/dist/web-server/usage/native-quota-collector.js.map +1 -1
  762. package/package.json +1 -1
  763. package/scripts/ci-parity-gate.sh +31 -0
  764. package/scripts/generate-throw-error-baseline.js +103 -0
  765. package/scripts/github/stable-release-issue-cleanup-lib.mjs +51 -11
  766. package/scripts/hardening-inventory.js +62 -4
  767. package/scripts/maintainability-metrics.js +356 -0
@@ -1 +1 @@
1
- import{j as e}from"./radix-ui-nu4wz29m.js";import{r}from"./react-vendor-Bjx91N7w.js";import{a as S,bA as E,x as b,S as n,C as g,bi as R,bk as D,B as T,e as C}from"./index-CGgavq2X.js";import{A as O,a as _,b as F,c as I,d as P,e as z,f as L,g as U}from"./alert-dialog-DjvPgzFs.js";import{x as $,y as H,ag as y,w as M,V as Y,R as J}from"./icons-DSLG1YsC.js";import"./tanstack-bhJxV1h8.js";import"./notifications-B4_o8bcr.js";import"./utils-CzKF5WmX.js";import"./form-utils-CuHzLhJZ.js";import"./charts-eIPy2oG6.js";const V=3e3,q=5e3;function ae(){const{t}=S(),{fetchRawConfig:p}=E(),m=r.useRef(null),d=r.useRef(null),[j,v]=r.useState([]),[f,N]=r.useState(!0),[u,w]=r.useState(null),[i,l]=r.useState(null),[c,k]=r.useState(null),[x,h]=r.useState(null),o=r.useCallback(async()=>{m.current?.abort(),m.current=new AbortController;try{N(!0),l(null);const s=await fetch("/api/persist/backups",{signal:m.current.signal});if(!s.ok)throw new Error(t("settingsBackups.failedFetch"));const a=await s.json();v(a.backups||[])}catch(s){if(s instanceof Error&&s.name==="AbortError")return;l(s instanceof Error?s.message:t("settings.unknownError"))}finally{N(!1)}},[t]),A=r.useCallback(async s=>{d.current?.abort(),d.current=new AbortController;try{w(s),l(null);const a=await fetch("/api/persist/restore",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({timestamp:s}),signal:d.current.signal});if(!a.ok){const B=await a.json();throw new Error(B.error||t("settingsBackups.failedRestore"))}k(t("settingsBackups.restoreSuccess")),await o(),await p()}catch(a){if(a instanceof Error&&a.name==="AbortError")return;l(a instanceof Error?a.message:t("settings.unknownError"))}finally{w(null)}},[o,p,t]);return r.useEffect(()=>{o()},[o]),r.useEffect(()=>()=>{m.current?.abort(),d.current?.abort()},[]),r.useEffect(()=>{if(c){const s=setTimeout(()=>k(null),V);return()=>clearTimeout(s)}},[c]),r.useEffect(()=>{if(i){const s=setTimeout(()=>l(null),q);return()=>clearTimeout(s)}},[i]),f?e.jsxs(e.Fragment,{children:[e.jsx(b,{className:"flex-1",children:e.jsxs("div",{className:"p-5 space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(n,{className:"h-6 w-40"}),e.jsx(n,{className:"h-4 w-full"})]}),[1,2,3].map(s=>e.jsx(g,{className:"p-4",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-2 flex-1",children:[e.jsx(n,{className:"h-4 w-32"}),e.jsx(n,{className:"h-3 w-48"})]}),e.jsx(n,{className:"h-8 w-20"})]})},s))]})}),e.jsx("div",{className:"p-4 border-t bg-background",children:e.jsx(n,{className:"h-9 w-full"})})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:`absolute left-5 right-5 top-20 z-10 transition-all duration-200 ease-out ${i||c?"opacity-100 translate-y-0":"opacity-0 -translate-y-2 pointer-events-none"}`,children:[i&&e.jsxs(R,{variant:"destructive",className:"py-2 shadow-lg",children:[e.jsx($,{className:"h-4 w-4"}),e.jsx(D,{children:i})]}),c&&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(H,{className:"h-4 w-4 shrink-0"}),e.jsx("span",{className:"text-sm font-medium",children:c})]})]}),e.jsx(b,{className:"flex-1",children:e.jsxs("div",{className:"p-5 space-y-4",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(y,{className:"w-5 h-5 text-primary"}),e.jsx("h2",{className:"text-lg font-semibold",children:t("settingsBackups.title")})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:t("settingsBackups.description")})]}),j.length===0?e.jsx(g,{className:"p-8",children:e.jsxs("div",{className:"text-center",children:[e.jsx(y,{className:"w-12 h-12 mx-auto mb-3 opacity-30 text-muted-foreground"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:t("settingsBackups.none")}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:t("settingsBackups.noneHint")})]})}):e.jsx("div",{className:"space-y-2",children:j.map((s,a)=>e.jsx(g,{className:"p-4 hover:bg-muted/50 transition-colors",children:e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{className:"flex items-start gap-3 flex-1 min-w-0",children:[e.jsx(M,{className:"w-4 h-4 text-muted-foreground mt-0.5 shrink-0"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("p",{className:"text-sm font-medium font-mono",children:s.timestamp}),a===0&&e.jsx(T,{variant:"secondary",className:"text-xs",children:t("settingsBackups.latest")})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s.date})]})]}),e.jsxs(C,{variant:"outline",size:"sm",onClick:()=>h(s.timestamp),disabled:u!==null,className:"gap-2 shrink-0",children:[e.jsx(Y,{className:`w-4 h-4 ${u===s.timestamp?"animate-spin":""}`}),u===s.timestamp?t("settingsBackups.restoring"):t("settingsBackups.restore")]})]})},s.timestamp))})]})}),e.jsx("div",{className:"p-4 border-t bg-background",children:e.jsxs(C,{variant:"outline",size:"sm",onClick:()=>{o(),p()},disabled:f||u!==null,className:"w-full",children:[e.jsx(J,{className:`w-4 h-4 mr-2 ${f?"animate-spin":""}`}),t("settings.refresh")]})}),e.jsx(O,{open:!!x,onOpenChange:()=>h(null),children:e.jsxs(_,{children:[e.jsxs(F,{children:[e.jsx(I,{children:t("settingsBackups.restoreConfirmTitle")}),e.jsxs(P,{children:[t("settingsBackups.restoreConfirmPrefix")," ",e.jsx("code",{className:"font-mono bg-muted px-1.5 py-0.5 rounded text-foreground",children:x}),". ",t("settingsBackups.restoreConfirmSuffix")]})]}),e.jsxs(z,{children:[e.jsx(L,{children:t("settingsBackups.cancel")}),e.jsx(U,{onClick:()=>{x&&A(x),h(null)},children:t("settingsBackups.restore")})]})]})})]})}export{ae as default};
1
+ import{j as e}from"./radix-ui-nu4wz29m.js";import{r}from"./react-vendor-Bjx91N7w.js";import{a as S,bA as E,x as b,S as n,C as g,bi as R,bk as D,B as T,e as C}from"./index-B2JEyN3d.js";import{A as O,a as _,b as F,c as I,d as P,e as z,f as L,g as U}from"./alert-dialog-6SiedqmE.js";import{x as $,y as H,ag as y,w as M,V as Y,R as J}from"./icons-DSLG1YsC.js";import"./tanstack-bhJxV1h8.js";import"./notifications-B4_o8bcr.js";import"./utils-CzKF5WmX.js";import"./form-utils-CuHzLhJZ.js";import"./charts-eIPy2oG6.js";const V=3e3,q=5e3;function ae(){const{t}=S(),{fetchRawConfig:p}=E(),m=r.useRef(null),d=r.useRef(null),[j,v]=r.useState([]),[f,N]=r.useState(!0),[u,w]=r.useState(null),[i,l]=r.useState(null),[c,k]=r.useState(null),[x,h]=r.useState(null),o=r.useCallback(async()=>{m.current?.abort(),m.current=new AbortController;try{N(!0),l(null);const s=await fetch("/api/persist/backups",{signal:m.current.signal});if(!s.ok)throw new Error(t("settingsBackups.failedFetch"));const a=await s.json();v(a.backups||[])}catch(s){if(s instanceof Error&&s.name==="AbortError")return;l(s instanceof Error?s.message:t("settings.unknownError"))}finally{N(!1)}},[t]),A=r.useCallback(async s=>{d.current?.abort(),d.current=new AbortController;try{w(s),l(null);const a=await fetch("/api/persist/restore",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({timestamp:s}),signal:d.current.signal});if(!a.ok){const B=await a.json();throw new Error(B.error||t("settingsBackups.failedRestore"))}k(t("settingsBackups.restoreSuccess")),await o(),await p()}catch(a){if(a instanceof Error&&a.name==="AbortError")return;l(a instanceof Error?a.message:t("settings.unknownError"))}finally{w(null)}},[o,p,t]);return r.useEffect(()=>{o()},[o]),r.useEffect(()=>()=>{m.current?.abort(),d.current?.abort()},[]),r.useEffect(()=>{if(c){const s=setTimeout(()=>k(null),V);return()=>clearTimeout(s)}},[c]),r.useEffect(()=>{if(i){const s=setTimeout(()=>l(null),q);return()=>clearTimeout(s)}},[i]),f?e.jsxs(e.Fragment,{children:[e.jsx(b,{className:"flex-1",children:e.jsxs("div",{className:"p-5 space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(n,{className:"h-6 w-40"}),e.jsx(n,{className:"h-4 w-full"})]}),[1,2,3].map(s=>e.jsx(g,{className:"p-4",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-2 flex-1",children:[e.jsx(n,{className:"h-4 w-32"}),e.jsx(n,{className:"h-3 w-48"})]}),e.jsx(n,{className:"h-8 w-20"})]})},s))]})}),e.jsx("div",{className:"p-4 border-t bg-background",children:e.jsx(n,{className:"h-9 w-full"})})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:`absolute left-5 right-5 top-20 z-10 transition-all duration-200 ease-out ${i||c?"opacity-100 translate-y-0":"opacity-0 -translate-y-2 pointer-events-none"}`,children:[i&&e.jsxs(R,{variant:"destructive",className:"py-2 shadow-lg",children:[e.jsx($,{className:"h-4 w-4"}),e.jsx(D,{children:i})]}),c&&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(H,{className:"h-4 w-4 shrink-0"}),e.jsx("span",{className:"text-sm font-medium",children:c})]})]}),e.jsx(b,{className:"flex-1",children:e.jsxs("div",{className:"p-5 space-y-4",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(y,{className:"w-5 h-5 text-primary"}),e.jsx("h2",{className:"text-lg font-semibold",children:t("settingsBackups.title")})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:t("settingsBackups.description")})]}),j.length===0?e.jsx(g,{className:"p-8",children:e.jsxs("div",{className:"text-center",children:[e.jsx(y,{className:"w-12 h-12 mx-auto mb-3 opacity-30 text-muted-foreground"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:t("settingsBackups.none")}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:t("settingsBackups.noneHint")})]})}):e.jsx("div",{className:"space-y-2",children:j.map((s,a)=>e.jsx(g,{className:"p-4 hover:bg-muted/50 transition-colors",children:e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{className:"flex items-start gap-3 flex-1 min-w-0",children:[e.jsx(M,{className:"w-4 h-4 text-muted-foreground mt-0.5 shrink-0"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("p",{className:"text-sm font-medium font-mono",children:s.timestamp}),a===0&&e.jsx(T,{variant:"secondary",className:"text-xs",children:t("settingsBackups.latest")})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s.date})]})]}),e.jsxs(C,{variant:"outline",size:"sm",onClick:()=>h(s.timestamp),disabled:u!==null,className:"gap-2 shrink-0",children:[e.jsx(Y,{className:`w-4 h-4 ${u===s.timestamp?"animate-spin":""}`}),u===s.timestamp?t("settingsBackups.restoring"):t("settingsBackups.restore")]})]})},s.timestamp))})]})}),e.jsx("div",{className:"p-4 border-t bg-background",children:e.jsxs(C,{variant:"outline",size:"sm",onClick:()=>{o(),p()},disabled:f||u!==null,className:"w-full",children:[e.jsx(J,{className:`w-4 h-4 mr-2 ${f?"animate-spin":""}`}),t("settings.refresh")]})}),e.jsx(O,{open:!!x,onOpenChange:()=>h(null),children:e.jsxs(_,{children:[e.jsxs(F,{children:[e.jsx(I,{children:t("settingsBackups.restoreConfirmTitle")}),e.jsxs(P,{children:[t("settingsBackups.restoreConfirmPrefix")," ",e.jsx("code",{className:"font-mono bg-muted px-1.5 py-0.5 rounded text-foreground",children:x}),". ",t("settingsBackups.restoreConfirmSuffix")]})]}),e.jsxs(z,{children:[e.jsx(L,{children:t("settingsBackups.cancel")}),e.jsx(U,{onClick:()=>{x&&A(x),h(null)},children:t("settingsBackups.restore")})]})]})})]})}export{ae as default};
@@ -1 +1 @@
1
- import{j as e}from"./radix-ui-nu4wz29m.js";import{r as d}from"./react-vendor-Bjx91N7w.js";import{a as R,bA as F,bi as b,bk as k,x as L,B as E,L as A,aJ as D,I as B,e as K}from"./index-CGgavq2X.js";import{R as M,x as N,y as O,ad as _,av as q,au as J,aI as Y}from"./icons-DSLG1YsC.js";import"./tanstack-bhJxV1h8.js";import"./notifications-B4_o8bcr.js";import"./utils-CzKF5WmX.js";import"./form-utils-CuHzLhJZ.js";import"./charts-eIPy2oG6.js";const U={selected:[],unattended:!1};async function S(t,l){try{const a=await t.json();return typeof a.error=="string"&&a.error.trim().length>0?a.error:l}catch{return l}}function z(){const[t,l]=d.useState(U),[a,j]=d.useState(null),[h,v]=d.useState(!0),[y,c]=d.useState(!1),[w,u]=d.useState(null),[C,m]=d.useState(null),f=d.useCallback(n=>{m(n),window.setTimeout(()=>m(null),1500)},[]),x=d.useCallback(async()=>{try{v(!0),u(null);const n=await fetch("/api/channels");if(!n.ok)throw new Error(await S(n,"Failed to load Official Channels settings"));const i=await n.json();return l(i.config??U),j(i.status??null),!0}catch(n){return u(n instanceof Error?n.message:"Unknown error"),!1}finally{v(!1)}},[]),P=d.useCallback(async(n,i="Settings saved")=>{try{c(!0),u(null);const r=await fetch("/api/channels",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!r.ok)throw new Error(await S(r,"Failed to save Official Channels settings"));const s=await r.json();return l(o=>s.config??{...o,...n}),f(i),!0}catch(r){return u(r instanceof Error?r.message:"Unknown error"),!1}finally{c(!1)}},[f]),V=d.useCallback(async(n,i)=>{try{c(!0),u(null);const r=await fetch(`/api/channels/${n}/token`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:i})});if(!r.ok)throw new Error(await S(r,`Failed to save ${n} token`));return await x()?(f(`${n} token saved`),!0):!1}catch(r){return u(r instanceof Error?r.message:"Unknown error"),!1}finally{c(!1)}},[x,f]),T=d.useCallback(async n=>{try{c(!0),u(null);const i=await fetch(`/api/channels/${n}/token`,{method:"DELETE"});if(!i.ok)throw new Error(await S(i,`Failed to clear ${n} token`));return await x()?(f(`${n} token cleared`),!0):!1}catch(i){return u(i instanceof Error?i.message:"Unknown error"),!1}finally{c(!1)}},[x,f]);return{config:t,status:a,loading:h,saving:y,error:w,success:C,fetchConfig:x,updateConfig:P,saveToken:V,clearToken:T}}const G={telegram:"",discord:"",imessage:""};function H(t){return t==="ready"?"border-green-200 bg-green-50 text-green-900 dark:border-green-900/60 dark:bg-green-950/40 dark:text-green-100":t==="limited"?"border-amber-200 bg-amber-50 text-amber-900 dark:border-amber-900/60 dark:bg-amber-950/40 dark:text-amber-100":"border-blue-200 bg-blue-50 text-blue-900 dark:border-blue-900/60 dark:bg-blue-950/40 dark:text-blue-100"}function Q(t){return t==="ready"?"default":t==="not_selected"?"secondary":t==="unavailable"?"destructive":"outline"}function W(t){return t==="ready"?"default":t==="partial"?"outline":t==="blocked"?"destructive":"secondary"}function X(t,l){return t.length===0?"None selected":t.map(a=>l?.find(j=>j.id===a)?.displayName??a).join(", ")}function le(){const{t}=R(),{config:l,status:a,loading:j,saving:h,error:v,success:y,fetchConfig:c,updateConfig:w,saveToken:u,clearToken:C}=z(),{fetchRawConfig:m}=F(),[f,x]=d.useState(G),P=X(l.selected,a?.channels);d.useEffect(()=>{c(),m()},[c,m]);const V=async()=>{await Promise.all([c(),m()])},T=async(s,o)=>{const g=o?[...new Set([...l.selected,s])]:l.selected.filter($=>$!==s);await w({selected:g},o?`${s} selected for auto-enable`:`${s} removed from auto-enable`)&&await Promise.all([c(),m()])},n=(s,o)=>{x(g=>({...g,[s]:o}))},i=async s=>{await u(s,f[s])&&(x(g=>({...g,[s]:""})),await m())},r=async s=>{await C(s)&&(x(g=>({...g,[s]:""})),await m())};return j?e.jsx("div",{className:"flex flex-1 items-center justify-center",children:e.jsxs("div",{className:"flex items-center gap-3 text-muted-foreground",children:[e.jsx(M,{className:"h-5 w-5 animate-spin"}),e.jsx("span",{children:t("settings.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 ${v||y?"translate-y-0 opacity-100":"pointer-events-none -translate-y-2 opacity-0"}`,children:[v&&e.jsxs(b,{variant:"destructive",className:"py-2 shadow-lg",children:[e.jsx(N,{className:"h-4 w-4"}),e.jsx(k,{children:v})]}),y&&e.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-green-200 bg-green-50 px-3 py-2 text-green-700 shadow-lg dark:border-green-900/50 dark:bg-green-900/90 dark:text-green-300",children:[e.jsx(O,{className:"h-4 w-4 shrink-0"}),e.jsx("span",{className:"text-sm font-medium",children:y})]})]}),e.jsx(L,{className:"flex-1",children:e.jsxs("div",{className:"space-y-6 p-5",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(_,{className:"h-5 w-5 text-primary"}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"font-medium",children:t("settingsPage.channelsSection.title")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:t("settingsPage.channelsSection.configureDescription",{defaultValue:"Configure official Claude channels here, then run `ccs` normally on a supported native Claude session."})}),e.jsx("p",{className:"text-sm text-muted-foreground",children:t("settingsPage.channelsSection.storageDescription",{defaultValue:"CCS stores only channel selection in `config.yaml`. Claude keeps the machine-level channel state under `~/.claude/channels/`."})})]})]}),a&&e.jsxs("div",{className:`rounded-xl border p-4 ${H(a.summary.state)}`,children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(E,{variant:a.summary.state==="ready"?"default":"outline",children:a.summary.title}),e.jsx("span",{className:"text-sm font-medium",children:P})]}),e.jsx("p",{className:"text-sm",children:a.summary.message}),e.jsx("p",{className:"text-sm opacity-90",children:a.summary.nextStep})]}),e.jsxs("div",{className:"min-w-[220px] rounded-lg border border-current/10 bg-background/60 p-3 text-sm text-foreground",children:[e.jsx("p",{className:"font-medium",children:t("settingsPage.channelsSection.machineChecks",{defaultValue:"Machine checks"})}),e.jsxs("div",{className:"mt-2 space-y-1 text-muted-foreground",children:[e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsx("span",{children:"Bun"}),e.jsx("span",{children:a.bunInstalled?t("settingsPage.channelsSection.installed",{defaultValue:"Installed"}):t("settingsPage.channelsSection.missing",{defaultValue:"Missing"})})]}),e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsx("span",{children:"Claude Code"}),e.jsx("span",{children:a.claudeVersion.current?`v${a.claudeVersion.current}`:"Unknown"})]}),e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsx("span",{children:"Claude auth"}),e.jsx("span",{children:a.auth.authMethod||t("settingsPage.channelsSection.unknown",{defaultValue:"Unknown"})})]})]})]})]}),a.summary.blockers.length>0&&e.jsx("div",{className:"mt-3 space-y-1 text-sm",children:a.summary.blockers.map(s=>e.jsx("p",{children:s},s))})]}),a&&e.jsxs("div",{className:"rounded-lg border bg-muted/20 p-4",children:[e.jsx("p",{className:"font-medium",children:t("settingsPage.channelsSection.fastestPath",{defaultValue:"Fastest path"})}),e.jsxs("div",{className:"mt-3 space-y-2 text-sm text-muted-foreground",children:[e.jsx("p",{children:t("settingsPage.channelsSection.fastestStep1",{defaultValue:"1. Turn on the channels you want below."})}),e.jsx("p",{children:t("settingsPage.channelsSection.fastestStep2",{defaultValue:"2. Save Telegram or Discord bot tokens here if that channel needs one."})}),e.jsx("p",{children:t("settingsPage.channelsSection.fastestStep3",{defaultValue:"3. Run `ccs` or a native Claude account profile. CCS adds `--channels` for you on supported runs."})}),e.jsx("p",{children:a.supportMessage})]}),e.jsxs("details",{className:"mt-3 rounded-lg border bg-background p-4",children:[e.jsx("summary",{className:"cursor-pointer text-sm font-medium",children:t("settingsPage.channelsSection.advancedNotes",{defaultValue:"Advanced notes and scope"})}),e.jsxs("div",{className:"mt-3 space-y-2 text-sm text-muted-foreground",children:[e.jsx("p",{children:a.accountStatusCaveat}),e.jsx("p",{children:a.stateScopeMessage})]})]})]}),a&&e.jsxs("div",{className:"rounded-lg border bg-background p-4",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"font-medium",children:t("settingsPage.channelsSection.ifYouRunNow",{defaultValue:"If you run `ccs` now"})}),e.jsx("p",{className:"text-sm text-muted-foreground",children:a.launchPreview.detail})]}),e.jsx(E,{variant:W(a.launchPreview.state),children:a.launchPreview.title})]}),e.jsxs("div",{className:"mt-3 space-y-2",children:[e.jsxs("div",{className:"rounded-md bg-muted px-3 py-2 font-mono text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:t("settingsPage.thinkingSection.youType")})," ",a.launchPreview.command]}),e.jsxs("div",{className:"rounded-md bg-muted px-3 py-2 font-mono text-sm break-all",children:[e.jsx("span",{className:"text-muted-foreground",children:t("settingsPage.thinkingSection.ccsAdds")})," ",a.launchPreview.appendedArgs.length>0?a.launchPreview.appendedArgs.join(" "):t("settingsPage.channelsSection.nothingYet",{defaultValue:"(nothing yet)"})]})]}),a.launchPreview.skippedMessages.length>0&&e.jsx("div",{className:"mt-3 space-y-1 text-sm text-muted-foreground",children:a.launchPreview.skippedMessages.map(s=>e.jsx("p",{children:s},s))})]}),a?.claudeVersion.message&&a.claudeVersion.state!=="supported"&&e.jsxs(b,{children:[e.jsx(N,{className:"h-4 w-4"}),e.jsx(k,{children:a.claudeVersion.message})]}),a?.auth.message&&a.auth.state!=="eligible"&&e.jsxs(b,{children:[e.jsx(N,{className:"h-4 w-4"}),e.jsx(k,{children:a.auth.message})]}),a?.auth.orgRequirementMessage&&e.jsxs(b,{children:[e.jsx(N,{className:"h-4 w-4"}),e.jsx(k,{children:a.auth.orgRequirementMessage})]}),e.jsx("div",{className:"space-y-4",children:a?.channels.map(s=>{const o=l.selected.includes(s.id),g=f[s.id];return e.jsxs("div",{className:"rounded-lg border p-4 space-y-4",children:[e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx(A,{className:"text-base font-medium",children:s.displayName}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:s.summary}),e.jsx("p",{className:"mt-2 font-mono text-xs text-muted-foreground",children:s.pluginSpec})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(E,{variant:Q(s.setup.state),children:s.setup.label}),e.jsx(D,{checked:o,disabled:h||!!s.unavailableReason&&!o,onCheckedChange:p=>void T(s.id,p)})]})]}),e.jsxs("div",{className:"rounded-lg bg-muted/30 p-4 text-sm text-muted-foreground space-y-2",children:[e.jsx("p",{children:s.setup.detail}),e.jsx("p",{children:s.setup.nextStep})]}),s.requiresToken&&e.jsxs("div",{className:"space-y-3 rounded-lg bg-muted/30 p-4",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:!s.tokenConfigured&&s.tokenSource==="process_env"?t("settingsPage.channelsSection.tokenFromProcessEnv",{envKey:s.envKey,defaultValue:"The current CCS process already has {{envKey}}. Save it here only if you want persistent Claude channel state."}):s.tokenConfigured&&s.processEnvAvailable?t("settingsPage.channelsSection.tokenSavedAndProcessEnv",{envKey:s.envKey,defaultValue:"{{envKey}} is saved in Claude channel state, and the current CCS process env also provides it."}):t("settingsPage.channelsSection.tokenSaveHint",{envKey:s.envKey,defaultValue:"Save {{envKey}} in Claude's official channel env file. The dashboard never reads the token value back after save."})}),s.tokenConfigured&&e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Saving here writes the same ",e.jsx("code",{children:".env"})," file as"," ",e.jsxs("code",{children:["/",s.id,":configure"]}),", so you do not need to run the configure command again after a successful save."]}),e.jsx(B,{type:"password",value:g,onChange:p=>n(s.id,p.target.value),placeholder:s.tokenConfigured?t("settingsPage.channelsSection.tokenConfiguredPlaceholder",{envKey:s.envKey,defaultValue:"Configured. Enter a new {{envKey}} to replace it."}):!s.tokenConfigured&&s.tokenSource==="process_env"?t("settingsPage.channelsSection.tokenProcessEnvPlaceholder",{envKey:s.envKey,defaultValue:"Using current CCS process env. Enter a new {{envKey}} to save it for Claude."}):t("settingsPage.channelsSection.tokenPastePlaceholder",{envKey:s.envKey,defaultValue:"Paste {{envKey}}"}),disabled:h}),s.tokenPath&&s.tokenSource!=="process_env"&&e.jsx("div",{className:"text-xs text-muted-foreground break-all",children:s.tokenPath}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs(K,{onClick:()=>void i(s.id),disabled:h||!g.trim(),children:[e.jsx(q,{className:"mr-2 h-4 w-4"}),t("settingsPage.channelsSection.saveToken",{defaultValue:"Save Token"})]}),e.jsxs(K,{variant:"outline",onClick:()=>void r(s.id),disabled:h||!s.tokenConfigured,children:[e.jsx(J,{className:"mr-2 h-4 w-4"}),t("settingsPage.channelsSection.clearSavedToken",{defaultValue:"Clear Saved Token"})]})]})]}),e.jsxs("details",{className:"rounded-lg border bg-background p-4",children:[e.jsx("summary",{className:"cursor-pointer text-sm font-medium",children:t("settingsPage.channelsSection.claudeSideSetupCommands",{defaultValue:"Claude-side setup commands"})}),e.jsx("div",{className:"mt-3 space-y-2",children:(s.manualSetupCommands??[]).map(p=>e.jsx("div",{className:"rounded-md bg-muted px-3 py-2 font-mono text-sm break-all",children:p},p))})]})]},s.id)})}),e.jsx(b,{children:e.jsx(k,{children:t("settingsPage.channelsSection.injectionDisclaimer",{defaultValue:"CCS injects `--channels` only for the current Claude session. Telegram, Discord, and iMessage stop receiving messages when that Claude session exits."})})}),e.jsx("div",{className:"rounded-lg border p-4",children:e.jsxs("div",{className:"flex items-start justify-between gap-4 rounded-lg bg-muted/30 p-4",children:[e.jsxs("div",{className:"flex gap-3",children:[e.jsx(Y,{className:"mt-0.5 h-4 w-4 shrink-0 text-amber-600"}),e.jsxs("div",{children:[e.jsx(A,{className:"text-sm font-medium",children:t("profileEditorSections.skipPermissionPrompts")}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:t("settingsPage.channelsSection.skipPermissionDescription",{defaultValue:"Optional advanced behavior. CCS adds `--dangerously-skip-permissions` only when at least one selected channel is being auto-enabled and you did not already pass a permission flag yourself."})})]})]}),e.jsx(D,{checked:l.unattended,disabled:h,onCheckedChange:s=>void(async()=>{await w({unattended:s},s?"Unattended mode enabled":"Unattended mode disabled")&&await m()})()})]})}),e.jsx("div",{className:"flex justify-end",children:e.jsxs(K,{variant:"outline",onClick:()=>void V(),disabled:h,children:[e.jsx(M,{className:`mr-2 h-4 w-4 ${h?"animate-spin":""}`}),t("settings.refresh")]})})]})})]})}export{le as default};
1
+ import{j as e}from"./radix-ui-nu4wz29m.js";import{r as d}from"./react-vendor-Bjx91N7w.js";import{a as R,bA as F,bi as b,bk as k,x as L,B as E,L as A,aJ as D,I as B,e as K}from"./index-B2JEyN3d.js";import{R as M,x as N,y as O,ad as _,av as q,au as J,aI as Y}from"./icons-DSLG1YsC.js";import"./tanstack-bhJxV1h8.js";import"./notifications-B4_o8bcr.js";import"./utils-CzKF5WmX.js";import"./form-utils-CuHzLhJZ.js";import"./charts-eIPy2oG6.js";const U={selected:[],unattended:!1};async function S(t,l){try{const a=await t.json();return typeof a.error=="string"&&a.error.trim().length>0?a.error:l}catch{return l}}function z(){const[t,l]=d.useState(U),[a,j]=d.useState(null),[h,v]=d.useState(!0),[y,c]=d.useState(!1),[w,u]=d.useState(null),[C,m]=d.useState(null),f=d.useCallback(n=>{m(n),window.setTimeout(()=>m(null),1500)},[]),x=d.useCallback(async()=>{try{v(!0),u(null);const n=await fetch("/api/channels");if(!n.ok)throw new Error(await S(n,"Failed to load Official Channels settings"));const i=await n.json();return l(i.config??U),j(i.status??null),!0}catch(n){return u(n instanceof Error?n.message:"Unknown error"),!1}finally{v(!1)}},[]),P=d.useCallback(async(n,i="Settings saved")=>{try{c(!0),u(null);const r=await fetch("/api/channels",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!r.ok)throw new Error(await S(r,"Failed to save Official Channels settings"));const s=await r.json();return l(o=>s.config??{...o,...n}),f(i),!0}catch(r){return u(r instanceof Error?r.message:"Unknown error"),!1}finally{c(!1)}},[f]),V=d.useCallback(async(n,i)=>{try{c(!0),u(null);const r=await fetch(`/api/channels/${n}/token`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:i})});if(!r.ok)throw new Error(await S(r,`Failed to save ${n} token`));return await x()?(f(`${n} token saved`),!0):!1}catch(r){return u(r instanceof Error?r.message:"Unknown error"),!1}finally{c(!1)}},[x,f]),T=d.useCallback(async n=>{try{c(!0),u(null);const i=await fetch(`/api/channels/${n}/token`,{method:"DELETE"});if(!i.ok)throw new Error(await S(i,`Failed to clear ${n} token`));return await x()?(f(`${n} token cleared`),!0):!1}catch(i){return u(i instanceof Error?i.message:"Unknown error"),!1}finally{c(!1)}},[x,f]);return{config:t,status:a,loading:h,saving:y,error:w,success:C,fetchConfig:x,updateConfig:P,saveToken:V,clearToken:T}}const G={telegram:"",discord:"",imessage:""};function H(t){return t==="ready"?"border-green-200 bg-green-50 text-green-900 dark:border-green-900/60 dark:bg-green-950/40 dark:text-green-100":t==="limited"?"border-amber-200 bg-amber-50 text-amber-900 dark:border-amber-900/60 dark:bg-amber-950/40 dark:text-amber-100":"border-blue-200 bg-blue-50 text-blue-900 dark:border-blue-900/60 dark:bg-blue-950/40 dark:text-blue-100"}function Q(t){return t==="ready"?"default":t==="not_selected"?"secondary":t==="unavailable"?"destructive":"outline"}function W(t){return t==="ready"?"default":t==="partial"?"outline":t==="blocked"?"destructive":"secondary"}function X(t,l){return t.length===0?"None selected":t.map(a=>l?.find(j=>j.id===a)?.displayName??a).join(", ")}function le(){const{t}=R(),{config:l,status:a,loading:j,saving:h,error:v,success:y,fetchConfig:c,updateConfig:w,saveToken:u,clearToken:C}=z(),{fetchRawConfig:m}=F(),[f,x]=d.useState(G),P=X(l.selected,a?.channels);d.useEffect(()=>{c(),m()},[c,m]);const V=async()=>{await Promise.all([c(),m()])},T=async(s,o)=>{const g=o?[...new Set([...l.selected,s])]:l.selected.filter($=>$!==s);await w({selected:g},o?`${s} selected for auto-enable`:`${s} removed from auto-enable`)&&await Promise.all([c(),m()])},n=(s,o)=>{x(g=>({...g,[s]:o}))},i=async s=>{await u(s,f[s])&&(x(g=>({...g,[s]:""})),await m())},r=async s=>{await C(s)&&(x(g=>({...g,[s]:""})),await m())};return j?e.jsx("div",{className:"flex flex-1 items-center justify-center",children:e.jsxs("div",{className:"flex items-center gap-3 text-muted-foreground",children:[e.jsx(M,{className:"h-5 w-5 animate-spin"}),e.jsx("span",{children:t("settings.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 ${v||y?"translate-y-0 opacity-100":"pointer-events-none -translate-y-2 opacity-0"}`,children:[v&&e.jsxs(b,{variant:"destructive",className:"py-2 shadow-lg",children:[e.jsx(N,{className:"h-4 w-4"}),e.jsx(k,{children:v})]}),y&&e.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-green-200 bg-green-50 px-3 py-2 text-green-700 shadow-lg dark:border-green-900/50 dark:bg-green-900/90 dark:text-green-300",children:[e.jsx(O,{className:"h-4 w-4 shrink-0"}),e.jsx("span",{className:"text-sm font-medium",children:y})]})]}),e.jsx(L,{className:"flex-1",children:e.jsxs("div",{className:"space-y-6 p-5",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(_,{className:"h-5 w-5 text-primary"}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"font-medium",children:t("settingsPage.channelsSection.title")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:t("settingsPage.channelsSection.configureDescription",{defaultValue:"Configure official Claude channels here, then run `ccs` normally on a supported native Claude session."})}),e.jsx("p",{className:"text-sm text-muted-foreground",children:t("settingsPage.channelsSection.storageDescription",{defaultValue:"CCS stores only channel selection in `config.yaml`. Claude keeps the machine-level channel state under `~/.claude/channels/`."})})]})]}),a&&e.jsxs("div",{className:`rounded-xl border p-4 ${H(a.summary.state)}`,children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(E,{variant:a.summary.state==="ready"?"default":"outline",children:a.summary.title}),e.jsx("span",{className:"text-sm font-medium",children:P})]}),e.jsx("p",{className:"text-sm",children:a.summary.message}),e.jsx("p",{className:"text-sm opacity-90",children:a.summary.nextStep})]}),e.jsxs("div",{className:"min-w-[220px] rounded-lg border border-current/10 bg-background/60 p-3 text-sm text-foreground",children:[e.jsx("p",{className:"font-medium",children:t("settingsPage.channelsSection.machineChecks",{defaultValue:"Machine checks"})}),e.jsxs("div",{className:"mt-2 space-y-1 text-muted-foreground",children:[e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsx("span",{children:"Bun"}),e.jsx("span",{children:a.bunInstalled?t("settingsPage.channelsSection.installed",{defaultValue:"Installed"}):t("settingsPage.channelsSection.missing",{defaultValue:"Missing"})})]}),e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsx("span",{children:"Claude Code"}),e.jsx("span",{children:a.claudeVersion.current?`v${a.claudeVersion.current}`:"Unknown"})]}),e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsx("span",{children:"Claude auth"}),e.jsx("span",{children:a.auth.authMethod||t("settingsPage.channelsSection.unknown",{defaultValue:"Unknown"})})]})]})]})]}),a.summary.blockers.length>0&&e.jsx("div",{className:"mt-3 space-y-1 text-sm",children:a.summary.blockers.map(s=>e.jsx("p",{children:s},s))})]}),a&&e.jsxs("div",{className:"rounded-lg border bg-muted/20 p-4",children:[e.jsx("p",{className:"font-medium",children:t("settingsPage.channelsSection.fastestPath",{defaultValue:"Fastest path"})}),e.jsxs("div",{className:"mt-3 space-y-2 text-sm text-muted-foreground",children:[e.jsx("p",{children:t("settingsPage.channelsSection.fastestStep1",{defaultValue:"1. Turn on the channels you want below."})}),e.jsx("p",{children:t("settingsPage.channelsSection.fastestStep2",{defaultValue:"2. Save Telegram or Discord bot tokens here if that channel needs one."})}),e.jsx("p",{children:t("settingsPage.channelsSection.fastestStep3",{defaultValue:"3. Run `ccs` or a native Claude account profile. CCS adds `--channels` for you on supported runs."})}),e.jsx("p",{children:a.supportMessage})]}),e.jsxs("details",{className:"mt-3 rounded-lg border bg-background p-4",children:[e.jsx("summary",{className:"cursor-pointer text-sm font-medium",children:t("settingsPage.channelsSection.advancedNotes",{defaultValue:"Advanced notes and scope"})}),e.jsxs("div",{className:"mt-3 space-y-2 text-sm text-muted-foreground",children:[e.jsx("p",{children:a.accountStatusCaveat}),e.jsx("p",{children:a.stateScopeMessage})]})]})]}),a&&e.jsxs("div",{className:"rounded-lg border bg-background p-4",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"font-medium",children:t("settingsPage.channelsSection.ifYouRunNow",{defaultValue:"If you run `ccs` now"})}),e.jsx("p",{className:"text-sm text-muted-foreground",children:a.launchPreview.detail})]}),e.jsx(E,{variant:W(a.launchPreview.state),children:a.launchPreview.title})]}),e.jsxs("div",{className:"mt-3 space-y-2",children:[e.jsxs("div",{className:"rounded-md bg-muted px-3 py-2 font-mono text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:t("settingsPage.thinkingSection.youType")})," ",a.launchPreview.command]}),e.jsxs("div",{className:"rounded-md bg-muted px-3 py-2 font-mono text-sm break-all",children:[e.jsx("span",{className:"text-muted-foreground",children:t("settingsPage.thinkingSection.ccsAdds")})," ",a.launchPreview.appendedArgs.length>0?a.launchPreview.appendedArgs.join(" "):t("settingsPage.channelsSection.nothingYet",{defaultValue:"(nothing yet)"})]})]}),a.launchPreview.skippedMessages.length>0&&e.jsx("div",{className:"mt-3 space-y-1 text-sm text-muted-foreground",children:a.launchPreview.skippedMessages.map(s=>e.jsx("p",{children:s},s))})]}),a?.claudeVersion.message&&a.claudeVersion.state!=="supported"&&e.jsxs(b,{children:[e.jsx(N,{className:"h-4 w-4"}),e.jsx(k,{children:a.claudeVersion.message})]}),a?.auth.message&&a.auth.state!=="eligible"&&e.jsxs(b,{children:[e.jsx(N,{className:"h-4 w-4"}),e.jsx(k,{children:a.auth.message})]}),a?.auth.orgRequirementMessage&&e.jsxs(b,{children:[e.jsx(N,{className:"h-4 w-4"}),e.jsx(k,{children:a.auth.orgRequirementMessage})]}),e.jsx("div",{className:"space-y-4",children:a?.channels.map(s=>{const o=l.selected.includes(s.id),g=f[s.id];return e.jsxs("div",{className:"rounded-lg border p-4 space-y-4",children:[e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx(A,{className:"text-base font-medium",children:s.displayName}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:s.summary}),e.jsx("p",{className:"mt-2 font-mono text-xs text-muted-foreground",children:s.pluginSpec})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(E,{variant:Q(s.setup.state),children:s.setup.label}),e.jsx(D,{checked:o,disabled:h||!!s.unavailableReason&&!o,onCheckedChange:p=>void T(s.id,p)})]})]}),e.jsxs("div",{className:"rounded-lg bg-muted/30 p-4 text-sm text-muted-foreground space-y-2",children:[e.jsx("p",{children:s.setup.detail}),e.jsx("p",{children:s.setup.nextStep})]}),s.requiresToken&&e.jsxs("div",{className:"space-y-3 rounded-lg bg-muted/30 p-4",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:!s.tokenConfigured&&s.tokenSource==="process_env"?t("settingsPage.channelsSection.tokenFromProcessEnv",{envKey:s.envKey,defaultValue:"The current CCS process already has {{envKey}}. Save it here only if you want persistent Claude channel state."}):s.tokenConfigured&&s.processEnvAvailable?t("settingsPage.channelsSection.tokenSavedAndProcessEnv",{envKey:s.envKey,defaultValue:"{{envKey}} is saved in Claude channel state, and the current CCS process env also provides it."}):t("settingsPage.channelsSection.tokenSaveHint",{envKey:s.envKey,defaultValue:"Save {{envKey}} in Claude's official channel env file. The dashboard never reads the token value back after save."})}),s.tokenConfigured&&e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Saving here writes the same ",e.jsx("code",{children:".env"})," file as"," ",e.jsxs("code",{children:["/",s.id,":configure"]}),", so you do not need to run the configure command again after a successful save."]}),e.jsx(B,{type:"password",value:g,onChange:p=>n(s.id,p.target.value),placeholder:s.tokenConfigured?t("settingsPage.channelsSection.tokenConfiguredPlaceholder",{envKey:s.envKey,defaultValue:"Configured. Enter a new {{envKey}} to replace it."}):!s.tokenConfigured&&s.tokenSource==="process_env"?t("settingsPage.channelsSection.tokenProcessEnvPlaceholder",{envKey:s.envKey,defaultValue:"Using current CCS process env. Enter a new {{envKey}} to save it for Claude."}):t("settingsPage.channelsSection.tokenPastePlaceholder",{envKey:s.envKey,defaultValue:"Paste {{envKey}}"}),disabled:h}),s.tokenPath&&s.tokenSource!=="process_env"&&e.jsx("div",{className:"text-xs text-muted-foreground break-all",children:s.tokenPath}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs(K,{onClick:()=>void i(s.id),disabled:h||!g.trim(),children:[e.jsx(q,{className:"mr-2 h-4 w-4"}),t("settingsPage.channelsSection.saveToken",{defaultValue:"Save Token"})]}),e.jsxs(K,{variant:"outline",onClick:()=>void r(s.id),disabled:h||!s.tokenConfigured,children:[e.jsx(J,{className:"mr-2 h-4 w-4"}),t("settingsPage.channelsSection.clearSavedToken",{defaultValue:"Clear Saved Token"})]})]})]}),e.jsxs("details",{className:"rounded-lg border bg-background p-4",children:[e.jsx("summary",{className:"cursor-pointer text-sm font-medium",children:t("settingsPage.channelsSection.claudeSideSetupCommands",{defaultValue:"Claude-side setup commands"})}),e.jsx("div",{className:"mt-3 space-y-2",children:(s.manualSetupCommands??[]).map(p=>e.jsx("div",{className:"rounded-md bg-muted px-3 py-2 font-mono text-sm break-all",children:p},p))})]})]},s.id)})}),e.jsx(b,{children:e.jsx(k,{children:t("settingsPage.channelsSection.injectionDisclaimer",{defaultValue:"CCS injects `--channels` only for the current Claude session. Telegram, Discord, and iMessage stop receiving messages when that Claude session exits."})})}),e.jsx("div",{className:"rounded-lg border p-4",children:e.jsxs("div",{className:"flex items-start justify-between gap-4 rounded-lg bg-muted/30 p-4",children:[e.jsxs("div",{className:"flex gap-3",children:[e.jsx(Y,{className:"mt-0.5 h-4 w-4 shrink-0 text-amber-600"}),e.jsxs("div",{children:[e.jsx(A,{className:"text-sm font-medium",children:t("profileEditorSections.skipPermissionPrompts")}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:t("settingsPage.channelsSection.skipPermissionDescription",{defaultValue:"Optional advanced behavior. CCS adds `--dangerously-skip-permissions` only when at least one selected channel is being auto-enabled and you did not already pass a permission flag yourself."})})]})]}),e.jsx(D,{checked:l.unattended,disabled:h,onCheckedChange:s=>void(async()=>{await w({unattended:s},s?"Unattended mode enabled":"Unattended mode disabled")&&await m()})()})]})}),e.jsx("div",{className:"flex justify-end",children:e.jsxs(K,{variant:"outline",onClick:()=>void V(),disabled:h,children:[e.jsx(M,{className:`mr-2 h-4 w-4 ${h?"animate-spin":""}`}),t("settings.refresh")]})})]})})]})}export{le as default};
@@ -1 +1 @@
1
- import{j as r,a1 as i,a2 as t}from"./radix-ui-nu4wz29m.js";import"./react-vendor-Bjx91N7w.js";import{c as s}from"./index-CGgavq2X.js";import{n as o}from"./icons-DSLG1YsC.js";function b({className:e,...a}){return r.jsx(i,{"data-slot":"checkbox",className:s("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...a,children:r.jsx(t,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none",children:r.jsx(o,{className:"size-3.5"})})})}export{b as C};
1
+ import{j as r,a1 as i,a2 as t}from"./radix-ui-nu4wz29m.js";import"./react-vendor-Bjx91N7w.js";import{c as s}from"./index-B2JEyN3d.js";import{n as o}from"./icons-DSLG1YsC.js";function b({className:e,...a}){return r.jsx(i,{"data-slot":"checkbox",className:s("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...a,children:r.jsx(t,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none",children:r.jsx(o,{className:"size-3.5"})})})}export{b as C};
@@ -1 +1 @@
1
- import{j as e}from"./radix-ui-nu4wz29m.js";import{r as W}from"./react-vendor-Bjx91N7w.js";import{a as q,bf as Ce,B as f,e as P,x as te,C as x,s as p,t as v,a0 as j,b as g,I as Y,j as ne,k as ie,l as le,m as de,n as re,z as J,U as we,V as Ve,W as oe,X as ce,c as fe,Y as ke}from"./index-CGgavq2X.js";import{u as Q,a as K,b as M}from"./tanstack-bhJxV1h8.js";import{t as C}from"./notifications-B4_o8bcr.js";import{ab as De,aa as Be,L as $,av as Ie,au as Te,R as Re,T as ue,aj as Ae,a8 as qe}from"./icons-DSLG1YsC.js";import"./utils-CzKF5WmX.js";import"./form-utils-CuHzLhJZ.js";import"./charts-eIPy2oG6.js";const U=["claude-extension-bindings"];async function w(s,n){const t=await fetch(Ce(s),{headers:{"Content-Type":"application/json"},...n});if(!t.ok){const l=await t.json().catch(()=>null);throw new Error(l?.error||`Request failed (${t.status})`)}return t.status===204?void 0:await t.json()}function Ue(){return Q({queryKey:["claude-extension-options"],queryFn:()=>w("/claude-extension/profiles")})}function Fe(s,n="vscode"){return Q({queryKey:["claude-extension-setup",s,n],enabled:!!s,queryFn:()=>w(`/claude-extension/setup?profile=${encodeURIComponent(s||"")}&host=${encodeURIComponent(n)}`)})}function Le(){return Q({queryKey:U,queryFn:()=>w("/claude-extension/bindings")})}function Oe(s){return Q({queryKey:["claude-extension-binding-status",s],enabled:!!s,queryFn:()=>w(`/claude-extension/bindings/${encodeURIComponent(s||"")}/verify`)})}function $e(){const s=K();return M({mutationFn:n=>w("/claude-extension/bindings",{method:"POST",body:JSON.stringify(n)}),onSuccess:()=>{s.invalidateQueries({queryKey:U}),C.success("Binding created")},onError:n=>C.error(n.message)})}function Je(){const s=K(),{t:n}=q();return M({mutationFn:({id:t,binding:l})=>w(`/claude-extension/bindings/${encodeURIComponent(t)}`,{method:"PUT",body:JSON.stringify(l)}),onSuccess:(t,l)=>{s.invalidateQueries({queryKey:U}),s.invalidateQueries({queryKey:["claude-extension-binding-status",l.id]}),C.success(n("claudeExtensionPage.bindingSaved"))},onError:t=>C.error(t.message)})}function Qe(){const s=K(),{t:n}=q();return M({mutationFn:t=>w(`/claude-extension/bindings/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>{s.invalidateQueries({queryKey:U}),C.success(n("claudeExtensionPage.bindingDeleted"))},onError:t=>C.error(t.message)})}function pe(s,n){const t=K();return M({mutationFn:({id:l,target:S})=>w(`/claude-extension/bindings/${encodeURIComponent(l)}/${s}`,{method:"POST",body:JSON.stringify({target:S})}),onSuccess:l=>{t.invalidateQueries({queryKey:U}),t.setQueryData(["claude-extension-binding-status",l.bindingId],l),C.success(n)},onError:l=>C.error(l.message)})}function Ke(){const{t:s}=q();return pe("apply",s("claudeExtensionPage.bindingApplied"))}function Me(){const{t:s}=q();return pe("reset",s("claudeExtensionPage.managedValuesRemoved"))}const He=[];function xe(s){return{name:"",profile:s,host:"vscode",ideSettingsPath:"",notes:""}}function T(s){return{name:s.name,profile:s.profile,host:s.host,ideSettingsPath:s.ideSettingsPath||"",notes:s.notes||""}}function ze(s){return{name:s.name.trim(),profile:s.profile.trim(),host:s.host,ideSettingsPath:s.ideSettingsPath.trim()||void 0,notes:s.notes.trim()||void 0}}function ge(s){return s?.state==="applied"}function _e({state:s}){const n=s==="applied"?"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300":s==="drifted"?"border-amber-500/30 bg-amber-500/10 text-amber-700 dark:text-amber-300":s==="missing"?"border-destructive/30 bg-destructive/10 text-destructive":"border-border bg-muted text-muted-foreground";return e.jsx(f,{variant:"outline",className:n,children:s})}function We(s){return s.replace(/[\\/]/g,"$&​")}function o({label:s,value:n,mono:t=!1,copyValue:l}){const S=typeof l=="string"&&l.trim().length>0;return e.jsxs("div",{className:"grid gap-2 text-sm sm:grid-cols-[112px_minmax(0,1fr)] sm:items-start",children:[e.jsx("span",{className:"text-muted-foreground",children:s}),S?e.jsxs("div",{className:"flex min-w-0 items-start gap-2",children:[e.jsx("div",{className:"min-w-0 flex-1 rounded-md border bg-muted/25 px-3 py-2",children:e.jsx("span",{className:"block text-left font-mono text-xs leading-5 [overflow-wrap:anywhere]",children:We(n)})}),e.jsx(J,{value:l,label:`Copy ${s.toLowerCase()}`,className:"shrink-0"})]}):e.jsx("span",{className:fe("text-left sm:text-right",t&&"font-mono text-xs leading-5 [overflow-wrap:anywhere]"),children:n})]})}function me({title:s,description:n,value:t}){return e.jsxs(x,{className:"border-border/60 bg-card/80",children:[e.jsx(p,{className:"pb-3",children:e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx(v,{className:"text-base",children:s}),e.jsx(j,{className:"mt-1",children:n})]}),e.jsx(J,{value:t,label:`Copy ${s}`})]})}),e.jsx(g,{children:e.jsx("pre",{className:"max-h-[360px] overflow-auto rounded-lg border bg-muted/30 p-4 text-xs leading-6",children:t})})]})}function he({title:s,description:n,status:t,applyLabel:l,resetLabel:S,onApply:F,onReset:m,disabled:b,busy:V}){return e.jsxs(x,{className:"border-border/60 bg-card/80",children:[e.jsx(p,{className:"pb-3",children:e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx(v,{className:"text-base",children:s}),e.jsx(j,{className:"mt-1",children:n})]}),t?e.jsx(_e,{state:t.state}):null]})}),e.jsxs(g,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(o,{label:"Path",value:t?.path||"Save a binding first",mono:!0,copyValue:t?.path}),e.jsx(o,{label:"File",value:t?t.exists?"Present":"Not created yet":"Unavailable"})]}),e.jsx("div",{className:"rounded-lg border bg-muted/25 p-3 text-sm text-muted-foreground",children:t?.message||ke.t("claudeExtensionPage.verifyAfterSaving",{defaultValue:"Verify the binding after saving to inspect the current file state."})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(P,{size:"sm",className:"flex-1",onClick:F,disabled:b||V,children:[V?e.jsx($,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):null,l]}),e.jsx(P,{size:"sm",variant:"outline",className:"flex-1",onClick:m,disabled:b||V,children:S})]})]})]})}function Ye({binding:s,isSelected:n,onSelect:t}){return e.jsx("button",{onClick:t,className:fe("w-full rounded-lg border px-3 py-3 text-left transition-colors",n?"border-primary/40 bg-primary/10":"border-border/60 bg-card hover:bg-muted/40"),children:e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"truncate text-sm font-medium",children:s.name}),e.jsxs("div",{className:"mt-1 text-xs text-muted-foreground",children:[s.profile," · ",s.host]})]}),e.jsx(f,{variant:"outline",className:"shrink-0",children:s.usesDefaultIdeSettingsPath?"Default path":"Custom path"})]})})}function ls(){const{t:s}=q(),n=Ue(),t=Le(),l=$e(),S=Je(),F=Qe(),m=Ke(),b=Me(),V=n.data?.profiles??[],G=n.data?.hosts??[],E=t.data?.bindings??He,ve=V[0]?.name??"default",[je,D]=W.useState(!1),[L,B]=W.useState(null),[X,k]=W.useState(()=>xe("default")),c=je||E.length===0,N=!c&&E.length>0?E.find(a=>a.id===L)??(L?null:E[0]):null,h=N?.id??null,d=c||!N||L?X:T(N),Z=Fe(d.profile,d.host),R=Oe(c?void 0:h||void 0),r=G.find(a=>a.id===d.host),H=V.find(a=>a.name===d.profile),z=n.error||t.error||Z.error||R.error,be=`${E.length} saved`,ee=l.isPending||S.isPending,Ne=m.isPending&&m.variables?.target==="shared"||b.isPending&&b.variables?.target==="shared",ye=m.isPending&&m.variables?.target==="ide"||b.isPending&&b.variables?.target==="ide",se=d.name.trim().length>0&&d.profile.trim().length>0,i=Z.data,u=R.data,ae=Math.max((i?.env.length??0)-6,0),Pe=i?.env.slice(0,6)??[];function _(){D(!0),B(null),k(xe(ve))}async function Se(){if(!se)return;const a=ze(d);if(!c&&h){const O=await S.mutateAsync({id:h,binding:a});D(!1),B(O.binding.id),k(T(O.binding));return}const y=await l.mutateAsync(a);D(!1),B(y.binding.id),k(T(y.binding))}async function Ee(){if(!h||!N||!window.confirm(s("claudeExtensionPage.deleteBindingConfirm",{name:N.name,defaultValue:'Delete binding "{{name}}"?'})))return;await F.mutateAsync(h);const a=E.filter(y=>y.id!==h);a.length>0?(B(a[0].id),D(!1),k(T(a[0]))):_()}function A(a,y){if(!c&&N&&!L){B(N.id),k({...T(N),[a]:y}),D(!1);return}k(O=>({...O,[a]:y}))}function I(a,y){if(h){if(y==="apply"){m.mutate({id:h,target:a});return}b.mutate({id:h,target:a})}}return e.jsxs("div",{className:"flex h-full min-h-0 overflow-hidden",children:[e.jsxs("div",{className:"flex w-[348px] shrink-0 flex-col border-r bg-muted/30 xl:w-[372px]",children:[e.jsx("div",{className:"border-b bg-background p-4",children:e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"rounded-lg border bg-muted/40 p-2",children:e.jsx(De,{className:"h-5 w-5 text-primary"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"font-semibold",children:s("claudeExtensionPage.title")}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s("claudeExtensionPage.savedBindingsSubtitle",{defaultValue:"Saved IDE bindings for CCS profiles"})})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(f,{variant:"secondary",children:be}),r?e.jsx(f,{variant:"outline",children:r.label}):null]})]}),e.jsxs(P,{size:"sm",onClick:_,className:"gap-1.5",children:[e.jsx(Be,{className:"h-3.5 w-3.5"}),s("claudeExtensionPage.new",{defaultValue:"New"})]})]})}),e.jsx(te,{className:"flex-1",children:e.jsxs("div",{className:"space-y-4 p-5",children:[e.jsxs(x,{className:"border-border/60 bg-card/80",children:[e.jsxs(p,{children:[e.jsx(v,{className:"text-base",children:c?s("claudeExtensionPage.createBinding",{defaultValue:"Create binding"}):s("claudeExtensionPage.bindingEditor",{defaultValue:"Binding editor"})}),e.jsx(j,{children:s("claudeExtensionPage.bindingEditorDescription",{defaultValue:"Save a profile + IDE path once, then apply or reset it from the dashboard."})})]}),e.jsxs(g,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"text-sm font-medium",children:s("settingsPage.thinkingSection.bindingName")}),e.jsx(Y,{value:d.name,onChange:a=>A("name",a.target.value),placeholder:s("claudeExtensionPage.bindingNamePlaceholder",{defaultValue:"VS Code · work profile"})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"text-sm font-medium",children:s("claudeExtensionPage.ccsProfile",{defaultValue:"CCS profile"})}),e.jsxs(ne,{value:d.profile,onValueChange:a=>A("profile",a),children:[e.jsx(ie,{children:e.jsx(le,{placeholder:s("claudeExtensionPage.selectProfile",{defaultValue:"Select a profile"})})}),e.jsx(de,{children:V.map(a=>e.jsxs(re,{value:a.name,children:[a.label," (",a.profileType,")"]},a.name))})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:H?.description||s("claudeExtensionPage.chooseProfileHint",{defaultValue:"Choose which CCS profile the IDE should inherit."})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"text-sm font-medium",children:s("settingsPage.thinkingSection.ideHost")}),e.jsxs(ne,{value:d.host,onValueChange:a=>A("host",a),children:[e.jsx(ie,{children:e.jsx(le,{placeholder:s("claudeExtensionPage.selectHost",{defaultValue:"Select a host"})})}),e.jsx(de,{children:G.map(a=>e.jsx(re,{value:a.id,children:a.label},a.id))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"text-sm font-medium",children:s("settingsPage.thinkingSection.ideSettingsPath")}),e.jsx(Y,{value:d.ideSettingsPath,onChange:a=>A("ideSettingsPath",a.target.value),placeholder:r?.defaultSettingsPath||s("claudeExtensionPage.ideSettingsPathPlaceholder",{defaultValue:"Leave blank for the default user settings path"})}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[s("claudeExtensionPage.ideSettingsPathHint",{defaultValue:"Leave blank to use the default user settings path for"})," ",r?.label||"this IDE","."]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"text-sm font-medium",children:s("settingsPage.thinkingSection.notes")}),e.jsx(Y,{value:d.notes,onChange:a=>A("notes",a.target.value),placeholder:s("claudeExtensionPage.notesPlaceholder",{defaultValue:"Optional reminder for this machine or workspace"})})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(P,{className:"flex-1 gap-1.5",onClick:()=>void Se(),disabled:!se||ee,children:[ee?e.jsx($,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(Ie,{className:"h-3.5 w-3.5"}),c?s("claudeExtensionPage.create",{defaultValue:"Create"}):s("claudeExtensionPage.save",{defaultValue:"Save"})]}),e.jsx(P,{variant:"outline",onClick:_,children:s("claudeExtensionPage.resetForm",{defaultValue:"Reset form"})})]}),c?null:e.jsxs(P,{variant:"outline",className:"w-full gap-1.5 text-destructive hover:text-destructive",onClick:()=>void Ee(),disabled:F.isPending,children:[e.jsx(Te,{className:"h-3.5 w-3.5"}),s("claudeExtensionPage.deleteBinding",{defaultValue:"Delete binding"})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"px-1 text-xs font-medium uppercase tracking-wide text-muted-foreground",children:s("claudeExtensionPage.savedBindings",{defaultValue:"Saved bindings"})}),e.jsx("div",{className:"space-y-2",children:E.length>0?E.map(a=>e.jsx(Ye,{binding:a,isSelected:a.id===h&&!c,onSelect:()=>{D(!1),B(a.id),k(T(a))}},a.id)):e.jsx(x,{className:"border-dashed border-border/60 bg-card/60",children:e.jsx(g,{className:"pt-6 text-sm text-muted-foreground",children:s("claudeExtensionPage.emptyBindings",{defaultValue:"No saved bindings yet. Create one to manage apply, reset, and drift checks from the dashboard."})})})})]})]})})]}),e.jsx("div",{className:"min-w-0 flex-1",children:e.jsx(te,{className:"h-full",children:e.jsxs("div",{className:"w-full space-y-6 p-6 xl:p-7 2xl:p-8",children:[e.jsxs("div",{className:"flex flex-col gap-3 lg:flex-row lg:items-end lg:justify-between",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[H?e.jsx(f,{variant:"outline",children:H.label}):null,r?e.jsx(f,{variant:"outline",children:r.label}):null,c?e.jsx(f,{variant:"secondary",children:s("settingsPage.thinkingSection.draft")}):null,u?.sharedSettings&&ge(u.sharedSettings)&&ge(u.ideSettings)?e.jsx(f,{className:"bg-emerald-600 hover:bg-emerald-600",children:s("settingsPage.thinkingSection.inSync")}):null]}),e.jsxs("div",{className:"max-w-5xl",children:[e.jsx("h2",{className:"text-2xl font-semibold tracking-tight",children:N?.name||s("claudeExtensionPage.defaultBindingName",{defaultValue:"Claude extension binding"})}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:s("claudeExtensionPage.bindingDescription",{defaultValue:"Manage the shared Claude settings file and the IDE-local settings file as two scoped targets."})})]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(P,{variant:"outline",onClick:()=>void R.refetch(),disabled:c||R.isFetching,children:[R.isFetching?e.jsx($,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):e.jsx(Re,{className:"mr-1.5 h-3.5 w-3.5"}),s("claudeExtensionPage.verify",{defaultValue:"Verify"})]}),i?e.jsx(J,{value:i.sharedSettings.command,label:"Copy persist command"}):null]})]}),z?e.jsx(x,{className:"border-destructive/40 bg-destructive/5",children:e.jsxs(g,{className:"flex items-start gap-3 pt-6 text-sm text-destructive",children:[e.jsx(ue,{className:"mt-0.5 h-4 w-4 shrink-0"}),e.jsx("div",{children:z.message})]})}):null,z?null:e.jsxs(we,{defaultValue:"overview",className:"flex flex-col gap-6",children:[e.jsxs(Ve,{className:"w-full justify-start",children:[e.jsx(oe,{value:"overview",children:s("claudeExtensionPage.overview",{defaultValue:"Overview"})})," ",e.jsx(oe,{value:"advanced",children:s("settingsPage.thinkingSection.advanced")})]}),e.jsxs(ce,{value:"overview",className:"mt-0 space-y-6",children:[e.jsxs("div",{className:"grid gap-6 xl:grid-cols-2",children:[e.jsx(he,{title:s("claudeExtensionPage.sharedClaudeSettings",{defaultValue:"Shared Claude settings"}),description:s("claudeExtensionPage.sharedClaudeSettingsDescription",{defaultValue:"Writes the managed env block inside ~/.claude/settings.json so CLI and IDE behavior stay aligned."}),status:u?.sharedSettings,applyLabel:s("claudeExtensionPage.applyShared",{defaultValue:"Apply shared"}),resetLabel:s("claudeExtensionPage.resetShared",{defaultValue:"Reset shared"}),onApply:()=>I("shared","apply"),onReset:()=>I("shared","reset"),disabled:c,busy:Ne}),e.jsx(he,{title:`${r?.label||"IDE"} settings.json`,description:"Writes only the Anthropic extension keys so unrelated editor preferences stay untouched.",status:u?.ideSettings,applyLabel:s("claudeExtensionPage.applyIde",{defaultValue:"Apply IDE"}),resetLabel:s("claudeExtensionPage.resetIde",{defaultValue:"Reset IDE"}),onApply:()=>I("ide","apply"),onReset:()=>I("ide","reset"),disabled:c,busy:ye})]}),e.jsxs("div",{className:"grid gap-6 xl:grid-cols-[minmax(0,1.15fr)_minmax(320px,0.85fr)]",children:[e.jsxs(x,{className:"border-border/60 bg-card/80",children:[e.jsxs(p,{children:[e.jsx(v,{className:"text-base",children:s("settingsPage.thinkingSection.resolvedBinding")}),e.jsx(j,{children:s("claudeExtensionPage.resolvedBindingDescription",{defaultValue:"The binding uses the same profile resolution as `ccs persist` and `ccs env`."})})]}),e.jsxs(g,{className:"space-y-3",children:[e.jsx(o,{label:s("claudeExtensionPage.profile",{defaultValue:"Profile"}),value:i?.profile.label||d.profile||"Not selected"}),e.jsx(o,{label:s("claudeExtensionPage.profileType",{defaultValue:"Profile type"}),value:i?.profile.profileType||"Unknown"}),e.jsx(o,{label:"IDE host",value:r?.label||"Not selected"}),e.jsx(o,{label:s("claudeExtensionPage.idePathMode",{defaultValue:"IDE path mode"}),value:d.ideSettingsPath.trim()?s("claudeExtensionPage.customPath",{defaultValue:"Custom path"}):s("claudeExtensionPage.defaultUserPath",{defaultValue:"Default user path"})}),e.jsx(o,{label:s("claudeExtensionPage.effectiveIdePath",{defaultValue:"Effective IDE path"}),value:u?.ideSettings.path||d.ideSettingsPath.trim()||r?.defaultSettingsPath||"Unavailable",mono:!0,copyValue:u?.ideSettings.path||d.ideSettingsPath.trim()||r?.defaultSettingsPath}),e.jsx(o,{label:s("claudeExtensionPage.persistCommand",{defaultValue:"Persist command"}),value:i?.sharedSettings.command||s("claudeExtensionPage.saveValidBindingFirst",{defaultValue:"Save a valid binding first"}),mono:!0}),d.notes.trim()?e.jsx(o,{label:s("settingsPage.thinkingSection.notes"),value:d.notes.trim()}):null]})]}),e.jsxs(x,{className:"border-border/60 bg-card/80",children:[e.jsxs(p,{children:[e.jsx(v,{className:"text-base",children:s("settingsPage.thinkingSection.managedPayload")}),e.jsx(j,{children:s("claudeExtensionPage.managedPayloadDescription",{defaultValue:"Keep the main view short. The full JSON stays in the Advanced tab."})})]}),e.jsxs(g,{className:"space-y-4",children:[e.jsxs("div",{className:"flex flex-wrap gap-2",children:[Pe.map(a=>e.jsx(f,{variant:"secondary",className:"font-mono text-[10px]",children:a.name},a.name)),ae>0?e.jsxs(f,{variant:"outline",children:["+",ae," more"]}):null]}),e.jsx("div",{className:"rounded-lg border bg-muted/25 p-4 text-sm",children:i?.env.length?e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"font-medium",children:s("claudeExtensionPage.envInjected",{count:i.env.length,defaultValue:"CCS will inject {{count}} environment values."})}),e.jsx("div",{className:"text-muted-foreground",children:s("claudeExtensionPage.envInjectedDescription",{defaultValue:"The IDE-local target receives the extension schema. The shared target receives the same env block through Claude settings."})})]}):e.jsx("div",{className:"text-muted-foreground",children:s("claudeExtensionPage.nativeDefaultsDescription",{defaultValue:"This profile resolves to native Claude defaults, so apply/reset mainly clears existing CCS-managed overrides."})})}),c?e.jsx("div",{className:"rounded-lg border border-dashed bg-muted/15 p-4 text-sm text-muted-foreground",children:s("claudeExtensionPage.saveDraftToUnlock",{defaultValue:"Save this draft to unlock apply, reset, and verify actions."})}):e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(P,{className:"flex-1",onClick:()=>I("all","apply"),disabled:m.isPending,children:[m.isPending&&m.variables?.target==="all"?e.jsx($,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):null,s("claudeExtensionPage.applyBothTargets",{defaultValue:"Apply both targets"})]}),e.jsx(P,{variant:"outline",className:"flex-1",onClick:()=>I("all","reset"),disabled:b.isPending,children:s("claudeExtensionPage.resetBothTargets",{defaultValue:"Reset both targets"})})]})]})]})]}),i&&(i.warnings.length>0||i.notes.length>0)?e.jsxs("div",{className:"grid gap-6 xl:grid-cols-2",children:[e.jsxs(x,{className:"border-border/60 bg-card/80",children:[e.jsxs(p,{children:[e.jsx(v,{className:"text-base",children:s("settingsPage.thinkingSection.warnings")}),e.jsx(j,{children:"Operational details that can break the binding even when JSON is correct."})]}),e.jsx(g,{className:"space-y-3",children:i.warnings.length>0?i.warnings.map(a=>e.jsxs("div",{className:"flex items-start gap-3 rounded-lg border border-amber-400/40 bg-amber-50/60 p-3 text-sm dark:bg-amber-950/10",children:[e.jsx(ue,{className:"mt-0.5 h-4 w-4 shrink-0 text-amber-600"}),e.jsx("span",{children:a})]},a)):e.jsx("div",{className:"rounded-lg border bg-muted/20 p-3 text-sm text-muted-foreground",children:"No runtime warnings for this binding."})})]}),e.jsxs(x,{className:"border-border/60 bg-card/80",children:[e.jsxs(p,{children:[e.jsx(v,{className:"text-base",children:s("settingsPage.thinkingSection.notes")}),e.jsx(j,{children:"Short context from CCS about account continuity and host-specific behavior."})]}),e.jsx(g,{className:"space-y-3",children:i.notes.length>0?i.notes.map(a=>e.jsxs("div",{className:"flex items-start gap-3 rounded-lg border bg-muted/30 p-3 text-sm",children:[e.jsx(Ae,{className:"mt-0.5 h-4 w-4 shrink-0 text-muted-foreground"}),e.jsx("span",{children:a})]},a)):e.jsx("div",{className:"rounded-lg border bg-muted/20 p-3 text-sm text-muted-foreground",children:"No extra notes for this binding."})})]})]}):null]}),e.jsx(ce,{value:"advanced",className:"mt-0 space-y-6",children:i?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid gap-6 xl:grid-cols-2",children:[e.jsx(me,{title:s("claudeExtensionPage.sharedSettingsJson",{defaultValue:"Shared Claude settings JSON"}),description:s("claudeExtensionPage.sharedSettingsJsonDescription",{defaultValue:"Managed env block for ~/.claude/settings.json."}),value:i.sharedSettings.json}),e.jsx(me,{title:`${r?.label||"IDE"} settings JSON`,description:s("claudeExtensionPage.ideSettingsJsonDescription",{label:r?.settingsTargetLabel||"settings.json",defaultValue:"Anthropic extension snippet for {{label}}."}),value:i.ideSettings.json})]}),e.jsxs(x,{className:"border-border/60 bg-card/80",children:[e.jsx(p,{children:e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx(v,{className:"text-base",children:s("claudeExtensionPage.resolvedEnvironmentPayload",{defaultValue:"Resolved environment payload"})}),e.jsx(j,{children:s("claudeExtensionPage.resolvedEnvironmentPayloadDescription",{defaultValue:"Exact environment values that the extension receives after CCS expands this profile."})})]}),e.jsx(J,{value:JSON.stringify(i.env,null,2),label:s("claudeExtensionPage.copyEnvironmentPayload",{defaultValue:"Copy environment payload"})})]})}),e.jsx(g,{children:i.env.length>0?e.jsx("pre",{className:"max-h-[420px] overflow-auto rounded-lg border bg-muted/30 p-4 text-xs leading-6",children:JSON.stringify(i.env,null,2)}):e.jsx("div",{className:"rounded-lg border bg-muted/20 p-4 text-sm text-muted-foreground",children:"No env payload. This binding resolves to native Claude defaults."})})]}),e.jsxs("div",{className:"grid gap-6 xl:grid-cols-2",children:[e.jsxs(x,{className:"border-border/60 bg-card/80",children:[e.jsxs(p,{children:[e.jsx(v,{className:"text-base",children:"Shared target metadata"}),e.jsx(j,{children:"Useful when debugging drift or comparing with manual edits."})]}),e.jsxs(g,{className:"space-y-3",children:[e.jsx(o,{label:"Target path",value:u?.sharedSettings.path||i.sharedSettings.path,mono:!0,copyValue:u?.sharedSettings.path||i.sharedSettings.path}),e.jsx(o,{label:"Command",value:i.sharedSettings.command,mono:!0}),e.jsx(o,{label:"Current state",value:u?.sharedSettings.state||"Not verified"})]})]}),e.jsxs(x,{className:"border-border/60 bg-card/80",children:[e.jsxs(p,{children:[e.jsx(v,{className:"text-base",children:"IDE target metadata"}),e.jsx(j,{children:"Current file path plus the extension setting key used for this host."})]}),e.jsxs(g,{className:"space-y-3",children:[e.jsx(o,{label:"Target path",value:u?.ideSettings.path||d.ideSettingsPath.trim()||r?.defaultSettingsPath||i.ideSettings.path,mono:!0,copyValue:u?.ideSettings.path||d.ideSettingsPath.trim()||r?.defaultSettingsPath||i.ideSettings.path}),e.jsx(o,{label:"Settings key",value:r?.settingsKey||"Unknown",mono:!0}),e.jsx(o,{label:"Current state",value:u?.ideSettings.state||"Not verified"})]})]})]})]}):e.jsx(x,{className:"border-border/60 bg-card/80",children:e.jsxs(g,{className:"flex min-h-[240px] items-center justify-center gap-3 text-sm text-muted-foreground",children:[e.jsx(qe,{className:"h-5 w-5"}),"Choose a profile and IDE host to preview the generated payload."]})})})]})]})})})]})}export{ls as ClaudeExtensionPage};
1
+ import{j as e}from"./radix-ui-nu4wz29m.js";import{r as W}from"./react-vendor-Bjx91N7w.js";import{a as q,bf as Ce,B as f,e as P,x as te,C as x,s as p,t as v,a0 as j,b as g,I as Y,j as ne,k as ie,l as le,m as de,n as re,z as J,U as we,V as Ve,W as oe,X as ce,c as fe,Y as ke}from"./index-B2JEyN3d.js";import{u as Q,a as K,b as M}from"./tanstack-bhJxV1h8.js";import{t as C}from"./notifications-B4_o8bcr.js";import{ab as De,aa as Be,L as $,av as Ie,au as Te,R as Re,T as ue,aj as Ae,a8 as qe}from"./icons-DSLG1YsC.js";import"./utils-CzKF5WmX.js";import"./form-utils-CuHzLhJZ.js";import"./charts-eIPy2oG6.js";const U=["claude-extension-bindings"];async function w(s,n){const t=await fetch(Ce(s),{headers:{"Content-Type":"application/json"},...n});if(!t.ok){const l=await t.json().catch(()=>null);throw new Error(l?.error||`Request failed (${t.status})`)}return t.status===204?void 0:await t.json()}function Ue(){return Q({queryKey:["claude-extension-options"],queryFn:()=>w("/claude-extension/profiles")})}function Fe(s,n="vscode"){return Q({queryKey:["claude-extension-setup",s,n],enabled:!!s,queryFn:()=>w(`/claude-extension/setup?profile=${encodeURIComponent(s||"")}&host=${encodeURIComponent(n)}`)})}function Le(){return Q({queryKey:U,queryFn:()=>w("/claude-extension/bindings")})}function Oe(s){return Q({queryKey:["claude-extension-binding-status",s],enabled:!!s,queryFn:()=>w(`/claude-extension/bindings/${encodeURIComponent(s||"")}/verify`)})}function $e(){const s=K();return M({mutationFn:n=>w("/claude-extension/bindings",{method:"POST",body:JSON.stringify(n)}),onSuccess:()=>{s.invalidateQueries({queryKey:U}),C.success("Binding created")},onError:n=>C.error(n.message)})}function Je(){const s=K(),{t:n}=q();return M({mutationFn:({id:t,binding:l})=>w(`/claude-extension/bindings/${encodeURIComponent(t)}`,{method:"PUT",body:JSON.stringify(l)}),onSuccess:(t,l)=>{s.invalidateQueries({queryKey:U}),s.invalidateQueries({queryKey:["claude-extension-binding-status",l.id]}),C.success(n("claudeExtensionPage.bindingSaved"))},onError:t=>C.error(t.message)})}function Qe(){const s=K(),{t:n}=q();return M({mutationFn:t=>w(`/claude-extension/bindings/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>{s.invalidateQueries({queryKey:U}),C.success(n("claudeExtensionPage.bindingDeleted"))},onError:t=>C.error(t.message)})}function pe(s,n){const t=K();return M({mutationFn:({id:l,target:S})=>w(`/claude-extension/bindings/${encodeURIComponent(l)}/${s}`,{method:"POST",body:JSON.stringify({target:S})}),onSuccess:l=>{t.invalidateQueries({queryKey:U}),t.setQueryData(["claude-extension-binding-status",l.bindingId],l),C.success(n)},onError:l=>C.error(l.message)})}function Ke(){const{t:s}=q();return pe("apply",s("claudeExtensionPage.bindingApplied"))}function Me(){const{t:s}=q();return pe("reset",s("claudeExtensionPage.managedValuesRemoved"))}const He=[];function xe(s){return{name:"",profile:s,host:"vscode",ideSettingsPath:"",notes:""}}function T(s){return{name:s.name,profile:s.profile,host:s.host,ideSettingsPath:s.ideSettingsPath||"",notes:s.notes||""}}function ze(s){return{name:s.name.trim(),profile:s.profile.trim(),host:s.host,ideSettingsPath:s.ideSettingsPath.trim()||void 0,notes:s.notes.trim()||void 0}}function ge(s){return s?.state==="applied"}function _e({state:s}){const n=s==="applied"?"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300":s==="drifted"?"border-amber-500/30 bg-amber-500/10 text-amber-700 dark:text-amber-300":s==="missing"?"border-destructive/30 bg-destructive/10 text-destructive":"border-border bg-muted text-muted-foreground";return e.jsx(f,{variant:"outline",className:n,children:s})}function We(s){return s.replace(/[\\/]/g,"$&​")}function o({label:s,value:n,mono:t=!1,copyValue:l}){const S=typeof l=="string"&&l.trim().length>0;return e.jsxs("div",{className:"grid gap-2 text-sm sm:grid-cols-[112px_minmax(0,1fr)] sm:items-start",children:[e.jsx("span",{className:"text-muted-foreground",children:s}),S?e.jsxs("div",{className:"flex min-w-0 items-start gap-2",children:[e.jsx("div",{className:"min-w-0 flex-1 rounded-md border bg-muted/25 px-3 py-2",children:e.jsx("span",{className:"block text-left font-mono text-xs leading-5 [overflow-wrap:anywhere]",children:We(n)})}),e.jsx(J,{value:l,label:`Copy ${s.toLowerCase()}`,className:"shrink-0"})]}):e.jsx("span",{className:fe("text-left sm:text-right",t&&"font-mono text-xs leading-5 [overflow-wrap:anywhere]"),children:n})]})}function me({title:s,description:n,value:t}){return e.jsxs(x,{className:"border-border/60 bg-card/80",children:[e.jsx(p,{className:"pb-3",children:e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx(v,{className:"text-base",children:s}),e.jsx(j,{className:"mt-1",children:n})]}),e.jsx(J,{value:t,label:`Copy ${s}`})]})}),e.jsx(g,{children:e.jsx("pre",{className:"max-h-[360px] overflow-auto rounded-lg border bg-muted/30 p-4 text-xs leading-6",children:t})})]})}function he({title:s,description:n,status:t,applyLabel:l,resetLabel:S,onApply:F,onReset:m,disabled:b,busy:V}){return e.jsxs(x,{className:"border-border/60 bg-card/80",children:[e.jsx(p,{className:"pb-3",children:e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx(v,{className:"text-base",children:s}),e.jsx(j,{className:"mt-1",children:n})]}),t?e.jsx(_e,{state:t.state}):null]})}),e.jsxs(g,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(o,{label:"Path",value:t?.path||"Save a binding first",mono:!0,copyValue:t?.path}),e.jsx(o,{label:"File",value:t?t.exists?"Present":"Not created yet":"Unavailable"})]}),e.jsx("div",{className:"rounded-lg border bg-muted/25 p-3 text-sm text-muted-foreground",children:t?.message||ke.t("claudeExtensionPage.verifyAfterSaving",{defaultValue:"Verify the binding after saving to inspect the current file state."})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(P,{size:"sm",className:"flex-1",onClick:F,disabled:b||V,children:[V?e.jsx($,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):null,l]}),e.jsx(P,{size:"sm",variant:"outline",className:"flex-1",onClick:m,disabled:b||V,children:S})]})]})]})}function Ye({binding:s,isSelected:n,onSelect:t}){return e.jsx("button",{onClick:t,className:fe("w-full rounded-lg border px-3 py-3 text-left transition-colors",n?"border-primary/40 bg-primary/10":"border-border/60 bg-card hover:bg-muted/40"),children:e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"truncate text-sm font-medium",children:s.name}),e.jsxs("div",{className:"mt-1 text-xs text-muted-foreground",children:[s.profile," · ",s.host]})]}),e.jsx(f,{variant:"outline",className:"shrink-0",children:s.usesDefaultIdeSettingsPath?"Default path":"Custom path"})]})})}function ls(){const{t:s}=q(),n=Ue(),t=Le(),l=$e(),S=Je(),F=Qe(),m=Ke(),b=Me(),V=n.data?.profiles??[],G=n.data?.hosts??[],E=t.data?.bindings??He,ve=V[0]?.name??"default",[je,D]=W.useState(!1),[L,B]=W.useState(null),[X,k]=W.useState(()=>xe("default")),c=je||E.length===0,N=!c&&E.length>0?E.find(a=>a.id===L)??(L?null:E[0]):null,h=N?.id??null,d=c||!N||L?X:T(N),Z=Fe(d.profile,d.host),R=Oe(c?void 0:h||void 0),r=G.find(a=>a.id===d.host),H=V.find(a=>a.name===d.profile),z=n.error||t.error||Z.error||R.error,be=`${E.length} saved`,ee=l.isPending||S.isPending,Ne=m.isPending&&m.variables?.target==="shared"||b.isPending&&b.variables?.target==="shared",ye=m.isPending&&m.variables?.target==="ide"||b.isPending&&b.variables?.target==="ide",se=d.name.trim().length>0&&d.profile.trim().length>0,i=Z.data,u=R.data,ae=Math.max((i?.env.length??0)-6,0),Pe=i?.env.slice(0,6)??[];function _(){D(!0),B(null),k(xe(ve))}async function Se(){if(!se)return;const a=ze(d);if(!c&&h){const O=await S.mutateAsync({id:h,binding:a});D(!1),B(O.binding.id),k(T(O.binding));return}const y=await l.mutateAsync(a);D(!1),B(y.binding.id),k(T(y.binding))}async function Ee(){if(!h||!N||!window.confirm(s("claudeExtensionPage.deleteBindingConfirm",{name:N.name,defaultValue:'Delete binding "{{name}}"?'})))return;await F.mutateAsync(h);const a=E.filter(y=>y.id!==h);a.length>0?(B(a[0].id),D(!1),k(T(a[0]))):_()}function A(a,y){if(!c&&N&&!L){B(N.id),k({...T(N),[a]:y}),D(!1);return}k(O=>({...O,[a]:y}))}function I(a,y){if(h){if(y==="apply"){m.mutate({id:h,target:a});return}b.mutate({id:h,target:a})}}return e.jsxs("div",{className:"flex h-full min-h-0 overflow-hidden",children:[e.jsxs("div",{className:"flex w-[348px] shrink-0 flex-col border-r bg-muted/30 xl:w-[372px]",children:[e.jsx("div",{className:"border-b bg-background p-4",children:e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"rounded-lg border bg-muted/40 p-2",children:e.jsx(De,{className:"h-5 w-5 text-primary"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"font-semibold",children:s("claudeExtensionPage.title")}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s("claudeExtensionPage.savedBindingsSubtitle",{defaultValue:"Saved IDE bindings for CCS profiles"})})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(f,{variant:"secondary",children:be}),r?e.jsx(f,{variant:"outline",children:r.label}):null]})]}),e.jsxs(P,{size:"sm",onClick:_,className:"gap-1.5",children:[e.jsx(Be,{className:"h-3.5 w-3.5"}),s("claudeExtensionPage.new",{defaultValue:"New"})]})]})}),e.jsx(te,{className:"flex-1",children:e.jsxs("div",{className:"space-y-4 p-5",children:[e.jsxs(x,{className:"border-border/60 bg-card/80",children:[e.jsxs(p,{children:[e.jsx(v,{className:"text-base",children:c?s("claudeExtensionPage.createBinding",{defaultValue:"Create binding"}):s("claudeExtensionPage.bindingEditor",{defaultValue:"Binding editor"})}),e.jsx(j,{children:s("claudeExtensionPage.bindingEditorDescription",{defaultValue:"Save a profile + IDE path once, then apply or reset it from the dashboard."})})]}),e.jsxs(g,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"text-sm font-medium",children:s("settingsPage.thinkingSection.bindingName")}),e.jsx(Y,{value:d.name,onChange:a=>A("name",a.target.value),placeholder:s("claudeExtensionPage.bindingNamePlaceholder",{defaultValue:"VS Code · work profile"})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"text-sm font-medium",children:s("claudeExtensionPage.ccsProfile",{defaultValue:"CCS profile"})}),e.jsxs(ne,{value:d.profile,onValueChange:a=>A("profile",a),children:[e.jsx(ie,{children:e.jsx(le,{placeholder:s("claudeExtensionPage.selectProfile",{defaultValue:"Select a profile"})})}),e.jsx(de,{children:V.map(a=>e.jsxs(re,{value:a.name,children:[a.label," (",a.profileType,")"]},a.name))})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:H?.description||s("claudeExtensionPage.chooseProfileHint",{defaultValue:"Choose which CCS profile the IDE should inherit."})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"text-sm font-medium",children:s("settingsPage.thinkingSection.ideHost")}),e.jsxs(ne,{value:d.host,onValueChange:a=>A("host",a),children:[e.jsx(ie,{children:e.jsx(le,{placeholder:s("claudeExtensionPage.selectHost",{defaultValue:"Select a host"})})}),e.jsx(de,{children:G.map(a=>e.jsx(re,{value:a.id,children:a.label},a.id))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"text-sm font-medium",children:s("settingsPage.thinkingSection.ideSettingsPath")}),e.jsx(Y,{value:d.ideSettingsPath,onChange:a=>A("ideSettingsPath",a.target.value),placeholder:r?.defaultSettingsPath||s("claudeExtensionPage.ideSettingsPathPlaceholder",{defaultValue:"Leave blank for the default user settings path"})}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[s("claudeExtensionPage.ideSettingsPathHint",{defaultValue:"Leave blank to use the default user settings path for"})," ",r?.label||"this IDE","."]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"text-sm font-medium",children:s("settingsPage.thinkingSection.notes")}),e.jsx(Y,{value:d.notes,onChange:a=>A("notes",a.target.value),placeholder:s("claudeExtensionPage.notesPlaceholder",{defaultValue:"Optional reminder for this machine or workspace"})})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(P,{className:"flex-1 gap-1.5",onClick:()=>void Se(),disabled:!se||ee,children:[ee?e.jsx($,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(Ie,{className:"h-3.5 w-3.5"}),c?s("claudeExtensionPage.create",{defaultValue:"Create"}):s("claudeExtensionPage.save",{defaultValue:"Save"})]}),e.jsx(P,{variant:"outline",onClick:_,children:s("claudeExtensionPage.resetForm",{defaultValue:"Reset form"})})]}),c?null:e.jsxs(P,{variant:"outline",className:"w-full gap-1.5 text-destructive hover:text-destructive",onClick:()=>void Ee(),disabled:F.isPending,children:[e.jsx(Te,{className:"h-3.5 w-3.5"}),s("claudeExtensionPage.deleteBinding",{defaultValue:"Delete binding"})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"px-1 text-xs font-medium uppercase tracking-wide text-muted-foreground",children:s("claudeExtensionPage.savedBindings",{defaultValue:"Saved bindings"})}),e.jsx("div",{className:"space-y-2",children:E.length>0?E.map(a=>e.jsx(Ye,{binding:a,isSelected:a.id===h&&!c,onSelect:()=>{D(!1),B(a.id),k(T(a))}},a.id)):e.jsx(x,{className:"border-dashed border-border/60 bg-card/60",children:e.jsx(g,{className:"pt-6 text-sm text-muted-foreground",children:s("claudeExtensionPage.emptyBindings",{defaultValue:"No saved bindings yet. Create one to manage apply, reset, and drift checks from the dashboard."})})})})]})]})})]}),e.jsx("div",{className:"min-w-0 flex-1",children:e.jsx(te,{className:"h-full",children:e.jsxs("div",{className:"w-full space-y-6 p-6 xl:p-7 2xl:p-8",children:[e.jsxs("div",{className:"flex flex-col gap-3 lg:flex-row lg:items-end lg:justify-between",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[H?e.jsx(f,{variant:"outline",children:H.label}):null,r?e.jsx(f,{variant:"outline",children:r.label}):null,c?e.jsx(f,{variant:"secondary",children:s("settingsPage.thinkingSection.draft")}):null,u?.sharedSettings&&ge(u.sharedSettings)&&ge(u.ideSettings)?e.jsx(f,{className:"bg-emerald-600 hover:bg-emerald-600",children:s("settingsPage.thinkingSection.inSync")}):null]}),e.jsxs("div",{className:"max-w-5xl",children:[e.jsx("h2",{className:"text-2xl font-semibold tracking-tight",children:N?.name||s("claudeExtensionPage.defaultBindingName",{defaultValue:"Claude extension binding"})}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:s("claudeExtensionPage.bindingDescription",{defaultValue:"Manage the shared Claude settings file and the IDE-local settings file as two scoped targets."})})]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(P,{variant:"outline",onClick:()=>void R.refetch(),disabled:c||R.isFetching,children:[R.isFetching?e.jsx($,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):e.jsx(Re,{className:"mr-1.5 h-3.5 w-3.5"}),s("claudeExtensionPage.verify",{defaultValue:"Verify"})]}),i?e.jsx(J,{value:i.sharedSettings.command,label:"Copy persist command"}):null]})]}),z?e.jsx(x,{className:"border-destructive/40 bg-destructive/5",children:e.jsxs(g,{className:"flex items-start gap-3 pt-6 text-sm text-destructive",children:[e.jsx(ue,{className:"mt-0.5 h-4 w-4 shrink-0"}),e.jsx("div",{children:z.message})]})}):null,z?null:e.jsxs(we,{defaultValue:"overview",className:"flex flex-col gap-6",children:[e.jsxs(Ve,{className:"w-full justify-start",children:[e.jsx(oe,{value:"overview",children:s("claudeExtensionPage.overview",{defaultValue:"Overview"})})," ",e.jsx(oe,{value:"advanced",children:s("settingsPage.thinkingSection.advanced")})]}),e.jsxs(ce,{value:"overview",className:"mt-0 space-y-6",children:[e.jsxs("div",{className:"grid gap-6 xl:grid-cols-2",children:[e.jsx(he,{title:s("claudeExtensionPage.sharedClaudeSettings",{defaultValue:"Shared Claude settings"}),description:s("claudeExtensionPage.sharedClaudeSettingsDescription",{defaultValue:"Writes the managed env block inside ~/.claude/settings.json so CLI and IDE behavior stay aligned."}),status:u?.sharedSettings,applyLabel:s("claudeExtensionPage.applyShared",{defaultValue:"Apply shared"}),resetLabel:s("claudeExtensionPage.resetShared",{defaultValue:"Reset shared"}),onApply:()=>I("shared","apply"),onReset:()=>I("shared","reset"),disabled:c,busy:Ne}),e.jsx(he,{title:`${r?.label||"IDE"} settings.json`,description:"Writes only the Anthropic extension keys so unrelated editor preferences stay untouched.",status:u?.ideSettings,applyLabel:s("claudeExtensionPage.applyIde",{defaultValue:"Apply IDE"}),resetLabel:s("claudeExtensionPage.resetIde",{defaultValue:"Reset IDE"}),onApply:()=>I("ide","apply"),onReset:()=>I("ide","reset"),disabled:c,busy:ye})]}),e.jsxs("div",{className:"grid gap-6 xl:grid-cols-[minmax(0,1.15fr)_minmax(320px,0.85fr)]",children:[e.jsxs(x,{className:"border-border/60 bg-card/80",children:[e.jsxs(p,{children:[e.jsx(v,{className:"text-base",children:s("settingsPage.thinkingSection.resolvedBinding")}),e.jsx(j,{children:s("claudeExtensionPage.resolvedBindingDescription",{defaultValue:"The binding uses the same profile resolution as `ccs persist` and `ccs env`."})})]}),e.jsxs(g,{className:"space-y-3",children:[e.jsx(o,{label:s("claudeExtensionPage.profile",{defaultValue:"Profile"}),value:i?.profile.label||d.profile||"Not selected"}),e.jsx(o,{label:s("claudeExtensionPage.profileType",{defaultValue:"Profile type"}),value:i?.profile.profileType||"Unknown"}),e.jsx(o,{label:"IDE host",value:r?.label||"Not selected"}),e.jsx(o,{label:s("claudeExtensionPage.idePathMode",{defaultValue:"IDE path mode"}),value:d.ideSettingsPath.trim()?s("claudeExtensionPage.customPath",{defaultValue:"Custom path"}):s("claudeExtensionPage.defaultUserPath",{defaultValue:"Default user path"})}),e.jsx(o,{label:s("claudeExtensionPage.effectiveIdePath",{defaultValue:"Effective IDE path"}),value:u?.ideSettings.path||d.ideSettingsPath.trim()||r?.defaultSettingsPath||"Unavailable",mono:!0,copyValue:u?.ideSettings.path||d.ideSettingsPath.trim()||r?.defaultSettingsPath}),e.jsx(o,{label:s("claudeExtensionPage.persistCommand",{defaultValue:"Persist command"}),value:i?.sharedSettings.command||s("claudeExtensionPage.saveValidBindingFirst",{defaultValue:"Save a valid binding first"}),mono:!0}),d.notes.trim()?e.jsx(o,{label:s("settingsPage.thinkingSection.notes"),value:d.notes.trim()}):null]})]}),e.jsxs(x,{className:"border-border/60 bg-card/80",children:[e.jsxs(p,{children:[e.jsx(v,{className:"text-base",children:s("settingsPage.thinkingSection.managedPayload")}),e.jsx(j,{children:s("claudeExtensionPage.managedPayloadDescription",{defaultValue:"Keep the main view short. The full JSON stays in the Advanced tab."})})]}),e.jsxs(g,{className:"space-y-4",children:[e.jsxs("div",{className:"flex flex-wrap gap-2",children:[Pe.map(a=>e.jsx(f,{variant:"secondary",className:"font-mono text-[10px]",children:a.name},a.name)),ae>0?e.jsxs(f,{variant:"outline",children:["+",ae," more"]}):null]}),e.jsx("div",{className:"rounded-lg border bg-muted/25 p-4 text-sm",children:i?.env.length?e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"font-medium",children:s("claudeExtensionPage.envInjected",{count:i.env.length,defaultValue:"CCS will inject {{count}} environment values."})}),e.jsx("div",{className:"text-muted-foreground",children:s("claudeExtensionPage.envInjectedDescription",{defaultValue:"The IDE-local target receives the extension schema. The shared target receives the same env block through Claude settings."})})]}):e.jsx("div",{className:"text-muted-foreground",children:s("claudeExtensionPage.nativeDefaultsDescription",{defaultValue:"This profile resolves to native Claude defaults, so apply/reset mainly clears existing CCS-managed overrides."})})}),c?e.jsx("div",{className:"rounded-lg border border-dashed bg-muted/15 p-4 text-sm text-muted-foreground",children:s("claudeExtensionPage.saveDraftToUnlock",{defaultValue:"Save this draft to unlock apply, reset, and verify actions."})}):e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(P,{className:"flex-1",onClick:()=>I("all","apply"),disabled:m.isPending,children:[m.isPending&&m.variables?.target==="all"?e.jsx($,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):null,s("claudeExtensionPage.applyBothTargets",{defaultValue:"Apply both targets"})]}),e.jsx(P,{variant:"outline",className:"flex-1",onClick:()=>I("all","reset"),disabled:b.isPending,children:s("claudeExtensionPage.resetBothTargets",{defaultValue:"Reset both targets"})})]})]})]})]}),i&&(i.warnings.length>0||i.notes.length>0)?e.jsxs("div",{className:"grid gap-6 xl:grid-cols-2",children:[e.jsxs(x,{className:"border-border/60 bg-card/80",children:[e.jsxs(p,{children:[e.jsx(v,{className:"text-base",children:s("settingsPage.thinkingSection.warnings")}),e.jsx(j,{children:"Operational details that can break the binding even when JSON is correct."})]}),e.jsx(g,{className:"space-y-3",children:i.warnings.length>0?i.warnings.map(a=>e.jsxs("div",{className:"flex items-start gap-3 rounded-lg border border-amber-400/40 bg-amber-50/60 p-3 text-sm dark:bg-amber-950/10",children:[e.jsx(ue,{className:"mt-0.5 h-4 w-4 shrink-0 text-amber-600"}),e.jsx("span",{children:a})]},a)):e.jsx("div",{className:"rounded-lg border bg-muted/20 p-3 text-sm text-muted-foreground",children:"No runtime warnings for this binding."})})]}),e.jsxs(x,{className:"border-border/60 bg-card/80",children:[e.jsxs(p,{children:[e.jsx(v,{className:"text-base",children:s("settingsPage.thinkingSection.notes")}),e.jsx(j,{children:"Short context from CCS about account continuity and host-specific behavior."})]}),e.jsx(g,{className:"space-y-3",children:i.notes.length>0?i.notes.map(a=>e.jsxs("div",{className:"flex items-start gap-3 rounded-lg border bg-muted/30 p-3 text-sm",children:[e.jsx(Ae,{className:"mt-0.5 h-4 w-4 shrink-0 text-muted-foreground"}),e.jsx("span",{children:a})]},a)):e.jsx("div",{className:"rounded-lg border bg-muted/20 p-3 text-sm text-muted-foreground",children:"No extra notes for this binding."})})]})]}):null]}),e.jsx(ce,{value:"advanced",className:"mt-0 space-y-6",children:i?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid gap-6 xl:grid-cols-2",children:[e.jsx(me,{title:s("claudeExtensionPage.sharedSettingsJson",{defaultValue:"Shared Claude settings JSON"}),description:s("claudeExtensionPage.sharedSettingsJsonDescription",{defaultValue:"Managed env block for ~/.claude/settings.json."}),value:i.sharedSettings.json}),e.jsx(me,{title:`${r?.label||"IDE"} settings JSON`,description:s("claudeExtensionPage.ideSettingsJsonDescription",{label:r?.settingsTargetLabel||"settings.json",defaultValue:"Anthropic extension snippet for {{label}}."}),value:i.ideSettings.json})]}),e.jsxs(x,{className:"border-border/60 bg-card/80",children:[e.jsx(p,{children:e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx(v,{className:"text-base",children:s("claudeExtensionPage.resolvedEnvironmentPayload",{defaultValue:"Resolved environment payload"})}),e.jsx(j,{children:s("claudeExtensionPage.resolvedEnvironmentPayloadDescription",{defaultValue:"Exact environment values that the extension receives after CCS expands this profile."})})]}),e.jsx(J,{value:JSON.stringify(i.env,null,2),label:s("claudeExtensionPage.copyEnvironmentPayload",{defaultValue:"Copy environment payload"})})]})}),e.jsx(g,{children:i.env.length>0?e.jsx("pre",{className:"max-h-[420px] overflow-auto rounded-lg border bg-muted/30 p-4 text-xs leading-6",children:JSON.stringify(i.env,null,2)}):e.jsx("div",{className:"rounded-lg border bg-muted/20 p-4 text-sm text-muted-foreground",children:"No env payload. This binding resolves to native Claude defaults."})})]}),e.jsxs("div",{className:"grid gap-6 xl:grid-cols-2",children:[e.jsxs(x,{className:"border-border/60 bg-card/80",children:[e.jsxs(p,{children:[e.jsx(v,{className:"text-base",children:"Shared target metadata"}),e.jsx(j,{children:"Useful when debugging drift or comparing with manual edits."})]}),e.jsxs(g,{className:"space-y-3",children:[e.jsx(o,{label:"Target path",value:u?.sharedSettings.path||i.sharedSettings.path,mono:!0,copyValue:u?.sharedSettings.path||i.sharedSettings.path}),e.jsx(o,{label:"Command",value:i.sharedSettings.command,mono:!0}),e.jsx(o,{label:"Current state",value:u?.sharedSettings.state||"Not verified"})]})]}),e.jsxs(x,{className:"border-border/60 bg-card/80",children:[e.jsxs(p,{children:[e.jsx(v,{className:"text-base",children:"IDE target metadata"}),e.jsx(j,{children:"Current file path plus the extension setting key used for this host."})]}),e.jsxs(g,{className:"space-y-3",children:[e.jsx(o,{label:"Target path",value:u?.ideSettings.path||d.ideSettingsPath.trim()||r?.defaultSettingsPath||i.ideSettings.path,mono:!0,copyValue:u?.ideSettings.path||d.ideSettingsPath.trim()||r?.defaultSettingsPath||i.ideSettings.path}),e.jsx(o,{label:"Settings key",value:r?.settingsKey||"Unknown",mono:!0}),e.jsx(o,{label:"Current state",value:u?.ideSettings.state||"Not verified"})]})]})]})]}):e.jsx(x,{className:"border-border/60 bg-card/80",children:e.jsxs(g,{className:"flex min-h-[240px] items-center justify-center gap-3 text-sm text-muted-foreground",children:[e.jsx(qe,{className:"h-5 w-5"}),"Choose a profile and IDE host to preview the generated payload."]})})})]})]})})})]})}export{ls as ClaudeExtensionPage};