File size: 5,432 Bytes
d79890b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
# Configuration constants

# API endpoints
GITHUB_API_BASE = "https://api.github.com"
HF_API_BASE = "https://huggingface.co"

# Supported file extensions for text processing
SUPPORTED_EXTENSIONS = {
    # Programming languages
    '.py', '.js', '.ts', '.jsx', '.tsx', '.java', '.cpp', '.c', '.cs', '.go', '.rs',
    '.php', '.rb', '.swift', '.kt', '.scala', '.r', '.m', '.sh', '.bash', '.zsh',
    '.fish', '.ps1', '.bat', '.sql', '.html', '.htm', '.xml', '.css', '.scss',
    '.sass', '.less', '.json', '.yaml', '.yml', '.toml', '.ini', '.cfg', '.conf',
    '.md', '.rst', '.txt', '.log', '.dockerfile', '.gitignore', '.gitattributes',
    '.editorconfig', '.eslintrc', '.prettierrc', '.babelrc', '.tsconfig',
    
    # Configuration files
    '.env', '.env.example', '.env.local', '.env.development', '.env.production',
    'package.json', 'package-lock.json', 'yarn.lock', 'pnpm-lock.yaml',
    'requirements.txt', 'Pipfile', 'poetry.lock', 'pyproject.toml',
    'Cargo.toml', 'Cargo.lock', 'go.mod', 'go.sum', 'composer.json',
    'composer.lock', 'Gemfile', 'Gemfile.lock', 'pom.xml', 'build.gradle',
    'CMakeLists.txt', 'Makefile', 'Dockerfile', 'docker-compose.yml',
    
    # Documentation
    '.md', '.rst', '.txt', '.adoc', '.tex', '.bib',
    
    # Data formats
    '.json', '.yaml', '.yml', '.toml', '.ini', '.cfg', '.conf',
    '.csv', '.tsv', '.xml', '.rss', '.atom',
    
    # Scripts
    '.sh', '.bash', '.zsh', '.fish', '.ps1', '.bat', '.cmd',
    '.py', '.pl', '.rb', '.lua', '.tcl', '.awk', '.sed',
}

# Size limits
MAX_FILE_SIZE = 10 * 1024 * 1024  # 10MB default
MAX_TOTAL_SIZE = 100 * 1024 * 1024  # 100MB default
CHUNK_SIZE = 50000  # Characters per chunk

# File patterns to exclude by default
DEFAULT_EXCLUDE_PATTERNS = [
    "*.git*",
    "*.log",
    "node_modules/**",
    "__pycache__/**",
    ".DS_Store",
    "Thumbs.db",
    "*.tmp",
    "*.temp",
    "*.swp",
    "*.swo",
    "*~",
    ".vscode/**",
    ".idea/**",
    "*.pyc",
    "*.pyo",
    "*.pyd",
    ".Python",
    "build/**",
    "dist/**",
    "*.egg-info/**",
    ".pytest_cache/**",
    ".coverage",
    "htmlcov/**",
    ".tox/**",
    "*.cover",
    "coverage.xml",
    "*.cover",
    ".hypothesis/**",
    ".mypy_cache/**",
    "dmypy.json",
    dmypy.json",
    ".pytest_cache/**",
    "nosetests.xml",
    "coverage.xml",
    "*.cover",
    ".hypothesis/**",
    ".cache/**",
    "*.pid",
    "*.seed",
    "*.pid.lock",
    ".nyc_output",
    ".grunt",
    ".bower",
    ".lock-wscript",
    "build/Release",
    "jspm_packages/",
    "typings",
    ".npm",
    ".eslintcache",
    ".stylelintcache",
    "*.tsbuildinfo",
    ".rsync_user",
    ".vscode-test",
]

# File patterns to include by default
DEFAULT_INCLUDE_PATTERNS = [
    "*.py",
    "*.js",
    "*.ts",
    "*.jsx",
    "*.tsx",
    "*.java",
    "*.cpp",
    "*.c",
    "*.cs",
    "*.go",
    "*.rs",
    "*.php",
    "*.rb",
    "*.swift",
    "*.kt",
    "*.scala",
    "*.r",
    "*.m",
    "*.sh",
    "*.bash",
    "*.zsh",
    "*.fish",
    "*.ps1",
    "*.bat",
    "*.sql",
    "*.html",
    "*.htm",
    "*.xml",
    "*.css",
    "*.scss",
    "*.sass",
    "*.less",
    "*.json",
    "*.yaml",
    "*.yml",
    "*.toml",
    "*.ini",
    "*.cfg",
    "*.conf",
    "*.md",
    "*.rst",
    "*.txt",
    "*.dockerfile",
    "*.gitignore",
    "*.gitattributes",
    "*.editorconfig",
    "*.eslintrc",
    "*.prettierrc",
    "*.babelrc",
    "*.tsconfig",
    "package.json",
    "requirements.txt",
    "Pipfile",
    "poetry.lock",
    "pyproject.toml",
    "Cargo.toml",
    "go.mod",
    "composer.json",
    "Gemfile",
    "pom.xml",
    "build.gradle",
    "CMakeLists.txt",
    "Makefile",
    "Dockerfile",
    "docker-compose.yml",
]

# Language comment patterns for cleaning
COMMENT_PATTERNS = {
    'python': [r'#.*$', r'""".*?"""', r"'''.*?'''"],
    'javascript': [r'//.*$', r'/\*.*?\*/'],
    'java': [r'//.*$', r'/\*.*?\*/'],
    'cpp': [r'//.*$', r'/\*.*?\*/'],
    'c': [r'//.*$', r'/\*.*?\*/'],
    'cs': [r'//.*$', r'/\*.*?\*/'],
    'go': [r'//.*$', r'/\*.*?\*/'],
    'rs': [r'//.*$', r'/\*.*?\*/'],
    'php': [r'//.*$', r'#.*$', r'/\*.*?\*/'],
    'ruby': [r'#.*$', r'=begin.*?=end'],
    'shell': [r'#.*$'],
    'sql': [r'--.*$', r'/\*.*?\*/'],
    'html': [r'<!--.*?-->'],
    'xml': [r'<!--.*?-->'],
    'css': [r'/\*.*?\*/'],
}

# Token estimation multipliers for different languages
TOKEN_MULTIPLIERS = {
    'python': 0.25,
    'javascript': 0.3,
    'java': 0.25,
    'cpp': 0.25,
    'c': 0.25,
    'cs': 0.25,
    'go': 0.25,
    'rs': 0.25,
    'php': 0.3,
    'ruby': 0.25,
    'shell': 0.3,
    'sql': 0.25,
    'html': 0.2,
    'xml': 0.2,
    'css': 0.25,
    'json': 0.15,
    'yaml': 0.2,
    'markdown': 0.2,
    'text': 0.25,
    'default': 0.25,
}

# Rate limiting
MAX_REQUESTS_PER_MINUTE = 60
REQUEST_TIMEOUT = 30

# UI Configuration
THEME_COLORS = {
    'primary': '#3070f0',
    'secondary': '#64748b',
    'success': '#10b981',
    'warning': '#f59e0b',
    'error': '#ef4444',
    'background': '#ffffff',
    'surface': '#f8fafc',
    'text': '#1e293b',
    'text_secondary': '#64748b',
}

# Progress tracking
PROGRESS_STEPS = [
    (0.0, "Initializing..."),
    (0.1, "Fetching repository information..."),
    (0.2, "Scanning files..."),
    (0.3, "Processing files..."),
    (0.5, "Analyzing content..."),
    (0.7, "Generating output..."),
    (0.9, "Finalizing..."),
    (1.0, "Complete!"),
]