@embedder/embedder 1.1.1 → 2.0.6

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 (80) hide show
  1. package/assets/_commonjsHelpers-C1uRMj_j.js +1 -0
  2. package/assets/cli-Ccqv_iE9.js +865 -0
  3. package/assets/devtools-B4JKPJyU.js +1 -0
  4. package/assets/index-B3hJUcJE.js +1 -0
  5. package/assets/index-BSFXqd02.js +1 -0
  6. package/assets/index-DjlgDVzW.js +1 -0
  7. package/cli.js +2 -0
  8. package/package.json +15 -96
  9. package/LICENSE +0 -36
  10. package/bundle/embedder.js +0 -618
  11. package/bundle/gdb-debugger-python/gdb_bridge.py +0 -392
  12. package/bundle/gdb-debugger-python/requirements.txt +0 -1
  13. package/bundle/postinstall-for-users.js +0 -515
  14. package/bundle/repomap-bridge.js +0 -6
  15. package/bundle/repomap-python/importance.py +0 -58
  16. package/bundle/repomap-python/queries/tree-sitter-language-pack/README.md +0 -9
  17. package/bundle/repomap-python/queries/tree-sitter-language-pack/arduino-tags.scm +0 -5
  18. package/bundle/repomap-python/queries/tree-sitter-language-pack/c-tags.scm +0 -9
  19. package/bundle/repomap-python/queries/tree-sitter-language-pack/chatito-tags.scm +0 -16
  20. package/bundle/repomap-python/queries/tree-sitter-language-pack/commonlisp-tags.scm +0 -122
  21. package/bundle/repomap-python/queries/tree-sitter-language-pack/cpp-tags.scm +0 -15
  22. package/bundle/repomap-python/queries/tree-sitter-language-pack/csharp-tags.scm +0 -26
  23. package/bundle/repomap-python/queries/tree-sitter-language-pack/d-tags.scm +0 -26
  24. package/bundle/repomap-python/queries/tree-sitter-language-pack/dart-tags.scm +0 -92
  25. package/bundle/repomap-python/queries/tree-sitter-language-pack/elisp-tags.scm +0 -5
  26. package/bundle/repomap-python/queries/tree-sitter-language-pack/elixir-tags.scm +0 -54
  27. package/bundle/repomap-python/queries/tree-sitter-language-pack/elm-tags.scm +0 -19
  28. package/bundle/repomap-python/queries/tree-sitter-language-pack/gleam-tags.scm +0 -41
  29. package/bundle/repomap-python/queries/tree-sitter-language-pack/go-tags.scm +0 -42
  30. package/bundle/repomap-python/queries/tree-sitter-language-pack/java-tags.scm +0 -20
  31. package/bundle/repomap-python/queries/tree-sitter-language-pack/javascript-tags.scm +0 -88
  32. package/bundle/repomap-python/queries/tree-sitter-language-pack/lua-tags.scm +0 -34
  33. package/bundle/repomap-python/queries/tree-sitter-language-pack/ocaml-tags.scm +0 -115
  34. package/bundle/repomap-python/queries/tree-sitter-language-pack/ocaml_interface-tags.scm +0 -98
  35. package/bundle/repomap-python/queries/tree-sitter-language-pack/pony-tags.scm +0 -39
  36. package/bundle/repomap-python/queries/tree-sitter-language-pack/properties-tags.scm +0 -5
  37. package/bundle/repomap-python/queries/tree-sitter-language-pack/python-tags.scm +0 -14
  38. package/bundle/repomap-python/queries/tree-sitter-language-pack/r-tags.scm +0 -21
  39. package/bundle/repomap-python/queries/tree-sitter-language-pack/racket-tags.scm +0 -12
  40. package/bundle/repomap-python/queries/tree-sitter-language-pack/ruby-tags.scm +0 -64
  41. package/bundle/repomap-python/queries/tree-sitter-language-pack/rust-tags.scm +0 -60
  42. package/bundle/repomap-python/queries/tree-sitter-language-pack/solidity-tags.scm +0 -43
  43. package/bundle/repomap-python/queries/tree-sitter-language-pack/swift-tags.scm +0 -51
  44. package/bundle/repomap-python/queries/tree-sitter-language-pack/udev-tags.scm +0 -20
  45. package/bundle/repomap-python/queries/tree-sitter-languages/README.md +0 -24
  46. package/bundle/repomap-python/queries/tree-sitter-languages/c-tags.scm +0 -9
  47. package/bundle/repomap-python/queries/tree-sitter-languages/c_sharp-tags.scm +0 -46
  48. package/bundle/repomap-python/queries/tree-sitter-languages/cpp-tags.scm +0 -15
  49. package/bundle/repomap-python/queries/tree-sitter-languages/dart-tags.scm +0 -91
  50. package/bundle/repomap-python/queries/tree-sitter-languages/elisp-tags.scm +0 -8
  51. package/bundle/repomap-python/queries/tree-sitter-languages/elixir-tags.scm +0 -54
  52. package/bundle/repomap-python/queries/tree-sitter-languages/elm-tags.scm +0 -19
  53. package/bundle/repomap-python/queries/tree-sitter-languages/go-tags.scm +0 -30
  54. package/bundle/repomap-python/queries/tree-sitter-languages/hcl-tags.scm +0 -77
  55. package/bundle/repomap-python/queries/tree-sitter-languages/java-tags.scm +0 -20
  56. package/bundle/repomap-python/queries/tree-sitter-languages/javascript-tags.scm +0 -88
  57. package/bundle/repomap-python/queries/tree-sitter-languages/kotlin-tags.scm +0 -27
  58. package/bundle/repomap-python/queries/tree-sitter-languages/ocaml-tags.scm +0 -115
  59. package/bundle/repomap-python/queries/tree-sitter-languages/ocaml_interface-tags.scm +0 -98
  60. package/bundle/repomap-python/queries/tree-sitter-languages/php-tags.scm +0 -26
  61. package/bundle/repomap-python/queries/tree-sitter-languages/python-tags.scm +0 -12
  62. package/bundle/repomap-python/queries/tree-sitter-languages/ql-tags.scm +0 -26
  63. package/bundle/repomap-python/queries/tree-sitter-languages/ruby-tags.scm +0 -64
  64. package/bundle/repomap-python/queries/tree-sitter-languages/rust-tags.scm +0 -60
  65. package/bundle/repomap-python/queries/tree-sitter-languages/scala-tags.scm +0 -65
  66. package/bundle/repomap-python/queries/tree-sitter-languages/typescript-tags.scm +0 -41
  67. package/bundle/repomap-python/repomap.py +0 -229
  68. package/bundle/repomap-python/repomap_bridge.py +0 -234
  69. package/bundle/repomap-python/repomap_class.py +0 -637
  70. package/bundle/repomap-python/repomap_server.py +0 -561
  71. package/bundle/repomap-python/requirements.txt +0 -7
  72. package/bundle/repomap-python/scm.py +0 -59
  73. package/bundle/repomap-python/utils.py +0 -58
  74. package/bundle/sandbox-macos-permissive-closed.sb +0 -26
  75. package/bundle/sandbox-macos-permissive-open.sb +0 -19
  76. package/bundle/sandbox-macos-permissive-proxied.sb +0 -31
  77. package/bundle/sandbox-macos-restrictive-closed.sb +0 -87
  78. package/bundle/sandbox-macos-restrictive-open.sb +0 -90
  79. package/bundle/sandbox-macos-restrictive-proxied.sb +0 -92
  80. package/postinstall.js +0 -42
