@jonnyhoo/ccs 1.1.1 → 1.1.3

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 (1033) hide show
  1. package/.claude/skills/ccs-delegation/SKILL.md +7 -7
  2. package/.claude/skills/ccs-delegation/references/troubleshooting.md +20 -20
  3. package/config/base-codex.settings.json +3 -3
  4. package/dist/api/services/index.d.ts +1 -1
  5. package/dist/api/services/index.d.ts.map +1 -1
  6. package/dist/api/services/index.js.map +1 -1
  7. package/dist/api/services/profile-reader.d.ts.map +1 -1
  8. package/dist/api/services/profile-reader.js +1 -21
  9. package/dist/api/services/profile-reader.js.map +1 -1
  10. package/dist/api/services/profile-types.d.ts +0 -7
  11. package/dist/api/services/profile-types.d.ts.map +1 -1
  12. package/dist/api/services/profile-writer.d.ts +1 -1
  13. package/dist/api/services/profile-writer.d.ts.map +1 -1
  14. package/dist/api/services/profile-writer.js +14 -11
  15. package/dist/api/services/profile-writer.js.map +1 -1
  16. package/dist/api/services/validation-service.d.ts.map +1 -1
  17. package/dist/api/services/validation-service.js +44 -3
  18. package/dist/api/services/validation-service.js.map +1 -1
  19. package/dist/ccs.js +263 -451
  20. package/dist/ccs.js.map +1 -1
  21. package/dist/commands/api-command.d.ts.map +1 -1
  22. package/dist/commands/api-command.js +22 -21
  23. package/dist/commands/api-command.js.map +1 -1
  24. package/dist/config/index.d.ts +1 -3
  25. package/dist/config/index.d.ts.map +1 -1
  26. package/dist/config/index.js +2 -6
  27. package/dist/config/index.js.map +1 -1
  28. package/dist/config/profile-detector.d.ts +64 -0
  29. package/dist/config/profile-detector.d.ts.map +1 -0
  30. package/dist/config/profile-detector.js +220 -0
  31. package/dist/config/profile-detector.js.map +1 -0
  32. package/dist/config/unified-config-loader.d.ts +3 -96
  33. package/dist/config/unified-config-loader.d.ts.map +1 -1
  34. package/dist/config/unified-config-loader.js +42 -474
  35. package/dist/config/unified-config-loader.js.map +1 -1
  36. package/dist/config/unified-config-types.d.ts +21 -489
  37. package/dist/config/unified-config-types.d.ts.map +1 -1
  38. package/dist/config/unified-config-types.js +8 -172
  39. package/dist/config/unified-config-types.js.map +1 -1
  40. package/dist/delegation/background-monitor.d.ts +80 -0
  41. package/dist/delegation/background-monitor.d.ts.map +1 -0
  42. package/dist/delegation/background-monitor.js +300 -0
  43. package/dist/delegation/background-monitor.js.map +1 -0
  44. package/dist/delegation/delegation-handler.d.ts +2 -1
  45. package/dist/delegation/delegation-handler.d.ts.map +1 -1
  46. package/dist/delegation/delegation-handler.js +48 -30
  47. package/dist/delegation/delegation-handler.js.map +1 -1
  48. package/dist/delegation/executor/types.d.ts +2 -0
  49. package/dist/delegation/executor/types.d.ts.map +1 -1
  50. package/dist/delegation/headless-executor.d.ts +3 -0
  51. package/dist/delegation/headless-executor.d.ts.map +1 -1
  52. package/dist/delegation/headless-executor.js +162 -14
  53. package/dist/delegation/headless-executor.js.map +1 -1
  54. package/dist/delegation/result-formatter.d.ts +1 -29
  55. package/dist/delegation/result-formatter.d.ts.map +1 -1
  56. package/dist/delegation/result-formatter.js +3 -188
  57. package/dist/delegation/result-formatter.js.map +1 -1
  58. package/dist/{cliproxy → proxy}/anthropic-to-openai-proxy.d.ts +17 -1
  59. package/dist/proxy/anthropic-to-openai-proxy.d.ts.map +1 -0
  60. package/dist/proxy/anthropic-to-openai-proxy.js +1708 -0
  61. package/dist/proxy/anthropic-to-openai-proxy.js.map +1 -0
  62. package/dist/proxy/cliproxy-autostart.d.ts +28 -0
  63. package/dist/proxy/cliproxy-autostart.d.ts.map +1 -0
  64. package/dist/proxy/cliproxy-autostart.js +226 -0
  65. package/dist/proxy/cliproxy-autostart.js.map +1 -0
  66. package/dist/proxy/tool-name-mapper.d.ts.map +1 -0
  67. package/dist/{cliproxy → proxy}/tool-name-mapper.js +13 -6
  68. package/dist/proxy/tool-name-mapper.js.map +1 -0
  69. package/dist/{cliproxy → proxy}/tool-name-sanitizer.d.ts +17 -21
  70. package/dist/proxy/tool-name-sanitizer.d.ts.map +1 -0
  71. package/dist/{cliproxy → proxy}/tool-name-sanitizer.js +46 -33
  72. package/dist/proxy/tool-name-sanitizer.js.map +1 -0
  73. package/dist/proxy/tool-sanitization-proxy.d.ts.map +1 -0
  74. package/dist/{cliproxy → proxy}/tool-sanitization-proxy.js +22 -2
  75. package/dist/proxy/tool-sanitization-proxy.js.map +1 -0
  76. package/dist/types/config.d.ts +0 -24
  77. package/dist/types/config.d.ts.map +1 -1
  78. package/dist/types/config.js.map +1 -1
  79. package/dist/types/index.d.ts +1 -2
  80. package/dist/types/index.d.ts.map +1 -1
  81. package/dist/types/index.js.map +1 -1
  82. package/dist/utils/config-manager.d.ts +0 -27
  83. package/dist/utils/config-manager.d.ts.map +1 -1
  84. package/dist/utils/config-manager.js +4 -65
  85. package/dist/utils/config-manager.js.map +1 -1
  86. package/dist/utils/delegation-validator.d.ts.map +1 -1
  87. package/dist/utils/delegation-validator.js +0 -11
  88. package/dist/utils/delegation-validator.js.map +1 -1
  89. package/dist/utils/error-manager.d.ts +0 -28
  90. package/dist/utils/error-manager.d.ts.map +1 -1
  91. package/dist/utils/error-manager.js +6 -105
  92. package/dist/utils/error-manager.js.map +1 -1
  93. package/dist/utils/helpers.js +1 -1
  94. package/dist/utils/helpers.js.map +1 -1
  95. package/dist/utils/index.d.ts +0 -5
  96. package/dist/utils/index.d.ts.map +1 -1
  97. package/dist/utils/index.js +3 -17
  98. package/dist/utils/index.js.map +1 -1
  99. package/dist/utils/shell-executor.d.ts.map +1 -1
  100. package/dist/utils/shell-executor.js +3 -9
  101. package/dist/utils/shell-executor.js.map +1 -1
  102. package/dist/utils/ui/index.d.ts +0 -4
  103. package/dist/utils/ui/index.d.ts.map +1 -1
  104. package/dist/utils/ui/index.js +1 -5
  105. package/dist/utils/ui/index.js.map +1 -1
  106. package/dist/utils/ui/init.d.ts.map +1 -1
  107. package/dist/utils/ui/init.js +1 -3
  108. package/dist/utils/ui/init.js.map +1 -1
  109. package/dist/utils/ui.d.ts +1 -2
  110. package/dist/utils/ui.d.ts.map +1 -1
  111. package/dist/utils/ui.js +2 -2
  112. package/dist/utils/ui.js.map +1 -1
  113. package/package.json +3 -29
  114. package/scripts/background-redis-bridge.js +320 -0
  115. package/scripts/dev-install.sh +2 -1
  116. package/scripts/monitor-task.js +313 -0
  117. package/dist/auth/auth-commands.d.ts +0 -62
  118. package/dist/auth/auth-commands.d.ts.map +0 -1
  119. package/dist/auth/auth-commands.js +0 -191
  120. package/dist/auth/auth-commands.js.map +0 -1
  121. package/dist/auth/commands/create-command.d.ts +0 -11
  122. package/dist/auth/commands/create-command.d.ts.map +0 -1
  123. package/dist/auth/commands/create-command.js +0 -137
  124. package/dist/auth/commands/create-command.js.map +0 -1
  125. package/dist/auth/commands/default-command.d.ts +0 -15
  126. package/dist/auth/commands/default-command.d.ts.map +0 -1
  127. package/dist/auth/commands/default-command.js +0 -71
  128. package/dist/auth/commands/default-command.js.map +0 -1
  129. package/dist/auth/commands/index.d.ts +0 -12
  130. package/dist/auth/commands/index.d.ts.map +0 -1
  131. package/dist/auth/commands/index.js +0 -25
  132. package/dist/auth/commands/index.js.map +0 -1
  133. package/dist/auth/commands/list-command.d.ts +0 -11
  134. package/dist/auth/commands/list-command.d.ts.map +0 -1
  135. package/dist/auth/commands/list-command.js +0 -124
  136. package/dist/auth/commands/list-command.js.map +0 -1
  137. package/dist/auth/commands/remove-command.d.ts +0 -11
  138. package/dist/auth/commands/remove-command.d.ts.map +0 -1
  139. package/dist/auth/commands/remove-command.js +0 -102
  140. package/dist/auth/commands/remove-command.js.map +0 -1
  141. package/dist/auth/commands/show-command.d.ts +0 -11
  142. package/dist/auth/commands/show-command.d.ts.map +0 -1
  143. package/dist/auth/commands/show-command.js +0 -103
  144. package/dist/auth/commands/show-command.js.map +0 -1
  145. package/dist/auth/commands/types.d.ts +0 -50
  146. package/dist/auth/commands/types.d.ts.map +0 -1
  147. package/dist/auth/commands/types.js +0 -26
  148. package/dist/auth/commands/types.js.map +0 -1
  149. package/dist/auth/index.d.ts +0 -8
  150. package/dist/auth/index.d.ts.map +0 -1
  151. package/dist/auth/index.js +0 -16
  152. package/dist/auth/index.js.map +0 -1
  153. package/dist/auth/profile-detector.d.ts +0 -106
  154. package/dist/auth/profile-detector.d.ts.map +0 -1
  155. package/dist/auth/profile-detector.js +0 -431
  156. package/dist/auth/profile-detector.js.map +0 -1
  157. package/dist/auth/profile-registry.d.ts +0 -110
  158. package/dist/auth/profile-registry.d.ts.map +0 -1
  159. package/dist/auth/profile-registry.js +0 -318
  160. package/dist/auth/profile-registry.js.map +0 -1
  161. package/dist/cliproxy/account-manager.d.ts +0 -218
  162. package/dist/cliproxy/account-manager.d.ts.map +0 -1
  163. package/dist/cliproxy/account-manager.js +0 -808
  164. package/dist/cliproxy/account-manager.js.map +0 -1
  165. package/dist/cliproxy/anthropic-to-openai-proxy.d.ts.map +0 -1
  166. package/dist/cliproxy/anthropic-to-openai-proxy.js +0 -856
  167. package/dist/cliproxy/anthropic-to-openai-proxy.js.map +0 -1
  168. package/dist/cliproxy/auth/auth-types.d.ts +0 -106
  169. package/dist/cliproxy/auth/auth-types.d.ts.map +0 -1
  170. package/dist/cliproxy/auth/auth-types.js +0 -164
  171. package/dist/cliproxy/auth/auth-types.js.map +0 -1
  172. package/dist/cliproxy/auth/environment-detector.d.ts +0 -30
  173. package/dist/cliproxy/auth/environment-detector.d.ts.map +0 -1
  174. package/dist/cliproxy/auth/environment-detector.js +0 -129
  175. package/dist/cliproxy/auth/environment-detector.js.map +0 -1
  176. package/dist/cliproxy/auth/gemini-token-refresh.d.ts +0 -38
  177. package/dist/cliproxy/auth/gemini-token-refresh.d.ts.map +0 -1
  178. package/dist/cliproxy/auth/gemini-token-refresh.js +0 -327
  179. package/dist/cliproxy/auth/gemini-token-refresh.js.map +0 -1
  180. package/dist/cliproxy/auth/index.d.ts +0 -11
  181. package/dist/cliproxy/auth/index.d.ts.map +0 -1
  182. package/dist/cliproxy/auth/index.js +0 -35
  183. package/dist/cliproxy/auth/index.js.map +0 -1
  184. package/dist/cliproxy/auth/kiro-import.d.ts +0 -23
  185. package/dist/cliproxy/auth/kiro-import.d.ts.map +0 -1
  186. package/dist/cliproxy/auth/kiro-import.js +0 -140
  187. package/dist/cliproxy/auth/kiro-import.js.map +0 -1
  188. package/dist/cliproxy/auth/oauth-handler.d.ts +0 -31
  189. package/dist/cliproxy/auth/oauth-handler.d.ts.map +0 -1
  190. package/dist/cliproxy/auth/oauth-handler.js +0 -422
  191. package/dist/cliproxy/auth/oauth-handler.js.map +0 -1
  192. package/dist/cliproxy/auth/oauth-process.d.ts +0 -27
  193. package/dist/cliproxy/auth/oauth-process.d.ts.map +0 -1
  194. package/dist/cliproxy/auth/oauth-process.js +0 -386
  195. package/dist/cliproxy/auth/oauth-process.js.map +0 -1
  196. package/dist/cliproxy/auth/provider-refreshers/index.d.ts +0 -21
  197. package/dist/cliproxy/auth/provider-refreshers/index.d.ts.map +0 -1
  198. package/dist/cliproxy/auth/provider-refreshers/index.js +0 -57
  199. package/dist/cliproxy/auth/provider-refreshers/index.js.map +0 -1
  200. package/dist/cliproxy/auth/token-expiry-checker.d.ts +0 -37
  201. package/dist/cliproxy/auth/token-expiry-checker.d.ts.map +0 -1
  202. package/dist/cliproxy/auth/token-expiry-checker.js +0 -115
  203. package/dist/cliproxy/auth/token-expiry-checker.js.map +0 -1
  204. package/dist/cliproxy/auth/token-manager.d.ts +0 -66
  205. package/dist/cliproxy/auth/token-manager.d.ts.map +0 -1
  206. package/dist/cliproxy/auth/token-manager.js +0 -309
  207. package/dist/cliproxy/auth/token-manager.js.map +0 -1
  208. package/dist/cliproxy/auth/token-refresh-config.d.ts +0 -13
  209. package/dist/cliproxy/auth/token-refresh-config.d.ts.map +0 -1
  210. package/dist/cliproxy/auth/token-refresh-config.js +0 -31
  211. package/dist/cliproxy/auth/token-refresh-config.js.map +0 -1
  212. package/dist/cliproxy/auth/token-refresh-worker.d.ts +0 -83
  213. package/dist/cliproxy/auth/token-refresh-worker.d.ts.map +0 -1
  214. package/dist/cliproxy/auth/token-refresh-worker.js +0 -214
  215. package/dist/cliproxy/auth/token-refresh-worker.js.map +0 -1
  216. package/dist/cliproxy/auth-handler.d.ts +0 -31
  217. package/dist/cliproxy/auth-handler.d.ts.map +0 -1
  218. package/dist/cliproxy/auth-handler.js +0 -60
  219. package/dist/cliproxy/auth-handler.js.map +0 -1
  220. package/dist/cliproxy/auth-session-manager.d.ts +0 -51
  221. package/dist/cliproxy/auth-session-manager.d.ts.map +0 -1
  222. package/dist/cliproxy/auth-session-manager.js +0 -134
  223. package/dist/cliproxy/auth-session-manager.js.map +0 -1
  224. package/dist/cliproxy/auth-token-manager.d.ts +0 -82
  225. package/dist/cliproxy/auth-token-manager.d.ts.map +0 -1
  226. package/dist/cliproxy/auth-token-manager.js +0 -187
  227. package/dist/cliproxy/auth-token-manager.js.map +0 -1
  228. package/dist/cliproxy/auth-utils.d.ts +0 -16
  229. package/dist/cliproxy/auth-utils.d.ts.map +0 -1
  230. package/dist/cliproxy/auth-utils.js +0 -33
  231. package/dist/cliproxy/auth-utils.js.map +0 -1
  232. package/dist/cliproxy/base-config-loader.d.ts +0 -42
  233. package/dist/cliproxy/base-config-loader.d.ts.map +0 -1
  234. package/dist/cliproxy/base-config-loader.js +0 -123
  235. package/dist/cliproxy/base-config-loader.js.map +0 -1
  236. package/dist/cliproxy/binary/downloader.d.ts +0 -42
  237. package/dist/cliproxy/binary/downloader.d.ts.map +0 -1
  238. package/dist/cliproxy/binary/downloader.js +0 -407
  239. package/dist/cliproxy/binary/downloader.js.map +0 -1
  240. package/dist/cliproxy/binary/extractor.d.ts +0 -12
  241. package/dist/cliproxy/binary/extractor.d.ts.map +0 -1
  242. package/dist/cliproxy/binary/extractor.js +0 -28
  243. package/dist/cliproxy/binary/extractor.js.map +0 -1
  244. package/dist/cliproxy/binary/index.d.ts +0 -13
  245. package/dist/cliproxy/binary/index.d.ts.map +0 -1
  246. package/dist/cliproxy/binary/index.js +0 -54
  247. package/dist/cliproxy/binary/index.js.map +0 -1
  248. package/dist/cliproxy/binary/installer.d.ts +0 -25
  249. package/dist/cliproxy/binary/installer.d.ts.map +0 -1
  250. package/dist/cliproxy/binary/installer.js +0 -129
  251. package/dist/cliproxy/binary/installer.js.map +0 -1
  252. package/dist/cliproxy/binary/lifecycle.d.ts +0 -11
  253. package/dist/cliproxy/binary/lifecycle.d.ts.map +0 -1
  254. package/dist/cliproxy/binary/lifecycle.js +0 -150
  255. package/dist/cliproxy/binary/lifecycle.js.map +0 -1
  256. package/dist/cliproxy/binary/tar-extractor.d.ts +0 -10
  257. package/dist/cliproxy/binary/tar-extractor.d.ts.map +0 -1
  258. package/dist/cliproxy/binary/tar-extractor.js +0 -118
  259. package/dist/cliproxy/binary/tar-extractor.js.map +0 -1
  260. package/dist/cliproxy/binary/types.d.ts +0 -49
  261. package/dist/cliproxy/binary/types.d.ts.map +0 -1
  262. package/dist/cliproxy/binary/types.js +0 -32
  263. package/dist/cliproxy/binary/types.js.map +0 -1
  264. package/dist/cliproxy/binary/updater.d.ts +0 -7
  265. package/dist/cliproxy/binary/updater.d.ts.map +0 -1
  266. package/dist/cliproxy/binary/updater.js +0 -18
  267. package/dist/cliproxy/binary/updater.js.map +0 -1
  268. package/dist/cliproxy/binary/verifier.d.ts +0 -18
  269. package/dist/cliproxy/binary/verifier.d.ts.map +0 -1
  270. package/dist/cliproxy/binary/verifier.js +0 -82
  271. package/dist/cliproxy/binary/verifier.js.map +0 -1
  272. package/dist/cliproxy/binary/version-cache.d.ts +0 -64
  273. package/dist/cliproxy/binary/version-cache.d.ts.map +0 -1
  274. package/dist/cliproxy/binary/version-cache.js +0 -239
  275. package/dist/cliproxy/binary/version-cache.js.map +0 -1
  276. package/dist/cliproxy/binary/version-checker.d.ts +0 -36
  277. package/dist/cliproxy/binary/version-checker.d.ts.map +0 -1
  278. package/dist/cliproxy/binary/version-checker.js +0 -135
  279. package/dist/cliproxy/binary/version-checker.js.map +0 -1
  280. package/dist/cliproxy/binary/zip-extractor.d.ts +0 -10
  281. package/dist/cliproxy/binary/zip-extractor.d.ts.map +0 -1
  282. package/dist/cliproxy/binary/zip-extractor.js +0 -110
  283. package/dist/cliproxy/binary/zip-extractor.js.map +0 -1
  284. package/dist/cliproxy/binary-manager.d.ts +0 -59
  285. package/dist/cliproxy/binary-manager.d.ts.map +0 -1
  286. package/dist/cliproxy/binary-manager.js +0 -211
  287. package/dist/cliproxy/binary-manager.js.map +0 -1
  288. package/dist/cliproxy/cliproxy-executor.d.ts +0 -33
  289. package/dist/cliproxy/cliproxy-executor.d.ts.map +0 -1
  290. package/dist/cliproxy/cliproxy-executor.js +0 -1228
  291. package/dist/cliproxy/cliproxy-executor.js.map +0 -1
  292. package/dist/cliproxy/codex-reasoning-proxy.d.ts +0 -54
  293. package/dist/cliproxy/codex-reasoning-proxy.d.ts.map +0 -1
  294. package/dist/cliproxy/codex-reasoning-proxy.js +0 -373
  295. package/dist/cliproxy/codex-reasoning-proxy.js.map +0 -1
  296. package/dist/cliproxy/config-generator.d.ts +0 -236
  297. package/dist/cliproxy/config-generator.d.ts.map +0 -1
  298. package/dist/cliproxy/config-generator.js +0 -932
  299. package/dist/cliproxy/config-generator.js.map +0 -1
  300. package/dist/cliproxy/device-code-handler.d.ts +0 -28
  301. package/dist/cliproxy/device-code-handler.d.ts.map +0 -1
  302. package/dist/cliproxy/device-code-handler.js +0 -22
  303. package/dist/cliproxy/device-code-handler.js.map +0 -1
  304. package/dist/cliproxy/endpoint-setup.d.ts +0 -44
  305. package/dist/cliproxy/endpoint-setup.d.ts.map +0 -1
  306. package/dist/cliproxy/endpoint-setup.js +0 -299
  307. package/dist/cliproxy/endpoint-setup.js.map +0 -1
  308. package/dist/cliproxy/https-tunnel-proxy.d.ts +0 -44
  309. package/dist/cliproxy/https-tunnel-proxy.d.ts.map +0 -1
  310. package/dist/cliproxy/https-tunnel-proxy.js +0 -224
  311. package/dist/cliproxy/https-tunnel-proxy.js.map +0 -1
  312. package/dist/cliproxy/index.d.ts +0 -41
  313. package/dist/cliproxy/index.d.ts.map +0 -1
  314. package/dist/cliproxy/index.js +0 -152
  315. package/dist/cliproxy/index.js.map +0 -1
  316. package/dist/cliproxy/management-api-client.d.ts +0 -67
  317. package/dist/cliproxy/management-api-client.d.ts.map +0 -1
  318. package/dist/cliproxy/management-api-client.js +0 -347
  319. package/dist/cliproxy/management-api-client.js.map +0 -1
  320. package/dist/cliproxy/management-api-types.d.ts +0 -107
  321. package/dist/cliproxy/management-api-types.d.ts.map +0 -1
  322. package/dist/cliproxy/management-api-types.js +0 -9
  323. package/dist/cliproxy/management-api-types.js.map +0 -1
  324. package/dist/cliproxy/model-catalog.d.ts +0 -108
  325. package/dist/cliproxy/model-catalog.d.ts.map +0 -1
  326. package/dist/cliproxy/model-catalog.js +0 -247
  327. package/dist/cliproxy/model-catalog.js.map +0 -1
  328. package/dist/cliproxy/model-config.d.ts +0 -31
  329. package/dist/cliproxy/model-config.d.ts.map +0 -1
  330. package/dist/cliproxy/model-config.js +0 -250
  331. package/dist/cliproxy/model-config.js.map +0 -1
  332. package/dist/cliproxy/openai-compat-manager.d.ts +0 -46
  333. package/dist/cliproxy/openai-compat-manager.d.ts.map +0 -1
  334. package/dist/cliproxy/openai-compat-manager.js +0 -191
  335. package/dist/cliproxy/openai-compat-manager.js.map +0 -1
  336. package/dist/cliproxy/platform-detector.d.ts +0 -99
  337. package/dist/cliproxy/platform-detector.d.ts.map +0 -1
  338. package/dist/cliproxy/platform-detector.js +0 -174
  339. package/dist/cliproxy/platform-detector.js.map +0 -1
  340. package/dist/cliproxy/project-selection-handler.d.ts +0 -105
  341. package/dist/cliproxy/project-selection-handler.d.ts.map +0 -1
  342. package/dist/cliproxy/project-selection-handler.js +0 -167
  343. package/dist/cliproxy/project-selection-handler.js.map +0 -1
  344. package/dist/cliproxy/proxy-config-resolver.d.ts +0 -86
  345. package/dist/cliproxy/proxy-config-resolver.d.ts.map +0 -1
  346. package/dist/cliproxy/proxy-config-resolver.js +0 -253
  347. package/dist/cliproxy/proxy-config-resolver.js.map +0 -1
  348. package/dist/cliproxy/proxy-detector.d.ts +0 -72
  349. package/dist/cliproxy/proxy-detector.d.ts.map +0 -1
  350. package/dist/cliproxy/proxy-detector.js +0 -196
  351. package/dist/cliproxy/proxy-detector.js.map +0 -1
  352. package/dist/cliproxy/proxy-target-resolver.d.ts +0 -50
  353. package/dist/cliproxy/proxy-target-resolver.d.ts.map +0 -1
  354. package/dist/cliproxy/proxy-target-resolver.js +0 -105
  355. package/dist/cliproxy/proxy-target-resolver.js.map +0 -1
  356. package/dist/cliproxy/quota-fetcher-codex.d.ts +0 -66
  357. package/dist/cliproxy/quota-fetcher-codex.d.ts.map +0 -1
  358. package/dist/cliproxy/quota-fetcher-codex.js +0 -315
  359. package/dist/cliproxy/quota-fetcher-codex.js.map +0 -1
  360. package/dist/cliproxy/quota-fetcher-gemini-cli.d.ts +0 -51
  361. package/dist/cliproxy/quota-fetcher-gemini-cli.d.ts.map +0 -1
  362. package/dist/cliproxy/quota-fetcher-gemini-cli.js +0 -492
  363. package/dist/cliproxy/quota-fetcher-gemini-cli.js.map +0 -1
  364. package/dist/cliproxy/quota-fetcher.d.ts +0 -95
  365. package/dist/cliproxy/quota-fetcher.d.ts.map +0 -1
  366. package/dist/cliproxy/quota-fetcher.js +0 -589
  367. package/dist/cliproxy/quota-fetcher.js.map +0 -1
  368. package/dist/cliproxy/quota-manager.d.ts +0 -88
  369. package/dist/cliproxy/quota-manager.d.ts.map +0 -1
  370. package/dist/cliproxy/quota-manager.js +0 -278
  371. package/dist/cliproxy/quota-manager.js.map +0 -1
  372. package/dist/cliproxy/quota-response-cache.d.ts +0 -46
  373. package/dist/cliproxy/quota-response-cache.d.ts.map +0 -1
  374. package/dist/cliproxy/quota-response-cache.js +0 -98
  375. package/dist/cliproxy/quota-response-cache.js.map +0 -1
  376. package/dist/cliproxy/quota-types.d.ts +0 -84
  377. package/dist/cliproxy/quota-types.d.ts.map +0 -1
  378. package/dist/cliproxy/quota-types.js +0 -9
  379. package/dist/cliproxy/quota-types.js.map +0 -1
  380. package/dist/cliproxy/remote-auth-fetcher.d.ts +0 -28
  381. package/dist/cliproxy/remote-auth-fetcher.d.ts.map +0 -1
  382. package/dist/cliproxy/remote-auth-fetcher.js +0 -117
  383. package/dist/cliproxy/remote-auth-fetcher.js.map +0 -1
  384. package/dist/cliproxy/remote-proxy-client.d.ts +0 -59
  385. package/dist/cliproxy/remote-proxy-client.d.ts.map +0 -1
  386. package/dist/cliproxy/remote-proxy-client.js +0 -278
  387. package/dist/cliproxy/remote-proxy-client.js.map +0 -1
  388. package/dist/cliproxy/remote-token-uploader.d.ts +0 -28
  389. package/dist/cliproxy/remote-token-uploader.d.ts.map +0 -1
  390. package/dist/cliproxy/remote-token-uploader.js +0 -178
  391. package/dist/cliproxy/remote-token-uploader.js.map +0 -1
  392. package/dist/cliproxy/service-manager.d.ts +0 -55
  393. package/dist/cliproxy/service-manager.d.ts.map +0 -1
  394. package/dist/cliproxy/service-manager.js +0 -327
  395. package/dist/cliproxy/service-manager.js.map +0 -1
  396. package/dist/cliproxy/services/binary-service.d.ts +0 -67
  397. package/dist/cliproxy/services/binary-service.d.ts.map +0 -1
  398. package/dist/cliproxy/services/binary-service.js +0 -176
  399. package/dist/cliproxy/services/binary-service.js.map +0 -1
  400. package/dist/cliproxy/services/index.d.ts +0 -8
  401. package/dist/cliproxy/services/index.d.ts.map +0 -1
  402. package/dist/cliproxy/services/index.js +0 -31
  403. package/dist/cliproxy/services/index.js.map +0 -1
  404. package/dist/cliproxy/services/proxy-lifecycle-service.d.ts +0 -38
  405. package/dist/cliproxy/services/proxy-lifecycle-service.d.ts.map +0 -1
  406. package/dist/cliproxy/services/proxy-lifecycle-service.js +0 -41
  407. package/dist/cliproxy/services/proxy-lifecycle-service.js.map +0 -1
  408. package/dist/cliproxy/services/variant-config-adapter.d.ts +0 -48
  409. package/dist/cliproxy/services/variant-config-adapter.d.ts.map +0 -1
  410. package/dist/cliproxy/services/variant-config-adapter.js +0 -215
  411. package/dist/cliproxy/services/variant-config-adapter.js.map +0 -1
  412. package/dist/cliproxy/services/variant-service.d.ts +0 -52
  413. package/dist/cliproxy/services/variant-service.d.ts.map +0 -1
  414. package/dist/cliproxy/services/variant-service.js +0 -218
  415. package/dist/cliproxy/services/variant-service.js.map +0 -1
  416. package/dist/cliproxy/services/variant-settings.d.ts +0 -37
  417. package/dist/cliproxy/services/variant-settings.d.ts.map +0 -1
  418. package/dist/cliproxy/services/variant-settings.js +0 -168
  419. package/dist/cliproxy/services/variant-settings.js.map +0 -1
  420. package/dist/cliproxy/session-tracker.d.ts +0 -100
  421. package/dist/cliproxy/session-tracker.d.ts.map +0 -1
  422. package/dist/cliproxy/session-tracker.js +0 -420
  423. package/dist/cliproxy/session-tracker.js.map +0 -1
  424. package/dist/cliproxy/startup-lock.d.ts +0 -57
  425. package/dist/cliproxy/startup-lock.d.ts.map +0 -1
  426. package/dist/cliproxy/startup-lock.js +0 -216
  427. package/dist/cliproxy/startup-lock.js.map +0 -1
  428. package/dist/cliproxy/stats-fetcher.d.ts +0 -106
  429. package/dist/cliproxy/stats-fetcher.d.ts.map +0 -1
  430. package/dist/cliproxy/stats-fetcher.js +0 -267
  431. package/dist/cliproxy/stats-fetcher.js.map +0 -1
  432. package/dist/cliproxy/sync/auto-sync-watcher.d.ts +0 -37
  433. package/dist/cliproxy/sync/auto-sync-watcher.d.ts.map +0 -1
  434. package/dist/cliproxy/sync/auto-sync-watcher.js +0 -211
  435. package/dist/cliproxy/sync/auto-sync-watcher.js.map +0 -1
  436. package/dist/cliproxy/sync/index.d.ts +0 -10
  437. package/dist/cliproxy/sync/index.d.ts.map +0 -1
  438. package/dist/cliproxy/sync/index.js +0 -27
  439. package/dist/cliproxy/sync/index.js.map +0 -1
  440. package/dist/cliproxy/sync/local-config-sync.d.ts +0 -28
  441. package/dist/cliproxy/sync/local-config-sync.d.ts.map +0 -1
  442. package/dist/cliproxy/sync/local-config-sync.js +0 -223
  443. package/dist/cliproxy/sync/local-config-sync.js.map +0 -1
  444. package/dist/cliproxy/sync/profile-mapper.d.ts +0 -55
  445. package/dist/cliproxy/sync/profile-mapper.d.ts.map +0 -1
  446. package/dist/cliproxy/sync/profile-mapper.js +0 -173
  447. package/dist/cliproxy/sync/profile-mapper.js.map +0 -1
  448. package/dist/cliproxy/thinking-validator.d.ts +0 -67
  449. package/dist/cliproxy/thinking-validator.d.ts.map +0 -1
  450. package/dist/cliproxy/thinking-validator.js +0 -327
  451. package/dist/cliproxy/thinking-validator.js.map +0 -1
  452. package/dist/cliproxy/tool-name-mapper.d.ts.map +0 -1
  453. package/dist/cliproxy/tool-name-mapper.js.map +0 -1
  454. package/dist/cliproxy/tool-name-sanitizer.d.ts.map +0 -1
  455. package/dist/cliproxy/tool-name-sanitizer.js.map +0 -1
  456. package/dist/cliproxy/tool-sanitization-proxy.d.ts.map +0 -1
  457. package/dist/cliproxy/tool-sanitization-proxy.js.map +0 -1
  458. package/dist/cliproxy/types.d.ts +0 -218
  459. package/dist/cliproxy/types.d.ts.map +0 -1
  460. package/dist/cliproxy/types.js +0 -12
  461. package/dist/cliproxy/types.js.map +0 -1
  462. package/dist/commands/cleanup-command.d.ts +0 -12
  463. package/dist/commands/cleanup-command.d.ts.map +0 -1
  464. package/dist/commands/cleanup-command.js +0 -350
  465. package/dist/commands/cleanup-command.js.map +0 -1
  466. package/dist/commands/cliproxy-command.d.ts +0 -21
  467. package/dist/commands/cliproxy-command.d.ts.map +0 -1
  468. package/dist/commands/cliproxy-command.js +0 -1099
  469. package/dist/commands/cliproxy-command.js.map +0 -1
  470. package/dist/commands/cliproxy-sync-handler.d.ts +0 -19
  471. package/dist/commands/cliproxy-sync-handler.d.ts.map +0 -1
  472. package/dist/commands/cliproxy-sync-handler.js +0 -99
  473. package/dist/commands/cliproxy-sync-handler.js.map +0 -1
  474. package/dist/commands/config-auth/disable-command.d.ts +0 -10
  475. package/dist/commands/config-auth/disable-command.d.ts.map +0 -1
  476. package/dist/commands/config-auth/disable-command.js +0 -64
  477. package/dist/commands/config-auth/disable-command.js.map +0 -1
  478. package/dist/commands/config-auth/index.d.ts +0 -14
  479. package/dist/commands/config-auth/index.d.ts.map +0 -1
  480. package/dist/commands/config-auth/index.js +0 -84
  481. package/dist/commands/config-auth/index.js.map +0 -1
  482. package/dist/commands/config-auth/setup-command.d.ts +0 -13
  483. package/dist/commands/config-auth/setup-command.d.ts.map +0 -1
  484. package/dist/commands/config-auth/setup-command.js +0 -121
  485. package/dist/commands/config-auth/setup-command.js.map +0 -1
  486. package/dist/commands/config-auth/show-command.d.ts +0 -10
  487. package/dist/commands/config-auth/show-command.d.ts.map +0 -1
  488. package/dist/commands/config-auth/show-command.js +0 -79
  489. package/dist/commands/config-auth/show-command.js.map +0 -1
  490. package/dist/commands/config-auth/types.d.ts +0 -25
  491. package/dist/commands/config-auth/types.d.ts.map +0 -1
  492. package/dist/commands/config-auth/types.js +0 -8
  493. package/dist/commands/config-auth/types.js.map +0 -1
  494. package/dist/commands/config-command.d.ts +0 -12
  495. package/dist/commands/config-command.d.ts.map +0 -1
  496. package/dist/commands/config-command.js +0 -184
  497. package/dist/commands/config-command.js.map +0 -1
  498. package/dist/commands/config-image-analysis-command.d.ts +0 -8
  499. package/dist/commands/config-image-analysis-command.d.ts.map +0 -1
  500. package/dist/commands/config-image-analysis-command.js +0 -174
  501. package/dist/commands/config-image-analysis-command.js.map +0 -1
  502. package/dist/commands/copilot-command.d.ts +0 -10
  503. package/dist/commands/copilot-command.d.ts.map +0 -1
  504. package/dist/commands/copilot-command.js +0 -228
  505. package/dist/commands/copilot-command.js.map +0 -1
  506. package/dist/commands/doctor-command.d.ts +0 -11
  507. package/dist/commands/doctor-command.d.ts.map +0 -1
  508. package/dist/commands/doctor-command.js +0 -92
  509. package/dist/commands/doctor-command.js.map +0 -1
  510. package/dist/commands/help-command.d.ts +0 -5
  511. package/dist/commands/help-command.d.ts.map +0 -1
  512. package/dist/commands/help-command.js +0 -359
  513. package/dist/commands/help-command.js.map +0 -1
  514. package/dist/commands/index.d.ts +0 -18
  515. package/dist/commands/index.d.ts.map +0 -1
  516. package/dist/commands/index.js +0 -35
  517. package/dist/commands/index.js.map +0 -1
  518. package/dist/commands/install-command.d.ts +0 -14
  519. package/dist/commands/install-command.d.ts.map +0 -1
  520. package/dist/commands/install-command.js +0 -62
  521. package/dist/commands/install-command.js.map +0 -1
  522. package/dist/commands/migrate-command.d.ts +0 -17
  523. package/dist/commands/migrate-command.d.ts.map +0 -1
  524. package/dist/commands/migrate-command.js +0 -139
  525. package/dist/commands/migrate-command.js.map +0 -1
  526. package/dist/commands/persist-command.d.ts +0 -12
  527. package/dist/commands/persist-command.d.ts.map +0 -1
  528. package/dist/commands/persist-command.js +0 -565
  529. package/dist/commands/persist-command.js.map +0 -1
  530. package/dist/commands/router.d.ts +0 -41
  531. package/dist/commands/router.d.ts.map +0 -1
  532. package/dist/commands/router.js +0 -234
  533. package/dist/commands/router.js.map +0 -1
  534. package/dist/commands/setup-command.d.ts +0 -29
  535. package/dist/commands/setup-command.d.ts.map +0 -1
  536. package/dist/commands/setup-command.js +0 -426
  537. package/dist/commands/setup-command.js.map +0 -1
  538. package/dist/commands/shell-completion-command.d.ts +0 -10
  539. package/dist/commands/shell-completion-command.d.ts.map +0 -1
  540. package/dist/commands/shell-completion-command.js +0 -90
  541. package/dist/commands/shell-completion-command.js.map +0 -1
  542. package/dist/commands/sync-command.d.ts +0 -10
  543. package/dist/commands/sync-command.d.ts.map +0 -1
  544. package/dist/commands/sync-command.js +0 -67
  545. package/dist/commands/sync-command.js.map +0 -1
  546. package/dist/commands/tokens-command.d.ts +0 -19
  547. package/dist/commands/tokens-command.d.ts.map +0 -1
  548. package/dist/commands/tokens-command.js +0 -173
  549. package/dist/commands/tokens-command.js.map +0 -1
  550. package/dist/commands/update-command.d.ts +0 -19
  551. package/dist/commands/update-command.d.ts.map +0 -1
  552. package/dist/commands/update-command.js +0 -290
  553. package/dist/commands/update-command.js.map +0 -1
  554. package/dist/commands/version-command.d.ts +0 -10
  555. package/dist/commands/version-command.d.ts.map +0 -1
  556. package/dist/commands/version-command.js +0 -100
  557. package/dist/commands/version-command.js.map +0 -1
  558. package/dist/config/feature-flags.d.ts +0 -19
  559. package/dist/config/feature-flags.d.ts.map +0 -1
  560. package/dist/config/feature-flags.js +0 -31
  561. package/dist/config/feature-flags.js.map +0 -1
  562. package/dist/config/migration-manager.d.ts +0 -75
  563. package/dist/config/migration-manager.d.ts.map +0 -1
  564. package/dist/config/migration-manager.js +0 -446
  565. package/dist/config/migration-manager.js.map +0 -1
  566. package/dist/config/reserved-names.d.ts +0 -31
  567. package/dist/config/reserved-names.d.ts.map +0 -1
  568. package/dist/config/reserved-names.js +0 -80
  569. package/dist/config/reserved-names.js.map +0 -1
  570. package/dist/copilot/copilot-auth.d.ts +0 -52
  571. package/dist/copilot/copilot-auth.d.ts.map +0 -1
  572. package/dist/copilot/copilot-auth.js +0 -201
  573. package/dist/copilot/copilot-auth.js.map +0 -1
  574. package/dist/copilot/copilot-daemon.d.ts +0 -36
  575. package/dist/copilot/copilot-daemon.d.ts.map +0 -1
  576. package/dist/copilot/copilot-daemon.js +0 -237
  577. package/dist/copilot/copilot-daemon.js.map +0 -1
  578. package/dist/copilot/copilot-executor.d.ts +0 -26
  579. package/dist/copilot/copilot-executor.d.ts.map +0 -1
  580. package/dist/copilot/copilot-executor.js +0 -150
  581. package/dist/copilot/copilot-executor.js.map +0 -1
  582. package/dist/copilot/copilot-models.d.ts +0 -34
  583. package/dist/copilot/copilot-models.d.ts.map +0 -1
  584. package/dist/copilot/copilot-models.js +0 -261
  585. package/dist/copilot/copilot-models.js.map +0 -1
  586. package/dist/copilot/copilot-package-manager.d.ts +0 -93
  587. package/dist/copilot/copilot-package-manager.d.ts.map +0 -1
  588. package/dist/copilot/copilot-package-manager.js +0 -488
  589. package/dist/copilot/copilot-package-manager.js.map +0 -1
  590. package/dist/copilot/index.d.ts +0 -13
  591. package/dist/copilot/index.d.ts.map +0 -1
  592. package/dist/copilot/index.js +0 -63
  593. package/dist/copilot/index.js.map +0 -1
  594. package/dist/copilot/types.d.ts +0 -65
  595. package/dist/copilot/types.d.ts.map +0 -1
  596. package/dist/copilot/types.js +0 -8
  597. package/dist/copilot/types.js.map +0 -1
  598. package/dist/management/checks/cliproxy-check.d.ts +0 -37
  599. package/dist/management/checks/cliproxy-check.d.ts.map +0 -1
  600. package/dist/management/checks/cliproxy-check.js +0 -187
  601. package/dist/management/checks/cliproxy-check.js.map +0 -1
  602. package/dist/management/checks/config-check.d.ts +0 -38
  603. package/dist/management/checks/config-check.d.ts.map +0 -1
  604. package/dist/management/checks/config-check.js +0 -215
  605. package/dist/management/checks/config-check.js.map +0 -1
  606. package/dist/management/checks/env-check.d.ts +0 -17
  607. package/dist/management/checks/env-check.d.ts.map +0 -1
  608. package/dist/management/checks/env-check.js +0 -71
  609. package/dist/management/checks/env-check.js.map +0 -1
  610. package/dist/management/checks/image-analysis-check.d.ts +0 -16
  611. package/dist/management/checks/image-analysis-check.d.ts.map +0 -1
  612. package/dist/management/checks/image-analysis-check.js +0 -140
  613. package/dist/management/checks/image-analysis-check.js.map +0 -1
  614. package/dist/management/checks/index.d.ts +0 -13
  615. package/dist/management/checks/index.d.ts.map +0 -1
  616. package/dist/management/checks/index.js +0 -52
  617. package/dist/management/checks/index.js.map +0 -1
  618. package/dist/management/checks/oauth-check.d.ts +0 -16
  619. package/dist/management/checks/oauth-check.d.ts.map +0 -1
  620. package/dist/management/checks/oauth-check.js +0 -68
  621. package/dist/management/checks/oauth-check.js.map +0 -1
  622. package/dist/management/checks/profile-check.d.ts +0 -40
  623. package/dist/management/checks/profile-check.d.ts.map +0 -1
  624. package/dist/management/checks/profile-check.js +0 -190
  625. package/dist/management/checks/profile-check.js.map +0 -1
  626. package/dist/management/checks/symlink-check.d.ts +0 -30
  627. package/dist/management/checks/symlink-check.d.ts.map +0 -1
  628. package/dist/management/checks/symlink-check.js +0 -214
  629. package/dist/management/checks/symlink-check.js.map +0 -1
  630. package/dist/management/checks/system-check.d.ts +0 -25
  631. package/dist/management/checks/system-check.d.ts.map +0 -1
  632. package/dist/management/checks/system-check.js +0 -135
  633. package/dist/management/checks/system-check.js.map +0 -1
  634. package/dist/management/checks/types.d.ts +0 -64
  635. package/dist/management/checks/types.d.ts.map +0 -1
  636. package/dist/management/checks/types.js +0 -64
  637. package/dist/management/checks/types.js.map +0 -1
  638. package/dist/management/doctor.d.ts +0 -34
  639. package/dist/management/doctor.d.ts.map +0 -1
  640. package/dist/management/doctor.js +0 -154
  641. package/dist/management/doctor.js.map +0 -1
  642. package/dist/management/environment-diagnostics.d.ts +0 -69
  643. package/dist/management/environment-diagnostics.d.ts.map +0 -1
  644. package/dist/management/environment-diagnostics.js +0 -229
  645. package/dist/management/environment-diagnostics.js.map +0 -1
  646. package/dist/management/index.d.ts +0 -15
  647. package/dist/management/index.d.ts.map +0 -1
  648. package/dist/management/index.js +0 -56
  649. package/dist/management/index.js.map +0 -1
  650. package/dist/management/instance-manager.d.ts +0 -57
  651. package/dist/management/instance-manager.d.ts.map +0 -1
  652. package/dist/management/instance-manager.js +0 -195
  653. package/dist/management/instance-manager.js.map +0 -1
  654. package/dist/management/oauth-port-diagnostics.d.ts +0 -115
  655. package/dist/management/oauth-port-diagnostics.d.ts.map +0 -1
  656. package/dist/management/oauth-port-diagnostics.js +0 -291
  657. package/dist/management/oauth-port-diagnostics.js.map +0 -1
  658. package/dist/management/recovery-manager.d.ts +0 -56
  659. package/dist/management/recovery-manager.d.ts.map +0 -1
  660. package/dist/management/recovery-manager.js +0 -239
  661. package/dist/management/recovery-manager.js.map +0 -1
  662. package/dist/management/repair/auto-repair.d.ts +0 -13
  663. package/dist/management/repair/auto-repair.d.ts.map +0 -1
  664. package/dist/management/repair/auto-repair.js +0 -186
  665. package/dist/management/repair/auto-repair.js.map +0 -1
  666. package/dist/management/repair/index.d.ts +0 -5
  667. package/dist/management/repair/index.d.ts.map +0 -1
  668. package/dist/management/repair/index.js +0 -9
  669. package/dist/management/repair/index.js.map +0 -1
  670. package/dist/management/shared-manager.d.ts +0 -55
  671. package/dist/management/shared-manager.d.ts.map +0 -1
  672. package/dist/management/shared-manager.js +0 -424
  673. package/dist/management/shared-manager.js.map +0 -1
  674. package/dist/router/index.d.ts +0 -13
  675. package/dist/router/index.d.ts.map +0 -1
  676. package/dist/router/index.js +0 -25
  677. package/dist/router/index.js.map +0 -1
  678. package/dist/router/scenario-router.d.ts +0 -86
  679. package/dist/router/scenario-router.d.ts.map +0 -1
  680. package/dist/router/scenario-router.js +0 -178
  681. package/dist/router/scenario-router.js.map +0 -1
  682. package/dist/router/scenario-routing-proxy.d.ts +0 -138
  683. package/dist/router/scenario-routing-proxy.d.ts.map +0 -1
  684. package/dist/router/scenario-routing-proxy.js +0 -380
  685. package/dist/router/scenario-routing-proxy.js.map +0 -1
  686. package/dist/router/settings-routing-executor.d.ts +0 -21
  687. package/dist/router/settings-routing-executor.d.ts.map +0 -1
  688. package/dist/router/settings-routing-executor.js +0 -111
  689. package/dist/router/settings-routing-executor.js.map +0 -1
  690. package/dist/router/types.d.ts +0 -72
  691. package/dist/router/types.d.ts.map +0 -1
  692. package/dist/router/types.js +0 -20
  693. package/dist/router/types.js.map +0 -1
  694. package/dist/types/glmt.d.ts +0 -95
  695. package/dist/types/glmt.d.ts.map +0 -1
  696. package/dist/types/glmt.js +0 -7
  697. package/dist/types/glmt.js.map +0 -1
  698. package/dist/utils/api-key-validator.d.ts +0 -14
  699. package/dist/utils/api-key-validator.d.ts.map +0 -1
  700. package/dist/utils/api-key-validator.js +0 -143
  701. package/dist/utils/api-key-validator.js.map +0 -1
  702. package/dist/utils/claude-dir-installer.d.ts +0 -46
  703. package/dist/utils/claude-dir-installer.d.ts.map +0 -1
  704. package/dist/utils/claude-dir-installer.js +0 -289
  705. package/dist/utils/claude-dir-installer.js.map +0 -1
  706. package/dist/utils/claude-spawner.d.ts +0 -54
  707. package/dist/utils/claude-spawner.d.ts.map +0 -1
  708. package/dist/utils/claude-spawner.js +0 -118
  709. package/dist/utils/claude-spawner.js.map +0 -1
  710. package/dist/utils/claude-symlink-manager.d.ts +0 -75
  711. package/dist/utils/claude-symlink-manager.d.ts.map +0 -1
  712. package/dist/utils/claude-symlink-manager.js +0 -393
  713. package/dist/utils/claude-symlink-manager.js.map +0 -1
  714. package/dist/utils/hooks/get-image-analysis-hook-env.d.ts +0 -17
  715. package/dist/utils/hooks/get-image-analysis-hook-env.d.ts.map +0 -1
  716. package/dist/utils/hooks/get-image-analysis-hook-env.js +0 -42
  717. package/dist/utils/hooks/get-image-analysis-hook-env.js.map +0 -1
  718. package/dist/utils/hooks/image-analyzer-hook-configuration.d.ts +0 -17
  719. package/dist/utils/hooks/image-analyzer-hook-configuration.d.ts.map +0 -1
  720. package/dist/utils/hooks/image-analyzer-hook-configuration.js +0 -71
  721. package/dist/utils/hooks/image-analyzer-hook-configuration.js.map +0 -1
  722. package/dist/utils/hooks/image-analyzer-hook-installer.d.ts +0 -31
  723. package/dist/utils/hooks/image-analyzer-hook-installer.d.ts.map +0 -1
  724. package/dist/utils/hooks/image-analyzer-hook-installer.js +0 -149
  725. package/dist/utils/hooks/image-analyzer-hook-installer.js.map +0 -1
  726. package/dist/utils/hooks/image-analyzer-profile-hook-injector.d.ts +0 -24
  727. package/dist/utils/hooks/image-analyzer-profile-hook-injector.d.ts.map +0 -1
  728. package/dist/utils/hooks/image-analyzer-profile-hook-injector.js +0 -251
  729. package/dist/utils/hooks/image-analyzer-profile-hook-injector.js.map +0 -1
  730. package/dist/utils/hooks/index.d.ts +0 -11
  731. package/dist/utils/hooks/index.d.ts.map +0 -1
  732. package/dist/utils/hooks/index.js +0 -21
  733. package/dist/utils/hooks/index.js.map +0 -1
  734. package/dist/utils/image-analysis/hook-installer.d.ts +0 -19
  735. package/dist/utils/image-analysis/hook-installer.d.ts.map +0 -1
  736. package/dist/utils/image-analysis/hook-installer.js +0 -112
  737. package/dist/utils/image-analysis/hook-installer.js.map +0 -1
  738. package/dist/utils/image-analysis/index.d.ts +0 -7
  739. package/dist/utils/image-analysis/index.d.ts.map +0 -1
  740. package/dist/utils/image-analysis/index.js +0 -12
  741. package/dist/utils/image-analysis/index.js.map +0 -1
  742. package/dist/utils/package-manager-detector.d.ts +0 -11
  743. package/dist/utils/package-manager-detector.d.ts.map +0 -1
  744. package/dist/utils/package-manager-detector.js +0 -103
  745. package/dist/utils/package-manager-detector.js.map +0 -1
  746. package/dist/utils/platform-commands.d.ts +0 -53
  747. package/dist/utils/platform-commands.d.ts.map +0 -1
  748. package/dist/utils/platform-commands.js +0 -189
  749. package/dist/utils/platform-commands.js.map +0 -1
  750. package/dist/utils/port-utils.d.ts +0 -55
  751. package/dist/utils/port-utils.d.ts.map +0 -1
  752. package/dist/utils/port-utils.js +0 -217
  753. package/dist/utils/port-utils.js.map +0 -1
  754. package/dist/utils/sensitive-keys.d.ts +0 -35
  755. package/dist/utils/sensitive-keys.d.ts.map +0 -1
  756. package/dist/utils/sensitive-keys.js +0 -67
  757. package/dist/utils/sensitive-keys.js.map +0 -1
  758. package/dist/utils/shell-completion.d.ts +0 -54
  759. package/dist/utils/shell-completion.d.ts.map +0 -1
  760. package/dist/utils/shell-completion.js +0 -260
  761. package/dist/utils/shell-completion.js.map +0 -1
  762. package/dist/utils/ui/tasks.d.ts +0 -26
  763. package/dist/utils/ui/tasks.d.ts.map +0 -1
  764. package/dist/utils/ui/tasks.js +0 -102
  765. package/dist/utils/ui/tasks.js.map +0 -1
  766. package/dist/utils/update-checker.d.ts +0 -71
  767. package/dist/utils/update-checker.d.ts.map +0 -1
  768. package/dist/utils/update-checker.js +0 -377
  769. package/dist/utils/update-checker.js.map +0 -1
  770. package/dist/utils/version.d.ts +0 -8
  771. package/dist/utils/version.d.ts.map +0 -1
  772. package/dist/utils/version.js +0 -51
  773. package/dist/utils/version.js.map +0 -1
  774. package/dist/utils/websearch/gemini-cli.d.ts +0 -36
  775. package/dist/utils/websearch/gemini-cli.d.ts.map +0 -1
  776. package/dist/utils/websearch/gemini-cli.js +0 -132
  777. package/dist/utils/websearch/gemini-cli.js.map +0 -1
  778. package/dist/utils/websearch/grok-cli.d.ts +0 -26
  779. package/dist/utils/websearch/grok-cli.d.ts.map +0 -1
  780. package/dist/utils/websearch/grok-cli.js +0 -81
  781. package/dist/utils/websearch/grok-cli.js.map +0 -1
  782. package/dist/utils/websearch/hook-config.d.ts +0 -27
  783. package/dist/utils/websearch/hook-config.d.ts.map +0 -1
  784. package/dist/utils/websearch/hook-config.js +0 -280
  785. package/dist/utils/websearch/hook-config.js.map +0 -1
  786. package/dist/utils/websearch/hook-env.d.ts +0 -16
  787. package/dist/utils/websearch/hook-env.d.ts.map +0 -1
  788. package/dist/utils/websearch/hook-env.js +0 -62
  789. package/dist/utils/websearch/hook-env.js.map +0 -1
  790. package/dist/utils/websearch/hook-installer.d.ts +0 -30
  791. package/dist/utils/websearch/hook-installer.d.ts.map +0 -1
  792. package/dist/utils/websearch/hook-installer.js +0 -148
  793. package/dist/utils/websearch/hook-installer.js.map +0 -1
  794. package/dist/utils/websearch/hook-utils.d.ts +0 -18
  795. package/dist/utils/websearch/hook-utils.d.ts.map +0 -1
  796. package/dist/utils/websearch/hook-utils.js +0 -59
  797. package/dist/utils/websearch/hook-utils.js.map +0 -1
  798. package/dist/utils/websearch/index.d.ts +0 -17
  799. package/dist/utils/websearch/index.d.ts.map +0 -1
  800. package/dist/utils/websearch/index.js +0 -51
  801. package/dist/utils/websearch/index.js.map +0 -1
  802. package/dist/utils/websearch/opencode-cli.d.ts +0 -26
  803. package/dist/utils/websearch/opencode-cli.d.ts.map +0 -1
  804. package/dist/utils/websearch/opencode-cli.js +0 -81
  805. package/dist/utils/websearch/opencode-cli.js.map +0 -1
  806. package/dist/utils/websearch/profile-hook-injector.d.ts +0 -20
  807. package/dist/utils/websearch/profile-hook-injector.d.ts.map +0 -1
  808. package/dist/utils/websearch/profile-hook-injector.js +0 -250
  809. package/dist/utils/websearch/profile-hook-injector.js.map +0 -1
  810. package/dist/utils/websearch/status.d.ts +0 -36
  811. package/dist/utils/websearch/status.d.ts.map +0 -1
  812. package/dist/utils/websearch/status.js +0 -192
  813. package/dist/utils/websearch/status.js.map +0 -1
  814. package/dist/utils/websearch/types.d.ts +0 -85
  815. package/dist/utils/websearch/types.d.ts.map +0 -1
  816. package/dist/utils/websearch/types.js +0 -10
  817. package/dist/utils/websearch/types.js.map +0 -1
  818. package/dist/utils/websearch-manager.d.ts +0 -31
  819. package/dist/utils/websearch-manager.d.ts.map +0 -1
  820. package/dist/utils/websearch-manager.js +0 -72
  821. package/dist/utils/websearch-manager.js.map +0 -1
  822. package/dist/web-server/data-aggregator.d.ts +0 -7
  823. package/dist/web-server/data-aggregator.d.ts.map +0 -1
  824. package/dist/web-server/data-aggregator.js +0 -23
  825. package/dist/web-server/data-aggregator.js.map +0 -1
  826. package/dist/web-server/file-watcher.d.ts +0 -15
  827. package/dist/web-server/file-watcher.d.ts.map +0 -1
  828. package/dist/web-server/file-watcher.js +0 -93
  829. package/dist/web-server/file-watcher.js.map +0 -1
  830. package/dist/web-server/health/cliproxy-checks.d.ts +0 -23
  831. package/dist/web-server/health/cliproxy-checks.d.ts.map +0 -1
  832. package/dist/web-server/health/cliproxy-checks.js +0 -171
  833. package/dist/web-server/health/cliproxy-checks.js.map +0 -1
  834. package/dist/web-server/health/config-checks.d.ts +0 -20
  835. package/dist/web-server/health/config-checks.d.ts.map +0 -1
  836. package/dist/web-server/health/config-checks.js +0 -212
  837. package/dist/web-server/health/config-checks.js.map +0 -1
  838. package/dist/web-server/health/environment-checks.d.ts +0 -11
  839. package/dist/web-server/health/environment-checks.d.ts.map +0 -1
  840. package/dist/web-server/health/environment-checks.js +0 -40
  841. package/dist/web-server/health/environment-checks.js.map +0 -1
  842. package/dist/web-server/health/index.d.ts +0 -13
  843. package/dist/web-server/health/index.d.ts.map +0 -1
  844. package/dist/web-server/health/index.js +0 -41
  845. package/dist/web-server/health/index.js.map +0 -1
  846. package/dist/web-server/health/oauth-checks.d.ts +0 -11
  847. package/dist/web-server/health/oauth-checks.d.ts.map +0 -1
  848. package/dist/web-server/health/oauth-checks.js +0 -34
  849. package/dist/web-server/health/oauth-checks.js.map +0 -1
  850. package/dist/web-server/health/profile-checks.d.ts +0 -20
  851. package/dist/web-server/health/profile-checks.d.ts.map +0 -1
  852. package/dist/web-server/health/profile-checks.js +0 -184
  853. package/dist/web-server/health/profile-checks.js.map +0 -1
  854. package/dist/web-server/health/symlink-checks.d.ts +0 -15
  855. package/dist/web-server/health/symlink-checks.d.ts.map +0 -1
  856. package/dist/web-server/health/symlink-checks.js +0 -173
  857. package/dist/web-server/health/symlink-checks.js.map +0 -1
  858. package/dist/web-server/health/system-checks.d.ts +0 -19
  859. package/dist/web-server/health/system-checks.d.ts.map +0 -1
  860. package/dist/web-server/health/system-checks.js +0 -127
  861. package/dist/web-server/health/system-checks.js.map +0 -1
  862. package/dist/web-server/health/types.d.ts +0 -34
  863. package/dist/web-server/health/types.d.ts.map +0 -1
  864. package/dist/web-server/health/types.js +0 -8
  865. package/dist/web-server/health/types.js.map +0 -1
  866. package/dist/web-server/health/websearch-checks.d.ts +0 -11
  867. package/dist/web-server/health/websearch-checks.d.ts.map +0 -1
  868. package/dist/web-server/health/websearch-checks.js +0 -53
  869. package/dist/web-server/health/websearch-checks.js.map +0 -1
  870. package/dist/web-server/health-service.d.ts +0 -20
  871. package/dist/web-server/health-service.d.ts.map +0 -1
  872. package/dist/web-server/health-service.js +0 -162
  873. package/dist/web-server/health-service.js.map +0 -1
  874. package/dist/web-server/index.d.ts +0 -25
  875. package/dist/web-server/index.d.ts.map +0 -1
  876. package/dist/web-server/index.js +0 -118
  877. package/dist/web-server/index.js.map +0 -1
  878. package/dist/web-server/jsonl-parser.d.ts +0 -68
  879. package/dist/web-server/jsonl-parser.d.ts.map +0 -1
  880. package/dist/web-server/jsonl-parser.js +0 -214
  881. package/dist/web-server/jsonl-parser.js.map +0 -1
  882. package/dist/web-server/middleware/auth-middleware.d.ts +0 -27
  883. package/dist/web-server/middleware/auth-middleware.d.ts.map +0 -1
  884. package/dist/web-server/middleware/auth-middleware.js +0 -116
  885. package/dist/web-server/middleware/auth-middleware.js.map +0 -1
  886. package/dist/web-server/model-pricing.d.ts +0 -42
  887. package/dist/web-server/model-pricing.d.ts.map +0 -1
  888. package/dist/web-server/model-pricing.js +0 -669
  889. package/dist/web-server/model-pricing.js.map +0 -1
  890. package/dist/web-server/overview-routes.d.ts +0 -7
  891. package/dist/web-server/overview-routes.d.ts.map +0 -1
  892. package/dist/web-server/overview-routes.js +0 -75
  893. package/dist/web-server/overview-routes.js.map +0 -1
  894. package/dist/web-server/routes/account-routes.d.ts +0 -9
  895. package/dist/web-server/routes/account-routes.d.ts.map +0 -1
  896. package/dist/web-server/routes/account-routes.js +0 -274
  897. package/dist/web-server/routes/account-routes.js.map +0 -1
  898. package/dist/web-server/routes/auth-routes.d.ts +0 -7
  899. package/dist/web-server/routes/auth-routes.d.ts.map +0 -1
  900. package/dist/web-server/routes/auth-routes.js +0 -108
  901. package/dist/web-server/routes/auth-routes.js.map +0 -1
  902. package/dist/web-server/routes/cliproxy-auth-routes.d.ts +0 -3
  903. package/dist/web-server/routes/cliproxy-auth-routes.d.ts.map +0 -1
  904. package/dist/web-server/routes/cliproxy-auth-routes.js +0 -610
  905. package/dist/web-server/routes/cliproxy-auth-routes.js.map +0 -1
  906. package/dist/web-server/routes/cliproxy-stats-routes.d.ts +0 -6
  907. package/dist/web-server/routes/cliproxy-stats-routes.d.ts.map +0 -1
  908. package/dist/web-server/routes/cliproxy-stats-routes.js +0 -681
  909. package/dist/web-server/routes/cliproxy-stats-routes.js.map +0 -1
  910. package/dist/web-server/routes/cliproxy-sync-routes.d.ts +0 -6
  911. package/dist/web-server/routes/cliproxy-sync-routes.d.ts.map +0 -1
  912. package/dist/web-server/routes/cliproxy-sync-routes.js +0 -157
  913. package/dist/web-server/routes/cliproxy-sync-routes.js.map +0 -1
  914. package/dist/web-server/routes/config-routes.d.ts +0 -6
  915. package/dist/web-server/routes/config-routes.d.ts.map +0 -1
  916. package/dist/web-server/routes/config-routes.js +0 -130
  917. package/dist/web-server/routes/config-routes.js.map +0 -1
  918. package/dist/web-server/routes/copilot-routes.d.ts +0 -6
  919. package/dist/web-server/routes/copilot-routes.d.ts.map +0 -1
  920. package/dist/web-server/routes/copilot-routes.js +0 -195
  921. package/dist/web-server/routes/copilot-routes.js.map +0 -1
  922. package/dist/web-server/routes/copilot-settings-routes.d.ts +0 -6
  923. package/dist/web-server/routes/copilot-settings-routes.d.ts.map +0 -1
  924. package/dist/web-server/routes/copilot-settings-routes.js +0 -122
  925. package/dist/web-server/routes/copilot-settings-routes.js.map +0 -1
  926. package/dist/web-server/routes/health-routes.d.ts +0 -6
  927. package/dist/web-server/routes/health-routes.d.ts.map +0 -1
  928. package/dist/web-server/routes/health-routes.js +0 -40
  929. package/dist/web-server/routes/health-routes.js.map +0 -1
  930. package/dist/web-server/routes/index.d.ts +0 -8
  931. package/dist/web-server/routes/index.d.ts.map +0 -1
  932. package/dist/web-server/routes/index.js +0 -62
  933. package/dist/web-server/routes/index.js.map +0 -1
  934. package/dist/web-server/routes/misc-routes.d.ts +0 -6
  935. package/dist/web-server/routes/misc-routes.d.ts.map +0 -1
  936. package/dist/web-server/routes/misc-routes.js +0 -396
  937. package/dist/web-server/routes/misc-routes.js.map +0 -1
  938. package/dist/web-server/routes/persist-routes.d.ts +0 -6
  939. package/dist/web-server/routes/persist-routes.d.ts.map +0 -1
  940. package/dist/web-server/routes/persist-routes.js +0 -286
  941. package/dist/web-server/routes/persist-routes.js.map +0 -1
  942. package/dist/web-server/routes/profile-routes.d.ts +0 -9
  943. package/dist/web-server/routes/profile-routes.d.ts.map +0 -1
  944. package/dist/web-server/routes/profile-routes.js +0 -116
  945. package/dist/web-server/routes/profile-routes.js.map +0 -1
  946. package/dist/web-server/routes/provider-routes.d.ts +0 -6
  947. package/dist/web-server/routes/provider-routes.d.ts.map +0 -1
  948. package/dist/web-server/routes/provider-routes.js +0 -146
  949. package/dist/web-server/routes/provider-routes.js.map +0 -1
  950. package/dist/web-server/routes/proxy-routes.d.ts +0 -11
  951. package/dist/web-server/routes/proxy-routes.d.ts.map +0 -1
  952. package/dist/web-server/routes/proxy-routes.js +0 -154
  953. package/dist/web-server/routes/proxy-routes.js.map +0 -1
  954. package/dist/web-server/routes/route-helpers.d.ts +0 -50
  955. package/dist/web-server/routes/route-helpers.d.ts.map +0 -1
  956. package/dist/web-server/routes/route-helpers.js +0 -179
  957. package/dist/web-server/routes/route-helpers.js.map +0 -1
  958. package/dist/web-server/routes/settings-routes.d.ts +0 -6
  959. package/dist/web-server/routes/settings-routes.d.ts.map +0 -1
  960. package/dist/web-server/routes/settings-routes.js +0 -413
  961. package/dist/web-server/routes/settings-routes.js.map +0 -1
  962. package/dist/web-server/routes/variant-routes.d.ts +0 -8
  963. package/dist/web-server/routes/variant-routes.d.ts.map +0 -1
  964. package/dist/web-server/routes/variant-routes.js +0 -119
  965. package/dist/web-server/routes/variant-routes.js.map +0 -1
  966. package/dist/web-server/routes/websearch-routes.d.ts +0 -6
  967. package/dist/web-server/routes/websearch-routes.d.ts.map +0 -1
  968. package/dist/web-server/routes/websearch-routes.js +0 -130
  969. package/dist/web-server/routes/websearch-routes.js.map +0 -1
  970. package/dist/web-server/services/index.d.ts +0 -7
  971. package/dist/web-server/services/index.d.ts.map +0 -1
  972. package/dist/web-server/services/index.js +0 -21
  973. package/dist/web-server/services/index.js.map +0 -1
  974. package/dist/web-server/services/usage-aggregator.d.ts +0 -7
  975. package/dist/web-server/services/usage-aggregator.d.ts.map +0 -1
  976. package/dist/web-server/services/usage-aggregator.js +0 -23
  977. package/dist/web-server/services/usage-aggregator.js.map +0 -1
  978. package/dist/web-server/shared-routes.d.ts +0 -7
  979. package/dist/web-server/shared-routes.d.ts.map +0 -1
  980. package/dist/web-server/shared-routes.js +0 -168
  981. package/dist/web-server/shared-routes.js.map +0 -1
  982. package/dist/web-server/shutdown.d.ts +0 -14
  983. package/dist/web-server/shutdown.d.ts.map +0 -1
  984. package/dist/web-server/shutdown.js +0 -29
  985. package/dist/web-server/shutdown.js.map +0 -1
  986. package/dist/web-server/usage/aggregator.d.ts +0 -54
  987. package/dist/web-server/usage/aggregator.d.ts.map +0 -1
  988. package/dist/web-server/usage/aggregator.js +0 -470
  989. package/dist/web-server/usage/aggregator.js.map +0 -1
  990. package/dist/web-server/usage/data-aggregator.d.ts +0 -55
  991. package/dist/web-server/usage/data-aggregator.d.ts.map +0 -1
  992. package/dist/web-server/usage/data-aggregator.js +0 -391
  993. package/dist/web-server/usage/data-aggregator.js.map +0 -1
  994. package/dist/web-server/usage/disk-cache.d.ts +0 -46
  995. package/dist/web-server/usage/disk-cache.d.ts.map +0 -1
  996. package/dist/web-server/usage/disk-cache.js +0 -162
  997. package/dist/web-server/usage/disk-cache.js.map +0 -1
  998. package/dist/web-server/usage/handlers.d.ts +0 -50
  999. package/dist/web-server/usage/handlers.d.ts.map +0 -1
  1000. package/dist/web-server/usage/handlers.js +0 -524
  1001. package/dist/web-server/usage/handlers.js.map +0 -1
  1002. package/dist/web-server/usage/index.d.ts +0 -12
  1003. package/dist/web-server/usage/index.d.ts.map +0 -1
  1004. package/dist/web-server/usage/index.js +0 -54
  1005. package/dist/web-server/usage/index.js.map +0 -1
  1006. package/dist/web-server/usage/routes.d.ts +0 -11
  1007. package/dist/web-server/usage/routes.d.ts.map +0 -1
  1008. package/dist/web-server/usage/routes.js +0 -37
  1009. package/dist/web-server/usage/routes.js.map +0 -1
  1010. package/dist/web-server/usage/types.d.ts +0 -119
  1011. package/dist/web-server/usage/types.d.ts.map +0 -1
  1012. package/dist/web-server/usage/types.js +0 -9
  1013. package/dist/web-server/usage/types.js.map +0 -1
  1014. package/dist/web-server/usage-disk-cache.d.ts +0 -7
  1015. package/dist/web-server/usage-disk-cache.d.ts.map +0 -1
  1016. package/dist/web-server/usage-disk-cache.js +0 -23
  1017. package/dist/web-server/usage-disk-cache.js.map +0 -1
  1018. package/dist/web-server/usage-routes.d.ts +0 -7
  1019. package/dist/web-server/usage-routes.d.ts.map +0 -1
  1020. package/dist/web-server/usage-routes.js +0 -14
  1021. package/dist/web-server/usage-routes.js.map +0 -1
  1022. package/dist/web-server/usage-types.d.ts +0 -7
  1023. package/dist/web-server/usage-types.d.ts.map +0 -1
  1024. package/dist/web-server/usage-types.js +0 -23
  1025. package/dist/web-server/usage-types.js.map +0 -1
  1026. package/dist/web-server/websocket.d.ts +0 -15
  1027. package/dist/web-server/websocket.d.ts.map +0 -1
  1028. package/dist/web-server/websocket.js +0 -162
  1029. package/dist/web-server/websocket.js.map +0 -1
  1030. package/lib/hooks/block-websearch.cjs +0 -75
  1031. package/lib/hooks/websearch-transformer.cjs +0 -632
  1032. /package/dist/{cliproxy → proxy}/tool-name-mapper.d.ts +0 -0
  1033. /package/dist/{cliproxy → proxy}/tool-sanitization-proxy.d.ts +0 -0
