ccjk 9.6.1 → 9.8.0

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 (56) hide show
  1. package/dist/chunks/boost.mjs +246 -7
  2. package/dist/chunks/ccjk-mcp.mjs +1 -1
  3. package/dist/chunks/ccr.mjs +25 -28
  4. package/dist/chunks/check-updates.mjs +4 -3
  5. package/dist/chunks/claude-code-config-manager.mjs +1 -1
  6. package/dist/chunks/claude-code-incremental-manager.mjs +1 -1
  7. package/dist/chunks/claude-config.mjs +1 -1
  8. package/dist/chunks/codex-config-switch.mjs +3 -4
  9. package/dist/chunks/codex-provider-manager.mjs +1 -2
  10. package/dist/chunks/codex.mjs +204 -3
  11. package/dist/chunks/config-switch.mjs +2 -3
  12. package/dist/chunks/config.mjs +1 -1
  13. package/dist/chunks/doctor.mjs +1 -1
  14. package/dist/chunks/features.mjs +24 -15
  15. package/dist/chunks/hook-installer.mjs +44 -0
  16. package/dist/chunks/index3.mjs +32 -32
  17. package/dist/chunks/init.mjs +129 -87
  18. package/dist/chunks/installer2.mjs +1 -1
  19. package/dist/chunks/interview.mjs +1 -1
  20. package/dist/chunks/mcp.mjs +1058 -17
  21. package/dist/chunks/menu.mjs +140 -56
  22. package/dist/chunks/package.mjs +2 -210
  23. package/dist/chunks/platform.mjs +1 -1
  24. package/dist/chunks/quick-setup.mjs +35 -18
  25. package/dist/chunks/simple-config.mjs +1 -1
  26. package/dist/{shared/ccjk.q1koQxEE.mjs → chunks/smart-defaults.mjs} +77 -79
  27. package/dist/chunks/status.mjs +208 -101
  28. package/dist/chunks/thinking.mjs +1 -1
  29. package/dist/chunks/uninstall.mjs +6 -4
  30. package/dist/chunks/update.mjs +4 -7
  31. package/dist/chunks/version-checker.mjs +1 -1
  32. package/dist/cli.mjs +4 -80
  33. package/dist/index.d.mts +17 -1482
  34. package/dist/index.d.ts +17 -1482
  35. package/dist/index.mjs +12 -4191
  36. package/dist/shared/{ccjk.CSkyCZIM.mjs → ccjk.Bndhan7G.mjs} +4 -242
  37. package/dist/shared/ccjk.CeE8RLG2.mjs +62 -0
  38. package/dist/shared/ccjk.DKojSRzw.mjs +266 -0
  39. package/dist/shared/{ccjk.CItD1fpl.mjs → ccjk.DvIrK0wz.mjs} +1 -1
  40. package/dist/shared/ccjk.LsPZ2PYo.mjs +1048 -0
  41. package/package.json +1 -1
  42. package/dist/chunks/api-adapter.mjs +0 -180
  43. package/dist/chunks/cli.mjs +0 -2227
  44. package/dist/chunks/context-menu.mjs +0 -913
  45. package/dist/chunks/hooks-sync.mjs +0 -1627
  46. package/dist/chunks/mcp-market.mjs +0 -1077
  47. package/dist/chunks/mcp-server.mjs +0 -776
  48. package/dist/chunks/project-detector.mjs +0 -131
  49. package/dist/chunks/provider-registry.mjs +0 -92
  50. package/dist/chunks/setup-wizard.mjs +0 -362
  51. package/dist/chunks/tools.mjs +0 -143
  52. package/dist/chunks/workflows2.mjs +0 -232
  53. package/dist/shared/ccjk.C0pb50xH.mjs +0 -347
  54. package/dist/shared/ccjk.ChMkBmdL.mjs +0 -490
  55. package/dist/shared/ccjk.CtSfXUSh.mjs +0 -209
  56. package/dist/shared/ccjk.xfAjmbJp.mjs +0 -75
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ccjk",
3
3
  "type": "module",
