@andrebuzeli/git-mcp 5.9.0 → 6.0.0
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/tools/gitIssues.js
CHANGED
|
@@ -13,16 +13,14 @@ class GitIssuesTool {
|
|
|
13
13
|
if (!action)
|
|
14
14
|
throw new errors_1.MCPError('VALIDATION_ERROR', 'action is required');
|
|
15
15
|
// Auto-extract repo info if projectPath is provided
|
|
16
|
-
let owner = params.owner;
|
|
17
16
|
let repo = params.repo;
|
|
18
17
|
if (!repo && params.projectPath) {
|
|
19
18
|
const repoInfo = (0, repoHelpers_1.getRepoInfo)(params.projectPath);
|
|
20
19
|
repo = repoInfo.repoName;
|
|
21
|
-
owner = owner || repoInfo.githubOwner || repoInfo.giteaOwner;
|
|
22
20
|
}
|
|
23
|
-
//
|
|
24
|
-
const githubOwner =
|
|
25
|
-
const giteaOwner =
|
|
21
|
+
// Each provider uses its own username from env
|
|
22
|
+
const githubOwner = process.env.GITHUB_USERNAME;
|
|
23
|
+
const giteaOwner = process.env.GITEA_USERNAME;
|
|
26
24
|
switch (action) {
|
|
27
25
|
case 'create': {
|
|
28
26
|
if (!params.title)
|
package/dist/tools/gitUpload.js
CHANGED
|
@@ -42,6 +42,7 @@ const errors_1 = require("../utils/errors");
|
|
|
42
42
|
const axios_1 = __importDefault(require("axios"));
|
|
43
43
|
const fs = __importStar(require("fs/promises"));
|
|
44
44
|
const path = __importStar(require("path"));
|
|
45
|
+
const repoHelpers_1 = require("../utils/repoHelpers");
|
|
45
46
|
/**
|
|
46
47
|
* Git Upload Tool - Envia projeto completo para GitHub e Gitea automaticamente
|
|
47
48
|
* Modo DUAL automático com rastreabilidade completa
|
|
@@ -56,7 +57,7 @@ class GitUploadTool {
|
|
|
56
57
|
if (!projectPath) {
|
|
57
58
|
throw new errors_1.MCPError('VALIDATION_ERROR', 'projectPath is required');
|
|
58
59
|
}
|
|
59
|
-
const repoName = params.repoName ||
|
|
60
|
+
const repoName = params.repoName || (0, repoHelpers_1.getRepoNameFromPath)(projectPath);
|
|
60
61
|
const description = params.description || `Project uploaded via git-upload at ${new Date().toISOString()}`;
|
|
61
62
|
const isPrivate = params.private !== undefined ? params.private : true;
|
|
62
63
|
const branch = params.branch || 'master';
|
|
@@ -130,8 +131,8 @@ class GitUploadTool {
|
|
|
130
131
|
}
|
|
131
132
|
// 4. Criar repositórios remotos em ambos providers
|
|
132
133
|
// Nota: Cada provider precisa usar seu próprio username (Gitea é case-sensitive)
|
|
133
|
-
const githubOwner =
|
|
134
|
-
const giteaOwner =
|
|
134
|
+
const githubOwner = process.env.GITHUB_USERNAME;
|
|
135
|
+
const giteaOwner = process.env.GITEA_USERNAME;
|
|
135
136
|
// GITHUB
|
|
136
137
|
if (ctx.providerManager.github) {
|
|
137
138
|
results.traceability.uploadSteps.push({
|
|
@@ -16,9 +16,13 @@ const path_1 = __importDefault(require("path"));
|
|
|
16
16
|
*/
|
|
17
17
|
/**
|
|
18
18
|
* Extract repository name from project path
|
|
19
|
+
* Normalizes: spaces to hyphens, lowercase, removes special chars
|
|
19
20
|
*/
|
|
20
21
|
function getRepoNameFromPath(projectPath) {
|
|
21
|
-
return path_1.default.basename(projectPath)
|
|
22
|
+
return path_1.default.basename(projectPath)
|
|
23
|
+
.toLowerCase()
|
|
24
|
+
.replace(/\s+/g, '-')
|
|
25
|
+
.replace(/[^a-z0-9-]/g, '');
|
|
22
26
|
}
|
|
23
27
|
/**
|
|
24
28
|
* Get GitHub owner from environment
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@andrebuzeli/git-mcp",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "Professional MCP server for Git operations -
|
|
3
|
+
"version": "6.0.0",
|
|
4
|
+
"description": "Professional MCP server for Git operations - FULLY AUTONOMOUS: each provider uses own username from env, repo name auto-normalized from projectPath (spaces→hyphens, lowercase, safe chars), zero redundant parameters, automatic dual-provider execution (GitHub + Gitea)",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"bin": {
|