@@ -1,932 +0,0 @@
1
- "use strict";
2
- /**
3
- * Config Generator for CLIProxyAPI
4
- *
5
- * Generates config.yaml for CLIProxyAPI based on provider.
6
- * Handles OAuth token paths and provider-specific settings.
7
- *
8
- * Model mappings are loaded from config/base-{provider}.settings.json files
9
- * to allow easy updates without code changes.
10
- */
11
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
12
- if (k2 === undefined) k2 = k;
13
- var desc = Object.getOwnPropertyDescriptor(m, k);
14
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
15
- desc = { enumerable: true, get: function() { return m[k]; } };
16
- }
17
- Object.defineProperty(o, k2, desc);
18
- }) : (function(o, m, k, k2) {
19
- if (k2 === undefined) k2 = k;
20
- o[k2] = m[k];
21
- }));
22
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
23
- Object.defineProperty(o, "default", { enumerable: true, value: v });
24
- }) : function(o, v) {
25
- o["default"] = v;
26
- });
27
- var __importStar = (this && this.__importStar) || function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- Object.defineProperty(exports, "__esModule", { value: true });
35
- exports.getRemoteEnvVars = exports.ensureProviderSettings = exports.getEffectiveEnvVars = exports.getClaudeEnvVars = exports.getProviderSettingsPath = exports.deleteConfig = exports.deleteConfigForPort = exports.configExists = exports.configNeedsRegeneration = exports.regenerateConfig = exports.parseUserApiKeys = exports.parseProviderApiKeySections = exports.generateConfig = exports.getBinDir = exports.getCliproxyConfigPath = exports.getConfigPathForPort = exports.getAuthDir = exports.getProviderAuthDir = exports.getCliproxyDir = exports.getModelMapping = exports.getProviderConfig = exports.CLIPROXY_CONFIG_VERSION = exports.getCliproxyWritablePath = exports.CCS_CONTROL_PANEL_SECRET = exports.CCS_INTERNAL_API_KEY = exports.getRemoteDefaultPort = exports.validateRemotePort = exports.normalizeProtocol = exports.CLIPROXY_DEFAULT_PORT = exports.validatePort = exports.applyThinkingConfig = exports.getThinkingValueForTier = exports.applyThinkingSuffix = exports.detectTierFromModel = void 0;
36
- const fs = __importStar(require("fs"));
37
- const path = __importStar(require("path"));
38
- const config_manager_1 = require("../utils/config-manager");
39
- const helpers_1 = require("../utils/helpers");
40
- const ui_1 = require("../utils/ui");
41
- const base_config_loader_1 = require("./base-config-loader");
42
- const unified_config_loader_1 = require("../config/unified-config-loader");
43
- const auth_token_manager_1 = require("./auth-token-manager");
44
- const model_catalog_1 = require("./model-catalog");
45
- const thinking_validator_1 = require("./thinking-validator");
46
- /**
47
- * Check if warnings should be shown based on thinking config.
48
- * Defaults to true if show_warnings is not explicitly false.
49
- */
50
- function shouldShowWarnings(thinkingConfig) {
51
- return thinkingConfig.show_warnings !== false;
52
- }
53
- /**
54
- * Detect tier from model name.
55
- * Returns 'sonnet' as default if unclear.
56
- */
57
- function detectTierFromModel(modelName) {
58
- const lower = modelName.toLowerCase();
59
- if (lower.includes('opus'))
60
- return 'opus';
61
- if (lower.includes('haiku'))
62
- return 'haiku';
63
- return 'sonnet'; // Default to sonnet (most common)
64
- }
65
- exports.detectTierFromModel = detectTierFromModel;
66
- /**
67
- * Apply thinking suffix to model name.
68
- * CLIProxyAPIPlus parses suffixes like model(level) or model(budget).
69
- *
70
- * @param model - Base model name
71
- * @param thinkingValue - Level name (e.g., 'high') or numeric budget
72
- * @returns Model name with thinking suffix, e.g., "gemini-3-pro-preview(high)"
73
- */
74
- function applyThinkingSuffix(model, thinkingValue) {
75
- // Don't apply if model already ends with a parenthesized suffix (e.g., "model(high)" or "model(8192)")
76
- // Matches: ends with "(...)" where content is non-empty
77
- if (/\([^)]+\)$/.test(model)) {
78
- return model;
79
- }
80
- return `${model}(${thinkingValue})`;
81
- }
82
- exports.applyThinkingSuffix = applyThinkingSuffix;
83
- /**
84
- * Get thinking value for tier based on config.
85
- * Respects provider-specific overrides if configured.
86
- */
87
- function getThinkingValueForTier(tier, provider, thinkingConfig) {
88
- // Check provider-specific override first
89
- const providerOverride = thinkingConfig.provider_overrides?.[provider]?.[tier];
90
- if (providerOverride) {
91
- return providerOverride;
92
- }
93
- // Fall back to global tier default (with null guard)
94
- return thinkingConfig.tier_defaults?.[tier] ?? 'medium';
95
- }
96
- exports.getThinkingValueForTier = getThinkingValueForTier;
97
- /**
98
- * Apply thinking configuration to env vars.
99
- * Modifies ANTHROPIC_MODEL and tier models with thinking suffixes.
100
- *
101
- * @param envVars - Environment variables to modify
102
- * @param provider - CLIProxy provider
103
- * @param thinkingOverride - Optional CLI override (takes priority over config)
104
- * @returns Modified env vars with thinking suffixes applied
105
- */
106
- function applyThinkingConfig(envVars, provider, thinkingOverride) {
107
- const thinkingConfig = (0, unified_config_loader_1.getThinkingConfig)();
108
- const result = { ...envVars };
109
- // Check if thinking is off
110
- if (thinkingConfig.mode === 'off' && thinkingOverride === undefined) {
111
- return result;
112
- }
113
- // Get base model to check thinking support
114
- const baseModel = result.ANTHROPIC_MODEL || '';
115
- if (!(0, model_catalog_1.supportsThinking)(provider, baseModel)) {
116
- // U2: Warn user if they explicitly provided --thinking but model doesn't support it
117
- if (thinkingOverride !== undefined && shouldShowWarnings(thinkingConfig)) {
118
- console.warn((0, ui_1.warn)(`Model ${baseModel || 'unknown'} (provider: ${provider}) does not support thinking budget. --thinking flag ignored.`));
119
- }
120
- return result;
121
- }
122
- // Determine thinking value to use
123
- let thinkingValue;
124
- if (thinkingOverride !== undefined) {
125
- // CLI override takes priority
126
- thinkingValue = thinkingOverride;
127
- }
128
- else if (thinkingConfig.mode === 'manual' && thinkingConfig.override !== undefined) {
129
- // Config manual mode with override
130
- thinkingValue = thinkingConfig.override;
131
- }
132
- else if (thinkingConfig.mode === 'auto') {
133
- // Auto mode: detect tier and apply default
134
- const tier = detectTierFromModel(baseModel);
135
- thinkingValue = getThinkingValueForTier(tier, provider, thinkingConfig);
136
- }
137
- else {
138
- return result; // No thinking to apply
139
- }
140
- // Validate thinking value against model capabilities
141
- const validation = (0, thinking_validator_1.validateThinking)(provider, baseModel, thinkingValue);
142
- if (validation.warning && shouldShowWarnings(thinkingConfig)) {
143
- console.warn((0, ui_1.warn)(validation.warning));
144
- }
145
- thinkingValue = validation.value;
146
- // If validation says off, don't apply suffix
147
- if (thinkingValue === 'off') {
148
- return result;
149
- }
150
- // Apply thinking suffix to main model
151
- if (result.ANTHROPIC_MODEL) {
152
- result.ANTHROPIC_MODEL = applyThinkingSuffix(result.ANTHROPIC_MODEL, thinkingValue);
153
- }
154
- // Apply to tier models if they support thinking
155
- const tierModels = [
156
- 'ANTHROPIC_DEFAULT_OPUS_MODEL',
157
- 'ANTHROPIC_DEFAULT_SONNET_MODEL',
158
- 'ANTHROPIC_DEFAULT_HAIKU_MODEL',
159
- ];
160
- for (const tierVar of tierModels) {
161
- const model = result[tierVar];
162
- if (model && (0, model_catalog_1.supportsThinking)(provider, model)) {
163
- // Get tier-specific thinking value
164
- const tier = tierVar.includes('OPUS')
165
- ? 'opus'
166
- : tierVar.includes('SONNET')
167
- ? 'sonnet'
168
- : 'haiku';
169
- const tierThinkingValue = thinkingOverride ?? getThinkingValueForTier(tier, provider, thinkingConfig);
170
- result[tierVar] = applyThinkingSuffix(model, tierThinkingValue);
171
- }
172
- }
173
- return result;
174
- }
175
- exports.applyThinkingConfig = applyThinkingConfig;
176
- /**
177
- * Validate port is a valid positive integer (1-65535).
178
- * Returns default port if invalid.
179
- *
180
- * @param port - Port number to validate
181
- * @returns Valid port or CLIPROXY_DEFAULT_PORT (8317) if invalid
182
- */
183
- function validatePort(port) {
184
- if (port === undefined || port === null) {
185
- return exports.CLIPROXY_DEFAULT_PORT;
186
- }
187
- if (!Number.isFinite(port) || port < 1 || port > 65535 || !Number.isInteger(port)) {
188
- return exports.CLIPROXY_DEFAULT_PORT;
189
- }
190
- return port;
191
- }
192
- exports.validatePort = validatePort;
193
- /**
194
- * Ensure required CLIProxy env vars are present.
195
- * Falls back to bundled defaults if missing from user settings.
196
- * This prevents 404 errors when users forget to set BASE_URL/AUTH_TOKEN.
197
- */
198
- function ensureRequiredEnvVars(envVars, provider, port) {
199
- const validPort = validatePort(port);
200
- const result = { ...envVars };
201
- const defaults = getClaudeEnvVars(provider, validPort);
202
- // Fill in missing required vars from defaults
203
- if (!result.ANTHROPIC_BASE_URL?.trim()) {
204
- result.ANTHROPIC_BASE_URL = defaults.ANTHROPIC_BASE_URL;
205
- }
206
- if (!result.ANTHROPIC_AUTH_TOKEN?.trim()) {
207
- result.ANTHROPIC_AUTH_TOKEN = defaults.ANTHROPIC_AUTH_TOKEN;
208
- }
209
- return result;
210
- }
211
- /** Default CLIProxy port */
212
- exports.CLIPROXY_DEFAULT_PORT = 8317;
213
- /**
214
- * Normalize protocol to lowercase and validate.
215
- * Handles runtime case sensitivity (e.g., 'HTTPS' → 'https').
216
- * Defaults to 'http' for invalid values.
217
- */
218
- function normalizeProtocol(protocol) {
219
- if (!protocol)
220
- return 'http';
221
- const normalized = protocol.toLowerCase();
222
- if (normalized === 'https')
223
- return 'https';
224
- if (normalized === 'http')
225
- return 'http';
226
- // Invalid protocol (e.g., 'ftp') - default to http
227
- return 'http';
228
- }
229
- exports.normalizeProtocol = normalizeProtocol;
230
- /**
231
- * Validate and sanitize port number for remote connections.
232
- * Returns undefined for invalid ports (letting caller use default).
233
- * Valid range: 1-65535, must be integer.
234
- */
235
- function validateRemotePort(port) {
236
- if (port === undefined || port === null)
237
- return undefined;
238
- if (typeof port !== 'number' || !Number.isInteger(port))
239
- return undefined;
240
- if (port <= 0 || port > 65535)
241
- return undefined;
242
- return port;
243
- }
244
- exports.validateRemotePort = validateRemotePort;
245
- /**
246
- * Get default port for remote CLIProxyAPI based on protocol.
247
- * - HTTP: 8317 (CLIProxyAPI default)
248
- * - HTTPS: 443 (standard SSL port)
249
- */
250
- function getRemoteDefaultPort(protocol) {
251
- return protocol === 'https' ? 443 : exports.CLIPROXY_DEFAULT_PORT;
252
- }
253
- exports.getRemoteDefaultPort = getRemoteDefaultPort;
254
- /** Internal API key for CCS-managed requests */
255
- exports.CCS_INTERNAL_API_KEY = 'ccs-internal-managed';
256
- /** Simple secret key for Control Panel login (user-facing) */
257
- exports.CCS_CONTROL_PANEL_SECRET = 'ccs';
258
- /**
259
- * Get CLIProxy writable directory for logs and runtime files.
260
- * This directory is set as WRITABLE_PATH env var when spawning CLIProxy.
261
- * Logs will be stored in ~/.ccs/cliproxy/logs/
262
- */
263
- function getCliproxyWritablePath() {
264
- return path.join((0, config_manager_1.getCcsDir)(), 'cliproxy');
265
- }
266
- exports.getCliproxyWritablePath = getCliproxyWritablePath;
267
- /**
268
- * Config version - bump when config format changes to trigger regeneration
269
- * v1: Initial config (port, auth-dir, api-keys only)
270
- * v2: Full-featured config with dashboard, quota mgmt, simplified key
271
- * v3: Logging disabled by default (user opt-in via ~/.ccs/config.yaml)
272
- * v4: Added Kiro (AWS) and GitHub Copilot providers
273
- * v5: Added disable-cooling: true for stability
274
- */
275
- exports.CLIPROXY_CONFIG_VERSION = 5;
276
- /** Provider display names (static metadata) */
277
- const PROVIDER_DISPLAY_NAMES = {
278
- gemini: 'Gemini',
279
- codex: 'Codex',
280
- agy: 'Antigravity',
281
- qwen: 'Qwen Code',
282
- iflow: 'iFlow',
283
- kiro: 'Kiro (AWS)',
284
- ghcp: 'GitHub Copilot (OAuth)',
285
- claude: 'Claude (Anthropic)',
286
- };
287
- /**
288
- * Get provider configuration
289
- * Model mappings are loaded from config/base-{provider}.settings.json
290
- */
291
- function getProviderConfig(provider) {
292
- const displayName = PROVIDER_DISPLAY_NAMES[provider];
293
- if (!displayName) {
294
- throw new Error(`Unknown provider: ${provider}`);
295
- }
296
- // Load models from base config file
297
- const models = (0, base_config_loader_1.getModelMappingFromConfig)(provider);
298
- return {
299
- name: provider,
300
- displayName,
301
- models,
302
- requiresOAuth: true, // All CLIProxy providers require OAuth
303
- };
304
- }
305
- exports.getProviderConfig = getProviderConfig;
306
- /**
307
- * Get model mapping for provider
308
- * Loads from config/base-{provider}.settings.json
309
- */
310
- function getModelMapping(provider) {
311
- return getProviderConfig(provider).models;
312
- }
313
- exports.getModelMapping = getModelMapping;
314
- /**
315
- * Get CLIProxy base directory
316
- * All CLIProxy-related files are stored under ~/.ccs/cliproxy/
317
- */
318
- function getCliproxyDir() {
319
- return path.join((0, config_manager_1.getCcsDir)(), 'cliproxy');
320
- }
321
- exports.getCliproxyDir = getCliproxyDir;
322
- /**
323
- * Get auth directory for provider
324
- * All providers use a FLAT auth directory structure for unified config.
325
- * CLIProxyAPI stores OAuth tokens directly in auth/ (not subdirectories).
326
- * This enables all providers to be discovered and used concurrently.
327
- */
328
- function getProviderAuthDir(_provider) {
329
- // Use flat structure - all auth files in same directory for unified discovery
330
- // Provider param kept for API compatibility (CLIProxyAPI handles via auth file type field)
331
- return path.join(getCliproxyDir(), 'auth');
332
- }
333
- exports.getProviderAuthDir = getProviderAuthDir;
334
- /**
335
- * Get base auth directory for CLIProxyAPI
336
- */
337
- function getAuthDir() {
338
- return path.join(getCliproxyDir(), 'auth');
339
- }
340
- exports.getAuthDir = getAuthDir;
341
- /**
342
- * Get config file path for a specific port.
343
- * Default port uses config.yaml, others use config-{port}.yaml.
344
- */
345
- function getConfigPathForPort(port) {
346
- if (port === exports.CLIPROXY_DEFAULT_PORT) {
347
- return path.join(getCliproxyDir(), 'config.yaml');
348
- }
349
- return path.join(getCliproxyDir(), `config-${port}.yaml`);
350
- }
351
- exports.getConfigPathForPort = getConfigPathForPort;
352
- /**
353
- * Get CLIProxy config file path (default port)
354
- * Named distinctly from config-manager's getConfigPath to avoid confusion.
355
- */
356
- function getCliproxyConfigPath() {
357
- return getConfigPathForPort(exports.CLIPROXY_DEFAULT_PORT);
358
- }
359
- exports.getCliproxyConfigPath = getCliproxyConfigPath;
360
- /**
361
- * Get binary directory path
362
- */
363
- function getBinDir() {
364
- return path.join(getCliproxyDir(), 'bin');
365
- }
366
- exports.getBinDir = getBinDir;
367
- /**
368
- * Get CLIProxy logging settings from user config.
369
- * Defaults to disabled to prevent disk bloat.
370
- */
371
- function getLoggingSettings() {
372
- const config = (0, unified_config_loader_1.loadOrCreateUnifiedConfig)();
373
- return {
374
- loggingToFile: config.cliproxy.logging?.enabled ?? false,
375
- requestLog: config.cliproxy.logging?.request_log ?? false,
376
- };
377
- }
378
- /**
379
- * Generate UNIFIED config.yaml content for ALL providers
380
- * This enables concurrent usage of gemini/codex/agy without config conflicts.
381
- * CLIProxyAPI routes requests by model name to the appropriate provider.
382
- *
383
- * @param port - Server port (default: 8317)
384
- * @param userApiKeys - User-added API keys to preserve (default: [])
385
- */
386
- function generateUnifiedConfigContent(port = exports.CLIPROXY_DEFAULT_PORT, userApiKeys = []) {
387
- const authDir = getAuthDir(); // Base auth dir - CLIProxyAPI scans subdirectories
388
- // Convert Windows backslashes to forward slashes for YAML compatibility
389
- const authDirNormalized = authDir.split(path.sep).join('/');
390
- // Get logging settings from user config (disabled by default)
391
- const { loggingToFile, requestLog } = getLoggingSettings();
392
- // Get effective auth tokens (respects user customization)
393
- const effectiveApiKey = (0, auth_token_manager_1.getEffectiveApiKey)();
394
- const effectiveSecret = (0, auth_token_manager_1.getEffectiveManagementSecret)();
395
- // Build api-keys section with internal key + preserved user keys
396
- const allApiKeys = [effectiveApiKey, ...userApiKeys];
397
- const apiKeysYaml = allApiKeys.map((key) => ` - "${key}"`).join('\n');
398
- // Unified config with enhanced CLIProxyAPI features
399
- const config = `# CLIProxyAPI config generated by CCS v${exports.CLIPROXY_CONFIG_VERSION}
400
- # Supports: gemini, codex, agy, qwen, iflow (concurrent usage)
401
- # Generated: ${new Date().toISOString()}
402
- #
403
- # This config is auto-managed by CCS. Manual edits may be overwritten.
404
- # Use 'ccs doctor' to regenerate with latest settings.
405
-
406
- # =============================================================================
407
- # Server Settings
408
- # =============================================================================
409
-
410
- port: ${port}
411
- debug: false
412
-
413
- # =============================================================================
414
- # Logging
415
- # =============================================================================
416
- # WARNING: Logs can grow to several GB if enabled!
417
- # To enable logging, edit ~/.ccs/config.yaml:
418
- # cliproxy:
419
- # logging:
420
- # enabled: true
421
- # request_log: true
422
- # Then run 'ccs doctor --fix' to regenerate this config.
423
- # Use 'ccs cleanup' to remove old logs.
424
-
425
- # Write logs to file (stored in ~/.ccs/cliproxy/logs/)
426
- logging-to-file: ${loggingToFile}
427
-
428
- # Log individual API requests for debugging/analytics
429
- request-log: ${requestLog}
430
-
431
- # =============================================================================
432
- # Dashboard & Management
433
- # =============================================================================
434
-
435
- # Enable usage statistics for CCS dashboard analytics
436
- usage-statistics-enabled: true
437
-
438
- # Remote management API for CCS dashboard integration
439
- remote-management:
440
- allow-remote: true
441
- secret-key: "${effectiveSecret}"
442
- disable-control-panel: false
443
-
444
- # =============================================================================
445
- # Reliability & Quota Management
446
- # =============================================================================
447
-
448
- # Disable quota cooldown scheduling for stability
449
- disable-cooling: true
450
-
451
- # Auto-retry on transient errors (403, 408, 500, 502, 503, 504)
452
- request-retry: 0
453
- max-retry-interval: 0
454
-
455
- # Auto-switch accounts on quota exceeded (429)
456
- # This enables seamless multi-account rotation when rate limited
457
- quota-exceeded:
458
- switch-project: true
459
- switch-preview-model: true
460
-
461
- # =============================================================================
462
- # Authentication
463
- # =============================================================================
464
-
465
- # API keys for CCS and user-added external requests
466
- # NOTE: User-added keys are preserved across CCS updates (fix for issue #200)
467
- api-keys:
468
- ${apiKeysYaml}
469
-
470
- # OAuth tokens directory (auto-discovered by CLIProxyAPI)
471
- auth-dir: "${authDirNormalized}"
472
- `;
473
- return config;
474
- }
475
- /**
476
- * Generate unified config.yaml file (supports all providers concurrently)
477
- * Only regenerates if config doesn't exist.
478
- * @returns Path to config file
479
- */
480
- function generateConfig(provider, port = exports.CLIPROXY_DEFAULT_PORT) {
481
- const configPath = getConfigPathForPort(port);
482
- // Ensure provider auth directory exists
483
- const authDir = getProviderAuthDir(provider);
484
- fs.mkdirSync(path.dirname(configPath), { recursive: true });
485
- fs.mkdirSync(authDir, { recursive: true, mode: 0o700 });
486
- // Only generate config if it doesn't exist (unified config serves all providers)
487
- if (!fs.existsSync(configPath)) {
488
- const configContent = generateUnifiedConfigContent(port);
489
- fs.writeFileSync(configPath, configContent, { mode: 0o600 });
490
- }
491
- return configPath;
492
- }
493
- exports.generateConfig = generateConfig;
494
- /**
495
- * Provider API key field names written by --setup (codex-api-key, gemini-api-key, claude-api-key).
496
- * These are custom endpoint configs that must be preserved during config regeneration.
497
- */
498
- const PROVIDER_API_KEY_FIELDS = ['codex-api-key', 'gemini-api-key', 'claude-api-key'];
499
- /**
500
- * Parse provider API key sections from existing config content.
501
- * These are sections like codex-api-key, gemini-api-key, claude-api-key
502
- * written by `ccs <provider> --setup` for custom endpoint configuration.
503
- *
504
- * @param content - Existing config.yaml content
505
- * @returns Raw YAML text of provider API key sections (empty string if none)
506
- */
507
- function parseProviderApiKeySections(content) {
508
- const normalizedContent = content.replace(/\r\n/g, '\n');
509
- const lines = normalizedContent.split('\n');
510
- const preservedSections = [];
511
- for (let i = 0; i < lines.length; i++) {
512
- const line = lines[i];
513
- // Check if this line starts a provider API key section
514
- const isProviderKeySection = PROVIDER_API_KEY_FIELDS.some((field) => line.trimStart().startsWith(`${field}:`));
515
- if (isProviderKeySection) {
516
- const sectionLines = [line];
517
- // Collect all indented lines that follow (the section body)
518
- for (let j = i + 1; j < lines.length; j++) {
519
- const nextLine = lines[j];
520
- // Stop at the next top-level key or end of file
521
- if (nextLine.length > 0 &&
522
- !nextLine.startsWith(' ') &&
523
- !nextLine.startsWith('\t') &&
524
- !nextLine.startsWith('#') &&
525
- /^[a-zA-Z_][a-zA-Z0-9_-]*\s*:/.test(nextLine)) {
526
- break;
527
- }
528
- sectionLines.push(nextLine);
529
- i = j; // Skip these lines in outer loop
530
- }
531
- preservedSections.push(sectionLines.join('\n'));
532
- }
533
- }
534
- return preservedSections.join('\n\n');
535
- }
536
- exports.parseProviderApiKeySections = parseProviderApiKeySections;
537
- /**
538
- * Parse user-added API keys from existing config content.
539
- * Extracts all keys except the internal CCS key for preservation.
540
- *
541
- * @param content - Existing config.yaml content
542
- * @returns Array of user-added API keys (excludes CCS_INTERNAL_API_KEY)
543
- */
544
- function parseUserApiKeys(content) {
545
- const userKeys = [];
546
- // Find the api-keys section by looking for lines starting with " - " after "api-keys:"
547
- // Normalize line endings first
548
- const normalizedContent = content.replace(/\r\n/g, '\n');
549
- // Find the api-keys: line and extract all subsequent key entries
550
- const lines = normalizedContent.split('\n');
551
- let inApiKeysSection = false;
552
- for (const line of lines) {
553
- // Check if this is the start of api-keys section
554
- if (line.match(/^api-keys:\s*$/)) {
555
- inApiKeysSection = true;
556
- continue;
557
- }
558
- // If we're in the api-keys section, look for key entries
559
- if (inApiKeysSection) {
560
- // Key entries are indented with " - " or similar
561
- const keyMatch = line.match(/^\s+-\s*"([^"]*)"/);
562
- if (keyMatch) {
563
- const key = keyMatch[1];
564
- // Exclude the internal CCS key and empty strings
565
- if (key && key !== exports.CCS_INTERNAL_API_KEY) {
566
- userKeys.push(key);
567
- }
568
- }
569
- else if (line.match(/^\S/) && line.trim().length > 0) {
570
- // Non-indented line that's not empty means we've left the api-keys section
571
- break;
572
- }
573
- // Continue for blank lines or other indented content
574
- }
575
- }
576
- return userKeys;
577
- }
578
- exports.parseUserApiKeys = parseUserApiKeys;
579
- /**
580
- * Force regenerate config.yaml with latest settings.
581
- * Preserves user-added API keys, port settings, and provider API key sections.
582
- *
583
- * @param port - Default port to use if not found in existing config
584
- * @returns Path to new config file
585
- */
586
- function regenerateConfig(port = exports.CLIPROXY_DEFAULT_PORT) {
587
- const configPath = getConfigPathForPort(port);
588
- // Preserve user settings from existing config
589
- let effectivePort = port;
590
- let userApiKeys = [];
591
- let providerApiKeySections = '';
592
- if (fs.existsSync(configPath)) {
593
- try {
594
- const content = fs.readFileSync(configPath, 'utf-8');
595
- // Preserve port setting
596
- const portMatch = content.match(/^port:\s*(\d+)/m);
597
- if (portMatch) {
598
- effectivePort = parseInt(portMatch[1], 10);
599
- }
600
- // Preserve user-added API keys (fix for issue #200)
601
- userApiKeys = parseUserApiKeys(content);
602
- // Preserve provider API key sections (codex-api-key, gemini-api-key, claude-api-key)
603
- // These are written by `ccs <provider> --setup` and must survive config regeneration
604
- providerApiKeySections = parseProviderApiKeySections(content);
605
- }
606
- catch {
607
- // Use defaults if reading fails
608
- }
609
- // Delete existing config
610
- fs.unlinkSync(configPath);
611
- }
612
- // Ensure directories exist
613
- fs.mkdirSync(path.dirname(configPath), { recursive: true });
614
- fs.mkdirSync(getAuthDir(), { recursive: true, mode: 0o700 });
615
- // Generate fresh config with preserved user API keys
616
- let configContent = generateUnifiedConfigContent(effectivePort, userApiKeys);
617
- // Re-append provider API key sections (--setup endpoint configs)
618
- if (providerApiKeySections.trim()) {
619
- configContent +=
620
- '\n# =============================================================================\n' +
621
- '# Provider API Keys (configured via --setup)\n' +
622
- '# =============================================================================\n\n' +
623
- providerApiKeySections.trim() +
624
- '\n';
625
- }
626
- fs.writeFileSync(configPath, configContent, { mode: 0o600 });
627
- return configPath;
628
- }
629
- exports.regenerateConfig = regenerateConfig;
630
- /**
631
- * Check if config needs regeneration (version mismatch)
632
- * @returns true if config should be regenerated
633
- */
634
- function configNeedsRegeneration() {
635
- const configPath = getCliproxyConfigPath();
636
- if (!fs.existsSync(configPath)) {
637
- return false; // Will be created on first use
638
- }
639
- try {
640
- const content = fs.readFileSync(configPath, 'utf-8');
641
- // Check for version marker
642
- const versionMatch = content.match(/CCS v(\d+)/);
643
- if (!versionMatch) {
644
- return true; // No version marker = old config
645
- }
646
- const configVersion = parseInt(versionMatch[1], 10);
647
- return configVersion < exports.CLIPROXY_CONFIG_VERSION;
648
- }
649
- catch {
650
- return true; // Error reading = regenerate
651
- }
652
- }
653
- exports.configNeedsRegeneration = configNeedsRegeneration;
654
- /**
655
- * Check if config exists for port
656
- */
657
- function configExists(port = exports.CLIPROXY_DEFAULT_PORT) {
658
- return fs.existsSync(getConfigPathForPort(port));
659
- }
660
- exports.configExists = configExists;
661
- /**
662
- * Delete config file for specific port
663
- */
664
- function deleteConfigForPort(port) {
665
- const configPath = getConfigPathForPort(port);
666
- if (fs.existsSync(configPath)) {
667
- fs.unlinkSync(configPath);
668
- }
669
- }
670
- exports.deleteConfigForPort = deleteConfigForPort;
671
- /**
672
- * Delete config file (default port)
673
- */
674
- function deleteConfig() {
675
- deleteConfigForPort(exports.CLIPROXY_DEFAULT_PORT);
676
- }
677
- exports.deleteConfig = deleteConfig;
678
- /**
679
- * Get path to user settings file for provider
680
- * Example: ~/.ccs/gemini.settings.json
681
- */
682
- function getProviderSettingsPath(provider) {
683
- return path.join((0, config_manager_1.getCcsDir)(), `${provider}.settings.json`);
684
- }
685
- exports.getProviderSettingsPath = getProviderSettingsPath;
686
- /**
687
- * Get environment variables for Claude CLI (bundled defaults)
688
- * Uses provider-specific endpoint (e.g., /api/provider/gemini) for explicit routing.
689
- * This enables concurrent gemini/codex usage - each session routes to its provider via URL path.
690
- */
691
- function getClaudeEnvVars(provider, port = exports.CLIPROXY_DEFAULT_PORT) {
692
- const models = getModelMapping(provider);
693
- // Base env vars from config file (includes ANTHROPIC_MAX_TOKENS, etc.)
694
- const baseEnvVars = (0, base_config_loader_1.getEnvVarsFromConfig)(provider);
695
- // Core env vars that we always set dynamically
696
- const coreEnvVars = {
697
- // Provider-specific endpoint - routes to correct provider via URL path
698
- ANTHROPIC_BASE_URL: `http://127.0.0.1:${port}/api/provider/${provider}`,
699
- ANTHROPIC_AUTH_TOKEN: (0, auth_token_manager_1.getEffectiveApiKey)(),
700
- ANTHROPIC_MODEL: models.claudeModel,
701
- ANTHROPIC_DEFAULT_OPUS_MODEL: models.opusModel || models.claudeModel,
702
- ANTHROPIC_DEFAULT_SONNET_MODEL: models.sonnetModel || models.claudeModel,
703
- ANTHROPIC_DEFAULT_HAIKU_MODEL: models.haikuModel || models.claudeModel,
704
- };
705
- // Filter out core env vars from base config to avoid conflicts
706
- const { ANTHROPIC_BASE_URL: _baseUrl, ANTHROPIC_AUTH_TOKEN: _authToken, ANTHROPIC_MODEL: _model, ANTHROPIC_DEFAULT_OPUS_MODEL: _opusModel, ANTHROPIC_DEFAULT_SONNET_MODEL: _sonnetModel, ANTHROPIC_DEFAULT_HAIKU_MODEL: _haikuModel, ...additionalEnvVars } = baseEnvVars;
707
- // Merge core env vars with additional env vars from base config
708
- return {
709
- ...coreEnvVars,
710
- ...additionalEnvVars, // Includes ANTHROPIC_MAX_TOKENS, etc.
711
- };
712
- }
713
- exports.getClaudeEnvVars = getClaudeEnvVars;
714
- /**
715
- * Get global env vars to inject into all third-party profiles.
716
- * Returns empty object if disabled.
717
- */
718
- function getGlobalEnvVars() {
719
- const globalEnvConfig = (0, unified_config_loader_1.getGlobalEnvConfig)();
720
- if (!globalEnvConfig.enabled) {
721
- return {};
722
- }
723
- return globalEnvConfig.env;
724
- }
725
- /**
726
- * Rewrite localhost URLs to remote server URLs.
727
- * Handles various localhost patterns: 127.0.0.1, localhost, 0.0.0.0
728
- */
729
- function rewriteLocalhostUrls(envVars, provider, remoteConfig) {
730
- const result = { ...envVars };
731
- const baseUrl = result.ANTHROPIC_BASE_URL;
732
- if (!baseUrl)
733
- return result;
734
- // Check if URL points to localhost (127.0.0.1, localhost, 0.0.0.0)
735
- const localhostPattern = /^https?:\/\/(127\.0\.0\.1|localhost|0\.0\.0\.0)(:\d+)?/i;
736
- if (!localhostPattern.test(baseUrl))
737
- return result;
738
- // Build remote URL with smart port handling (8317 for HTTP, 443 for HTTPS)
739
- // Validate port and normalize protocol for defensive handling
740
- const normalizedProtocol = normalizeProtocol(remoteConfig.protocol);
741
- const validatedPort = validateRemotePort(remoteConfig.port);
742
- const effectivePort = validatedPort ?? getRemoteDefaultPort(normalizedProtocol);
743
- // Omit port suffix for standard web ports (80/443) for cleaner URLs
744
- const standardWebPort = normalizedProtocol === 'https' ? 443 : 80;
745
- const portSuffix = effectivePort === standardWebPort ? '' : `:${effectivePort}`;
746
- const remoteBaseUrl = `${normalizedProtocol}://${remoteConfig.host}${portSuffix}/api/provider/${provider}`;
747
- result.ANTHROPIC_BASE_URL = remoteBaseUrl;
748
- // Update auth token if provided
749
- if (remoteConfig.authToken) {
750
- result.ANTHROPIC_AUTH_TOKEN = remoteConfig.authToken;
751
- }
752
- return result;
753
- }
754
- /**
755
- * Get effective environment variables for provider
756
- *
757
- * Priority order:
758
- * 1. Custom settings path (for user-defined CLIProxy variants)
759
- * 2. User settings file (~/.ccs/{provider}.settings.json) if exists
760
- * 3. Bundled defaults from PROVIDER_CONFIGS
761
- *
762
- * All results are merged with global_env vars (telemetry/reporting disables).
763
- * User takes full responsibility for custom settings.
764
- *
765
- * If remoteRewriteConfig is provided, localhost URLs are rewritten to remote server.
766
- */
767
- function getEffectiveEnvVars(provider, port = exports.CLIPROXY_DEFAULT_PORT, customSettingsPath, remoteRewriteConfig) {
768
- // Get global env vars (DISABLE_TELEMETRY, etc.)
769
- const globalEnv = getGlobalEnvVars();
770
- let envVars;
771
- // Priority 1: Custom settings path (for user-defined variants)
772
- if (customSettingsPath) {
773
- const expandedPath = (0, helpers_1.expandPath)(customSettingsPath);
774
- if (fs.existsSync(expandedPath)) {
775
- try {
776
- const content = fs.readFileSync(expandedPath, 'utf-8');
777
- const settings = JSON.parse(content);
778
- if (settings.env && typeof settings.env === 'object') {
779
- // Custom variant settings found - merge with global env
780
- envVars = { ...globalEnv, ...settings.env };
781
- // Ensure required vars are present (fall back to defaults if missing)
782
- envVars = ensureRequiredEnvVars(envVars, provider, port);
783
- // Apply remote rewrite if configured
784
- if (remoteRewriteConfig) {
785
- envVars = rewriteLocalhostUrls(envVars, provider, remoteRewriteConfig);
786
- }
787
- return envVars;
788
- }
789
- }
790
- catch {
791
- // Invalid JSON - fall through to provider defaults
792
- console.warn((0, ui_1.warn)(`Invalid settings file: ${customSettingsPath}`));
793
- }
794
- }
795
- else {
796
- console.warn((0, ui_1.warn)(`Settings file not found: ${customSettingsPath}`));
797
- }
798
- }
799
- // Priority 2: Default provider settings file
800
- const settingsPath = getProviderSettingsPath(provider);
801
- // Check for user override file
802
- if (fs.existsSync(settingsPath)) {
803
- try {
804
- const content = fs.readFileSync(settingsPath, 'utf-8');
805
- const settings = JSON.parse(content);
806
- if (settings.env && typeof settings.env === 'object') {
807
- // User override found - merge with global env
808
- envVars = { ...globalEnv, ...settings.env };
809
- // Ensure required vars are present (fall back to defaults if missing)
810
- envVars = ensureRequiredEnvVars(envVars, provider, port);
811
- // Apply remote rewrite if configured
812
- if (remoteRewriteConfig) {
813
- envVars = rewriteLocalhostUrls(envVars, provider, remoteRewriteConfig);
814
- }
815
- return envVars;
816
- }
817
- }
818
- catch {
819
- // Invalid JSON or structure - fall through to defaults
820
- // Silent fallback: don't spam errors for broken user files
821
- }
822
- }
823
- // No override or invalid - use bundled defaults merged with global env
824
- return { ...globalEnv, ...getClaudeEnvVars(provider, port) };
825
- }
826
- exports.getEffectiveEnvVars = getEffectiveEnvVars;
827
- /**
828
- * Copy bundled settings template to user directory if not exists
829
- * Called during installation/first run
830
- */
831
- function ensureProviderSettings(provider) {
832
- const settingsPath = getProviderSettingsPath(provider);
833
- // Only create if doesn't exist (preserve user edits)
834
- if (fs.existsSync(settingsPath)) {
835
- return;
836
- }
837
- // Generate default settings from PROVIDER_CONFIGS
838
- const envVars = getClaudeEnvVars(provider);
839
- const settings = { env: envVars };
840
- // Ensure directory exists
841
- fs.mkdirSync(path.dirname(settingsPath), { recursive: true });
842
- // Write with restricted permissions
843
- fs.writeFileSync(settingsPath, JSON.stringify(settings, null, 2) + '\n', {
844
- mode: 0o600,
845
- });
846
- }
847
- exports.ensureProviderSettings = ensureProviderSettings;
848
- /**
849
- * Get environment variables for remote proxy mode.
850
- * Uses the remote proxy's provider endpoint as the base URL.
851
- * Respects user model settings from custom settings path or provider settings file.
852
- *
853
- * @param provider CLIProxy provider (gemini, codex, agy, qwen, iflow)
854
- * @param remoteConfig Remote proxy connection details
855
- * @param customSettingsPath Optional path to user's custom settings file
856
- * @returns Environment variables for Claude CLI
857
- */
858
- function getRemoteEnvVars(provider, remoteConfig, customSettingsPath) {
859
- // Build URL with smart port handling (8317 for HTTP, 443 for HTTPS)
860
- // Validate port and normalize protocol for defensive handling
861
- const normalizedProtocol = normalizeProtocol(remoteConfig.protocol);
862
- const validatedPort = validateRemotePort(remoteConfig.port);
863
- const effectivePort = validatedPort ?? getRemoteDefaultPort(normalizedProtocol);
864
- // Omit port suffix for standard web ports (80/443) for cleaner URLs
865
- const standardWebPort = normalizedProtocol === 'https' ? 443 : 80;
866
- const portSuffix = effectivePort === standardWebPort ? '' : `:${effectivePort}`;
867
- // Remote CLIProxyAPI uses root path (e.g., /v1/messages), not /api/provider/{provider}/v1/messages
868
- // The /api/provider/ prefix is only for local CLIProxy instances
869
- const baseUrl = `${normalizedProtocol}://${remoteConfig.host}${portSuffix}`;
870
- // Get global env vars (DISABLE_TELEMETRY, etc.)
871
- const globalEnv = getGlobalEnvVars();
872
- // Load user settings with priority: custom path > user settings file > base config
873
- let userEnvVars = {};
874
- // Priority 1: Custom settings path (for user-defined variants)
875
- if (customSettingsPath) {
876
- const expandedPath = (0, helpers_1.expandPath)(customSettingsPath);
877
- if (fs.existsSync(expandedPath)) {
878
- try {
879
- const content = fs.readFileSync(expandedPath, 'utf-8');
880
- const settings = JSON.parse(content);
881
- if (settings.env && typeof settings.env === 'object') {
882
- userEnvVars = settings.env;
883
- }
884
- }
885
- catch {
886
- // Invalid JSON - fall through to provider defaults
887
- console.warn((0, ui_1.warn)(`Invalid settings file: ${customSettingsPath}`));
888
- }
889
- }
890
- }
891
- // Priority 2: Default provider settings file (~/.ccs/{provider}.settings.json)
892
- if (Object.keys(userEnvVars).length === 0) {
893
- const settingsPath = getProviderSettingsPath(provider);
894
- if (fs.existsSync(settingsPath)) {
895
- try {
896
- const content = fs.readFileSync(settingsPath, 'utf-8');
897
- const settings = JSON.parse(content);
898
- if (settings.env && typeof settings.env === 'object') {
899
- userEnvVars = settings.env;
900
- }
901
- }
902
- catch {
903
- // Invalid JSON - fall through to base config
904
- }
905
- }
906
- }
907
- // Priority 3: Base config defaults
908
- if (Object.keys(userEnvVars).length === 0) {
909
- const models = getModelMapping(provider);
910
- const baseEnvVars = (0, base_config_loader_1.getEnvVarsFromConfig)(provider);
911
- // Filter out URL/auth from base config (we'll set those from remote config)
912
- const { ANTHROPIC_BASE_URL: _baseUrl, ANTHROPIC_AUTH_TOKEN: _authToken, ...additionalEnvVars } = baseEnvVars;
913
- userEnvVars = {
914
- ...additionalEnvVars,
915
- ANTHROPIC_MODEL: models.claudeModel,
916
- ANTHROPIC_DEFAULT_OPUS_MODEL: models.opusModel || models.claudeModel,
917
- ANTHROPIC_DEFAULT_SONNET_MODEL: models.sonnetModel || models.claudeModel,
918
- ANTHROPIC_DEFAULT_HAIKU_MODEL: models.haikuModel || models.claudeModel,
919
- };
920
- }
921
- // Build final env: global + user settings + remote URL/auth override
922
- const env = {
923
- ...globalEnv,
924
- ...userEnvVars,
925
- // Always override URL and auth token with remote config
926
- ANTHROPIC_BASE_URL: baseUrl,
927
- ANTHROPIC_AUTH_TOKEN: remoteConfig.authToken || (0, auth_token_manager_1.getEffectiveApiKey)(),
928
- };
929
- return env;
930
- }
931
- exports.getRemoteEnvVars = getRemoteEnvVars;
932
- //# sourceMappingURL=config-generator.js.map