sourcefire 0.3.0__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 (43) hide show
  1. {sourcefire-0.3.0/sourcefire.egg-info → sourcefire-0.3.2}/PKG-INFO +1 -1
  2. {sourcefire-0.3.0 → sourcefire-0.3.2}/pyproject.toml +1 -1
  3. {sourcefire-0.3.0 → sourcefire-0.3.2}/sourcefire/api/models.py +1 -1
  4. {sourcefire-0.3.0 → sourcefire-0.3.2}/sourcefire/chain/rag_chain.py +1 -1
  5. {sourcefire-0.3.0 → sourcefire-0.3.2}/sourcefire/cli.py +22 -22
  6. {sourcefire-0.3.0 → sourcefire-0.3.2}/sourcefire/config.py +4 -4
  7. {sourcefire-0.3.0 → sourcefire-0.3.2}/sourcefire/global_config.py +3 -3
  8. {sourcefire-0.3.0 → sourcefire-0.3.2}/sourcefire/init.py +1 -1
  9. {sourcefire-0.3.0 → sourcefire-0.3.2}/sourcefire/watcher.py +16 -0
  10. {sourcefire-0.3.0 → sourcefire-0.3.2/sourcefire.egg-info}/PKG-INFO +1 -1
  11. {sourcefire-0.3.0 → sourcefire-0.3.2}/LICENSE +0 -0
  12. {sourcefire-0.3.0 → sourcefire-0.3.2}/MANIFEST.in +0 -0
  13. {sourcefire-0.3.0 → sourcefire-0.3.2}/README.md +0 -0
  14. {sourcefire-0.3.0 → sourcefire-0.3.2}/setup.cfg +0 -0
  15. {sourcefire-0.3.0 → sourcefire-0.3.2}/sourcefire/__init__.py +0 -0
  16. {sourcefire-0.3.0 → sourcefire-0.3.2}/sourcefire/api/__init__.py +0 -0
  17. {sourcefire-0.3.0 → sourcefire-0.3.2}/sourcefire/api/routes.py +0 -0
  18. {sourcefire-0.3.0 → sourcefire-0.3.2}/sourcefire/chain/__init__.py +0 -0
  19. {sourcefire-0.3.0 → sourcefire-0.3.2}/sourcefire/chain/prompts.py +0 -0
  20. {sourcefire-0.3.0 → sourcefire-0.3.2}/sourcefire/db.py +0 -0
  21. {sourcefire-0.3.0 → sourcefire-0.3.2}/sourcefire/indexer/__init__.py +0 -0
  22. {sourcefire-0.3.0 → sourcefire-0.3.2}/sourcefire/indexer/embeddings.py +0 -0
  23. {sourcefire-0.3.0 → sourcefire-0.3.2}/sourcefire/indexer/language_profiles.py +0 -0
  24. {sourcefire-0.3.0 → sourcefire-0.3.2}/sourcefire/indexer/metadata.py +0 -0
  25. {sourcefire-0.3.0 → sourcefire-0.3.2}/sourcefire/indexer/pipeline.py +0 -0
  26. {sourcefire-0.3.0 → sourcefire-0.3.2}/sourcefire/prompts/system.md +0 -0
  27. {sourcefire-0.3.0 → sourcefire-0.3.2}/sourcefire/retriever/__init__.py +0 -0
  28. {sourcefire-0.3.0 → sourcefire-0.3.2}/sourcefire/retriever/graph.py +0 -0
  29. {sourcefire-0.3.0 → sourcefire-0.3.2}/sourcefire/retriever/search.py +0 -0
  30. {sourcefire-0.3.0 → sourcefire-0.3.2}/sourcefire/static/app.js +0 -0
  31. {sourcefire-0.3.0 → sourcefire-0.3.2}/sourcefire/static/index.html +0 -0
  32. {sourcefire-0.3.0 → sourcefire-0.3.2}/sourcefire/static/styles.css +0 -0
  33. {sourcefire-0.3.0 → sourcefire-0.3.2}/sourcefire.egg-info/SOURCES.txt +0 -0
  34. {sourcefire-0.3.0 → sourcefire-0.3.2}/sourcefire.egg-info/dependency_links.txt +0 -0
  35. {sourcefire-0.3.0 → sourcefire-0.3.2}/sourcefire.egg-info/entry_points.txt +0 -0
  36. {sourcefire-0.3.0 → sourcefire-0.3.2}/sourcefire.egg-info/requires.txt +0 -0
  37. {sourcefire-0.3.0 → sourcefire-0.3.2}/sourcefire.egg-info/top_level.txt +0 -0
  38. {sourcefire-0.3.0 → sourcefire-0.3.2}/tests/test_config.py +0 -0
  39. {sourcefire-0.3.0 → sourcefire-0.3.2}/tests/test_graph.py +0 -0
  40. {sourcefire-0.3.0 → sourcefire-0.3.2}/tests/test_metadata.py +0 -0
  41. {sourcefire-0.3.0 → sourcefire-0.3.2}/tests/test_prompts.py +0 -0
  42. {sourcefire-0.3.0 → sourcefire-0.3.2}/tests/test_routes.py +0 -0
  43. {sourcefire-0.3.0 → sourcefire-0.3.2}/tests/test_search.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sourcefire
