@andrebuzeli/git-mcp 9.1.0 → 10.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.
Files changed (102) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +460 -328
  3. package/dist/.tsbuildinfo +1 -1
  4. package/dist/config.d.ts +0 -1
  5. package/dist/config.js +0 -1
  6. package/dist/index.d.ts +0 -1
  7. package/dist/index.js +6 -36
  8. package/dist/index.js.map +1 -1
  9. package/dist/prompts/gitPrompts.d.ts +20 -1
  10. package/dist/prompts/gitPrompts.d.ts.map +1 -1
  11. package/dist/prompts/gitPrompts.js +49 -9
  12. package/dist/prompts/gitPrompts.js.map +1 -1
  13. package/dist/providers/giteaProvider.d.ts +1 -18
  14. package/dist/providers/giteaProvider.js +1 -87
  15. package/dist/providers/githubProvider.d.ts +0 -1
  16. package/dist/providers/githubProvider.js +0 -1
  17. package/dist/providers/providerManager.d.ts +0 -15
  18. package/dist/providers/providerManager.js +0 -65
  19. package/dist/resources/toolsGuide.d.ts +0 -1
  20. package/dist/resources/toolsGuide.js +1701 -1702
  21. package/dist/server.d.ts +0 -1
  22. package/dist/server.js +0 -1
  23. package/dist/tools/gitAnalytics.d.ts +0 -29
  24. package/dist/tools/gitAnalytics.js +4 -39
  25. package/dist/tools/gitArchive.d.ts +0 -30
  26. package/dist/tools/gitArchive.d.ts.map +1 -1
  27. package/dist/tools/gitArchive.js +1 -32
  28. package/dist/tools/gitArchive.js.map +1 -1
  29. package/dist/tools/gitBackup.d.ts +2 -35
  30. package/dist/tools/gitBackup.d.ts.map +1 -1
  31. package/dist/tools/gitBackup.js +7 -41
  32. package/dist/tools/gitBackup.js.map +1 -1
  33. package/dist/tools/gitBranches.d.ts +0 -49
  34. package/dist/tools/gitBranches.js +28 -92
  35. package/dist/tools/gitChangelog.d.ts +37 -1
  36. package/dist/tools/gitChangelog.d.ts.map +1 -1
  37. package/dist/tools/gitChangelog.js +67 -2
  38. package/dist/tools/gitChangelog.js.map +1 -1
  39. package/dist/tools/gitConfig.d.ts +2 -31
  40. package/dist/tools/gitConfig.js +9 -38
  41. package/dist/tools/gitFiles.d.ts +0 -37
  42. package/dist/tools/gitFiles.js +1 -39
  43. package/dist/tools/gitFix.d.ts +1 -4
  44. package/dist/tools/gitFix.js +32 -62
  45. package/dist/tools/gitFix.tool.d.ts +2 -26
  46. package/dist/tools/gitFix.tool.js +61 -85
  47. package/dist/tools/gitHistory.d.ts +5 -18
  48. package/dist/tools/gitHistory.js +208 -193
  49. package/dist/tools/gitIgnore.d.ts +0 -24
  50. package/dist/tools/gitIgnore.js +113 -136
  51. package/dist/tools/gitIssues.d.ts +0 -79
  52. package/dist/tools/gitIssues.js +16 -123
  53. package/dist/tools/gitLog.d.ts +30 -1
  54. package/dist/tools/gitLog.d.ts.map +1 -1
  55. package/dist/tools/gitLog.js +46 -2
  56. package/dist/tools/gitLog.js.map +1 -1
  57. package/dist/tools/gitMonitor.d.ts +0 -29
  58. package/dist/tools/gitMonitor.js +18 -47
  59. package/dist/tools/gitPackages.d.ts +146 -34
  60. package/dist/tools/gitPackages.js +147 -280
  61. package/dist/tools/gitPulls.d.ts +0 -66
  62. package/dist/tools/gitPulls.d.ts.map +1 -1
  63. package/dist/tools/gitPulls.js +7 -93
  64. package/dist/tools/gitPulls.js.map +1 -1
  65. package/dist/tools/gitPush.d.ts +0 -1
  66. package/dist/tools/gitPush.js +0 -1
  67. package/dist/tools/gitRelease.d.ts +0 -49
  68. package/dist/tools/gitRelease.js +6 -122
  69. package/dist/tools/gitRemote.d.ts +1 -31
  70. package/dist/tools/gitRemote.js +17 -59
  71. package/dist/tools/gitReset.d.ts +0 -25
  72. package/dist/tools/gitReset.js +8 -33
  73. package/dist/tools/gitStash.d.ts +2 -35
  74. package/dist/tools/gitStash.js +26 -56
  75. package/dist/tools/gitSync.d.ts +0 -29
  76. package/dist/tools/gitSync.js +20 -65
  77. package/dist/tools/gitTags.d.ts +0 -37
  78. package/dist/tools/gitTags.d.ts.map +1 -1
  79. package/dist/tools/gitTags.js +26 -53
  80. package/dist/tools/gitTags.js.map +1 -1
  81. package/dist/tools/gitUpdate.d.ts +6 -11
  82. package/dist/tools/gitUpdate.js +304 -61
  83. package/dist/tools/gitUpload.d.ts +1 -24
  84. package/dist/tools/gitUpload.js +50 -45
  85. package/dist/tools/gitWorkflow.d.ts +0 -27
  86. package/dist/tools/gitWorkflow.js +55 -87
  87. package/dist/types.d.ts +0 -7
  88. package/dist/types.js +0 -1
  89. package/dist/utils/apiHelpers.d.ts +0 -1
  90. package/dist/utils/apiHelpers.js +0 -1
  91. package/dist/utils/errors.d.ts +0 -1
  92. package/dist/utils/errors.js +0 -1
  93. package/dist/utils/gitAdapter.d.ts +14 -13
  94. package/dist/utils/gitAdapter.d.ts.map +1 -1
  95. package/dist/utils/gitAdapter.js +47 -9
  96. package/dist/utils/gitAdapter.js.map +1 -1
  97. package/dist/utils/repoHelpers.d.ts +0 -2
  98. package/dist/utils/repoHelpers.js +3 -16
  99. package/dist/utils/safetyController.d.ts +0 -1
  100. package/dist/utils/safetyController.js +0 -1
  101. package/dist/utils/safetyController.js.map +1 -1
  102. package/package.json +87 -96
