@andrebuzeli/git-mcp 5.5.0 → 5.5.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.
Files changed (224) hide show
  1. package/README.md +25 -0
  2. package/dist/config.d.ts +5 -131
  3. package/dist/config.js +28 -430
  4. package/dist/index.d.ts +1 -21
  5. package/dist/index.js +66 -144
  6. package/dist/providers/giteaProvider.d.ts +3 -0
  7. package/dist/providers/giteaProvider.js +12 -0
  8. package/dist/providers/githubProvider.d.ts +2 -0
  9. package/dist/providers/githubProvider.js +7 -0
  10. package/dist/providers/providerManager.d.ts +11 -0
  11. package/dist/providers/providerManager.js +48 -0
  12. package/dist/server.d.ts +6 -40
  13. package/dist/server.js +30 -700
  14. package/dist/tools/gitAnalytics.d.ts +29 -0
  15. package/dist/tools/gitAnalytics.js +72 -0
  16. package/dist/tools/gitArchive.d.ts +6 -0
  17. package/dist/tools/gitArchive.js +27 -0
  18. package/dist/tools/gitBackup.d.ts +10 -0
  19. package/dist/tools/gitBackup.js +44 -0
  20. package/dist/tools/gitBranches.d.ts +72 -0
  21. package/dist/tools/gitBranches.js +97 -0
  22. package/dist/tools/gitConfig.d.ts +34 -0
  23. package/dist/tools/gitConfig.js +73 -0
  24. package/dist/tools/gitFiles.d.ts +24 -0
  25. package/dist/tools/gitFiles.js +53 -0
  26. package/dist/tools/gitIssues.d.ts +21 -0
  27. package/dist/tools/gitIssues.js +193 -0
  28. package/dist/tools/gitMonitor.d.ts +51 -0
  29. package/dist/tools/gitMonitor.js +102 -0
  30. package/dist/tools/gitPackages.d.ts +6 -0
  31. package/dist/tools/gitPackages.js +28 -0
  32. package/dist/tools/gitPulls.d.ts +74 -0
  33. package/dist/tools/gitPulls.js +190 -0
  34. package/dist/tools/gitRelease.d.ts +34 -0
  35. package/dist/tools/gitRelease.js +99 -0
  36. package/dist/tools/gitRemote.d.ts +51 -0
  37. package/dist/tools/gitRemote.js +68 -0
  38. package/dist/tools/gitReset.d.ts +34 -0
  39. package/dist/tools/gitReset.js +64 -0
  40. package/dist/tools/gitStash.d.ts +41 -0
  41. package/dist/tools/gitStash.js +67 -0
  42. package/dist/tools/gitSync.d.ts +25 -0
  43. package/dist/tools/gitSync.js +51 -0
  44. package/dist/tools/gitTags.d.ts +30 -0
  45. package/dist/tools/gitTags.js +69 -0
  46. package/dist/tools/gitWorkflow.d.ts +69 -0
  47. package/dist/tools/gitWorkflow.js +129 -0
  48. package/dist/types.d.ts +10 -0
  49. package/dist/types.js +2 -0
  50. package/dist/utils/errors.d.ts +13 -0
  51. package/dist/utils/errors.js +22 -0
  52. package/dist/utils/safetyController.d.ts +1 -0
  53. package/dist/utils/safetyController.js +15 -0
  54. package/package.json +7 -2
  55. package/dist/config.d.ts.map +0 -1
  56. package/dist/config.js.map +0 -1
  57. package/dist/index.d.ts.map +0 -1
  58. package/dist/index.js.map +0 -1
  59. package/dist/providers/base-provider.d.ts +0 -66
  60. package/dist/providers/base-provider.d.ts.map +0 -1
  61. package/dist/providers/base-provider.js +0 -65
  62. package/dist/providers/base-provider.js.map +0 -1
  63. package/dist/providers/gitea-provider.d.ts +0 -79
  64. package/dist/providers/gitea-provider.d.ts.map +0 -1
  65. package/dist/providers/gitea-provider.js +0 -576
  66. package/dist/providers/gitea-provider.js.map +0 -1
  67. package/dist/providers/github-provider.d.ts +0 -74
  68. package/dist/providers/github-provider.d.ts.map +0 -1
  69. package/dist/providers/github-provider.js +0 -683
  70. package/dist/providers/github-provider.js.map +0 -1
  71. package/dist/providers/index.d.ts +0 -13
  72. package/dist/providers/index.d.ts.map +0 -1
  73. package/dist/providers/index.js +0 -35
  74. package/dist/providers/index.js.map +0 -1
  75. package/dist/providers/provider-factory.d.ts +0 -49
  76. package/dist/providers/provider-factory.d.ts.map +0 -1
  77. package/dist/providers/provider-factory.js +0 -193
  78. package/dist/providers/provider-factory.js.map +0 -1
  79. package/dist/providers/provider-operation-handler.d.ts +0 -115
  80. package/dist/providers/provider-operation-handler.d.ts.map +0 -1
  81. package/dist/providers/provider-operation-handler.js +0 -449
  82. package/dist/providers/provider-operation-handler.js.map +0 -1
  83. package/dist/providers/types.d.ts +0 -200
  84. package/dist/providers/types.d.ts.map +0 -1
  85. package/dist/providers/types.js +0 -8
  86. package/dist/providers/types.js.map +0 -1
  87. package/dist/server.d.ts.map +0 -1
  88. package/dist/server.js.map +0 -1
  89. package/dist/tools/git-analytics.d.ts +0 -237
  90. package/dist/tools/git-analytics.d.ts.map +0 -1
  91. package/dist/tools/git-analytics.js +0 -828
  92. package/dist/tools/git-analytics.js.map +0 -1
  93. package/dist/tools/git-archive.d.ts +0 -113
  94. package/dist/tools/git-archive.d.ts.map +0 -1
  95. package/dist/tools/git-archive.js +0 -466
  96. package/dist/tools/git-archive.js.map +0 -1
  97. package/dist/tools/git-auto-monitor.d.ts +0 -180
  98. package/dist/tools/git-auto-monitor.d.ts.map +0 -1
  99. package/dist/tools/git-auto-monitor.js +0 -522
  100. package/dist/tools/git-auto-monitor.js.map +0 -1
  101. package/dist/tools/git-backup.d.ts +0 -105
  102. package/dist/tools/git-backup.d.ts.map +0 -1
  103. package/dist/tools/git-backup.js +0 -414
  104. package/dist/tools/git-backup.js.map +0 -1
  105. package/dist/tools/git-branches.d.ts +0 -183
  106. package/dist/tools/git-branches.d.ts.map +0 -1
  107. package/dist/tools/git-branches.js +0 -507
  108. package/dist/tools/git-branches.js.map +0 -1
  109. package/dist/tools/git-config.d.ts +0 -119
  110. package/dist/tools/git-config.d.ts.map +0 -1
  111. package/dist/tools/git-config.js +0 -449
  112. package/dist/tools/git-config.js.map +0 -1
  113. package/dist/tools/git-files.d.ts +0 -150
  114. package/dist/tools/git-files.d.ts.map +0 -1
  115. package/dist/tools/git-files.js +0 -536
  116. package/dist/tools/git-files.js.map +0 -1
  117. package/dist/tools/git-history.d.ts +0 -253
  118. package/dist/tools/git-history.d.ts.map +0 -1
  119. package/dist/tools/git-history.js +0 -824
  120. package/dist/tools/git-history.js.map +0 -1
  121. package/dist/tools/git-issues.d.ts +0 -164
  122. package/dist/tools/git-issues.d.ts.map +0 -1
  123. package/dist/tools/git-issues.js +0 -349
  124. package/dist/tools/git-issues.js.map +0 -1
  125. package/dist/tools/git-monitor.d.ts +0 -154
  126. package/dist/tools/git-monitor.d.ts.map +0 -1
  127. package/dist/tools/git-monitor.js +0 -531
  128. package/dist/tools/git-monitor.js.map +0 -1
  129. package/dist/tools/git-packages.d.ts +0 -157
  130. package/dist/tools/git-packages.d.ts.map +0 -1
  131. package/dist/tools/git-packages.js +0 -534
  132. package/dist/tools/git-packages.js.map +0 -1
  133. package/dist/tools/git-pulls.d.ts +0 -180
  134. package/dist/tools/git-pulls.d.ts.map +0 -1
  135. package/dist/tools/git-pulls.js +0 -378
  136. package/dist/tools/git-pulls.js.map +0 -1
  137. package/dist/tools/git-release.d.ts +0 -161
  138. package/dist/tools/git-release.d.ts.map +0 -1
  139. package/dist/tools/git-release.js +0 -466
  140. package/dist/tools/git-release.js.map +0 -1
  141. package/dist/tools/git-remote.d.ts +0 -128
  142. package/dist/tools/git-remote.d.ts.map +0 -1
  143. package/dist/tools/git-remote.js +0 -542
  144. package/dist/tools/git-remote.js.map +0 -1
  145. package/dist/tools/git-reset.d.ts +0 -120
  146. package/dist/tools/git-reset.d.ts.map +0 -1
  147. package/dist/tools/git-reset.js +0 -479
  148. package/dist/tools/git-reset.js.map +0 -1
  149. package/dist/tools/git-stash.d.ts +0 -124
  150. package/dist/tools/git-stash.d.ts.map +0 -1
  151. package/dist/tools/git-stash.js +0 -506
  152. package/dist/tools/git-stash.js.map +0 -1
  153. package/dist/tools/git-sync.d.ts +0 -154
  154. package/dist/tools/git-sync.d.ts.map +0 -1
  155. package/dist/tools/git-sync.js +0 -479
  156. package/dist/tools/git-sync.js.map +0 -1
  157. package/dist/tools/git-tags.d.ts +0 -136
  158. package/dist/tools/git-tags.d.ts.map +0 -1
  159. package/dist/tools/git-tags.js +0 -470
  160. package/dist/tools/git-tags.js.map +0 -1
  161. package/dist/tools/git-update.d.ts +0 -224
  162. package/dist/tools/git-update.d.ts.map +0 -1
  163. package/dist/tools/git-update.js +0 -948
  164. package/dist/tools/git-update.js.map +0 -1
  165. package/dist/tools/git-workflow.d.ts +0 -189
  166. package/dist/tools/git-workflow.d.ts.map +0 -1
  167. package/dist/tools/git-workflow.js +0 -551
  168. package/dist/tools/git-workflow.js.map +0 -1
  169. package/dist/utils/credential-manager.d.ts +0 -119
  170. package/dist/utils/credential-manager.d.ts.map +0 -1
  171. package/dist/utils/credential-manager.js +0 -450
  172. package/dist/utils/credential-manager.js.map +0 -1
  173. package/dist/utils/data-merger.d.ts +0 -49
  174. package/dist/utils/data-merger.d.ts.map +0 -1
  175. package/dist/utils/data-merger.js +0 -233
  176. package/dist/utils/data-merger.js.map +0 -1
  177. package/dist/utils/git-command-executor.d.ts +0 -330
  178. package/dist/utils/git-command-executor.d.ts.map +0 -1
  179. package/dist/utils/git-command-executor.js +0 -901
  180. package/dist/utils/git-command-executor.js.map +0 -1
  181. package/dist/utils/logger.d.ts +0 -143
  182. package/dist/utils/logger.d.ts.map +0 -1
  183. package/dist/utils/logger.js +0 -473
  184. package/dist/utils/logger.js.map +0 -1
  185. package/dist/utils/operation-error-handler.d.ts +0 -97
  186. package/dist/utils/operation-error-handler.d.ts.map +0 -1
  187. package/dist/utils/operation-error-handler.js +0 -367
  188. package/dist/utils/operation-error-handler.js.map +0 -1
  189. package/dist/utils/parameter-validator.d.ts +0 -49
  190. package/dist/utils/parameter-validator.d.ts.map +0 -1
  191. package/dist/utils/parameter-validator.js +0 -647
  192. package/dist/utils/parameter-validator.js.map +0 -1
  193. package/dist/utils/repository-checker.d.ts +0 -46
  194. package/dist/utils/repository-checker.d.ts.map +0 -1
  195. package/dist/utils/repository-checker.js +0 -151
  196. package/dist/utils/repository-checker.js.map +0 -1
  197. package/dist/utils/repository-detector.d.ts +0 -128
  198. package/dist/utils/repository-detector.d.ts.map +0 -1
  199. package/dist/utils/repository-detector.js +0 -422
  200. package/dist/utils/repository-detector.js.map +0 -1
  201. package/dist/utils/repository-sync.d.ts +0 -67
  202. package/dist/utils/repository-sync.d.ts.map +0 -1
  203. package/dist/utils/repository-sync.js +0 -344
  204. package/dist/utils/repository-sync.js.map +0 -1
  205. package/dist/utils/response-formatter.d.ts +0 -146
  206. package/dist/utils/response-formatter.d.ts.map +0 -1
  207. package/dist/utils/response-formatter.js +0 -378
  208. package/dist/utils/response-formatter.js.map +0 -1
  209. package/dist/utils/retry.d.ts +0 -12
  210. package/dist/utils/retry.d.ts.map +0 -1
  211. package/dist/utils/retry.js +0 -28
  212. package/dist/utils/retry.js.map +0 -1
  213. package/dist/utils/safety-warnings.d.ts +0 -56
  214. package/dist/utils/safety-warnings.d.ts.map +0 -1
  215. package/dist/utils/safety-warnings.js +0 -330
  216. package/dist/utils/safety-warnings.js.map +0 -1
  217. package/dist/utils/terminal-controller.d.ts +0 -79
  218. package/dist/utils/terminal-controller.d.ts.map +0 -1
  219. package/dist/utils/terminal-controller.js +0 -291
  220. package/dist/utils/terminal-controller.js.map +0 -1
  221. package/dist/utils/user-friendly-formatter.d.ts +0 -45
  222. package/dist/utils/user-friendly-formatter.d.ts.map +0 -1
  223. package/dist/utils/user-friendly-formatter.js +0 -175
  224. package/dist/utils/user-friendly-formatter.js.map +0 -1
