ocerebro 0.4.21 → 0.4.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ocerebro",
3
- "version": "0.4.21",
3
+ "version": "0.4.22",
4
4
  "description": "OCerebro - Sistema de Memoria para Agentes (Claude Code/MCP)",
5
5
  "main": "bin/ocerebro.js",
6
6
  "bin": {
package/pyproject.toml CHANGED
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "ocerebro"
7
- version = "0.4.21"
7
+ version = "0.4.22"
8
8
  description = "OCerebro - Sistema de Memoria para Agentes (Claude Code/MCP)"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
package/src/mcp/server.py CHANGED
@@ -556,9 +556,12 @@ class CerebroMCP:
556
556
  """Gera memória ativa e escreve no diretório nativo do Claude Code para auto-load."""
557
557
  project = args.get("project") or self._detect_project()
558
558
 
559
- # Se official/ estiver vazio, sincroniza automaticamente
560
- official_dir = self.cerebro_path / "official"
561
- has_memories = any(official_dir.rglob("*.md")) if official_dir.exists() else False
559
+ # Auto-sync: se official/<project>/ vazio, sincroniza
560
+ project_official = self.cerebro_path / "official" / project
561
+ has_memories = (
562
+ project_official.exists()
563
+ and any(project_official.rglob("*.md"))
564
+ )
562
565
  if not has_memories:
563
566
  self._sync({"project": project})
564
567
 
@@ -661,42 +664,46 @@ class CerebroMCP:
661
664
  session_id = self.session_manager.get_session_id()
662
665
 
663
666
  lines = [
664
- "╔══════════════════════════════════════════════════════════════╗",
665
- "║ 🧠 OCEREBRO STATUS",
666
- "╚══════════════════════════════════════════════════════════════╝",
667
+ "=" * 60,
668
+ "OCEREBRO STATUS",
669
+ "=" * 60,
667
670
  "",
668
671
  f"Session ID: {session_id}",
669
672
  f"Path: {self.cerebro_path.absolute()}",
670
673
  "",
671
674
  ]
672
675
 
673
- # Contagem de memórias por tipo (entities DB)
676
+ # Contagem de memórias por tipo (metadata DB)
674
677
  try:
675
678
  import sqlite3
676
- conn = sqlite3.connect(str(self.cerebro_path / "index" / "entities.db"))
679
+ conn = sqlite3.connect(
680
+ str(self.cerebro_path / "index" / "metadata.db")
681
+ )
677
682
  cursor = conn.cursor()
678
- cursor.execute("SELECT entity_type, COUNT(*) FROM entities GROUP BY entity_type ORDER BY COUNT(*) DESC")
683
+ cursor.execute(
684
+ "SELECT type, COUNT(*) FROM memories "
685
+ "GROUP BY type ORDER BY COUNT(*) DESC"
686
+ )
679
687
  type_counts = cursor.fetchall()
680
688
  conn.close()
681
689
 
682
690
  if type_counts:
683
691
  total = sum(c for _, c in type_counts)
684
- lines.append(f"📊 Memórias: {total} total")
692
+ lines.append(f"Memorias: {total} total")
685
693
  lines.append("")
686
694
  lines.append("Por tipo:")
687
- for entity_type, count in type_counts:
688
- icon = self._get_type_icon(entity_type)
689
- lines.append(f" {icon} {entity_type}: {count}")
695
+ for mem_type, count in type_counts:
696
+ lines.append(f" - {mem_type}: {count}")
690
697
  else:
691
- lines.append("📊 Memórias: 0")
698
+ lines.append("Memorias: 0")
692
699
  except Exception:
693
- lines.append("📊 Memórias: (banco não acessível)")
700
+ lines.append("Memorias: (banco nao acessivel)")
694
701
 
695
702
  lines.append("")
696
703
  lines.append("Storages:")
697
- lines.append(f" 📁 Raw: {self.cerebro_path / 'raw'}")
698
- lines.append(f" 📝 Working: {self.cerebro_path / 'working'}")
699
- lines.append(f" 📋 Official: {self.cerebro_path / 'official'}")
704
+ lines.append(f" Raw: {self.cerebro_path / 'raw'}")
705
+ lines.append(f" Working: {self.cerebro_path / 'working'}")
706
+ lines.append(f" Official: {self.cerebro_path / 'official'}")
700
707
 
701
708
  return "\n".join(lines)
702
709