baseguard 1.0.4 → 1.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 (84) hide show
  1. package/dist/ai/gemini-analyzer.d.ts.map +1 -1
  2. package/dist/ai/gemini-analyzer.js +1 -1
  3. package/dist/ai/gemini-analyzer.js.map +1 -1
  4. package/dist/ai/gemini-code-fixer.d.ts.map +1 -1
  5. package/dist/ai/gemini-code-fixer.js +2 -7
  6. package/dist/ai/gemini-code-fixer.js.map +1 -1
  7. package/dist/ai/jules-implementer.d.ts +8 -0
  8. package/dist/ai/jules-implementer.d.ts.map +1 -1
  9. package/dist/ai/jules-implementer.js +115 -17
  10. package/dist/ai/jules-implementer.js.map +1 -1
  11. package/dist/commands/fix.d.ts.map +1 -1
  12. package/dist/commands/fix.js +5 -1
  13. package/dist/commands/fix.js.map +1 -1
  14. package/dist/core/baseline-checker.d.ts.map +1 -1
  15. package/dist/core/baseline-checker.js +6 -4
  16. package/dist/core/baseline-checker.js.map +1 -1
  17. package/package.json +1 -1
  18. package/src/ai/__tests__/gemini-analyzer.test.ts +0 -181
  19. package/src/ai/agentkit-orchestrator.ts +0 -534
  20. package/src/ai/fix-manager.ts +0 -362
  21. package/src/ai/gemini-analyzer.ts +0 -665
  22. package/src/ai/gemini-code-fixer.ts +0 -539
  23. package/src/ai/index.ts +0 -4
  24. package/src/ai/jules-implementer.ts +0 -504
  25. package/src/ai/unified-code-fixer.ts +0 -347
  26. package/src/commands/automation.ts +0 -344
  27. package/src/commands/check.ts +0 -298
  28. package/src/commands/config.ts +0 -584
  29. package/src/commands/fix.ts +0 -264
  30. package/src/commands/index.ts +0 -7
  31. package/src/commands/init.ts +0 -156
  32. package/src/commands/status.ts +0 -307
  33. package/src/core/api-key-manager.ts +0 -298
  34. package/src/core/baseguard.ts +0 -757
  35. package/src/core/baseline-checker.ts +0 -564
  36. package/src/core/cache-manager.ts +0 -272
  37. package/src/core/configuration-recovery.ts +0 -672
  38. package/src/core/configuration.ts +0 -596
  39. package/src/core/debug-logger.ts +0 -590
  40. package/src/core/directory-filter.ts +0 -421
  41. package/src/core/error-handler.ts +0 -518
  42. package/src/core/file-processor.ts +0 -338
  43. package/src/core/gitignore-manager.ts +0 -169
  44. package/src/core/graceful-degradation-manager.ts +0 -596
  45. package/src/core/index.ts +0 -17
  46. package/src/core/lazy-loader.ts +0 -317
  47. package/src/core/logger.ts +0 -0
  48. package/src/core/memory-manager.ts +0 -290
  49. package/src/core/parser-worker.ts +0 -33
  50. package/src/core/startup-optimizer.ts +0 -246
  51. package/src/core/system-error-handler.ts +0 -755
  52. package/src/git/automation-engine.ts +0 -361
  53. package/src/git/github-manager.ts +0 -190
  54. package/src/git/hook-manager.ts +0 -210
  55. package/src/git/index.ts +0 -4
  56. package/src/index.ts +0 -8
  57. package/src/parsers/feature-validator.ts +0 -559
  58. package/src/parsers/index.ts +0 -8
  59. package/src/parsers/parser-manager.ts +0 -418
  60. package/src/parsers/parser.ts +0 -26
  61. package/src/parsers/react-parser-optimized.ts +0 -161
  62. package/src/parsers/react-parser.ts +0 -359
  63. package/src/parsers/svelte-parser.ts +0 -510
  64. package/src/parsers/vanilla-parser.ts +0 -685
  65. package/src/parsers/vue-parser.ts +0 -476
  66. package/src/types/index.ts +0 -96
  67. package/src/ui/components.ts +0 -567
  68. package/src/ui/help.ts +0 -193
  69. package/src/ui/index.ts +0 -4
  70. package/src/ui/prompts.ts +0 -681
  71. package/src/ui/terminal-header.ts +0 -59
  72. package/tests/e2e/baseguard.e2e.test.ts +0 -516
  73. package/tests/e2e/cross-platform.e2e.test.ts +0 -420
  74. package/tests/e2e/git-integration.e2e.test.ts +0 -487
  75. package/tests/fixtures/react-project/package.json +0 -14
  76. package/tests/fixtures/react-project/src/App.css +0 -76
  77. package/tests/fixtures/react-project/src/App.tsx +0 -77
  78. package/tests/fixtures/svelte-project/package.json +0 -11
  79. package/tests/fixtures/svelte-project/src/App.svelte +0 -369
  80. package/tests/fixtures/vanilla-project/index.html +0 -76
  81. package/tests/fixtures/vanilla-project/script.js +0 -331
  82. package/tests/fixtures/vanilla-project/styles.css +0 -359
  83. package/tests/fixtures/vue-project/package.json +0 -12
  84. package/tests/fixtures/vue-project/src/App.vue +0 -216
