cast-code 1.0.6 β†’ 1.0.7

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 (29) hide show
  1. package/dist/common/services/multi-llm.service.js +19 -0
  2. package/dist/common/services/multi-llm.service.js.map +1 -1
  3. package/dist/modules/config/services/config-commands.service.js +86 -6
  4. package/dist/modules/config/services/config-commands.service.js.map +1 -1
  5. package/dist/modules/config/types/config.types.js +5 -0
  6. package/dist/modules/config/types/config.types.js.map +1 -1
  7. package/dist/modules/config/types/config.types.spec.js +60 -0
  8. package/dist/modules/config/types/config.types.spec.js.map +1 -0
  9. package/dist/modules/core/services/deep-agent.service.js +40 -4
  10. package/dist/modules/core/services/deep-agent.service.js.map +1 -1
  11. package/dist/modules/git/git.module.js +5 -2
  12. package/dist/modules/git/git.module.js.map +1 -1
  13. package/dist/modules/git/git.module.spec.js +54 -0
  14. package/dist/modules/git/git.module.spec.js.map +1 -0
  15. package/dist/modules/git/services/unit-test-generator.service.js +557 -0
  16. package/dist/modules/git/services/unit-test-generator.service.js.map +1 -0
  17. package/dist/modules/git/services/unit-test-generator.service.spec.js +119 -0
  18. package/dist/modules/git/services/unit-test-generator.service.spec.js.map +1 -0
  19. package/dist/modules/repl/services/commands/git-commands.service.js +97 -2
  20. package/dist/modules/repl/services/commands/git-commands.service.js.map +1 -1
  21. package/dist/modules/repl/services/commands/repl-commands.service.js +1 -0
  22. package/dist/modules/repl/services/commands/repl-commands.service.js.map +1 -1
  23. package/dist/modules/repl/services/commands/repl-commands.service.spec.js +69 -0
  24. package/dist/modules/repl/services/commands/repl-commands.service.spec.js.map +1 -0
  25. package/dist/modules/repl/services/repl.service.js +11 -1
  26. package/dist/modules/repl/services/repl.service.js.map +1 -1
  27. package/dist/modules/repl/services/repl.service.spec.js +137 -0
  28. package/dist/modules/repl/services/repl.service.spec.js.map +1 -0
  29. package/package.json +1 -1
