@andrebuzeli/git-mcp 15.2.1 → 15.2.3
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/package.json +5 -7
- package/src/tools/git-workflow.js +13 -0
- package/src/utils/gitAdapter.js +584 -1087
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@andrebuzeli/git-mcp",
|
|
3
|
-
"version": "15.2.
|
|
3
|
+
"version": "15.2.3",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "MCP server para Git com operações locais e sincronização paralela GitHub/Gitea",
|
|
6
6
|
"license": "MIT",
|
|
@@ -18,13 +18,11 @@
|
|
|
18
18
|
"git-mcp": "src/index.js",
|
|
19
19
|
"git-mcpv2": "src/index.js"
|
|
20
20
|
},
|
|
21
|
-
"scripts": {
|
|
22
|
-
},
|
|
21
|
+
"scripts": {},
|
|
23
22
|
"dependencies": {
|
|
24
|
-
"
|
|
25
|
-
"axios": "^1.7.7",
|
|
23
|
+
"@modelcontextprotocol/sdk": "^0.4.0",
|
|
26
24
|
"@octokit/rest": "^20.0.0",
|
|
27
|
-
"
|
|
28
|
-
"
|
|
25
|
+
"ajv": "^8.12.0",
|
|
26
|
+
"axios": "^1.7.7"
|
|
29
27
|
}
|
|
30
28
|
}
|
|
@@ -71,7 +71,14 @@ QUANDO USAR CADA ACTION:
|
|
|
71
71
|
}
|
|
72
72
|
const { projectPath, action } = args;
|
|
73
73
|
try {
|
|
74
|
+
// #region agent log
|
|
75
|
+
fetch('http://127.0.0.1:8243/ingest/a7114eec-653b-43b0-9f09-7073baee17bf',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({sessionId:'debug-session',runId:'run1',hypothesisId:'H1',location:'git-workflow.js:handle-entry',message:'handle start',data:{action,projectPath},timestamp:Date.now()})}).catch(()=>{});
|
|
76
|
+
// #endregion
|
|
77
|
+
|
|
74
78
|
validateProjectPath(projectPath);
|
|
79
|
+
// #region agent log
|
|
80
|
+
fetch('http://127.0.0.1:8243/ingest/a7114eec-653b-43b0-9f09-7073baee17bf',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({sessionId:'debug-session',runId:'run1',hypothesisId:'H1',location:'git-workflow.js:handle-validated',message:'projectPath validated',data:{action},timestamp:Date.now()})}).catch(()=>{});
|
|
81
|
+
// #endregion
|
|
75
82
|
if (action === "init") {
|
|
76
83
|
await git.init(projectPath);
|
|
77
84
|
|
|
@@ -96,6 +103,9 @@ QUANDO USAR CADA ACTION:
|
|
|
96
103
|
}
|
|
97
104
|
if (action === "status") {
|
|
98
105
|
const st = await git.status(projectPath);
|
|
106
|
+
// #region agent log
|
|
107
|
+
fetch('http://127.0.0.1:8243/ingest/a7114eec-653b-43b0-9f09-7073baee17bf',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({sessionId:'debug-session',runId:'run1',hypothesisId:'H2',location:'git-workflow.js:status',message:'status result',data:{modified:st.modified.length,created:st.created.length,deleted:st.deleted.length,notAdded:st.not_added.length,isClean:st.isClean},timestamp:Date.now()})}).catch(()=>{});
|
|
108
|
+
// #endregion
|
|
99
109
|
return asToolResult(st);
|
|
100
110
|
}
|
|
101
111
|
if (action === "add") {
|
|
@@ -113,6 +123,9 @@ QUANDO USAR CADA ACTION:
|
|
|
113
123
|
return asToolError("MISSING_PARAMETER", "message é obrigatório para commit", { parameter: "message" });
|
|
114
124
|
}
|
|
115
125
|
const sha = await git.commit(projectPath, args.message);
|
|
126
|
+
// #region agent log
|
|
127
|
+
fetch('http://127.0.0.1:8243/ingest/a7114eec-653b-43b0-9f09-7073baee17bf',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({sessionId:'debug-session',runId:'run1',hypothesisId:'H3',location:'git-workflow.js:commit',message:'commit created',data:{sha,message:args.message},timestamp:Date.now()})}).catch(()=>{});
|
|
128
|
+
// #endregion
|
|
116
129
|
return asToolResult({ success: true, sha, message: args.message, nextStep: "Use action='push' para enviar ao GitHub/Gitea" });
|
|
117
130
|
}
|
|
118
131
|
if (action === "clean") {
|