ccjk 12.0.7 → 12.0.8

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 (299) hide show
  1. package/package.json +1 -1
  2. package/dist/chunks/agent-teams.mjs +0 -136
  3. package/dist/chunks/agent.mjs +0 -1439
  4. package/dist/chunks/agents.mjs +0 -3778
  5. package/dist/chunks/api-cli.mjs +0 -132
  6. package/dist/chunks/api-providers.mjs +0 -129
  7. package/dist/chunks/api.mjs +0 -112
  8. package/dist/chunks/auto-bootstrap.mjs +0 -358
  9. package/dist/chunks/auto-init.mjs +0 -7584
  10. package/dist/chunks/auto-updater.mjs +0 -410
  11. package/dist/chunks/banner.mjs +0 -188
  12. package/dist/chunks/bash.mjs +0 -187
  13. package/dist/chunks/boost.mjs +0 -397
  14. package/dist/chunks/ccjk-agents.mjs +0 -414
  15. package/dist/chunks/ccjk-all.mjs +0 -1028
  16. package/dist/chunks/ccjk-config.mjs +0 -261
  17. package/dist/chunks/ccjk-hooks.mjs +0 -1074
  18. package/dist/chunks/ccjk-mcp.mjs +0 -761
  19. package/dist/chunks/ccjk-setup.mjs +0 -763
  20. package/dist/chunks/ccjk-skills.mjs +0 -514
  21. package/dist/chunks/ccr.mjs +0 -98
  22. package/dist/chunks/ccu.mjs +0 -40
  23. package/dist/chunks/check-updates.mjs +0 -108
  24. package/dist/chunks/claude-code-config-manager.mjs +0 -750
  25. package/dist/chunks/claude-code-incremental-manager.mjs +0 -623
  26. package/dist/chunks/claude-config.mjs +0 -236
  27. package/dist/chunks/claude-wrapper.mjs +0 -85
  28. package/dist/chunks/cleanup-migration.mjs +0 -20
  29. package/dist/chunks/cli-hook.mjs +0 -2285
  30. package/dist/chunks/cloud-sync.mjs +0 -29
  31. package/dist/chunks/codex-config-switch.mjs +0 -451
  32. package/dist/chunks/codex-provider-manager.mjs +0 -236
  33. package/dist/chunks/codex-uninstaller.mjs +0 -404
  34. package/dist/chunks/codex.mjs +0 -2077
  35. package/dist/chunks/commands.mjs +0 -108
  36. package/dist/chunks/commands2.mjs +0 -413
  37. package/dist/chunks/commit.mjs +0 -138
  38. package/dist/chunks/completion.mjs +0 -515
  39. package/dist/chunks/config-consolidator.mjs +0 -172
  40. package/dist/chunks/config-switch.mjs +0 -317
  41. package/dist/chunks/config.mjs +0 -379
  42. package/dist/chunks/config2.mjs +0 -477
  43. package/dist/chunks/config3.mjs +0 -470
  44. package/dist/chunks/constants.mjs +0 -133
  45. package/dist/chunks/context-loader.mjs +0 -343
  46. package/dist/chunks/context.mjs +0 -372
  47. package/dist/chunks/convoy-manager.mjs +0 -880
  48. package/dist/chunks/dashboard.mjs +0 -476
  49. package/dist/chunks/doctor.mjs +0 -964
  50. package/dist/chunks/evolution.mjs +0 -382
  51. package/dist/chunks/features.mjs +0 -698
  52. package/dist/chunks/fish.mjs +0 -181
  53. package/dist/chunks/fs-operations.mjs +0 -192
  54. package/dist/chunks/health-alerts.mjs +0 -304
  55. package/dist/chunks/health-check.mjs +0 -532
  56. package/dist/chunks/help.mjs +0 -340
  57. package/dist/chunks/hook-installer.mjs +0 -45
  58. package/dist/chunks/index.mjs +0 -24
  59. package/dist/chunks/index10.mjs +0 -1171
  60. package/dist/chunks/index11.mjs +0 -1008
  61. package/dist/chunks/index12.mjs +0 -193
  62. package/dist/chunks/index13.mjs +0 -218
  63. package/dist/chunks/index14.mjs +0 -663
  64. package/dist/chunks/index2.mjs +0 -19
  65. package/dist/chunks/index3.mjs +0 -19092
  66. package/dist/chunks/index4.mjs +0 -8
  67. package/dist/chunks/index5.mjs +0 -7600
  68. package/dist/chunks/index6.mjs +0 -171
  69. package/dist/chunks/index7.mjs +0 -3583
  70. package/dist/chunks/index8.mjs +0 -19
  71. package/dist/chunks/index9.mjs +0 -616
  72. package/dist/chunks/init.mjs +0 -1606
  73. package/dist/chunks/installer.mjs +0 -690
  74. package/dist/chunks/installer2.mjs +0 -179
  75. package/dist/chunks/interview.mjs +0 -2927
  76. package/dist/chunks/json-config.mjs +0 -60
  77. package/dist/chunks/linux.mjs +0 -3863
  78. package/dist/chunks/macos.mjs +0 -69
  79. package/dist/chunks/main.mjs +0 -635
  80. package/dist/chunks/manager.mjs +0 -1048
  81. package/dist/chunks/marketplace.mjs +0 -949
  82. package/dist/chunks/mcp-cli.mjs +0 -204
  83. package/dist/chunks/mcp-performance.mjs +0 -187
  84. package/dist/chunks/mcp.mjs +0 -1231
  85. package/dist/chunks/menu.mjs +0 -652
  86. package/dist/chunks/metrics-display.mjs +0 -153
  87. package/dist/chunks/migrator.mjs +0 -178
  88. package/dist/chunks/monitor.mjs +0 -1856
  89. package/dist/chunks/notification.mjs +0 -1864
  90. package/dist/chunks/onboarding.mjs +0 -385
  91. package/dist/chunks/package.mjs +0 -3
  92. package/dist/chunks/paradigm.mjs +0 -74
  93. package/dist/chunks/permission-manager.mjs +0 -132
  94. package/dist/chunks/permissions.mjs +0 -265
  95. package/dist/chunks/persistence-manager.mjs +0 -794
  96. package/dist/chunks/persistence.mjs +0 -667
  97. package/dist/chunks/platform.mjs +0 -391
  98. package/dist/chunks/plugin.mjs +0 -1936
  99. package/dist/chunks/powershell.mjs +0 -213
  100. package/dist/chunks/prompts.mjs +0 -241
  101. package/dist/chunks/providers.mjs +0 -260
  102. package/dist/chunks/quick-actions.mjs +0 -320
  103. package/dist/chunks/quick-provider.mjs +0 -682
  104. package/dist/chunks/quick-setup.mjs +0 -412
  105. package/dist/chunks/remote.mjs +0 -497
  106. package/dist/chunks/session.mjs +0 -878
  107. package/dist/chunks/sessions.mjs +0 -106
  108. package/dist/chunks/silent-updater.mjs +0 -396
  109. package/dist/chunks/simple-config.mjs +0 -98
  110. package/dist/chunks/skill.mjs +0 -117
  111. package/dist/chunks/skill2.mjs +0 -9003
  112. package/dist/chunks/skills-sync.mjs +0 -6460
  113. package/dist/chunks/skills.mjs +0 -567
  114. package/dist/chunks/slash-commands.mjs +0 -207
  115. package/dist/chunks/smart-defaults.mjs +0 -412
  116. package/dist/chunks/smart-guide.mjs +0 -194
  117. package/dist/chunks/startup.mjs +0 -487
  118. package/dist/chunks/stats.mjs +0 -410
  119. package/dist/chunks/status.mjs +0 -289
  120. package/dist/chunks/team.mjs +0 -63
  121. package/dist/chunks/thinking.mjs +0 -626
  122. package/dist/chunks/trace.mjs +0 -57
  123. package/dist/chunks/uninstall.mjs +0 -849
  124. package/dist/chunks/update.mjs +0 -167
  125. package/dist/chunks/upgrade-manager.mjs +0 -204
  126. package/dist/chunks/version-checker.mjs +0 -881
  127. package/dist/chunks/vim.mjs +0 -903
  128. package/dist/chunks/windows.mjs +0 -14
  129. package/dist/chunks/workflows.mjs +0 -633
  130. package/dist/chunks/wsl.mjs +0 -129
  131. package/dist/chunks/zero-config.mjs +0 -374
  132. package/dist/chunks/zsh.mjs +0 -182
  133. package/dist/cli.d.mts +0 -1
  134. package/dist/cli.d.ts +0 -1
  135. package/dist/cli.mjs +0 -2199
  136. package/dist/i18n/locales/en/agent-teams.json +0 -18
  137. package/dist/i18n/locales/en/agentBrowser.json +0 -79
  138. package/dist/i18n/locales/en/agents.json +0 -135
  139. package/dist/i18n/locales/en/api.json +0 -63
  140. package/dist/i18n/locales/en/ccjk-agents.json +0 -33
  141. package/dist/i18n/locales/en/ccjk-all.json +0 -23
  142. package/dist/i18n/locales/en/ccjk-skills.json +0 -22
  143. package/dist/i18n/locales/en/ccjk.json +0 -276
  144. package/dist/i18n/locales/en/ccr.json +0 -65
  145. package/dist/i18n/locales/en/claude-md.json +0 -73
  146. package/dist/i18n/locales/en/cli.json +0 -152
  147. package/dist/i18n/locales/en/cloud-setup.json +0 -31
  148. package/dist/i18n/locales/en/cloud-sync.json +0 -147
  149. package/dist/i18n/locales/en/cloud.json +0 -40
  150. package/dist/i18n/locales/en/cloudPlugins.json +0 -118
  151. package/dist/i18n/locales/en/codex.json +0 -127
  152. package/dist/i18n/locales/en/cometix.json +0 -29
  153. package/dist/i18n/locales/en/common.json +0 -68
  154. package/dist/i18n/locales/en/config.json +0 -108
  155. package/dist/i18n/locales/en/configuration.json +0 -226
  156. package/dist/i18n/locales/en/context.json +0 -85
  157. package/dist/i18n/locales/en/dashboard.json +0 -78
  158. package/dist/i18n/locales/en/errors.json +0 -26
  159. package/dist/i18n/locales/en/evolution.json +0 -54
  160. package/dist/i18n/locales/en/hooks.json +0 -74
  161. package/dist/i18n/locales/en/hooksSync.json +0 -133
  162. package/dist/i18n/locales/en/installation.json +0 -83
  163. package/dist/i18n/locales/en/interview.json +0 -104
  164. package/dist/i18n/locales/en/language.json +0 -19
  165. package/dist/i18n/locales/en/lsp.json +0 -78
  166. package/dist/i18n/locales/en/marketplace.json +0 -116
  167. package/dist/i18n/locales/en/mcp.json +0 -178
  168. package/dist/i18n/locales/en/memory.json +0 -92
  169. package/dist/i18n/locales/en/menu.json +0 -143
  170. package/dist/i18n/locales/en/multi-config.json +0 -79
  171. package/dist/i18n/locales/en/notification.json +0 -307
  172. package/dist/i18n/locales/en/permissions.json +0 -95
  173. package/dist/i18n/locales/en/persistence.json +0 -127
  174. package/dist/i18n/locales/en/plugins.json +0 -146
  175. package/dist/i18n/locales/en/quick-actions.json +0 -78
  176. package/dist/i18n/locales/en/registry.json +0 -54
  177. package/dist/i18n/locales/en/remote.json +0 -93
  178. package/dist/i18n/locales/en/sandbox.json +0 -44
  179. package/dist/i18n/locales/en/setup.json +0 -44
  180. package/dist/i18n/locales/en/shencha.json +0 -14
  181. package/dist/i18n/locales/en/skills.json +0 -100
  182. package/dist/i18n/locales/en/skillsSync.json +0 -74
  183. package/dist/i18n/locales/en/smartGuide.json +0 -49
  184. package/dist/i18n/locales/en/stats.json +0 -20
  185. package/dist/i18n/locales/en/subagent.json +0 -69
  186. package/dist/i18n/locales/en/superpowers.json +0 -117
  187. package/dist/i18n/locales/en/team.json +0 -7
  188. package/dist/i18n/locales/en/thinking.json +0 -65
  189. package/dist/i18n/locales/en/tools.json +0 -42
  190. package/dist/i18n/locales/en/uninstall.json +0 -56
  191. package/dist/i18n/locales/en/updater.json +0 -29
  192. package/dist/i18n/locales/en/vim.json +0 -169
  193. package/dist/i18n/locales/en/workflow.json +0 -55
  194. package/dist/i18n/locales/en/workspace.json +0 -108
  195. package/dist/i18n/locales/zh-CN/agent-teams.json +0 -18
  196. package/dist/i18n/locales/zh-CN/agentBrowser.json +0 -79
  197. package/dist/i18n/locales/zh-CN/agents.json +0 -135
  198. package/dist/i18n/locales/zh-CN/api.json +0 -63
  199. package/dist/i18n/locales/zh-CN/ccjk-agents.json +0 -33
  200. package/dist/i18n/locales/zh-CN/ccjk-all.json +0 -23
  201. package/dist/i18n/locales/zh-CN/ccjk-skills.json +0 -22
  202. package/dist/i18n/locales/zh-CN/ccjk.json +0 -276
  203. package/dist/i18n/locales/zh-CN/ccr.json +0 -65
  204. package/dist/i18n/locales/zh-CN/claude-md.json +0 -73
  205. package/dist/i18n/locales/zh-CN/cli.json +0 -152
  206. package/dist/i18n/locales/zh-CN/cloud-setup.json +0 -31
  207. package/dist/i18n/locales/zh-CN/cloud-sync.json +0 -147
  208. package/dist/i18n/locales/zh-CN/cloud.json +0 -40
  209. package/dist/i18n/locales/zh-CN/cloudPlugins.json +0 -118
  210. package/dist/i18n/locales/zh-CN/codex.json +0 -127
  211. package/dist/i18n/locales/zh-CN/cometix.json +0 -29
  212. package/dist/i18n/locales/zh-CN/common.json +0 -68
  213. package/dist/i18n/locales/zh-CN/config.json +0 -108
  214. package/dist/i18n/locales/zh-CN/configuration.json +0 -224
  215. package/dist/i18n/locales/zh-CN/context.json +0 -85
  216. package/dist/i18n/locales/zh-CN/dashboard.json +0 -78
  217. package/dist/i18n/locales/zh-CN/errors.json +0 -26
  218. package/dist/i18n/locales/zh-CN/evolution.json +0 -54
  219. package/dist/i18n/locales/zh-CN/hooks.json +0 -74
  220. package/dist/i18n/locales/zh-CN/hooksSync.json +0 -133
  221. package/dist/i18n/locales/zh-CN/installation.json +0 -83
  222. package/dist/i18n/locales/zh-CN/interview.json +0 -104
  223. package/dist/i18n/locales/zh-CN/language.json +0 -19
  224. package/dist/i18n/locales/zh-CN/lsp.json +0 -78
  225. package/dist/i18n/locales/zh-CN/marketplace.json +0 -116
  226. package/dist/i18n/locales/zh-CN/mcp.json +0 -178
  227. package/dist/i18n/locales/zh-CN/memory.json +0 -92
  228. package/dist/i18n/locales/zh-CN/menu.json +0 -143
  229. package/dist/i18n/locales/zh-CN/multi-config.json +0 -79
  230. package/dist/i18n/locales/zh-CN/notification.json +0 -307
  231. package/dist/i18n/locales/zh-CN/permissions.json +0 -95
  232. package/dist/i18n/locales/zh-CN/persistence.json +0 -127
  233. package/dist/i18n/locales/zh-CN/plugins.json +0 -146
  234. package/dist/i18n/locales/zh-CN/quick-actions.json +0 -78
  235. package/dist/i18n/locales/zh-CN/registry.json +0 -54
  236. package/dist/i18n/locales/zh-CN/remote.json +0 -93
  237. package/dist/i18n/locales/zh-CN/sandbox.json +0 -44
  238. package/dist/i18n/locales/zh-CN/setup.json +0 -44
  239. package/dist/i18n/locales/zh-CN/shencha.json +0 -14
  240. package/dist/i18n/locales/zh-CN/skills.json +0 -100
  241. package/dist/i18n/locales/zh-CN/skillsSync.json +0 -74
  242. package/dist/i18n/locales/zh-CN/smartGuide.json +0 -49
  243. package/dist/i18n/locales/zh-CN/stats.json +0 -20
  244. package/dist/i18n/locales/zh-CN/subagent.json +0 -69
  245. package/dist/i18n/locales/zh-CN/superpowers.json +0 -117
  246. package/dist/i18n/locales/zh-CN/team.json +0 -7
  247. package/dist/i18n/locales/zh-CN/thinking.json +0 -65
  248. package/dist/i18n/locales/zh-CN/tools.json +0 -42
  249. package/dist/i18n/locales/zh-CN/uninstall.json +0 -56
  250. package/dist/i18n/locales/zh-CN/updater.json +0 -29
  251. package/dist/i18n/locales/zh-CN/vim.json +0 -169
  252. package/dist/i18n/locales/zh-CN/workflow.json +0 -55
  253. package/dist/i18n/locales/zh-CN/workspace.json +0 -108
  254. package/dist/index.d.mts +0 -5295
  255. package/dist/index.d.ts +0 -5295
  256. package/dist/index.mjs +0 -4941
  257. package/dist/shared/ccjk.B364Fu0N.mjs +0 -1819
  258. package/dist/shared/ccjk.BAGoDD49.mjs +0 -36
  259. package/dist/shared/ccjk.BBtCGd_g.mjs +0 -899
  260. package/dist/shared/ccjk.BFQ7yr5S.mjs +0 -16
  261. package/dist/shared/ccjk.BFxsJM0k.mjs +0 -599
  262. package/dist/shared/ccjk.BIxuVL3_.mjs +0 -25
  263. package/dist/shared/ccjk.BRZ9ww8S.mjs +0 -142
  264. package/dist/shared/ccjk.BoApaI4j.mjs +0 -28
  265. package/dist/shared/ccjk.BrPUmTqm.mjs +0 -266
  266. package/dist/shared/ccjk.BtB1e5jm.mjs +0 -171
  267. package/dist/shared/ccjk.BwfbSKN2.mjs +0 -1051
  268. package/dist/shared/ccjk.BxSmJ8B7.mjs +0 -243
  269. package/dist/shared/ccjk.Bx_rmYfN.mjs +0 -69
  270. package/dist/shared/ccjk.C2jHOZVP.mjs +0 -52
  271. package/dist/shared/ccjk.CL4Yat0G.mjs +0 -303
  272. package/dist/shared/ccjk.COweQ1RR.mjs +0 -5
  273. package/dist/shared/ccjk.CePkJq2S.mjs +0 -223
  274. package/dist/shared/ccjk.CfKKcvWy.mjs +0 -126
  275. package/dist/shared/ccjk.Cjgrln_h.mjs +0 -297
  276. package/dist/shared/ccjk.Cjj8SVrn.mjs +0 -54
  277. package/dist/shared/ccjk.CxpGa6MC.mjs +0 -2724
  278. package/dist/shared/ccjk.D5MFQT7w.mjs +0 -400
  279. package/dist/shared/ccjk.D6ycHbak.mjs +0 -270
  280. package/dist/shared/ccjk.D8ZLYSZZ.mjs +0 -299
  281. package/dist/shared/ccjk.DG_o24cZ.mjs +0 -88
  282. package/dist/shared/ccjk.DLLw-h4Y.mjs +0 -460
  283. package/dist/shared/ccjk.DOwtZMk8.mjs +0 -4019
  284. package/dist/shared/ccjk.DS7UESmF.mjs +0 -2451
  285. package/dist/shared/ccjk.DTdjs-qK.mjs +0 -1447
  286. package/dist/shared/ccjk.DXRAZcix.mjs +0 -66
  287. package/dist/shared/ccjk.DsYaCCx4.mjs +0 -317
  288. package/dist/shared/ccjk.J8YiPsOw.mjs +0 -259
  289. package/dist/shared/ccjk.KfSWcGlE.mjs +0 -38
  290. package/dist/shared/ccjk.RyizuzOI.mjs +0 -21
  291. package/dist/shared/ccjk.SPoXMvZD.mjs +0 -1242
  292. package/dist/shared/ccjk.T_cX87dY.mjs +0 -15
  293. package/dist/shared/ccjk.UIvifqNE.mjs +0 -1486
  294. package/dist/shared/ccjk._dESH4Rk.mjs +0 -111
  295. package/dist/shared/ccjk.bQ7Dh1g4.mjs +0 -249
  296. package/dist/shared/ccjk.c-ETfBZ_.mjs +0 -617
  297. package/dist/shared/ccjk.gDEDGD_t.mjs +0 -38
  298. package/dist/shared/ccjk.hoqrwWdN.mjs +0 -333
  299. package/dist/shared/ccjk.waa2ikKJ.mjs +0 -351
