ccjk 12.0.6 → 12.0.7

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 (62) hide show
  1. package/README.md +14 -0
  2. package/README.zh-CN.md +13 -0
  3. package/dist/chunks/api-cli.mjs +1 -1
  4. package/dist/chunks/ccjk-agents.mjs +3 -2
  5. package/dist/chunks/ccjk-all.mjs +129 -1764
  6. package/dist/chunks/ccjk-hooks.mjs +5 -4
  7. package/dist/chunks/ccjk-mcp.mjs +7 -6
  8. package/dist/chunks/ccjk-setup.mjs +3 -2
  9. package/dist/chunks/ccjk-skills.mjs +6 -5
  10. package/dist/chunks/ccr.mjs +6 -5
  11. package/dist/chunks/check-updates.mjs +8 -8
  12. package/dist/chunks/claude-code-config-manager.mjs +1 -1
  13. package/dist/chunks/claude-code-incremental-manager.mjs +2 -2
  14. package/dist/chunks/codex-config-switch.mjs +1 -1
  15. package/dist/chunks/codex-provider-manager.mjs +1 -1
  16. package/dist/chunks/config-switch.mjs +1 -1
  17. package/dist/chunks/config.mjs +1 -1
  18. package/dist/chunks/config2.mjs +1 -1
  19. package/dist/chunks/config3.mjs +1 -1
  20. package/dist/chunks/constants.mjs +33 -2
  21. package/dist/chunks/dashboard.mjs +115 -3
  22. package/dist/chunks/features.mjs +3 -3
  23. package/dist/chunks/init.mjs +108 -4
  24. package/dist/chunks/installer2.mjs +7 -7
  25. package/dist/chunks/manager.mjs +1048 -0
  26. package/dist/chunks/mcp-cli.mjs +1 -1
  27. package/dist/chunks/mcp.mjs +1 -1
  28. package/dist/chunks/menu.mjs +22 -1
  29. package/dist/chunks/notification.mjs +5 -2
  30. package/dist/chunks/package.mjs +1 -1
  31. package/dist/chunks/quick-provider.mjs +1 -269
  32. package/dist/chunks/quick-setup.mjs +10 -10
  33. package/dist/chunks/remote.mjs +4 -1
  34. package/dist/chunks/simple-config.mjs +1 -1
  35. package/dist/chunks/skill.mjs +117 -9003
  36. package/dist/chunks/skill2.mjs +9003 -0
  37. package/dist/chunks/skills-sync.mjs +536 -55
  38. package/dist/chunks/skills.mjs +7 -1156
  39. package/dist/chunks/smart-defaults.mjs +87 -9
  40. package/dist/chunks/status.mjs +1 -1
  41. package/dist/chunks/uninstall.mjs +1 -1
  42. package/dist/chunks/update.mjs +2 -2
  43. package/dist/chunks/zero-config.mjs +6 -2
  44. package/dist/cli.mjs +3 -1
  45. package/dist/i18n/locales/en/cloud.json +40 -0
  46. package/dist/i18n/locales/zh-CN/cloud.json +40 -0
  47. package/dist/index.d.mts +2586 -2
  48. package/dist/index.d.ts +2586 -2
  49. package/dist/index.mjs +1340 -7
  50. package/dist/shared/ccjk.B364Fu0N.mjs +1819 -0
  51. package/dist/shared/ccjk.BtB1e5jm.mjs +171 -0
  52. package/dist/shared/{ccjk.BnpWvs9V.mjs → ccjk.BwfbSKN2.mjs} +1 -1
  53. package/dist/shared/{ccjk.AqnXPAzw.mjs → ccjk.C2jHOZVP.mjs} +1 -1
  54. package/dist/shared/{ccjk.BSYWk9ML.mjs → ccjk.Cjj8SVrn.mjs} +1 -1
  55. package/dist/shared/ccjk.D6ycHbak.mjs +270 -0
  56. package/dist/shared/ccjk.D8ZLYSZZ.mjs +299 -0
  57. package/dist/shared/{ccjk.s7OCVzdd.mjs → ccjk.DS7UESmF.mjs} +2 -1483
  58. package/dist/shared/{ccjk.BiCrMV5O.mjs → ccjk.DXRAZcix.mjs} +0 -28
  59. package/dist/shared/ccjk.UIvifqNE.mjs +1486 -0
  60. package/dist/shared/{ccjk.BDKUdmLk.mjs → ccjk.c-ETfBZ_.mjs} +208 -86
  61. package/package.json +5 -1
  62. package/templates/claude-code/common/settings.json +3 -1
