clementine-agent 1.0.35 → 1.0.37

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 (2) hide show
  1. package/dist/cli/index.js +57 -17
  2. package/package.json +1 -1
package/dist/cli/index.js CHANGED
@@ -483,7 +483,7 @@ function cmdDoctor(opts = {}) {
483
483
  let fixed = 0;
484
484
  const isMac = process.platform === 'darwin';
485
485
  const isLinux = process.platform === 'linux';
486
- const hasBrew = isMac && (() => { try {
486
+ let hasBrew = isMac && (() => { try {
487
487
  execSync('which brew', { stdio: 'pipe' });
488
488
  return true;
489
489
  }
@@ -497,6 +497,19 @@ function cmdDoctor(opts = {}) {
497
497
  catch {
498
498
  return false;
499
499
  } })();
500
+ // Homebrew official installer. Honors NONINTERACTIVE=1 (set by tryFix) so
501
+ // it won't block on sudo or "Press Return" prompts, though it still needs
502
+ // the password cached or sudoless access. Surfaced as copy-paste guidance
503
+ // when --fix is off.
504
+ const BREW_INSTALL_CMD = '/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"';
505
+ /** Resolve the current brew binary path after a fresh install. */
506
+ const brewBin = () => {
507
+ for (const p of ['/opt/homebrew/bin/brew', '/usr/local/bin/brew']) {
508
+ if (existsSync(p))
509
+ return p;
510
+ }
511
+ return 'brew';
512
+ };
500
513
  /** Attempt a fix command, return true on success. */
501
514
  function tryFix(label, cmd, opts) {
502
515
  if (!fix)
@@ -571,24 +584,50 @@ function cmdDoctor(opts = {}) {
571
584
  issues++;
572
585
  }
573
586
  }
587
+ // macOS: if Homebrew is missing and --fix is on, install it up front so
588
+ // the subsequent redis-server / libomp checks can auto-resolve. Brew's
589
+ // installer honors NONINTERACTIVE=1 (which tryFix sets), but still needs
590
+ // sudo access — fails gracefully and falls back to copy-paste guidance
591
+ // if sudo isn't available.
592
+ if (isMac && !hasBrew && fix) {
593
+ console.log(` ${RED}FAIL${RESET} Homebrew not installed (required to install graph-memory deps)`);
594
+ if (tryFix('Homebrew', BREW_INSTALL_CMD, { timeout: 600000 })) {
595
+ hasBrew = existsSync('/opt/homebrew/bin/brew') || existsSync('/usr/local/bin/brew');
596
+ }
597
+ if (!hasBrew) {
598
+ console.log(` Install manually, then re-run ${CYAN}clementine doctor --fix${RESET}:`);
599
+ console.log(` ${BREW_INSTALL_CMD}`);
600
+ issues++;
601
+ }
602
+ }
603
+ else if (isMac && !hasBrew) {
604
+ console.log(` ${RED}FAIL${RESET} Homebrew not installed (required to install graph-memory deps)`);
605
+ console.log(` Install it, then run ${CYAN}clementine doctor --fix${RESET}:`);
606
+ console.log(` ${BREW_INSTALL_CMD}`);
607
+ issues++;
608
+ }
574
609
  // FalkorDB graph engine — system dependencies: redis
610
+ // The knowledge-graph layer is a core memory feature. Missing deps are
611
+ // a blocking issue: the daemon technically launches (graph-store.ts has
612
+ // a no-op degradation path), but memory features the framework depends
613
+ // on are silently absent. Surface it loudly.
575
614
  try {
576
615
  execSync('which redis-server', { stdio: 'pipe' });
577
616
  console.log(` ${GREEN}OK${RESET} redis-server found`);
578
617
  }
579
618
  catch {
580
- console.log(` ${RED}FAIL${RESET} redis-server not found (required for knowledge graph)`);
581
- const fixCmd = hasBrew ? 'brew install redis' : hasApt ? 'sudo apt-get install -y redis-server' : null;
619
+ console.log(` ${RED}FAIL${RESET} redis-server not found (required for graph memory)`);
620
+ const fixCmd = hasBrew ? `${brewBin()} install redis` : hasApt ? 'sudo apt-get install -y redis-server' : null;
582
621
  if (fixCmd && tryFix('redis-server', fixCmd)) {
583
622
  // fixed
584
623
  }
585
- else if (!fixCmd && fix) {
586
- console.log(` ${YELLOW}Cannot auto-fix:${RESET} no supported package manager found`);
587
- console.log(` Install redis-server manually`);
588
- issues++;
589
- }
590
624
  else {
591
- console.log(` Fix: brew install redis (macOS) or sudo apt install redis-server (Linux)`);
625
+ if (isMac && !hasBrew) {
626
+ console.log(` Install Homebrew first (see above), then ${CYAN}clementine doctor --fix${RESET}`);
627
+ }
628
+ else {
629
+ console.log(` Fix: brew install redis (macOS) or sudo apt install redis-server (Linux)`);
630
+ }
592
631
  issues++;
593
632
  }
594
633
  }
@@ -603,18 +642,18 @@ function cmdDoctor(opts = {}) {
603
642
  console.log(` ${GREEN}OK${RESET} libomp (OpenMP runtime) found`);
604
643
  }
605
644
  catch {
606
- console.log(` ${RED}FAIL${RESET} libomp (OpenMP runtime) not found (required for knowledge graph)`);
607
- const fixCmd = hasBrew ? 'brew install libomp' : hasApt ? 'sudo apt-get install -y libomp-dev' : null;
645
+ console.log(` ${RED}FAIL${RESET} libomp (OpenMP runtime) not found (required for graph memory)`);
646
+ const fixCmd = hasBrew ? `${brewBin()} install libomp` : hasApt ? 'sudo apt-get install -y libomp-dev' : null;
608
647
  if (fixCmd && tryFix('libomp', fixCmd)) {
609
648
  // fixed
610
649
  }
611
- else if (!fixCmd && fix) {
612
- console.log(` ${YELLOW}Cannot auto-fix:${RESET} no supported package manager found`);
613
- console.log(` Install libomp manually`);
614
- issues++;
615
- }
616
650
  else {
617
- console.log(` Fix: brew install libomp (macOS) or sudo apt install libomp-dev (Linux)`);
651
+ if (isMac && !hasBrew) {
652
+ console.log(` Install Homebrew first (see above), then ${CYAN}clementine doctor --fix${RESET}`);
653
+ }
654
+ else {
655
+ console.log(` Fix: brew install libomp (macOS) or sudo apt install libomp-dev (Linux)`);
656
+ }
618
657
  issues++;
619
658
  }
620
659
  }
@@ -627,6 +666,7 @@ function cmdDoctor(opts = {}) {
627
666
  console.log(` ${RED}FAIL${RESET} FalkorDB graph engine binaries not available`);
628
667
  if (!tryFix('FalkorDB binaries', `node node_modules/falkordblite/scripts/postinstall.js`, { cwd: PACKAGE_ROOT, timeout: 180000 })) {
629
668
  console.log(` Fix: cd ${PACKAGE_ROOT} && node node_modules/falkordblite/scripts/postinstall.js`);
669
+ console.log(` ${DIM}(Usually self-heals once redis-server + libomp are installed)${RESET}`);
630
670
  issues++;
631
671
  }
632
672
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clementine-agent",
3
- "version": "1.0.35",
3
+ "version": "1.0.37",
4
4
  "description": "Clementine — Personal AI Assistant (TypeScript)",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",