@@ -1,534 +0,0 @@
1
- "use strict";
2
- /**
3
- * Git Packages Tool
4
- *
5
- * Package management tool providing comprehensive Git package operations.
6
- * Supports both local package operations and remote provider operations.
7
- *
8
- * Operations: list, get, create, update, delete, publish, download
9
- */
10
- Object.defineProperty(exports, "__esModule", { value: true });
11
- exports.GitPackagesTool = void 0;
12
- const git_command_executor_js_1 = require("../utils/git-command-executor.js");
13
- const parameter_validator_js_1 = require("../utils/parameter-validator.js");
14
- const operation_error_handler_js_1 = require("../utils/operation-error-handler.js");
15
- const provider_operation_handler_js_1 = require("../providers/provider-operation-handler.js");
16
- const config_js_1 = require("../config.js");
17
- class GitPackagesTool {
18
- gitExecutor;
19
- providerHandler;
20
- constructor(providerConfig) {
21
- this.gitExecutor = new git_command_executor_js_1.GitCommandExecutor();
22
- if (providerConfig) {
23
- this.providerHandler = new provider_operation_handler_js_1.ProviderOperationHandler(providerConfig);
24
- }
25
- }
26
- /**
27
- * Execute git-packages operation
28
- */
29
- async execute(params) {
30
- const startTime = Date.now();
31
- try {
32
- // Validate basic parameters
33
- const validation = parameter_validator_js_1.ParameterValidator.validateToolParams('git-packages', params);
34
- if (!validation.isValid) {
35
- return operation_error_handler_js_1.OperationErrorHandler.createToolError('VALIDATION_ERROR', `Parameter validation failed: ${validation.errors.join(', ')}`, params.action, { validationErrors: validation.errors }, validation.suggestions);
36
- }
37
- // Validate operation-specific parameters
38
- const operationValidation = parameter_validator_js_1.ParameterValidator.validateOperationParams('git-packages', params.action, params);
39
- if (!operationValidation.isValid) {
40
- return operation_error_handler_js_1.OperationErrorHandler.createToolError('VALIDATION_ERROR', `Operation validation failed: ${operationValidation.errors.join(', ')}`, params.action, { validationErrors: operationValidation.errors }, operationValidation.suggestions);
41
- }
42
- // Route to appropriate handler
43
- const isRemoteOperation = this.isRemoteOperation(params.action);
44
- if (isRemoteOperation) {
45
- return await this.executeRemoteOperation(params, startTime);
46
- }
47
- else {
48
- return await this.executeLocalOperation(params, startTime);
49
- }
50
- }
51
- catch (error) {
52
- const errorMessage = error instanceof Error ? error.message : 'Unknown error';
53
- return operation_error_handler_js_1.OperationErrorHandler.createToolError('EXECUTION_ERROR', `Failed to execute ${params.action}: ${errorMessage}`, params.action, { error: errorMessage }, ['Check the error details and try again']);
54
- }
55
- }
56
- /**
57
- * Execute local Git package operations
58
- */
59
- async executeLocalOperation(params, startTime) {
60
- switch (params.action) {
61
- case 'list':
62
- return await this.handleListLocalPackages(params, startTime);
63
- case 'get':
64
- return await this.handleGetLocalPackage(params, startTime);
65
- default:
66
- return operation_error_handler_js_1.OperationErrorHandler.createToolError('UNSUPPORTED_LOCAL_OPERATION', `Local operation '${params.action}' is not supported. Use provider for remote package operations.`, params.action, {}, ['Specify a provider (github, gitea, or both) for remote package operations']);
67
- }
68
- }
69
- /**
70
- * Execute remote provider operations
71
- */
72
- async executeRemoteOperation(params, startTime) {
73
- if (!this.providerHandler) {
74
- return operation_error_handler_js_1.OperationErrorHandler.createToolError('PROVIDER_NOT_CONFIGURED', 'Provider handler is not configured for remote operations', params.action, {}, ['Configure GitHub or Gitea provider to use remote operations']);
75
- }
76
- if (!params.provider) {
77
- if (config_js_1.configManager.isUniversalMode()) {
78
- params.provider = 'both';
79
- console.error(`[Universal Mode] Auto-applying both providers for ${params.action}`);
80
- }
81
- else {
82
- return operation_error_handler_js_1.OperationErrorHandler.createToolError('PROVIDER_REQUIRED', 'Provider parameter is required for remote package operations', params.action, {}, ['Specify provider as: github, gitea, or both']);
83
- }
84
- }
85
- const operation = {
86
- provider: params.provider,
87
- operation: this.mapActionToProviderOperation(params.action),
88
- parameters: this.extractRemoteParameters(params),
89
- requiresAuth: true,
90
- isRemoteOperation: true
91
- };
92
- try {
93
- const result = await this.providerHandler.executeOperation(operation);
94
- return {
95
- success: result.success,
96
- data: result.partialFailure ? result : result.results[0]?.data,
97
- error: result.success ? undefined : {
98
- code: result.errors[0]?.error?.code || 'REMOTE_OPERATION_ERROR',
99
- message: result.errors[0]?.error?.message || 'Remote operation failed',
100
- details: result.errors,
101
- suggestions: ['Check provider configuration and credentials']
102
- },
103
- metadata: {
104
- provider: params.provider,
105
- operation: params.action,
106
- timestamp: new Date().toISOString(),
107
- executionTime: Date.now() - startTime
108
- }
109
- };
110
- }
111
- catch (error) {
112
- const errorMessage = error instanceof Error ? error.message : 'Unknown error';
113
- return operation_error_handler_js_1.OperationErrorHandler.createToolError('REMOTE_OPERATION_ERROR', `Remote operation failed: ${errorMessage}`, params.action, { error: errorMessage }, ['Check provider configuration and network connectivity']);
114
- }
115
- }
116
- /**
117
- * Handle list local packages operation (checks for package files)
118
- */
119
- async handleListLocalPackages(params, startTime) {
120
- try {
121
- const packages = [];
122
- // Check for common package files
123
- const packageFiles = [
124
- { file: 'package.json', type: 'npm' },
125
- { file: 'pom.xml', type: 'maven' },
126
- { file: 'build.gradle', type: 'gradle' },
127
- { file: 'Cargo.toml', type: 'cargo' },
128
- { file: 'composer.json', type: 'composer' },
129
- { file: 'setup.py', type: 'python' },
130
- { file: 'pyproject.toml', type: 'python' },
131
- { file: 'Dockerfile', type: 'container' },
132
- { file: 'Chart.yaml', type: 'helm' },
133
- { file: 'pubspec.yaml', type: 'dart' },
134
- { file: 'go.mod', type: 'go' }
135
- ];
136
- for (const { file, type } of packageFiles) {
137
- const filePath = `${params.projectPath}/${file}`;
138
- try {
139
- // Check if file exists using git ls-files or simple file check
140
- const result = await this.gitExecutor.executeGitCommand('ls-files', [file], params.projectPath);
141
- if (result.success && result.stdout.trim()) {
142
- // File exists in git, try to read package info
143
- const packageInfo = await this.extractPackageInfo(params.projectPath, file, type);
144
- if (packageInfo) {
145
- packages.push({
146
- type,
147
- file,
148
- ...packageInfo,
149
- isLocal: true
150
- });
151
- }
152
- }
153
- }
154
- catch (error) {
155
- // Continue checking other files
156
- continue;
157
- }
158
- }
159
- return {
160
- success: true,
161
- data: {
162
- packages,
163
- total: packages.length,
164
- note: 'These are local package definitions. Use a provider for remote package registry operations.'
165
- },
166
- metadata: {
167
- operation: 'list',
168
- timestamp: new Date().toISOString(),
169
- executionTime: Date.now() - startTime
170
- }
171
- };
172
- }
173
- catch (error) {
174
- const errorMessage = error instanceof Error ? error.message : 'Unknown error';
175
- return operation_error_handler_js_1.OperationErrorHandler.createToolError('LIST_PACKAGES_ERROR', `Failed to list local packages: ${errorMessage}`, 'list', { error: errorMessage, projectPath: params.projectPath });
176
- }
177
- }
178
- /**
179
- * Handle get local package operation (gets package file info)
180
- */
181
- async handleGetLocalPackage(params, startTime) {
182
- try {
183
- if (!params.packageName && !params.packageType) {
184
- return operation_error_handler_js_1.OperationErrorHandler.createToolError('MISSING_PARAMETER', 'Either packageName or packageType is required for get package operation', 'get', {}, [
185
- 'Provide packageName with the actual file path (e.g., "package.json", "pom.xml")',
186
- 'Or provide packageType to auto-detect common package files (e.g., "npm", "maven")',
187
- 'Note: packageName should be the file name, not the package name from the file'
188
- ]);
189
- }
190
- // Determine package file based on name or type
191
- let packageFile = params.packageName;
192
- let packageType = params.packageType;
193
- if (!packageFile && packageType) {
194
- const typeToFile = {
195
- 'npm': 'package.json',
196
- 'maven': 'pom.xml',
197
- 'gradle': 'build.gradle',
198
- 'cargo': 'Cargo.toml',
199
- 'composer': 'composer.json',
200
- 'python': 'setup.py',
201
- 'container': 'Dockerfile',
202
- 'helm': 'Chart.yaml',
203
- 'dart': 'pubspec.yaml',
204
- 'go': 'go.mod'
205
- };
206
- packageFile = typeToFile[packageType];
207
- }
208
- if (!packageFile) {
209
- return operation_error_handler_js_1.OperationErrorHandler.createToolError('INVALID_PACKAGE_TYPE', `Unknown package type: ${packageType}`, 'get', { packageType }, ['Use supported package types: npm, maven, gradle, cargo, composer, python, container, helm, dart, go']);
210
- }
211
- // Check if package file exists
212
- const result = await this.gitExecutor.executeGitCommand('ls-files', [packageFile], params.projectPath);
213
- if (!result.success || !result.stdout.trim()) {
214
- return operation_error_handler_js_1.OperationErrorHandler.createToolError('PACKAGE_NOT_FOUND', `Package file '${packageFile}' not found in repository`, 'get', { packageFile }, [
215
- 'Check if the package file exists in the repository',
216
- 'Verify the file is tracked by git (not in .gitignore)',
217
- 'Use correct file name (e.g., "package.json" not "@andrebuzeli/git-mcp")',
218
- 'Try using packageType parameter instead to auto-detect common files'
219
- ]);
220
- }
221
- // Extract package information
222
- const packageInfo = await this.extractPackageInfo(params.projectPath, packageFile, packageType);
223
- if (!packageInfo) {
224
- return operation_error_handler_js_1.OperationErrorHandler.createToolError('PACKAGE_READ_ERROR', `Failed to read package information from '${packageFile}'`, 'get', { packageFile }, ['Check if the package file is valid and readable']);
225
- }
226
- return {
227
- success: true,
228
- data: {
229
- file: packageFile,
230
- type: packageType,
231
- ...packageInfo,
232
- isLocal: true,
233
- note: 'This is a local package definition. Use a provider for remote package registry operations.'
234
- },
235
- metadata: {
236
- operation: 'get',
237
- timestamp: new Date().toISOString(),
238
- executionTime: Date.now() - startTime
239
- }
240
- };
241
- }
242
- catch (error) {
243
- const errorMessage = error instanceof Error ? error.message : 'Unknown error';
244
- return operation_error_handler_js_1.OperationErrorHandler.createToolError('GET_PACKAGE_ERROR', `Failed to get local package information: ${errorMessage}`, 'get', { error: errorMessage, projectPath: params.projectPath });
245
- }
246
- }
247
- /**
248
- * Extract package information from package files
249
- */
250
- async extractPackageInfo(projectPath, file, type) {
251
- try {
252
- const result = await this.gitExecutor.executeGitCommand('show', [`HEAD:${file}`], projectPath);
253
- if (!result.success) {
254
- return null;
255
- }
256
- const content = result.stdout;
257
- switch (file) {
258
- case 'package.json':
259
- try {
260
- const pkg = JSON.parse(content);
261
- return {
262
- name: pkg.name,
263
- version: pkg.version,
264
- description: pkg.description,
265
- author: pkg.author,
266
- license: pkg.license,
267
- dependencies: pkg.dependencies ? Object.keys(pkg.dependencies).length : 0,
268
- devDependencies: pkg.devDependencies ? Object.keys(pkg.devDependencies).length : 0,
269
- scripts: pkg.scripts ? Object.keys(pkg.scripts) : [],
270
- repository: pkg.repository,
271
- homepage: pkg.homepage
272
- };
273
- }
274
- catch {
275
- return { name: 'Invalid package.json', error: 'Failed to parse JSON' };
276
- }
277
- case 'pom.xml':
278
- // Basic XML parsing for Maven
279
- const groupIdMatch = content.match(/<groupId>(.*?)<\/groupId>/);
280
- const artifactIdMatch = content.match(/<artifactId>(.*?)<\/artifactId>/);
281
- const versionMatch = content.match(/<version>(.*?)<\/version>/);
282
- const nameMatch = content.match(/<name>(.*?)<\/name>/);
283
- const descriptionMatch = content.match(/<description>(.*?)<\/description>/);
284
- return {
285
- groupId: groupIdMatch?.[1],
286
- artifactId: artifactIdMatch?.[1],
287
- name: nameMatch?.[1] || artifactIdMatch?.[1],
288
- version: versionMatch?.[1],
289
- description: descriptionMatch?.[1]
290
- };
291
- case 'Cargo.toml':
292
- // Basic TOML parsing for Rust
293
- const nameTomlMatch = content.match(/name\s*=\s*"([^"]+)"/);
294
- const versionTomlMatch = content.match(/version\s*=\s*"([^"]+)"/);
295
- const descriptionTomlMatch = content.match(/description\s*=\s*"([^"]+)"/);
296
- const authorTomlMatch = content.match(/authors\s*=\s*\[(.*?)\]/s);
297
- return {
298
- name: nameTomlMatch?.[1],
299
- version: versionTomlMatch?.[1],
300
- description: descriptionTomlMatch?.[1],
301
- authors: authorTomlMatch?.[1]?.split(',').map((a) => a.trim().replace(/"/g, ''))
302
- };
303
- case 'composer.json':
304
- try {
305
- const composer = JSON.parse(content);
306
- return {
307
- name: composer.name,
308
- version: composer.version,
309
- description: composer.description,
310
- type: composer.type,
311
- license: composer.license,
312
- authors: composer.authors,
313
- require: composer.require ? Object.keys(composer.require).length : 0,
314
- requireDev: composer['require-dev'] ? Object.keys(composer['require-dev']).length : 0
315
- };
316
- }
317
- catch {
318
- return { name: 'Invalid composer.json', error: 'Failed to parse JSON' };
319
- }
320
- case 'Chart.yaml':
321
- // Basic YAML parsing for Helm
322
- const chartNameMatch = content.match(/name:\s*(.+)/);
323
- const chartVersionMatch = content.match(/version:\s*(.+)/);
324
- const chartDescMatch = content.match(/description:\s*(.+)/);
325
- const appVersionMatch = content.match(/appVersion:\s*(.+)/);
326
- return {
327
- name: chartNameMatch?.[1]?.trim(),
328
- version: chartVersionMatch?.[1]?.trim(),
329
- description: chartDescMatch?.[1]?.trim(),
330
- appVersion: appVersionMatch?.[1]?.trim()
331
- };
332
- case 'go.mod':
333
- const moduleMatch = content.match(/module\s+(.+)/);
334
- const goVersionMatch = content.match(/go\s+(.+)/);
335
- return {
336
- module: moduleMatch?.[1]?.trim(),
337
- goVersion: goVersionMatch?.[1]?.trim(),
338
- name: moduleMatch?.[1]?.split('/').pop()
339
- };
340
- default:
341
- return {
342
- name: file,
343
- type: type || 'unknown',
344
- size: content.length
345
- };
346
- }
347
- }
348
- catch (error) {
349
- return null;
350
- }
351
- }
352
- /**
353
- * Check if operation is a remote operation
354
- */
355
- isRemoteOperation(action) {
356
- // Most package operations require remote provider APIs
357
- const remoteOperations = ['create', 'update', 'delete', 'publish', 'download'];
358
- return remoteOperations.includes(action);
359
- }
360
- /**
361
- * Extract parameters for remote operations
362
- */
363
- extractRemoteParameters(params) {
364
- const remoteParams = {
365
- projectPath: params.projectPath
366
- };
367
- // Common parameters
368
- if (params.repo)
369
- remoteParams.repo = params.repo;
370
- if (params.packageName)
371
- remoteParams.package_name = params.packageName;
372
- if (params.packageType)
373
- remoteParams.package_type = params.packageType;
374
- if (params.version)
375
- remoteParams.version = params.version;
376
- // Operation-specific parameters
377
- switch (params.action) {
378
- case 'list':
379
- if (params.limit)
380
- remoteParams.per_page = params.limit;
381
- if (params.packageType)
382
- remoteParams.package_type = params.packageType;
383
- if (params.query)
384
- remoteParams.q = params.query;
385
- if (params.includeVersions !== undefined)
386
- remoteParams.include_versions = params.includeVersions;
387
- break;
388
- case 'get':
389
- // Get operations need packageName (already handled above)
390
- if (params.includeVersions !== undefined)
391
- remoteParams.include_versions = params.includeVersions;
392
- break;
393
- case 'create':
394
- if (params.description)
395
- remoteParams.description = params.description;
396
- if (params.visibility)
397
- remoteParams.visibility = params.visibility;
398
- if (params.packageData)
399
- remoteParams.package_data = params.packageData;
400
- if (params.tags)
401
- remoteParams.tags = params.tags;
402
- break;
403
- case 'update':
404
- if (params.description)
405
- remoteParams.description = params.description;
406
- if (params.visibility)
407
- remoteParams.visibility = params.visibility;
408
- if (params.packageData)
409
- remoteParams.package_data = params.packageData;
410
- if (params.tags)
411
- remoteParams.tags = params.tags;
412
- break;
413
- case 'delete':
414
- // Delete operations need packageName and version (already handled above)
415
- break;
416
- case 'publish':
417
- if (params.registry)
418
- remoteParams.registry = params.registry;
419
- if (params.packageData)
420
- remoteParams.package_data = params.packageData;
421
- break;
422
- case 'download':
423
- if (params.downloadPath)
424
- remoteParams.download_path = params.downloadPath;
425
- if (params.format)
426
- remoteParams.format = params.format;
427
- break;
428
- }
429
- return remoteParams;
430
- }
431
- /**
432
- * Map git-packages actions to provider operations
433
- */
434
- mapActionToProviderOperation(action) {
435
- const actionMap = {
436
- 'list': 'package-list',
437
- 'get': 'package-get',
438
- 'create': 'package-create',
439
- 'update': 'package-update',
440
- 'delete': 'package-delete',
441
- 'publish': 'package-publish',
442
- 'download': 'package-download'
443
- };
444
- return actionMap[action] || action;
445
- }
446
- /**
447
- * Get tool schema for MCP registration
448
- */
449
- static getToolSchema() {
450
- return {
451
- name: 'git-packages',
452
- description: 'Git package management tool for package operations. Supports list, get, create, update, delete, publish, and download operations. Local operations work with package files, remote operations require a provider. In universal mode (GIT_MCP_MODE=universal), automatically executes on both GitHub and Gitea providers.',
453
- inputSchema: {
454
- type: 'object',
455
- properties: {
456
- action: {
457
- type: 'string',
458
- enum: ['list', 'get', 'create', 'update', 'delete', 'publish', 'download'],
459
- description: 'The package operation to perform'
460
- },
461
- projectPath: {
462
- type: 'string',
463
- description: 'Absolute path to the project directory'
464
- },
465
- packageName: {
466
- type: 'string',
467
- description: 'Name of the package file (e.g., "package.json", "pom.xml") - NOT the package name from inside the file (required for most operations)'
468
- },
469
- packageType: {
470
- type: 'string',
471
- description: 'Type of package (npm, maven, container, etc.)'
472
- },
473
- version: {
474
- type: 'string',
475
- description: 'Package version (for get, create, update, delete, publish, download)'
476
- },
477
- description: {
478
- type: 'string',
479
- description: 'Package description (for create/update)'
480
- },
481
- visibility: {
482
- type: 'string',
483
- enum: ['public', 'private', 'internal'],
484
- description: 'Package visibility (for create/update)'
485
- },
486
- packageData: {
487
- type: 'object',
488
- description: 'Package content/metadata (for create/update/publish)'
489
- },
490
- tags: {
491
- type: 'array',
492
- items: { type: 'string' },
493
- description: 'Package tags (for create/update)'
494
- },
495
- downloadPath: {
496
- type: 'string',
497
- description: 'Path to save downloaded package (for download)'
498
- },
499
- format: {
500
- type: 'string',
501
- description: 'Package format for download (for download)'
502
- },
503
- registry: {
504
- type: 'string',
505
- description: 'Target registry for publishing (for publish)'
506
- },
507
- force: {
508
- type: 'boolean',
509
- description: 'Force operation (for delete, update)'
510
- },
511
- includeVersions: {
512
- type: 'boolean',
513
- description: 'Include version history (for list, get)'
514
- },
515
- repo: {
516
- type: 'string',
517
- description: 'Repository name (for remote operations)'
518
- },
519
- limit: {
520
- type: 'number',
521
- description: 'Maximum number of packages to return (for list)'
522
- },
523
- query: {
524
- type: 'string',
525
- description: 'Search query for packages (for list)'
526
- }
527
- },
528
- required: ['action', 'projectPath']
529
- }
530
- };
531
- }
532
- }
533
- exports.GitPackagesTool = GitPackagesTool;
534
- //# sourceMappingURL=git-packages.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"git-packages.js","sourceRoot":"","sources":["../../src/tools/git-packages.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;AAEH,8EAAsE;AACtE,4EAAiF;AACjF,oFAAwF;AACxF,8FAAsF;AAEtF,4CAA6C;AAqC7C,MAAa,eAAe;IAClB,WAAW,CAAqB;IAChC,eAAe,CAA4B;IAEnD,YAAY,cAA+B;QACzC,IAAI,CAAC,WAAW,GAAG,IAAI,4CAAkB,EAAE,CAAC;QAC5C,IAAI,cAAc,EAAE,CAAC;YACnB,IAAI,CAAC,eAAe,GAAG,IAAI,wDAAwB,CAAC,cAAc,CAAC,CAAC;QACtE,CAAC;IACH,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,OAAO,CAAC,MAAyB;QACrC,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QAE7B,IAAI,CAAC;YACH,4BAA4B;YAC5B,MAAM,UAAU,GAAG,2CAAkB,CAAC,kBAAkB,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC;YACjF,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC;gBACxB,OAAO,kDAAqB,CAAC,eAAe,CAC1C,kBAAkB,EAClB,gCAAgC,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAC9D,MA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