Pular para conteúdo

Configuração

Project root detection and configuration management.

SemtreeConfig dataclass

SemtreeConfig(include_extensions=(lambda: ['.py', '.js', '.ts', '.tsx', '.jsx', '.go', '.rs', '.java', '.c', '.cpp', '.h', '.hpp', '.rb', '.php', '.swift', '.kt', '.cs', '.md', '.txt', '.yaml', '.yml', '.toml', '.json'])(), exclude_dirs=(lambda: ['.git', '.hg', '.svn', 'node_modules', '__pycache__', '.venv', 'venv', 'env', '.env', 'dist', 'build', 'target', '.ctx', '.idea', '.vscode', '*.egg-info', 'coverage', '.coverage', 'htmlcov'])(), max_file_size_kb=512, use_gitignore=True, default_token_budget=8000, git_context=True, mcp_host='127.0.0.1', mcp_port=5137)

Project-level configuration for semtree.

load classmethod

load(root)

Load config from .ctx/semtree.json, merging with defaults.

save

save(root)

Write config to .ctx/semtree.json.

is_included

is_included(path)

Return True if the file at path should be indexed.

find_project_root

find_project_root(start=None)

Walk up from start (default: cwd) until a root marker is found.

Falls back to cwd if no marker is found within 10 levels.

ctx_dir

ctx_dir(root)

Return the .ctx directory path for a project root.

db_path

db_path(root)

Return the SQLite database path.

config_path

config_path(root)

Return the semtree config file path.

lock_path

lock_path(root)

Return the indexing lock file path.