@@ -0,0 +1,119 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ const _strict = /*#__PURE__*/ _interop_require_default(require("node:assert/strict"));
6
+ const _nodetest = /*#__PURE__*/ _interop_require_default(require("node:test"));
7
+ const _nodefs = require("node:fs");
8
+ const _nodeos = require("node:os");
9
+ const _nodepath = require("node:path");
10
+ const _unittestgeneratorservice = require("./unit-test-generator.service");
11
+ function _interop_require_default(obj) {
12
+ return obj && obj.__esModule ? obj : {
13
+ default: obj
14
+ };
15
+ }
16
+ const stubLlm = {};
17
+ // Ensures the constructor retains the provided multi-LLM service reference for dependency injection.
18
+ (0, _nodetest.default)('constructor stores the provided LLM dependency', ()=>{
19
+ const service = new _unittestgeneratorservice.UnitTestGeneratorService(stubLlm);
20
+ _strict.default.strictEqual(service['multiLlmService'], stubLlm);
21
+ });
22
+ // Validates that filterRelevantFiles excludes test artifacts and non-source files while keeping production sources.
23
+ (0, _nodetest.default)('filterRelevantFiles excludes tests and outputs only source files', ()=>{
24
+ const service = new _unittestgeneratorservice.UnitTestGeneratorService(stubLlm);
25
+ const files = [
26
+ 'src/app/main.ts',
27
+ 'src/app/main.spec.ts',
28
+ 'lib/utils.js',
29
+ 'tests/test_helper.ts',
30
+ 'dist/bundle.js',
31
+ 'node_modules/dep/index.ts',
32
+ 'scripts/build.ts',
33
+ 'src/utils/helper.jsx',
34
+ 'src/utils/helper.test.jsx',
35
+ 'server/module.py',
36
+ 'server/module_test.py',
37
+ 'src/test/support.ts'
38
+ ];
39
+ const relevant = service['filterRelevantFiles'](files);
40
+ _strict.default.deepStrictEqual(relevant, [
41
+ 'src/app/main.ts',
42
+ 'lib/utils.js',
43
+ 'scripts/build.ts',
44
+ 'src/utils/helper.jsx',
45
+ 'server/module.py'
46
+ ]);
47
+ });
48
+ // Verifies resolveTestPath normalizes extensions for JavaScript, Python, and Java sources to their expected test locations.
49
+ (0, _nodetest.default)('resolveTestPath returns expected test paths for supported languages', ()=>{
50
+ const service = new _unittestgeneratorservice.UnitTestGeneratorService(stubLlm);
51
+ const jsPath = service['resolveTestPath']('src/modules/git/service.ts', 'javascript');
52
+ const jsxPath = service['resolveTestPath']('src/components/Widget.jsx', 'javascript');
53
+ const pythonPath = service['resolveTestPath']('src/helpers/transform.py', 'python');
54
+ const javaMainPath = service['resolveTestPath']('src/main/java/com/example/App.java', 'java');
55
+ const javaPlainPath = service['resolveTestPath']('lib/Legacy.java', 'java');
56
+ _strict.default.strictEqual(jsPath, 'src/modules/git/service.spec.ts');
57
+ _strict.default.strictEqual(jsxPath, 'src/components/Widget.spec.ts');
58
+ _strict.default.strictEqual(pythonPath, 'tests/test_transform.py');
59
+ _strict.default.strictEqual(javaMainPath, 'src/test/java/com/example/AppTest.java');
60
+ _strict.default.strictEqual(javaPlainPath, 'lib/LegacyTest.java');
61
+ });
62
+ // Confirms getFileDiff returns an empty string when no git diff fragments exist.
63
+ (0, _nodetest.default)('getFileDiff returns empty string when git output is empty', ()=>{
64
+ const service = new _unittestgeneratorservice.UnitTestGeneratorService(stubLlm);
65
+ service['execGit'] = ()=>'';
66
+ const diff = service['getFileDiff']('main', 'src/index.ts');
67
+ _strict.default.strictEqual(diff, '');
68
+ });
69
+ // Confirms getFileDiff truncates overly long diffs and appends a truncation notice.
70
+ (0, _nodetest.default)('getFileDiff truncates long git diffs and adds a notice', ()=>{
71
+ const service = new _unittestgeneratorservice.UnitTestGeneratorService(stubLlm);
72
+ const huge = 'x'.repeat(9000);
73
+ service['execGit'] = (command)=>command.includes('--cached') ? '' : huge;
74
+ const diff = service['getFileDiff']('main', 'src/index.ts', 8000);
75
+ _strict.default.strictEqual(diff, 'x'.repeat(8000) + '\n... (diff truncated)');
76
+ });
77
+ // Ensures detectTestFramework picks the highest-priority framework listed in package metadata.
78
+ (0, _nodetest.default)('detectTestFramework prefers vitest before other frameworks', ()=>{
79
+ const service = new _unittestgeneratorservice.UnitTestGeneratorService(stubLlm);
80
+ const tempDir = (0, _nodefs.mkdtempSync)((0, _nodepath.join)((0, _nodeos.tmpdir)(), 'pkg-'));
81
+ const originalCwd = process.cwd();
82
+ try {
83
+ process.chdir(tempDir);
84
+ (0, _nodefs.writeFileSync)((0, _nodepath.join)(tempDir, 'package.json'), JSON.stringify({
85
+ dependencies: {
86
+ mocha: '1.0.0'
87
+ },
88
+ devDependencies: {
89
+ vitest: '1.0.0',
90
+ jest: '1.0.0'
91
+ }
92
+ }));
93
+ _strict.default.strictEqual(service.detectTestFramework(), 'vitest');
94
+ } finally{
95
+ process.chdir(originalCwd);
96
+ (0, _nodefs.rmSync)(tempDir, {
97
+ recursive: true,
98
+ force: true
99
+ });
100
+ }
101
+ });
102
+ // Ensures detectTestFramework falls back to the node:test default when package metadata cannot be read.
103
+ (0, _nodetest.default)('detectTestFramework falls back to node:test if package.json is missing', ()=>{
104
+ const service = new _unittestgeneratorservice.UnitTestGeneratorService(stubLlm);
105
+ const tempDir = (0, _nodefs.mkdtempSync)((0, _nodepath.join)((0, _nodeos.tmpdir)(), 'pkg-'));
106
+ const originalCwd = process.cwd();
107
+ try {
108
+ process.chdir(tempDir);
109
+ _strict.default.strictEqual(service.detectTestFramework(), 'node:test');
110
+ } finally{
111
+ process.chdir(originalCwd);
112
+ (0, _nodefs.rmSync)(tempDir, {
113
+ recursive: true,
114
+ force: true
115
+ });
116
+ }
117
+ });
118
+
119
+ //# sourceMappingURL=unit-test-generator.service.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/modules/git/services/unit-test-generator.service.spec.ts"],"sourcesContent":["import assert from 'node:assert/strict';\nimport test from 'node:test';\nimport { mkdtempSync, writeFileSync, rmSync } from 'node:fs';\nimport { tmpdir } from 'node:os';\nimport { join } from 'node:path';\nimport { UnitTestGeneratorService } from './unit-test-generator.service';\nimport type { MultiLlmService } from '../../../common/services/multi-llm.service';\n\nconst stubLlm = {} as MultiLlmService;\n\n// Ensures the constructor retains the provided multi-LLM service reference for dependency injection.\ntest('constructor stores the provided LLM dependency', () => {\n const service = new UnitTestGeneratorService(stubLlm);\n assert.strictEqual(service['multiLlmService'], stubLlm);\n});\n\n// Validates that filterRelevantFiles excludes test artifacts and non-source files while keeping production sources.\ntest('filterRelevantFiles excludes tests and outputs only source files', () => {\n const service = new UnitTestGeneratorService(stubLlm);\n const files = [\n 'src/app/main.ts',\n 'src/app/main.spec.ts',\n 'lib/utils.js',\n 'tests/test_helper.ts',\n 'dist/bundle.js',\n 'node_modules/dep/index.ts',\n 'scripts/build.ts',\n 'src/utils/helper.jsx',\n 'src/utils/helper.test.jsx',\n 'server/module.py',\n 'server/module_test.py',\n 'src/test/support.ts',\n ];\n const relevant = service['filterRelevantFiles'](files);\n assert.deepStrictEqual(relevant, ['src/app/main.ts', 'lib/utils.js', 'scripts/build.ts', 'src/utils/helper.jsx', 'server/module.py']);\n});\n\n// Verifies resolveTestPath normalizes extensions for JavaScript, Python, and Java sources to their expected test locations.\ntest('resolveTestPath returns expected test paths for supported languages', () => {\n const service = new UnitTestGeneratorService(stubLlm);\n const jsPath = service['resolveTestPath']('src/modules/git/service.ts', 'javascript');\n const jsxPath = service['resolveTestPath']('src/components/Widget.jsx', 'javascript');\n const pythonPath = service['resolveTestPath']('src/helpers/transform.py', 'python');\n const javaMainPath = service['resolveTestPath']('src/main/java/com/example/App.java', 'java');\n const javaPlainPath = service['resolveTestPath']('lib/Legacy.java', 'java');\n\n assert.strictEqual(jsPath, 'src/modules/git/service.spec.ts');\n assert.strictEqual(jsxPath, 'src/components/Widget.spec.ts');\n assert.strictEqual(pythonPath, 'tests/test_transform.py');\n assert.strictEqual(javaMainPath, 'src/test/java/com/example/AppTest.java');\n assert.strictEqual(javaPlainPath, 'lib/LegacyTest.java');\n});\n\n// Confirms getFileDiff returns an empty string when no git diff fragments exist.\ntest('getFileDiff returns empty string when git output is empty', () => {\n const service = new UnitTestGeneratorService(stubLlm);\n service['execGit'] = () => '';\n const diff = service['getFileDiff']('main', 'src/index.ts');\n assert.strictEqual(diff, '');\n});\n\n// Confirms getFileDiff truncates overly long diffs and appends a truncation notice.\ntest('getFileDiff truncates long git diffs and adds a notice', () => {\n const service = new UnitTestGeneratorService(stubLlm);\n const huge = 'x'.repeat(9000);\n service['execGit'] = (command: string) => (command.includes('--cached') ? '' : huge);\n const diff = service['getFileDiff']('main', 'src/index.ts', 8000);\n assert.strictEqual(diff, 'x'.repeat(8000) + '\\n... (diff truncated)');\n});\n\n// Ensures detectTestFramework picks the highest-priority framework listed in package metadata.\ntest('detectTestFramework prefers vitest before other frameworks', () => {\n const service = new UnitTestGeneratorService(stubLlm);\n const tempDir = mkdtempSync(join(tmpdir(), 'pkg-'));\n const originalCwd = process.cwd();\n try {\n process.chdir(tempDir);\n writeFileSync(\n join(tempDir, 'package.json'),\n JSON.stringify({ dependencies: { mocha: '1.0.0' }, devDependencies: { vitest: '1.0.0', jest: '1.0.0' } }),\n );\n assert.strictEqual(service.detectTestFramework(), 'vitest');\n } finally {\n process.chdir(originalCwd);\n rmSync(tempDir, { recursive: true, force: true });\n }\n});\n\n// Ensures detectTestFramework falls back to the node:test default when package metadata cannot be read.\ntest('detectTestFramework falls back to node:test if package.json is missing', () => {\n const service = new UnitTestGeneratorService(stubLlm);\n const tempDir = mkdtempSync(join(tmpdir(), 'pkg-'));\n const originalCwd = process.cwd();\n try {\n process.chdir(tempDir);\n assert.strictEqual(service.detectTestFramework(), 'node:test');\n } finally {\n process.chdir(originalCwd);\n rmSync(tempDir, { recursive: true, force: true });\n }\n});\n"],"names":["stubLlm","test","service","UnitTestGeneratorService","assert","strictEqual","files","relevant","deepStrictEqual","jsPath","jsxPath","pythonPath","javaMainPath","javaPlainPath","diff","huge","repeat","command","includes","tempDir","mkdtempSync","join","tmpdir","originalCwd","process","cwd","chdir","writeFileSync","JSON","stringify","dependencies","mocha","devDependencies","vitest","jest","detectTestFramework","rmSync","recursive","force"],"mappings":";;;;+DAAmB;iEACF;wBACkC;wBAC5B;0BACF;0CACoB;;;;;;AAGzC,MAAMA,UAAU,CAAC;AAEjB,qGAAqG;AACrGC,IAAAA,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iC,mBAAmB,IAAI;IACpD,SAAU;QACRX,QAAQE,KAAK,CAACH;QACda,IAAAA,cAAM,EAACjB,SAAS;YAAEkB,WAAW;YAAMC,OAAO;QAAK;IACjD;AACF"}
@@ -15,6 +15,7 @@ const _monorepodetectorservice = require("../../../git/services/monorepo-detecto
15
15
  const _prgeneratorservice = require("../../../git/services/pr-generator.service");
16
16
  const _codereviewservice = require("../../../git/services/code-review.service");
17
17
  const _releasenotesservice = require("../../../git/services/release-notes.service");
18
+ const _unittestgeneratorservice = require("../../../git/services/unit-test-generator.service");
18
19
  function _ts_decorate(decorators, target, key, desc) {
19
20
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
20
21
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -477,12 +478,105 @@ let GitCommandsService = class GitCommandsService {
477
478
  w(`${_theme.Colors.red} βœ— Failed: ${result.error}${_theme.Colors.reset}\r\n\r\n`);
478
479
  }
479
480
  }
480
- constructor(commitGenerator, monorepoDetector, prGenerator, codeReviewService, releaseNotesService){
481
+ async cmdUnitTest(smartInput) {
482
+ const w = (s)=>process.stdout.write(s);
483
+ const detectedBase = this.unitTestGenerator.detectDefaultBaseBranch();
484
+ const baseInput = await smartInput.question((0, _theme.colorize)(` Base branch (default: ${detectedBase}): `, 'cyan'));
485
+ const baseBranch = baseInput.trim() || detectedBase;
486
+ w(`\r\n${_theme.Colors.cyan}πŸ” Analyzing branch changes...${_theme.Colors.reset}\r\n`);
487
+ const changedFiles = this.unitTestGenerator.getChangedFiles(baseBranch);
488
+ if (changedFiles.length === 0) {
489
+ w(`${_theme.Colors.yellow} No changes found between HEAD and ${baseBranch}${_theme.Colors.reset}\r\n\r\n`);
490
+ return;
491
+ }
492
+ w(`\r\n${_theme.Colors.cyan}πŸ€– Generating unit tests...${_theme.Colors.reset}\r\n`);
493
+ const frames = [
494
+ '◐',
495
+ 'β—“',
496
+ 'β—‘',
497
+ 'β—’'
498
+ ];
499
+ let frame = 0;
500
+ let progressText = 'Starting...';
501
+ const spinner = setInterval(()=>{
502
+ const icon = frames[frame++ % frames.length];
503
+ w(`\r ${(0, _theme.colorize)(icon, 'cyan')} ${(0, _theme.colorize)(progressText, 'muted')}`);
504
+ }, 90);
505
+ let result;
506
+ try {
507
+ result = await this.unitTestGenerator.generateUnitTests(baseBranch, ({ current, total, sourcePath })=>{
508
+ const shortPath = sourcePath.length > 64 ? `...${sourcePath.slice(-61)}` : sourcePath;
509
+ progressText = `[${current}/${total}] ${shortPath}`;
510
+ });
511
+ } catch (error) {
512
+ const message = error?.message || 'unknown error';
513
+ clearInterval(spinner);
514
+ w('\r\x1b[K');
515
+ w(`${_theme.Colors.red} Failed to generate unit tests: ${message}${_theme.Colors.reset}\r\n\r\n`);
516
+ return;
517
+ } finally{
518
+ clearInterval(spinner);
519
+ w('\r\x1b[K');
520
+ }
521
+ if (!result.files.length) {
522
+ w(`${_theme.Colors.yellow} No unit tests generated${_theme.Colors.reset}\r\n`);
523
+ if (result.notes.length > 0) {
524
+ for (const note of result.notes){
525
+ w(` ${(0, _theme.colorize)(note, 'muted')}\r\n`);
526
+ }
527
+ }
528
+ w('\r\n');
529
+ return;
530
+ }
531
+ w(`\r\n${_theme.Colors.green}βœ“ Generated ${result.files.length} test file(s)${_theme.Colors.reset}\r\n`);
532
+ for (const file of result.files){
533
+ const reason = file.reason ? ` - ${file.reason}` : '';
534
+ w(` ${(0, _theme.colorize)(file.path, 'cyan')}${(0, _theme.colorize)(reason, 'muted')}\r\n`);
535
+ }
536
+ if (result.notes.length > 0) {
537
+ w(`\r\n${(0, _theme.colorize)('Coverage notes:', 'bold')}\r\n`);
538
+ for (const note of result.notes){
539
+ w(` ${(0, _theme.colorize)('- ' + note, 'muted')}\r\n`);
540
+ }
541
+ }
542
+ const confirm = await smartInput.askChoice('Write unit tests to disk?', [
543
+ {
544
+ key: 'y',
545
+ label: 'yes',
546
+ description: 'Create and update test files'
547
+ },
548
+ {
549
+ key: 'n',
550
+ label: 'no',
551
+ description: 'Cancel'
552
+ }
553
+ ]);
554
+ if (confirm === 'n') {
555
+ w((0, _theme.colorize)(' Cancelled\r\n\r\n', 'muted'));
556
+ return;
557
+ }
558
+ const fs = require('fs');
559
+ const path = require('path');
560
+ let written = 0;
561
+ for (const file of result.files){
562
+ try {
563
+ const dir = path.dirname(file.path);
564
+ fs.mkdirSync(dir, {
565
+ recursive: true
566
+ });
567
+ fs.writeFileSync(file.path, file.content + '\n', 'utf-8');
568
+ written++;
569
+ } catch {}
570
+ }
571
+ w(`\r\n${_theme.Colors.green}βœ“ Wrote ${written} test file(s)${_theme.Colors.reset}\r\n\r\n`);
572
+ }
573
+ constructor(commitGenerator, monorepoDetector, prGenerator, codeReviewService, releaseNotesService, unitTestGenerator){
481
574
  this.commitGenerator = commitGenerator;
482
575
  this.monorepoDetector = monorepoDetector;
483
576
  this.prGenerator = prGenerator;
484
577
  this.codeReviewService = codeReviewService;
485
578
  this.releaseNotesService = releaseNotesService;
579
+ this.unitTestGenerator = unitTestGenerator;
486
580
  }
487
581
  };
488
582
  GitCommandsService = _ts_decorate([
@@ -493,7 +587,8 @@ GitCommandsService = _ts_decorate([
493
587
  typeof _monorepodetectorservice.MonorepoDetectorService === "undefined" ? Object : _monorepodetectorservice.MonorepoDetectorService,
494
588
  typeof _prgeneratorservice.PrGeneratorService === "undefined" ? Object : _prgeneratorservice.PrGeneratorService,
495
589
  typeof _codereviewservice.CodeReviewService === "undefined" ? Object : _codereviewservice.CodeReviewService,
496
- typeof _releasenotesservice.ReleaseNotesService === "undefined" ? Object : _releasenotesservice.ReleaseNotesService
590
+ typeof _releasenotesservice.ReleaseNotesService === "undefined" ? Object : _releasenotesservice.ReleaseNotesService,
591
+ typeof _unittestgeneratorservice.UnitTestGeneratorService === "undefined" ? Object : _unittestgeneratorservice.UnitTestGeneratorService
497
592
  ])
498
593
  ], GitCommandsService);
499
594
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/modules/repl/services/commands/git-commands.service.ts"],"sourcesContent":["import { Injectable } from '@nestjs/common';\nimport { Colors, colorize, Box, Icons } from '../../utils/theme';\nimport { CommitGeneratorService } from '../../../git/services/commit-generator.service';\nimport { MonorepoDetectorService } from '../../../git/services/monorepo-detector.service';\nimport { PrGeneratorService } from '../../../git/services/pr-generator.service';\nimport { CodeReviewService } from '../../../git/services/code-review.service';\nimport { ReleaseNotesService } from '../../../git/services/release-notes.service';\n\ninterface SmartInput {\n askChoice: (question: string, choices: { key: string; label: string; description: string }[]) => Promise<string>;\n question: (prompt: string) => Promise<string>;\n}\n\n@Injectable()\nexport class GitCommandsService {\n constructor(\n private readonly commitGenerator: CommitGeneratorService,\n private readonly monorepoDetector: MonorepoDetectorService,\n private readonly prGenerator: PrGeneratorService,\n private readonly codeReviewService: CodeReviewService,\n private readonly releaseNotesService: ReleaseNotesService,\n ) {}\n\n runGit(cmd: string): void {\n const { execSync } = require('child_process');\n try {\n const output = execSync(cmd, { encoding: 'utf-8', cwd: process.cwd() }).trim();\n process.stdout.write(output ? `\\r\\n${output}\\r\\n\\r\\n` : ` ${colorize('(no output)', 'muted')}\\r\\n`);\n } catch (e) {\n process.stdout.write(`${Colors.red} ${(e as Error).message}${Colors.reset}\\r\\n`);\n }\n }\n\n async cmdCommit(args: string[], smartInput: SmartInput): Promise<void> {\n const msg = args.join(' ');\n if (!msg) {\n await this.generateAndCommit(smartInput);\n } else {\n const { execSync } = require('child_process');\n try {\n execSync('git add -A', { cwd: process.cwd() });\n execSync('git commit -F -', { cwd: process.cwd(), input: `${msg}\\n`, encoding: 'utf-8' });\n } catch {}\n }\n }\n\n private async generateAndCommit(smartInput: SmartInput): Promise<void> {\n const w = (s: string) => process.stdout.write(s);\n\n if (!this.commitGenerator.hasChanges()) {\n w(`${Colors.yellow} No changes to commit${Colors.reset}\\r\\n\\r\\n`);\n return;\n }\n\n w(`\\r\\n${Colors.cyan}πŸ€– Analyzing changes...${Colors.reset}\\r\\n`);\n\n const message = await this.commitGenerator.generateCommitMessage();\n if (!message) {\n w(`${Colors.red} Failed to generate commit message${Colors.reset}\\r\\n\\r\\n`);\n return;\n }\n\n w(`\\r\\n${Colors.green}βœ“ Generated:${Colors.reset} ${colorize(message, 'cyan')}\\r\\n\\r\\n`);\n\n const confirm = await smartInput.askChoice('Commit?', [\n { key: 'y', label: 'yes', description: 'Commit with this message' },\n { key: 'n', label: 'no', description: 'Cancel' },\n { key: 'e', label: 'edit', description: 'Edit message' },\n ]);\n\n if (confirm === 'n') {\n w(colorize(' Cancelled\\r\\n\\r\\n', 'muted'));\n return;\n }\n\n let finalMessage = message;\n\n if (confirm === 'e') {\n const newMsg = await smartInput.question(colorize(' Message: ', 'cyan'));\n if (!newMsg.trim()) {\n w(colorize(' Cancelled\\r\\n\\r\\n', 'muted'));\n return;\n }\n finalMessage = newMsg.trim();\n }\n\n const success = this.commitGenerator.executeCommit(finalMessage);\n if (success) {\n w(`${Colors.green}βœ“ Committed${Colors.reset}\\r\\n\\r\\n`);\n } else {\n w(`${Colors.red}βœ— Commit failed${Colors.reset}\\r\\n\\r\\n`);\n }\n }\n\n async cmdUp(smartInput: SmartInput): Promise<void> {\n const w = (s: string) => process.stdout.write(s);\n\n if (!this.commitGenerator.hasChanges()) {\n w(`${Colors.yellow} No changes to commit${Colors.reset}\\r\\n\\r\\n`);\n return;\n }\n\n const monorepoInfo = this.monorepoDetector.detectMonorepo(process.cwd());\n if (monorepoInfo.isMonorepo) {\n w(`\\r\\n${colorize('Monorepo:', 'muted')} ${monorepoInfo.modules.join(', ')}\\r\\n`);\n }\n\n w(`\\r\\n${Colors.cyan}πŸ€– Analyzing changes...${Colors.reset}\\r\\n`);\n\n const message = await this.commitGenerator.generateCommitMessage();\n if (!message) {\n w(`${Colors.red} Failed to generate commit message${Colors.reset}\\r\\n\\r\\n`);\n return;\n }\n\n w(`\\r\\n${Colors.green}βœ“ Generated:${Colors.reset}\\r\\n ${colorize(message, 'cyan')}\\r\\n\\r\\n`);\n\n const confirm = await smartInput.askChoice('Confirm and push?', [\n { key: 'y', label: 'yes', description: 'Commit and push' },\n { key: 'n', label: 'no', description: 'Cancel' },\n { key: 'e', label: 'edit', description: 'Edit message' },\n ]);\n\n if (confirm === 'n') {\n w(colorize(' Cancelled\\r\\n\\r\\n', 'muted'));\n return;\n }\n\n let finalMessage = message;\n\n if (confirm === 'e') {\n const instructions = await smartInput.question(colorize(' Instructions for AI: ', 'cyan'));\n if (!instructions.trim()) {\n w(colorize(' Cancelled\\r\\n\\r\\n', 'muted'));\n return;\n }\n\n w(`\\r\\n${Colors.cyan}πŸ€– Regenerating...${Colors.reset}\\r\\n`);\n const diffInfo = this.commitGenerator.getDiffInfo();\n if (diffInfo) {\n const refined = await this.commitGenerator.refineCommitMessage(message, instructions.trim(), diffInfo);\n w(`\\r\\n${Colors.green}βœ“ Refined:${Colors.reset}\\r\\n ${colorize(refined, 'cyan')}\\r\\n\\r\\n`);\n\n const confirmRefined = await smartInput.askChoice('Use this?', [\n { key: 'y', label: 'yes', description: 'Commit and push' },\n { key: 'n', label: 'no', description: 'Cancel' },\n ]);\n\n if (confirmRefined === 'n') {\n w(colorize(' Cancelled\\r\\n\\r\\n', 'muted'));\n return;\n }\n finalMessage = refined;\n }\n }\n\n w(colorize(' Committing...\\r\\n', 'muted'));\n const commitSuccess = this.commitGenerator.executeCommit(finalMessage, true);\n if (!commitSuccess) {\n w(`${Colors.red} βœ— Commit failed${Colors.reset}\\r\\n\\r\\n`);\n return;\n }\n\n w(`${Colors.green} βœ“ Committed${Colors.reset}\\r\\n`);\n w(colorize(' Pushing...\\r\\n', 'muted'));\n\n const pushResult = this.commitGenerator.executePush();\n if (pushResult.success) {\n w(`${Colors.green} βœ“ Pushed${Colors.reset}\\r\\n\\r\\n`);\n } else {\n w(`${Colors.red} βœ— Push failed:${Colors.reset} ${pushResult.error}\\r\\n\\r\\n`);\n }\n }\n\n async cmdSplitUp(smartInput: SmartInput): Promise<void> {\n const w = (s: string) => process.stdout.write(s);\n\n if (!this.commitGenerator.hasChanges()) {\n w(`${Colors.yellow} No changes to commit${Colors.reset}\\r\\n\\r\\n`);\n return;\n }\n\n w(`\\r\\n${Colors.cyan}πŸ€– Analyzing for split...${Colors.reset}\\r\\n`);\n\n const proposedCommits = await this.commitGenerator.splitCommits();\n const commits = (proposedCommits || []).filter(c => c.files && c.files.length > 0);\n\n if (commits.length === 0) {\n w(`${Colors.red} Failed to split commits${Colors.reset}\\r\\n\\r\\n`);\n return;\n }\n\n w(`\\r\\n${Colors.green}βœ“ Proposed ${commits.length} commits:${Colors.reset}\\r\\n\\r\\n`);\n \n for (let i = 0; i < commits.length; i++) {\n const commit = commits[i];\n w(` ${colorize((i + 1).toString() + '.', 'cyan')} ${commit.message}\\r\\n`);\n w(` ${colorize('Files: ' + commit.files.join(', '), 'muted')}\\r\\n`);\n }\n\n w('\\r\\n');\n\n const confirm = await smartInput.askChoice('Execute these commits?', [\n { key: 'y', label: 'yes', description: `Commit all ${commits.length}` },\n { key: 'n', label: 'no', description: 'Cancel' },\n ]);\n\n if (confirm !== 'y') {\n w(colorize(' Cancelled\\r\\n\\r\\n', 'muted'));\n return;\n }\n\n w(colorize(' Executing...\\r\\n', 'muted'));\n const result = this.commitGenerator.executeSplitCommits(commits);\n\n if (result.success) {\n w(`${Colors.green} βœ“ ${result.committed} commits executed${Colors.reset}\\r\\n\\r\\n`);\n\n const { execSync } = require('child_process');\n try {\n const log = execSync(`git log --oneline -${result.committed}`, { cwd: process.cwd(), encoding: 'utf-8' });\n w(colorize(' Commits criados:\\r\\n', 'bold'));\n log.split('\\n').filter(l => l.trim()).forEach((line: string) => {\n w(` ${colorize(line, 'muted')}\\r\\n`);\n });\n w('\\r\\n');\n } catch {}\n\n w(colorize(' Pushing...\\r\\n', 'muted'));\n const pushResult = this.commitGenerator.executePush();\n\n if (pushResult.success) {\n w(`${Colors.green} βœ“ Pushed${Colors.reset}\\r\\n\\r\\n`);\n } else {\n w(`${Colors.red} βœ— Push failed:${Colors.reset} ${pushResult.error}\\r\\n\\r\\n`);\n }\n } else {\n w(`${Colors.red} βœ— Failed after ${result.committed} commit(s):${Colors.reset} ${result.error}\\r\\n`);\n\n if (result.originalHead && result.committed > 0) {\n w(`${colorize(' Rollback disponΓ­vel:', 'warning')}\\r\\n`);\n w(` ${colorize(`git reset --soft ${result.originalHead}`, 'cyan')}\\r\\n\\r\\n`);\n } else {\n w('\\r\\n');\n }\n }\n }\n\n async cmdPr(smartInput: SmartInput): Promise<void> {\n const w = (s: string) => process.stdout.write(s);\n\n const branch = this.prGenerator.getCurrentBranch();\n if (branch === 'main' || branch === 'master' || branch === 'develop') {\n w(`${Colors.yellow} Cannot create PR from ${branch} branch${Colors.reset}\\r\\n\\r\\n`);\n return;\n }\n\n const detectedBase = this.prGenerator.detectDefaultBaseBranch();\n const baseInput = await smartInput.question(colorize(` Base branch (default: ${detectedBase}): `, 'cyan'));\n const baseBranch = baseInput.trim() || detectedBase;\n\n w(`\\r\\n${Colors.cyan}πŸ” Analyzing commits...${Colors.reset}\\r\\n`);\n\n const commits = this.prGenerator.getCommitsNotInBase(baseBranch);\n if (commits.length === 0) {\n w(`${Colors.yellow} No commits found between ${branch} and ${baseBranch}${Colors.reset}\\r\\n\\r\\n`);\n return;\n }\n\n w(`\\r\\n${Colors.green}βœ“ Found ${commits.length} commit(s):${Colors.reset}\\r\\n`);\n for (const commit of commits) {\n w(` ${colorize(commit.hash.slice(0, 7), 'muted')} ${commit.message.slice(0, 50)}${commit.message.length > 50 ? '...' : ''}\\r\\n`);\n }\n\n w(`\\r\\n${Colors.cyan}πŸ€– Generating PR description...${Colors.reset}\\r\\n`);\n\n const prDescription = await this.prGenerator.generatePRDescription(branch, commits, baseBranch);\n\n w(`\\r\\n${colorize('─'.repeat(50), 'subtle')}\\r\\n`);\n w(colorize('Pull Request Preview:', 'bold') + '\\r\\n');\n w(colorize('─'.repeat(50), 'subtle') + '\\r\\n\\r\\n');\n w(`${colorize('Title:', 'bold')}\\r\\n ${colorize(prDescription.title, 'cyan')}\\r\\n\\r\\n`);\n \n const descLines = prDescription.description.split('\\n');\n for (const line of descLines.slice(0, 25)) {\n w(` ${line}\\r\\n`);\n }\n if (descLines.length > 25) {\n w(` ${colorize(`... (${descLines.length - 25} more lines)`, 'muted')}\\r\\n`);\n }\n \n w(`\\r\\n${colorize('─'.repeat(50), 'subtle')}\\r\\n\\r\\n`);\n\n const confirm = await smartInput.askChoice('Create this PR?', [\n { key: 'y', label: 'yes', description: 'Create PR on GitHub' },\n { key: 'n', label: 'no', description: 'Cancel' },\n { key: 'e', label: 'edit', description: 'Edit title/description' },\n ]);\n\n if (confirm === 'n') {\n w(colorize(' Cancelled\\r\\n\\r\\n', 'muted'));\n return;\n }\n\n let finalTitle = prDescription.title;\n let finalDescription = prDescription.description;\n\n if (confirm === 'e') {\n const newTitle = await smartInput.question(colorize(' Title (empty to keep): ', 'cyan'));\n if (newTitle.trim()) {\n finalTitle = newTitle.trim();\n }\n\n const editDesc = await smartInput.askChoice('Edit description?', [\n { key: 'y', label: 'yes', description: 'Open in editor' },\n { key: 'n', label: 'no', description: 'Keep as is' },\n ]);\n\n if (editDesc === 'y') {\n const fs = require('fs');\n const { execSync } = require('child_process');\n const tempFile = `/tmp/pr-desc-${Date.now()}.md`;\n fs.writeFileSync(tempFile, finalDescription);\n \n const editor = process.env.EDITOR || 'nano';\n try {\n execSync(`${editor} \"${tempFile}\"`, { stdio: 'inherit' });\n finalDescription = fs.readFileSync(tempFile, 'utf-8');\n } catch {\n w(colorize(' Could not open editor\\r\\n', 'yellow'));\n } finally {\n try { fs.unlinkSync(tempFile); } catch {}\n }\n }\n }\n\n const { platform } = this.prGenerator.detectPlatform();\n \n if (platform === 'github') {\n try {\n const { execSync } = require('child_process');\n execSync(`git push origin ${branch}`, { cwd: process.cwd() });\n } catch {}\n }\n\n const result = await this.prGenerator.createPR(finalTitle, finalDescription, baseBranch);\n\n if (result.success && result.url) {\n w(`\\r\\n${Colors.green}βœ“ Pull Request created!${Colors.reset}\\r\\n`);\n w(` ${colorize(result.url, 'cyan')}\\r\\n\\r\\n`);\n } else {\n if (result.description) {\n const copied = this.prGenerator.copyToClipboard(result.description);\n w(`\\r\\n${colorize('PR Description:', 'bold')}\\r\\n`);\n w(colorize('─'.repeat(50), 'subtle') + '\\r\\n');\n w(result.description.split('\\n').slice(0, 30).join('\\r\\n') + '\\r\\n');\n w(colorize('─'.repeat(50), 'subtle') + '\\r\\n\\r\\n');\n \n if (copied) {\n w(`${colorize('βœ“', 'success')} Copied to clipboard\\r\\n`);\n }\n\n const createUrl = this.prGenerator.getPRCreateUrl(platform, baseBranch);\n if (createUrl) {\n w(`\\r\\n ${colorize('Open to create PR:', 'muted')}\\r\\n`);\n w(` ${colorize(createUrl, 'cyan')}\\r\\n`);\n }\n }\n w('\\r\\n');\n }\n }\n\n async cmdReview(args: string[]): Promise<void> {\n const w = (s: string) => process.stdout.write(s);\n\n let files: string[] = [];\n \n if (args.length > 0) {\n files = args.filter(a => !a.startsWith('/'));\n } else {\n w(`\\r\\n${Colors.cyan}πŸ” Analyzing staged files...${Colors.reset}\\r\\n`);\n files = this.codeReviewService['getChangedFiles'](true);\n }\n\n if (files.length === 0) {\n w(`${Colors.yellow} No files to review${Colors.reset}\\r\\n\\r\\n`);\n return;\n }\n\n w(`\\r\\n${Colors.cyan}πŸ€– Reviewing ${files.length} file(s)...${Colors.reset}\\r\\n`);\n\n const results = await this.codeReviewService.reviewFiles(files);\n\n let totalIssues = 0;\n let totalScore = 0;\n\n for (const result of results) {\n totalScore += result.score;\n const errors = result.issues.filter(i => i.severity === 'error').length;\n const warnings = result.issues.filter(i => i.severity === 'warning').length;\n const suggestions = result.issues.filter(i => i.severity === 'suggestion').length;\n totalIssues += result.issues.length;\n\n const scoreColor = result.score >= 80 ? 'success' : result.score >= 60 ? 'warning' : 'error';\n \n w(`\\r\\n${colorize(result.file, 'bold')} ${colorize(result.score + '/100', scoreColor)}\\r\\n`);\n w(` ${colorize(result.summary, 'muted')}\\r\\n`);\n\n if (errors > 0) w(` ${colorize('βœ— ' + errors + ' errors', 'error')} `);\n if (warnings > 0) w(`${colorize('⚠ ' + warnings + ' warnings', 'warning')} `);\n if (suggestions > 0) w(`${colorize('πŸ’‘ ' + suggestions + ' suggestions', 'muted')}`);\n if (errors > 0 || warnings > 0 || suggestions > 0) w('\\r\\n');\n\n const topIssues = result.issues.filter(i => i.severity !== 'praise').slice(0, 3);\n for (const issue of topIssues) {\n const icon = issue.severity === 'error' ? 'βœ—' : issue.severity === 'warning' ? '⚠' : 'πŸ’‘';\n const color = issue.severity === 'error' ? 'error' : issue.severity === 'warning' ? 'warning' : 'muted';\n const line = issue.line ? colorize(':' + issue.line, 'muted') : '';\n w(` ${colorize(icon, color)} ${issue.message}${line}\\r\\n`);\n }\n\n if (result.issues.length > 3) {\n w(` ${colorize('... and ' + (result.issues.length - 3) + ' more', 'muted')}\\r\\n`);\n }\n }\n\n const avgScore = Math.round(totalScore / results.length);\n const avgColor = avgScore >= 80 ? 'success' : avgScore >= 60 ? 'warning' : 'error';\n \n w(`\\r\\n${colorize('Summary:', 'bold')} ${colorize(avgScore + '/100', avgColor)} | ${totalIssues} issue(s)\\r\\n\\r\\n`);\n }\n\n async cmdFix(args: string[]): Promise<void> {\n const w = (s: string) => process.stdout.write(s);\n\n if (args.length === 0) {\n w(`${Colors.yellow} Usage: /fix <file>${Colors.reset}\\r\\n\\r\\n`);\n return;\n }\n\n const filePath = args[0];\n w(`\\r\\n${Colors.cyan}πŸ”§ Fixing ${filePath}...${Colors.reset}\\r\\n`);\n\n const result = await this.codeReviewService.fixFile(filePath);\n\n if (result.success) {\n w(`${Colors.green} βœ“ File fixed${Colors.reset}\\r\\n\\r\\n`);\n } else {\n w(`${Colors.red} βœ— Failed: ${result.error}${Colors.reset}\\r\\n\\r\\n`);\n }\n }\n\n async cmdIdent(): Promise<void> {\n const w = (s: string) => process.stdout.write(s);\n w(`\\r\\n${Colors.cyan}🎨 Formatting code files...${Colors.reset}\\r\\n`);\n\n const result = await this.codeReviewService.indentAll();\n\n w(`${Colors.green} βœ“ ${result.success} file(s) formatted${Colors.reset}\\r\\n`);\n if (result.failed > 0) {\n w(`${Colors.yellow} ⚠ ${result.failed} file(s) failed${Colors.reset}\\r\\n`);\n }\n w('\\r\\n');\n }\n\n async cmdRelease(args: string[]): Promise<void> {\n const w = (s: string) => process.stdout.write(s);\n const sinceTag = args[0];\n\n w(`\\r\\n${Colors.cyan}πŸ“ Generating release notes...${Colors.reset}\\r\\n`);\n\n const result = await this.releaseNotesService.generateReleaseNotes(sinceTag);\n\n if (result.success && result.filePath) {\n w(`${Colors.green} βœ“ Release notes generated!${Colors.reset}\\r\\n`);\n w(` ${colorize(result.filePath, 'accent')}\\r\\n\\r\\n`);\n\n if (result.content) {\n w(`${colorize('Preview:', 'bold')}\\r\\n`);\n const lines = result.content.split('\\n').slice(0, 15);\n for (const line of lines) {\n w(` ${line}\\r\\n`);\n }\n if (result.content.split('\\n').length > 15) {\n w(` ${colorize('...', 'muted')}\\r\\n`);\n }\n w('\\r\\n');\n }\n } else {\n w(`${Colors.red} βœ— Failed: ${result.error}${Colors.reset}\\r\\n\\r\\n`);\n }\n }\n}\n"],"names":["GitCommandsService","runGit","cmd","execSync","require","output","encoding","cwd","process","trim","stdout","write","colorize","e","Colors","red","message","reset","cmdCommit","args","smartInput","msg","join","generateAndCommit","input","w","s","commitGenerator","hasChanges","yellow","cyan","generateCommitMessage","green","confirm","askChoice","key","label","description","finalMessage","newMsg","question","success","executeCommit","cmdUp","monorepoInfo","monorepoDetector","detectMonorepo","isMonorepo","modules","instructions","diffInfo","getDiffInfo","refined","refineCommitMessage","confirmRefined","commitSuccess","pushResult","executePush","error","cmdSplitUp","proposedCommits","splitCommits","commits","filter","c","files","length","i","commit","toString","result","executeSplitCommits","committed","log","split","l","forEach","line","originalHead","cmdPr","branch","prGenerator","getCurrentBranch","detectedBase","detectDefaultBaseBranch","baseInput","baseBranch","getCommitsNotInBase","hash","slice","prDescription","generatePRDescription","repeat","title","descLines","finalTitle","finalDescription","newTitle","editDesc","fs","tempFile","Date","now","writeFileSync","editor","env","EDITOR","stdio","readFileSync","unlinkSync","platform","detectPlatform","createPR","url","copied","copyToClipboard","createUrl","getPRCreateUrl","cmdReview","a","startsWith","codeReviewService","results","reviewFiles","totalIssues","totalScore","score","errors","issues","severity","warnings","suggestions","scoreColor","file","summary","topIssues","issue","icon","color","avgScore","Math","round","avgColor","cmdFix","filePath","fixFile","cmdIdent","indentAll","failed","cmdRelease","sinceTag","releaseNotesService","generateReleaseNotes","content","lines"],"mappings":";;;;+BAcaA;;;eAAAA;;;wBAdc;uBACkB;wCACN;yCACC;oCACL;mCACD;qCACE;;;;;;;;;;AAQ7B,IAAA,AAAMA,qBAAN,MAAMA;IASXC,OAAOC,GAAW,EAAQ;QACxB,MAAM,EAAEC,QAAQ,EAAE,GAAGC,QAAQ;QAC7B,IAAI;YACF,MAAMC,SAASF,SAASD,KAAK;gBAAEI,UAAU;gBAASC,KAAKC,QAAQD,GAAG;YAAG,GAAGE,IAAI;YAC5ED,QAAQE,MAAM,CAACC,KAAK,CAACN,SAAS,CAAC,IAAI,EAAEA,OAAO,QAAQ,CAAC,GAAG,CAAC,EAAE,EAAEO,IAAAA,eAAQ,EAAC,eAAe,SAAS,IAAI,CAAC;QACrG,EAAE,OAAOC,GAAG;YACVL,QAAQE,MAAM,CAACC,KAAK,CAAC,GAAGG,aAAM,CAACC,GAAG,CAAC,EAAE,EAAE,AAACF,EAAYG,OAAO,GAAGF,aAAM,CAACG,KAAK,CAAC,IAAI,CAAC;QAClF;IACF;IAEA,MAAMC,UAAUC,IAAc,EAAEC,UAAsB,EAAiB;QACrE,MAAMC,MAAMF,KAAKG,IAAI,CAAC;QACtB,IAAI,CAACD,KAAK;YACR,MAAM,IAAI,CAACE,iBAAiB,CAACH;QAC/B,OAAO;YACL,MAAM,EAAEjB,QAAQ,EAAE,GAAGC,QAA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AI,CAAC;gBACvC;gBACAa,EAAE;YACJ;QACF,OAAO;YACLA,EAAE,GAAGX,aAAM,CAACC,GAAG,CAAC,YAAY,EAAEuD,OAAOZ,KAAK,GAAG5C,aAAM,CAACG,KAAK,CAAC,QAAQ,CAAC;QACrE;IACF;IA5dA,YACE,AAAiBU,eAAuC,EACxD,AAAiBkB,gBAAyC,EAC1D,AAAiBoC,WAA+B,EAChD,AAAiBwC,iBAAoC,EACrD,AAAiB8B,mBAAwC,CACzD;aALiB5H,kBAAAA;aACAkB,mBAAAA;aACAoC,cAAAA;aACAwC,oBAAAA;aACA8B,sBAAAA;IAChB;AAudL"}
1
+ {"version":3,"sources":["../../../../../src/modules/repl/services/commands/git-commands.service.ts"],"sourcesContent":["import { Injectable } from '@nestjs/common';\nimport { Colors, colorize, Box, Icons } from '../../utils/theme';\nimport { CommitGeneratorService } from '../../../git/services/commit-generator.service';\nimport { MonorepoDetectorService } from '../../../git/services/monorepo-detector.service';\nimport { PrGeneratorService } from '../../../git/services/pr-generator.service';\nimport { CodeReviewService } from '../../../git/services/code-review.service';\nimport { ReleaseNotesService } from '../../../git/services/release-notes.service';\nimport { UnitTestGeneratorService } from '../../../git/services/unit-test-generator.service';\n\ninterface SmartInput {\n askChoice: (question: string, choices: { key: string; label: string; description: string }[]) => Promise<string>;\n question: (prompt: string) => Promise<string>;\n}\n\n@Injectable()\nexport class GitCommandsService {\n constructor(\n private readonly commitGenerator: CommitGeneratorService,\n private readonly monorepoDetector: MonorepoDetectorService,\n private readonly prGenerator: PrGeneratorService,\n private readonly codeReviewService: CodeReviewService,\n private readonly releaseNotesService: ReleaseNotesService,\n private readonly unitTestGenerator: UnitTestGeneratorService,\n ) {}\n\n runGit(cmd: string): void {\n const { execSync } = require('child_process');\n try {\n const output = execSync(cmd, { encoding: 'utf-8', cwd: process.cwd() }).trim();\n process.stdout.write(output ? `\\r\\n${output}\\r\\n\\r\\n` : ` ${colorize('(no output)', 'muted')}\\r\\n`);\n } catch (e) {\n process.stdout.write(`${Colors.red} ${(e as Error).message}${Colors.reset}\\r\\n`);\n }\n }\n\n async cmdCommit(args: string[], smartInput: SmartInput): Promise<void> {\n const msg = args.join(' ');\n if (!msg) {\n await this.generateAndCommit(smartInput);\n } else {\n const { execSync } = require('child_process');\n try {\n execSync('git add -A', { cwd: process.cwd() });\n execSync('git commit -F -', { cwd: process.cwd(), input: `${msg}\\n`, encoding: 'utf-8' });\n } catch {}\n }\n }\n\n private async generateAndCommit(smartInput: SmartInput): Promise<void> {\n const w = (s: string) => process.stdout.write(s);\n\n if (!this.commitGenerator.hasChanges()) {\n w(`${Colors.yellow} No changes to commit${Colors.reset}\\r\\n\\r\\n`);\n return;\n }\n\n w(`\\r\\n${Colors.cyan}πŸ€– Analyzing changes...${Colors.reset}\\r\\n`);\n\n const message = await this.commitGenerator.generateCommitMessage();\n if (!message) {\n w(`${Colors.red} Failed to generate commit message${Colors.reset}\\r\\n\\r\\n`);\n return;\n }\n\n w(`\\r\\n${Colors.green}βœ“ Generated:${Colors.reset} ${colorize(message, 'cyan')}\\r\\n\\r\\n`);\n\n const confirm = await smartInput.askChoice('Commit?', [\n { key: 'y', label: 'yes', description: 'Commit with this message' },\n { key: 'n', label: 'no', description: 'Cancel' },\n { key: 'e', label: 'edit', description: 'Edit message' },\n ]);\n\n if (confirm === 'n') {\n w(colorize(' Cancelled\\r\\n\\r\\n', 'muted'));\n return;\n }\n\n let finalMessage = message;\n\n if (confirm === 'e') {\n const newMsg = await smartInput.question(colorize(' Message: ', 'cyan'));\n if (!newMsg.trim()) {\n w(colorize(' Cancelled\\r\\n\\r\\n', 'muted'));\n return;\n }\n finalMessage = newMsg.trim();\n }\n\n const success = this.commitGenerator.executeCommit(finalMessage);\n if (success) {\n w(`${Colors.green}βœ“ Committed${Colors.reset}\\r\\n\\r\\n`);\n } else {\n w(`${Colors.red}βœ— Commit failed${Colors.reset}\\r\\n\\r\\n`);\n }\n }\n\n async cmdUp(smartInput: SmartInput): Promise<void> {\n const w = (s: string) => process.stdout.write(s);\n\n if (!this.commitGenerator.hasChanges()) {\n w(`${Colors.yellow} No changes to commit${Colors.reset}\\r\\n\\r\\n`);\n return;\n }\n\n const monorepoInfo = this.monorepoDetector.detectMonorepo(process.cwd());\n if (monorepoInfo.isMonorepo) {\n w(`\\r\\n${colorize('Monorepo:', 'muted')} ${monorepoInfo.modules.join(', ')}\\r\\n`);\n }\n\n w(`\\r\\n${Colors.cyan}πŸ€– Analyzing changes...${Colors.reset}\\r\\n`);\n\n const message = await this.commitGenerator.generateCommitMessage();\n if (!message) {\n w(`${Colors.red} Failed to generate commit message${Colors.reset}\\r\\n\\r\\n`);\n return;\n }\n\n w(`\\r\\n${Colors.green}βœ“ Generated:${Colors.reset}\\r\\n ${colorize(message, 'cyan')}\\r\\n\\r\\n`);\n\n const confirm = await smartInput.askChoice('Confirm and push?', [\n { key: 'y', label: 'yes', description: 'Commit and push' },\n { key: 'n', label: 'no', description: 'Cancel' },\n { key: 'e', label: 'edit', description: 'Edit message' },\n ]);\n\n if (confirm === 'n') {\n w(colorize(' Cancelled\\r\\n\\r\\n', 'muted'));\n return;\n }\n\n let finalMessage = message;\n\n if (confirm === 'e') {\n const instructions = await smartInput.question(colorize(' Instructions for AI: ', 'cyan'));\n if (!instructions.trim()) {\n w(colorize(' Cancelled\\r\\n\\r\\n', 'muted'));\n return;\n }\n\n w(`\\r\\n${Colors.cyan}πŸ€– Regenerating...${Colors.reset}\\r\\n`);\n const diffInfo = this.commitGenerator.getDiffInfo();\n if (diffInfo) {\n const refined = await this.commitGenerator.refineCommitMessage(message, instructions.trim(), diffInfo);\n w(`\\r\\n${Colors.green}βœ“ Refined:${Colors.reset}\\r\\n ${colorize(refined, 'cyan')}\\r\\n\\r\\n`);\n\n const confirmRefined = await smartInput.askChoice('Use this?', [\n { key: 'y', label: 'yes', description: 'Commit and push' },\n { key: 'n', label: 'no', description: 'Cancel' },\n ]);\n\n if (confirmRefined === 'n') {\n w(colorize(' Cancelled\\r\\n\\r\\n', 'muted'));\n return;\n }\n finalMessage = refined;\n }\n }\n\n w(colorize(' Committing...\\r\\n', 'muted'));\n const commitSuccess = this.commitGenerator.executeCommit(finalMessage, true);\n if (!commitSuccess) {\n w(`${Colors.red} βœ— Commit failed${Colors.reset}\\r\\n\\r\\n`);\n return;\n }\n\n w(`${Colors.green} βœ“ Committed${Colors.reset}\\r\\n`);\n w(colorize(' Pushing...\\r\\n', 'muted'));\n\n const pushResult = this.commitGenerator.executePush();\n if (pushResult.success) {\n w(`${Colors.green} βœ“ Pushed${Colors.reset}\\r\\n\\r\\n`);\n } else {\n w(`${Colors.red} βœ— Push failed:${Colors.reset} ${pushResult.error}\\r\\n\\r\\n`);\n }\n }\n\n async cmdSplitUp(smartInput: SmartInput): Promise<void> {\n const w = (s: string) => process.stdout.write(s);\n\n if (!this.commitGenerator.hasChanges()) {\n w(`${Colors.yellow} No changes to commit${Colors.reset}\\r\\n\\r\\n`);\n return;\n }\n\n w(`\\r\\n${Colors.cyan}πŸ€– Analyzing for split...${Colors.reset}\\r\\n`);\n\n const proposedCommits = await this.commitGenerator.splitCommits();\n const commits = (proposedCommits || []).filter(c => c.files && c.files.length > 0);\n\n if (commits.length === 0) {\n w(`${Colors.red} Failed to split commits${Colors.reset}\\r\\n\\r\\n`);\n return;\n }\n\n w(`\\r\\n${Colors.green}βœ“ Proposed ${commits.length} commits:${Colors.reset}\\r\\n\\r\\n`);\n \n for (let i = 0; i < commits.length; i++) {\n const commit = commits[i];\n w(` ${colorize((i + 1).toString() + '.', 'cyan')} ${commit.message}\\r\\n`);\n w(` ${colorize('Files: ' + commit.files.join(', '), 'muted')}\\r\\n`);\n }\n\n w('\\r\\n');\n\n const confirm = await smartInput.askChoice('Execute these commits?', [\n { key: 'y', label: 'yes', description: `Commit all ${commits.length}` },\n { key: 'n', label: 'no', description: 'Cancel' },\n ]);\n\n if (confirm !== 'y') {\n w(colorize(' Cancelled\\r\\n\\r\\n', 'muted'));\n return;\n }\n\n w(colorize(' Executing...\\r\\n', 'muted'));\n const result = this.commitGenerator.executeSplitCommits(commits);\n\n if (result.success) {\n w(`${Colors.green} βœ“ ${result.committed} commits executed${Colors.reset}\\r\\n\\r\\n`);\n\n const { execSync } = require('child_process');\n try {\n const log = execSync(`git log --oneline -${result.committed}`, { cwd: process.cwd(), encoding: 'utf-8' });\n w(colorize(' Commits criados:\\r\\n', 'bold'));\n log.split('\\n').filter(l => l.trim()).forEach((line: string) => {\n w(` ${colorize(line, 'muted')}\\r\\n`);\n });\n w('\\r\\n');\n } catch {}\n\n w(colorize(' Pushing...\\r\\n', 'muted'));\n const pushResult = this.commitGenerator.executePush();\n\n if (pushResult.success) {\n w(`${Colors.green} βœ“ Pushed${Colors.reset}\\r\\n\\r\\n`);\n } else {\n w(`${Colors.red} βœ— Push failed:${Colors.reset} ${pushResult.error}\\r\\n\\r\\n`);\n }\n } else {\n w(`${Colors.red} βœ— Failed after ${result.committed} commit(s):${Colors.reset} ${result.error}\\r\\n`);\n\n if (result.originalHead && result.committed > 0) {\n w(`${colorize(' Rollback disponΓ­vel:', 'warning')}\\r\\n`);\n w(` ${colorize(`git reset --soft ${result.originalHead}`, 'cyan')}\\r\\n\\r\\n`);\n } else {\n w('\\r\\n');\n }\n }\n }\n\n async cmdPr(smartInput: SmartInput): Promise<void> {\n const w = (s: string) => process.stdout.write(s);\n\n const branch = this.prGenerator.getCurrentBranch();\n if (branch === 'main' || branch === 'master' || branch === 'develop') {\n w(`${Colors.yellow} Cannot create PR from ${branch} branch${Colors.reset}\\r\\n\\r\\n`);\n return;\n }\n\n const detectedBase = this.prGenerator.detectDefaultBaseBranch();\n const baseInput = await smartInput.question(colorize(` Base branch (default: ${detectedBase}): `, 'cyan'));\n const baseBranch = baseInput.trim() || detectedBase;\n\n w(`\\r\\n${Colors.cyan}πŸ” Analyzing commits...${Colors.reset}\\r\\n`);\n\n const commits = this.prGenerator.getCommitsNotInBase(baseBranch);\n if (commits.length === 0) {\n w(`${Colors.yellow} No commits found between ${branch} and ${baseBranch}${Colors.reset}\\r\\n\\r\\n`);\n return;\n }\n\n w(`\\r\\n${Colors.green}βœ“ Found ${commits.length} commit(s):${Colors.reset}\\r\\n`);\n for (const commit of commits) {\n w(` ${colorize(commit.hash.slice(0, 7), 'muted')} ${commit.message.slice(0, 50)}${commit.message.length > 50 ? '...' : ''}\\r\\n`);\n }\n\n w(`\\r\\n${Colors.cyan}πŸ€– Generating PR description...${Colors.reset}\\r\\n`);\n\n const prDescription = await this.prGenerator.generatePRDescription(branch, commits, baseBranch);\n\n w(`\\r\\n${colorize('─'.repeat(50), 'subtle')}\\r\\n`);\n w(colorize('Pull Request Preview:', 'bold') + '\\r\\n');\n w(colorize('─'.repeat(50), 'subtle') + '\\r\\n\\r\\n');\n w(`${colorize('Title:', 'bold')}\\r\\n ${colorize(prDescription.title, 'cyan')}\\r\\n\\r\\n`);\n \n const descLines = prDescription.description.split('\\n');\n for (const line of descLines.slice(0, 25)) {\n w(` ${line}\\r\\n`);\n }\n if (descLines.length > 25) {\n w(` ${colorize(`... (${descLines.length - 25} more lines)`, 'muted')}\\r\\n`);\n }\n \n w(`\\r\\n${colorize('─'.repeat(50), 'subtle')}\\r\\n\\r\\n`);\n\n const confirm = await smartInput.askChoice('Create this PR?', [\n { key: 'y', label: 'yes', description: 'Create PR on GitHub' },\n { key: 'n', label: 'no', description: 'Cancel' },\n { key: 'e', label: 'edit', description: 'Edit title/description' },\n ]);\n\n if (confirm === 'n') {\n w(colorize(' Cancelled\\r\\n\\r\\n', 'muted'));\n return;\n }\n\n let finalTitle = prDescription.title;\n let finalDescription = prDescription.description;\n\n if (confirm === 'e') {\n const newTitle = await smartInput.question(colorize(' Title (empty to keep): ', 'cyan'));\n if (newTitle.trim()) {\n finalTitle = newTitle.trim();\n }\n\n const editDesc = await smartInput.askChoice('Edit description?', [\n { key: 'y', label: 'yes', description: 'Open in editor' },\n { key: 'n', label: 'no', description: 'Keep as is' },\n ]);\n\n if (editDesc === 'y') {\n const fs = require('fs');\n const { execSync } = require('child_process');\n const tempFile = `/tmp/pr-desc-${Date.now()}.md`;\n fs.writeFileSync(tempFile, finalDescription);\n \n const editor = process.env.EDITOR || 'nano';\n try {\n execSync(`${editor} \"${tempFile}\"`, { stdio: 'inherit' });\n finalDescription = fs.readFileSync(tempFile, 'utf-8');\n } catch {\n w(colorize(' Could not open editor\\r\\n', 'yellow'));\n } finally {\n try { fs.unlinkSync(tempFile); } catch {}\n }\n }\n }\n\n const { platform } = this.prGenerator.detectPlatform();\n \n if (platform === 'github') {\n try {\n const { execSync } = require('child_process');\n execSync(`git push origin ${branch}`, { cwd: process.cwd() });\n } catch {}\n }\n\n const result = await this.prGenerator.createPR(finalTitle, finalDescription, baseBranch);\n\n if (result.success && result.url) {\n w(`\\r\\n${Colors.green}βœ“ Pull Request created!${Colors.reset}\\r\\n`);\n w(` ${colorize(result.url, 'cyan')}\\r\\n\\r\\n`);\n } else {\n if (result.description) {\n const copied = this.prGenerator.copyToClipboard(result.description);\n w(`\\r\\n${colorize('PR Description:', 'bold')}\\r\\n`);\n w(colorize('─'.repeat(50), 'subtle') + '\\r\\n');\n w(result.description.split('\\n').slice(0, 30).join('\\r\\n') + '\\r\\n');\n w(colorize('─'.repeat(50), 'subtle') + '\\r\\n\\r\\n');\n \n if (copied) {\n w(`${colorize('βœ“', 'success')} Copied to clipboard\\r\\n`);\n }\n\n const createUrl = this.prGenerator.getPRCreateUrl(platform, baseBranch);\n if (createUrl) {\n w(`\\r\\n ${colorize('Open to create PR:', 'muted')}\\r\\n`);\n w(` ${colorize(createUrl, 'cyan')}\\r\\n`);\n }\n }\n w('\\r\\n');\n }\n }\n\n async cmdReview(args: string[]): Promise<void> {\n const w = (s: string) => process.stdout.write(s);\n\n let files: string[] = [];\n \n if (args.length > 0) {\n files = args.filter(a => !a.startsWith('/'));\n } else {\n w(`\\r\\n${Colors.cyan}πŸ” Analyzing staged files...${Colors.reset}\\r\\n`);\n files = this.codeReviewService['getChangedFiles'](true);\n }\n\n if (files.length === 0) {\n w(`${Colors.yellow} No files to review${Colors.reset}\\r\\n\\r\\n`);\n return;\n }\n\n w(`\\r\\n${Colors.cyan}πŸ€– Reviewing ${files.length} file(s)...${Colors.reset}\\r\\n`);\n\n const results = await this.codeReviewService.reviewFiles(files);\n\n let totalIssues = 0;\n let totalScore = 0;\n\n for (const result of results) {\n totalScore += result.score;\n const errors = result.issues.filter(i => i.severity === 'error').length;\n const warnings = result.issues.filter(i => i.severity === 'warning').length;\n const suggestions = result.issues.filter(i => i.severity === 'suggestion').length;\n totalIssues += result.issues.length;\n\n const scoreColor = result.score >= 80 ? 'success' : result.score >= 60 ? 'warning' : 'error';\n \n w(`\\r\\n${colorize(result.file, 'bold')} ${colorize(result.score + '/100', scoreColor)}\\r\\n`);\n w(` ${colorize(result.summary, 'muted')}\\r\\n`);\n\n if (errors > 0) w(` ${colorize('βœ— ' + errors + ' errors', 'error')} `);\n if (warnings > 0) w(`${colorize('⚠ ' + warnings + ' warnings', 'warning')} `);\n if (suggestions > 0) w(`${colorize('πŸ’‘ ' + suggestions + ' suggestions', 'muted')}`);\n if (errors > 0 || warnings > 0 || suggestions > 0) w('\\r\\n');\n\n const topIssues = result.issues.filter(i => i.severity !== 'praise').slice(0, 3);\n for (const issue of topIssues) {\n const icon = issue.severity === 'error' ? 'βœ—' : issue.severity === 'warning' ? '⚠' : 'πŸ’‘';\n const color = issue.severity === 'error' ? 'error' : issue.severity === 'warning' ? 'warning' : 'muted';\n const line = issue.line ? colorize(':' + issue.line, 'muted') : '';\n w(` ${colorize(icon, color)} ${issue.message}${line}\\r\\n`);\n }\n\n if (result.issues.length > 3) {\n w(` ${colorize('... and ' + (result.issues.length - 3) + ' more', 'muted')}\\r\\n`);\n }\n }\n\n const avgScore = Math.round(totalScore / results.length);\n const avgColor = avgScore >= 80 ? 'success' : avgScore >= 60 ? 'warning' : 'error';\n \n w(`\\r\\n${colorize('Summary:', 'bold')} ${colorize(avgScore + '/100', avgColor)} | ${totalIssues} issue(s)\\r\\n\\r\\n`);\n }\n\n async cmdFix(args: string[]): Promise<void> {\n const w = (s: string) => process.stdout.write(s);\n\n if (args.length === 0) {\n w(`${Colors.yellow} Usage: /fix <file>${Colors.reset}\\r\\n\\r\\n`);\n return;\n }\n\n const filePath = args[0];\n w(`\\r\\n${Colors.cyan}πŸ”§ Fixing ${filePath}...${Colors.reset}\\r\\n`);\n\n const result = await this.codeReviewService.fixFile(filePath);\n\n if (result.success) {\n w(`${Colors.green} βœ“ File fixed${Colors.reset}\\r\\n\\r\\n`);\n } else {\n w(`${Colors.red} βœ— Failed: ${result.error}${Colors.reset}\\r\\n\\r\\n`);\n }\n }\n\n async cmdIdent(): Promise<void> {\n const w = (s: string) => process.stdout.write(s);\n w(`\\r\\n${Colors.cyan}🎨 Formatting code files...${Colors.reset}\\r\\n`);\n\n const result = await this.codeReviewService.indentAll();\n\n w(`${Colors.green} βœ“ ${result.success} file(s) formatted${Colors.reset}\\r\\n`);\n if (result.failed > 0) {\n w(`${Colors.yellow} ⚠ ${result.failed} file(s) failed${Colors.reset}\\r\\n`);\n }\n w('\\r\\n');\n }\n\n async cmdRelease(args: string[]): Promise<void> {\n const w = (s: string) => process.stdout.write(s);\n const sinceTag = args[0];\n\n w(`\\r\\n${Colors.cyan}πŸ“ Generating release notes...${Colors.reset}\\r\\n`);\n\n const result = await this.releaseNotesService.generateReleaseNotes(sinceTag);\n\n if (result.success && result.filePath) {\n w(`${Colors.green} βœ“ Release notes generated!${Colors.reset}\\r\\n`);\n w(` ${colorize(result.filePath, 'accent')}\\r\\n\\r\\n`);\n\n if (result.content) {\n w(`${colorize('Preview:', 'bold')}\\r\\n`);\n const lines = result.content.split('\\n').slice(0, 15);\n for (const line of lines) {\n w(` ${line}\\r\\n`);\n }\n if (result.content.split('\\n').length > 15) {\n w(` ${colorize('...', 'muted')}\\r\\n`);\n }\n w('\\r\\n');\n }\n } else {\n w(`${Colors.red} βœ— Failed: ${result.error}${Colors.reset}\\r\\n\\r\\n`);\n }\n }\n\n async cmdUnitTest(smartInput: SmartInput): Promise<void> {\n const w = (s: string) => process.stdout.write(s);\n\n const detectedBase = this.unitTestGenerator.detectDefaultBaseBranch();\n const baseInput = await smartInput.question(colorize(` Base branch (default: ${detectedBase}): `, 'cyan'));\n const baseBranch = baseInput.trim() || detectedBase;\n\n w(`\\r\\n${Colors.cyan}πŸ” Analyzing branch changes...${Colors.reset}\\r\\n`);\n const changedFiles = this.unitTestGenerator.getChangedFiles(baseBranch);\n if (changedFiles.length === 0) {\n w(`${Colors.yellow} No changes found between HEAD and ${baseBranch}${Colors.reset}\\r\\n\\r\\n`);\n return;\n }\n\n w(`\\r\\n${Colors.cyan}πŸ€– Generating unit tests...${Colors.reset}\\r\\n`);\n const frames = ['◐', 'β—“', 'β—‘', 'β—’'];\n let frame = 0;\n let progressText = 'Starting...';\n const spinner = setInterval(() => {\n const icon = frames[frame++ % frames.length];\n w(`\\r ${colorize(icon, 'cyan')} ${colorize(progressText, 'muted')}`);\n }, 90);\n\n let result;\n try {\n result = await this.unitTestGenerator.generateUnitTests(\n baseBranch,\n ({ current, total, sourcePath }) => {\n const shortPath = sourcePath.length > 64 ? `...${sourcePath.slice(-61)}` : sourcePath;\n progressText = `[${current}/${total}] ${shortPath}`;\n },\n );\n } catch (error: any) {\n const message = error?.message || 'unknown error';\n clearInterval(spinner);\n w('\\r\\x1b[K');\n w(`${Colors.red} Failed to generate unit tests: ${message}${Colors.reset}\\r\\n\\r\\n`);\n return;\n } finally {\n clearInterval(spinner);\n w('\\r\\x1b[K');\n }\n\n if (!result.files.length) {\n w(`${Colors.yellow} No unit tests generated${Colors.reset}\\r\\n`);\n if (result.notes.length > 0) {\n for (const note of result.notes) {\n w(` ${colorize(note, 'muted')}\\r\\n`);\n }\n }\n w('\\r\\n');\n return;\n }\n\n w(`\\r\\n${Colors.green}βœ“ Generated ${result.files.length} test file(s)${Colors.reset}\\r\\n`);\n for (const file of result.files) {\n const reason = file.reason ? ` - ${file.reason}` : '';\n w(` ${colorize(file.path, 'cyan')}${colorize(reason, 'muted')}\\r\\n`);\n }\n\n if (result.notes.length > 0) {\n w(`\\r\\n${colorize('Coverage notes:', 'bold')}\\r\\n`);\n for (const note of result.notes) {\n w(` ${colorize('- ' + note, 'muted')}\\r\\n`);\n }\n }\n\n const confirm = await smartInput.askChoice('Write unit tests to disk?', [\n { key: 'y', label: 'yes', description: 'Create and update test files' },\n { key: 'n', label: 'no', description: 'Cancel' },\n ]);\n if (confirm === 'n') {\n w(colorize(' Cancelled\\r\\n\\r\\n', 'muted'));\n return;\n }\n\n const fs = require('fs');\n const path = require('path');\n let written = 0;\n for (const file of result.files) {\n try {\n const dir = path.dirname(file.path);\n fs.mkdirSync(dir, { recursive: true });\n fs.writeFileSync(file.path, file.content + '\\n', 'utf-8');\n written++;\n } catch {}\n }\n\n w(`\\r\\n${Colors.green}βœ“ Wrote ${written} test file(s)${Colors.reset}\\r\\n\\r\\n`);\n }\n}\n"],"names":["GitCommandsService","runGit","cmd","execSync","require","output","encoding","cwd","process","trim","stdout","write","colorize","e","Colors","red","message","reset","cmdCommit","args","smartInput","msg","join","generateAndCommit","input","w","s","commitGenerator","hasChanges","yellow","cyan","generateCommitMessage","green","confirm","askChoice","key","label","description","finalMessage","newMsg","question","success","executeCommit","cmdUp","monorepoInfo","monorepoDetector","detectMonorepo","isMonorepo","modules","instructions","diffInfo","getDiffInfo","refined","refineCommitMessage","confirmRefined","commitSuccess","pushResult","executePush","error","cmdSplitUp","proposedCommits","splitCommits","commits","filter","c","files","length","i","commit","toString","result","executeSplitCommits","committed","log","split","l","forEach","line","originalHead","cmdPr","branch","prGenerator","getCurrentBranch","detectedBase","detectDefaultBaseBranch","baseInput","baseBranch","getCommitsNotInBase","hash","slice","prDescription","generatePRDescription","repeat","title","descLines","finalTitle","finalDescription","newTitle","editDesc","fs","tempFile","Date","now","writeFileSync","editor","env","EDITOR","stdio","readFileSync","unlinkSync","platform","detectPlatform","createPR","url","copied","copyToClipboard","createUrl","getPRCreateUrl","cmdReview","a","startsWith","codeReviewService","results","reviewFiles","totalIssues","totalScore","score","errors","issues","severity","warnings","suggestions","scoreColor","file","summary","topIssues","issue","icon","color","avgScore","Math","round","avgColor","cmdFix","filePath","fixFile","cmdIdent","indentAll","failed","cmdRelease","sinceTag","releaseNotesService","generateReleaseNotes","content","lines","cmdUnitTest","unitTestGenerator","changedFiles","getChangedFiles","frames","frame","progressText","spinner","setInterval","generateUnitTests","current","total","sourcePath","shortPath","clearInterval","notes","note","reason","path","written","dir","dirname","mkdirSync","recursive"],"mappings":";;;;+BAeaA;;;eAAAA;;;wBAfc;uBACkB;wCACN;yCACC;oCACL;mCACD;qCACE;0CACK;;;;;;;;;;AAQlC,IAAA,AAAMA,qBAAN,MAAMA;IAUXC,OAAOC,GAAW,EAAQ;QACxB,MAAM,EAAEC,QAAQ,EAAE,GAAGC,QAAQ;QAC7B,IAAI;YACF,MAAMC,SAASF,SAASD,KAAK;gBAAEI,UAAU;gBAASC,KAAKC,QAAQD,GAAG;YAAG,GAAGE,IAAI;YAC5ED,QAAQE,MAAM,CAACC,KAAK,CAACN,SAAS,CAAC,IAAI,EAAEA,OAAO,QAAQ,CAAC,GAAG,CAAC,EAAE,EAAEO,IAAAA,eAAQ,EAAC,eAAe,SAAS,IAAI,CAAC;QACrG,EAAE,OAAOC,GAAG;YACVL,QAAQE,MAAM,CAACC,KAAK,CAAC,GAAGG,aAAM,CAACC,GAAG,CAAC,EAAE,EAAE,AAACF,EAAYG,OAAO,GAAGF,aAAM,CAACG,KAAK,CAAC,IAAI,CAAC;QAClF;IACF;IAEA,MAAMC,UAAUC,IAAc,EAAEC,UAAsB,EAAiB;QACrE,MAAMC,MAAMF,KAAKG,IAAI,CAAC;QACtB,IAAI,CAACD,KAAK;YACR,MAAM,IAAI,CAACE,iBAAiB,CAACH;QAC/B,OAAO;YACL,MAAM,EAAEjB,QAAQ,EAAE,GAAGC,QAAQ;YAC7B,IAAI;gBACFD,SAAS,cAAc;oBAAE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,eAAuC,EACxD,AAAiBkB,gBAAyC,EAC1D,AAAiBoC,WAA+B,EAChD,AAAiBwC,iBAAoC,EACrD,AAAiB8B,mBAAwC,EACzD,AAAiBK,iBAA2C,CAC5D;aANiBjI,kBAAAA;aACAkB,mBAAAA;aACAoC,cAAAA;aACAwC,oBAAAA;aACA8B,sBAAAA;aACAK,oBAAAA;IAChB;AAkjBL"}
@@ -50,6 +50,7 @@ let ReplCommandsService = class ReplCommandsService {
50
50
  process.stdout.write(cmd('/up', 'Smart commit & push'));
51
51
  process.stdout.write(cmd('/split-up', 'Split into multiple commits'));
52
52
  process.stdout.write(cmd('/pr', 'Create PR with AI description'));
53
+ process.stdout.write(cmd('/unit-test', 'Generate unit tests for branch changes'));
53
54
  process.stdout.write(cmd('/review [files]', 'Code review'));
54
55
  process.stdout.write(cmd('/fix <file>', 'Auto-fix code issues'));
55
56
  process.stdout.write(cmd('/ident', 'Format all code files'));