codebase-brain 0.3.1__tar.gz → 0.3.2__tar.gz

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 (25) hide show
  1. {codebase_brain-0.3.1 → codebase_brain-0.3.2}/PKG-INFO +1 -1
  2. {codebase_brain-0.3.1 → codebase_brain-0.3.2}/brain_cli.py +1 -0
  3. {codebase_brain-0.3.1 → codebase_brain-0.3.2}/brain_parser/file_watcher.py +3 -4
  4. {codebase_brain-0.3.1 → codebase_brain-0.3.2}/brain_parser/llm_router.py +10 -7
  5. {codebase_brain-0.3.1 → codebase_brain-0.3.2}/codebase_brain.egg-info/PKG-INFO +1 -1
  6. {codebase_brain-0.3.1 → codebase_brain-0.3.2}/setup.py +1 -1
  7. {codebase_brain-0.3.1 → codebase_brain-0.3.2}/README.md +0 -0
  8. {codebase_brain-0.3.1 → codebase_brain-0.3.2}/brain_parser/__init__.py +0 -0
  9. {codebase_brain-0.3.1 → codebase_brain-0.3.2}/brain_parser/ast_parser.py +0 -0
  10. {codebase_brain-0.3.1 → codebase_brain-0.3.2}/brain_parser/bug_detector.py +0 -0
  11. {codebase_brain-0.3.1 → codebase_brain-0.3.2}/brain_parser/codebase_walker.py +0 -0
  12. {codebase_brain-0.3.1 → codebase_brain-0.3.2}/brain_parser/graph_builder.py +0 -0
  13. {codebase_brain-0.3.1 → codebase_brain-0.3.2}/brain_parser/query_engine.py +0 -0
  14. {codebase_brain-0.3.1 → codebase_brain-0.3.2}/brain_parser/root_cause.py +0 -0
  15. {codebase_brain-0.3.1 → codebase_brain-0.3.2}/brain_parser/universal_parser.py +0 -0
  16. {codebase_brain-0.3.1 → codebase_brain-0.3.2}/codebase_brain.egg-info/SOURCES.txt +0 -0
  17. {codebase_brain-0.3.1 → codebase_brain-0.3.2}/codebase_brain.egg-info/dependency_links.txt +0 -0
  18. {codebase_brain-0.3.1 → codebase_brain-0.3.2}/codebase_brain.egg-info/entry_points.txt +0 -0
  19. {codebase_brain-0.3.1 → codebase_brain-0.3.2}/codebase_brain.egg-info/requires.txt +0 -0
  20. {codebase_brain-0.3.1 → codebase_brain-0.3.2}/codebase_brain.egg-info/top_level.txt +0 -0
  21. {codebase_brain-0.3.1 → codebase_brain-0.3.2}/setup.cfg +0 -0
  22. {codebase_brain-0.3.1 → codebase_brain-0.3.2}/tests/test_bugs.py +0 -0
  23. {codebase_brain-0.3.1 → codebase_brain-0.3.2}/tests/test_classes.py +0 -0
  24. {codebase_brain-0.3.1 → codebase_brain-0.3.2}/tests/test_parser.py +0 -0
  25. {codebase_brain-0.3.1 → codebase_brain-0.3.2}/tests/test_treesitter.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: codebase-brain
3
- Version: 0.3.1
3
+ Version: 0.3.2
4
4
  Summary: An AI brain that lives inside your codebase
5
5
  Requires-Python: >=3.8
6
6
  Requires-Dist: watchdog
@@ -206,6 +206,7 @@ def cmd_impact(filepath=None, staged=False, block=False):
206
206
  return
207
207
 
208
208
  _print_impact(G, risk, filepath, clean)
209
+
209
210
  def install_hook(repo_path="."):
210
211
  hook_dir = os.path.join(repo_path, ".git", "hooks")
211
212
  hook_path = os.path.join(hook_dir, "pre-commit")
@@ -4,14 +4,14 @@ from watchdog.events import FileSystemEventHandler
4
4
  from brain_parser.universal_parser import parse_file
5
5
  from brain_parser.codebase_walker import walk_codebase, save_brain, load_brain
6
6
 
7
- SKIP_WATCH = {'.git', '.idea', '__pycache__', 'node_modules', 'lib'}
7
+ SKIP_WATCH = {'.git', '.idea', '__pycache__', 'node_modules', 'lib', 'venv', 'codebase_brain.egg-info', 'temp', '.env'}
8
+
8
9
 
9
10
  class BrainEventHandler(FileSystemEventHandler):
10
11
  def __init__(self):
11
12
  self.brain = load_brain() or {}
12
13
 
13
-
14
- def should_skip(self,path):
14
+ def should_skip(self, path):
15
15
  # skip git, ide, temp files
16
16
  if path.endswith('~'):
17
17
  return True
@@ -25,7 +25,6 @@ class BrainEventHandler(FileSystemEventHandler):
25
25
  return
26
26
  if self.should_skip(event.src_path):
27
27
  return
28
- # skip brain output files
29
28
 
30
29
  if event.src_path.endswith('brain.json') or event.src_path.endswith('brain_map.html'):
31
30
  return
@@ -1,18 +1,21 @@
1
1
  import os
2
+ from dotenv import load_dotenv
3
+
2
4
 
3
5
  def get_config():
4
6
  """Load from local .env first, then global ~/.codebase-brain/config.env"""
5
- from dotenv import load_dotenv
6
-
7
- # try local .env first
8
7
  local_env = os.path.join(os.getcwd(), '.env')
9
8
  if os.path.exists(local_env):
10
- load_dotenv(local_env)
11
- else:
12
- # fallback to global config
9
+ load_dotenv(local_env, override=True)
10
+
11
+ # check if local .env actually had Brain's keys
12
+ has_key = os.getenv("LLM_API_KEY") or os.getenv("GROQ_API_KEY")
13
+
14
+ if not has_key:
15
+ # local .env didn't have Brain's config — fall back to global
13
16
  global_config = os.path.expanduser("~/.codebase-brain/config.env")
14
17
  if os.path.exists(global_config):
15
- load_dotenv(global_config)
18
+ load_dotenv(global_config, override=True)
16
19
 
17
20
  return {
18
21
  'provider': os.getenv("LLM_PROVIDER", "groq").lower(),
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: codebase-brain
3
- Version: 0.3.1
3
+ Version: 0.3.2
4
4
  Summary: An AI brain that lives inside your codebase
5
5
  Requires-Python: >=3.8
6
6
  Requires-Dist: watchdog
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name="codebase-brain",
5
- version="0.3.1",
5
+ version="0.3.2",
6
6
  description="An AI brain that lives inside your codebase",
7
7
  package_dir={"": "."},
8
8
  packages=find_packages(where="."),
File without changes
File without changes