package/src/ui/prompts.ts DELETED
@@ -1,681 +0,0 @@
1
- import inquirer from 'inquirer';
2
- import open from 'open';
3
- import chalk from 'chalk';
4
- import { Colors, UIComponents } from './components.js';
5
- import { ApiKeyManager } from '../core/api-key-manager.js';
6
- import type { BrowserTarget } from '../types/index.js';
7
-
8
- /**
9
- * Interactive prompts for user input
10
- */
11
- export class Prompts {
12
- /**
13
- * Prompt for initial BaseGuard setup
14
- */
15
- static async setupWizard(): Promise<{
16
- targets: BrowserTarget[];
17
- installHooks: boolean;
18
- hookTrigger: 'pre-commit' | 'pre-push';
19
- setupApiKeys: boolean;
20
- }> {
21
- UIComponents.showHeader();
22
- UIComponents.showSectionHeader('Welcome to BaseGuard Setup');
23
-
24
- console.log(Colors.muted('Let\'s configure BaseGuard for your project.\n'));
25
-
26
- const answers = await inquirer.prompt([
27
- {
28
- type: 'list',
29
- name: 'targetPreset',
30
- message: 'Which browser compatibility target would you like to use?',
31
- choices: [
32
- {
33
- name: 'Baseline Widely (30+ months of support) - Recommended',
34
- value: 'baseline-widely'
35
- },
36
- {
37
- name: 'Baseline Newly (Recently available features)',
38
- value: 'baseline-newly'
39
- },
40
- {
41
- name: 'Last 2 years (Modern browsers)',
42
- value: 'last-2-years'
43
- },
44
- {
45
- name: 'Custom configuration',
46
- value: 'custom'
47
- }
48
- ],
49
- default: 'baseline-widely'
50
- },
51
- {
52
- type: 'confirm',
53
- name: 'installHooks',
54
- message: 'Would you like to install git hooks for automatic checking?',
55
- default: true
56
- },
57
- {
58
- type: 'list',
59
- name: 'hookTrigger',
60
- message: 'When should BaseGuard check your code?',
61
- choices: [
62
- {
63
- name: 'Before each commit (pre-commit) - Recommended',
64
- value: 'pre-commit'
65
- },
66
- {
67
- name: 'Before each push (pre-push)',
68
- value: 'pre-push'
69
- }
70
- ],
71
- default: 'pre-commit',
72
- when: (answers) => answers.installHooks
73
- },
74
- {
75
- type: 'confirm',
76
- name: 'setupApiKeys',
77
- message: 'Would you like to set up AI analysis and fixing now?',
78
- default: true
79
- }
80
- ]);
81
-
82
- let targets: BrowserTarget[] = [];
83
-
84
- if (answers.targetPreset === 'custom') {
85
- targets = await this.promptCustomTargets();
86
- } else {
87
- targets = this.getPresetTargets(answers.targetPreset);
88
- }
89
-
90
- return {
91
- targets,
92
- installHooks: answers.installHooks,
93
- hookTrigger: answers.hookTrigger || 'pre-commit',
94
- setupApiKeys: answers.setupApiKeys
95
- };
96
- }
97
-
98
- /**
99
- * Prompt for custom browser targets
100
- */
101
- static async promptCustomTargets(): Promise<BrowserTarget[]> {
102
- const targets: BrowserTarget[] = [];
103
- let addMore = true;
104
-
105
- while (addMore) {
106
- const target = await inquirer.prompt([
107
- {
108
- type: 'list',
109
- name: 'browser',
110
- message: 'Select a browser:',
111
- choices: [
112
- 'chrome',
113
- 'firefox',
114
- 'safari',
115
- 'edge',
116
- 'opera',
117
- 'samsung_android',
118
- 'webview_android'
119
- ]
120
- },
121
- {
122
- type: 'input',
123
- name: 'version',
124
- message: 'Minimum version (or "baseline" for baseline support):',
125
- default: 'baseline',
126
- validate: (input: string) => {
127
- if (input === 'baseline' || input === 'baseline-newly') return true;
128
- if (/^\d+(\.\d+)*$/.test(input)) return true;
129
- return 'Please enter a valid version number or "baseline"';
130
- }
131
- }
132
- ]);
133
-
134
- targets.push({
135
- browser: target.browser,
136
- minVersion: target.version
137
- });
138
-
139
- const continuePrompt = await inquirer.prompt([
140
- {
141
- type: 'confirm',
142
- name: 'addAnother',
143
- message: 'Add another browser target?',
144
- default: false
145
- }
146
- ]);
147
-
148
- addMore = continuePrompt.addAnother;
149
- }
150
-
151
- return targets;
152
- }
153
-
154
- /**
155
- * Get preset browser targets
156
- */
157
- private static getPresetTargets(preset: string): BrowserTarget[] {
158
- switch (preset) {
159
- case 'baseline-widely':
160
- return [
161
- { browser: 'chrome', minVersion: 'baseline' },
162
- { browser: 'firefox', minVersion: 'baseline' },
163
- { browser: 'safari', minVersion: 'baseline' },
164
- { browser: 'edge', minVersion: 'baseline' }
165
- ];
166
- case 'baseline-newly':
167
- return [
168
- { browser: 'chrome', minVersion: 'baseline-newly' },
169
- { browser: 'firefox', minVersion: 'baseline-newly' },
170
- { browser: 'safari', minVersion: 'baseline-newly' },
171
- { browser: 'edge', minVersion: 'baseline-newly' }
172
- ];
173
- case 'last-2-years':
174
- return [
175
- { browser: 'chrome', minVersion: '109' },
176
- { browser: 'firefox', minVersion: '109' },
177
- { browser: 'safari', minVersion: '16' },
178
- { browser: 'edge', minVersion: '109' }
179
- ];
180
- default:
181
- return [];
182
- }
183
- }
184
-
185
- /**
186
- * Guided API key setup with browser integration
187
- */
188
- static async setupApiKeys(): Promise<{
189
- julesApiKey?: string;
190
- geminiApiKey?: string;
191
- }> {
192
- UIComponents.showSectionHeader('API Key Setup');
193
-
194
- console.log(Colors.muted('BaseGuard uses AI services for analysis and fixing:'));
195
- console.log(Colors.muted('• Jules API for autonomous code fixing'));
196
- console.log(Colors.muted('• Gemini API for compatibility analysis\n'));
197
-
198
- const setupChoice = await inquirer.prompt([
199
- {
200
- type: 'list',
201
- name: 'choice',
202
- message: 'How would you like to proceed?',
203
- choices: [
204
- {
205
- name: 'Set up both APIs now (Recommended)',
206
- value: 'both'
207
- },
208
- {
209
- name: 'Set up Jules API only (for fixing)',
210
- value: 'jules'
211
- },
212
- {
213
- name: 'Set up Gemini API only (for analysis)',
214
- value: 'gemini'
215
- },
216
- {
217
- name: 'Skip for now (baseline checking only)',
218
- value: 'skip'
219
- }
220
- ],
221
- default: 'both'
222
- }
223
- ]);
224
-
225
- if (setupChoice.choice === 'skip') {
226
- UIComponents.showWarningBox('Skipping API setup. You can configure APIs later with: base config api-keys');
227
- return {};
228
- }
229
-
230
- const result: { julesApiKey?: string; geminiApiKey?: string } = {};
231
-
232
- if (setupChoice.choice === 'both' || setupChoice.choice === 'jules') {
233
- result.julesApiKey = await this.setupJulesApiKey();
234
- }
235
-
236
- if (setupChoice.choice === 'both' || setupChoice.choice === 'gemini') {
237
- result.geminiApiKey = await this.setupGeminiApiKey();
238
- }
239
-
240
- return result;
241
- }
242
-
243
- /**
244
- * Set up Jules API key with browser integration
245
- */
246
- static async setupJulesApiKey(): Promise<string | undefined> {
247
- console.log(Colors.info('\nšŸ”§ Setting up Jules API for autonomous code fixing'));
248
-
249
- const openBrowser = await inquirer.prompt([
250
- {
251
- type: 'confirm',
252
- name: 'open',
253
- message: 'Open jules.google.com to get your API key?',
254
- default: true
255
- }
256
- ]);
257
-
258
- if (openBrowser.open) {
259
- const spinner = UIComponents.createSpinner('Opening Jules website...');
260
- spinner.start();
261
-
262
- try {
263
- await open('https://jules.google.com');
264
- spinner.succeed('Opened jules.google.com');
265
- } catch (error) {
266
- spinner.fail('Failed to open browser. Please visit https://jules.google.com manually');
267
- }
268
- }
269
-
270
- console.log(Colors.muted('\nSteps to get your Jules API key:'));
271
- UIComponents.showList([
272
- 'Sign in to jules.google.com',
273
- 'Navigate to API settings or developer console',
274
- 'Generate a new API key',
275
- 'Copy the key and paste it below'
276
- ]);
277
-
278
- let attempts = 0;
279
- const maxAttempts = 3;
280
-
281
- while (attempts < maxAttempts) {
282
- const keyPrompt = await inquirer.prompt([
283
- {
284
- type: 'password',
285
- name: 'apiKey',
286
- message: 'Enter your Jules API key:',
287
- mask: '*',
288
- validate: (input: string) => {
289
- const validation = ApiKeyManager.validateJulesApiKey(input);
290
- return validation.valid || validation.error!;
291
- }
292
- }
293
- ]);
294
-
295
- // Test the API key
296
- const spinner = UIComponents.createSpinner('Testing Jules API key...');
297
- spinner.start();
298
-
299
- const testResult = await ApiKeyManager.testJulesApiKey(keyPrompt.apiKey);
300
-
301
- if (testResult.success) {
302
- spinner.succeed('Jules API key validated successfully');
303
-
304
- // Note: GitHub integration should be set up on the Jules dashboard
305
- console.log(chalk.cyan('šŸ’” Note: GitHub integration should be configured on the Jules dashboard.'));
306
-
307
- return keyPrompt.apiKey;
308
- } else {
309
- spinner.fail(`Failed to validate Jules API key: ${testResult.error}`);
310
- attempts++;
311
-
312
- if (attempts < maxAttempts) {
313
- const retry = await inquirer.prompt([
314
- {
315
- type: 'confirm',
316
- name: 'retry',
317
- message: `Would you like to try again? (${maxAttempts - attempts} attempts remaining)`,
318
- default: true
319
- }
320
- ]);
321
-
322
- if (!retry.retry) {
323
- break;
324
- }
325
- }
326
- }
327
- }
328
-
329
- UIComponents.showWarningBox('Jules API key setup incomplete. You can configure it later with: base config api-keys');
330
- return undefined;
331
- }
332
-
333
-
334
-
335
- /**
336
- * Set up Gemini API key with browser integration
337
- */
338
- static async setupGeminiApiKey(): Promise<string | undefined> {
339
- console.log(Colors.info('\n🧠 Setting up Gemini API for compatibility analysis'));
340
-
341
- const openBrowser = await inquirer.prompt([
342
- {
343
- type: 'confirm',
344
- name: 'open',
345
- message: 'Open aistudio.google.com to get your API key?',
346
- default: true
347
- }
348
- ]);
349
-
350
- if (openBrowser.open) {
351
- const spinner = UIComponents.createSpinner('Opening AI Studio...');
352
- spinner.start();
353
-
354
- try {
355
- await open('https://aistudio.google.com/app/apikey');
356
- spinner.succeed('Opened AI Studio');
357
- } catch (error) {
358
- spinner.fail('Failed to open browser. Please visit https://aistudio.google.com/app/apikey manually');
359
- }
360
- }
361
-
362
- console.log(Colors.muted('\nSteps to get your Gemini API key:'));
363
- UIComponents.showList([
364
- 'Sign in to aistudio.google.com',
365
- 'Click "Get API key" or "Create API key"',
366
- 'Copy the generated key',
367
- 'Paste it below'
368
- ]);
369
-
370
- let attempts = 0;
371
- const maxAttempts = 3;
372
-
373
- while (attempts < maxAttempts) {
374
- const keyPrompt = await inquirer.prompt([
375
- {
376
- type: 'password',
377
- name: 'apiKey',
378
- message: 'Enter your Gemini API key:',
379
- mask: '*',
380
- validate: (input: string) => {
381
- const validation = ApiKeyManager.validateGeminiApiKey(input);
382
- return validation.valid || validation.error!;
383
- }
384
- }
385
- ]);
386
-
387
- // Test the API key
388
- const spinner = UIComponents.createSpinner('Testing Gemini API key...');
389
- spinner.start();
390
-
391
- const testResult = await ApiKeyManager.testGeminiApiKey(keyPrompt.apiKey);
392
-
393
- if (testResult.success) {
394
- spinner.succeed('Gemini API key validated successfully');
395
- return keyPrompt.apiKey;
396
- } else {
397
- spinner.fail(`Failed to validate Gemini API key: ${testResult.error}`);
398
- attempts++;
399
-
400
- if (attempts < maxAttempts) {
401
- const retry = await inquirer.prompt([
402
- {
403
- type: 'confirm',
404
- name: 'retry',
405
- message: `Would you like to try again? (${maxAttempts - attempts} attempts remaining)`,
406
- default: true
407
- }
408
- ]);
409
-
410
- if (!retry.retry) {
411
- break;
412
- }
413
- }
414
- }
415
- }
416
-
417
- UIComponents.showWarningBox('Gemini API key setup incomplete. You can configure it later with: base config api-keys');
418
- return undefined;
419
- }
420
-
421
- /**
422
- * Prompt for fix approval with preview
423
- */
424
- static async confirmFix(fixPreview: string, fileName: string): Promise<boolean> {
425
- console.log(Colors.highlight(`\nšŸ“ Proposed fix for ${fileName}:`));
426
- console.log(Colors.muted('─'.repeat(50)));
427
- console.log(fixPreview);
428
- console.log(Colors.muted('─'.repeat(50)));
429
-
430
- const answer = await inquirer.prompt([
431
- {
432
- type: 'list',
433
- name: 'action',
434
- message: 'What would you like to do?',
435
- choices: [
436
- {
437
- name: 'āœ… Apply this fix',
438
- value: 'apply'
439
- },
440
- {
441
- name: 'āŒ Skip this fix',
442
- value: 'skip'
443
- },
444
- {
445
- name: 'šŸ‘€ Show more details',
446
- value: 'details'
447
- }
448
- ],
449
- default: 'apply'
450
- }
451
- ]);
452
-
453
- if (answer.action === 'details') {
454
- // Show more details and ask again
455
- console.log(Colors.info('\nFix details:'));
456
- UIComponents.showList([
457
- 'This fix adds progressive enhancement',
458
- 'Original functionality is preserved',
459
- 'Fallbacks are added for older browsers',
460
- 'Code follows best practices'
461
- ]);
462
-
463
- return this.confirmFix(fixPreview, fileName);
464
- }
465
-
466
- return answer.action === 'apply';
467
- }
468
-
469
- /**
470
- * Show progress for batch operations
471
- */
472
- static async showBatchProgress<T>(
473
- items: T[],
474
- operation: (item: T, index: number) => Promise<void>,
475
- operationName: string
476
- ): Promise<void> {
477
- console.log(Colors.primary(`\n${operationName}...`));
478
-
479
- for (let i = 0; i < items.length; i++) {
480
- UIComponents.showProgress(i, items.length, `Processing ${i + 1}/${items.length}`);
481
- await operation(items[i]!, i);
482
- }
483
-
484
- UIComponents.showProgress(items.length, items.length, 'Complete');
485
- }
486
-
487
- /**
488
- * Handle graceful error display with next steps
489
- */
490
- static async handleError(error: Error, context: string): Promise<void> {
491
- UIComponents.showErrorBox(`${context}: ${error.message}`);
492
-
493
- console.log(Colors.muted('\nPossible solutions:'));
494
-
495
- if (error.message.includes('API key')) {
496
- UIComponents.showList([
497
- 'Check your API key configuration: base config show',
498
- 'Reconfigure API keys: base config api-keys',
499
- 'Verify API key permissions and quotas'
500
- ]);
501
- } else if (error.message.includes('network') || error.message.includes('fetch')) {
502
- UIComponents.showList([
503
- 'Check your internet connection',
504
- 'Verify firewall settings',
505
- 'Try again in a few moments'
506
- ]);
507
- } else if (error.message.includes('file') || error.message.includes('permission')) {
508
- UIComponents.showList([
509
- 'Check file permissions',
510
- 'Ensure the file exists and is readable',
511
- 'Try running with appropriate permissions'
512
- ]);
513
- } else {
514
- UIComponents.showList([
515
- 'Check the BaseGuard documentation',
516
- 'Report this issue on GitHub',
517
- 'Try running with --verbose for more details'
518
- ]);
519
- }
520
-
521
- const continuePrompt = await inquirer.prompt([
522
- {
523
- type: 'confirm',
524
- name: 'continue',
525
- message: 'Would you like to continue anyway?',
526
- default: false
527
- }
528
- ]);
529
-
530
- if (!continuePrompt.continue) {
531
- process.exit(1);
532
- }
533
- }
534
-
535
- /**
536
- * Prompt for configuration updates
537
- */
538
- static async promptConfigUpdate(currentConfig: any): Promise<any> {
539
- UIComponents.showSectionHeader('Update Configuration');
540
-
541
- const choices = [
542
- {
543
- name: 'Browser targets',
544
- value: 'targets'
545
- },
546
- {
547
- name: 'API keys',
548
- value: 'apiKeys'
549
- },
550
- {
551
- name: 'Git automation settings',
552
- value: 'automation'
553
- },
554
- {
555
- name: 'View current configuration',
556
- value: 'view'
557
- }
558
- ];
559
-
560
- const answer = await inquirer.prompt([
561
- {
562
- type: 'list',
563
- name: 'section',
564
- message: 'What would you like to update?',
565
- choices
566
- }
567
- ]);
568
-
569
- switch (answer.section) {
570
- case 'targets':
571
- return { targets: await this.promptCustomTargets() };
572
- case 'apiKeys':
573
- return { apiKeys: await this.setupApiKeys() };
574
- case 'automation':
575
- return { automation: await this.promptAutomationSettings() };
576
- case 'view':
577
- console.log(Colors.info('\nCurrent configuration:'));
578
- console.log(JSON.stringify(currentConfig, null, 2));
579
- return {};
580
- default:
581
- return {};
582
- }
583
- }
584
-
585
- /**
586
- * Prompt for automation settings
587
- */
588
- static async promptAutomationSettings(): Promise<any> {
589
- return await inquirer.prompt([
590
- {
591
- type: 'confirm',
592
- name: 'enabled',
593
- message: 'Enable git automation?',
594
- default: true
595
- },
596
- {
597
- type: 'list',
598
- name: 'trigger',
599
- message: 'When should BaseGuard run?',
600
- choices: [
601
- { name: 'Before each commit (pre-commit)', value: 'pre-commit' },
602
- { name: 'Before each push (pre-push)', value: 'pre-push' }
603
- ],
604
- default: 'pre-commit',
605
- when: (answers) => answers.enabled
606
- },
607
- {
608
- type: 'confirm',
609
- name: 'autoAnalyze',
610
- message: 'Automatically analyze violations with AI?',
611
- default: true,
612
- when: (answers) => answers.enabled
613
- },
614
- {
615
- type: 'confirm',
616
- name: 'autoFix',
617
- message: 'Automatically fix violations when possible?',
618
- default: false,
619
- when: (answers) => answers.enabled
620
- },
621
- {
622
- type: 'confirm',
623
- name: 'blockCommit',
624
- message: 'Block commits when violations are found?',
625
- default: true,
626
- when: (answers) => answers.enabled
627
- }
628
- ]);
629
- }
630
-
631
- /**
632
- * Choose coding agent for fixing
633
- */
634
- static async chooseCodingAgent(): Promise<{ primary: 'jules' | 'gemini'; fallback: 'jules' | 'gemini' }> {
635
- console.log(chalk.cyan('\nšŸ¤– Coding Agent Selection'));
636
- console.log(chalk.dim('Choose which AI agent to use for code fixing:\n'));
637
-
638
- console.log(chalk.white('Jules (Google\'s Autonomous Coding Agent):'));
639
- console.log(chalk.green(' āœ… Autonomous operation in cloud VMs'));
640
- console.log(chalk.green(' āœ… Full repository context understanding'));
641
- console.log(chalk.green(' āœ… Asynchronous processing'));
642
- console.log(chalk.red(' āŒ Requires GitHub repository'));
643
- console.log(chalk.red(' āŒ Cannot work with local/uncommitted files'));
644
-
645
- console.log(chalk.white('\nGemini 2.5 Pro (Direct API Integration):'));
646
- console.log(chalk.green(' āœ… Works with any files (GitHub or not)'));
647
- console.log(chalk.green(' āœ… Immediate processing'));
648
- console.log(chalk.green(' āœ… Works with uncommitted/local files'));
649
- console.log(chalk.green(' āœ… Grounded with real-time web search'));
650
- console.log(chalk.yellow(' āš ļø Requires manual code application'));
651
-
652
- const answers = await inquirer.prompt([
653
- {
654
- type: 'list',
655
- name: 'primary',
656
- message: 'Select primary coding agent:',
657
- choices: [
658
- { name: 'Gemini 2.5 Pro (recommended for most projects)', value: 'gemini' },
659
- { name: 'Jules (for GitHub repositories with autonomous needs)', value: 'jules' }
660
- ],
661
- default: 'gemini'
662
- },
663
- {
664
- type: 'list',
665
- name: 'fallback',
666
- message: 'Select fallback coding agent:',
667
- choices: [
668
- { name: 'Gemini 2.5 Pro', value: 'gemini' },
669
- { name: 'Jules', value: 'jules' }
670
- ],
671
- default: 'gemini'
672
- }
673
- ]);
674
-
675
- console.log(chalk.green(`\nāœ… Coding agents configured:`));
676
- console.log(` Primary: ${answers.primary}`);
677
- console.log(` Fallback: ${answers.fallback}`);
678
-
679
- return answers;
680
- }
681
- }