ccjk 9.8.2 → 9.10.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.
@@ -252,6 +252,17 @@ async function checkAndUpdateTools(skipPrompt = false) {
252
252
  console.warn(ansis.yellow(`\u26A0 Duplicate installation check failed: ${errorMessage}`));
253
253
  }
254
254
  const results = [];
255
+ console.log(ansis.bold("\u{1F4E6} CCJK"));
256
+ try {
257
+ await checkCcjkVersionAndPrompt(skipPrompt);
258
+ results.push({ tool: "CCJK", success: true });
259
+ } catch (error) {
260
+ const errorMessage = error instanceof Error ? error.message : String(error);
261
+ console.error(ansis.red(`\u274C ${format(i18n.t("updater:updateFailed"), { tool: "CCJK" })}: ${errorMessage}`));
262
+ results.push({ tool: "CCJK", success: false, error: errorMessage });
263
+ }
264
+ console.log();
265
+ console.log(ansis.bold("\u{1F500} CCR"));
255
266
  try {
256
267
  const success = await updateCcr(false, skipPrompt);
257
268
  results.push({ tool: "CCR", success });
@@ -290,5 +301,58 @@ async function checkAndUpdateTools(skipPrompt = false) {
290
301
  }
291
302
  }
292
303
  }
304
+ async function checkCcjkVersionAndPrompt(skipPrompt) {
305
+ try {
306
+ const { readFileSync } = await import('node:fs');
307
+ const { fileURLToPath } = await import('node:url');
308
+ const { dirname, join } = await import('pathe');
309
+ const __dirname = dirname(fileURLToPath(import.meta.url));
310
+ const pkgPath = join(__dirname, "..", "..", "package.json");
311
+ const pkg = JSON.parse(readFileSync(pkgPath, "utf-8"));
312
+ const currentVersion = pkg.version;
313
+ console.log(ansis.cyan(`${i18n.t("updater:currentVersion")} v${currentVersion}`));
314
+ const { stdout } = await exec("npm", ["view", "ccjk", "version"]);
315
+ const latestVersion = stdout.trim();
316
+ console.log(ansis.cyan(`${i18n.t("updater:latestVersion")} v${latestVersion}`));
317
+ if (currentVersion === latestVersion) {
318
+ console.log(ansis.green(`\u2713 ${i18n.t("updater:alreadyLatest")}`));
319
+ return;
320
+ }
321
+ if (!skipPrompt) {
322
+ const inquirer = (await import('inquirer')).default;
323
+ const { shouldUpdate } = await inquirer.prompt([
324
+ {
325
+ type: "confirm",
326
+ name: "shouldUpdate",
327
+ message: format(i18n.t("updater:updatePrompt"), { tool: "CCJK", version: latestVersion }),
328
+ default: true
329
+ }
330
+ ]);
331
+ if (!shouldUpdate) {
332
+ console.log(ansis.gray(i18n.t("updater:updateSkipped")));
333
+ return;
334
+ }
335
+ }
336
+ console.log(ansis.dim("Clearing npx cache..."));
337
+ try {
338
+ await exec("npm", ["cache", "clean", "--force"]);
339
+ } catch {
340
+ }
341
+ const ora2 = (await import('ora')).default;
342
+ const updateSpinner = ora2("Updating CCJK...").start();
343
+ try {
344
+ await execWithSudoIfNeeded("npm", ["install", "-g", "ccjk@latest", "--force"]);
345
+ updateSpinner.succeed(ansis.green(`\u2713 CCJK updated to v${latestVersion}`));
346
+ console.log(ansis.yellow("\n\u26A0 Please restart ccjk to use the new version"));
347
+ process.exit(0);
348
+ } catch (error) {
349
+ updateSpinner.fail(ansis.red("\u2717 CCJK update failed"));
350
+ console.error(ansis.red(error instanceof Error ? error.message : String(error)));
351
+ console.log(ansis.gray("\nTry manually: npm install -g ccjk@latest"));
352
+ }
353
+ } catch (error) {
354
+ console.error(ansis.red(`${i18n.t("updater:checkFailed")} ${error instanceof Error ? error.message : String(error)}`));
355
+ }
356
+ }
293
357
 
294
358
  export { checkAndUpdateTools, execWithSudoIfNeeded, updateCcr, updateClaudeCode, updateCometixLine };
@@ -1,4 +1,4 @@
1
- const version = "9.8.2";
1
+ const version = "9.10.0";
2
2
  const homepage = "https://github.com/miounet11/ccjk";
3
3
 
4
4
  export { homepage, version };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ccjk",
3
3
  "type": "module",
4
- "version": "9.8.2",
4
+ "version": "9.10.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": {