4
- "version": "9.6.1",
4
+ "version": "9.8.0",
5
5
  "packageManager": "pnpm@10.17.1",
6
6
  "description": "CCJK v9.0.0 - Revolutionary AI Development Platform with Enterprise Security, Streaming Cloud Sync, CRDT Conflict Resolution, and Unified V3 Architecture",
7
7
  "author": {
@@ -1,180 +0,0 @@
1
- import { existsSync, readFileSync } from 'node:fs';
2
- import { join } from 'pathe';
3
-
4
- async function detectApiStatus() {
5
- if (process.env.ANTHROPIC_API_KEY) {
6
- return {
7
- configured: true,
8
- mode: "custom",
9
- provider: "Anthropic"
10
- };
11
- }
12
- const homeDir = process.env.HOME || process.env.USERPROFILE || "";
13
- const claudeConfigPath = join(homeDir, ".claude", "config.json");
14
- if (existsSync(claudeConfigPath)) {
15
- try {
16
- const content = readFileSync(claudeConfigPath, "utf-8");
17
- const config = JSON.parse(content);
18
- if (config.apiKey || config.api_key) {
19
- return {
20
- configured: true,
21
- mode: "custom",
22
- provider: config.provider || "Custom",
23
- baseUrl: config.baseUrl || config.base_url
24
- };
25
- }
26
- if (config.oauth || config.session) {
27
- return {
28
- configured: true,
29
- mode: "official",
30
- provider: "Anthropic"
31
- };
32
- }
33
- } catch {
34
- }
35
- }
36
- const ccjkConfigPath = join(homeDir, ".ccjk", "config.json");
37
- if (existsSync(ccjkConfigPath)) {
38
- try {
39
- const content = readFileSync(ccjkConfigPath, "utf-8");
40
- const config = JSON.parse(content);
41
- if (config.apiProvider) {
42
- return {
43
- configured: true,
44
- mode: config.apiProvider === "ccr" ? "ccr" : "custom",
45
- provider: config.apiProvider,
46
- baseUrl: config.apiBaseUrl
47
- };
48
- }
49
- } catch {
50
- }
51
- }
52
- return {
53
- configured: false,
54
- mode: "none"
55
- };
56
- }
57
- function getApiStatusSummary(status, locale = "zh-CN") {
58
- const isZh = locale === "zh-CN";
59
- if (!status.configured) {
60
- return isZh ? "\u26A0\uFE0F \u672A\u914D\u7F6E API" : "\u26A0\uFE0F API not configured";
61
- }
62
- switch (status.mode) {
63
- case "official":
64
- return isZh ? "\u2713 \u5B98\u65B9\u767B\u5F55" : "\u2713 Official login";
65
- case "ccr":
66
- return isZh ? "\u2713 CCR \u4EE3\u7406" : "\u2713 CCR Proxy";
67
- case "custom":
68
- return isZh ? `\u2713 ${status.provider || "\u81EA\u5B9A\u4E49"}` : `\u2713 ${status.provider || "Custom"}`;
69
- default:
70
- return isZh ? "\u2713 \u5DF2\u914D\u7F6E" : "\u2713 Configured";
71
- }
72
- }
73
- async function quickApiSetup(locale = "zh-CN") {
74
- const inquirer = (await import('inquirer')).default;
75
- const ansis = (await import('ansis')).default;
76
- const isZh = locale === "zh-CN";
77
- console.log("");
78
- console.log(ansis.bold(isZh ? "\u26A1 \u5FEB\u901F\u914D\u7F6E API" : "\u26A1 Quick API Setup"));
79
- console.log(ansis.dim(isZh ? "\u53EA\u9700 2 \u6B65\uFF0C\u5373\u53EF\u5F00\u59CB\u4F7F\u7528 Claude" : "Just 2 steps to start using Claude"));
80
- console.log("");
81
- try {
82
- const { createWizard } = await import('./setup-wizard.mjs');
83
- const wizard = createWizard();
84
- const step1 = wizard.getStep1();
85
- console.log(ansis.cyan(`Step 1: ${step1.title}`));
86
- console.log(ansis.dim(step1.description));
87
- console.log("");
88
- const providerField = step1.fields[0];
89
- const providerChoices = providerField.options?.filter((opt) => opt.value !== "---").map((opt) => ({
90
- name: `${opt.label}
91
- ${ansis.dim(opt.description || "")}`,
92
- value: opt.value,
93
- short: opt.label
94
- })) || [];
95
- const { provider } = await inquirer.prompt([
96
- {
97
- type: "list",
98
- name: "provider",
99
- message: isZh ? "\u9009\u62E9 AI \u63D0\u4F9B\u5546:" : "Select AI Provider:",
100
- choices: providerChoices,
101
- pageSize: 10
102
- }
103
- ]);
104
- wizard.setProvider(provider);
105
- const step2 = wizard.getStep2(provider);
106
- console.log("");
107
- console.log(ansis.cyan(`Step 2: ${step2.title}`));
108
- console.log(ansis.dim(step2.description));
109
- console.log("");
110
- const credentials = {};
111
- for (const field of step2.fields) {
112
- if (field.type === "password") {
113
- const { value } = await inquirer.prompt([
114
- {
115
- type: "password",
116
- name: "value",
117
- message: `${field.label}:`,
118
- mask: "*"
119
- }
120
- ]);
121
- credentials[field.name] = value;
122
- } else if (field.type === "select" && field.options) {
123
- const { value } = await inquirer.prompt([
124
- {
125
- type: "list",
126
- name: "value",
127
- message: `${field.label}:`,
128
- choices: field.options.map((opt) => ({
129
- name: opt.label,
130
- value: opt.value
131
- })),
132
- default: field.defaultValue
133
- }
134
- ]);
135
- credentials[field.name] = value;
136
- } else {
137
- const { value } = await inquirer.prompt([
138
- {
139
- type: "input",
140
- name: "value",
141
- message: `${field.label}:`,
142
- default: field.defaultValue
143
- }
144
- ]);
145
- credentials[field.name] = value;
146
- }
147
- }
148
- await wizard.setCredentials(credentials);
149
- console.log("");
150
- console.log(ansis.dim(isZh ? "\u6B63\u5728\u6D4B\u8BD5\u8FDE\u63A5..." : "Testing connection..."));
151
- const testResult = await wizard.testConnection();
152
- if (testResult.success) {
153
- console.log(ansis.green(`\u2713 ${testResult.message}`));
154
- const setup = await wizard.complete();
155
- console.log("");
156
- console.log(ansis.green.bold(isZh ? "\u{1F389} \u914D\u7F6E\u5B8C\u6210\uFF01" : "\u{1F389} Configuration complete!"));
157
- console.log(ansis.dim(isZh ? `\u63D0\u4F9B\u5546: ${setup.provider}` : `Provider: ${setup.provider}`));
158
- console.log(ansis.dim(isZh ? `\u6A21\u578B: ${setup.model}` : `Model: ${setup.model}`));
159
- return true;
160
- } else {
161
- console.log(ansis.red(`\u2717 ${testResult.message}`));
162
- if (testResult.suggestions) {
163
- console.log(ansis.yellow(isZh ? "\u5EFA\u8BAE:" : "Suggestions:"));
164
- testResult.suggestions.forEach((s) => console.log(` - ${s}`));
165
- }
166
- return false;
167
- }
168
- } catch (error) {
169
- const ansis2 = (await import('ansis')).default;
170
- console.log(ansis2.red(isZh ? "\u914D\u7F6E\u5931\u8D25" : "Configuration failed"));
171
- console.log(ansis2.dim(String(error)));
172
- return false;
173
- }
174
- }
175
- async function needsApiSetup() {
176
- const status = await detectApiStatus();
177
- return !status.configured;
178
- }
179
-
180
- export { detectApiStatus, getApiStatusSummary, needsApiSetup, quickApiSetup };