File size: 2,644 Bytes
cd3b358
 
 
 
 
 
 
38c50f9
cd3b358
 
9915ced
 
 
cd3b358
 
9915ced
35c8868
 
cd3b358
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
"""
FixFlow Configuration
All API keys, model config, and constants loaded from environment variables.
"""
import os
from dotenv import load_dotenv

load_dotenv(override=True)

# ── LLM Config ──────────────────────────────────────────────────────────────
GLM_API_KEY: str = os.getenv("GLM_API_KEY", "").strip()
GLM_BASE_URL: str = os.getenv("GLM_BASE_URL", "https://open.bigmodel.cn/api/paas/v4").strip()
GLM_MODEL: str = os.getenv("GLM_MODEL", "glm-4-air").strip()

# ── GitHub Config ────────────────────────────────────────────────────────────
GITHUB_TOKEN: str = os.getenv("GITHUB_TOKEN", "").strip()
if GITHUB_TOKEN == "your_github_token_here":
    GITHUB_TOKEN = ""

# ── Agent Limits ─────────────────────────────────────────────────────────────
MAX_FILES_TO_SCAN: int = int(os.getenv("MAX_FILES_TO_SCAN", "100"))
MAX_FILE_SIZE_BYTES: int = int(os.getenv("MAX_FILE_SIZE_BYTES", "51200"))  # 50 KB
MAX_FILES_TO_ANALYZE: int = 10      # Top N files sent to deep analysis
MAX_REPO_FILES: int = 500           # Hard cap on tree traversal

# ── File Filters (skip these in code analysis) ───────────────────────────────
IGNORE_EXTENSIONS = {
    ".png", ".jpg", ".jpeg", ".gif", ".svg", ".ico", ".webp",
    ".mp4", ".mp3", ".wav", ".pdf", ".zip", ".tar", ".gz",
    ".woff", ".woff2", ".ttf", ".eot",
    ".lock", ".sum", ".mod",
    ".pyc", ".pyo", ".pyd",
    ".class", ".jar",
    ".DS_Store",
}

IGNORE_DIRS = {
    "node_modules", ".git", ".github", "__pycache__", ".venv", "venv",
    "env", "dist", "build", ".next", ".nuxt", "coverage", ".pytest_cache",
    "vendor", "third_party", "external", "site-packages",
}

CODE_EXTENSIONS = {
    ".py", ".js", ".ts", ".jsx", ".tsx", ".java", ".go", ".rb", ".rs",
    ".cpp", ".c", ".h", ".hpp", ".cs", ".php", ".swift", ".kt", ".scala",
    ".sh", ".bash", ".yaml", ".yml", ".toml", ".cfg", ".ini", ".env",
    ".json", ".xml", ".html", ".css", ".scss", ".sql", ".md",
}

# ── Timing & Logging ─────────────────────────────────────────────────────────
LOG_LLM_CALLS: bool = os.getenv("LOG_LLM_CALLS", "true").lower() == "true"