ocerebro 0.1.4 → 0.1.6
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/bin/ocerebro.js +1 -1
- package/cerebro/cerebro_setup.py +25 -4
- package/package.json +1 -1
- package/pyproject.toml +2 -2
- package/src/cli/main.py +4 -4
package/bin/ocerebro.js
CHANGED
package/cerebro/cerebro_setup.py
CHANGED
|
@@ -5,6 +5,7 @@ Detecta e configura o Claude Desktop e Claude Code automaticamente.
|
|
|
5
5
|
|
|
6
6
|
import json
|
|
7
7
|
import os
|
|
8
|
+
import subprocess
|
|
8
9
|
import sys
|
|
9
10
|
from pathlib import Path
|
|
10
11
|
from typing import Optional
|
|
@@ -99,10 +100,30 @@ def find_claude_desktop_config() -> Path | None:
|
|
|
99
100
|
|
|
100
101
|
def get_ocerebro_path() -> Path:
|
|
101
102
|
"""Retorna o caminho absoluto do OCerebro instalado"""
|
|
102
|
-
# Tenta encontrar o package instalado
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
103
|
+
# Tenta encontrar o package instalado via pip
|
|
104
|
+
try:
|
|
105
|
+
import cerebro
|
|
106
|
+
cerebro_path = Path(cerebro.__file__).parent
|
|
107
|
+
return cerebro_path.resolve()
|
|
108
|
+
except ImportError:
|
|
109
|
+
pass
|
|
110
|
+
|
|
111
|
+
# Fallback: usa pip show para encontrar o Location
|
|
112
|
+
try:
|
|
113
|
+
result = subprocess.run(
|
|
114
|
+
[sys.executable, "-m", "pip", "show", "ocerebro"],
|
|
115
|
+
capture_output=True,
|
|
116
|
+
text=True
|
|
117
|
+
)
|
|
118
|
+
if result.returncode == 0:
|
|
119
|
+
for line in result.stdout.splitlines():
|
|
120
|
+
if line.startswith("Location:"):
|
|
121
|
+
return Path(line.split(":", 1)[1].strip())
|
|
122
|
+
except Exception:
|
|
123
|
+
pass
|
|
124
|
+
|
|
125
|
+
# Último fallback: usa o path do próprio arquivo
|
|
126
|
+
return Path(__file__).parent.resolve()
|
|
106
127
|
|
|
107
128
|
|
|
108
129
|
def generate_mcp_config(ocerebro_path: Path) -> dict:
|
package/package.json
CHANGED
package/pyproject.toml
CHANGED
|
@@ -4,12 +4,12 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "ocerebro"
|
|
7
|
-
version = "0.1.
|
|
7
|
+
version = "0.1.6"
|
|
8
8
|
description = "OCerebro - Sistema de Memoria para Agentes (Claude Code/MCP)"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.10"
|
|
11
11
|
authors = [
|
|
12
|
-
{name = "OARANHA", email = "
|
|
12
|
+
{name = "OARANHA", email = "aranha.com@gmail.com"}
|
|
13
13
|
]
|
|
14
14
|
keywords = [
|
|
15
15
|
"claude",
|
package/src/cli/main.py
CHANGED
|
@@ -266,7 +266,7 @@ class CerebroCLI:
|
|
|
266
266
|
|
|
267
267
|
def _run_init(project_path: Optional[Path] = None):
|
|
268
268
|
"""Lógica de init compartilhada entre 'init' e 'setup init'"""
|
|
269
|
-
from cerebro.cerebro_setup import
|
|
269
|
+
from cerebro.cerebro_setup import setup_ocerebro_dir, setup_hooks
|
|
270
270
|
|
|
271
271
|
print("Como quer usar o OCerebro?")
|
|
272
272
|
print(" 1. Neste projeto (cria .ocerebro/ aqui)")
|
|
@@ -285,7 +285,7 @@ def _run_init(project_path: Optional[Path] = None):
|
|
|
285
285
|
config_file.write_text(f"base_path={base_path}\n", encoding="utf-8")
|
|
286
286
|
print(f"✓ Configuração salva em {config_file}")
|
|
287
287
|
|
|
288
|
-
|
|
288
|
+
setup_ocerebro_dir(base_path)
|
|
289
289
|
setup_hooks(base_path)
|
|
290
290
|
print("\nSetup completo! Agora execute:")
|
|
291
291
|
print(" ocerebro setup claude")
|
|
@@ -383,7 +383,7 @@ def main():
|
|
|
383
383
|
|
|
384
384
|
# Comando setup
|
|
385
385
|
if args.command == "setup":
|
|
386
|
-
from cerebro.cerebro_setup import setup_claude_desktop, setup_hooks,
|
|
386
|
+
from cerebro.cerebro_setup import setup_claude_desktop, setup_hooks, setup_ocerebro_dir
|
|
387
387
|
|
|
388
388
|
if args.subcommand == "claude":
|
|
389
389
|
success = setup_claude_desktop()
|
|
@@ -395,7 +395,7 @@ def main():
|
|
|
395
395
|
_run_init(getattr(args, 'project', None))
|
|
396
396
|
sys.exit(0)
|
|
397
397
|
else:
|
|
398
|
-
|
|
398
|
+
setup_ocerebro_dir(args.project)
|
|
399
399
|
setup_hooks(args.project)
|
|
400
400
|
setup_claude_desktop()
|
|
401
401
|
sys.exit(0)
|