@@ -7,10 +7,19 @@ export class GitUpdatePrompt {
7
7
  this.name = "gitupdate";
8
8
  this.title = "Git Update - Complete Workflow";
9
9
  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
+ ];
10
17
  }
11
18
  async generate(args, ctx) {
12
- // Use current working directory or provided path
13
- const projectPath = args.projectPath || process.cwd();
19
+ const projectPath = args.projectPath;
20
+ if (!projectPath) {
21
+ throw new Error('projectPath is required');
22
+ }
14
23
  // Get current status to generate context
15
24
  const status = await ctx.gitAdapter.status(projectPath);
16
25
  const repoInfo = getRepoInfo(projectPath);
@@ -64,10 +73,19 @@ export class GitFixPrompt {
64
73
  this.name = "gitfix";
65
74
  this.title = "Git Fix - Repository Configuration";
66
75
  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
+ ];
67
83
  }
68
84
  async generate(args, ctx) {
69
- // Use current working directory or provided path
70
- const projectPath = args.projectPath || process.cwd();
85
+ const projectPath = args.projectPath;
86
+ if (!projectPath) {
87
+ throw new Error('projectPath is required');
88
+ }
71
89
  const remotes = await ctx.gitAdapter.listRemotes(projectPath);
72
90
  const repoInfo = getRepoInfo(projectPath);
73
91
  const remotesInfo = remotes.length > 0
@@ -115,10 +133,19 @@ export class GitLogPrompt {
115
133
  this.name = "gitlog";
116
134
  this.title = "Git Log - Generate Changelog";
117
135
  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
+ ];
118
143
  }
119
144
  async generate(args, ctx) {
120
- // Use current working directory or provided path
121
- const projectPath = args.projectPath || process.cwd();
145
+ const projectPath = args.projectPath;
146
+ if (!projectPath) {
147
+ throw new Error('projectPath is required');
148
+ }
122
149
  const repoInfo = getRepoInfo(projectPath);
123
150
  // Get recent commits for context
124
151
  const log = await ctx.gitAdapter.log(projectPath, { maxCount: 20 });
@@ -168,10 +195,24 @@ export class GitReleasePrompt {
168
195
  this.name = "gitrelease";
169
196
  this.title = "Git Release - Create Release";
170
197
  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
+ ];
171
210
  }
