@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
@@ -2,8 +2,7 @@
2
2
  /**
3
3
  * Unified Config Loader
4
4
  *
5
- * Loads and saves the unified YAML configuration.
6
- * Provides fallback to legacy JSON format for backward compatibility.
5
+ * 精简版:加载和保存 YAML 配置,只保留核心功能。
7
6
  */
8
7
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
9
8
  if (k2 === undefined) k2 = k;
@@ -29,133 +28,95 @@ var __importStar = (this && this.__importStar) || function (mod) {
29
28
  return result;
30
29
  };
31
30
  Object.defineProperty(exports, "__esModule", { value: true });
32
- exports.getImageAnalysisConfig = exports.getDashboardAuthConfig = exports.getThinkingConfig = exports.getGlobalEnvConfig = exports.getWebSearchConfig = exports.setDefaultProfile = exports.getDefaultProfile = exports.isUnifiedMode = exports.updateUnifiedConfig = exports.saveUnifiedConfig = exports.loadOrCreateUnifiedConfig = exports.loadUnifiedConfig = exports.getConfigFormat = exports.hasLegacyConfig = exports.hasUnifiedConfig = exports.getConfigJsonPath = exports.getConfigYamlPath = void 0;
31
+ exports.getThinkingConfig = exports.getGlobalEnvConfig = exports.setDefaultProfile = exports.getDefaultProfile = exports.isUnifiedMode = exports.updateUnifiedConfig = exports.saveUnifiedConfig = exports.loadOrCreateUnifiedConfig = exports.loadUnifiedConfig = exports.getConfigFormat = exports.hasLegacyConfig = exports.hasUnifiedConfig = exports.getConfigJsonPath = exports.getConfigYamlPath = void 0;
33
32
  const fs = __importStar(require("fs"));
34
33
  const path = __importStar(require("path"));
35
34
  const yaml = __importStar(require("js-yaml"));
36
35
  const config_manager_1 = require("../utils/config-manager");
37
36
  const unified_config_types_1 = require("./unified-config-types");
38
- const feature_flags_1 = require("./feature-flags");
39
37
  const CONFIG_YAML = 'config.yaml';
40
38
  const CONFIG_JSON = 'config.json';
41
39
  const CONFIG_LOCK = 'config.yaml.lock';
42
- const LOCK_STALE_MS = 5000; // Lock is stale after 5 seconds
43
- /**
44
- * Get path to unified config.yaml
45
- */
40
+ const LOCK_STALE_MS = 5000;
46
41
  function getConfigYamlPath() {
47
42
  return path.join((0, config_manager_1.getCcsDir)(), CONFIG_YAML);
48
43
  }
49
44
  exports.getConfigYamlPath = getConfigYamlPath;
50
- /**
51
- * Get path to legacy config.json
52
- */
53
45
  function getConfigJsonPath() {
54
46
  return path.join((0, config_manager_1.getCcsDir)(), CONFIG_JSON);
55
47
  }
56
48
  exports.getConfigJsonPath = getConfigJsonPath;
57
- /**
58
- * Get path to config lockfile
59
- */
60
49
  function getLockFilePath() {
61
50
  return path.join((0, config_manager_1.getCcsDir)(), CONFIG_LOCK);
62
51
  }