@@ -38,7 +38,7 @@ import './fs-operations.mjs';
38
38
  import 'node:fs/promises';
39
39
  import './json-config.mjs';
40
40
  import './config.mjs';
41
- import '../shared/ccjk.BiCrMV5O.mjs';
41
+ import '../shared/ccjk.DXRAZcix.mjs';
42
42
  import './platform.mjs';
43
43
  import '../shared/ccjk.BFQ7yr5S.mjs';
44
44
  import './prompts.mjs';
@@ -40,7 +40,7 @@ import '../shared/ccjk.BBtCGd_g.mjs';
40
40
  import './ccjk-config.mjs';
41
41
  import './index6.mjs';
42
42
  import './config.mjs';
43
- import '../shared/ccjk.BiCrMV5O.mjs';
43
+ import '../shared/ccjk.DXRAZcix.mjs';
44
44
  import '../shared/ccjk.BFQ7yr5S.mjs';
45
45
  import './prompts.mjs';
46
46
  import '../shared/ccjk.gDEDGD_t.mjs';
@@ -8,7 +8,7 @@ import { ensureI18nInitialized, i18n } from './index5.mjs';
8
8
  import { displayBannerWithInfo } from './banner.mjs';
9
9
  import { updateZcfConfig, readZcfConfig } from './ccjk-config.mjs';
10
10
  import { r as readMcpConfig } from './claude-config.mjs';
11
- import { r as resolveCodeType } from '../shared/ccjk.BSYWk9ML.mjs';
11
+ import { r as resolveCodeType } from '../shared/ccjk.Cjj8SVrn.mjs';
12
12
  import { h as handleExitPromptError, a as handleGeneralError } from '../shared/ccjk.BIxuVL3_.mjs';
13
13
  import { changeScriptLanguageFeature, mcpManagerFeature, configureMergedPermissionsFeature, configureAiMemoryFeature, configureDefaultModelFeature, configureMcpFeature, configureApiFeature } from './features.mjs';
14
14
  import { a as addNumbersToChoices } from '../shared/ccjk.BFQ7yr5S.mjs';
@@ -350,11 +350,32 @@ function checkNewMcpServicesHint(isZh) {
350
350
  } catch {
351
351
  }
352
352
  }
