juno-code 1.0.20 → 1.0.22

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.
package/dist/bin/cli.js CHANGED
@@ -401,7 +401,31 @@ var init_service_installer = __esm({
401
401
  if (!exists) {
402
402
  return true;
403
403
  }
404
- return semver__default.default.gt(packageVersion, installedVersion);
404
+ if (semver__default.default.gt(packageVersion, installedVersion)) {
405
+ return true;
406
+ }
407
+ if (semver__default.default.eq(packageVersion, installedVersion)) {
408
+ const codexExists = await fs3__default.default.pathExists(path3__namespace.join(this.SERVICES_DIR, "codex.py"));
409
+ const claudeExists = await fs3__default.default.pathExists(path3__namespace.join(this.SERVICES_DIR, "claude.py"));
410
+ if (!codexExists || !claudeExists) {
411
+ return true;
412
+ }
413
+ try {
414
+ const packageServicesDir = this.getPackageServicesDir();
415
+ const packageCodex = path3__namespace.join(packageServicesDir, "codex.py");
416
+ const packageClaude = path3__namespace.join(packageServicesDir, "claude.py");
417
+ const packageCodexExists = await fs3__default.default.pathExists(packageCodex);
418
+ const packageClaudeExists = await fs3__default.default.pathExists(packageClaude);
419
+ if (packageCodexExists || packageClaudeExists) {
420
+ const isDevelopment2 = packageServicesDir.includes("/src/");
421
+ if (isDevelopment2) {
422
+ return true;
423
+ }
424
+ }
425
+ } catch {
426
+ }
427
+ }
428
+ return false;
405
429
  } catch {
406
430
  return true;
407
431
  }
@@ -455,13 +479,28 @@ var init_service_installer = __esm({
455
479
  */
456
480
  static async autoUpdate() {
457
481
  try {
482
+ const debug = process.env.JUNO_CODE_DEBUG === "1";
483
+ if (debug) {
484
+ const packageVersion = this.getPackageVersion();
485
+ const installedVersion = await this.getInstalledVersion();
486
+ console.error(`[DEBUG] Package version: ${packageVersion}, Installed version: ${installedVersion || "not found"}`);
487
+ }
458
488
  const needsUpdate = await this.needsUpdate();
489
+ if (debug) {
490
+ console.error(`[DEBUG] Needs update: ${needsUpdate}`);
491
+ }
459
492
  if (needsUpdate) {
460
493
  await this.install(true);
494
+ if (debug) {
495
+ console.error(`[DEBUG] Service scripts updated successfully`);
496
+ }
461
497
  return true;
462
498
  }
463
499
  return false;
464
- } catch {
500
+ } catch (error) {
501
+ if (process.env.JUNO_CODE_DEBUG === "1") {
502
+ console.error("[DEBUG] autoUpdate error:", error instanceof Error ? error.message : String(error));
503
+ }
465
504
  return false;
466
505
  }
467
506
  }
@@ -12806,11 +12845,23 @@ var init_main = __esm({
12806
12845
  return;
12807
12846
  }
12808
12847
  }
12809
- const content = event.content.length > 100 ? event.content.substring(0, 100) + "..." : event.content;
12810
- if (this.verbose) {
12811
- console.error(chalk12__default.default.gray(`[${timestamp}] ${event.type}: ${content}`));
12812
- } else {
12813
- console.error(chalk12__default.default.blue(`\u{1F4E1} ${event.type}: ${content}`));
12848
+ try {
12849
+ const jsonObj = JSON.parse(event.content);
12850
+ const formattedJson = this.colorizeJson(jsonObj);
12851
+ const backend = event.backend ? chalk12__default.default.cyan(`[${event.backend}]`) : "";
12852
+ if (this.verbose) {
12853
+ console.error(`${chalk12__default.default.gray(timestamp)} ${backend} ${formattedJson}`);
12854
+ } else {
12855
+ console.error(`${backend} ${formattedJson}`);
12856
+ }
12857
+ return;
12858
+ } catch (error) {
12859
+ const backend = event.backend ? `[${event.backend}]` : "";
12860
+ if (this.verbose) {
12861
+ console.error(chalk12__default.default.gray(`[${timestamp}] ${backend} ${event.type}: ${event.content}`));
12862
+ } else {
12863
+ console.error(`${backend} ${chalk12__default.default.blue(`${event.type}:`)} ${event.content}`);
12864
+ }
12814
12865
  }
12815
12866
  }
12816
12867
  /**
@@ -25149,8 +25200,14 @@ async function main() {
25149
25200
  configureEnvironment();
25150
25201
  try {
25151
25202
  const { ServiceInstaller: ServiceInstaller2 } = await Promise.resolve().then(() => (init_service_installer(), service_installer_exports));
25152
- await ServiceInstaller2.autoUpdate();
25153
- } catch {
25203
+ const updated = await ServiceInstaller2.autoUpdate();
25204
+ if (updated && (process.argv.includes("--verbose") || process.argv.includes("-v") || process.env.JUNO_CODE_DEBUG === "1")) {
25205
+ console.error("[DEBUG] Service scripts auto-updated to latest version");
25206
+ }
25207
+ } catch (error) {
25208
+ if (process.env.JUNO_CODE_DEBUG === "1") {
25209
+ console.error("[DEBUG] Service auto-update failed:", error instanceof Error ? error.message : String(error));
25210
+ }
25154
25211
  }
25155
25212
  program.name("juno-code").description("TypeScript implementation of juno-code CLI tool for AI subagent orchestration").version(VERSION, "-V, --version", "Display version information").helpOption("-h, --help", "Display help information");
25156
25213
  setupGlobalOptions(program);