3
- Version: 0.3.0
3
+ Version: 0.3.2
4
4
  Summary: Get instant context on any codebase. One command to index, ask questions in plain English, get answers grounded in actual code.
5
5
  Author-email: Athar Wani <athar@cravv.com>
6
6
  License: MIT
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "sourcefire"
3
- version = "0.3.0"
3
+ version = "0.3.2"
4
4
  description = "Get instant context on any codebase. One command to index, ask questions in plain English, get answers grounded in actual code."
5
5
  readme = "README.md"
6
6
  license = {text = "MIT"}
@@ -8,7 +8,7 @@ from pydantic import BaseModel
8
8
  class QueryRequest(BaseModel):
9
9
  query: str
10
10
  mode: Literal["debug", "feature", "explain"] = "debug"
11
- model: Literal["gemini-2.5-flash", "gemini-2.5-pro"] = "gemini-2.5-flash"
11
+ model: Literal["gemini-3.1-flash-lite-preview", "gemini-3.1-pro-preview"] = "gemini-3.1-flash-lite-preview"
12
12
  history: list[dict] = []
13
13
 
14
14
 
@@ -827,7 +827,7 @@ async def stream_rag_response(
827
827
  graph: ImportGraph,
828
828
  query: str,
829
829
  mode: str,
830
- model: str = "gemini-2.5-flash",
830
+ model: str = "gemini-3.1-flash-lite-preview",
831
831
  history: list[dict[str, str]] | None = None,
832
832
  profile: LanguageProfile | None = None,
833
833
  project_dir: Path | None = None,
@@ -270,28 +270,28 @@ def main() -> None:
270
270
 
271
271
  project_dir, sourcefire_dir = discover_project()
272
272
 
273
- # Safety check: warn if running in a broad directory (home, /, etc.)
274
- needs_init = not sourcefire_dir.exists() or not (sourcefire_dir / "config.toml").exists()
275
- if needs_init:
276
- dangerous_dirs = {
277
- Path.home().resolve(),
278
- Path("/").resolve(),
279
- }
280
- # Also flag common broad directories
281
- for name in ("Documents", "Downloads", "Desktop"):
282
- dangerous_dirs.add((Path.home() / name).resolve())
283
-
284
- if project_dir.resolve() in dangerous_dirs:
285
- print(f"\n WARNING: You are about to index: {project_dir.resolve()}")
286
- print(" This is a broad directory and may index thousands of files.\n")
287
- try:
288
- confirm = input(" Do you trust this folder? (yes/no): ").strip().lower()
289
- except (EOFError, KeyboardInterrupt):
290
- print("\nAborted.")
291
- sys.exit(1)
292
- if confirm not in ("yes", "y"):
293
- print("Aborted. Run sourcefire from a project directory instead.")
294
- sys.exit(0)
273
+ # Safety check: block broad directories (home, /, Documents, etc.)
274
+ dangerous_dirs = {
275
+ Path.home().resolve(),
276
+ Path("/").resolve(),
277
+ }
278
+ for name in ("Documents", "Downloads", "Desktop", "Library", "Applications",
279
+ "Pictures", "Music", "Movies", "Public"):
280
+ dangerous_dirs.add((Path.home() / name).resolve())
281
+
282
+ resolved_project = project_dir.resolve()
283
+ if resolved_project in dangerous_dirs:
284
+ print(f"\n WARNING: You are about to index: {resolved_project}")
285
+ print(" This is a broad directory — it will index system files, app data, and more.\n")
286
+ print(" Please check twice. This is NOT a project directory.\n")
287
+ try:
288
+ confirm = input(" Do you trust this folder? (yes/no): ").strip().lower()
289
+ except (EOFError, KeyboardInterrupt):
290
+ print("\nAborted.")
291
+ sys.exit(1)
292
+ if confirm not in ("yes", "y"):
293
+ print("Aborted. cd into a project directory and run sourcefire there.")
294
+ sys.exit(0)
295
295
 
296
296
  # Acquire lock
297
297
  lock_fd = acquire_lock(sourcefire_dir / ".lock")
@@ -30,7 +30,7 @@ class SourcefireConfig:
30
30
 
31
31
  # [llm]
32
32
  provider: str = "gemini"
33
- model: str = "gemini-2.5-flash"
33
+ model: str = "gemini-3.1-flash-lite-preview"
34
34
  api_key_env: str = "GEMINI_API_KEY"
35
35
 
36
36
  # [server]
@@ -68,8 +68,8 @@ class SourcefireConfig:
68
68
  # Constants used by other modules
69
69
  EMBEDDING_MODEL: str = "sentence-transformers/all-MiniLM-L6-v2"
70
70
  MAX_TOKEN_BUDGET: dict[str, int] = {
71
- "gemini-2.5-flash": 100_000,
72
- "gemini-2.5-pro": 200_000,
71
+ "gemini-3.1-flash-lite-preview": 100_000,
72
+ "gemini-3.1-pro-preview": 200_000,
73
73
  }
74
74
  MAX_HISTORY_PAIRS: int = 5
75
75
  RESPONSE_HEADROOM: int = 8_000
@@ -118,7 +118,7 @@ def load_config(project_dir: Path, sourcefire_dir: Path) -> SourcefireConfig:
118
118
  chunk_size=indexer.get("chunk_size", 1000),
119
119
  chunk_overlap=indexer.get("chunk_overlap", 300),
120
120
  provider=llm.get("provider", "gemini"),
121
- model=llm.get("model", "gemini-2.5-flash"),
121
+ model=llm.get("model", "gemini-3.1-flash-lite-preview"),
122
122
  api_key_env=llm.get("api_key_env", "GEMINI_API_KEY"),
123
123
  host=server.get("host", "127.0.0.1"),
124
124
  port=server.get("port", 8000),
@@ -1,4 +1,4 @@
1
- """Global Sourcefire configuration — stored in ~/.sourcefire/
1
+ """Global Sourcefire configuration — stored in ~/.config/sourcefire/
2
2
 
3
3
  This directory holds user-level settings (API keys, preferences) that
4
4
  apply across all projects. Separate from the per-project .sourcefire/
@@ -20,13 +20,13 @@ import tomli_w
20
20
  def get_global_dir() -> Path:
21
21
  """Return the global Sourcefire config directory.
22
22
 
23
- - macOS/Linux: ~/.sourcefire/
23
+ - macOS/Linux: ~/.config/sourcefire/
24
24
  - Windows: %APPDATA%/sourcefire/
25
25
  """
26
26
  if platform.system() == "Windows":
27
27
  base = Path(os.environ.get("APPDATA", Path.home() / "AppData" / "Roaming"))
28
28
  return base / "sourcefire"
29
- return Path.home() / ".sourcefire"
29
+ return Path.home() / ".config" / "sourcefire"
30
30
 
31
31
 
32
32
  def get_global_config_path() -> Path:
@@ -49,7 +49,7 @@ def _generate_patterns_via_llm(file_tree: str, api_key: str) -> dict[str, list[s
49
49
  from langchain_core.messages import HumanMessage
50
50
 
51
51
  llm = ChatGoogleGenerativeAI(
52
- model="gemini-2.5-flash",
52
+ model="gemini-3.1-flash-lite-preview",
53
53
  google_api_key=api_key,
54
54
  )
55
55
 
@@ -16,8 +16,24 @@ from sourcefire.indexer.pipeline import index_files
16
16
  from sourcefire.retriever.graph import ImportGraph
17
17
 
18
18
 
19
+ # Always skip these regardless of config
20
+ _ALWAYS_EXCLUDE = (
21
+ ".sourcefire/",
22
+ ".git/",
23
+ "node_modules/",
24
+ "__pycache__/",
25
+ ".venv/",
26
+ "venv/",
27
+ )
28
+
29
+
19
30
  def _should_watch(rel_path: str, config: SourcefireConfig) -> bool:
20
31
  """Return True if the file matches include patterns and not exclude patterns."""
32
+ # Hard excludes — never watch these
33
+ for prefix in _ALWAYS_EXCLUDE:
34
+ if rel_path.startswith(prefix):
35
+ return False
36
+
21
37
  for pattern in config.exclude:
22
38
  if fnmatch.fnmatch(rel_path, pattern):
23
39
  return False
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sourcefire
3
- Version: 0.3.0
3
+ Version: 0.3.2
4
4
  Summary: Get instant context on any codebase. One command to index, ask questions in plain English, get answers grounded in actual code.
5
5
  Author-email: Athar Wani <athar@cravv.com>
6
6
  License: MIT
File without changes
File without changes
File without changes
File without changes
File without changes