@andrebuzeli/git-mcp 10.0.1 → 10.0.2
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/prompts/gitPrompts.d.ts +1 -22
- package/dist/prompts/gitPrompts.js +58 -179
- package/dist/server.js +0 -5
- package/dist/tools/gitConfig.js +1 -1
- package/dist/tools/gitFiles.js +1 -1
- package/dist/tools/gitPush.d.ts +5 -0
- package/dist/tools/gitPush.js +7 -1
- package/dist/tools/gitSync.d.ts +24 -0
- package/dist/tools/gitSync.js +130 -42
- package/dist/tools/gitUpload.js +15 -5
- package/dist/tools/gitWorkflow.js +30 -4
- package/dist/utils/agentHelpers.d.ts +11 -0
- package/dist/utils/agentHelpers.js +41 -0
- package/dist/utils/contextDetector.d.ts +0 -0
- package/dist/utils/contextDetector.js +1 -0
- package/dist/utils/gitAdapter.d.ts +2 -2
- package/dist/utils/gitAdapter.js +4 -4
- package/package.json +1 -1
- package/dist/.tsbuildinfo +0 -1
- package/dist/config.d.ts.map +0 -1
- package/dist/config.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/prompts/gitPrompts.d.ts.map +0 -1
- package/dist/prompts/gitPrompts.js.map +0 -1
- package/dist/providers/giteaProvider.d.ts.map +0 -1
- package/dist/providers/giteaProvider.js.map +0 -1
- package/dist/providers/githubProvider.d.ts.map +0 -1
- package/dist/providers/githubProvider.js.map +0 -1
- package/dist/providers/providerManager.d.ts.map +0 -1
- package/dist/providers/providerManager.js.map +0 -1
- package/dist/resources/toolsGuide.d.ts.map +0 -1
- package/dist/resources/toolsGuide.js.map +0 -1
- package/dist/server.d.ts.map +0 -1
- package/dist/server.js.map +0 -1
- package/dist/tools/gitAnalytics.d.ts.map +0 -1
- package/dist/tools/gitAnalytics.js.map +0 -1
- package/dist/tools/gitArchive.d.ts.map +0 -1
- package/dist/tools/gitArchive.js.map +0 -1
- package/dist/tools/gitBackup.d.ts.map +0 -1
- package/dist/tools/gitBackup.js.map +0 -1
- package/dist/tools/gitBranches.d.ts.map +0 -1
- package/dist/tools/gitBranches.js.map +0 -1
- package/dist/tools/gitChangelog.d.ts.map +0 -1
- package/dist/tools/gitChangelog.js.map +0 -1
- package/dist/tools/gitConfig.d.ts.map +0 -1
- package/dist/tools/gitConfig.js.map +0 -1
- package/dist/tools/gitFiles.d.ts.map +0 -1
- package/dist/tools/gitFiles.js.map +0 -1
- package/dist/tools/gitFix.d.ts.map +0 -1
- package/dist/tools/gitFix.js.map +0 -1
- package/dist/tools/gitFix.tool.d.ts.map +0 -1
- package/dist/tools/gitFix.tool.js.map +0 -1
- package/dist/tools/gitHistory.d.ts.map +0 -1
- package/dist/tools/gitHistory.js.map +0 -1
- package/dist/tools/gitIgnore.d.ts.map +0 -1
- package/dist/tools/gitIgnore.js.map +0 -1
- package/dist/tools/gitIssues.d.ts.map +0 -1
- package/dist/tools/gitIssues.js.map +0 -1
- package/dist/tools/gitLog.d.ts.map +0 -1
- package/dist/tools/gitLog.js.map +0 -1
- package/dist/tools/gitMonitor.d.ts.map +0 -1
- package/dist/tools/gitMonitor.js.map +0 -1
- package/dist/tools/gitPackages.d.ts.map +0 -1
- package/dist/tools/gitPackages.js.map +0 -1
- package/dist/tools/gitPulls.d.ts.map +0 -1
- package/dist/tools/gitPulls.js.map +0 -1
- package/dist/tools/gitPush.d.ts.map +0 -1
- package/dist/tools/gitPush.js.map +0 -1
- package/dist/tools/gitRelease.d.ts.map +0 -1
- package/dist/tools/gitRelease.js.map +0 -1
- package/dist/tools/gitRemote.d.ts.map +0 -1
- package/dist/tools/gitRemote.js.map +0 -1
- package/dist/tools/gitReset.d.ts.map +0 -1
- package/dist/tools/gitReset.js.map +0 -1
- package/dist/tools/gitStash.d.ts.map +0 -1
- package/dist/tools/gitStash.js.map +0 -1
- package/dist/tools/gitSync.d.ts.map +0 -1
- package/dist/tools/gitSync.js.map +0 -1
- package/dist/tools/gitTags.d.ts.map +0 -1
- package/dist/tools/gitTags.js.map +0 -1
- package/dist/tools/gitUpdate.d.ts.map +0 -1
- package/dist/tools/gitUpdate.js.map +0 -1
- package/dist/tools/gitUpload.d.ts.map +0 -1
- package/dist/tools/gitUpload.js.map +0 -1
- package/dist/tools/gitWorkflow.d.ts.map +0 -1
- package/dist/tools/gitWorkflow.js.map +0 -1
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js.map +0 -1
- package/dist/utils/apiHelpers.d.ts.map +0 -1
- package/dist/utils/apiHelpers.js.map +0 -1
- package/dist/utils/errors.d.ts.map +0 -1
- package/dist/utils/errors.js.map +0 -1
- package/dist/utils/gitAdapter.d.ts.map +0 -1
- package/dist/utils/gitAdapter.js.map +0 -1
- package/dist/utils/repoHelpers.d.ts.map +0 -1
- package/dist/utils/repoHelpers.js.map +0 -1
- package/dist/utils/safetyController.d.ts.map +0 -1
- package/dist/utils/safetyController.js.map +0 -1
|
@@ -26,11 +26,6 @@ export declare class GitUpdatePrompt implements Prompt {
|
|
|
26
26
|
name: string;
|
|
27
27
|
title: string;
|
|
28
28
|
description: string;
|
|
29
|
-
arguments: {
|
|
30
|
-
name: string;
|
|
31
|
-
description: string;
|
|
32
|
-
required: boolean;
|
|
33
|
-
}[];
|
|
34
29
|
generate(args: Record<string, any>, ctx: MCPContext): Promise<{
|
|
35
30
|
description: string;
|
|
36
31
|
messages: {
|
|
@@ -41,19 +36,13 @@ export declare class GitUpdatePrompt implements Prompt {
|
|
|
41
36
|
};
|
|
42
37
|
}[];
|
|
43
38
|
}>;
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
39
|
+
} /**
|
|
46
40
|
* /gitfix - Fix repository configuration
|
|
47
41
|
*/
|
|
48
42
|
export declare class GitFixPrompt implements Prompt {
|
|
49
43
|
name: string;
|
|
50
44
|
title: string;
|
|
51
45
|
description: string;
|
|
52
|
-
arguments: {
|
|
53
|
-
name: string;
|
|
54
|
-
description: string;
|
|
55
|
-
required: boolean;
|
|
56
|
-
}[];
|
|
57
46
|
generate(args: Record<string, any>, ctx: MCPContext): Promise<{
|
|
58
47
|
description: string;
|
|
59
48
|
messages: {
|
|
@@ -72,11 +61,6 @@ export declare class GitLogPrompt implements Prompt {
|
|
|
72
61
|
name: string;
|
|
73
62
|
title: string;
|
|
74
63
|
description: string;
|
|
75
|
-
arguments: {
|
|
76
|
-
name: string;
|
|
77
|
-
description: string;
|
|
78
|
-
required: boolean;
|
|
79
|
-
}[];
|
|
80
64
|
generate(args: Record<string, any>, ctx: MCPContext): Promise<{
|
|
81
65
|
description: string;
|
|
82
66
|
messages: {
|
|
@@ -95,11 +79,6 @@ export declare class GitReleasePrompt implements Prompt {
|
|
|
95
79
|
name: string;
|
|
96
80
|
title: string;
|
|
97
81
|
description: string;
|
|
98
|
-
arguments: {
|
|
99
|
-
name: string;
|
|
100
|
-
description: string;
|
|
101
|
-
required: boolean;
|
|
102
|
-
}[];
|
|
103
82
|
generate(args: Record<string, any>, ctx: MCPContext): Promise<{
|
|
104
83
|
description: string;
|
|
105
84
|
messages: {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { getRepoInfo } from '../utils/repoHelpers.js';
|
|
2
1
|
/**
|
|
3
2
|
* /gitupdate - Complete update workflow with remote traceability
|
|
4
3
|
*/
|
|
@@ -7,31 +6,10 @@ export class GitUpdatePrompt {
|
|
|
7
6
|
this.name = "gitupdate";
|
|
8
7
|
this.title = "Git Update - Complete Workflow";
|
|
9
8
|
this.description = "Execute complete Git update (add, commit, push) with full remote traceability via issues";
|
|
10
|
-
this.arguments = [
|
|
11
|
-
{
|
|
12
|
-
name: "projectPath",
|
|
13
|
-
description: "Absolute path to the repository (REQUIRED)",
|
|
14
|
-
required: true
|
|
15
|
-
}
|
|
16
|
-
];
|
|
17
9
|
}
|
|
18
10
|
async generate(args, ctx) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
throw new Error('projectPath is required');
|
|
22
|
-
}
|
|
23
|
-
// Get current status to generate context
|
|
24
|
-
const status = await ctx.gitAdapter.status(projectPath);
|
|
25
|
-
const repoInfo = getRepoInfo(projectPath);
|
|
26
|
-
const filesChanged = [
|
|
27
|
-
...status.modified,
|
|
28
|
-
...status.created,
|
|
29
|
-
...status.deleted,
|
|
30
|
-
...status.renamed.map((r) => `${r.from} → ${r.to}`)
|
|
31
|
-
];
|
|
32
|
-
const changesSummary = filesChanged.length > 0
|
|
33
|
-
? `\n\nFiles to be committed:\n${filesChanged.map(f => `- ${f}`).join('\n')}`
|
|
34
|
-
: '\n\nNo changes detected.';
|
|
11
|
+
// PROMPT só instrui o AI AGENT - não detecta nada
|
|
12
|
+
// AI AGENT é responsável por detectar workspace e passar projectPath obrigatório
|
|
35
13
|
return {
|
|
36
14
|
description: "Git update workflow with remote traceability",
|
|
37
15
|
messages: [
|
|
@@ -39,33 +17,27 @@ export class GitUpdatePrompt {
|
|
|
39
17
|
role: "user",
|
|
40
18
|
content: {
|
|
41
19
|
type: "text",
|
|
42
|
-
text: `Execute git-update tool
|
|
43
|
-
Project path: ${projectPath}
|
|
44
|
-
Current branch: ${status.current || 'unknown'}
|
|
45
|
-
${changesSummary}
|
|
20
|
+
text: `Execute the git-update tool to update the current project.
|
|
46
21
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
"files": ["."]
|
|
52
|
-
}
|
|
22
|
+
You must call the git-update tool with:
|
|
23
|
+
- projectPath: (REQUIRED) Detect the user's current workspace folder path
|
|
24
|
+
- message: (optional) Generate appropriate conventional commit message
|
|
25
|
+
- files: (optional) Default is ["."]
|
|
53
26
|
|
|
54
27
|
The tool will automatically:
|
|
55
28
|
1. Stage all changes
|
|
56
|
-
2. Create commit
|
|
57
|
-
3. Push to GitHub and Gitea
|
|
58
|
-
4. Create traceability issues
|
|
59
|
-
5. Return
|
|
29
|
+
2. Create commit
|
|
30
|
+
3. Push to GitHub and Gitea
|
|
31
|
+
4. Create traceability issues
|
|
32
|
+
5. Return tracking report
|
|
60
33
|
|
|
61
|
-
|
|
34
|
+
Call the tool now with the workspace path you detect from context.`
|
|
62
35
|
}
|
|
63
36
|
}
|
|
64
37
|
]
|
|
65
38
|
};
|
|
66
39
|
}
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
40
|
+
} /**
|
|
69
41
|
* /gitfix - Fix repository configuration
|
|
70
42
|
*/
|
|
71
43
|
export class GitFixPrompt {
|
|
@@ -73,24 +45,9 @@ export class GitFixPrompt {
|
|
|
73
45
|
this.name = "gitfix";
|
|
74
46
|
this.title = "Git Fix - Repository Configuration";
|
|
75
47
|
this.description = "Automatically fix and configure Git repository for dual-provider system";
|
|
76
|
-
this.arguments = [
|
|
77
|
-
{
|
|
78
|
-
name: "projectPath",
|
|
79
|
-
description: "Absolute path to the repository (REQUIRED)",
|
|
80
|
-
required: true
|
|
81
|
-
}
|
|
82
|
-
];
|
|
83
48
|
}
|
|
84
49
|
async generate(args, ctx) {
|
|
85
|
-
|
|
86
|
-
if (!projectPath) {
|
|
87
|
-
throw new Error('projectPath is required');
|
|
88
|
-
}
|
|
89
|
-
const remotes = await ctx.gitAdapter.listRemotes(projectPath);
|
|
90
|
-
const repoInfo = getRepoInfo(projectPath);
|
|
91
|
-
const remotesInfo = remotes.length > 0
|
|
92
|
-
? `\n\nCurrent remotes:\n${remotes.map(r => `- ${r.name}: ${r.url}`).join('\n')}`
|
|
93
|
-
: '\n\nNo remotes configured.';
|
|
50
|
+
// PROMPT só instrui o AI AGENT - não detecta nada
|
|
94
51
|
return {
|
|
95
52
|
description: "Fix Git repository configuration",
|
|
96
53
|
messages: [
|
|
@@ -98,27 +55,20 @@ export class GitFixPrompt {
|
|
|
98
55
|
role: "user",
|
|
99
56
|
content: {
|
|
100
57
|
type: "text",
|
|
101
|
-
text: `Execute git-fix tool
|
|
102
|
-
Project path: ${projectPath}
|
|
103
|
-
${remotesInfo}
|
|
58
|
+
text: `Execute the git-fix tool to fix Git repository configuration.
|
|
104
59
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
"autoDetect": true
|
|
109
|
-
}
|
|
60
|
+
You must call the git-fix tool with:
|
|
61
|
+
- projectPath: (REQUIRED) Detect the user's current workspace folder path
|
|
62
|
+
- autoDetect: true (optional)
|
|
110
63
|
|
|
111
64
|
The tool will automatically:
|
|
112
65
|
1. Detect existing GitHub/Gitea remotes from URLs
|
|
113
|
-
2. Remove broken/duplicate remotes
|
|
114
|
-
3. Configure
|
|
115
|
-
- github → GitHub repository
|
|
116
|
-
- gitea → Gitea repository
|
|
117
|
-
- origin → Dual-push (pushes to both simultaneously)
|
|
66
|
+
2. Remove broken/duplicate remotes
|
|
67
|
+
3. Configure dual-provider setup (github, gitea, origin)
|
|
118
68
|
4. Create .gitignore if missing
|
|
119
|
-
5. Return
|
|
69
|
+
5. Return configuration report
|
|
120
70
|
|
|
121
|
-
|
|
71
|
+
Call the tool now with the workspace path you detect from context.`
|
|
122
72
|
}
|
|
123
73
|
}
|
|
124
74
|
]
|
|
@@ -133,23 +83,9 @@ export class GitLogPrompt {
|
|
|
133
83
|
this.name = "gitlog";
|
|
134
84
|
this.title = "Git Log - Generate Changelog";
|
|
135
85
|
this.description = "Generate Keep a Changelog format changelog and commit it to the repository";
|
|
136
|
-
this.arguments = [
|
|
137
|
-
{
|
|
138
|
-
name: "projectPath",
|
|
139
|
-
description: "Absolute path to the repository (REQUIRED)",
|
|
140
|
-
required: true
|
|
141
|
-
}
|
|
142
|
-
];
|
|
143
86
|
}
|
|
144
87
|
async generate(args, ctx) {
|
|
145
|
-
|
|
146
|
-
if (!projectPath) {
|
|
147
|
-
throw new Error('projectPath is required');
|
|
148
|
-
}
|
|
149
|
-
const repoInfo = getRepoInfo(projectPath);
|
|
150
|
-
// Get recent commits for context
|
|
151
|
-
const log = await ctx.gitAdapter.log(projectPath, { maxCount: 20 });
|
|
152
|
-
const logSummary = log.slice(0, 5).map((commit) => `- ${commit.oid.substring(0, 7)} ${commit.commit.message.split('\n')[0]}`).join('\n');
|
|
88
|
+
// PROMPT só instrui o AI AGENT - não detecta nada
|
|
153
89
|
return {
|
|
154
90
|
description: "Generate changelog in repository",
|
|
155
91
|
messages: [
|
|
@@ -157,30 +93,22 @@ export class GitLogPrompt {
|
|
|
157
93
|
role: "user",
|
|
158
94
|
content: {
|
|
159
95
|
type: "text",
|
|
160
|
-
text: `
|
|
161
|
-
Project path: ${projectPath}
|
|
162
|
-
|
|
163
|
-
Recent commits:
|
|
164
|
-
${logSummary}
|
|
96
|
+
text: `Execute the git-history tool to generate a changelog.
|
|
165
97
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
"format": "keepachangelog"
|
|
173
|
-
}
|
|
98
|
+
You must call the git-history tool with:
|
|
99
|
+
- projectPath: (REQUIRED) Detect the user's current workspace folder path
|
|
100
|
+
- action: "generate_changelog" (REQUIRED)
|
|
101
|
+
- outputFile: "CHANGELOG.md" (optional)
|
|
102
|
+
- since: "last-tag" (optional)
|
|
103
|
+
- format: "keepachangelog" (optional)
|
|
174
104
|
|
|
175
105
|
The tool will automatically:
|
|
176
|
-
1. Analyze
|
|
177
|
-
2.
|
|
178
|
-
3.
|
|
179
|
-
4.
|
|
180
|
-
5. Commit with message: "docs: Update CHANGELOG.md"
|
|
181
|
-
6. Push to GitHub and Gitea
|
|
106
|
+
1. Analyze commits since last tag
|
|
107
|
+
2. Generate Keep a Changelog format
|
|
108
|
+
3. Save to repository
|
|
109
|
+
4. Commit and push
|
|
182
110
|
|
|
183
|
-
|
|
111
|
+
Call the tool now with the workspace path you detect from context.`
|
|
184
112
|
}
|
|
185
113
|
}
|
|
186
114
|
]
|
|
@@ -195,35 +123,9 @@ export class GitReleasePrompt {
|
|
|
195
123
|
this.name = "gitrelease";
|
|
196
124
|
this.title = "Git Release - Create Release";
|
|
197
125
|
this.description = "Create new release with automatic or manual version and changelog (always uses force)";
|
|
198
|
-
this.arguments = [
|
|
199
|
-
{
|
|
200
|
-
name: "projectPath",
|
|
201
|
-
description: "Absolute path to the repository (REQUIRED)",
|
|
202
|
-
required: true
|
|
203
|
-
},
|
|
204
|
-
{
|
|
205
|
-
name: "version",
|
|
206
|
-
description: "Optional version (e.g., '1.5.0'). If not provided, auto-detects from commits.",
|
|
207
|
-
required: false
|
|
208
|
-
}
|
|
209
|
-
];
|
|
210
126
|
}
|
|
211
127
|
async generate(args, ctx) {
|
|
212
|
-
|
|
213
|
-
if (!projectPath) {
|
|
214
|
-
throw new Error('projectPath is required');
|
|
215
|
-
}
|
|
216
|
-
const userVersion = args.version; // Manual version from user chat
|
|
217
|
-
const repoInfo = getRepoInfo(projectPath);
|
|
218
|
-
// Get current tags to provide context
|
|
219
|
-
const tags = await ctx.gitAdapter.listTags(projectPath);
|
|
220
|
-
const latestTag = tags.length > 0 ? tags[0] : 'No tags yet';
|
|
221
|
-
const versionStrategy = userVersion
|
|
222
|
-
? `Use the specified version: v${userVersion}`
|
|
223
|
-
: `Analyze commits since last tag for automatic semver bump:
|
|
224
|
-
- breaking changes (BREAKING CHANGE:) → major bump
|
|
225
|
-
- feat: → minor bump
|
|
226
|
-
- fix: → patch bump`;
|
|
128
|
+
// PROMPT só instrui o AI AGENT - não detecta nada
|
|
227
129
|
return {
|
|
228
130
|
description: "Create new release with changelog",
|
|
229
131
|
messages: [
|
|
@@ -231,58 +133,35 @@ export class GitReleasePrompt {
|
|
|
231
133
|
role: "user",
|
|
232
134
|
content: {
|
|
233
135
|
type: "text",
|
|
234
|
-
text: `
|
|
235
|
-
Project path: ${projectPath}
|
|
236
|
-
Latest tag: ${latestTag}
|
|
237
|
-
${userVersion ? `Requested version: v${userVersion}` : 'Version: Auto-detect from commits'}
|
|
136
|
+
text: `Execute the release workflow to create a new version.
|
|
238
137
|
|
|
239
|
-
|
|
138
|
+
Workflow steps:
|
|
240
139
|
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
"projectPath": "${projectPath}",
|
|
245
|
-
"action": "generate_changelog",
|
|
246
|
-
"since": "last-tag",
|
|
247
|
-
"format": "keepachangelog"
|
|
248
|
-
}
|
|
140
|
+
1. Generate changelog using git-history tool:
|
|
141
|
+
- projectPath: (REQUIRED) Detect workspace
|
|
142
|
+
- action: "generate_changelog"
|
|
249
143
|
|
|
250
|
-
|
|
251
|
-
${versionStrategy}
|
|
144
|
+
2. Determine next version from commits (semver)
|
|
252
145
|
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
"tagName": "v{next-version}",
|
|
259
|
-
"message": "Release v{next-version}",
|
|
260
|
-
"force": true
|
|
261
|
-
}
|
|
146
|
+
3. Create tag using git-tags tool:
|
|
147
|
+
- projectPath: (REQUIRED) Detect workspace
|
|
148
|
+
- action: "create"
|
|
149
|
+
- tagName: Next version
|
|
150
|
+
- force: true
|
|
262
151
|
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
"tagName": "v{next-version}",
|
|
269
|
-
"force": true
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
STEP 5: Create releases on GitHub and Gitea
|
|
273
|
-
Use git-release tool:
|
|
274
|
-
{
|
|
275
|
-
"projectPath": "${projectPath}",
|
|
276
|
-
"action": "create",
|
|
277
|
-
"tagName": "v{next-version}",
|
|
278
|
-
"name": "Release v{next-version}",
|
|
279
|
-
"body": "{changelog-content-from-step1}",
|
|
280
|
-
"force": true
|
|
281
|
-
}
|
|
152
|
+
4. Push tag using git-tags tool:
|
|
153
|
+
- projectPath: (REQUIRED) Detect workspace
|
|
154
|
+
- action: "push"
|
|
155
|
+
- tagName: Same version
|
|
156
|
+
- force: true
|
|
282
157
|
|
|
283
|
-
|
|
158
|
+
5. Create releases using git-release tool:
|
|
159
|
+
- projectPath: (REQUIRED) Detect workspace
|
|
160
|
+
- action: "create"
|
|
161
|
+
- tagName: Same version
|
|
162
|
+
- body: Changelog content
|
|
284
163
|
|
|
285
|
-
Execute the
|
|
164
|
+
Execute all steps with the workspace path you detect from context.`
|
|
286
165
|
}
|
|
287
166
|
}
|
|
288
167
|
]
|
package/dist/server.js
CHANGED
|
@@ -49,11 +49,6 @@ export function createServer(opts) {
|
|
|
49
49
|
const t = toolRegistry.get(tool);
|
|
50
50
|
if (!t)
|
|
51
51
|
return res.status(404).json(createErrorResponse('TOOL_NOT_FOUND', `Tool not found: ${tool}`));
|
|
52
|
-
// Enforce projectPath presence for all tool calls to avoid agents calling tools without context
|
|
53
|
-
// Many tools require projectPath; centralize the check so callers receive a clear validation error.
|
|
54
|
-
if (!params || !params.projectPath) {
|
|
55
|
-
return res.status(400).json(createErrorResponse('VALIDATION_ERROR', 'projectPath is required for all tool calls'));
|
|
56
|
-
}
|
|
57
52
|
try {
|
|
58
53
|
// Validate params via JSON Schema if available
|
|
59
54
|
if (t.inputSchema) {
|
package/dist/tools/gitConfig.js
CHANGED
package/dist/tools/gitFiles.js
CHANGED
package/dist/tools/gitPush.d.ts
CHANGED
|
@@ -21,6 +21,10 @@ export declare class GitPushTool implements Tool {
|
|
|
21
21
|
type: string;
|
|
22
22
|
description: string;
|
|
23
23
|
};
|
|
24
|
+
setUpstream: {
|
|
25
|
+
type: string;
|
|
26
|
+
description: string;
|
|
27
|
+
};
|
|
24
28
|
};
|
|
25
29
|
required: string[];
|
|
26
30
|
additionalProperties: boolean;
|
|
@@ -30,6 +34,7 @@ export declare class GitPushTool implements Tool {
|
|
|
30
34
|
remote: any;
|
|
31
35
|
branch: any;
|
|
32
36
|
force: any;
|
|
37
|
+
setUpstream: any;
|
|
33
38
|
message: string;
|
|
34
39
|
}>;
|
|
35
40
|
}
|
package/dist/tools/gitPush.js
CHANGED
|
@@ -21,6 +21,10 @@ export class GitPushTool {
|
|
|
21
21
|
force: {
|
|
22
22
|
type: "boolean",
|
|
23
23
|
description: "Force push (optional, default: false)"
|
|
24
|
+
},
|
|
25
|
+
setUpstream: {
|
|
26
|
+
type: "boolean",
|
|
27
|
+
description: "Set upstream tracking (optional, default: true)"
|
|
24
28
|
}
|
|
25
29
|
},
|
|
26
30
|
required: ["projectPath"],
|
|
@@ -36,13 +40,15 @@ export class GitPushTool {
|
|
|
36
40
|
const remote = params.remote || 'origin';
|
|
37
41
|
const branch = params.branch || await git.getCurrentBranch(projectPath);
|
|
38
42
|
const force = params.force || false;
|
|
43
|
+
const setUpstream = params.setUpstream !== undefined ? params.setUpstream : true; // Default to true
|
|
39
44
|
try {
|
|
40
|
-
await git.push(projectPath, remote, branch, force);
|
|
45
|
+
await git.push(projectPath, remote, branch, force, setUpstream);
|
|
41
46
|
return {
|
|
42
47
|
success: true,
|
|
43
48
|
remote,
|
|
44
49
|
branch,
|
|
45
50
|
force,
|
|
51
|
+
setUpstream,
|
|
46
52
|
message: `Successfully pushed ${branch} to ${remote}`,
|
|
47
53
|
};
|
|
48
54
|
}
|
package/dist/tools/gitSync.d.ts
CHANGED
|
@@ -2,5 +2,29 @@ import { Tool, MCPContext } from '../types.js';
|
|
|
2
2
|
export declare class GitSyncTool implements Tool {
|
|
3
3
|
name: string;
|
|
4
4
|
description: string;
|
|
5
|
+
inputSchema: {
|
|
6
|
+
type: "object";
|
|
7
|
+
properties: {
|
|
8
|
+
projectPath: {
|
|
9
|
+
type: string;
|
|
10
|
+
description: string;
|
|
11
|
+
};
|
|
12
|
+
action: {
|
|
13
|
+
type: string;
|
|
14
|
+
enum: string[];
|
|
15
|
+
description: string;
|
|
16
|
+
};
|
|
17
|
+
remote: {
|
|
18
|
+
type: string;
|
|
19
|
+
description: string;
|
|
20
|
+
};
|
|
21
|
+
branch: {
|
|
22
|
+
type: string;
|
|
23
|
+
description: string;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
required: string[];
|
|
27
|
+
additionalProperties: boolean;
|
|
28
|
+
};
|
|
5
29
|
handle(params: Record<string, any>, ctx: MCPContext): Promise<any>;
|
|
6
30
|
}
|