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.mjs CHANGED
@@ -366,7 +366,31 @@ var init_service_installer = __esm({
366
366
  if (!exists) {
367
367
  return true;
368
368
  }
369
- return semver.gt(packageVersion, installedVersion);
369
+ if (semver.gt(packageVersion, installedVersion)) {
370
+ return true;
371
+ }
372
+ if (semver.eq(packageVersion, installedVersion)) {
373
+ const codexExists = await fs3.pathExists(path3.join(this.SERVICES_DIR, "codex.py"));
374
+ const claudeExists = await fs3.pathExists(path3.join(this.SERVICES_DIR, "claude.py"));
375
+ if (!codexExists || !claudeExists) {
376
+ return true;
377
+ }
378
+ try {
379
+ const packageServicesDir = this.getPackageServicesDir();
380
+ const packageCodex = path3.join(packageServicesDir, "codex.py");
381
+ const packageClaude = path3.join(packageServicesDir, "claude.py");
382
+ const packageCodexExists = await fs3.pathExists(packageCodex);
383
+ const packageClaudeExists = await fs3.pathExists(packageClaude);
384
+ if (packageCodexExists || packageClaudeExists) {
385
+ const isDevelopment2 = packageServicesDir.includes("/src/");
386
+ if (isDevelopment2) {
387
+ return true;
388
+ }
389
+ }
390
+ } catch {
391
+ }
392
+ }
393
+ return false;
370
394
  } catch {
371
395
  return true;
372
396
  }
@@ -420,13 +444,28 @@ var init_service_installer = __esm({
420
444
  */
421
445
  static async autoUpdate() {
422
446
  try {
447
+ const debug = process.env.JUNO_CODE_DEBUG === "1";
448
+ if (debug) {
449
+ const packageVersion = this.getPackageVersion();
450
+ const installedVersion = await this.getInstalledVersion();
451
+ console.error(`[DEBUG] Package version: ${packageVersion}, Installed version: ${installedVersion || "not found"}`);
452
+ }
423
453
  const needsUpdate = await this.needsUpdate();
454
+ if (debug) {
455
+ console.error(`[DEBUG] Needs update: ${needsUpdate}`);
456
+ }
424
457
  if (needsUpdate) {
425
458
  await this.install(true);
459
+ if (debug) {
460
+ console.error(`[DEBUG] Service scripts updated successfully`);
461
+ }
426
462
  return true;
427
463
  }
428
464
  return false;
429
- } catch {
465
+ } catch (error) {
466
+ if (process.env.JUNO_CODE_DEBUG === "1") {
467
+ console.error("[DEBUG] autoUpdate error:", error instanceof Error ? error.message : String(error));
468
+ }
430
469
  return false;
431
470
  }
432
471
  }
@@ -12771,11 +12810,23 @@ var init_main = __esm({
12771
12810
  return;
12772
12811
  }
12773
12812
  }
12774
- const content = event.content.length > 100 ? event.content.substring(0, 100) + "..." : event.content;
12775
- if (this.verbose) {
12776
- console.error(chalk12.gray(`[${timestamp}] ${event.type}: ${content}`));
12777
- } else {
12778
- console.error(chalk12.blue(`\u{1F4E1} ${event.type}: ${content}`));
12813
+ try {
12814
+ const jsonObj = JSON.parse(event.content);
12815
+ const formattedJson = this.colorizeJson(jsonObj);
12816
+ const backend = event.backend ? chalk12.cyan(`[${event.backend}]`) : "";
12817
+ if (this.verbose) {
12818
+ console.error(`${chalk12.gray(timestamp)} ${backend} ${formattedJson}`);
12819
+ } else {
12820
+ console.error(`${backend} ${formattedJson}`);
12821
+ }
12822
+ return;
12823
+ } catch (error) {
12824
+ const backend = event.backend ? `[${event.backend}]` : "";
12825
+ if (this.verbose) {
12826
+ console.error(chalk12.gray(`[${timestamp}] ${backend} ${event.type}: ${event.content}`));
12827
+ } else {
12828
+ console.error(`${backend} ${chalk12.blue(`${event.type}:`)} ${event.content}`);
12829
+ }
12779
12830
  }
12780
12831
  }
12781
12832
  /**
@@ -25114,8 +25165,14 @@ async function main() {
25114
25165
  configureEnvironment();
25115
25166
  try {
25116
25167
  const { ServiceInstaller: ServiceInstaller2 } = await Promise.resolve().then(() => (init_service_installer(), service_installer_exports));
25117
- await ServiceInstaller2.autoUpdate();
25118
- } catch {
25168
+ const updated = await ServiceInstaller2.autoUpdate();
25169
+ if (updated && (process.argv.includes("--verbose") || process.argv.includes("-v") || process.env.JUNO_CODE_DEBUG === "1")) {
25170
+ console.error("[DEBUG] Service scripts auto-updated to latest version");
25171
+ }
25172
+ } catch (error) {
25173
+ if (process.env.JUNO_CODE_DEBUG === "1") {
25174
+ console.error("[DEBUG] Service auto-update failed:", error instanceof Error ? error.message : String(error));
25175
+ }
25119
25176
  }
25120
25177
  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");
25121
25178
  setupGlobalOptions(program);