cortex-local 2.5.3__tar.gz → 2.6.0__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.
- {cortex_local-2.5.3 → cortex_local-2.6.0}/.gitignore +1 -0
- {cortex_local-2.5.3 → cortex_local-2.6.0}/PKG-INFO +1 -1
- {cortex_local-2.5.3 → cortex_local-2.6.0}/cortex/core/chunker.py +32 -1
- {cortex_local-2.5.3 → cortex_local-2.6.0}/cortex/indexer.py +3 -3
- {cortex_local-2.5.3 → cortex_local-2.6.0}/README.md +0 -0
- {cortex_local-2.5.3 → cortex_local-2.6.0}/cortex/__init__.py +0 -0
- {cortex_local-2.5.3 → cortex_local-2.6.0}/cortex/cli.py +0 -0
- {cortex_local-2.5.3 → cortex_local-2.6.0}/cortex/config.py +0 -0
- {cortex_local-2.5.3 → cortex_local-2.6.0}/cortex/core/__init__.py +0 -0
- {cortex_local-2.5.3 → cortex_local-2.6.0}/cortex/core/cache.py +0 -0
- {cortex_local-2.5.3 → cortex_local-2.6.0}/cortex/core/code_graph.py +0 -0
- {cortex_local-2.5.3 → cortex_local-2.6.0}/cortex/core/formatters.py +0 -0
- {cortex_local-2.5.3 → cortex_local-2.6.0}/cortex/core/global_graph.py +0 -0
- {cortex_local-2.5.3 → cortex_local-2.6.0}/cortex/core/graph.py +0 -0
- {cortex_local-2.5.3 → cortex_local-2.6.0}/cortex/core/notes_graph.py +0 -0
- {cortex_local-2.5.3 → cortex_local-2.6.0}/cortex/core/roslyn_analyzer.py +0 -0
- {cortex_local-2.5.3 → cortex_local-2.6.0}/cortex/core/roslyn_tool/CortexAnalyzer.csproj +0 -0
- {cortex_local-2.5.3 → cortex_local-2.6.0}/cortex/core/roslyn_tool/Program.cs +0 -0
- {cortex_local-2.5.3 → cortex_local-2.6.0}/cortex/db.py +0 -0
- {cortex_local-2.5.3 → cortex_local-2.6.0}/cortex/embedder.py +0 -0
- {cortex_local-2.5.3 → cortex_local-2.6.0}/cortex/mcp_server.py +0 -0
- {cortex_local-2.5.3 → cortex_local-2.6.0}/cortex/state.py +0 -0
- {cortex_local-2.5.3 → cortex_local-2.6.0}/cortex/watcher.py +0 -0
- {cortex_local-2.5.3 → cortex_local-2.6.0}/hatch_build.py +0 -0
- {cortex_local-2.5.3 → cortex_local-2.6.0}/pyproject.toml +0 -0
- {cortex_local-2.5.3 → cortex_local-2.6.0}/tests/test_imports.py +0 -0
- {cortex_local-2.5.3 → cortex_local-2.6.0}/tests/test_stdio_init.py +0 -0
|
@@ -33,7 +33,7 @@ def _extract_razor_cs_blocks(source: str) -> list:
|
|
|
33
33
|
REPOS_DIR = Path(os.environ.get("REPOS_DIR", "/tmp/repos"))
|
|
34
34
|
|
|
35
35
|
CODE_EXTS = {".js", ".ts", ".tsx", ".jsx", ".svelte", ".py", ".java", ".go", ".rs", ".css", ".html", ".kt", ".kts", ".gd", ".yml", ".yaml", ".cs", ".razor", ".cshtml"}
|
|
36
|
-
SKIP_DIRS = {"node_modules", ".git", "dist", "build", ".next", ".svelte-kit", "__pycache__", ".gradle", "target", "bin", "obj"}
|
|
36
|
+
SKIP_DIRS = {"node_modules", ".git", "dist", "build", ".next", ".svelte-kit", "__pycache__", ".gradle", "target", "bin", "obj", ".godot"}
|
|
37
37
|
LANG_MAP = {
|
|
38
38
|
".js": "javascript", ".ts": "typescript", ".tsx": "typescript",
|
|
39
39
|
".jsx": "javascript", ".svelte": "svelte", ".py": "python",
|
|
@@ -47,6 +47,37 @@ def _is_excluded(rel: str, patterns: list) -> bool:
|
|
|
47
47
|
return any(fnmatch.fnmatch(rel, p) for p in patterns)
|
|
48
48
|
|
|
49
49
|
|
|
50
|
+
def repo_ignore_patterns(root: Path) -> list:
|
|
51
|
+
"""Per-repo exclude globs for _is_excluded():
|
|
52
|
+
|
|
53
|
+
- `.cortexignore` at the repo root, gitignore-like: `addons/gut/` or `/vendor` (anchored),
|
|
54
|
+
`*.min.js`, `# comments`. Unanchored entries match at any depth. No `!` negation.
|
|
55
|
+
- every directory containing a `.gdignore` (Godot's "do not import" marker).
|
|
56
|
+
"""
|
|
57
|
+
pats: list = []
|
|
58
|
+
ci = root / ".cortexignore"
|
|
59
|
+
if ci.is_file():
|
|
60
|
+
for line in ci.read_text(encoding="utf-8", errors="replace").splitlines():
|
|
61
|
+
line = line.strip()
|
|
62
|
+
if not line or line.startswith(("#", "!")):
|
|
63
|
+
continue
|
|
64
|
+
anchored = line.startswith("/")
|
|
65
|
+
line = line.strip("/")
|
|
66
|
+
if not line:
|
|
67
|
+
continue
|
|
68
|
+
base = [line, line + "/*"]
|
|
69
|
+
pats += base if anchored else base + ["*/" + b for b in base]
|
|
70
|
+
for dirpath, dirs, files in os.walk(root):
|
|
71
|
+
dirs[:] = [d for d in dirs if d not in SKIP_DIRS]
|
|
72
|
+
if ".gdignore" in files:
|
|
73
|
+
rel = Path(dirpath).relative_to(root).as_posix()
|
|
74
|
+
if rel == ".":
|
|
75
|
+
return ["*"]
|
|
76
|
+
pats.append(rel + "/*")
|
|
77
|
+
dirs[:] = []
|
|
78
|
+
return pats
|
|
79
|
+
|
|
80
|
+
|
|
50
81
|
CHUNK_LINES = 30
|
|
51
82
|
OVERLAP_LINES = 5
|
|
52
83
|
MAX_CHUNK_LINES = 80
|
|
@@ -18,7 +18,7 @@ from qdrant_client.models import (
|
|
|
18
18
|
from . import db
|
|
19
19
|
from .config import data_dir, cache_file, VECTOR_SIZE, get_config, read_index_meta, write_index_meta
|
|
20
20
|
from .embedder import embed, sparse_embed
|
|
21
|
-
from .core.chunker import chunk_file, CODE_EXTS, SKIP_DIRS, _is_excluded
|
|
21
|
+
from .core.chunker import chunk_file, CODE_EXTS, SKIP_DIRS, _is_excluded, repo_ignore_patterns
|
|
22
22
|
from .core.cache import load_cache, save_cache
|
|
23
23
|
from .core import graph as _graph
|
|
24
24
|
from .core import roslyn_analyzer as _roslyn
|
|
@@ -171,7 +171,7 @@ def index_notes(notes_dir: Path, show_progress: bool = False) -> int:
|
|
|
171
171
|
Changed files have their old points deleted first; files gone from disk (or newly
|
|
172
172
|
excluded) are removed from the index.
|
|
173
173
|
"""
|
|
174
|
-
exclude_patterns = get_config()["index"]["exclude_patterns"]
|
|
174
|
+
exclude_patterns = get_config()["index"]["exclude_patterns"] + repo_ignore_patterns(notes_dir)
|
|
175
175
|
root = notes_dir.resolve().as_posix()
|
|
176
176
|
prefix = root + "/"
|
|
177
177
|
|
|
@@ -235,7 +235,7 @@ def index_code(code_dir: Path, show_progress: bool = False) -> int:
|
|
|
235
235
|
|
|
236
236
|
Same incremental contract as index_notes: changed files are replaced, deleted files removed.
|
|
237
237
|
"""
|
|
238
|
-
exclude_patterns = get_config()["index"]["exclude_patterns"]
|
|
238
|
+
exclude_patterns = get_config()["index"]["exclude_patterns"] + repo_ignore_patterns(code_dir)
|
|
239
239
|
repo_name = code_dir.name
|
|
240
240
|
root = code_dir.resolve().as_posix()
|
|
241
241
|
prefix = root + "/"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|