@gilbert_oliveira/commit-wizard 1.2.2 → 2.0.1

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.
package/dist/config.js DELETED
@@ -1,84 +0,0 @@
1
- import fs from 'fs';
2
- import path from 'path';
3
- import os from 'os';
4
- const DEFAULT_CONFIG = {
5
- model: 'gpt-4o',
6
- temperature: 0.2,
7
- maxTokens: 1000,
8
- language: 'pt',
9
- autoCommit: false,
10
- excludePatterns: ['*.lock*', '*.log', 'node_modules/**'],
11
- includeEmoji: true,
12
- };
13
- const CONFIG_FILE_NAME = '.commit-wizard.json';
14
- /**
15
- * Busca o arquivo de configuração no diretório atual ou no home do usuário
16
- */
17
- function findConfigFile() {
18
- // Primeiro verifica no diretório atual
19
- const localConfig = path.join(process.cwd(), CONFIG_FILE_NAME);
20
- if (fs.existsSync(localConfig)) {
21
- return localConfig;
22
- }
23
- // Depois verifica no home do usuário
24
- const globalConfig = path.join(os.homedir(), CONFIG_FILE_NAME);
25
- if (fs.existsSync(globalConfig)) {
26
- return globalConfig;
27
- }
28
- return null;
29
- }
30
- /**
31
- * Carrega a configuração mesclando defaults com arquivo de config
32
- */
33
- export function loadConfig() {
34
- const configFile = findConfigFile();
35
- let userConfig = {};
36
- if (configFile) {
37
- try {
38
- const configContent = fs.readFileSync(configFile, 'utf8');
39
- userConfig = JSON.parse(configContent);
40
- }
41
- catch (error) {
42
- console.warn(`⚠️ Erro ao ler arquivo de configuração ${configFile}:`, error);
43
- }
44
- }
45
- // Mescla configuração padrão com configuração do usuário
46
- const config = {
47
- ...DEFAULT_CONFIG,
48
- ...userConfig,
49
- apiKey: userConfig.apiKey || process.env.OPENAI_API_KEY,
50
- };
51
- return config;
52
- }
53
- /**
54
- * Salva a configuração no arquivo local ou global
55
- */
56
- export function saveConfig(config, global = false) {
57
- const configPath = global
58
- ? path.join(os.homedir(), CONFIG_FILE_NAME)
59
- : path.join(process.cwd(), CONFIG_FILE_NAME);
60
- try {
61
- const existingConfig = global ? {} : loadConfig();
62
- const newConfig = { ...existingConfig, ...config };
63
- // Remove a apiKey do arquivo (deve ficar apenas em variável de ambiente)
64
- delete newConfig.apiKey;
65
- fs.writeFileSync(configPath, JSON.stringify(newConfig, null, 2));
66
- console.log(`✅ Configuração salva em ${configPath}`);
67
- }
68
- catch (error) {
69
- console.error('❌ Erro ao salvar configuração:', error);
70
- }
71
- }
72
- /**
73
- * Cria um arquivo de configuração exemplo
74
- */
75
- export function createConfigExample() {
76
- const configPath = path.join(process.cwd(), `${CONFIG_FILE_NAME}.example`);
77
- const exampleConfig = {
78
- ...DEFAULT_CONFIG,
79
- apiKey: 'sk-your-openai-api-key-here',
80
- };
81
- fs.writeFileSync(configPath, JSON.stringify(exampleConfig, null, 2));
82
- console.log(`📄 Arquivo de exemplo criado: ${configPath}`);
83
- }
84
- //# sourceMappingURL=config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,IAAI,CAAC;AAapB,MAAM,cAAc,GAAW;IAC7B,KAAK,EAAE,QAAQ;IACf,WAAW,EAAE,GAAG;IAChB,SAAS,EAAE,IAAI;IACf,QAAQ,EAAE,IAAI;IACd,UAAU,EAAE,KAAK;IACjB,eAAe,EAAE,CAAC,SAAS,EAAE,OAAO,EAAE,iBAAiB,CAAC;IACxD,YAAY,EAAE,IAAI;CACnB,CAAC;AAEF,MAAM,gBAAgB,GAAG,qBAAqB,CAAC;AAE/C;;GAEG;AACH,SAAS,cAAc;IACrB,uCAAuC;IACvC,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,gBAAgB,CAAC,CAAC;IAC/D,IAAI,EAAE,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC;Q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AG,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC;QAClD,MAAM,SAAS,GAAG,EAAE,GAAG,cAAc,EAAE,GAAG,MAAM,EAAE,CAAC;QAEnD,yEAAyE;QACzE,OAAO,SAAS,CAAC,MAAM,CAAC;QAExB,EAAE,CAAC,aAAa,CAAC,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QACjE,OAAO,CAAC,GAAG,CAAC,2BAA2B,UAAU,EAAE,CAAC,CAAC;IACvD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,gCAAgC,EAAE,KAAK,CAAC,CAAC;IACzD,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,mBAAmB;IACjC,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,GAAG,gBAAgB,UAAU,CAAC,CAAC;IAC3E,MAAM,aAAa,GAAG;QACpB,GAAG,cAAc;QACjB,MAAM,EAAE,6BAA6B;KACtC,CAAC;IAEF,EAAE,CAAC,aAAa,CAAC,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IACrE,OAAO,CAAC,GAAG,CAAC,iCAAiC,UAAU,EAAE,CAAC,CAAC;AAC7D,CAAC"}
@@ -1,39 +0,0 @@
1
- import { AIService } from './ai-service.js';
2
- /**
3
- * Processador de diff para chunks e resumos
4
- */
5
- export declare class DiffProcessor {
6
- private aiService;
7
- private maxTokens;
8
- constructor(aiService: AIService, maxTokens?: number);
9
- /**
10
- * Divide o diff em chunks menores baseado na contagem de tokens
11
- */
12
- chunkDiff(diff: string): string[];
13
- /**
14
- * Processa diff grande gerando resumos dos chunks
15
- */
16
- processLargeDiff(diff: string): Promise<string>;
17
- /**
18
- * Analisa a complexidade do diff
19
- */
20
- analyzeDiffComplexity(diff: string): {
21
- tokenCount: number;
22
- lineCount: number;
23
- fileCount: number;
24
- complexity: 'simple' | 'moderate' | 'complex';
25
- };
26
- /**
27
- * Extrai estatísticas do diff
28
- */
29
- extractDiffStats(diff: string): {
30
- additions: number;
31
- deletions: number;
32
- files: string[];
33
- types: string[];
34
- };
35
- /**
36
- * Verifica se o diff contém breaking changes
37
- */
38
- detectBreakingChanges(diff: string): boolean;
39
- }
@@ -1,156 +0,0 @@
1
- import { encode, decode } from 'gpt-tokenizer';
2
- import ora from 'ora';
3
- import cliProgress from 'cli-progress';
4
- /**
5
- * Processador de diff para chunks e resumos
6
- */
7
- export class DiffProcessor {
8
- constructor(aiService, maxTokens = 1000) {
9
- this.aiService = aiService;
10
- this.maxTokens = maxTokens;
11
- }
12
- /**
13
- * Divide o diff em chunks menores baseado na contagem de tokens
14
- */
15
- chunkDiff(diff) {
16
- const tokens = encode(diff);
17
- if (tokens.length <= this.maxTokens) {
18
- return [diff];
19
- }
20
- const chunks = [];
21
- for (let i = 0; i < tokens.length; i += this.maxTokens) {
22
- const chunkTokens = tokens.slice(i, i + this.maxTokens);
23
- const chunkText = decode(chunkTokens);
24
- chunks.push(chunkText);
25
- }
26
- return chunks;
27
- }
28
- /**
29
- * Processa diff grande gerando resumos dos chunks
30
- */
31
- async processLargeDiff(diff) {
32
- const chunks = this.chunkDiff(diff);
33
- if (chunks.length === 1) {
34
- return chunks[0];
35
- }
36
- const partialSummaries = [];
37
- // Se há muitos chunks, usa progress bar
38
- if (chunks.length > 3) {
39
- console.log(`\n📊 Processando ${chunks.length} chunks do diff...\n`);
40
- const progressBar = new cliProgress.SingleBar({
41
- format: '🔄 Progresso |' + '{bar}' + '| {percentage}% | {value}/{total} chunks | ETA: {eta}s',
42
- barCompleteChar: '█',
43
- barIncompleteChar: '░',
44
- hideCursor: true,
45
- });
46
- progressBar.start(chunks.length, 0);
47
- try {
48
- for (let i = 0; i < chunks.length; i++) {
49
- const summary = await this.aiService.generateSummary(chunks[i]);
50
- partialSummaries.push(summary);
51
- progressBar.update(i + 1);
52
- }
53
- progressBar.stop();
54
- console.log(`✅ ${chunks.length} chunks processados com sucesso.\n`);
55
- }
56
- catch (error) {
57
- progressBar.stop();
58
- console.log('❌ Erro ao processar chunks do diff.\n');
59
- throw error;
60
- }
61
- }
62
- else {
63
- // Para poucos chunks, usa spinner simples
64
- const spinner = ora(`Processando ${chunks.length} chunks...`).start();
65
- try {
66
- for (let i = 0; i < chunks.length; i++) {
67
- spinner.text = `Processando chunk ${i + 1}/${chunks.length}...`;
68
- const summary = await this.aiService.generateSummary(chunks[i]);
69
- partialSummaries.push(summary);
70
- }
71
- spinner.succeed(`${chunks.length} chunks processados.`);
72
- }
73
- catch (error) {
74
- spinner.fail('Erro ao processar chunks.');
75
- throw error;
76
- }
77
- }
78
- return partialSummaries.join('\n\n');
79
- }
80
- /**
81
- * Analisa a complexidade do diff
82
- */
83
- analyzeDiffComplexity(diff) {
84
- const tokens = encode(diff);
85
- const lines = diff.split('\n');
86
- const fileChanges = (diff.match(/^diff --git/gm) || []).length;
87
- let complexity = 'simple';
88
- if (tokens.length > 2000 || fileChanges > 10) {
89
- complexity = 'complex';
90
- }
91
- else if (tokens.length > 500 || fileChanges > 3) {
92
- complexity = 'moderate';
93
- }
94
- return {
95
- tokenCount: tokens.length,
96
- lineCount: lines.length,
97
- fileCount: fileChanges,
98
- complexity,
99
- };
100
- }
101
- /**
102
- * Extrai estatísticas do diff
103
- */
104
- extractDiffStats(diff) {
105
- const lines = diff.split('\n');
106
- let additions = 0;
107
- let deletions = 0;
108
- const files = [];
109
- const types = new Set();
110
- for (const line of lines) {
111
- if (line.startsWith('+') && !line.startsWith('+++')) {
112
- additions++;
113
- }
114
- else if (line.startsWith('-') && !line.startsWith('---')) {
115
- deletions++;
116
- }
117
- else if (line.startsWith('diff --git')) {
118
- const match = line.match(/b\/(.+)$/);
119
- if (match) {
120
- const file = match[1];
121
- files.push(file);
122
- const ext = file.split('.').pop()?.toLowerCase();
123
- if (ext) {
124
- types.add(ext);
125
- }
126
- }
127
- }
128
- }
129
- return {
130
- additions,
131
- deletions,
132
- files,
133
- types: Array.from(types),
134
- };
135
- }
136
- /**
137
- * Verifica se o diff contém breaking changes
138
- */
139
- detectBreakingChanges(diff) {
140
- const breakingPatterns = [
141
- /class.*\{[\s\S]*?constructor.*\(/,
142
- /interface.*\{[\s\S]*?\}/,
143
- /export.*function.*\(/,
144
- /export.*class/,
145
- /export.*interface/,
146
- /export.*type/,
147
- /API/i,
148
- /BREAKING/i,
149
- /deprecated/i,
150
- /remove.*function/i,
151
- /delete.*method/i,
152
- ];
153
- return breakingPatterns.some(pattern => pattern.test(diff));
154
- }
155
- }
156
- //# sourceMappingURL=diff-processor.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"diff-processor.js","sourceRoot":"","sources":["../src/diff-processor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAE/C,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,WAAW,MAAM,cAAc,CAAC;AAEvC;;GAEG;AACH,MAAM,OAAO,aAAa;IAIxB,YAAY,SAAoB,EAAE,YAAoB,IAAI;QACxD,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC7B,CAAC;IAED;;OAEG;IACH,SAAS,CAAC,IAAY;QACpB,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;QAE5B,IAAI,MAAM,CAAC,MAAM,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACpC,OAAO,CAAC,IAAI,CAAC,CAAC;QAChB,CAAC;QAED,MAAM,MAAM,GAAa,EAAE,CAAC;QAE5B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,IAAI,IAAI,CAAC,SAAS,E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AC,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;gBACzC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;gBACrC,IAAI,KAAK,EAAE,CAAC;oBACV,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;oBACtB,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;oBAEjB,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,WAAW,EAAE,CAAC;oBACjD,IAAI,GAAG,EAAE,CAAC;wBACR,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;oBACjB,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;QAED,OAAO;YACL,SAAS;YACT,SAAS;YACT,KAAK;YACL,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC;SACzB,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,qBAAqB,CAAC,IAAY;QAChC,MAAM,gBAAgB,GAAG;YACvB,kCAAkC;YAClC,yBAAyB;YACzB,sBAAsB;YACtB,eAAe;YACf,mBAAmB;YACnB,cAAc;YACd,MAAM;YACN,WAAW;YACX,aAAa;YACb,mBAAmB;YACnB,iBAAiB;SAClB,CAAC;QAEF,OAAO,gBAAgB,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAC9D,CAAC;CACF"}
@@ -1,72 +0,0 @@
1
- export interface GitStatus {
2
- hasStagedFiles: boolean;
3
- stagedFiles: string[];
4
- diff: string;
5
- }
6
- /**
7
- * Utilitários para operações Git
8
- */
9
- export declare class GitUtils {
10
- private excludePatterns;
11
- constructor(excludePatterns?: string[]);
12
- /**
13
- * Verifica se o diretório atual é um repositório Git
14
- */
15
- isGitRepository(): boolean;
16
- /**
17
- * Constrói argumentos de exclusão para comandos git
18
- */
19
- private buildExcludeArgs;
20
- /**
21
- * Obtém status dos arquivos staged
22
- */
23
- getStagedStatus(): GitStatus;
24
- /**
25
- * Limpa o output do diff removendo possíveis contaminações
26
- */
27
- private cleanDiffOutput;
28
- /**
29
- * Realiza commit com mensagem usando arquivo temporário (mais seguro)
30
- */
31
- commit(message: string, additionalArgs?: string[]): void;
32
- /**
33
- * Limpa a mensagem de commit removendo conteúdo inválido
34
- */
35
- private cleanCommitMessage;
36
- /**
37
- * Realiza commit usando arquivo temporário para a mensagem
38
- */
39
- commitWithFile(messageFile: string, additionalArgs?: string[]): void;
40
- /**
41
- * Obtém informações sobre o último commit
42
- */
43
- getLastCommitInfo(): {
44
- hash: string;
45
- message: string;
46
- author: string;
47
- date: string;
48
- };
49
- /**
50
- * Verifica se há arquivos não commitados
51
- */
52
- hasUncommittedChanges(): boolean;
53
- /**
54
- * Lista branches disponíveis
55
- */
56
- getBranches(): {
57
- current: string;
58
- all: string[];
59
- };
60
- /**
61
- * Obtém lista de arquivos alterados (staged)
62
- */
63
- getChangedFiles(): string[];
64
- /**
65
- * Obtém diff de um arquivo específico
66
- */
67
- getFileDiff(filePath: string): string;
68
- /**
69
- * Obtém diff completo dos arquivos staged
70
- */
71
- getStagedDiff(): string;
72
- }