172
211
  async generate(args, ctx) {
173
- // Use current working directory or provided path
174
- const projectPath = args.projectPath || process.cwd();
212
+ const projectPath = args.projectPath;
213
+ if (!projectPath) {
214
+ throw new Error('projectPath is required');
215
+ }
175
216
  const userVersion = args.version; // Manual version from user chat
176
217
  const repoInfo = getRepoInfo(projectPath);
177
218
  // Get current tags to provide context
@@ -255,4 +296,3 @@ export const GIT_PROMPTS = [
255
296
  new GitLogPrompt(),
256
297
  new GitReleasePrompt(),
257
298
  ];
258
- //# sourceMappingURL=gitPrompts.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"gitPrompts.js","sourceRoot":"","sources":["../../src/prompts/gitPrompts.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAuBtD;;GAEG;AACH,MAAM,OAAO,eAAe;IAA5B;QACE,SAAI,GAAG,WAAW,CAAC;QACnB,UAAK,GAAG,gCAAgC,CAAC;QACzC,gBAAW,GAAG,0FAA0F,CAAC;IAqD3G,CAAC;IAnDC,KAAK,CAAC,QAAQ,CAAC,IAAyB,EAAE,GAAe;QACvD,iDAAiD;QACjD,MAAM,WAAW,GAAG,IAAI,CAAC,WAAW,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;QAEtD,yCAAyC;QACzC,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;QACxD,MAAM,QAAQ,GAAG,WAAW,CAAC,WAAW,CAAC,CAAC;QAE1C,MAAM,YAAY,GAAG;YACnB,GAAG,MAAM,CAAC,QAAQ;YAClB,GAAG,MAAM,CAAC,OAAO;YACjB,GAAG,MAAM,CAAC,OAAO;YACjB,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAM,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC,EAAE,EAAE,CAAC;SACzD,CAAC;QAEF,MAAM,cAAc,GAAG,YAAY,CAAC,MAAM,GAAG,CAAC;YAC5C,CAAC,CAAC,+BAA+B,YAAY,CAAC,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AAsC;QACtC,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,UAAU,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;QACxD,MAAM,SAAS,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC;QAE5D,MAAM,eAAe,GAAG,WAAW;YACjC,CAAC,CAAC,+BAA+B,WAAW,EAAE;YAC9C,CAAC,CAAC;;;uBAGe,CAAC;QAEpB,OAAO;YACL,WAAW,EAAE,mCAAmC;YAChD,QAAQ,EAAE;gBACR;oBACE,IAAI,EAAE,MAAe;oBACrB,OAAO,EAAE;wBACP,IAAI,EAAE,MAAe;wBACrB,IAAI,EAAE,kCAAkC,QAAQ,CAAC,QAAQ;gBACrD,WAAW;cACb,SAAS;EACrB,WAAW,CAAC,CAAC,CAAC,uBAAuB,WAAW,EAAE,CAAC,CAAC,CAAC,mCAAmC;;;;;;;oBAOtE,WAAW;;;;;;;EAO7B,eAAe;;;;;oBAKG,WAAW;;;;;;;;;;oBAUX,WAAW;;;;;;;;;oBASX,WAAW;;;;;;;;;;iEAUkC;qBACtD;iBACF;aACF;SACF,CAAC;IACJ,CAAC;CACF;AAED,qBAAqB;AACrB,MAAM,CAAC,MAAM,WAAW,GAAa;IACnC,IAAI,eAAe,EAAE;IACrB,IAAI,YAAY,EAAE;IAClB,IAAI,YAAY,EAAE;IAClB,IAAI,gBAAgB,EAAE;CACvB,CAAC"}
@@ -1,20 +1,3 @@
1
- export declare class GiteaAPIError extends Error {
2
- status: number;
3
- url: string;
4
- response?: any | undefined;
5
- constructor(message: string, status: number, url: string, response?: any | undefined);
6
- }
7
- interface GiteaResponse<T = any> {
8
- data: T;
9
- headers?: Record<string, string>;
10
- status: number;
11
- }
12
1
  export declare function createGiteaClient(baseUrl: string, token: string): {
13
- request<T = any>(path: string, opts?: any): Promise<GiteaResponse<T>>;
14
- get<T = any>(path: string): Promise<GiteaResponse<T>>;
15
- post<T = any>(path: string, data?: any): Promise<GiteaResponse<T>>;
16
- patch<T = any>(path: string, data?: any): Promise<GiteaResponse<T>>;
17
- delete<T = any>(path: string): Promise<GiteaResponse<T>>;
2
+ request: (path: string, opts?: any) => Promise<import("axios").AxiosResponse<any, any, {}>>;
18
3
  };
19
- export {};
20
- //# sourceMappingURL=giteaProvider.d.ts.map
@@ -1,92 +1,6 @@
1
1
  import axios from 'axios';
2
- // ============================================================================
3
- // GITEA API ERROR HANDLING
4
- // ============================================================================
5
- export class GiteaAPIError extends Error {
6
- constructor(message, status, url, response) {
7
- super(message);
8
- this.status = status;
9
- this.url = url;
10
- this.response = response;
11
- this.name = 'GiteaAPIError';
12
- }
13
- }
14
- // ============================================================================
15
- // GITEA API VALIDATION & RETRY
16
- // ============================================================================
17
- async function validateGiteaResponse(response, url) {
18
- // Axios throws on non-2xx, but double-check
19
- if (response.status < 200 || response.status >= 300) {
20
- const errorMessage = response.data?.message || `Gitea API Error: ${response.status} ${response.statusText}`;
21
- throw new GiteaAPIError(errorMessage, response.status, url, response.data);
22
- }
23
- // Validate data exists
24
- if (response.data === null || response.data === undefined) {
25
- throw new GiteaAPIError('Response data is null or undefined', response.status, url);
26
- }
27
- return {
28
- data: response.data,
29
- headers: response.headers,
30
- status: response.status
31
- };
32
- }
33
- async function giteaFetchWithRetry(axiosCall, url, maxRetries = 3, retryDelay = 1000) {
34
- let lastError = null;
35
- for (let attempt = 0; attempt < maxRetries; attempt++) {
36
- try {
37
- const response = await axiosCall();
38
- return await validateGiteaResponse(response, url);
39
- }
40
- catch (error) {
41
- lastError = error;
42
- // Don't retry on 4xx (client errors)
43
- if (error.response?.status >= 400 && error.response?.status < 500) {
44
- throw new GiteaAPIError(error.response.data?.message || error.message, error.response.status, url, error.response.data);
45
- }
46
- // Retry on 5xx (server errors) or network errors
47
- if (attempt < maxRetries - 1) {
48
- await new Promise(resolve => setTimeout(resolve, retryDelay * (attempt + 1)));
49
- continue;
50
- }
51
- }
52
- }
53
- throw lastError || new Error('Max retries exceeded');
54
- }
55
- // ============================================================================
56
- // GITEA CLIENT
57
- // ============================================================================
58
2
  export function createGiteaClient(baseUrl, token) {
59
- const cleanBaseUrl = baseUrl.replace(/\/+$/, ''); // Remove trailing slashes
60
- const getHeaders = () => ({
61
- 'Authorization': `token ${token}`,
62
- 'Content-Type': 'application/json',
63
- 'Accept': 'application/json'
64
- });
65
3
  return {
66
- async request(path, opts = {}) {
67
- const url = `${cleanBaseUrl}${path}`;
68
- return giteaFetchWithRetry(() => axios.request({
69
- url,
70
- headers: { ...getHeaders(), ...opts.headers },
71
- ...opts
72
- }), url);
73
- },
74
- async get(path) {
75
- const url = `${cleanBaseUrl}${path}`;
76
- return giteaFetchWithRetry(() => axios.get(url, { headers: getHeaders() }), url);
77
- },
78
- async post(path, data) {
79
- const url = `${cleanBaseUrl}${path}`;
80
- return giteaFetchWithRetry(() => axios.post(url, data, { headers: getHeaders() }), url);
81
- },
82
- async patch(path, data) {
83
- const url = `${cleanBaseUrl}${path}`;
84
- return giteaFetchWithRetry(() => axios.patch(url, data, { headers: getHeaders() }), url);
85
- },
86
- async delete(path) {
87
- const url = `${cleanBaseUrl}${path}`;
88
- return giteaFetchWithRetry(() => axios.delete(url, { headers: getHeaders() }), url);
89
- }
4
+ request: (path, opts = {}) => axios.request({ url: `${baseUrl}${path}`, headers: { Authorization: `token ${token}` }, ...opts }),
90
5
  };
91
6
  }
92
- //# sourceMappingURL=giteaProvider.js.map
@@ -1,3 +1,2 @@
1
1
  import { Octokit } from '@octokit/rest';
2
2
  export declare function createGitHubClient(token: string): Octokit;
3
- //# sourceMappingURL=githubProvider.d.ts.map
@@ -2,4 +2,3 @@ import { Octokit } from '@octokit/rest';
2
2
  export function createGitHubClient(token) {
3
3
  return new Octokit({ auth: token });
4
4
  }
5
- //# sourceMappingURL=githubProvider.js.map
@@ -1,26 +1,11 @@
1
1
  import { Octokit } from '@octokit/rest';
2
- import { createGiteaClient } from './giteaProvider.js';
3
2
  export declare class ProviderManager {
4
3
  github?: Octokit;
5
- gitea?: ReturnType<typeof createGiteaClient>;
6
4
  giteaBaseUrl?: string;
7
5
  giteaToken?: string;
8
- private _githubUsername?;
9
- private _giteaUsername?;
10
6
  constructor();
11
7
  validateConfiguredProviders(): Promise<Record<string, {
12
8
  ok: boolean;
13
9
  error?: string;
14
10
  }>>;
15
- /**
16
- * Get authenticated GitHub username
17
- * Tries API first, falls back to env var, caches result
18
- */
19
- getGitHubUsername(): Promise<string>;
20
- /**
21
- * Get authenticated Gitea username
22
- * Tries API first, falls back to env var, caches result
23
- */
24
- getGiteaUsername(): Promise<string>;
25
11
  }
26
- //# sourceMappingURL=providerManager.d.ts.map
@@ -1,6 +1,5 @@
1
1
  import { Octokit } from '@octokit/rest';
2
2
  import axios from 'axios';
3
- import { createGiteaClient } from './giteaProvider.js';
4
3
  export class ProviderManager {
5
4
  constructor() {
6
5
  const ghToken = process.env.GITHUB_TOKEN;
@@ -10,8 +9,6 @@ export class ProviderManager {
10
9
  if (process.env.GITEA_URL && process.env.GITEA_TOKEN) {
11
10
  this.giteaBaseUrl = process.env.GITEA_URL;
12
11
  this.giteaToken = process.env.GITEA_TOKEN;
13
- // Initialize Gitea client
14
- this.gitea = createGiteaClient(process.env.GITEA_URL, process.env.GITEA_TOKEN);
15
12
  }
16
13
  }
17
14
  async validateConfiguredProviders() {
@@ -49,66 +46,4 @@ export class ProviderManager {
49
46
  }
50
47
  return results;
51
48
  }
52
- /**
53
- * Get authenticated GitHub username
54
- * Tries API first, falls back to env var, caches result
55
- */
56
- async getGitHubUsername() {
57
- // Return cached value if available
58
- if (this._githubUsername) {
59
- return this._githubUsername;
60
- }
61
- // Try API first
62
- if (this.github) {
63
- try {
64
- const user = await this.github.rest.users.getAuthenticated();
65
- this._githubUsername = user.data.login;
66
- return this._githubUsername;
67
- }
68
- catch (err) {
69
- // API failed, continue to fallback
70
- console.warn(`GitHub API failed to fetch username: ${err.message}`);
71
- }
72
- }
73
- // Fallback to env var
74
- if (process.env.GITHUB_USERNAME) {
75
- this._githubUsername = process.env.GITHUB_USERNAME;
76
- return this._githubUsername;
77
- }
78
- throw new Error('GitHub username not available. Set GITHUB_USERNAME env var or configure GITHUB_TOKEN.');
79
- }
80
- /**
81
- * Get authenticated Gitea username
82
- * Tries API first, falls back to env var, caches result
83
- */
84
- async getGiteaUsername() {
85
- // Return cached value if available
86
- if (this._giteaUsername) {
87
- return this._giteaUsername;
88
- }
89
- // Try API first
90
- if (this.giteaBaseUrl && this.giteaToken) {
91
- try {
92
- const resp = await axios.get(`${this.giteaBaseUrl}/api/v1/user`, {
93
- headers: { Authorization: `token ${this.giteaToken}` },
94
- timeout: 5000,
95
- });
96
- this._giteaUsername = resp.data.login || resp.data.username;
97
- if (this._giteaUsername) {
98
- return this._giteaUsername;
99
- }
100
- }
101
- catch (err) {
102
- // API failed, continue to fallback
103
- console.warn(`Gitea API failed to fetch username: ${err.message}`);
104
- }
105
- }
106
- // Fallback to env var
107
- if (process.env.GITEA_USERNAME) {
108
- this._giteaUsername = process.env.GITEA_USERNAME;
109
- return this._giteaUsername;
110
- }
111
- throw new Error('Gitea username not available. Set GITEA_USERNAME env var or configure GITEA_URL and GITEA_TOKEN.');
112
- }
113
49
  }
114
- //# sourceMappingURL=providerManager.js.map
@@ -10,4 +10,3 @@ export declare const TOOLS_GUIDE: {
10
10
  content: string;
11
11
  };
12
12
  export default TOOLS_GUIDE;
13
- //# sourceMappingURL=toolsGuide.d.ts.map