353
+ async function showContextValueSummary(isZh) {
354
+ try {
355
+ const { getContextPersistence } = await import('./persistence.mjs');
356
+ const persistence = getContextPersistence();
357
+ const metrics = persistence.getCompressionMetricsStats();
358
+ if (metrics.totalCompressions === 0) {
359
+ return;
360
+ }
361
+ const saved = metrics.totalTokensSaved.toLocaleString();
362
+ const sessionCompressions = metrics.sessionStats?.compressions || 0;
363
+ const sessionSavings = metrics.sessionStats?.tokensSaved || 0;
364
+ console.log(a.cyan(` \u{1F9E0} ${isZh ? "\u4E0A\u4E0B\u6587\u6536\u76CA\u6458\u8981" : "Context Value Summary"}:`));
365
+ console.log(a.dim(` ${isZh ? "\u7D2F\u8BA1\u8282\u7701" : "Total saved"}: ${saved} ${isZh ? "tokens" : "tokens"}`));
366
+ if (sessionCompressions > 0) {
367
+ console.log(a.dim(` ${isZh ? "\u6700\u8FD124\u5C0F\u65F6" : "Last 24h"}: ${sessionCompressions} ${isZh ? "\u6B21\u538B\u7F29\uFF0C\u8282\u7701" : "compressions, saved"} ${sessionSavings.toLocaleString()} tokens`));
368
+ }
369
+ console.log(a.dim(` ${isZh ? "\u67E5\u770B\u8BE6\u60C5" : "Details"}: ${isZh ? "ccjk morning / ccjk review" : "ccjk morning / ccjk review"}`));
370
+ } catch {
371
+ }
372
+ }
353
373
  async function showSimplifiedMenu() {
354
374
  const lang = i18n.language;
355
375
  const isZh = lang === "zh-CN";
356
376
  console.log("");
357
377
  console.log(a.bold.yellow(isZh ? "\u8BF7\u9009\u62E9\u529F\u80FD" : "Select Feature"));
378
+ await showContextValueSummary(isZh);
358
379
  checkNewMcpServicesHint(isZh);
359
380
  console.log(a.dim(` -------- Claude Code --------`));
360
381
  console.log(` ${a.green("1.")} ${isZh ? "\u5B8C\u6574\u521D\u59CB\u5316" : "Full Init"} ${a.dim(isZh ? "- \u5B89\u88C5 Claude Code + \u5BFC\u5165\u5DE5\u4F5C\u6D41 + \u914D\u7F6E API \u6216 CCR \u4EE3\u7406 + \u914D\u7F6E MCP \u670D\u52A1" : "- Install Claude Code + Import workflows + Configure API or CCR proxy + Configure MCP")}`);
@@ -1,7 +1,7 @@
1
1
  import a from './index2.mjs';
2
2
  import { i as inquirer } from './index3.mjs';
3
3
  import { i18n } from './index5.mjs';
4
- import { m as maskToken, a as isValidTokenFormat, c as generateDeviceToken, d as decryptToken, e as encryptToken, f as getDeviceInfo, i as isDeviceBound, g as getBindingStatus, u as unbindDevice, b as bindDevice, s as sendNotification } from '../shared/ccjk.BDKUdmLk.mjs';
4
+ import { m as maskToken, a as isValidTokenFormat, c as generateDeviceToken, d as decryptToken, e as encryptToken, f as getDeviceInfo, i as isDeviceBound, g as getBindingStatus, u as unbindDevice, b as bindDevice, s as sendNotification } from '../shared/ccjk.c-ETfBZ_.mjs';
5
5
  import { exec } from 'node:child_process';
6
6
  import * as fs from 'node:fs';
7
7
  import fs__default from 'node:fs';
@@ -29,6 +29,9 @@ import 'string_decoder';
29
29
  import 'node:url';
30
30
  import '../shared/ccjk.bQ7Dh1g4.mjs';
31
31
  import 'node:buffer';
32
+ import '../shared/ccjk.BtB1e5jm.mjs';
33
+ import './constants.mjs';
34
+ import '../shared/ccjk.D6ycHbak.mjs';
32
35
  import 'node:fs/promises';
33
36
 
34
37
  const execAsync = promisify(exec);
@@ -1549,7 +1552,7 @@ async function handleBind(code) {
1549
1552
  console.log("");
1550
1553
  console.log(a.green(`\u2705 ${i18n.t("notification:cloud.bindSuccess")}`));
1551
1554
  console.log("");
1552
- console.log(a.dim(i18n.t("notification:cloud.deviceId", { id: result.deviceId || "N/A" })));
1555
+ console.log(a.dim(i18n.t("notification:cloud.deviceId", { id: result.data?.deviceId || "N/A" })));
1553
1556
  console.log("");
1554
1557
  const { sendTest } = await inquirer.prompt([{
1555
1558
  type: "confirm",
@@ -1,3 +1,3 @@
1
- const version = "12.0.5";
1
+ const version = "12.0.6";
2
2
 
3
3
  export { version };
@@ -1,6 +1,7 @@
1
1
  import a from './index2.mjs';
2
2
  import { i as inquirer } from './index3.mjs';
3
3
  import ora from './index7.mjs';
4
+ import { c as createApiClient } from '../shared/ccjk.D6ycHbak.mjs';
4
5
  import '../shared/ccjk.BAGoDD49.mjs';
5
6
  import 'node:readline';
6
7
  import 'stream';
@@ -18,275 +19,6 @@ import 'node:crypto';
18
19
  import 'buffer';
19
20
  import 'string_decoder';
20
21
 
21
- const DEFAULT_TIMEOUT = 3e4;
22
- const DEFAULT_RETRY_ATTEMPTS = 3;
23
- const DEFAULT_RETRY_DELAY = 1e3;
24
- class CloudApiClient {
25
- baseUrl;
26
- timeout;
27
- authToken;
28
- userAgent;
29
- retry;
30
- /**
31
- * Create a new CloudApiClient instance
32
- *
33
- * @param config - Client configuration
34
- */
35
- constructor(config) {
36
- this.baseUrl = config.baseUrl.replace(/\/$/, "");
37
- this.timeout = config.timeout || DEFAULT_TIMEOUT;
38
- this.authToken = config.authToken;
39
- this.userAgent = config.userAgent || "CCJK-Client/1.0";
40
- this.retry = config.retry || {
41
- maxAttempts: DEFAULT_RETRY_ATTEMPTS,
42
- delay: DEFAULT_RETRY_DELAY
43
- };
44
- }
45
- // ==========================================================================
46
- // Configuration Methods
47
- // ==========================================================================
48
- /**
49
- * Set authentication token
50
- *
51
- * @param token - Authentication token
52
- */
53
- setAuthToken(token) {
54
- this.authToken = token;
55
- }
56
- /**
57
- * Clear authentication token
58
- */
59
- clearAuthToken() {
60
- this.authToken = void 0;
61
- }
62
- /**
63
- * Get current base URL
64
- */
65
- getBaseUrl() {
66
- return this.baseUrl;
67
- }
68
- /**
69
- * Update base URL
70
- *
71
- * @param url - New base URL
72
- */
73
- setBaseUrl(url) {
74
- this.baseUrl = url.replace(/\/$/, "");
75
- }
76
- // ==========================================================================
77
- // Request Methods
78
- // ==========================================================================
79
- /**
80
- * Make an HTTP request to the cloud service
81
- *
82
- * @param path - API endpoint path (e.g., '/plugins/recommend')
83
- * @param options - Request options
84
- * @returns API response
85
- *
86
- * @example
87
- * ```typescript
88
- * const response = await client.request<{ data: string }>('/api/endpoint', {
89
- * method: 'POST',
90
- * body: { key: 'value' },
91
- * timeout: 5000
92
- * })
93
- * ```
94
- */
95
- async request(path, options) {
96
- const maxAttempts = options.retry?.maxAttempts || this.retry.maxAttempts;
97
- const retryDelay = options.retry?.delay || this.retry.delay;
98
- let lastError = null;
99
- for (let attempt = 1; attempt <= maxAttempts; attempt++) {
100
- try {
101
- return await this.executeRequest(path, options);
102
- } catch (error) {
103
- lastError = error instanceof Error ? error : new Error(String(error));
104
- if (attempt === maxAttempts || this.isClientError(lastError)) {
105
- break;
106
- }
107
- await this.sleep(retryDelay * attempt);
108
- }
109
- }
110
- return {
111
- success: false,
112
- error: lastError?.message || "Request failed",
113
- code: "REQUEST_FAILED"
114
- };
115
- }
116
- /**
117
- * Execute a single HTTP request
118
- *
119
- * @private
120
- */
121
- async executeRequest(path, options) {
122
- const url = this.buildUrl(path, options.query);
123
- const timeout = options.timeout || this.timeout;
124
- const controller = new AbortController();
125
- const timeoutId = setTimeout(() => controller.abort(), timeout);
126
- try {
127
- const headers = this.buildHeaders(options);
128
- const response = await fetch(url, {
129
- method: options.method,
130
- headers,
131
- body: options.body ? JSON.stringify(options.body) : void 0,
132
- signal: controller.signal
133
- });
134
- clearTimeout(timeoutId);
135
- const data = await response.json();
136
- if (!response.ok) {
137
- const errorMsg = typeof data.error === "object" && data.error !== null ? data.error.message || JSON.stringify(data.error) : data.error || `HTTP ${response.status}: ${response.statusText}`;
138
- const errorCode = typeof data.error === "object" && data.error !== null ? data.error.code || data.code : data.code;
139
- return {
140
- success: false,
141
- error: errorMsg,
142
- code: errorCode || `HTTP_${response.status}`
143
- };
144
- }
145
- return {
146
- ...data,
147
- success: true
148
- };
149
- } catch (error) {
150
- clearTimeout(timeoutId);
151
- if (error instanceof Error) {
152
- if (error.name === "AbortError") {
153
- return {
154
- success: false,
155
- error: "Request timeout",
156
- code: "TIMEOUT"
157
- };
158
- }
159
- return {
160
- success: false,
161
- error: error.message,
162
- code: "NETWORK_ERROR"
163
- };
164
- }
165
- return {
166
- success: false,
167
- error: String(error),
168
- code: "UNKNOWN_ERROR"
169
- };
170
- }
171
- }
172
- // ==========================================================================
173
- // Convenience Methods
174
- // ==========================================================================
175
- /**
176
- * Make a GET request
177
- *
178
- * @param path - API endpoint path
179
- * @param query - Query parameters
180
- * @param options - Additional request options
181
- * @returns API response
182
- */
183
- async get(path, query, options) {
184
- return this.request(path, {
185
- method: "GET",
186
- query,
187
- ...options
188
- });
189
- }
190
- /**
191
- * Make a POST request
192
- *
193
- * @param path - API endpoint path
194
- * @param body - Request body
195
- * @param options - Additional request options
196
- * @returns API response
197
- */
198
- async post(path, body, options) {
199
- return this.request(path, {
200
- method: "POST",
201
- body,
202
- ...options
203
- });
204
- }
205
- /**
206
- * Make a PUT request
207
- *
208
- * @param path - API endpoint path
209
- * @param body - Request body
210
- * @param options - Additional request options
211
- * @returns API response
212
- */
213
- async put(path, body, options) {
214
- return this.request(path, {
215
- method: "PUT",
216
- body,
217
- ...options
218
- });
219
- }
220
- /**
221
- * Make a DELETE request
222
- *
223
- * @param path - API endpoint path
224
- * @param options - Additional request options
225
- * @returns API response
226
- */
227
- async delete(path, options) {
228
- return this.request(path, {
229
- method: "DELETE",
230
- ...options
231
- });
232
- }
233
- // ==========================================================================
234
- // Helper Methods
235
- // ==========================================================================
236
- /**
237
- * Build full URL with query parameters
238
- *
239
- * @private
240
- */
241
- buildUrl(path, query) {
242
- const url = `${this.baseUrl}${path}`;
243
- if (!query || Object.keys(query).length === 0) {
244
- return url;
245
- }
246
- const params = new URLSearchParams();
247
- for (const [key, value] of Object.entries(query)) {
248
- params.append(key, String(value));
249
- }
250
- return `${url}?${params.toString()}`;
251
- }
252
- /**
253
- * Build request headers
254
- *
255
- * @private
256
- */
257
- buildHeaders(options) {
258
- const headers = {
259
- "Content-Type": "application/json",
260
- "User-Agent": this.userAgent,
261
- ...options.headers
262
- };
263
- const token = options.authToken || this.authToken;
264
- if (token) {
265
- headers.Authorization = `Bearer ${token}`;
266
- }
267
- return headers;
268
- }
269
- /**
270
- * Check if error is a client error (4xx)
271
- *
272
- * @private
273
- */
274
- isClientError(error) {
275
- return error.message.includes("HTTP 4");
276
- }
277
- /**
278
- * Sleep for specified milliseconds
279
- *
280
- * @private
281
- */
282
- sleep(ms) {
283
- return new Promise((resolve) => setTimeout(resolve, ms));
284
- }
285
- }
286
- function createApiClient(config) {
287
- return new CloudApiClient(config);
288
- }
289
-
290
22
  const CLOUD_API_BASE_URL = "https://api.claudehome.cn/v1";
291
23
  const REQUEST_TIMEOUT = 1e4;
292
24
  const BUILTIN_PROVIDERS = {
@@ -1,6 +1,6 @@
1
1
  import a from './index2.mjs';
2
2
  import { i as inquirer } from './index3.mjs';
3
- import { detectSmartDefaults } from './smart-defaults.mjs';
3
+ import { d as detectSmartDefaults } from './smart-defaults.mjs';
4
4
  import { i18n } from './index5.mjs';
5
5
  import { updateZcfConfig } from './ccjk-config.mjs';
6
6
  import { g as getRuntimeVersion } from '../shared/ccjk.gDEDGD_t.mjs';
@@ -23,35 +23,35 @@ import 'buffer';
23
23
  import 'string_decoder';
24
24
  import 'node:child_process';
25
25
  import 'node:fs';
26
+ import './constants.mjs';
27
+ import '../shared/ccjk.bQ7Dh1g4.mjs';
28
+ import './json-config.mjs';
29
+ import '../shared/ccjk.RyizuzOI.mjs';
30
+ import './fs-operations.mjs';
31
+ import 'node:fs/promises';
26
32
  import './platform.mjs';
27
33
  import './main.mjs';
28
34
  import 'module';
29
35
  import 'node:stream';
30
- import '../shared/ccjk.bQ7Dh1g4.mjs';
31
36
  import '../shared/ccjk.BrPUmTqm.mjs';
32
37
  import 'node:url';
33
38
  import '../shared/ccjk.BBtCGd_g.mjs';
34
39
  import './index6.mjs';
35
- import './constants.mjs';
36
- import './fs-operations.mjs';
37
- import 'node:fs/promises';
38
- import './json-config.mjs';
39
- import '../shared/ccjk.RyizuzOI.mjs';
40
40
  import './codex.mjs';
41
41
  import './index7.mjs';
42
42
  import '../shared/ccjk.CxpGa6MC.mjs';
43
43
  import './config.mjs';
44
44
  import './claude-config.mjs';
45
- import '../shared/ccjk.BiCrMV5O.mjs';
45
+ import '../shared/ccjk.DXRAZcix.mjs';
46
46
  import '../shared/ccjk.BFQ7yr5S.mjs';
47
47
  import './prompts.mjs';
48
48
  import '../shared/ccjk.DOwtZMk8.mjs';
49
- import '../shared/ccjk.BnpWvs9V.mjs';
49
+ import '../shared/ccjk.BwfbSKN2.mjs';
50
50
  import './banner.mjs';
51
51
  import './config2.mjs';
52
52
  import './auto-updater.mjs';
53
53
  import './version-checker.mjs';
54
- import '../shared/ccjk.BSYWk9ML.mjs';
54
+ import '../shared/ccjk.Cjj8SVrn.mjs';
55
55
  import '../shared/ccjk.BIxuVL3_.mjs';
56
56
  import './installer.mjs';
57
57
  import '../shared/ccjk._dESH4Rk.mjs';
@@ -5,7 +5,7 @@ import ora from './index7.mjs';
5
5
  import { homedir } from 'os';
6
6
  import { join } from 'path';
7
7
  import { i18n } from './index5.mjs';
8
- import { i as isDeviceBound, g as getBindingStatus, b as bindDevice } from '../shared/ccjk.BDKUdmLk.mjs';
8
+ import { i as isDeviceBound, g as getBindingStatus, b as bindDevice } from '../shared/ccjk.c-ETfBZ_.mjs';
9
9
  import { l as logger } from '../shared/ccjk.DG_o24cZ.mjs';
10
10
  import 'node:readline';
11
11
  import '../shared/ccjk.BAGoDD49.mjs';
@@ -27,6 +27,9 @@ import '../shared/ccjk.bQ7Dh1g4.mjs';
27
27
  import './fs-operations.mjs';
28
28
  import 'node:fs/promises';
29
29
  import 'node:buffer';
30
+ import '../shared/ccjk.BtB1e5jm.mjs';
31
+ import './constants.mjs';
32
+ import '../shared/ccjk.D6ycHbak.mjs';
30
33
  import './index2.mjs';
31
34
 
32
35
  const DAEMON_CONFIG_PATH = join(homedir(), ".ccjk", "daemon.json");
@@ -3,7 +3,7 @@ import { fileURLToPath } from 'node:url';
3
3
  import { exec as q } from './main.mjs';
4
4
  import { SETTINGS_FILE, CLAUDE_DIR } from './constants.mjs';
5
5
  import { ensureDir, writeFileAtomic } from './fs-operations.mjs';
6
- import { m as mergeAndCleanPermissions } from '../shared/ccjk.BiCrMV5O.mjs';
6
+ import { m as mergeAndCleanPermissions } from '../shared/ccjk.DXRAZcix.mjs';
7
7
  import { g as getPlatform } from './platform.mjs';
8
8
  import { j as join, d as dirname } from '../shared/ccjk.bQ7Dh1g4.mjs';
9
9
  import 'module';