63
- /**
64
- * Acquire lockfile for config write operations.
65
- * Returns true if lock acquired, false if already locked by another process.
66
- * Cleans up stale locks (older than LOCK_STALE_MS).
67
- */
68
52
  function acquireLock() {
69
53
  const lockPath = getLockFilePath();
70
54
  const lockData = `${process.pid}\n${Date.now()}`;
71
55
  try {
72
- // Check if lock exists
73
- if (fs.existsSync(lockPath)) {
56
+ // 尝试原子创建锁文件(wx = 排他写入,文件已存在则失败)
57
+ const fd = fs.openSync(lockPath, 'wx', 0o600);
58
+ fs.writeSync(fd, lockData);
59
+ fs.closeSync(fd);
60
+ return true;
61
+ }
62
+ catch (createError) {
63
+ // 文件已存在,检查是否过期
64
+ try {
74
65
  const content = fs.readFileSync(lockPath, 'utf8');
75
66
  const [pidStr, timestampStr] = content.trim().split('\n');
76
67
  const timestamp = parseInt(timestampStr, 10);
77
- // Check if lock is stale
78
68
  if (Date.now() - timestamp > LOCK_STALE_MS) {
79
- // Stale lock - remove and acquire
80
69
  fs.unlinkSync(lockPath);
70
+ return acquireLock();
81
71
  }
82
- else {
83
- // Check if process still exists
84
- try {
85
- process.kill(parseInt(pidStr, 10), 0); // Signal 0 checks if process exists
86
- // Process exists - lock is valid
87
- return false;
88
- }
89
- catch {
90
- // Process doesn't exist - remove stale lock
91
- fs.unlinkSync(lockPath);
92
- }
72
+ // 检查持锁进程是否存活
73
+ try {
74
+ process.kill(parseInt(pidStr, 10), 0);
75
+ return false; // 进程存活,锁有效
76
+ }
77
+ catch {
78
+ fs.unlinkSync(lockPath);
79
+ return acquireLock();
93
80
  }
94
81
  }
95
- // Acquire lock
96
- fs.writeFileSync(lockPath, lockData, { mode: 0o600 });
97
- return true;
98
- }
99
- catch {
100
- // Lock acquisition failed
101
- return false;
82
+ catch {
83
+ return false;
84
+ }
102
85
  }
103
86
  }
104
- /**
105
- * Release lockfile after config write operation.
106
- */
107
87
  function releaseLock() {
108
88
  const lockPath = getLockFilePath();
109
89
  try {
110
- if (fs.existsSync(lockPath)) {
90
+ if (fs.existsSync(lockPath))
111
91
  fs.unlinkSync(lockPath);
112
- }
113
92
  }
114
93
  catch {
115
- // Ignore cleanup errors
94
+ /* ignore */
116
95
  }
117
96
  }
118
- /**
119
- * Check if unified config.yaml exists
120
- */
121
97
  function hasUnifiedConfig() {
122
98
  return fs.existsSync(getConfigYamlPath());
123
99
  }
124
100
  exports.hasUnifiedConfig = hasUnifiedConfig;
125
- /**
126
- * Check if legacy config.json exists
127
- */
128
101
  function hasLegacyConfig() {
129
102
  return fs.existsSync(getConfigJsonPath());
130
103
  }
131
104
  exports.hasLegacyConfig = hasLegacyConfig;
132
- /**
133
- * Determine which config format is active.
134
- * Returns 'yaml' if unified config exists or is enabled,
135
- * 'json' if only legacy config exists,
136
- * 'none' if no config exists.
137
- */
138
105
  function getConfigFormat() {
139
106
  if (hasUnifiedConfig())
140
107
  return 'yaml';
141
- if ((0, feature_flags_1.isUnifiedConfigEnabled)())
142
- return 'yaml';
143
108
  if (hasLegacyConfig())
144
109
  return 'json';
145
110
  return 'none';
146
111
  }
147
112
  exports.getConfigFormat = getConfigFormat;
148
113
  /**
149
- * Load unified config from YAML file.
150
- * Returns null if file doesn't exist or format check fails.
151
- * Auto-upgrades config if version is outdated (regenerates comments).
114
+ * 加载 unified config。文件不存在或格式错误返回 null。
152
115
  */
153
116
  function loadUnifiedConfig() {
154
117
  const yamlPath = getConfigYamlPath();
155
- // If file doesn't exist, return null
156
- if (!fs.existsSync(yamlPath)) {
118
+ if (!fs.existsSync(yamlPath))
157
119
  return null;
158
- }
159
120
  try {
160
121
  const content = fs.readFileSync(yamlPath, 'utf8');
161
122
  const parsed = yaml.load(content);
@@ -163,35 +124,25 @@ function loadUnifiedConfig() {
163
124
  console.error(`[!] Invalid config format in ${yamlPath}`);
164
125
  return null;
165
126
  }
166
- // Auto-upgrade if version is outdated (regenerates YAML with new comments and fields)
127
+ // 版本升级
167
128
  if ((parsed.version ?? 1) < unified_config_types_1.UNIFIED_CONFIG_VERSION) {
168
- // Merge with defaults to add new fields (e.g., model for websearch providers)
169
129
  const upgraded = mergeWithDefaults(parsed);
170
130
  upgraded.version = unified_config_types_1.UNIFIED_CONFIG_VERSION;
171
131
  try {
172
132
  saveUnifiedConfig(upgraded);
173
- if (process.env.CCS_DEBUG) {
174
- console.error(`[i] Config upgraded to v${unified_config_types_1.UNIFIED_CONFIG_VERSION}`);
175
- }
176
133
  return upgraded;
177
134
  }
178
- catch (saveError) {
179
- console.error('[!] Config upgrade failed to save:', saveError.message);
180
- // Continue using the upgraded version in-memory even if save fails
135
+ catch {
136
+ // 保存失败也返回内存中的升级版本
181
137
  }
182
138
  }
183
139
  return parsed;
184
140
  }
185
141
  catch (err) {
186
- // U3: Provide better context for YAML syntax errors
187
142
  if (err instanceof yaml.YAMLException) {
188
143
  const mark = err.mark;
189
144
  console.error(`[X] YAML syntax error in ${yamlPath}:`);
190
145
  console.error(` Line ${(mark?.line ?? 0) + 1}, Column ${(mark?.column ?? 0) + 1}: ${err.reason || 'Invalid syntax'}`);
191
- if (mark?.snippet) {
192
- console.error(` ${mark.snippet}`);
193
- }
194
- console.error(` Tip: Check for missing colons, incorrect indentation, or unquoted special characters.`);
195
146
  }
196
147
  else {
197
148
  const error = err instanceof Error ? err.message : 'Unknown error';
@@ -201,128 +152,21 @@ function loadUnifiedConfig() {
201
152
  }
202
153
  }
203
154
  exports.loadUnifiedConfig = loadUnifiedConfig;
204
- /**
205
- * Merge partial config with defaults.
206
- * Preserves existing data while filling in missing sections.
207
- */
208
155
  function mergeWithDefaults(partial) {
209
156
  const defaults = (0, unified_config_types_1.createEmptyUnifiedConfig)();
210
157
  return {
211
158
  version: partial.version ?? defaults.version,
212
159
  setup_completed: partial.setup_completed,
213
160
  default: partial.default ?? defaults.default,
214
- accounts: partial.accounts ?? defaults.accounts,
215
161
  profiles: partial.profiles ?? defaults.profiles,
216
- cliproxy: {
217
- oauth_accounts: partial.cliproxy?.oauth_accounts ?? defaults.cliproxy.oauth_accounts,
218
- providers: defaults.cliproxy.providers, // Always use defaults for providers
219
- variants: partial.cliproxy?.variants ?? defaults.cliproxy.variants,
220
- logging: {
221
- enabled: partial.cliproxy?.logging?.enabled ?? defaults.cliproxy.logging?.enabled ?? false,
222
- request_log: partial.cliproxy?.logging?.request_log ?? defaults.cliproxy.logging?.request_log ?? false,
223
- },
224
- // Auth config - preserve user values, no defaults (uses constants as fallback)
225
- auth: partial.cliproxy?.auth,
226
- // Backend selection - validate and preserve user choice (original vs plus)
227
- backend: partial.cliproxy?.backend === 'original' || partial.cliproxy?.backend === 'plus'
228
- ? partial.cliproxy.backend
229
- : undefined, // Invalid values become undefined (defaults to 'plus' at runtime)
230
- // Auto-sync - default to true
231
- auto_sync: partial.cliproxy?.auto_sync ?? defaults.cliproxy.auto_sync ?? true,
232
- },
233
162
  preferences: {
234
163
  ...defaults.preferences,
235
164
  ...partial.preferences,
236
165
  },
237
- websearch: {
238
- enabled: partial.websearch?.enabled ?? defaults.websearch?.enabled ?? true,
239
- providers: {
240
- gemini: {
241
- enabled: partial.websearch?.providers?.gemini?.enabled ??
242
- partial.websearch?.gemini?.enabled ?? // Legacy fallback
243
- true,
244
- model: partial.websearch?.providers?.gemini?.model ?? 'gemini-2.5-flash',
245
- timeout: partial.websearch?.providers?.gemini?.timeout ??
246
- partial.websearch?.gemini?.timeout ?? // Legacy fallback
247
- 55,
248
- },
249
- opencode: {
250
- enabled: partial.websearch?.providers?.opencode?.enabled ?? false,
251
- model: partial.websearch?.providers?.opencode?.model ?? 'opencode/grok-code',
252
- timeout: partial.websearch?.providers?.opencode?.timeout ?? 90,
253
- },
254
- grok: {
255
- enabled: partial.websearch?.providers?.grok?.enabled ?? false,
256
- timeout: partial.websearch?.providers?.grok?.timeout ?? 55,
257
- },
258
- },
259
- // Legacy fields (keep for backwards compatibility during read)
260
- gemini: partial.websearch?.gemini,
261
- },
262
- // Copilot config - strictly opt-in, merge with defaults
263
- copilot: {
264
- enabled: partial.copilot?.enabled ?? unified_config_types_1.DEFAULT_COPILOT_CONFIG.enabled,
265
- auto_start: partial.copilot?.auto_start ?? unified_config_types_1.DEFAULT_COPILOT_CONFIG.auto_start,
266
- port: partial.copilot?.port ?? unified_config_types_1.DEFAULT_COPILOT_CONFIG.port,
267
- account_type: partial.copilot?.account_type ?? unified_config_types_1.DEFAULT_COPILOT_CONFIG.account_type,
268
- rate_limit: partial.copilot?.rate_limit ?? unified_config_types_1.DEFAULT_COPILOT_CONFIG.rate_limit,
269
- wait_on_limit: partial.copilot?.wait_on_limit ?? unified_config_types_1.DEFAULT_COPILOT_CONFIG.wait_on_limit,
270
- model: partial.copilot?.model ?? unified_config_types_1.DEFAULT_COPILOT_CONFIG.model,
271
- },
272
- // Global env - injected into all non-Claude subscription profiles
273
166
  global_env: {
274
167
  enabled: partial.global_env?.enabled ?? true,
275
168
  env: partial.global_env?.env ?? { ...unified_config_types_1.DEFAULT_GLOBAL_ENV },
276
169
  },
277
- // CLIProxy server config - remote/local CLIProxyAPI settings
278
- cliproxy_server: {
279
- remote: {
280
- enabled: partial.cliproxy_server?.remote?.enabled ?? unified_config_types_1.DEFAULT_CLIPROXY_SERVER_CONFIG.remote.enabled,
281
- host: partial.cliproxy_server?.remote?.host ?? unified_config_types_1.DEFAULT_CLIPROXY_SERVER_CONFIG.remote.host,
282
- // Port is optional - undefined means use protocol default (443 for HTTPS, 8317 for HTTP)
283
- port: partial.cliproxy_server?.remote?.port,
284
- protocol: partial.cliproxy_server?.remote?.protocol ??
285
- unified_config_types_1.DEFAULT_CLIPROXY_SERVER_CONFIG.remote.protocol,
286
- auth_token: partial.cliproxy_server?.remote?.auth_token ??
287
- unified_config_types_1.DEFAULT_CLIPROXY_SERVER_CONFIG.remote.auth_token,
288
- // management_key is optional - falls back to auth_token when not set
289
- management_key: partial.cliproxy_server?.remote?.management_key,
290
- },
291
- fallback: {
292
- enabled: partial.cliproxy_server?.fallback?.enabled ??
293
- unified_config_types_1.DEFAULT_CLIPROXY_SERVER_CONFIG.fallback.enabled,
294
- auto_start: partial.cliproxy_server?.fallback?.auto_start ??
295
- unified_config_types_1.DEFAULT_CLIPROXY_SERVER_CONFIG.fallback.auto_start,
296
- },
297
- local: {
298
- port: partial.cliproxy_server?.local?.port ?? unified_config_types_1.DEFAULT_CLIPROXY_SERVER_CONFIG.local.port,
299
- auto_start: partial.cliproxy_server?.local?.auto_start ??
300
- unified_config_types_1.DEFAULT_CLIPROXY_SERVER_CONFIG.local.auto_start,
301
- },
302
- },
303
- // Quota management config - hybrid auto+manual account selection
304
- quota_management: {
305
- mode: partial.quota_management?.mode ?? unified_config_types_1.DEFAULT_QUOTA_MANAGEMENT_CONFIG.mode,
306
- auto: {
307
- preflight_check: partial.quota_management?.auto?.preflight_check ??
308
- unified_config_types_1.DEFAULT_QUOTA_MANAGEMENT_CONFIG.auto.preflight_check,
309
- exhaustion_threshold: partial.quota_management?.auto?.exhaustion_threshold ??
310
- unified_config_types_1.DEFAULT_QUOTA_MANAGEMENT_CONFIG.auto.exhaustion_threshold,
311
- tier_priority: partial.quota_management?.auto?.tier_priority ??
312
- unified_config_types_1.DEFAULT_QUOTA_MANAGEMENT_CONFIG.auto.tier_priority,
313
- cooldown_minutes: partial.quota_management?.auto?.cooldown_minutes ??
314
- unified_config_types_1.DEFAULT_QUOTA_MANAGEMENT_CONFIG.auto.cooldown_minutes,
315
- },
316
- manual: {
317
- paused_accounts: partial.quota_management?.manual?.paused_accounts ??
318
- unified_config_types_1.DEFAULT_QUOTA_MANAGEMENT_CONFIG.manual.paused_accounts,
319
- forced_default: partial.quota_management?.manual?.forced_default ??
320
- unified_config_types_1.DEFAULT_QUOTA_MANAGEMENT_CONFIG.manual.forced_default,
321
- tier_lock: partial.quota_management?.manual?.tier_lock ??
322
- unified_config_types_1.DEFAULT_QUOTA_MANAGEMENT_CONFIG.manual.tier_lock,
323
- },
324
- },
325
- // Thinking config - auto/manual/off control for reasoning budget
326
170
  thinking: {
327
171
  mode: partial.thinking?.mode ?? unified_config_types_1.DEFAULT_THINKING_CONFIG.mode,
328
172
  override: partial.thinking?.override,
@@ -334,103 +178,40 @@ function mergeWithDefaults(partial) {
334
178
  provider_overrides: partial.thinking?.provider_overrides,
335
179
  show_warnings: partial.thinking?.show_warnings ?? unified_config_types_1.DEFAULT_THINKING_CONFIG.show_warnings,
336
180
  },
337
- // Dashboard auth config - disabled by default
338
- dashboard_auth: {
339
- enabled: partial.dashboard_auth?.enabled ?? unified_config_types_1.DEFAULT_DASHBOARD_AUTH_CONFIG.enabled,
340
- username: partial.dashboard_auth?.username ?? unified_config_types_1.DEFAULT_DASHBOARD_AUTH_CONFIG.username,
341
- password_hash: partial.dashboard_auth?.password_hash ?? unified_config_types_1.DEFAULT_DASHBOARD_AUTH_CONFIG.password_hash,
342
- session_timeout_hours: partial.dashboard_auth?.session_timeout_hours ??
343
- unified_config_types_1.DEFAULT_DASHBOARD_AUTH_CONFIG.session_timeout_hours,
344
- },
345
- // Image analysis config - enabled by default for CLIProxy providers
346
- image_analysis: {
347
- enabled: partial.image_analysis?.enabled ?? unified_config_types_1.DEFAULT_IMAGE_ANALYSIS_CONFIG.enabled,
348
- timeout: partial.image_analysis?.timeout ?? unified_config_types_1.DEFAULT_IMAGE_ANALYSIS_CONFIG.timeout,
349
- provider_models: partial.image_analysis?.provider_models ?? unified_config_types_1.DEFAULT_IMAGE_ANALYSIS_CONFIG.provider_models,
350
- },
351
- // Router config - scenario-based routing for sub-agents
352
- router: partial.router,
353
181
  };
354
182
  }
355
- /**
356
- * Load config, preferring YAML if available, falling back to creating empty config.
357
- * Merges with defaults to ensure all sections exist.
358
- */
359
183
  function loadOrCreateUnifiedConfig() {
360
184
  const existing = loadUnifiedConfig();
361
- if (existing) {
362
- // Merge with defaults to fill any missing sections
185
+ if (existing)
363
186
  return mergeWithDefaults(existing);
364
- }
365
- // Create empty config
366
- const config = (0, unified_config_types_1.createEmptyUnifiedConfig)();
367
- return config;
187
+ return (0, unified_config_types_1.createEmptyUnifiedConfig)();
368
188
  }
369
189
  exports.loadOrCreateUnifiedConfig = loadOrCreateUnifiedConfig;
370
- /**
371
- * Generate YAML header with helpful comments.
372
- */
373
190
  function generateYamlHeader() {
374
191
  return `# CCS Unified Configuration
375
192
  # Docs: https://github.com/kaitranntt/ccs
376
193
  `;
377
194
  }
378
- /**
379
- * Generate YAML content with section comments for better readability.
380
- */
381
195
  function generateYamlWithComments(config) {
382
196
  const lines = [];
383
- // Version
384
197
  lines.push(`version: ${config.version}`);
385
198
  if (config.setup_completed !== undefined) {
386
199
  lines.push(`setup_completed: ${config.setup_completed}`);
387
200
  }
388
201
  lines.push('');
389
- // Default
390
202
  if (config.default) {
391
203
  lines.push(`# Default profile used when running 'ccs' without arguments`);
392
204
  lines.push(`default: "${config.default}"`);
393
205
  lines.push('');
394
206
  }
395
- // Accounts section
396
- lines.push('# ----------------------------------------------------------------------------');
397
- lines.push('# Accounts: Isolated Claude instances (each with separate auth/sessions)');
398
- lines.push('# Manage with: ccs auth add <name>, ccs auth list, ccs auth remove <name>');
399
- lines.push('# ----------------------------------------------------------------------------');
400
- lines.push(yaml.dump({ accounts: config.accounts }, { indent: 2, lineWidth: -1, quotingType: '"' }).trim());
401
- lines.push('');
402
- // Profiles section
207
+ // Profiles
403
208
  lines.push('# ----------------------------------------------------------------------------');
404
209
  lines.push('# Profiles: API-based providers (GLM, GLMT, Kimi, custom endpoints)');
405
210
  lines.push('# Each profile points to a *.settings.json file containing env vars.');
406
- lines.push('# Edit the settings file directly to customize (ANTHROPIC_MAX_TOKENS, etc.)');
407
211
  lines.push('# ----------------------------------------------------------------------------');
408
212
  lines.push(yaml.dump({ profiles: config.profiles }, { indent: 2, lineWidth: -1, quotingType: '"' }).trim());
409
213
  lines.push('');
410
- // CLIProxy section
411
- lines.push('# ----------------------------------------------------------------------------');
412
- lines.push('# CLIProxy: OAuth-based providers (gemini, codex, agy, qwen, iflow)');
413
- lines.push('# Each variant can reference a *.settings.json file for custom env vars.');
414
- lines.push('# Edit the settings file directly to customize model or other settings.');
415
- lines.push('# ----------------------------------------------------------------------------');
416
- lines.push(yaml.dump({ cliproxy: config.cliproxy }, { indent: 2, lineWidth: -1, quotingType: '"' }).trim());
417
- lines.push('');
418
- // CLIProxy Server section (remote proxy configuration) - placed right after cliproxy
419
- if (config.cliproxy_server) {
420
- lines.push('# ----------------------------------------------------------------------------');
421
- lines.push('# CLIProxy Server: Remote proxy connection settings');
422
- lines.push('# Configure via Dashboard (`ccs config`) > Proxy tab.');
423
- lines.push('#');
424
- lines.push('# remote: Connect to a remote CLIProxyAPI instance');
425
- lines.push('# fallback: Use local proxy if remote is unreachable');
426
- lines.push('# local: Local proxy settings (port, auto-start)');
427
- lines.push('# ----------------------------------------------------------------------------');
428
- lines.push(yaml
429
- .dump({ cliproxy_server: config.cliproxy_server }, { indent: 2, lineWidth: -1, quotingType: '"' })
430
- .trim());
431
- lines.push('');
432
- }
433
- // Preferences section
214
+ // Preferences
434
215
  lines.push('# ----------------------------------------------------------------------------');
435
216
  lines.push('# Preferences: User settings');
436
217
  lines.push('# ----------------------------------------------------------------------------');
@@ -438,144 +219,32 @@ function generateYamlWithComments(config) {
438
219
  .dump({ preferences: config.preferences }, { indent: 2, lineWidth: -1, quotingType: '"' })
439
220
  .trim());
440
221
  lines.push('');
441
- // WebSearch section
442
- if (config.websearch) {
443
- lines.push('# ----------------------------------------------------------------------------');
444
- lines.push('# WebSearch: CLI-based web search for third-party profiles');
445
- lines.push('# Dashboard (`ccs config`) is the source of truth for provider selection.');
446
- lines.push('#');
447
- lines.push('# Third-party providers (gemini, codex, agy, etc.) do not have access to');
448
- lines.push("# Anthropic's WebSearch tool. These CLI tools provide fallback web search.");
449
- lines.push('#');
450
- lines.push('# Fallback chain: Gemini -> OpenCode -> Grok (tries in order until success)');
451
- lines.push('#');
452
- lines.push('# Gemini models: gemini-2.5-flash (default), gemini-2.5-pro, gemini-2.5-flash-lite');
453
- lines.push('# OpenCode models: opencode/grok-code (default), opencode/gpt-4o, opencode/claude-3.5-sonnet');
454
- lines.push('#');
455
- lines.push('# Install commands:');
456
- lines.push('# gemini: npm i -g @google/gemini-cli (FREE - 1000 req/day)');
457
- lines.push('# opencode: curl -fsSL https://opencode.ai/install | bash (FREE via Zen)');
458
- lines.push('# grok: npm i -g @vibe-kit/grok-cli (requires GROK_API_KEY)');
459
- lines.push('# ----------------------------------------------------------------------------');
460
- lines.push(yaml
461
- .dump({ websearch: config.websearch }, { indent: 2, lineWidth: -1, quotingType: '"' })
462
- .trim());
463
- lines.push('');
464
- }
465
- // Copilot section (GitHub Copilot proxy)
466
- if (config.copilot) {
467
- lines.push('# ----------------------------------------------------------------------------');
468
- lines.push('# Copilot: GitHub Copilot API proxy (via copilot-api)');
469
- lines.push('# Uses your existing GitHub Copilot subscription with Claude Code.');
470
- lines.push('#');
471
- lines.push('# !! DISCLAIMER - USE AT YOUR OWN RISK !!');
472
- lines.push('# This uses an UNOFFICIAL reverse-engineered API.');
473
- lines.push('# Excessive usage may trigger GitHub account restrictions.');
474
- lines.push('# CCS provides NO WARRANTY and accepts NO RESPONSIBILITY for consequences.');
475
- lines.push('#');
476
- lines.push('# Setup: npx copilot-api auth (authenticate with GitHub)');
477
- lines.push('# Usage: ccs copilot (switch to copilot profile)');
478
- lines.push('#');
479
- lines.push('# Models: claude-sonnet-4.5, claude-opus-4.5, gpt-5.1, gemini-2.5-pro');
480
- lines.push('# Account types: individual, business, enterprise');
481
- lines.push('# ----------------------------------------------------------------------------');
482
- lines.push(yaml.dump({ copilot: config.copilot }, { indent: 2, lineWidth: -1, quotingType: '"' }).trim());
483
- lines.push('');
484
- }
485
- // Global env section
222
+ // Global env
486
223
  if (config.global_env) {
487
224
  lines.push('# ----------------------------------------------------------------------------');
488
225
  lines.push('# Global Environment Variables: Injected into all non-Claude subscription profiles');
489
- lines.push('# These env vars disable telemetry/reporting for third-party providers.');
490
- lines.push('# Configure via Dashboard (`ccs config`) > Global Env tab.');
491
- lines.push('#');
492
- lines.push('# Default variables:');
493
- lines.push('# DISABLE_BUG_COMMAND: Disables /bug command (not supported by proxy)');
494
- lines.push('# DISABLE_ERROR_REPORTING: Disables error reporting to Anthropic');
495
- lines.push('# DISABLE_TELEMETRY: Disables usage telemetry');
496
226
  lines.push('# ----------------------------------------------------------------------------');
497
227
  lines.push(yaml
498
228
  .dump({ global_env: config.global_env }, { indent: 2, lineWidth: -1, quotingType: '"' })
499
229
  .trim());
500
230
  lines.push('');
501
231
  }
502
- // Thinking section (extended thinking/reasoning configuration)
232
+ // Thinking
503
233
  if (config.thinking) {
504
234
  lines.push('# ----------------------------------------------------------------------------');
505
235
  lines.push('# Thinking: Extended thinking/reasoning budget configuration');
506
- lines.push('# Controls reasoning depth for supported providers (agy, gemini, codex).');
507
- lines.push('#');
508
236
  lines.push('# Modes: auto (use tier_defaults), off (disable), manual (--thinking flag only)');
509
- lines.push('# Levels: minimal (512), low (1K), medium (8K), high (24K), xhigh (32K), auto');
510
- lines.push('# Override: Set global override value (number or level name)');
511
- lines.push('# Provider overrides: Per-provider tier defaults');
512
237
  lines.push('# ----------------------------------------------------------------------------');
513
238
  lines.push(yaml
514
239
  .dump({ thinking: config.thinking }, { indent: 2, lineWidth: -1, quotingType: '"' })
515
240
  .trim());
516
241
  lines.push('');
517
242
  }
518
- // Dashboard auth section (only if configured)
519
- if (config.dashboard_auth?.enabled) {
520
- lines.push('# ----------------------------------------------------------------------------');
521
- lines.push('# Dashboard Auth: Optional login protection for CCS dashboard');
522
- lines.push('# Generate password hash: npx bcrypt-cli hash "your-password"');
523
- lines.push('# ENV override: CCS_DASHBOARD_AUTH_ENABLED, CCS_DASHBOARD_USERNAME, CCS_DASHBOARD_PASSWORD_HASH');
524
- lines.push('# ----------------------------------------------------------------------------');
525
- lines.push(yaml
526
- .dump({ dashboard_auth: config.dashboard_auth }, { indent: 2, lineWidth: -1, quotingType: '"' })
527
- .trim());
528
- lines.push('');
529
- }
530
- // Image analysis section
531
- if (config.image_analysis) {
532
- lines.push('# ----------------------------------------------------------------------------');
533
- lines.push('# Image Analysis: Vision-based analysis for images and PDFs');
534
- lines.push('# Routes Read tool requests for images/PDFs through CLIProxy vision API.');
535
- lines.push('#');
536
- lines.push('# When enabled: Image files trigger vision analysis instead of raw file read');
537
- lines.push('# Provider models: Vision model used for each CLIProxy provider');
538
- lines.push('# Timeout: Maximum seconds to wait for analysis (10-600)');
539
- lines.push('#');
540
- lines.push('# Supported formats: .jpg, .jpeg, .png, .gif, .webp, .heic, .bmp, .tiff, .pdf');
541
- lines.push('# Configure via: ccs config image-analysis');
542
- lines.push('# ----------------------------------------------------------------------------');
543
- lines.push(yaml
544
- .dump({ image_analysis: config.image_analysis }, { indent: 2, lineWidth: -1, quotingType: '"' })
545
- .trim());
546
- lines.push('');
547
- }
548
- // Router section (scenario routing for sub-agents)
549
- if (config.router) {
550
- lines.push('# ----------------------------------------------------------------------------');
551
- lines.push('# Router: Scenario-based routing for Claude sub-agents');
552
- lines.push('# Routes different request types (background, think, webSearch) to profiles.');
553
- lines.push('#');
554
- lines.push('# Scenarios:');
555
- lines.push('# default - Fallback for unmatched requests');
556
- lines.push('# background - Claude background/haiku sub-agents');
557
- lines.push('# think - Extended thinking requests');
558
- lines.push('# longContext - Requests exceeding token threshold');
559
- lines.push('# webSearch - Web search tool requests');
560
- lines.push('#');
561
- lines.push('# Configure via: ccs router set <scenario> <profile>');
562
- lines.push('# ----------------------------------------------------------------------------');
563
- lines.push(yaml
564
- .dump({ router: config.router }, { indent: 2, lineWidth: -1, quotingType: '"' })
565
- .trim());
566
- lines.push('');
567
- }
568
243
  return lines.join('\n');
569
244
  }
570
- /**
571
- * Save unified config to YAML file.
572
- * Uses atomic write (temp file + rename) to prevent corruption.
573
- * Uses lockfile to prevent concurrent writes.
574
- */
575
245
  function saveUnifiedConfig(config) {
576
246
  const yamlPath = getConfigYamlPath();
577
247
  const dir = path.dirname(yamlPath);
578
- // Acquire lock (retry for up to 1 second)
579
248
  const maxRetries = 10;
580
249
  const retryDelayMs = 100;
581
250
  let lockAcquired = false;
@@ -584,41 +253,34 @@ function saveUnifiedConfig(config) {
584
253
  lockAcquired = true;
585
254
  break;
586
255
  }
587
- // Synchronous sleep without CPU-intensive busy-wait
588
- // Uses Atomics.wait which properly sleeps the thread
589
- // Note: saveUnifiedConfig is sync API with 19+ callers, converting to async not feasible
590
- Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, retryDelayMs);
256
+ // 同步忙等待,避免阻塞事件循环的 Atomics.wait
257
+ const waitUntil = Date.now() + retryDelayMs;
258
+ while (Date.now() < waitUntil) { /* spin */ }
591
259
  }
592
260
  if (!lockAcquired) {
593
261
  throw new Error('Config file is locked by another process. Wait a moment and try again.');
594
262
  }
595
263
  try {
596
- // Ensure directory exists
597
264
  if (!fs.existsSync(dir)) {
598
265
  fs.mkdirSync(dir, { recursive: true, mode: 0o700 });
599
266
  }
600
- // Ensure version is set
601
267
  config.version = unified_config_types_1.UNIFIED_CONFIG_VERSION;
602
- // Generate YAML with section comments
603
268
  const yamlContent = generateYamlWithComments(config);
604
269
  const content = generateYamlHeader() + yamlContent;
605
- // Atomic write: write to temp file, then rename
606
270
  const tempPath = `${yamlPath}.tmp.${process.pid}`;
607
271
  try {
608
272
  fs.writeFileSync(tempPath, content, { mode: 0o600 });
609
273
  fs.renameSync(tempPath, yamlPath);
610
274
  }
611
275
  catch (error) {
612
- // Clean up temp file on error
613
276
  if (fs.existsSync(tempPath)) {
614
277
  try {
615
278
  fs.unlinkSync(tempPath);
616
279
  }
617
280
  catch {
618
- // Ignore cleanup errors
281
+ /* ignore */
619
282
  }
620
283
  }
621
- // Classify filesystem errors
622
284
  const err = error;
623
285
  if (err.code === 'ENOSPC') {
624
286
  throw new Error('Disk full - cannot save config. Free up space and try again.');
@@ -630,15 +292,10 @@ function saveUnifiedConfig(config) {
630
292
  }
631
293
  }
632
294
  finally {
633
- // Always release lock
634
295
  releaseLock();
635
296
  }
636
297
  }
637
298
  exports.saveUnifiedConfig = saveUnifiedConfig;
638
- /**
639
- * Update unified config with partial data.
640
- * Loads existing config, merges changes, and saves.
641
- */
642
299
  function updateUnifiedConfig(updates) {
643
300
  const config = loadOrCreateUnifiedConfig();
644
301
  const updated = { ...config, ...updates };
@@ -646,19 +303,10 @@ function updateUnifiedConfig(updates) {
646
303
  return updated;
647
304
  }
648
305
  exports.updateUnifiedConfig = updateUnifiedConfig;
649
- /**
650
- * Check if unified config mode is active.
651
- * Returns true if config.yaml exists OR CCS_UNIFIED_CONFIG=1.
652
- *
653
- * Use this centralized function instead of duplicating the logic.
654
- */
655
306
  function isUnifiedMode() {
656
- return hasUnifiedConfig() || (0, feature_flags_1.isUnifiedConfigEnabled)();
307
+ return hasUnifiedConfig();
657
308
  }
658
309
  exports.isUnifiedMode = isUnifiedMode;
659
- /**
660
- * Get or set default profile name.
661
- */
662
310
  function getDefaultProfile() {
663
311
  const config = loadUnifiedConfig();
664
312
  return config?.default;
@@ -668,47 +316,6 @@ function setDefaultProfile(name) {
668
316
  updateUnifiedConfig({ default: name });
669
317
  }
670
318
  exports.setDefaultProfile = setDefaultProfile;
671
- /**
672
- * Get websearch configuration.
673
- * Returns defaults if not configured.
674
- * Supports Gemini CLI, OpenCode, and Grok CLI providers.
675
- */
676
- function getWebSearchConfig() {
677
- const config = loadOrCreateUnifiedConfig();
678
- // Build provider configs
679
- const geminiConfig = {
680
- enabled: config.websearch?.providers?.gemini?.enabled ?? config.websearch?.gemini?.enabled ?? true,
681
- model: config.websearch?.providers?.gemini?.model ?? 'gemini-2.5-flash',
682
- timeout: config.websearch?.providers?.gemini?.timeout ?? config.websearch?.gemini?.timeout ?? 55,
683
- };
684
- const opencodeConfig = {
685
- enabled: config.websearch?.providers?.opencode?.enabled ?? false,
686
- model: config.websearch?.providers?.opencode?.model ?? 'opencode/grok-code',
687
- timeout: config.websearch?.providers?.opencode?.timeout ?? 90,
688
- };
689
- const grokConfig = {
690
- enabled: config.websearch?.providers?.grok?.enabled ?? false,
691
- timeout: config.websearch?.providers?.grok?.timeout ?? 55,
692
- };
693
- // Auto-enable master switch if ANY provider is enabled
694
- const anyProviderEnabled = geminiConfig.enabled || opencodeConfig.enabled || grokConfig.enabled;
695
- const enabled = anyProviderEnabled && (config.websearch?.enabled ?? true);
696
- return {
697
- enabled,
698
- providers: {
699
- gemini: geminiConfig,
700
- opencode: opencodeConfig,
701
- grok: grokConfig,
702
- },
703
- // Legacy field for backwards compatibility
704
- gemini: config.websearch?.gemini,
705
- };
706
- }
707
- exports.getWebSearchConfig = getWebSearchConfig;
708
- /**
709
- * Get global_env configuration.
710
- * Returns defaults if not configured.
711
- */
712
319
  function getGlobalEnvConfig() {
713
320
  const config = loadOrCreateUnifiedConfig();
714
321
  return {
@@ -717,16 +324,10 @@ function getGlobalEnvConfig() {
717
324
  };
718
325
  }
719
326
  exports.getGlobalEnvConfig = getGlobalEnvConfig;
720
- /**
721
- * Get thinking configuration.
722
- * Returns defaults if not configured.
723
- */
724
327
  function getThinkingConfig() {
725
328
  const config = loadOrCreateUnifiedConfig();
726
- // W2: Check for invalid thinking config (e.g., thinking: true instead of object)
727
329
  if (config.thinking !== undefined && typeof config.thinking !== 'object') {
728
330
  console.warn(`[!] Invalid thinking config: expected object, got ${typeof config.thinking}. Using defaults.`);
729
- console.warn(` Tip: Use 'thinking: { mode: auto }' instead of 'thinking: true'`);
730
331
  return unified_config_types_1.DEFAULT_THINKING_CONFIG;
731
332
  }
732
333
  return {
@@ -742,37 +343,4 @@ function getThinkingConfig() {
742
343
  };
743
344
  }
744
345
  exports.getThinkingConfig = getThinkingConfig;
745
- /**
746
- * Get dashboard_auth configuration with ENV var override.
747
- * Priority: ENV vars > config.yaml > defaults
748
- */
749
- function getDashboardAuthConfig() {
750
- const config = loadOrCreateUnifiedConfig();
751
- // ENV vars take precedence
752
- const envEnabled = process.env.CCS_DASHBOARD_AUTH_ENABLED;
753
- const envUsername = process.env.CCS_DASHBOARD_USERNAME;
754
- const envPasswordHash = process.env.CCS_DASHBOARD_PASSWORD_HASH;
755
- return {
756
- enabled: envEnabled !== undefined
757
- ? envEnabled === 'true' || envEnabled === '1'
758
- : (config.dashboard_auth?.enabled ?? false),
759
- username: envUsername ?? config.dashboard_auth?.username ?? '',
760
- password_hash: envPasswordHash ?? config.dashboard_auth?.password_hash ?? '',
761
- session_timeout_hours: config.dashboard_auth?.session_timeout_hours ?? 24,
762
- };
763
- }
764
- exports.getDashboardAuthConfig = getDashboardAuthConfig;
765
- /**
766
- * Get image_analysis configuration.
767
- * Returns defaults if not configured.
768
- */
769
- function getImageAnalysisConfig() {
770
- const config = loadOrCreateUnifiedConfig();
771
- return {
772
- enabled: config.image_analysis?.enabled ?? unified_config_types_1.DEFAULT_IMAGE_ANALYSIS_CONFIG.enabled,
773
- timeout: config.image_analysis?.timeout ?? unified_config_types_1.DEFAULT_IMAGE_ANALYSIS_CONFIG.timeout,
774
- provider_models: config.image_analysis?.provider_models ?? unified_config_types_1.DEFAULT_IMAGE_ANALYSIS_CONFIG.provider_models,
775
- };
776
- }
777
- exports.getImageAnalysisConfig = getImageAnalysisConfig;
778
346
  //# sourceMappingURL=unified-config-loader.js.map