@@ -1,682 +0,0 @@
1
- import a from './index2.mjs';
2
- import { i as inquirer } from './index3.mjs';
3
- import ora from './index7.mjs';
4
- import { c as createApiClient } from '../shared/ccjk.D6ycHbak.mjs';
5
- import '../shared/ccjk.BAGoDD49.mjs';
6
- import 'node:readline';
7
- import 'stream';
8
- import 'node:tty';
9
- import 'node:process';
10
- import 'node:async_hooks';
11
- import '../shared/ccjk.Cjgrln_h.mjs';
12
- import 'node:util';
13
- import 'tty';
14
- import 'fs';
15
- import 'child_process';
16
- import 'node:path';
17
- import 'node:os';
18
- import 'node:crypto';
19
- import 'buffer';
20
- import 'string_decoder';
21
-
22
- const CLOUD_API_BASE_URL = "https://api.claudehome.cn/v1";
23
- const REQUEST_TIMEOUT = 1e4;
24
- const BUILTIN_PROVIDERS = {
25
- 302: {
26
- shortcode: "302",
27
- name: "302.AI",
28
- apiUrl: "https://api.302.ai",
29
- description: "302.AI \u4E2D\u8F6C\u670D\u52A1 - \u652F\u6301\u591A\u79CD\u6A21\u578B",
30
- models: ["gpt-4", "gpt-4-turbo", "gpt-3.5-turbo", "claude-3-opus", "claude-3-sonnet"],
31
- verified: true,
32
- category: "relay",
33
- status: "active",
34
- createdAt: "2024-01-01T00:00:00Z"
35
- },
36
- glm: {
37
- shortcode: "glm",
38
- name: "\u667A\u8C31AI",
39
- apiUrl: "https://open.bigmodel.cn/api/paas/v4",
40
- description: "\u667A\u8C31 GLM \u5927\u6A21\u578B",
41
- models: ["glm-4", "glm-4-plus", "glm-3-turbo"],
42
- verified: true,
43
- category: "domestic",
44
- status: "active",
45
- createdAt: "2024-01-01T00:00:00Z"
46
- },
47
- kimi: {
48
- shortcode: "kimi",
49
- name: "\u6708\u4E4B\u6697\u9762 Kimi",
50
- apiUrl: "https://api.moonshot.cn/v1",
51
- description: "Moonshot Kimi \u5927\u6A21\u578B",
52
- models: ["moonshot-v1-8k", "moonshot-v1-32k", "moonshot-v1-128k"],
53
- verified: true,
54
- category: "domestic",
55
- status: "active",
56
- createdAt: "2024-01-01T00:00:00Z"
57
- },
58
- minimax: {
59
- shortcode: "minimax",
60
- name: "MiniMax",
61
- apiUrl: "https://api.minimax.chat/v1",
62
- description: "MiniMax \u5927\u6A21\u578B",
63
- models: ["abab5.5-chat", "abab6-chat", "abab6.5-chat"],
64
- verified: true,
65
- category: "domestic",
66
- status: "active",
67
- createdAt: "2024-01-01T00:00:00Z"
68
- },
69
- deepseek: {
70
- shortcode: "deepseek",
71
- name: "DeepSeek",
72
- apiUrl: "https://api.deepseek.com/v1",
73
- description: "DeepSeek \u5927\u6A21\u578B",
74
- models: ["deepseek-chat", "deepseek-coder"],
75
- verified: true,
76
- category: "domestic",
77
- status: "active",
78
- createdAt: "2024-01-01T00:00:00Z"
79
- },
80
- qwen: {
81
- shortcode: "qwen",
82
- name: "\u901A\u4E49\u5343\u95EE",
83
- apiUrl: "https://dashscope.aliyuncs.com/compatible-mode/v1",
84
- description: "\u963F\u91CC\u901A\u4E49\u5343\u95EE\u5927\u6A21\u578B",
85
- models: ["qwen-turbo", "qwen-plus", "qwen-max"],
86
- verified: true,
87
- category: "domestic",
88
- status: "active",
89
- createdAt: "2024-01-01T00:00:00Z"
90
- }
91
- };
92
- class ProviderRegistryService {
93
- client;
94
- useCloud = true;
95
- constructor(options) {
96
- this.client = createApiClient({
97
- baseUrl: options?.baseUrl || CLOUD_API_BASE_URL,
98
- timeout: REQUEST_TIMEOUT,
99
- userAgent: "CCJK-QuickLaunch/1.0"
100
- });
101
- this.useCloud = options?.useCloud ?? true;
102
- }
103
- // ==========================================================================
104
- // Query Methods
105
- // ==========================================================================
106
- /**
107
- * Get provider by shortcode
108
- *
109
- * First tries cloud registry, falls back to built-in providers.
110
- *
111
- * @param shortcode - Provider shortcode (e.g., "302", "glm")
112
- * @returns Provider info or null if not found
113
- */
114
- async getProvider(shortcode) {
115
- const normalizedCode = shortcode.toLowerCase().trim();
116
- if (this.useCloud) {
117
- try {
118
- const response = await this.client.get(
119
- `/providers/${encodeURIComponent(normalizedCode)}`
120
- );
121
- if (response.success && response.data) {
122
- return response.data;
123
- }
124
- } catch {
125
- }
126
- }
127
- return BUILTIN_PROVIDERS[normalizedCode] || null;
128
- }
129
- /**
130
- * Check if shortcode exists
131
- *
132
- * @param shortcode - Provider shortcode to check
133
- * @returns true if exists, false otherwise
134
- */
135
- async exists(shortcode) {
136
- const provider = await this.getProvider(shortcode);
137
- return provider !== null;
138
- }
139
- /**
140
- * Check if shortcode is available for registration
141
- *
142
- * @param shortcode - Provider shortcode to check
143
- * @returns true if available, false if taken
144
- */
145
- async isAvailable(shortcode) {
146
- return !await this.exists(shortcode);
147
- }
148
- // ==========================================================================
149
- // Registration Methods
150
- // ==========================================================================
151
- /**
152
- * Create a new provider in the cloud registry
153
- *
154
- * @param input - Provider creation data
155
- * @returns Created provider or error
156
- */
157
- async createProvider(input) {
158
- if (!this.useCloud) {
159
- return {
160
- success: false,
161
- error: {
162
- code: "CLOUD_DISABLED",
163
- message: "Cloud service is disabled"
164
- }
165
- };
166
- }
167
- try {
168
- const response = await this.client.post(
169
- "/providers",
170
- input
171
- );
172
- if (response.success && response.data) {
173
- return {
174
- success: true,
175
- data: response.data
176
- };
177
- }
178
- return {
179
- success: false,
180
- error: {
181
- code: response.code || "CREATE_FAILED",
182
- message: response.error || "Failed to create provider"
183
- }
184
- };
185
- } catch (error) {
186
- return {
187
- success: false,
188
- error: {
189
- code: "NETWORK_ERROR",
190
- message: error instanceof Error ? error.message : "Network error"
191
- }
192
- };
193
- }
194
- }
195
- // ==========================================================================
196
- // List Methods
197
- // ==========================================================================
198
- /**
199
- * List all available providers
200
- *
201
- * @param options - List options
202
- * @returns List of providers
203
- */
204
- async listProviders(options) {
205
- if (this.useCloud) {
206
- try {
207
- const query = {};
208
- if (options?.category)
209
- query.category = options.category;
210
- if (options?.verified !== void 0)
211
- query.verified = options.verified;
212
- if (options?.limit)
213
- query.limit = options.limit;
214
- const response = await this.client.get(
215
- "/providers",
216
- query
217
- );
218
- if (response.success && response.data?.providers) {
219
- return response.data.providers;
220
- }
221
- } catch {
222
- }
223
- }
224
- let providers = Object.values(BUILTIN_PROVIDERS);
225
- if (options?.category) {
226
- providers = providers.filter((p) => p.category === options.category);
227
- }
228
- if (options?.verified !== void 0) {
229
- providers = providers.filter((p) => p.verified === options.verified);
230
- }
231
- if (options?.limit) {
232
- providers = providers.slice(0, options.limit);
233
- }
234
- return providers;
235
- }
236
- /**
237
- * Get built-in provider (always available, no network)
238
- *
239
- * @param shortcode - Provider shortcode
240
- * @returns Built-in provider or null
241
- */
242
- getBuiltinProvider(shortcode) {
243
- return BUILTIN_PROVIDERS[shortcode.toLowerCase()] || null;
244
- }
245
- /**
246
- * List all built-in providers
247
- *
248
- * @returns Array of built-in providers
249
- */
250
- listBuiltinProviders() {
251
- return Object.values(BUILTIN_PROVIDERS);
252
- }
253
- // ==========================================================================
254
- // Configuration
255
- // ==========================================================================
256
- /**
257
- * Enable or disable cloud service
258
- */
259
- setUseCloud(enabled) {
260
- this.useCloud = enabled;
261
- }
262
- /**
263
- * Check if cloud service is enabled
264
- */
265
- isCloudEnabled() {
266
- return this.useCloud;
267
- }
268
- }
269
- let _instance = null;
270
- function getProviderRegistry() {
271
- if (!_instance) {
272
- _instance = new ProviderRegistryService();
273
- }
274
- return _instance;
275
- }
276
-
277
- function isValidApiUrl(url) {
278
- try {
279
- const parsed = new URL(url);
280
- return parsed.protocol === "https:" || parsed.protocol === "http:";
281
- } catch {
282
- return false;
283
- }
284
- }
285
-
286
- const KNOWN_COMMANDS = /* @__PURE__ */ new Set([
287
- // Core commands
288
- "",
289
- "init",
290
- "update",
291
- "doctor",
292
- "help",
293
- "menu",
294
- // Quick setup commands (must be before 'quick' deprecated)
295
- "quick-setup",
296
- "quick",
297
- "qs",
298
- // Extended commands
299
- "serve",
300
- "mcp",
301
- "browser",
302
- "interview",
303
- "commit",
304
- "config",
305
- "daemon",
306
- "providers",
307
- "task",
308
- "tasks",
309
- "keybinding",
310
- "kb",
311
- "history",
312
- "hist",
313
- "ccr",
314
- "vim",
315
- "permissions",
316
- "perm",
317
- "zero-config",
318
- "zc",
319
- "skills",
320
- "sk",
321
- "skill",
322
- "agent",
323
- "ag",
324
- "ccu",
325
- "stats",
326
- "uninstall",
327
- "check-updates",
328
- "check",
329
- "config-switch",
330
- "cs",
331
- "workflows",
332
- "wf",
333
- "notification",
334
- "notify",
335
- "session",
336
- "context",
337
- "ctx",
338
- "api",
339
- "team",
340
- "thinking",
341
- "think",
342
- "agent-teams",
343
- "teams",
344
- "postmortem",
345
- "pm",
346
- "claude",
347
- "monitor",
348
- "paradigm",
349
- "trace",
350
- "status",
351
- "st",
352
- "boost",
353
- "evolution",
354
- // CCJK v8 commands
355
- "ccjk:mcp",
356
- "ccjk-mcp",
357
- "ccjk:skills",
358
- "ccjk-skills",
359
- "ccjk:agents",
360
- "ccjk-agents",
361
- "ccjk:hooks",
362
- "ccjk-hooks",
363
- "ccjk:all",
364
- "ccjk-all",
365
- "ccjk:setup",
366
- "ccjk-setup",
367
- // Special commands
368
- "cloud",
369
- "system",
370
- "sys",
371
- "plugin",
372
- "completion",
373
- // Deprecated but still recognized
374
- "skills-sync",
375
- "agents-sync",
376
- "marketplace",
377
- "deep",
378
- "setup",
379
- "sync",
380
- "versions",
381
- "upgrade",
382
- "config-scan",
383
- "workspace"
384
- ]);
385
- function isKnownCommand(arg) {
386
- if (!arg)
387
- return true;
388
- if (arg.startsWith("-"))
389
- return true;
390
- return KNOWN_COMMANDS.has(arg.toLowerCase());
391
- }
392
- function couldBeShortcode(arg) {
393
- if (!arg)
394
- return false;
395
- if (arg.startsWith("-"))
396
- return false;
397
- if (isKnownCommand(arg))
398
- return false;
399
- return /^[a-z0-9][a-z0-9-]{0,18}[a-z0-9]?$/i.test(arg);
400
- }
401
- async function quickProviderLaunch(shortcode, options = {}) {
402
- const registry = getProviderRegistry();
403
- const normalizedCode = shortcode.toLowerCase().trim();
404
- console.log();
405
- const spinner = ora({
406
- text: a.gray(`\u6B63\u5728\u67E5\u8BE2\u4F9B\u5E94\u5546 "${normalizedCode}"...`),
407
- color: "cyan"
408
- }).start();
409
- try {
410
- const provider = await registry.getProvider(normalizedCode);
411
- spinner.stop();
412
- if (provider) {
413
- return await handleExistingProvider(provider, options);
414
- } else {
415
- return await handleNewProvider(normalizedCode, options);
416
- }
417
- } catch (error) {
418
- spinner.fail(a.red("\u67E5\u8BE2\u5931\u8D25"));
419
- console.error(a.gray(error instanceof Error ? error.message : "\u7F51\u7EDC\u9519\u8BEF"));
420
- return false;
421
- }
422
- }
423
- async function handleExistingProvider(provider, options) {
424
- console.log(a.cyan.bold(`
425
- \u{1F680} \u5FEB\u901F\u914D\u7F6E: ${provider.name}`));
426
- console.log(a.gray("\u2500".repeat(40)));
427
- console.log(` ${a.yellow("\u77ED\u7801:")} ${provider.shortcode}`);
428
- console.log(` ${a.yellow("API URL:")} ${provider.apiUrl}`);
429
- if (provider.description) {
430
- console.log(` ${a.yellow("\u63CF\u8FF0:")} ${provider.description}`);
431
- }
432
- if (provider.verified) {
433
- console.log(` ${a.green("\u2713")} \u5B98\u65B9\u9A8C\u8BC1`);
434
- }
435
- console.log();
436
- const { confirmed } = await inquirer.prompt([
437
- {
438
- type: "confirm",
439
- name: "confirmed",
440
- message: `\u662F\u5426\u4F7F\u7528 ${a.cyan(provider.name)} \u4F5C\u4E3A API \u4F9B\u5E94\u5546?`,
441
- default: true
442
- }
443
- ]);
444
- if (!confirmed) {
445
- console.log(a.gray("\n\u5DF2\u53D6\u6D88\uFF0C\u8FDB\u5165\u4E3B\u83DC\u5355...\n"));
446
- return false;
447
- }
448
- const config = await configureProvider(provider);
449
- if (config) {
450
- await saveProviderConfig(config);
451
- showSuccessMessage(config);
452
- return true;
453
- }
454
- return false;
455
- }
456
- async function handleNewProvider(shortcode, options) {
457
- console.log(a.yellow(`
458
- \u26A0\uFE0F \u4F9B\u5E94\u5546 "${shortcode}" \u5C1A\u672A\u6CE8\u518C`));
459
- console.log(a.gray("\u8BE5\u77ED\u7801\u5728\u4E91\u7AEF\u6CE8\u518C\u8868\u4E2D\u4E0D\u5B58\u5728\n"));
460
- const { createNew } = await inquirer.prompt([
461
- {
462
- type: "confirm",
463
- name: "createNew",
464
- message: "\u662F\u5426\u521B\u5EFA\u8BE5\u4F9B\u5E94\u5546?",
465
- default: false
466
- }
467
- ]);
468
- if (!createNew) {
469
- console.log(a.gray("\n\u5DF2\u53D6\u6D88\uFF0C\u8FDB\u5165\u4E3B\u83DC\u5355...\n"));
470
- return false;
471
- }
472
- const { name, apiUrl } = await inquirer.prompt([
473
- {
474
- type: "input",
475
- name: "name",
476
- message: "\u4F9B\u5E94\u5546\u540D\u79F0:",
477
- default: shortcode.toUpperCase(),
478
- validate: (value) => {
479
- if (!value.trim())
480
- return "\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A";
481
- if (value.length > 50)
482
- return "\u540D\u79F0\u8FC7\u957F\uFF08\u6700\u591A50\u5B57\u7B26\uFF09";
483
- return true;
484
- }
485
- },
486
- {
487
- type: "input",
488
- name: "apiUrl",
489
- message: "API URL (\u5982 https://api.example.com/v1):",
490
- validate: (value) => {
491
- if (!value.trim())
492
- return "URL \u4E0D\u80FD\u4E3A\u7A7A";
493
- if (!isValidApiUrl(value))
494
- return "\u8BF7\u8F93\u5165\u6709\u6548\u7684 URL\uFF08http:// \u6216 https://\uFF09";
495
- return true;
496
- }
497
- }
498
- ]);
499
- const spinner = ora("\u6B63\u5728\u6CE8\u518C\u4F9B\u5E94\u5546...").start();
500
- try {
501
- const registry = getProviderRegistry();
502
- const result = await registry.createProvider({
503
- shortcode,
504
- name: name.trim(),
505
- apiUrl: apiUrl.trim()
506
- });
507
- if (result.success && result.data) {
508
- spinner.succeed(a.green("\u4F9B\u5E94\u5546\u6CE8\u518C\u6210\u529F!"));
509
- const config = await configureProvider(result.data, options);
510
- if (config) {
511
- await saveProviderConfig(config);
512
- showSuccessMessage(config);
513
- return true;
514
- }
515
- } else {
516
- spinner.fail(a.red("\u6CE8\u518C\u5931\u8D25"));
517
- console.error(a.gray(result.error?.message || "\u672A\u77E5\u9519\u8BEF"));
518
- const { continueLocal } = await inquirer.prompt([
519
- {
520
- type: "confirm",
521
- name: "continueLocal",
522
- message: "\u662F\u5426\u4ECD\u7136\u4F7F\u7528\u6B64\u914D\u7F6E\uFF08\u4EC5\u672C\u5730\uFF09?",
523
- default: true
524
- }
525
- ]);
526
- if (continueLocal) {
527
- const localProvider = {
528
- shortcode,
529
- name: name.trim(),
530
- apiUrl: apiUrl.trim(),
531
- verified: false,
532
- createdAt: (/* @__PURE__ */ new Date()).toISOString()
533
- };
534
- const config = await configureProvider(localProvider, options);
535
- if (config) {
536
- await saveProviderConfig(config);
537
- showSuccessMessage(config);
538
- return true;
539
- }
540
- }
541
- }
542
- } catch (error) {
543
- spinner.fail(a.red("\u6CE8\u518C\u5931\u8D25"));
544
- console.error(a.gray(error instanceof Error ? error.message : "\u7F51\u7EDC\u9519\u8BEF"));
545
- }
546
- return false;
547
- }
548
- async function configureProvider(provider, _options) {
549
- console.log(a.cyan("\n\u{1F4DD} \u914D\u7F6E API \u51ED\u8BC1"));
550
- console.log(a.gray("\u2500".repeat(40)));
551
- const { apiKey } = await inquirer.prompt([
552
- {
553
- type: "password",
554
- name: "apiKey",
555
- message: "API Key:",
556
- mask: "*",
557
- validate: (value) => {
558
- if (!value.trim())
559
- return "API Key \u4E0D\u80FD\u4E3A\u7A7A";
560
- if (value.length < 10)
561
- return "API Key \u683C\u5F0F\u4E0D\u6B63\u786E";
562
- return true;
563
- }
564
- }
565
- ]);
566
- let model;
567
- if (provider.models && provider.models.length > 0) {
568
- const { modelChoice } = await inquirer.prompt([
569
- {
570
- type: "list",
571
- name: "modelChoice",
572
- message: "\u9009\u62E9\u6A21\u578B:",
573
- choices: [
574
- ...provider.models.map((m) => ({
575
- name: m,
576
- value: m
577
- })),
578
- {
579
- name: a.gray("\u81EA\u5B9A\u4E49..."),
580
- value: "__custom__"
581
- }
582
- ]
583
- }
584
- ]);
585
- if (modelChoice === "__custom__") {
586
- const { customModel } = await inquirer.prompt([
587
- {
588
- type: "input",
589
- name: "customModel",
590
- message: "\u8F93\u5165\u6A21\u578B\u540D\u79F0:",
591
- validate: (value) => {
592
- if (!value.trim())
593
- return "\u6A21\u578B\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A";
594
- return true;
595
- }
596
- }
597
- ]);
598
- model = customModel;
599
- } else {
600
- model = modelChoice;
601
- }
602
- } else {
603
- const { inputModel } = await inquirer.prompt([
604
- {
605
- type: "input",
606
- name: "inputModel",
607
- message: "\u6A21\u578B\u540D\u79F0 (\u5982 gpt-4, claude-3-opus):",
608
- default: "gpt-4",
609
- validate: (value) => {
610
- if (!value.trim())
611
- return "\u6A21\u578B\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A";
612
- return true;
613
- }
614
- }
615
- ]);
616
- model = inputModel;
617
- }
618
- return {
619
- shortcode: provider.shortcode,
620
- provider,
621
- apiKey: apiKey.trim(),
622
- model: model.trim()
623
- };
624
- }
625
- async function saveProviderConfig(config) {
626
- const spinner = ora("\u6B63\u5728\u4FDD\u5B58\u914D\u7F6E...").start();
627
- try {
628
- const { readJsonFile, writeJsonFile } = await import('./fs-operations.mjs');
629
- const { join } = await import('./index8.mjs');
630
- const { homedir } = await import('node:os');
631
- const { existsSync, mkdirSync } = await import('node:fs');
632
- const claudeDir = join(homedir(), ".claude");
633
- const settingsPath = join(claudeDir, "settings.json");
634
- if (!existsSync(claudeDir)) {
635
- mkdirSync(claudeDir, { recursive: true });
636
- }
637
- let settings = {};
638
- try {
639
- if (existsSync(settingsPath)) {
640
- settings = readJsonFile(settingsPath) || {};
641
- }
642
- } catch {
643
- }
644
- settings.apiProvider = "custom";
645
- settings.apiUrl = config.provider.apiUrl;
646
- settings.apiKey = config.apiKey;
647
- settings.model = config.model;
648
- const envConfig = {
649
- ANTHROPIC_BASE_URL: config.provider.apiUrl,
650
- ANTHROPIC_API_KEY: config.apiKey,
651
- ANTHROPIC_MODEL: config.model
652
- };
653
- settings.env = {
654
- ...settings.env || {},
655
- ...envConfig
656
- };
657
- writeJsonFile(settingsPath, settings);
658
- spinner.succeed(a.green("\u914D\u7F6E\u5DF2\u4FDD\u5B58"));
659
- } catch (error) {
660
- spinner.fail(a.red("\u4FDD\u5B58\u5931\u8D25"));
661
- console.log(a.yellow("\n\u8BF7\u624B\u52A8\u914D\u7F6E:"));
662
- console.log(a.gray("\u2500".repeat(40)));
663
- console.log(`${a.cyan("API URL:")} ${config.provider.apiUrl}`);
664
- console.log(`${a.cyan("Model:")} ${config.model}`);
665
- console.log(a.gray('\n\u8FD0\u884C "ccjk api" \u8FDB\u884C\u624B\u52A8\u914D\u7F6E'));
666
- throw error;
667
- }
668
- }
669
- function showSuccessMessage(config) {
670
- console.log();
671
- console.log(a.green.bold("\u2705 \u914D\u7F6E\u5B8C\u6210!"));
672
- console.log(a.gray("\u2500".repeat(40)));
673
- console.log(` ${a.yellow("\u4F9B\u5E94\u5546:")} ${config.provider.name}`);
674
- console.log(` ${a.yellow("API URL:")} ${config.provider.apiUrl}`);
675
- console.log(` ${a.yellow("\u6A21\u578B:")} ${config.model}`);
676
- console.log();
677
- console.log(a.gray("\u73B0\u5728\u53EF\u4EE5\u5F00\u59CB\u4F7F\u7528 Claude Code \u4E86"));
678
- console.log(a.gray('\u8FD0\u884C "claude" \u542F\u52A8\u5BF9\u8BDD'));
679
- console.log();
680
- }
681
-
682
- export { configureProvider, couldBeShortcode, handleExistingProvider, handleNewProvider, isKnownCommand, quickProviderLaunch, saveProviderConfig };