@@ -1,515 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * Post-installation script for end users
4
- * Installs Python dependencies for RepoMapper when embedder-cli is installed from .tgz
5
- */
6
-
7
- import { spawn, spawnSync } from 'child_process';
8
- import { resolve, dirname, join } from 'path';
9
- import { fileURLToPath } from 'url';
10
- import { existsSync, readFileSync } from 'fs';
11
- import { platform } from 'os';
12
-
13
- const __filename = fileURLToPath(import.meta.url);
14
- const __dirname = dirname(__filename);
15
-
16
- // Cross-platform Python executable detection
17
- function getPythonExecutables() {
18
- const isWindows = platform() === 'win32';
19
-
20
- if (isWindows) {
21
- return ['py', 'python', 'python3'];
22
- } else {
23
- return ['python3', 'python'];
24
- }
25
- }
26
-
27
- // Check if Python executable exists and get version
28
- function checkPythonExecutable(executable) {
29
- return new Promise((resolve) => {
30
- const child = spawn(executable, ['--version'], {
31
- stdio: 'pipe',
32
- shell: platform() === 'win32'
33
- });
34
-
35
- let output = '';
36
- child.stdout.on('data', (data) => output += data.toString());
37
- child.stderr.on('data', (data) => output += data.toString());
38
-
39
- child.on('close', (code) => {
40
- if (code === 0 && output.includes('Python')) {
41
- const versionMatch = output.match(/Python (\d+)\.(\d+)/);
42
- if (versionMatch) {
43
- const major = parseInt(versionMatch[1]);
44
- const minor = parseInt(versionMatch[2]);
45
-
46
- // Require Python 3.8+
47
- if (major >= 3 && (major > 3 || minor >= 8)) {
48
- resolve({ executable, version: `${major}.${minor}`, valid: true });
49
- return;
50
- }
51
- }
52
- }
53
- resolve({ executable, valid: false });
54
- });
55
-
56
- child.on('error', () => {
57
- resolve({ executable, valid: false });
58
- });
59
- });
60
- }
61
-
62
- // Find the best Python executable
63
- async function findPythonExecutable() {
64
- const executables = getPythonExecutables();
65
-
66
- for (const executable of executables) {
67
- const result = await checkPythonExecutable(executable);
68
- if (result.valid) {
69
- console.log(`✅ Found Python ${result.version} at: ${executable}`);
70
- return executable;
71
- }
72
- }
73
-
74
- return null;
75
- }
76
-
77
- // Check if pip is available
78
- function checkPip(pythonExecutable) {
79
- return new Promise((resolve) => {
80
- const child = spawn(pythonExecutable, ['-m', 'pip', '--version'], {
81
- stdio: 'pipe',
82
- shell: platform() === 'win32'
83
- });
84
-
85
- child.on('close', (code) => {
86
- resolve(code === 0);
87
- });
88
-
89
- child.on('error', () => {
90
- resolve(false);
91
- });
92
- });
93
- }
94
-
95
- // Install Python dependencies
96
- function installDependencies(pythonExecutable, requirementsPath) {
97
- return new Promise((resolve, reject) => {
98
- const isWindows = platform() === 'win32';
99
-
100
- // Use --user flag on Unix systems to avoid permission issues with global installation
101
- const pipArgs = ['-m', 'pip', 'install'];
102
- if (!isWindows) {
103
- pipArgs.push('--user');
104
- }
105
- pipArgs.push('-r', requirementsPath);
106
-
107
- console.log('📦 Installing RepoMapper Python dependencies...');
108
- console.log(`Using: ${pythonExecutable} ${pipArgs.join(' ')}`);
109
-
110
- const child = spawn(pythonExecutable, pipArgs, {
111
- stdio: 'inherit',
112
- shell: isWindows,
113
- cwd: dirname(requirementsPath)
114
- });
115
-
116
- child.on('close', (code) => {
117
- if (code === 0) {
118
- console.log('✅ RepoMapper Python dependencies installed successfully');
119
- resolve();
120
- } else {
121
- reject(new Error(`pip install failed with exit code ${code}`));
122
- }
123
- });
124
-
125
- child.on('error', (error) => {
126
- reject(new Error(`Failed to run pip install: ${error.message}`));
127
- });
128
- });
129
- }
130
-
131
- // Validate installation
132
- function validateInstallation(pythonExecutable) {
133
- return new Promise((resolve, reject) => {
134
- const checkScript = `
135
- import sys
136
-
137
- missing = []
138
- required_modules = ['tiktoken', 'networkx', 'diskcache', 'grep_ast', 'tree_sitter', 'pygments', 'fastmcp']
139
-
140
- for module in required_modules:
141
- try:
142
- __import__(module)
143
- print(f' ✅ {module}')
144
- except ImportError:
145
- missing.append(module)
146
- print(f' ❌ {module}')
147
-
148
- if missing:
149
- print(f'\\nMissing modules: {missing}')
150
- sys.exit(1)
151
- else:
152
- print('\\n✅ All RepoMapper Python dependencies are available')
153
- `;
154
-
155
- console.log('🧪 Validating RepoMapper dependencies...');
156
-
157
- const child = spawn(pythonExecutable, ['-c', checkScript], {
158
- stdio: 'inherit',
159
- shell: platform() === 'win32'
160
- });
161
-
162
- child.on('close', (code) => {
163
- if (code === 0) {
164
- resolve();
165
- } else {
166
- reject(new Error('Some RepoMapper dependencies are missing'));
167
- }
168
- });
169
-
170
- child.on('error', (error) => {
171
- reject(new Error(`Failed to validate dependencies: ${error.message}`));
172
- });
173
- });
174
- }
175
-
176
- async function main() {
177
- // Skip if environment variable is set
178
- if (process.env.SKIP_PYTHON_DEPS === 'true') {
179
- console.log('⏭️ Skipping Python dependency installation (SKIP_PYTHON_DEPS=true)');
180
- return;
181
- }
182
-
183
- console.log('🔧 Setting up Python dependencies for embedder-cli...');
184
- console.log('');
185
-
186
- try {
187
- await setupRepoMapperDependencies();
188
- await setupGdbDebuggerDependencies();
189
- } catch (error) {
190
- console.error('❌ Failed to setup Python dependencies:', error.message);
191
-
192
- // Don't fail the npm install process by default, just warn
193
- if (process.env.FAIL_ON_PYTHON_ERROR !== 'true') {
194
- console.error('');
195
- console.error('⚠️ Continuing with installation (some features may not work)');
196
- } else {
197
- process.exit(1);
198
- }
199
- }
200
- }
201
-
202
- async function setupRepoMapperDependencies() {
203
- try {
204
- console.log('📦 Setting up RepoMapper Python dependencies...');
205
-
206
- // Check for both bundled and source installations
207
- const bundleDir = resolve(__dirname, '../bundle');
208
- const repomapPythonDir = join(bundleDir, 'repomap-python');
209
- const bundledRequirementsPath = join(repomapPythonDir, 'requirements.txt');
210
- const sourceRepomapDir = resolve(__dirname, '../packages/RepoMapper');
211
- const sourceRequirementsPath = join(sourceRepomapDir, 'python/requirements.txt');
212
-
213
- // Determine which installation type we have
214
- if (existsSync(sourceRequirementsPath)) {
215
- console.log('📦 Found source RepoMapper, using unified installer with virtual environment...');
216
-
217
- // Use the unified installer for source installations (supports virtual environments)
218
- try {
219
- const result = spawnSync('node', [
220
- join(sourceRepomapDir, 'scripts/install-python-deps-unified.js')
221
- ], {
222
- stdio: 'inherit',
223
- cwd: sourceRepomapDir
224
- });
225
-
226
- if (result.status === 0) {
227
- console.log('✅ RepoMapper Python dependencies setup complete via unified installer!');
228
- return;
229
- } else {
230
- throw new Error(`Unified installer exited with code ${result.status}`);
231
- }
232
- } catch (error) {
233
- console.error('❌ Failed to run unified installer:', error.message);
234
- console.error(' Falling back to manual installation instructions...');
235
- console.error(' Run: cd packages/RepoMapper && npm run install-python-deps');
236
- return;
237
- }
238
- } else if (existsSync(bundledRequirementsPath)) {
239
- console.log('📦 Found bundled RepoMapper, creating virtual environment...');
240
-
241
- // For bundled installations, we also need virtual environments!
242
- // Create a virtual environment in the bundle directory
243
- const bundleVenvPath = join(bundleDir, 'repomap-venv');
244
- const isWindows = platform() === 'win32';
245
- const venvPython = isWindows
246
- ? join(bundleVenvPath, 'Scripts', 'python.exe')
247
- : join(bundleVenvPath, 'bin', 'python');
248
-
249
- try {
250
- // Create virtual environment if it doesn't exist
251
- if (!existsSync(venvPython)) {
252
- console.log('🏗️ Creating virtual environment for bundled installation...');
253
-
254
- // Find system Python
255
- const pythonExecutable = await findPythonExecutable();
256
- if (!pythonExecutable) {
257
- throw new Error('No suitable Python installation found');
258
- }
259
-
260
- // Create virtual environment
261
- const createVenvResult = spawnSync(pythonExecutable, ['-m', 'venv', bundleVenvPath], {
262
- stdio: 'inherit'
263
- });
264
-
265
- if (createVenvResult.status !== 0) {
266
- throw new Error(`Failed to create virtual environment (exit code ${createVenvResult.status})`);
267
- }
268
-
269
- console.log('✅ Virtual environment created successfully');
270
- }
271
-
272
- // Install dependencies in virtual environment
273
- console.log('📦 Installing dependencies in virtual environment...');
274
- const installResult = spawnSync(venvPython, ['-m', 'pip', 'install', '-r', bundledRequirementsPath], {
275
- stdio: 'inherit',
276
- cwd: repomapPythonDir
277
- });
278
-
279
- if (installResult.status !== 0) {
280
- throw new Error(`pip install failed with exit code ${installResult.status}`);
281
- }
282
-
283
- console.log('✅ RepoMapper Python dependencies installed successfully');
284
-
285
- // Validate installation
286
- await validateInstallation(venvPython);
287
-
288
- console.log('🎉 RepoMapper Python dependencies setup complete!');
289
- return;
290
-
291
- } catch (error) {
292
- console.error('❌ Failed to setup bundled RepoMapper with virtual environment:', error.message);
293
- console.error(' Falling back to global installation...');
294
- // Fall through to the original bundled logic below
295
- }
296
- } else {
297
- console.log('ℹ️ No RepoMapper installation found, skipping Python setup');
298
- console.log(' (This is normal for CLI-only installations)');
299
- return;
300
- }
301
-
302
- console.log('🔍 Setting up RepoMapper Python dependencies...');
303
-
304
- // Find Python executable
305
- const pythonExecutable = await findPythonExecutable();
306
- if (!pythonExecutable) {
307
- console.error('❌ No suitable Python installation found');
308
- console.error(' Please install Python 3.8+ and ensure it\'s in your PATH');
309
- console.error(' Windows: Install from https://python.org or Microsoft Store');
310
- console.error(' macOS: Install via homebrew or python.org');
311
- console.error(' Linux: Install via package manager (apt, yum, etc.)');
312
- console.error('');
313
- console.error(' To skip this check, set SKIP_PYTHON_DEPS=true');
314
-
315
- // Don't fail the installation, just warn
316
- if (process.env.FAIL_ON_PYTHON_ERROR !== 'true') {
317
- console.error('');
318
- console.error('⚠️ Continuing with installation (RepoMapper features may not work)');
319
- return;
320
- } else {
321
- process.exit(1);
322
- }
323
- }
324
-
325
- // Check pip
326
- console.log('🔍 Checking pip availability...');
327
- const pipAvailable = await checkPip(pythonExecutable);
328
- if (!pipAvailable) {
329
- console.error('❌ pip is not available');
330
- console.error(' Please install pip for your Python installation');
331
- console.error(' Usually: python -m ensurepip --upgrade');
332
-
333
- if (process.env.FAIL_ON_PYTHON_ERROR !== 'true') {
334
- console.error('');
335
- console.error('⚠️ Continuing with installation (RepoMapper features may not work)');
336
- return;
337
- } else {
338
- process.exit(1);
339
- }
340
- }
341
-
342
- console.log('✅ pip is available');
343
-
344
- // Install dependencies
345
- await installDependencies(pythonExecutable, requirementsPath);
346
-
347
- // Validate installation
348
- await validateInstallation(pythonExecutable);
349
-
350
- console.log('');
351
- console.log('🎉 RepoMapper Python dependencies setup complete!');
352
-
353
- } catch (error) {
354
- console.error('❌ Failed to install RepoMapper Python dependencies:', error.message);
355
- console.error('');
356
- console.error('You can:');
357
- console.error('1. Install dependencies manually: pip install -r bundle/repomap-python/requirements.txt');
358
- console.error('2. Skip this check by setting SKIP_PYTHON_DEPS=true');
359
- console.error('3. Use embedder-cli without RepoMapper features');
360
-
361
- // Don't fail the npm install process by default, just warn
362
- if (process.env.FAIL_ON_PYTHON_ERROR !== 'true') {
363
- console.error('');
364
- console.error('⚠️ Continuing with installation (RepoMapper features may not work)');
365
- } else {
366
- throw error;
367
- }
368
- }
369
- }
370
-
371
- async function setupGdbDebuggerDependencies() {
372
- try {
373
- console.log('🔧 Setting up GDB Debugger Python dependencies...');
374
-
375
- // Look for GDB Debugger Python requirements in the bundle
376
- const bundleDir = resolve(__dirname, '../bundle');
377
- const gdbDebuggerPythonDir = join(bundleDir, 'gdb-debugger-python');
378
- const requirementsPath = join(gdbDebuggerPythonDir, 'requirements.txt');
379
-
380
- if (!existsSync(requirementsPath)) {
381
- console.log('ℹ️ GDB Debugger Python files not found, skipping Python setup');
382
- console.log(' (This is normal if you\'re installing from source)');
383
- return;
384
- }
385
-
386
- console.log('🔍 Setting up GDB Debugger Python dependencies...');
387
-
388
- // Find Python executable
389
- const pythonExecutable = await findPythonExecutable();
390
- if (!pythonExecutable) {
391
- console.error('❌ No suitable Python installation found for GDB Debugger');
392
- console.error(' Please install Python 3.8+ and ensure it\'s in your PATH');
393
-
394
- if (process.env.FAIL_ON_PYTHON_ERROR !== 'true') {
395
- console.error('');
396
- console.error('⚠️ Continuing with installation (GDB Debugger features may not work)');
397
- return;
398
- } else {
399
- process.exit(1);
400
- }
401
- }
402
-
403
- // Check pip
404
- const pipAvailable = await checkPip(pythonExecutable);
405
- if (!pipAvailable) {
406
- console.error('❌ pip is not available for GDB Debugger');
407
-
408
- if (process.env.FAIL_ON_PYTHON_ERROR !== 'true') {
409
- console.error('');
410
- console.error('⚠️ Continuing with installation (GDB Debugger features may not work)');
411
- return;
412
- } else {
413
- process.exit(1);
414
- }
415
- }
416
-
417
- // Install dependencies directly (GDB Debugger doesn't need virtual env in global install)
418
- await installGdbDebuggerDependencies(pythonExecutable, requirementsPath);
419
-
420
- // Validate installation
421
- await validateGdbDebuggerInstallation(pythonExecutable);
422
-
423
- console.log('');
424
- console.log('🎯 GDB Debugger Python dependencies setup complete!');
425
-
426
- } catch (error) {
427
- console.error('❌ Failed to install GDB Debugger Python dependencies:', error.message);
428
- console.error('');
429
- console.error('You can:');
430
- console.error('1. Install dependencies manually: pip install -r bundle/gdb-debugger-python/requirements.txt');
431
- console.error('2. Skip this check by setting SKIP_PYTHON_DEPS=true');
432
- console.error('3. Use embedder-cli without GDB Debugger features');
433
-
434
- // Don't fail the npm install process by default, just warn
435
- if (process.env.FAIL_ON_PYTHON_ERROR !== 'true') {
436
- console.error('');
437
- console.error('⚠️ Continuing with installation (GDB Debugger features may not work)');
438
- } else {
439
- throw error;
440
- }
441
- }
442
- }
443
-
444
- // Install GDB Debugger Python dependencies
445
- function installGdbDebuggerDependencies(pythonExecutable, requirementsPath) {
446
- return new Promise((resolve, reject) => {
447
- const isWindows = platform() === 'win32';
448
-
449
- // Use --user flag on Unix systems to avoid permission issues with global installation
450
- const pipArgs = ['-m', 'pip', 'install'];
451
- if (!isWindows) {
452
- pipArgs.push('--user');
453
- }
454
- pipArgs.push('-r', requirementsPath);
455
-
456
- console.log('📦 Installing GDB Debugger Python dependencies...');
457
- console.log(`Using: ${pythonExecutable} ${pipArgs.join(' ')}`);
458
-
459
- const child = spawn(pythonExecutable, pipArgs, {
460
- stdio: 'inherit',
461
- shell: isWindows,
462
- cwd: dirname(requirementsPath)
463
- });
464
-
465
- child.on('close', (code) => {
466
- if (code === 0) {
467
- console.log('✅ GDB Debugger Python dependencies installed successfully');
468
- resolve();
469
- } else {
470
- reject(new Error(`pip install failed with exit code ${code}`));
471
- }
472
- });
473
-
474
- child.on('error', (error) => {
475
- reject(new Error(`Failed to run pip install: ${error.message}`));
476
- });
477
- });
478
- }
479
-
480
- // Validate GDB Debugger Python installation
481
- function validateGdbDebuggerInstallation(pythonExecutable) {
482
- return new Promise((resolve, reject) => {
483
- console.log('🔍 Validating GDB Debugger Python installation...');
484
-
485
- const child = spawn(pythonExecutable, ['-c', `
486
- try:
487
- import pygdbmi
488
- print('\\n✅ All GDB Debugger Python dependencies are available')
489
- print(f' pygdbmi version: {pygdbmi.__version__}')
490
- except ImportError as e:
491
- print(f'\\n❌ Missing dependency: {e}')
492
- exit(1)
493
- `], {
494
- stdio: 'inherit',
495
- shell: platform() === 'win32'
496
- });
497
-
498
- child.on('close', (code) => {
499
- if (code === 0) {
500
- resolve();
501
- } else {
502
- reject(new Error('Python validation failed'));
503
- }
504
- });
505
-
506
- child.on('error', (error) => {
507
- reject(new Error(`Failed to validate installation: ${error.message}`));
508
- });
509
- });
510
- }
511
-
512
- // Run if this is the main module
513
- if (import.meta.url.startsWith('file:') && process.argv[1] === fileURLToPath(import.meta.url)) {
514
- main();
515
- }
@@ -1,6 +0,0 @@
1
- #!/usr/bin/env node
2
- const _0x1b0f89=_0x2f68;import{createRequire}from'module';const require=createRequire(import.meta['url']);import{parseArgs as _0x48cf22}from'util';import{resolve as _0x438e9b}from'path';import{spawn as _0xe4afda}from'node:child_process';import{resolve as _0x18a6a9,dirname as _0x31de32}from'node:path';import{fileURLToPath as _0x5a7c93}from'node:url';import{existsSync as _0xb837fd}from'node:fs';function _0x2f68(_0x25d05f,_0x5b5eac){const _0x2f68ab=_0x5b5e();return _0x2f68=function(_0x5d5e32,_0x5c1b6c){_0x5d5e32=_0x5d5e32-0xf6;let _0x4703cd=_0x2f68ab[_0x5d5e32];return _0x4703cd;},_0x2f68(_0x25d05f,_0x5b5eac);}import{spawn as _0x49ecee}from'node:child_process';function _0x5b5e(){const _0x4664d8=['../python/repomap_bridge.py','repomap-python/repomap_bridge.py','pythonScriptPath','Python\x20script\x20not\x20found\x20at:\x20','python3','cachedPython','checkPythonExecutable','pipe','win32','stdout','data','toString','match','error','createPythonNotFoundError','❌\x20No\x20suitable\x20Python\x20installation\x20found\x20(requires\x20Python\x203.8+)\x0a\x0a','Windows\x20Installation\x20Options:\x0a','2.\x20Install\x20from\x20Microsoft\x20Store:\x20\x27python3\x27\x20command\x0a','getPlatformExecutables','Unix/Linux\x20Installation\x20Options:\x0a','1.\x20Ubuntu/Debian:\x20sudo\x20apt\x20install\x20python3\x20python3-pip\x0a','Tried\x20executables:\x20','\x0aTo\x20skip\x20Python\x20features:\x20set\x20SKIP_PYTHON_DEPS=true','🔍\x20DEBUG:\x20Python\x20script\x20path:\x20','🔍\x20DEBUG:\x20Python\x20script\x20exists:\x20','🔍\x20DEBUG:\x20Request:\x20','stringify','findPythonExecutable','🔍\x20DEBUG:\x20Using\x20Python\x20executable:\x20','Failed\x20to\x20find\x20Python\x20executable:\x20','message','🔍\x20DEBUG:\x20Spawned\x20Python\x20process\x20with\x20PID:\x20','🔍\x20DEBUG:\x20Working\x20directory:\x20','🔍\x20DEBUG:\x20Python\x20process\x20timed\x20out\x20after\x20','SIGTERM','RepoMapper\x20timed\x20out\x20after\x20','🔍\x20DEBUG:\x20Python\x20STDOUT\x20chunk:\x20','length','...','stderr','close','🔍\x20DEBUG:\x20Python\x20process\x20closed\x20with\x20code:\x20','🔍\x20DEBUG:\x20Final\x20STDOUT\x20length:\x20','🔍\x20DEBUG:\x20Final\x20STDERR\x20length:\x20','🔍\x20DEBUG:\x20Python\x20process\x20failed\x20with\x20stderr:\x20','Python\x20script\x20exited\x20with\x20code\x20','.\x20Stderr:\x20','🔍\x20DEBUG:\x20Attempting\x20to\x20parse\x20Python\x20output...','🔍\x20DEBUG:\x20Failed\x20to\x20parse\x20Python\x20output:\x20','.\x20Output:\x20','Failed\x20to\x20start\x20Python\x20process:\x20','🔍\x20DEBUG:\x20Sending\x20request\x20to\x20Python:\x20','write','stdin','end','kill','🔍\x20DEBUG:\x20Failed\x20to\x20write\x20to\x20Python\x20stdin:\x20','Failed\x20to\x20send\x20request\x20to\x20Python\x20script:\x20','Failed\x20to\x20parse\x20Python\x20output:\x20','search_identifiers','checkDependencies','parse','Python\x20executable\x20not\x20available','Python\x20detection\x20failed:\x20','string','boolean','Usage:\x20repomap-bridge\x20--project-root\x20<path>\x20[options]','\x20\x20--chat-files\x20<files...>\x20\x20\x20\x20\x20\x20\x20\x20\x20Files\x20currently\x20in\x20chat\x20context','\x20\x20--exclude-unranked\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Exclude\x20files\x20with\x20PageRank\x200','\x20\x20--force-refresh\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Force\x20cache\x20refresh','\x20\x20--verbose\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Enable\x20verbose\x20output','Examples:','\x20\x20repomap-bridge\x20--project-root\x20/path/to/project','exit','project-root','chat-files','mentioned-files','mentioned-idents','force-refresh','verbose','timeout','token-limit','exclude-unranked','max-context-window','Checking\x20Python\x20dependencies...','Missing\x20Python\x20dependencies:','Dependencies\x20OK','generateMap','Unknown\x20error','log','url','repomap-bridge'];_0x5b5e=function(){return _0x4664d8;};return _0x5b5e();}import{platform as _0x5b7262}from'node:os';var w=_0x5a7c93(import.meta['url']),g=_0x31de32(w),u=class{['pythonScriptPath'];['cachedPython']=null;constructor(){const _0x2014fd=_0x2f68;let _0x3a2ea6=_0x18a6a9(g,_0x2014fd(0xf6)),_0x132038=_0x18a6a9(g,_0x2014fd(0xf7));if(_0xb837fd(_0x132038))this[_0x2014fd(0xf8)]=_0x132038;else{if(_0xb837fd(_0x3a2ea6))this[_0x2014fd(0xf8)]=_0x3a2ea6;else throw new Error(_0x2014fd(0xf9)+_0x3a2ea6+'\x20or\x20'+_0x132038);}}['getPlatformExecutables'](){const _0x18c641=_0x2f68;return _0x5b7262()==='win32'?['py','python',_0x18c641(0xfa)]:['python3','python'];}async['findPythonExecutable'](){const _0xb311d6=_0x2f68;if(this[_0xb311d6(0xfb)])return this[_0xb311d6(0xfb)];let _0x3d4e01=this['getPlatformExecutables']();for(let _0x29f84d of _0x3d4e01)try{if(await this[_0xb311d6(0xfc)](_0x29f84d))return this[_0xb311d6(0xfb)]=_0x29f84d,_0x29f84d;}catch{continue;}throw new Error(this['createPythonNotFoundError']());}[_0x1b0f89(0xfc)](_0x2d00c3){return new Promise(_0x406d50=>{const _0x16c5bf=_0x2f68;let _0x50803a=_0x49ecee(_0x2d00c3,['--version'],{'stdio':_0x16c5bf(0xfd),'shell':_0x5b7262()===_0x16c5bf(0xfe)}),_0x313b62='';_0x50803a[_0x16c5bf(0xff)]?.['on'](_0x16c5bf(0x100),_0xb3b818=>_0x313b62+=_0xb3b818[_0x16c5bf(0x101)]()),_0x50803a['stderr']?.['on']('data',_0x1c1fb2=>_0x313b62+=_0x1c1fb2[_0x16c5bf(0x101)]()),_0x50803a['on']('close',_0xa60610=>{const _0x37803c=_0x16c5bf;if(_0xa60610===0x0&&_0x313b62['includes']('Python')){let _0x59429b=_0x313b62[_0x37803c(0x102)](/Python (\d+)\.(\d+)/);if(_0x59429b){let _0x2e7580=parseInt(_0x59429b[0x1]),_0x4d40b5=parseInt(_0x59429b[0x2]);_0x406d50(_0x2e7580>=0x3&&(_0x2e7580>0x3||_0x4d40b5>=0x8));return;}}_0x406d50(!0x1);}),_0x50803a['on'](_0x16c5bf(0x103),()=>_0x406d50(!0x1));});}[_0x1b0f89(0x104)](){const _0x868119=_0x1b0f89;let _0x53f4c5=_0x5b7262()===_0x868119(0xfe),_0x240e45=_0x868119(0x105);return _0x53f4c5?(_0x240e45+=_0x868119(0x106),_0x240e45+='1.\x20Install\x20from\x20python.org:\x20https://python.org/downloads/\x0a',_0x240e45+=_0x868119(0x107),_0x240e45+='3.\x20Use\x20py\x20launcher:\x20Should\x20be\x20available\x20after\x20standard\x20install\x0a\x0a',_0x240e45+='Tried\x20executables:\x20'+this[_0x868119(0x108)]()['join'](',\x20')+'\x0a',_0x240e45+='\x0aCommon\x20Windows\x20Issues:\x0a',_0x240e45+='-\x20Exit\x20code\x209009\x20means\x20Python\x20executable\x20not\x20found\x20in\x20PATH\x0a',_0x240e45+='-\x20Ensure\x20Python\x20installation\x20added\x20executables\x20to\x20PATH\x0a'):(_0x240e45+=_0x868119(0x109),_0x240e45+=_0x868119(0x10a),_0x240e45+='2.\x20CentOS/RHEL:\x20sudo\x20yum\x20install\x20python3\x20python3-pip\x0a',_0x240e45+='3.\x20macOS:\x20brew\x20install\x20python3\x0a\x0a',_0x240e45+=_0x868119(0x10b)+this['getPlatformExecutables']()['join'](',\x20')+'\x0a'),_0x240e45+=_0x868119(0x10c),_0x240e45;}async['generateMap'](_0x143643,_0xe261d7=0xea60){const _0x137b30=_0x1b0f89;return console[_0x137b30(0x103)]('🔍\x20DEBUG:\x20RepoMapBridge.generateMap\x20called'),console[_0x137b30(0x103)](_0x137b30(0x10d)+this[_0x137b30(0xf8)]),console['error'](_0x137b30(0x10e)+_0xb837fd(this[_0x137b30(0xf8)])),console['error'](_0x137b30(0x10f)+JSON[_0x137b30(0x110)](_0x143643,null,0x2)),console[_0x137b30(0x103)]('🔍\x20DEBUG:\x20Timeout:\x20'+_0xe261d7+'ms'),new Promise(async(_0x45af0a,_0x5a03c6)=>{const _0x52f769=_0x137b30;let _0x40f81d;try{let _0x30e0f5=await this[_0x52f769(0x111)]();console['error'](_0x52f769(0x112)+_0x30e0f5),_0x40f81d=_0xe4afda(_0x30e0f5,[this['pythonScriptPath']],{'stdio':['pipe',_0x52f769(0xfd),'pipe'],'cwd':_0x31de32(this['pythonScriptPath'])});}catch(_0x3c7eab){_0x5a03c6(new Error(_0x52f769(0x113)+(_0x3c7eab instanceof Error?_0x3c7eab[_0x52f769(0x114)]:_0x3c7eab)));return;}console['error'](_0x52f769(0x115)+_0x40f81d['pid']),console['error'](_0x52f769(0x116)+_0x31de32(this['pythonScriptPath']));let _0x43ccf2='',_0x206ed1='',_0x537039=setTimeout(()=>{const _0x20f523=_0x52f769;console['error'](_0x20f523(0x117)+_0xe261d7+'ms'),_0x40f81d['kill'](_0x20f523(0x118)),_0x5a03c6(new Error(_0x20f523(0x119)+_0xe261d7+'ms'));},_0xe261d7);_0x40f81d[_0x52f769(0xff)]['on']('data',_0x35ed24=>{const _0x70eb85=_0x52f769;let _0x1d959d=_0x35ed24[_0x70eb85(0x101)]();_0x43ccf2+=_0x1d959d,console['error'](_0x70eb85(0x11a)+_0x1d959d['substring'](0x0,0x64)+(_0x1d959d[_0x70eb85(0x11b)]>0x64?_0x70eb85(0x11c):''));}),_0x40f81d[_0x52f769(0x11d)]['on'](_0x52f769(0x100),_0xc5a301=>{let _0x504638=_0xc5a301['toString']();_0x206ed1+=_0x504638,console['error']('🔍\x20DEBUG:\x20Python\x20STDERR\x20chunk:\x20'+_0x504638);}),_0x40f81d['on'](_0x52f769(0x11e),_0x4a6e8f=>{const _0x2faa2b=_0x52f769;if(clearTimeout(_0x537039),console[_0x2faa2b(0x103)](_0x2faa2b(0x11f)+_0x4a6e8f),console[_0x2faa2b(0x103)](_0x2faa2b(0x120)+_0x43ccf2['length']),console['error'](_0x2faa2b(0x121)+_0x206ed1['length']),_0x4a6e8f!==0x0){console['error'](_0x2faa2b(0x122)+_0x206ed1),_0x5a03c6(new Error(_0x2faa2b(0x123)+_0x4a6e8f+_0x2faa2b(0x124)+_0x206ed1));return;}try{console['error'](_0x2faa2b(0x125));let _0x5464cc=JSON['parse'](_0x43ccf2);console['error']('🔍\x20DEBUG:\x20Successfully\x20parsed\x20Python\x20output'),_0x45af0a(_0x5464cc);}catch(_0x25d70f){console['error'](_0x2faa2b(0x126)+_0x25d70f),console[_0x2faa2b(0x103)]('🔍\x20DEBUG:\x20Raw\x20output:\x20'+_0x43ccf2),_0x5a03c6(new Error('Failed\x20to\x20parse\x20Python\x20output:\x20'+_0x25d70f+_0x2faa2b(0x127)+_0x43ccf2));}}),_0x40f81d['on']('error',_0x4028c7=>{const _0x35a994=_0x52f769;clearTimeout(_0x537039),console['error']('🔍\x20DEBUG:\x20Python\x20process\x20spawn\x20error:\x20'+_0x4028c7[_0x35a994(0x114)]),_0x5a03c6(new Error(_0x35a994(0x128)+_0x4028c7[_0x35a994(0x114)]));});try{let _0x3b8e72=JSON[_0x52f769(0x110)](_0x143643);console[_0x52f769(0x103)](_0x52f769(0x129)+_0x3b8e72['substring'](0x0,0xc8)+(_0x3b8e72['length']>0xc8?'...':'')),_0x40f81d['stdin'][_0x52f769(0x12a)](_0x3b8e72),_0x40f81d[_0x52f769(0x12b)][_0x52f769(0x12c)](),console[_0x52f769(0x103)]('🔍\x20DEBUG:\x20Request\x20sent\x20successfully');}catch(_0x3f16c9){clearTimeout(_0x537039),_0x40f81d[_0x52f769(0x12d)](_0x52f769(0x118)),console['error'](_0x52f769(0x12e)+_0x3f16c9),_0x5a03c6(new Error(_0x52f769(0x12f)+_0x3f16c9));}});}async['searchIdentifiers'](_0x457876,_0x56c940=0x7530){return new Promise(async(_0x157ed1,_0x56ccba)=>{const _0x2677e9=_0x2f68;let _0x549f69;try{let _0xc75271=await this['findPythonExecutable']();_0x549f69=_0xe4afda(_0xc75271,[this[_0x2677e9(0xf8)]],{'stdio':['pipe',_0x2677e9(0xfd),'pipe'],'cwd':_0x31de32(this[_0x2677e9(0xf8)])});}catch(_0x5ce9cb){_0x56ccba(new Error('Failed\x20to\x20find\x20Python\x20executable:\x20'+(_0x5ce9cb instanceof Error?_0x5ce9cb[_0x2677e9(0x114)]:_0x5ce9cb)));return;}let _0x1def64='',_0x29431a='',_0x5d7ba3=setTimeout(()=>{const _0x26949a=_0x2677e9;_0x549f69[_0x26949a(0x12d)](_0x26949a(0x118)),_0x56ccba(new Error('Identifier\x20search\x20timed\x20out\x20after\x20'+_0x56c940+'ms'));},_0x56c940);_0x549f69[_0x2677e9(0xff)]['on']('data',_0x156e72=>{_0x1def64+=_0x156e72['toString']();}),_0x549f69[_0x2677e9(0x11d)]['on']('data',_0x4aa9fc=>{const _0x54e50c=_0x2677e9;_0x29431a+=_0x4aa9fc[_0x54e50c(0x101)]();}),_0x549f69['on'](_0x2677e9(0x11e),_0x54e5e0=>{const _0x2a7331=_0x2677e9;if(clearTimeout(_0x5d7ba3),_0x54e5e0!==0x0){_0x56ccba(new Error('Python\x20script\x20exited\x20with\x20code\x20'+_0x54e5e0+'.\x20Stderr:\x20'+_0x29431a));return;}try{let _0x18f03a=JSON['parse'](_0x1def64);_0x157ed1(_0x18f03a);}catch(_0x2032b){_0x56ccba(new Error(_0x2a7331(0x130)+_0x2032b+_0x2a7331(0x127)+_0x1def64));}}),_0x549f69['on']('error',_0x495ee8=>{const _0x479896=_0x2677e9;clearTimeout(_0x5d7ba3),_0x56ccba(new Error(_0x479896(0x128)+_0x495ee8[_0x479896(0x114)]));});try{let _0x5732ff={'action':_0x2677e9(0x131),..._0x457876},_0x107e92=JSON['stringify'](_0x5732ff);_0x549f69[_0x2677e9(0x12b)][_0x2677e9(0x12a)](_0x107e92),_0x549f69[_0x2677e9(0x12b)]['end']();}catch(_0x33c9bd){clearTimeout(_0x5d7ba3),_0x549f69['kill'](_0x2677e9(0x118)),_0x56ccba(new Error('Failed\x20to\x20send\x20search\x20request\x20to\x20Python\x20script:\x20'+_0x33c9bd));}});}async[_0x1b0f89(0x132)](){return new Promise(async _0x37f32c=>{const _0x4209f7=_0x2f68;let _0x19c74d='\x0aimport\x20sys\x0aimport\x20json\x0a\x0amissing\x20=\x20[]\x0arequired_modules\x20=\x20[\x27tiktoken\x27,\x20\x27networkx\x27,\x20\x27diskcache\x27,\x20\x27grep_ast\x27,\x20\x27tree_sitter\x27,\x20\x27pygments\x27,\x20\x27fastmcp\x27]\x0a\x0afor\x20module\x20in\x20required_modules:\x0a\x20\x20\x20\x20try:\x0a\x20\x20\x20\x20\x20\x20\x20\x20__import__(module)\x0a\x20\x20\x20\x20except\x20ImportError:\x0a\x20\x20\x20\x20\x20\x20\x20\x20missing.append(module)\x0a\x0aresult\x20=\x20{\x0a\x20\x20\x20\x20\x27available\x27:\x20len(missing)\x20==\x200,\x0a\x20\x20\x20\x20\x27missing\x27:\x20missing\x20if\x20missing\x20else\x20None\x0a}\x0aprint(json.dumps(result))\x0a';try{let _0x566232=await this[_0x4209f7(0x111)](),_0x29bb59=_0xe4afda(_0x566232,['-c',_0x19c74d],{'stdio':[_0x4209f7(0xfd),'pipe','pipe']}),_0x2be669='';_0x29bb59['stdout']['on']('data',_0x526ee2=>{const _0x5f5809=_0x4209f7;_0x2be669+=_0x526ee2[_0x5f5809(0x101)]();}),_0x29bb59['on'](_0x4209f7(0x11e),()=>{const _0x2ad6ff=_0x4209f7;try{let _0x2184a3=JSON[_0x2ad6ff(0x133)](_0x2be669['trim']());_0x37f32c(_0x2184a3);}catch{_0x37f32c({'available':!0x1,'missing':['Failed\x20to\x20check\x20dependencies']});}}),_0x29bb59['on']('error',()=>{const _0x942936=_0x4209f7;_0x37f32c({'available':!0x1,'missing':[_0x942936(0x134)]});});}catch(_0x1ef303){_0x37f32c({'available':!0x1,'missing':[_0x4209f7(0x135)+(_0x1ef303 instanceof Error?_0x1ef303[_0x4209f7(0x114)]:_0x1ef303)]});}});}};import{fileURLToPath as _0x54f69f}from'url';function R(){const _0x5145b5=_0x1b0f89;let {values:_0xf8480a}=_0x48cf22({'args':process['argv']['slice'](0x2),'options':{'project-root':{'type':'string'},'chat-files':{'type':'string','multiple':!0x0},'mentioned-files':{'type':'string','multiple':!0x0},'other-files':{'type':'string','multiple':!0x0},'mentioned-idents':{'type':'string','multiple':!0x0},'token-limit':{'type':_0x5145b5(0x136),'default':'8192'},'exclude-unranked':{'type':'boolean','default':!0x1},'force-refresh':{'type':_0x5145b5(0x137),'default':!0x1},'verbose':{'type':_0x5145b5(0x137),'default':!0x1},'max-context-window':{'type':_0x5145b5(0x136)},'timeout':{'type':'string','default':'60'}}});return _0xf8480a['project-root']||(console[_0x5145b5(0x103)](_0x5145b5(0x138)),console[_0x5145b5(0x103)](''),console[_0x5145b5(0x103)]('Options:'),console[_0x5145b5(0x103)](' --project-root <path> Root directory of the project (required)'),console[_0x5145b5(0x103)](_0x5145b5(0x139)),console['error']('\x20\x20--mentioned-files\x20<files...>\x20\x20\x20\x20Files\x20explicitly\x20mentioned'),console[_0x5145b5(0x103)]('\x20\x20--other-files\x20<files...>\x20\x20\x20\x20\x20\x20\x20\x20Other\x20relevant\x20files'),console[_0x5145b5(0x103)]('\x20\x20--mentioned-idents\x20<idents...>\x20\x20Identifiers\x20explicitly\x20mentioned'),console['error']('\x20\x20--token-limit\x20<number>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Maximum\x20tokens\x20for\x20map\x20(default:\x208192)'),console[_0x5145b5(0x103)](_0x5145b5(0x13a)),console[_0x5145b5(0x103)](_0x5145b5(0x13b)),console[_0x5145b5(0x103)](_0x5145b5(0x13c)),console[_0x5145b5(0x103)]('\x20\x20--max-context-window\x20<number>\x20\x20\x20Maximum\x20context\x20window\x20size'),console['error']('\x20\x20--timeout\x20<seconds>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Timeout\x20in\x20seconds\x20(default:\x2060)'),console['error'](''),console['error'](_0x5145b5(0x13d)),console['error'](_0x5145b5(0x13e)),console['error']('\x20\x20repomap-bridge\x20--project-root\x20.\x20--chat-files\x20src/main.ts\x20src/utils.ts'),console['error']('\x20\x20repomap-bridge\x20--project-root\x20.\x20--mentioned-files\x20config.json\x20--token-limit\x204096'),process[_0x5145b5(0x13f)](0x1)),{'project-root':_0xf8480a[_0x5145b5(0x140)],'chat-files':_0xf8480a[_0x5145b5(0x141)]||[],'mentioned-files':_0xf8480a[_0x5145b5(0x142)]||[],'other-files':_0xf8480a['other-files']||[],'mentioned-idents':_0xf8480a[_0x5145b5(0x143)]||[],'token-limit':parseInt(_0xf8480a['token-limit'])||0x2000,'exclude-unranked':_0xf8480a['exclude-unranked'],'force-refresh':_0xf8480a[_0x5145b5(0x144)],'verbose':_0xf8480a[_0x5145b5(0x145)],'max-context-window':_0xf8480a['max-context-window']?parseInt(_0xf8480a['max-context-window']):void 0x0,'timeout':parseInt(_0xf8480a[_0x5145b5(0x146)])||0x3c};}async function $(){const _0x544354=_0x1b0f89;try{let _0x4b4346=R(),_0x5aae46={'project_root':_0x438e9b(_0x4b4346[_0x544354(0x140)]),'chat_files':_0x4b4346['chat-files'],'mentioned_files':_0x4b4346['mentioned-files'],'other_files':_0x4b4346['other-files'],'mentioned_idents':_0x4b4346[_0x544354(0x143)],'token_limit':_0x4b4346[_0x544354(0x147)],'exclude_unranked':_0x4b4346[_0x544354(0x148)],'force_refresh':_0x4b4346[_0x544354(0x144)],'verbose':_0x4b4346['verbose'],'max_context_window':_0x4b4346[_0x544354(0x149)]},_0x5907c2=new u();if(_0x4b4346[_0x544354(0x145)]){console[_0x544354(0x103)](_0x544354(0x14a));let _0x486d1e=await _0x5907c2[_0x544354(0x132)]();_0x486d1e['available']||(console[_0x544354(0x103)](_0x544354(0x14b),_0x486d1e['missing']),console['error']('Run: pip install -r python/requirements.txt'),process[_0x544354(0x13f)](0x1)),console[_0x544354(0x103)](_0x544354(0x14c));}let _0x18990e=(_0x4b4346[_0x544354(0x146)]||0x3c)*0x3e8,_0x4c70de=await _0x5907c2[_0x544354(0x14d)](_0x5aae46,_0x18990e);console['log'](JSON['stringify'](_0x4c70de,null,0x2)),process['exit'](0x0);}catch(_0x1ebdb1){console[_0x544354(0x103)]('RepoMapper\x20bridge\x20failed:',_0x1ebdb1);let _0x8dce04={'map':'','report':{'excluded':{},'definition_matches':0x0,'reference_matches':0x0,'total_files_considered':0x0},'error':_0x1ebdb1 instanceof Error?_0x1ebdb1[_0x544354(0x114)]:_0x544354(0x14e)};console[_0x544354(0x14f)](JSON[_0x544354(0x110)](_0x8dce04,null,0x2)),process['exit'](0x1);}}import.meta[_0x1b0f89(0x150)]['startsWith']('file:')&&(process['argv'][0x1]===_0x54f69f(import.meta['url'])||process['argv'][0x1]?.['includes'](_0x1b0f89(0x151))||process['argv'][_0x1b0f89(0x11b)]>=0x2)&&$();/**
3
- * @license
4
- * Copyright 2025 Google LLC
5
- * SPDX-License-Identifier: Apache-2.0
6
- */
@@ -1,58 +0,0 @@
1
- """
2
- Important file filtering for RepoMap.
3
- """
4
-
5
- import os
6
- from typing import List
7
-
8
- IMPORTANT_FILENAMES = {
9
- "README.md", "README.txt", "readme.md", "README.rst", "README",
10
- "requirements.txt", "Pipfile", "pyproject.toml", "setup.py", "setup.cfg",
11
- "package.json", "yarn.lock", "package-lock.json", "npm-shrinkwrap.json",
12
- "Dockerfile", "docker-compose.yml", "docker-compose.yaml",
13
- ".gitignore", ".gitattributes", ".dockerignore",
14
- "Makefile", "makefile", "CMakeLists.txt",
15
- "LICENSE", "LICENSE.txt", "LICENSE.md", "COPYING",
16
- "CHANGELOG.md", "CHANGELOG.txt", "HISTORY.md",
17
- "CONTRIBUTING.md", "CODE_OF_CONDUCT.md",
18
- ".env", ".env.example", ".env.local",
19
- "tox.ini", "pytest.ini", ".pytest.ini",
20
- ".flake8", ".pylintrc", "mypy.ini",
21
- "go.mod", "go.sum", "Cargo.toml", "Cargo.lock",
22
- "pom.xml", "build.gradle", "build.gradle.kts",
23
- "composer.json", "composer.lock",
24
- "Gemfile", "Gemfile.lock",
25
- }
26
-
27
- IMPORTANT_DIR_PATTERNS = {
28
- os.path.normpath(".github/workflows"): lambda fname: fname.endswith((".yml", ".yaml")),
29
- os.path.normpath(".github"): lambda fname: fname.endswith((".md", ".yml", ".yaml")),
30
- os.path.normpath("docs"): lambda fname: fname.endswith((".md", ".rst", ".txt")),
31
- }
32
-
33
-
34
- def is_important(rel_file_path: str) -> bool:
35
- """Check if a file is considered important."""
36
- normalized_path = os.path.normpath(rel_file_path)
37
- file_name = os.path.basename(normalized_path)
38
- dir_name = os.path.dirname(normalized_path)
39
-
40
- # Check specific directory patterns
41
- for important_dir, checker_func in IMPORTANT_DIR_PATTERNS.items():
42
- if dir_name == important_dir and checker_func(file_name):
43
- return True
44
-
45
- # Check if the full normalized path is important
46
- if normalized_path in IMPORTANT_FILENAMES:
47
- return True
48
-
49
- # Check if just the basename is important
50
- if file_name in IMPORTANT_FILENAMES:
51
- return True
52
-
53
- return False
54
-
55
-
56
- def filter_important_files(file_paths: List[str]) -> List[str]:
57
- """Filter list to only include important files."""
58
- return [path for path in file_paths if is_important(path)]
@@ -1,9 +0,0 @@
1
- These scm files are all adapted from the github repositories listed here:
2
-
3
- https://github.com/Goldziher/tree-sitter-language-pack/blob/main/sources/language_definitions.json
4
-
5
- See this URL for information on the licenses of each repo:
6
-
7
- https://github.com/Goldziher/tree-sitter-language-pack/
8
-
9
- (RepoMapper stole these from Aider)
@@ -1,5 +0,0 @@
1
- (function_declarator
2
- declarator: (identifier) @name.definition.function) @definition.function
3
-
4
- (call_expression
5
- function: (identifier) @name.reference.call) @reference.call
@@ -1,9 +0,0 @@
1
- (struct_specifier name: (type_identifier) @name.definition.class body:(_)) @definition.class
2
-
3
- (declaration type: (union_specifier name: (type_identifier) @name.definition.class)) @definition.class
4
-
5
- (function_declarator declarator: (identifier) @name.definition.function) @definition.function
6
-
7
- (type_definition declarator: (type_identifier) @name.definition.type) @definition.type
8
-
9
- (enum_specifier name: (type_identifier) @name.definition.type) @definition.type
@@ -1,16 +0,0 @@
1
- ; Definitions
2
- (intent_def
3
- (intent) @name.definition.intent) @definition.intent
4
-
5
- (slot_def
6
- (slot) @name.definition.slot) @definition.slot
7
-
8
- (alias_def
9
- (alias) @name.definition.alias) @definition.alias
10
-
11
- ; References
12
- (slot_ref
13
- (slot) @name.reference.slot) @reference.slot
14
-
15
- (alias_ref
16
- (alias) @name.reference.alias) @reference.alias