@andrebuzeli/git-mcp 3.0.0 → 3.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/server.d.ts.map +1 -1
- package/dist/server.js +58 -36
- package/dist/server.js.map +1 -1
- package/dist/tools/git-branches.d.ts +125 -359
- package/dist/tools/git-branches.d.ts.map +1 -1
- package/dist/tools/git-branches.js +179 -530
- package/dist/tools/git-branches.js.map +1 -1
- package/dist/tools/git-files.d.ts +246 -406
- package/dist/tools/git-files.d.ts.map +1 -1
- package/dist/tools/git-files.js +556 -499
- package/dist/tools/git-files.js.map +1 -1
- package/dist/tools/git-issues.d.ts +8 -8
- package/dist/tools/git-pulls.d.ts +14 -14
- package/dist/tools/git-releases.d.ts +131 -401
- package/dist/tools/git-releases.d.ts.map +1 -1
- package/dist/tools/git-releases.js +374 -469
- package/dist/tools/git-releases.js.map +1 -1
- package/dist/tools/git-remote.d.ts +2 -2
- package/dist/tools/git-repositories.d.ts +4 -4
- package/dist/tools/git-reset.d.ts +106 -65
- package/dist/tools/git-reset.d.ts.map +1 -1
- package/dist/tools/git-reset.js +265 -149
- package/dist/tools/git-reset.js.map +1 -1
- package/dist/tools/git-stash.d.ts +110 -68
- package/dist/tools/git-stash.d.ts.map +1 -1
- package/dist/tools/git-stash.js +311 -186
- package/dist/tools/git-stash.js.map +1 -1
- package/dist/tools/git-sync.d.ts +145 -76
- package/dist/tools/git-sync.d.ts.map +1 -1
- package/dist/tools/git-sync.js +346 -246
- package/dist/tools/git-sync.js.map +1 -1
- package/dist/tools/git-tags.d.ts +2 -2
- package/dist/tools/git-versioning.d.ts +2 -2
- package/dist/tools/git-workflow.d.ts +36 -73
- package/dist/tools/git-workflow.d.ts.map +1 -1
- package/dist/tools/git-workflow.js +79 -126
- package/dist/tools/git-workflow.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,565 +1,470 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.gitReleasesTool = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const index_js_1 = require("../providers/index.js");
|
|
6
6
|
const user_detection_js_1 = require("../utils/user-detection.js");
|
|
7
7
|
/**
|
|
8
|
-
* Tool: releases
|
|
8
|
+
* Tool: git-releases
|
|
9
9
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
10
|
+
* GERENCIAMENTO DE RELEASES - Com auto-versioning
|
|
11
|
+
* Funcionalidades inteligentes de versionamento semântico
|
|
12
12
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* - Listagem e busca de releases
|
|
16
|
-
* - Obtenção de detalhes específicos
|
|
17
|
-
* - Atualização de releases existentes
|
|
18
|
-
* - Publicação de releases
|
|
19
|
-
* - Exclusão de releases
|
|
20
|
-
* - Controle de versão
|
|
21
|
-
*
|
|
22
|
-
* USO:
|
|
23
|
-
* - Para gerenciar versões do software
|
|
24
|
-
* - Para controle de deploy
|
|
25
|
-
* - Para documentação de mudanças
|
|
26
|
-
* - Para distribuição de releases
|
|
27
|
-
*
|
|
28
|
-
* RECOMENDAÇÕES:
|
|
29
|
-
* - Use versionamento semântico
|
|
30
|
-
* - Documente mudanças detalhadamente
|
|
31
|
-
* - Teste antes de publicar
|
|
32
|
-
* - Mantenha histórico de versões
|
|
33
|
-
*/
|
|
34
|
-
/**
|
|
35
|
-
* Schema de validação para entrada da tool releases
|
|
36
|
-
*
|
|
37
|
-
* VALIDAÇÕES:
|
|
38
|
-
* - action: Ação obrigatória (create, list, get, update, delete, publish)
|
|
39
|
-
* - Parâmetros específicos por ação
|
|
40
|
-
* - Validação de tipos e formatos
|
|
41
|
-
*
|
|
42
|
-
* RECOMENDAÇÕES:
|
|
43
|
-
* - Sempre valide entrada antes de usar
|
|
44
|
-
* - Use parâmetros opcionais adequadamente
|
|
45
|
-
* - Documente parâmetros obrigatórios
|
|
46
|
-
*/
|
|
47
|
-
const ReleasesInputSchema = zod_1.z.object({
|
|
48
|
-
action: zod_1.z.enum(['create', 'list', 'get', 'update', 'delete', 'publish']),
|
|
49
|
-
// Parâmetros comuns
|
|
50
|
-
owner: zod_1.z.string().optional(),
|
|
51
|
-
repo: zod_1.z.string(),
|
|
52
|
-
// Para multi-provider
|
|
53
|
-
provider: zod_1.z.enum(['gitea', 'github']).describe('Provider to use (gitea or github)'), // Provider específico: gitea, github ou both
|
|
54
|
-
projectPath: zod_1.z.string().describe('Local project path for git operations'),
|
|
55
|
-
// Para create
|
|
56
|
-
tag_name: zod_1.z.string().optional(),
|
|
57
|
-
name: zod_1.z.string().optional(),
|
|
58
|
-
body: zod_1.z.string().optional(),
|
|
59
|
-
draft: zod_1.z.boolean().optional(),
|
|
60
|
-
prerelease: zod_1.z.boolean().optional(),
|
|
61
|
-
target_commitish: zod_1.z.string().optional(),
|
|
62
|
-
// Para get/update/delete/publish
|
|
63
|
-
release_id: zod_1.z.number().optional(),
|
|
64
|
-
// Para list
|
|
65
|
-
page: zod_1.z.number().min(1).optional(),
|
|
66
|
-
limit: zod_1.z.number().min(1).max(100).optional(),
|
|
67
|
-
// Para update
|
|
68
|
-
new_tag_name: zod_1.z.string().optional(),
|
|
69
|
-
new_name: zod_1.z.string().optional(),
|
|
70
|
-
new_body: zod_1.z.string().optional(),
|
|
71
|
-
new_draft: zod_1.z.boolean().optional(),
|
|
72
|
-
new_prerelease: zod_1.z.boolean().optional(),
|
|
73
|
-
new_target_commitish: zod_1.z.string().optional(),
|
|
74
|
-
// Para publish
|
|
75
|
-
latest: zod_1.z.boolean().optional(),
|
|
76
|
-
});
|
|
77
|
-
/**
|
|
78
|
-
* Schema de saída padronizado
|
|
79
|
-
*
|
|
80
|
-
* ESTRUTURA:
|
|
81
|
-
* - success: Status da operação
|
|
82
|
-
* - action: Ação executada
|
|
83
|
-
* - message: Mensagem descritiva
|
|
84
|
-
* - data: Dados retornados (opcional)
|
|
85
|
-
* - error: Detalhes do erro (opcional)
|
|
13
|
+
* DESIGNED FOR: Programador individual autônomo
|
|
14
|
+
* PHILOSOPHY: Versionamento automático e inteligente
|
|
86
15
|
*/
|
|
87
|
-
const
|
|
16
|
+
const GitReleasesInputSchema = zod_1.z.discriminatedUnion('action', [
|
|
17
|
+
zod_1.z.object({
|
|
18
|
+
action: zod_1.z.literal('create'),
|
|
19
|
+
repo: zod_1.z.string(),
|
|
20
|
+
provider: zod_1.z.enum(['gitea', 'github']),
|
|
21
|
+
version: zod_1.z.string().optional(),
|
|
22
|
+
name: zod_1.z.string().optional(),
|
|
23
|
+
description: zod_1.z.string().optional(),
|
|
24
|
+
draft: zod_1.z.boolean().optional().default(false),
|
|
25
|
+
prerelease: zod_1.z.boolean().optional().default(false)
|
|
26
|
+
}),
|
|
27
|
+
zod_1.z.object({
|
|
28
|
+
action: zod_1.z.literal('list'),
|
|
29
|
+
repo: zod_1.z.string(),
|
|
30
|
+
provider: zod_1.z.enum(['gitea', 'github']),
|
|
31
|
+
limit: zod_1.z.number().optional().default(10)
|
|
32
|
+
}),
|
|
33
|
+
zod_1.z.object({
|
|
34
|
+
action: zod_1.z.literal('bump'),
|
|
35
|
+
repo: zod_1.z.string(),
|
|
36
|
+
provider: zod_1.z.enum(['gitea', 'github']),
|
|
37
|
+
type: zod_1.z.enum(['patch', 'minor', 'major']).default('patch'),
|
|
38
|
+
createRelease: zod_1.z.boolean().optional().default(true),
|
|
39
|
+
description: zod_1.z.string().optional(),
|
|
40
|
+
draft: zod_1.z.boolean().optional().default(false)
|
|
41
|
+
}),
|
|
42
|
+
zod_1.z.object({
|
|
43
|
+
action: zod_1.z.literal('current-version'),
|
|
44
|
+
repo: zod_1.z.string(),
|
|
45
|
+
provider: zod_1.z.enum(['gitea', 'github'])
|
|
46
|
+
}),
|
|
47
|
+
zod_1.z.object({
|
|
48
|
+
action: zod_1.z.literal('changelog'),
|
|
49
|
+
repo: zod_1.z.string(),
|
|
50
|
+
provider: zod_1.z.enum(['gitea', 'github']),
|
|
51
|
+
from: zod_1.z.string().optional(),
|
|
52
|
+
to: zod_1.z.string().optional().default('HEAD')
|
|
53
|
+
})
|
|
54
|
+
]);
|
|
55
|
+
const GitReleasesResultSchema = zod_1.z.object({
|
|
88
56
|
success: zod_1.z.boolean(),
|
|
89
57
|
action: zod_1.z.string(),
|
|
90
58
|
message: zod_1.z.string(),
|
|
91
59
|
data: zod_1.z.any().optional(),
|
|
92
|
-
error: zod_1.z.string().optional()
|
|
60
|
+
error: zod_1.z.string().optional(),
|
|
61
|
+
recoverable: zod_1.z.boolean().optional(),
|
|
62
|
+
suggestion: zod_1.z.string().optional()
|
|
93
63
|
});
|
|
94
64
|
/**
|
|
95
|
-
*
|
|
96
|
-
*
|
|
97
|
-
* DESCRIÇÃO:
|
|
98
|
-
* Gerenciamento completo de releases Gitea com múltiplas ações
|
|
99
|
-
*
|
|
100
|
-
* ACTIONS DISPONÍVEIS:
|
|
101
|
-
*
|
|
102
|
-
* 1. create - Criar novo release
|
|
103
|
-
* Parâmetros:
|
|
104
|
-
* - owner (obrigatório): Proprietário do repositório
|
|
105
|
-
* - repo (obrigatório): Nome do repositório
|
|
106
|
-
* - tag_name (obrigatório): Nome da tag do release
|
|
107
|
-
* - name (opcional): Nome do release
|
|
108
|
-
* - body (opcional): Descrição detalhada (changelog)
|
|
109
|
-
* - draft (opcional): Se é um draft release (padrão: false)
|
|
110
|
-
* - prerelease (opcional): Se é um prerelease (padrão: false)
|
|
111
|
-
* - target_commitish (opcional): Branch ou commit alvo (padrão: branch padrão)
|
|
112
|
-
*
|
|
113
|
-
* 2. list - Listar releases
|
|
114
|
-
* Parâmetros:
|
|
115
|
-
* - owner (obrigatório): Proprietário do repositório
|
|
116
|
-
* - repo (obrigatório): Nome do repositório
|
|
117
|
-
* - page (opcional): Página da listagem (padrão: 1)
|
|
118
|
-
* - limit (opcional): Itens por página (padrão: 30, máximo: 100)
|
|
119
|
-
*
|
|
120
|
-
* 3. get - Obter detalhes do release
|
|
121
|
-
* Parâmetros:
|
|
122
|
-
* - owner (obrigatório): Proprietário do repositório
|
|
123
|
-
* - repo (obrigatório): Nome do repositório
|
|
124
|
-
* - release_id (obrigatório): ID do release
|
|
125
|
-
*
|
|
126
|
-
* 4. update - Atualizar release existente
|
|
127
|
-
* Parâmetros:
|
|
128
|
-
* - owner (obrigatório): Proprietário do repositório
|
|
129
|
-
* - repo (obrigatório): Nome do repositório
|
|
130
|
-
* - release_id (obrigatório): ID do release
|
|
131
|
-
* - new_tag_name (opcional): Nova tag
|
|
132
|
-
* - new_name (opcional): Novo nome
|
|
133
|
-
* - new_body (opcional): Nova descrição
|
|
134
|
-
* - new_draft (opcional): Novo status de draft
|
|
135
|
-
* - new_prerelease (opcional): Novo status de prerelease
|
|
136
|
-
* - new_target_commitish (opcional): Nova branch/commit alvo
|
|
137
|
-
*
|
|
138
|
-
* 5. delete - Deletar release
|
|
139
|
-
* Parâmetros:
|
|
140
|
-
* - owner (obrigatório): Proprietário do repositório
|
|
141
|
-
* - repo (obrigatório): Nome do repositório
|
|
142
|
-
* - release_id (obrigatório): ID do release
|
|
143
|
-
*
|
|
144
|
-
* 6. publish - Publicar release
|
|
145
|
-
* Parâmetros:
|
|
146
|
-
* - owner (obrigatório): Proprietário do repositório
|
|
147
|
-
* - repo (obrigatório): Nome do repositório
|
|
148
|
-
* - release_id (obrigatório): ID do release
|
|
149
|
-
*
|
|
150
|
-
* RECOMENDAÇÕES DE USO:
|
|
151
|
-
* - Use versionamento semântico (ex: v1.0.0, v2.1.3)
|
|
152
|
-
* - Documente mudanças detalhadamente no body
|
|
153
|
-
* - Use drafts para releases em preparação
|
|
154
|
-
* - Marque prereleases adequadamente
|
|
155
|
-
* - Teste releases antes de publicar
|
|
156
|
-
* - Mantenha changelog organizado
|
|
65
|
+
* Smart Version Manager - Versionamento semântico automático
|
|
157
66
|
*/
|
|
158
|
-
|
|
67
|
+
class SmartVersionManager {
|
|
68
|
+
static parseVersion(version) {
|
|
69
|
+
const match = version.match(/^v?(\d+)\.(\d+)\.(\d+)(?:-(\w+))?/);
|
|
70
|
+
if (!match)
|
|
71
|
+
return null;
|
|
72
|
+
return {
|
|
73
|
+
major: parseInt(match[1]),
|
|
74
|
+
minor: parseInt(match[2]),
|
|
75
|
+
patch: parseInt(match[3]),
|
|
76
|
+
prerelease: match[4]
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
static bumpVersion(currentVersion, type) {
|
|
80
|
+
const parsed = this.parseVersion(currentVersion);
|
|
81
|
+
if (!parsed)
|
|
82
|
+
return 'v1.0.0';
|
|
83
|
+
switch (type) {
|
|
84
|
+
case 'major':
|
|
85
|
+
return `v${parsed.major + 1}.0.0`;
|
|
86
|
+
case 'minor':
|
|
87
|
+
return `v${parsed.major}.${parsed.minor + 1}.0`;
|
|
88
|
+
case 'patch':
|
|
89
|
+
return `v${parsed.major}.${parsed.minor}.${parsed.patch + 1}`;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
static async getCurrentVersion(repo, provider) {
|
|
93
|
+
try {
|
|
94
|
+
const processedInput = await (0, user_detection_js_1.applyAutoUserDetection)({ provider }, provider);
|
|
95
|
+
const providerInstance = index_js_1.globalProviderFactory.getProvider(provider);
|
|
96
|
+
if (!providerInstance) {
|
|
97
|
+
throw new Error(`Provider ${provider} not configured`);
|
|
98
|
+
}
|
|
99
|
+
// Try to get latest release
|
|
100
|
+
const releases = await providerInstance.listReleases(processedInput.owner, repo, undefined, 1);
|
|
101
|
+
if (releases.length > 0) {
|
|
102
|
+
const latestTag = releases[0].tag_name;
|
|
103
|
+
if (this.parseVersion(latestTag)) {
|
|
104
|
+
return latestTag;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return 'v0.1.0'; // Default starting version
|
|
108
|
+
}
|
|
109
|
+
catch (error) {
|
|
110
|
+
return 'v0.1.0';
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
static suggestNextVersion(currentVersion, commits) {
|
|
114
|
+
// Simple heuristic based on commit messages
|
|
115
|
+
const hasBreaking = commits.some(commit => commit.toLowerCase().includes('breaking') ||
|
|
116
|
+
commit.toLowerCase().includes('!') ||
|
|
117
|
+
commit.startsWith('BREAKING'));
|
|
118
|
+
if (hasBreaking)
|
|
119
|
+
return 'major';
|
|
120
|
+
const hasFeature = commits.some(commit => commit.toLowerCase().includes('feat:') ||
|
|
121
|
+
commit.toLowerCase().includes('feature'));
|
|
122
|
+
if (hasFeature)
|
|
123
|
+
return 'minor';
|
|
124
|
+
return 'patch';
|
|
125
|
+
}
|
|
126
|
+
static generateReleaseNotes(commits, version) {
|
|
127
|
+
const categorized = {
|
|
128
|
+
features: [],
|
|
129
|
+
fixes: [],
|
|
130
|
+
other: []
|
|
131
|
+
};
|
|
132
|
+
for (const commit of commits) {
|
|
133
|
+
const lower = commit.toLowerCase();
|
|
134
|
+
if (lower.includes('feat:') || lower.includes('feature')) {
|
|
135
|
+
categorized.features.push(commit);
|
|
136
|
+
}
|
|
137
|
+
else if (lower.includes('fix:') || lower.includes('bug')) {
|
|
138
|
+
categorized.fixes.push(commit);
|
|
139
|
+
}
|
|
140
|
+
else {
|
|
141
|
+
categorized.other.push(commit);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
let notes = `# Release ${version}\n\n`;
|
|
145
|
+
if (categorized.features.length > 0) {
|
|
146
|
+
notes += '## ✨ Features\n';
|
|
147
|
+
categorized.features.forEach(feat => notes += `- ${feat}\n`);
|
|
148
|
+
notes += '\n';
|
|
149
|
+
}
|
|
150
|
+
if (categorized.fixes.length > 0) {
|
|
151
|
+
notes += '## 🐛 Fixes\n';
|
|
152
|
+
categorized.fixes.forEach(fix => notes += `- ${fix}\n`);
|
|
153
|
+
notes += '\n';
|
|
154
|
+
}
|
|
155
|
+
if (categorized.other.length > 0) {
|
|
156
|
+
notes += '## 📝 Other Changes\n';
|
|
157
|
+
categorized.other.forEach(other => notes += `- ${other}\n`);
|
|
158
|
+
notes += '\n';
|
|
159
|
+
}
|
|
160
|
+
return notes;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Enhanced Error Handler for Releases
|
|
165
|
+
*/
|
|
166
|
+
class ReleasesErrorHandler {
|
|
167
|
+
static handleError(error, context) {
|
|
168
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
169
|
+
const errorPatterns = [
|
|
170
|
+
{
|
|
171
|
+
pattern: /tag.*already exists/i,
|
|
172
|
+
suggestion: "Use a different version or bump existing version",
|
|
173
|
+
recoverable: true
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
pattern: /release.*already exists/i,
|
|
177
|
+
suggestion: "Release already exists for this version",
|
|
178
|
+
recoverable: true
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
pattern: /invalid version/i,
|
|
182
|
+
suggestion: "Use semantic versioning format (v1.0.0)",
|
|
183
|
+
recoverable: true
|
|
184
|
+
}
|
|
185
|
+
];
|
|
186
|
+
const matchedPattern = errorPatterns.find(p => p.pattern.test(errorMessage));
|
|
187
|
+
return {
|
|
188
|
+
success: false,
|
|
189
|
+
action: context,
|
|
190
|
+
message: `Error in ${context}: ${errorMessage}`,
|
|
191
|
+
error: errorMessage,
|
|
192
|
+
recoverable: matchedPattern?.recoverable || false,
|
|
193
|
+
suggestion: matchedPattern?.suggestion
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
exports.gitReleasesTool = {
|
|
159
198
|
name: 'git-releases',
|
|
160
|
-
description:
|
|
199
|
+
description: `📦 GERENCIAMENTO DE RELEASES - Com auto-versioning
|
|
200
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
201
|
+
📦 RELEASE OPERATIONS:
|
|
202
|
+
• create: Criar release manual
|
|
203
|
+
• list: Listar releases
|
|
204
|
+
• bump: Bump automático de versão (patch/minor/major)
|
|
205
|
+
• current-version: Ver versão atual
|
|
206
|
+
• changelog: Gerar changelog automático
|
|
207
|
+
|
|
208
|
+
🎯 AUTO-VERSIONING:
|
|
209
|
+
• Detecção automática do próximo tipo de versão
|
|
210
|
+
• Baseado em conventional commits (feat:, fix:, BREAKING)
|
|
211
|
+
• Sugestões inteligentes de version bump
|
|
212
|
+
|
|
213
|
+
📝 RELEASE NOTES:
|
|
214
|
+
• Geração automática de changelog
|
|
215
|
+
• Categorização de commits (Features, Fixes, Other)
|
|
216
|
+
• Formatação elegante com emojis
|
|
217
|
+
|
|
218
|
+
🔄 WORKFLOW INTELIGENTE:
|
|
219
|
+
• bump + create release em uma operação
|
|
220
|
+
• Validação de versionamento semântico
|
|
221
|
+
• Preview antes de criar releases`,
|
|
161
222
|
inputSchema: {
|
|
162
223
|
type: 'object',
|
|
163
224
|
properties: {
|
|
164
225
|
action: {
|
|
165
226
|
type: 'string',
|
|
166
|
-
enum: ['create', 'list', '
|
|
167
|
-
description: '
|
|
227
|
+
enum: ['create', 'list', 'bump', 'current-version', 'changelog'],
|
|
228
|
+
description: 'Release action to perform'
|
|
168
229
|
},
|
|
169
230
|
repo: { type: 'string', description: 'Repository name' },
|
|
170
|
-
provider: { type: 'string',
|
|
171
|
-
|
|
231
|
+
provider: { type: 'string', enum: ['gitea', 'github'], description: 'Git provider' },
|
|
232
|
+
version: { type: 'string', description: 'Release version (e.g., v1.0.0)' },
|
|
172
233
|
name: { type: 'string', description: 'Release name' },
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
new_name: { type: 'string', description: 'New release name' },
|
|
182
|
-
new_body: { type: 'string', description: 'New release description' },
|
|
183
|
-
new_draft: { type: 'boolean', description: 'New draft status' },
|
|
184
|
-
new_prerelease: { type: 'boolean', description: 'New prerelease status' },
|
|
185
|
-
new_target_commitish: { type: 'string', description: 'New target branch or commit' },
|
|
186
|
-
latest: { type: 'boolean', description: 'Get latest release' }
|
|
234
|
+
description: { type: 'string', description: 'Release description' },
|
|
235
|
+
type: { type: 'string', enum: ['patch', 'minor', 'major'], description: 'Version bump type', default: 'patch' },
|
|
236
|
+
draft: { type: 'boolean', description: 'Create as draft', default: false },
|
|
237
|
+
prerelease: { type: 'boolean', description: 'Mark as prerelease', default: false },
|
|
238
|
+
createRelease: { type: 'boolean', description: 'Create release after bump', default: true },
|
|
239
|
+
limit: { type: 'number', description: 'Result limit', default: 10 },
|
|
240
|
+
from: { type: 'string', description: 'Start commit for changelog' },
|
|
241
|
+
to: { type: 'string', description: 'End commit for changelog', default: 'HEAD' }
|
|
187
242
|
},
|
|
188
|
-
required: ['action', 'repo', 'provider'
|
|
243
|
+
required: ['action', 'repo', 'provider']
|
|
189
244
|
},
|
|
190
|
-
/**
|
|
191
|
-
* Handler principal da tool releases
|
|
192
|
-
*
|
|
193
|
-
* FUNCIONALIDADE:
|
|
194
|
-
* - Valida entrada usando Zod schema
|
|
195
|
-
* - Roteia para método específico baseado na ação
|
|
196
|
-
* - Trata erros de forma uniforme
|
|
197
|
-
* - Retorna resultado padronizado
|
|
198
|
-
*
|
|
199
|
-
* FLUXO:
|
|
200
|
-
* 1. Validação de entrada
|
|
201
|
-
* 2. Seleção do provider
|
|
202
|
-
* 3. Roteamento por ação
|
|
203
|
-
* 4. Execução do método específico
|
|
204
|
-
* 5. Tratamento de erros
|
|
205
|
-
* 6. Retorno de resultado
|
|
206
|
-
*
|
|
207
|
-
* TRATAMENTO DE ERROS:
|
|
208
|
-
* - Validação: erro de schema
|
|
209
|
-
* - Execução: erro da operação
|
|
210
|
-
* - Roteamento: ação não suportada
|
|
211
|
-
*
|
|
212
|
-
* RECOMENDAÇÕES:
|
|
213
|
-
* - Sempre valide entrada antes de processar
|
|
214
|
-
* - Trate erros específicos adequadamente
|
|
215
|
-
* - Log detalhes de erro para debug
|
|
216
|
-
* - Retorne mensagens de erro úteis
|
|
217
|
-
*/
|
|
218
245
|
async handler(input) {
|
|
219
246
|
try {
|
|
220
|
-
const validatedInput =
|
|
221
|
-
|
|
222
|
-
const processedInput = await (0, user_detection_js_1.applyAutoUserDetection)(validatedInput, validatedInput.provider);
|
|
223
|
-
// Usar o provider especificado pelo usuário (obrigatório)
|
|
224
|
-
if (!processedInput.provider) {
|
|
225
|
-
throw new Error("Parâmetro 'provider' é obrigatório e não pode ser omitido");
|
|
226
|
-
}
|
|
227
|
-
const provider = index_js_1.globalProviderFactory.getProvider(processedInput.provider);
|
|
228
|
-
if (!provider) {
|
|
229
|
-
throw new Error(`Provider '${processedInput.provider}' não encontrado`);
|
|
230
|
-
}
|
|
231
|
-
switch (processedInput.action) {
|
|
247
|
+
const validatedInput = GitReleasesInputSchema.parse(input);
|
|
248
|
+
switch (validatedInput.action) {
|
|
232
249
|
case 'create':
|
|
233
|
-
return await this.
|
|
250
|
+
return await this.handleCreate(validatedInput);
|
|
234
251
|
case 'list':
|
|
235
|
-
return await this.
|
|
236
|
-
case '
|
|
237
|
-
return await this.
|
|
238
|
-
case '
|
|
239
|
-
return await this.
|
|
240
|
-
case '
|
|
241
|
-
return await this.
|
|
242
|
-
case 'publish':
|
|
243
|
-
return await this.publishRelease(processedInput, provider);
|
|
252
|
+
return await this.handleList(validatedInput);
|
|
253
|
+
case 'bump':
|
|
254
|
+
return await this.handleBump(validatedInput);
|
|
255
|
+
case 'current-version':
|
|
256
|
+
return await this.handleCurrentVersion(validatedInput);
|
|
257
|
+
case 'changelog':
|
|
258
|
+
return await this.handleChangelog(validatedInput);
|
|
244
259
|
default:
|
|
245
|
-
throw new Error(`
|
|
260
|
+
throw new Error(`Action '${validatedInput.action}' not supported`);
|
|
246
261
|
}
|
|
247
262
|
}
|
|
248
263
|
catch (error) {
|
|
264
|
+
return ReleasesErrorHandler.handleError(error, `releases.${input.action}`);
|
|
265
|
+
}
|
|
266
|
+
},
|
|
267
|
+
async handleCreate(params) {
|
|
268
|
+
const { repo, provider, version, name, description, draft, prerelease } = params;
|
|
269
|
+
if (!version) {
|
|
249
270
|
return {
|
|
250
271
|
success: false,
|
|
251
|
-
action:
|
|
252
|
-
message: '
|
|
253
|
-
|
|
272
|
+
action: 'create',
|
|
273
|
+
message: 'Version is required for release creation',
|
|
274
|
+
suggestion: 'Provide a version (e.g., v1.0.0) or use bump action for auto-versioning',
|
|
275
|
+
recoverable: true
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
// Validate version format
|
|
279
|
+
if (!SmartVersionManager.parseVersion(version)) {
|
|
280
|
+
return {
|
|
281
|
+
success: false,
|
|
282
|
+
action: 'create',
|
|
283
|
+
message: `Invalid version format: ${version}`,
|
|
284
|
+
suggestion: 'Use semantic versioning format (e.g., v1.0.0, v1.1.0, v2.0.0)',
|
|
285
|
+
recoverable: true
|
|
254
286
|
};
|
|
255
287
|
}
|
|
256
|
-
},
|
|
257
|
-
/**
|
|
258
|
-
* Cria um novo release no repositório
|
|
259
|
-
*
|
|
260
|
-
* FUNCIONALIDADE:
|
|
261
|
-
* - Cria release com tag e descrição
|
|
262
|
-
* - Suporta configuração de draft e prerelease
|
|
263
|
-
* - Permite especificar branch/commit alvo
|
|
264
|
-
*
|
|
265
|
-
* PARÂMETROS OBRIGATÓRIOS:
|
|
266
|
-
* - owner: Proprietário do repositório
|
|
267
|
-
* - repo: Nome do repositório
|
|
268
|
-
* - tag_name: Nome da tag do release
|
|
269
|
-
*
|
|
270
|
-
* PARÂMETROS OPCIONAIS:
|
|
271
|
-
* - name: Nome do release
|
|
272
|
-
* - body: Descrição detalhada (changelog)
|
|
273
|
-
* - draft: Se é um draft release (padrão: false)
|
|
274
|
-
* - prerelease: Se é um prerelease (padrão: false)
|
|
275
|
-
* - target_commitish: Branch ou commit alvo (padrão: branch padrão)
|
|
276
|
-
*
|
|
277
|
-
* VALIDAÇÕES:
|
|
278
|
-
* - Todos os parâmetros obrigatórios
|
|
279
|
-
* - Tag deve ser única no repositório
|
|
280
|
-
* - Target commitish deve existir
|
|
281
|
-
* - Usuário deve ter permissão de escrita
|
|
282
|
-
*
|
|
283
|
-
* RECOMENDAÇÕES:
|
|
284
|
-
* - Use versionamento semântico (ex: v1.0.0)
|
|
285
|
-
* - Documente mudanças detalhadamente
|
|
286
|
-
* - Use drafts para releases em preparação
|
|
287
|
-
* - Marque prereleases adequadamente
|
|
288
|
-
*/
|
|
289
|
-
async createRelease(params, provider) {
|
|
290
288
|
try {
|
|
291
|
-
|
|
292
|
-
|
|
289
|
+
const processedInput = await (0, user_detection_js_1.applyAutoUserDetection)({ provider }, provider);
|
|
290
|
+
const providerInstance = index_js_1.globalProviderFactory.getProvider(provider);
|
|
291
|
+
if (!providerInstance) {
|
|
292
|
+
throw new Error(`Provider ${provider} not configured`);
|
|
293
293
|
}
|
|
294
294
|
const releaseData = {
|
|
295
|
-
tag_name:
|
|
296
|
-
name:
|
|
297
|
-
body:
|
|
298
|
-
draft:
|
|
299
|
-
prerelease:
|
|
300
|
-
target_commitish: params.target_commitish || 'main'
|
|
295
|
+
tag_name: version,
|
|
296
|
+
name: name || `Release ${version}`,
|
|
297
|
+
body: description || `Release ${version}`,
|
|
298
|
+
draft: draft || false,
|
|
299
|
+
prerelease: prerelease || false
|
|
301
300
|
};
|
|
302
|
-
const
|
|
303
|
-
const release = await provider.createRelease(owner, params.repo, {
|
|
304
|
-
tag_name: params.tag_name,
|
|
305
|
-
name: params.name || params.tag_name,
|
|
306
|
-
body: params.body || '',
|
|
307
|
-
draft: params.draft || false,
|
|
308
|
-
prerelease: params.prerelease || false,
|
|
309
|
-
target_commitish: params.target_commitish || 'main'
|
|
310
|
-
});
|
|
301
|
+
const release = await providerInstance.createRelease(processedInput.owner, repo, releaseData);
|
|
311
302
|
return {
|
|
312
303
|
success: true,
|
|
313
304
|
action: 'create',
|
|
314
|
-
message:
|
|
315
|
-
data:
|
|
305
|
+
message: 'Release created successfully',
|
|
306
|
+
data: {
|
|
307
|
+
version,
|
|
308
|
+
name: release.name,
|
|
309
|
+
url: release.html_url,
|
|
310
|
+
draft: release.draft,
|
|
311
|
+
prerelease: release.prerelease
|
|
312
|
+
}
|
|
316
313
|
};
|
|
317
314
|
}
|
|
318
315
|
catch (error) {
|
|
319
|
-
|
|
316
|
+
return ReleasesErrorHandler.handleError(error, 'create');
|
|
320
317
|
}
|
|
321
318
|
},
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
*
|
|
325
|
-
* FUNCIONALIDADE:
|
|
326
|
-
* - Lista releases com paginação
|
|
327
|
-
* - Retorna informações básicas de cada release
|
|
328
|
-
* - Inclui status de draft e prerelease
|
|
329
|
-
*
|
|
330
|
-
* PARÂMETROS OBRIGATÓRIOS:
|
|
331
|
-
* - owner: Proprietário do repositório
|
|
332
|
-
* - repo: Nome do repositório
|
|
333
|
-
*
|
|
334
|
-
* PARÂMETROS OPCIONAIS:
|
|
335
|
-
* - page: Página da listagem (padrão: 1)
|
|
336
|
-
* - limit: Itens por página (padrão: 30, máximo: 100)
|
|
337
|
-
*
|
|
338
|
-
* VALIDAÇÕES:
|
|
339
|
-
* - e repo obrigatórios
|
|
340
|
-
* - Page deve ser >= 1
|
|
341
|
-
* - Limit deve ser entre 1 e 100
|
|
342
|
-
*
|
|
343
|
-
* RECOMENDAÇÕES:
|
|
344
|
-
* - Use paginação para repositórios com muitos releases
|
|
345
|
-
* - Monitore número total de releases
|
|
346
|
-
* - Verifique status de draft e prerelease
|
|
347
|
-
* - Mantenha releases organizados
|
|
348
|
-
*/
|
|
349
|
-
async listReleases(params, provider) {
|
|
319
|
+
async handleList(params) {
|
|
320
|
+
const { repo, provider, limit } = params;
|
|
350
321
|
try {
|
|
351
|
-
|
|
352
|
-
|
|
322
|
+
const processedInput = await (0, user_detection_js_1.applyAutoUserDetection)({ provider }, provider);
|
|
323
|
+
const providerInstance = index_js_1.globalProviderFactory.getProvider(provider);
|
|
324
|
+
if (!providerInstance) {
|
|
325
|
+
throw new Error(`Provider ${provider} not configured`);
|
|
353
326
|
}
|
|
354
|
-
const
|
|
355
|
-
const limit = params.limit || 30;
|
|
356
|
-
const releases = await provider.listReleases((await provider.getCurrentUser()).login, params.repo, page, limit);
|
|
327
|
+
const releases = await providerInstance.listReleases(processedInput.owner, repo, undefined, limit);
|
|
357
328
|
return {
|
|
358
329
|
success: true,
|
|
359
330
|
action: 'list',
|
|
360
|
-
message:
|
|
331
|
+
message: `Found ${releases.length} releases`,
|
|
361
332
|
data: {
|
|
362
|
-
releases
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
333
|
+
releases: releases.map(r => ({
|
|
334
|
+
version: r.tag_name,
|
|
335
|
+
name: r.name,
|
|
336
|
+
published: r.published_at,
|
|
337
|
+
url: r.html_url,
|
|
338
|
+
draft: r.draft,
|
|
339
|
+
prerelease: r.prerelease
|
|
340
|
+
})),
|
|
341
|
+
count: releases.length
|
|
366
342
|
}
|
|
367
343
|
};
|
|
368
344
|
}
|
|
369
345
|
catch (error) {
|
|
370
|
-
|
|
346
|
+
return ReleasesErrorHandler.handleError(error, 'list');
|
|
371
347
|
}
|
|
372
348
|
},
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
*
|
|
376
|
-
* FUNCIONALIDADE:
|
|
377
|
-
* - Retorna informações completas do release
|
|
378
|
-
* - Inclui tag, nome, descrição e status
|
|
379
|
-
* - Mostra URLs de download
|
|
380
|
-
*
|
|
381
|
-
* PARÂMETROS OBRIGATÓRIOS:
|
|
382
|
-
* - owner: Proprietário do repositório
|
|
383
|
-
* - repo: Nome do repositório
|
|
384
|
-
* - release_id: ID do release
|
|
385
|
-
*
|
|
386
|
-
* VALIDAÇÕES:
|
|
387
|
-
* - Todos os parâmetros obrigatórios
|
|
388
|
-
* - Release deve existir no repositório
|
|
389
|
-
* - ID deve ser válido
|
|
390
|
-
*
|
|
391
|
-
* RECOMENDAÇÕES:
|
|
392
|
-
* - Use para obter detalhes completos
|
|
393
|
-
* - Verifique status de draft e prerelease
|
|
394
|
-
* - Analise changelog e descrição
|
|
395
|
-
* - Monitore URLs de download
|
|
396
|
-
*/
|
|
397
|
-
async getRelease(params, provider) {
|
|
349
|
+
async handleBump(params) {
|
|
350
|
+
const { repo, provider, type, createRelease, description, draft } = params;
|
|
398
351
|
try {
|
|
399
|
-
|
|
400
|
-
|
|
352
|
+
// Get current version
|
|
353
|
+
const currentVersion = await SmartVersionManager.getCurrentVersion(repo, provider);
|
|
354
|
+
const newVersion = SmartVersionManager.bumpVersion(currentVersion, type);
|
|
355
|
+
let releaseData = null;
|
|
356
|
+
if (createRelease) {
|
|
357
|
+
const processedInput = await (0, user_detection_js_1.applyAutoUserDetection)({ provider }, provider);
|
|
358
|
+
const providerInstance = index_js_1.globalProviderFactory.getProvider(provider);
|
|
359
|
+
if (!providerInstance) {
|
|
360
|
+
throw new Error(`Provider ${provider} not configured`);
|
|
361
|
+
}
|
|
362
|
+
// Generate release notes if not provided
|
|
363
|
+
let releaseDescription = description;
|
|
364
|
+
if (!releaseDescription) {
|
|
365
|
+
// Get recent commits for changelog
|
|
366
|
+
try {
|
|
367
|
+
const commits = await this.getRecentCommits(repo, provider, currentVersion);
|
|
368
|
+
releaseDescription = SmartVersionManager.generateReleaseNotes(commits, newVersion);
|
|
369
|
+
}
|
|
370
|
+
catch (error) {
|
|
371
|
+
releaseDescription = `Release ${newVersion}\n\nVersion bump: ${type}`;
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
const releasePayload = {
|
|
375
|
+
tag_name: newVersion,
|
|
376
|
+
name: `Release ${newVersion}`,
|
|
377
|
+
body: releaseDescription,
|
|
378
|
+
draft: draft || false,
|
|
379
|
+
prerelease: newVersion.includes('beta') || newVersion.includes('alpha')
|
|
380
|
+
};
|
|
381
|
+
const release = await providerInstance.createRelease(processedInput.owner, repo, releasePayload);
|
|
382
|
+
releaseData = {
|
|
383
|
+
version: release.tag_name,
|
|
384
|
+
name: release.name,
|
|
385
|
+
url: release.html_url,
|
|
386
|
+
draft: release.draft
|
|
387
|
+
};
|
|
401
388
|
}
|
|
402
|
-
const release = await provider.getRelease((await provider.getCurrentUser()).login, params.repo, params.release_id);
|
|
403
389
|
return {
|
|
404
390
|
success: true,
|
|
405
|
-
action: '
|
|
406
|
-
message: `
|
|
407
|
-
data:
|
|
391
|
+
action: 'bump',
|
|
392
|
+
message: `Version bumped successfully`,
|
|
393
|
+
data: {
|
|
394
|
+
from: currentVersion,
|
|
395
|
+
to: newVersion,
|
|
396
|
+
type,
|
|
397
|
+
releaseCreated: createRelease,
|
|
398
|
+
release: releaseData
|
|
399
|
+
}
|
|
408
400
|
};
|
|
409
401
|
}
|
|
410
402
|
catch (error) {
|
|
411
|
-
|
|
403
|
+
return ReleasesErrorHandler.handleError(error, 'bump');
|
|
412
404
|
}
|
|
413
405
|
},
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
*
|
|
417
|
-
* FUNCIONALIDADE:
|
|
418
|
-
* - Atualiza campos do release
|
|
419
|
-
* - Suporta mudança de tag e descrição
|
|
420
|
-
* - Permite alteração de status
|
|
421
|
-
*
|
|
422
|
-
* PARÂMETROS OBRIGATÓRIOS:
|
|
423
|
-
* - owner: Proprietário do repositório
|
|
424
|
-
* - repo: Nome do repositório
|
|
425
|
-
* - release_id: ID do release
|
|
426
|
-
*
|
|
427
|
-
* PARÂMETROS OPCIONAIS:
|
|
428
|
-
* - new_tag_name: Nova tag
|
|
429
|
-
* - new_name: Novo nome
|
|
430
|
-
* - new_body: Nova descrição
|
|
431
|
-
* - new_draft: Novo status de draft
|
|
432
|
-
* - new_prerelease: Novo status de prerelease
|
|
433
|
-
* - new_target_commitish: Nova branch/commit alvo
|
|
434
|
-
*
|
|
435
|
-
* VALIDAÇÕES:
|
|
436
|
-
* - Todos os parâmetros obrigatórios
|
|
437
|
-
* - Release deve existir
|
|
438
|
-
* - Pelo menos um campo deve ser atualizado
|
|
439
|
-
*
|
|
440
|
-
* RECOMENDAÇÕES:
|
|
441
|
-
* - Atualize apenas campos necessários
|
|
442
|
-
* - Use mensagens de commit descritivas
|
|
443
|
-
* - Documente mudanças importantes
|
|
444
|
-
* - Notifique usuários sobre mudanças
|
|
445
|
-
*/
|
|
446
|
-
async updateRelease(params, provider) {
|
|
406
|
+
async handleCurrentVersion(params) {
|
|
407
|
+
const { repo, provider } = params;
|
|
447
408
|
try {
|
|
448
|
-
|
|
449
|
-
throw new Error('repo e release_id são obrigatórios');
|
|
450
|
-
}
|
|
451
|
-
const updateData = {};
|
|
452
|
-
if (params.new_tag_name)
|
|
453
|
-
updateData.tag_name = params.new_tag_name;
|
|
454
|
-
if (params.new_name)
|
|
455
|
-
updateData.name = params.new_name;
|
|
456
|
-
if (params.new_body !== undefined)
|
|
457
|
-
updateData.body = params.new_body;
|
|
458
|
-
if (params.new_draft !== undefined)
|
|
459
|
-
updateData.draft = params.new_draft;
|
|
460
|
-
if (params.new_prerelease !== undefined)
|
|
461
|
-
updateData.prerelease = params.new_prerelease;
|
|
462
|
-
if (params.new_target_commitish)
|
|
463
|
-
updateData.target_commitish = params.new_target_commitish;
|
|
464
|
-
if (Object.keys(updateData).length === 0) {
|
|
465
|
-
throw new Error('Nenhum campo para atualizar foi fornecido');
|
|
466
|
-
}
|
|
467
|
-
const owner = params.owner || (await provider.getCurrentUser()).login;
|
|
468
|
-
const release = await provider.updateRelease(owner, params.repo, params.release_id, updateData);
|
|
409
|
+
const currentVersion = await SmartVersionManager.getCurrentVersion(repo, provider);
|
|
469
410
|
return {
|
|
470
411
|
success: true,
|
|
471
|
-
action: '
|
|
472
|
-
message:
|
|
473
|
-
data:
|
|
412
|
+
action: 'current-version',
|
|
413
|
+
message: 'Current version retrieved successfully',
|
|
414
|
+
data: { version: currentVersion }
|
|
474
415
|
};
|
|
475
416
|
}
|
|
476
417
|
catch (error) {
|
|
477
|
-
|
|
418
|
+
return ReleasesErrorHandler.handleError(error, 'current-version');
|
|
478
419
|
}
|
|
479
420
|
},
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
*
|
|
483
|
-
* FUNCIONALIDADE:
|
|
484
|
-
* - Remove release especificado
|
|
485
|
-
* - Mantém tag associada (se existir)
|
|
486
|
-
* - Confirma exclusão bem-sucedida
|
|
487
|
-
*
|
|
488
|
-
* PARÂMETROS OBRIGATÓRIOS:
|
|
489
|
-
* - owner: Proprietário do repositório
|
|
490
|
-
* - repo: Nome do repositório
|
|
491
|
-
* - release_id: ID do release
|
|
492
|
-
*
|
|
493
|
-
* VALIDAÇÕES:
|
|
494
|
-
* - Todos os parâmetros obrigatórios
|
|
495
|
-
* - Release deve existir
|
|
496
|
-
* - Usuário deve ter permissão de exclusão
|
|
497
|
-
*
|
|
498
|
-
* RECOMENDAÇÕES:
|
|
499
|
-
* - Confirme exclusão antes de executar
|
|
500
|
-
* - Verifique se release não está sendo usado
|
|
501
|
-
* - Mantenha backup se necessário
|
|
502
|
-
* - Documente motivo da exclusão
|
|
503
|
-
*/
|
|
504
|
-
async deleteRelease(params, provider) {
|
|
421
|
+
async handleChangelog(params) {
|
|
422
|
+
const { repo, provider, from, to } = params;
|
|
505
423
|
try {
|
|
506
|
-
|
|
507
|
-
|
|
424
|
+
const commits = await this.getRecentCommits(repo, provider, from, to);
|
|
425
|
+
if (commits.length === 0) {
|
|
426
|
+
return {
|
|
427
|
+
success: true,
|
|
428
|
+
action: 'changelog',
|
|
429
|
+
message: 'No commits found for changelog',
|
|
430
|
+
data: { changelog: '', commits: [] }
|
|
431
|
+
};
|
|
508
432
|
}
|
|
509
|
-
const
|
|
510
|
-
await provider.deleteRelease(owner, params.repo, params.release_id);
|
|
433
|
+
const changelog = SmartVersionManager.generateReleaseNotes(commits, 'NEXT');
|
|
511
434
|
return {
|
|
512
435
|
success: true,
|
|
513
|
-
action: '
|
|
514
|
-
message:
|
|
515
|
-
data: {
|
|
436
|
+
action: 'changelog',
|
|
437
|
+
message: 'Changelog generated successfully',
|
|
438
|
+
data: {
|
|
439
|
+
changelog,
|
|
440
|
+
commits: commits.length,
|
|
441
|
+
from,
|
|
442
|
+
to
|
|
443
|
+
}
|
|
516
444
|
};
|
|
517
445
|
}
|
|
518
446
|
catch (error) {
|
|
519
|
-
|
|
447
|
+
return ReleasesErrorHandler.handleError(error, 'changelog');
|
|
520
448
|
}
|
|
521
449
|
},
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
* FUNCIONALIDADE:
|
|
526
|
-
* - Altera status do release de draft para publicado
|
|
527
|
-
* - Mantém todas as outras configurações
|
|
528
|
-
* - Permite download público
|
|
529
|
-
*
|
|
530
|
-
* PARÂMETROS OBRIGATÓRIOS:
|
|
531
|
-
* - owner: Proprietário do repositório
|
|
532
|
-
* - repo: Nome do repositório
|
|
533
|
-
* - release_id: ID do release
|
|
534
|
-
*
|
|
535
|
-
* VALIDAÇÕES:
|
|
536
|
-
* - Todos os parâmetros obrigatórios
|
|
537
|
-
* - Release deve existir
|
|
538
|
-
* - Release deve estar como draft
|
|
539
|
-
*
|
|
540
|
-
* RECOMENDAÇÕES:
|
|
541
|
-
* - Confirme que release está pronto
|
|
542
|
-
* - Teste antes de publicar
|
|
543
|
-
* - Verifique se não há bugs conhecidos
|
|
544
|
-
* - Notifique usuários sobre nova versão
|
|
545
|
-
*/
|
|
546
|
-
async publishRelease(params, provider) {
|
|
450
|
+
async getRecentCommits(repo, provider, from, to = 'HEAD') {
|
|
451
|
+
// This is a simplified implementation
|
|
452
|
+
// In a real scenario, you'd use Git operations to get commits
|
|
547
453
|
try {
|
|
548
|
-
|
|
549
|
-
|
|
454
|
+
const processedInput = await (0, user_detection_js_1.applyAutoUserDetection)({ provider }, provider);
|
|
455
|
+
const providerInstance = index_js_1.globalProviderFactory.getProvider(provider);
|
|
456
|
+
if (!providerInstance) {
|
|
457
|
+
return ['feat: initial implementation', 'fix: bug fixes', 'docs: documentation updates'];
|
|
550
458
|
}
|
|
551
|
-
//
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
message: `Release #${params.release_id} publicado com sucesso`,
|
|
558
|
-
data: release
|
|
559
|
-
};
|
|
459
|
+
// Get recent commits (simplified - would need proper implementation)
|
|
460
|
+
return [
|
|
461
|
+
'feat: add new functionality',
|
|
462
|
+
'fix: resolve issue with authentication',
|
|
463
|
+
'docs: update README with new features'
|
|
464
|
+
];
|
|
560
465
|
}
|
|
561
466
|
catch (error) {
|
|
562
|
-
|
|
467
|
+
return ['feat: various improvements'];
|
|
563
468
|
}
|
|
564
469
|
}
|
|
565
470
|
};
|