@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.
- package/README.md +25 -0
- package/dist/config.d.ts +5 -131
- package/dist/config.js +28 -430
- package/dist/index.d.ts +1 -21
- package/dist/index.js +66 -144
- package/dist/providers/giteaProvider.d.ts +3 -0
- package/dist/providers/giteaProvider.js +12 -0
- package/dist/providers/githubProvider.d.ts +2 -0
- package/dist/providers/githubProvider.js +7 -0
- package/dist/providers/providerManager.d.ts +11 -0
- package/dist/providers/providerManager.js +48 -0
- package/dist/server.d.ts +6 -40
- package/dist/server.js +30 -700
- package/dist/tools/gitAnalytics.d.ts +29 -0
- package/dist/tools/gitAnalytics.js +72 -0
- package/dist/tools/gitArchive.d.ts +6 -0
- package/dist/tools/gitArchive.js +27 -0
- package/dist/tools/gitBackup.d.ts +10 -0
- package/dist/tools/gitBackup.js +44 -0
- package/dist/tools/gitBranches.d.ts +72 -0
- package/dist/tools/gitBranches.js +97 -0
- package/dist/tools/gitConfig.d.ts +34 -0
- package/dist/tools/gitConfig.js +73 -0
- package/dist/tools/gitFiles.d.ts +24 -0
- package/dist/tools/gitFiles.js +53 -0
- package/dist/tools/gitIssues.d.ts +21 -0
- package/dist/tools/gitIssues.js +193 -0
- package/dist/tools/gitMonitor.d.ts +51 -0
- package/dist/tools/gitMonitor.js +102 -0
- package/dist/tools/gitPackages.d.ts +6 -0
- package/dist/tools/gitPackages.js +28 -0
- package/dist/tools/gitPulls.d.ts +74 -0
- package/dist/tools/gitPulls.js +190 -0
- package/dist/tools/gitRelease.d.ts +34 -0
- package/dist/tools/gitRelease.js +99 -0
- package/dist/tools/gitRemote.d.ts +51 -0
- package/dist/tools/gitRemote.js +68 -0
- package/dist/tools/gitReset.d.ts +34 -0
- package/dist/tools/gitReset.js +64 -0
- package/dist/tools/gitStash.d.ts +41 -0
- package/dist/tools/gitStash.js +67 -0
- package/dist/tools/gitSync.d.ts +25 -0
- package/dist/tools/gitSync.js +51 -0
- package/dist/tools/gitTags.d.ts +30 -0
- package/dist/tools/gitTags.js +69 -0
- package/dist/tools/gitWorkflow.d.ts +69 -0
- package/dist/tools/gitWorkflow.js +129 -0
- package/dist/types.d.ts +10 -0
- package/dist/types.js +2 -0
- package/dist/utils/errors.d.ts +13 -0
- package/dist/utils/errors.js +22 -0
- package/dist/utils/safetyController.d.ts +1 -0
- package/dist/utils/safetyController.js +15 -0
- package/package.json +7 -2
- 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/providers/base-provider.d.ts +0 -66
- package/dist/providers/base-provider.d.ts.map +0 -1
- package/dist/providers/base-provider.js +0 -65
- package/dist/providers/base-provider.js.map +0 -1
- package/dist/providers/gitea-provider.d.ts +0 -79
- package/dist/providers/gitea-provider.d.ts.map +0 -1
- package/dist/providers/gitea-provider.js +0 -576
- package/dist/providers/gitea-provider.js.map +0 -1
- package/dist/providers/github-provider.d.ts +0 -74
- package/dist/providers/github-provider.d.ts.map +0 -1
- package/dist/providers/github-provider.js +0 -683
- package/dist/providers/github-provider.js.map +0 -1
- package/dist/providers/index.d.ts +0 -13
- package/dist/providers/index.d.ts.map +0 -1
- package/dist/providers/index.js +0 -35
- package/dist/providers/index.js.map +0 -1
- package/dist/providers/provider-factory.d.ts +0 -49
- package/dist/providers/provider-factory.d.ts.map +0 -1
- package/dist/providers/provider-factory.js +0 -193
- package/dist/providers/provider-factory.js.map +0 -1
- package/dist/providers/provider-operation-handler.d.ts +0 -115
- package/dist/providers/provider-operation-handler.d.ts.map +0 -1
- package/dist/providers/provider-operation-handler.js +0 -449
- package/dist/providers/provider-operation-handler.js.map +0 -1
- package/dist/providers/types.d.ts +0 -200
- package/dist/providers/types.d.ts.map +0 -1
- package/dist/providers/types.js +0 -8
- package/dist/providers/types.js.map +0 -1
- package/dist/server.d.ts.map +0 -1
- package/dist/server.js.map +0 -1
- package/dist/tools/git-analytics.d.ts +0 -237
- package/dist/tools/git-analytics.d.ts.map +0 -1
- package/dist/tools/git-analytics.js +0 -828
- package/dist/tools/git-analytics.js.map +0 -1
- package/dist/tools/git-archive.d.ts +0 -113
- package/dist/tools/git-archive.d.ts.map +0 -1
- package/dist/tools/git-archive.js +0 -466
- package/dist/tools/git-archive.js.map +0 -1
- package/dist/tools/git-auto-monitor.d.ts +0 -180
- package/dist/tools/git-auto-monitor.d.ts.map +0 -1
- package/dist/tools/git-auto-monitor.js +0 -522
- package/dist/tools/git-auto-monitor.js.map +0 -1
- package/dist/tools/git-backup.d.ts +0 -105
- package/dist/tools/git-backup.d.ts.map +0 -1
- package/dist/tools/git-backup.js +0 -414
- package/dist/tools/git-backup.js.map +0 -1
- package/dist/tools/git-branches.d.ts +0 -183
- package/dist/tools/git-branches.d.ts.map +0 -1
- package/dist/tools/git-branches.js +0 -507
- package/dist/tools/git-branches.js.map +0 -1
- package/dist/tools/git-config.d.ts +0 -119
- package/dist/tools/git-config.d.ts.map +0 -1
- package/dist/tools/git-config.js +0 -449
- package/dist/tools/git-config.js.map +0 -1
- package/dist/tools/git-files.d.ts +0 -150
- package/dist/tools/git-files.d.ts.map +0 -1
- package/dist/tools/git-files.js +0 -536
- package/dist/tools/git-files.js.map +0 -1
- package/dist/tools/git-history.d.ts +0 -253
- package/dist/tools/git-history.d.ts.map +0 -1
- package/dist/tools/git-history.js +0 -824
- package/dist/tools/git-history.js.map +0 -1
- package/dist/tools/git-issues.d.ts +0 -164
- package/dist/tools/git-issues.d.ts.map +0 -1
- package/dist/tools/git-issues.js +0 -349
- package/dist/tools/git-issues.js.map +0 -1
- package/dist/tools/git-monitor.d.ts +0 -154
- package/dist/tools/git-monitor.d.ts.map +0 -1
- package/dist/tools/git-monitor.js +0 -531
- package/dist/tools/git-monitor.js.map +0 -1
- package/dist/tools/git-packages.d.ts +0 -157
- package/dist/tools/git-packages.d.ts.map +0 -1
- package/dist/tools/git-packages.js +0 -534
- package/dist/tools/git-packages.js.map +0 -1
- package/dist/tools/git-pulls.d.ts +0 -180
- package/dist/tools/git-pulls.d.ts.map +0 -1
- package/dist/tools/git-pulls.js +0 -378
- package/dist/tools/git-pulls.js.map +0 -1
- package/dist/tools/git-release.d.ts +0 -161
- package/dist/tools/git-release.d.ts.map +0 -1
- package/dist/tools/git-release.js +0 -466
- package/dist/tools/git-release.js.map +0 -1
- package/dist/tools/git-remote.d.ts +0 -128
- package/dist/tools/git-remote.d.ts.map +0 -1
- package/dist/tools/git-remote.js +0 -542
- package/dist/tools/git-remote.js.map +0 -1
- package/dist/tools/git-reset.d.ts +0 -120
- package/dist/tools/git-reset.d.ts.map +0 -1
- package/dist/tools/git-reset.js +0 -479
- package/dist/tools/git-reset.js.map +0 -1
- package/dist/tools/git-stash.d.ts +0 -124
- package/dist/tools/git-stash.d.ts.map +0 -1
- package/dist/tools/git-stash.js +0 -506
- package/dist/tools/git-stash.js.map +0 -1
- package/dist/tools/git-sync.d.ts +0 -154
- package/dist/tools/git-sync.d.ts.map +0 -1
- package/dist/tools/git-sync.js +0 -479
- package/dist/tools/git-sync.js.map +0 -1
- package/dist/tools/git-tags.d.ts +0 -136
- package/dist/tools/git-tags.d.ts.map +0 -1
- package/dist/tools/git-tags.js +0 -470
- package/dist/tools/git-tags.js.map +0 -1
- package/dist/tools/git-update.d.ts +0 -224
- package/dist/tools/git-update.d.ts.map +0 -1
- package/dist/tools/git-update.js +0 -948
- package/dist/tools/git-update.js.map +0 -1
- package/dist/tools/git-workflow.d.ts +0 -189
- package/dist/tools/git-workflow.d.ts.map +0 -1
- package/dist/tools/git-workflow.js +0 -551
- package/dist/tools/git-workflow.js.map +0 -1
- package/dist/utils/credential-manager.d.ts +0 -119
- package/dist/utils/credential-manager.d.ts.map +0 -1
- package/dist/utils/credential-manager.js +0 -450
- package/dist/utils/credential-manager.js.map +0 -1
- package/dist/utils/data-merger.d.ts +0 -49
- package/dist/utils/data-merger.d.ts.map +0 -1
- package/dist/utils/data-merger.js +0 -233
- package/dist/utils/data-merger.js.map +0 -1
- package/dist/utils/git-command-executor.d.ts +0 -330
- package/dist/utils/git-command-executor.d.ts.map +0 -1
- package/dist/utils/git-command-executor.js +0 -901
- package/dist/utils/git-command-executor.js.map +0 -1
- package/dist/utils/logger.d.ts +0 -143
- package/dist/utils/logger.d.ts.map +0 -1
- package/dist/utils/logger.js +0 -473
- package/dist/utils/logger.js.map +0 -1
- package/dist/utils/operation-error-handler.d.ts +0 -97
- package/dist/utils/operation-error-handler.d.ts.map +0 -1
- package/dist/utils/operation-error-handler.js +0 -367
- package/dist/utils/operation-error-handler.js.map +0 -1
- package/dist/utils/parameter-validator.d.ts +0 -49
- package/dist/utils/parameter-validator.d.ts.map +0 -1
- package/dist/utils/parameter-validator.js +0 -647
- package/dist/utils/parameter-validator.js.map +0 -1
- package/dist/utils/repository-checker.d.ts +0 -46
- package/dist/utils/repository-checker.d.ts.map +0 -1
- package/dist/utils/repository-checker.js +0 -151
- package/dist/utils/repository-checker.js.map +0 -1
- package/dist/utils/repository-detector.d.ts +0 -128
- package/dist/utils/repository-detector.d.ts.map +0 -1
- package/dist/utils/repository-detector.js +0 -422
- package/dist/utils/repository-detector.js.map +0 -1
- package/dist/utils/repository-sync.d.ts +0 -67
- package/dist/utils/repository-sync.d.ts.map +0 -1
- package/dist/utils/repository-sync.js +0 -344
- package/dist/utils/repository-sync.js.map +0 -1
- package/dist/utils/response-formatter.d.ts +0 -146
- package/dist/utils/response-formatter.d.ts.map +0 -1
- package/dist/utils/response-formatter.js +0 -378
- package/dist/utils/response-formatter.js.map +0 -1
- package/dist/utils/retry.d.ts +0 -12
- package/dist/utils/retry.d.ts.map +0 -1
- package/dist/utils/retry.js +0 -28
- package/dist/utils/retry.js.map +0 -1
- package/dist/utils/safety-warnings.d.ts +0 -56
- package/dist/utils/safety-warnings.d.ts.map +0 -1
- package/dist/utils/safety-warnings.js +0 -330
- package/dist/utils/safety-warnings.js.map +0 -1
- package/dist/utils/terminal-controller.d.ts +0 -79
- package/dist/utils/terminal-controller.d.ts.map +0 -1
- package/dist/utils/terminal-controller.js +0 -291
- package/dist/utils/terminal-controller.js.map +0 -1
- package/dist/utils/user-friendly-formatter.d.ts +0 -45
- package/dist/utils/user-friendly-formatter.d.ts.map +0 -1
- package/dist/utils/user-friendly-formatter.js +0 -175
- package/dist/utils/user-friendly-formatter.js.map +0 -1
package/dist/tools/git-backup.js
DELETED
|
@@ -1,414 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Git Backup Tool
|
|
4
|
-
*
|
|
5
|
-
* Comprehensive backup system for Git repositories.
|
|
6
|
-
* Supports backup creation, restoration, listing, and verification.
|
|
7
|
-
*
|
|
8
|
-
* Operations: backup, restore, list, verify
|
|
9
|
-
*/
|
|
10
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
11
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
12
|
-
};
|
|
13
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.GitBackupTool = void 0;
|
|
15
|
-
const git_command_executor_js_1 = require("../utils/git-command-executor.js");
|
|
16
|
-
const terminal_controller_js_1 = require("../utils/terminal-controller.js");
|
|
17
|
-
const parameter_validator_js_1 = require("../utils/parameter-validator.js");
|
|
18
|
-
const operation_error_handler_js_1 = require("../utils/operation-error-handler.js");
|
|
19
|
-
const path_1 = __importDefault(require("path"));
|
|
20
|
-
const promises_1 = __importDefault(require("fs/promises"));
|
|
21
|
-
const fs_1 = require("fs");
|
|
22
|
-
class GitBackupTool {
|
|
23
|
-
gitExecutor;
|
|
24
|
-
terminal;
|
|
25
|
-
constructor() {
|
|
26
|
-
this.gitExecutor = new git_command_executor_js_1.GitCommandExecutor();
|
|
27
|
-
this.terminal = new terminal_controller_js_1.TerminalController();
|
|
28
|
-
}
|
|
29
|
-
async execute(params) {
|
|
30
|
-
const startTime = Date.now();
|
|
31
|
-
try {
|
|
32
|
-
// Validate required parameters
|
|
33
|
-
const validation = parameter_validator_js_1.ParameterValidator.validateToolParams('git-backup', params);
|
|
34
|
-
if (!validation.isValid) {
|
|
35
|
-
return operation_error_handler_js_1.OperationErrorHandler.createToolError('VALIDATION_ERROR', `Validation failed: ${validation.errors.join(', ')}`, 'backup', { errors: validation.errors }, validation.suggestions);
|
|
36
|
-
}
|
|
37
|
-
// Validate project path exists
|
|
38
|
-
if (!(0, fs_1.existsSync)(params.projectPath)) {
|
|
39
|
-
return operation_error_handler_js_1.OperationErrorHandler.createToolError('PROJECT_NOT_FOUND', `Project path does not exist: ${params.projectPath}`, 'backup', { projectPath: params.projectPath }, ['Ensure the project path exists and is accessible']);
|
|
40
|
-
}
|
|
41
|
-
switch (params.action) {
|
|
42
|
-
case 'backup':
|
|
43
|
-
return await this.handleBackup(params, startTime);
|
|
44
|
-
case 'restore':
|
|
45
|
-
return await this.handleRestore(params, startTime);
|
|
46
|
-
case 'list':
|
|
47
|
-
return await this.handleList(params, startTime);
|
|
48
|
-
case 'verify':
|
|
49
|
-
return await this.handleVerify(params, startTime);
|
|
50
|
-
default:
|
|
51
|
-
return operation_error_handler_js_1.OperationErrorHandler.createToolError('INVALID_ACTION', `Invalid action: ${params.action}`, params.action, {}, ['Use one of: backup, restore, list, verify']);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
catch (error) {
|
|
55
|
-
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
56
|
-
return operation_error_handler_js_1.OperationErrorHandler.createToolError('BACKUP_TOOL_ERROR', `Git backup tool error: ${errorMessage}`, 'backup', { error: errorMessage });
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Handle backup creation operation
|
|
61
|
-
*/
|
|
62
|
-
async handleBackup(params, startTime) {
|
|
63
|
-
try {
|
|
64
|
-
// Check if it's a Git repository
|
|
65
|
-
const isGitRepo = await this.gitExecutor.isGitRepository(params.projectPath);
|
|
66
|
-
if (!isGitRepo) {
|
|
67
|
-
return operation_error_handler_js_1.OperationErrorHandler.createToolError('NOT_GIT_REPOSITORY', 'Project is not a Git repository', 'backup', { projectPath: params.projectPath }, ['Initialize Git repository with: git init']);
|
|
68
|
-
}
|
|
69
|
-
// Generate backup path if not provided
|
|
70
|
-
if (!params.backupPath) {
|
|
71
|
-
const timestamp = new Date().toISOString().replace(/[:.]/g, '-');
|
|
72
|
-
const repoName = path_1.default.basename(params.projectPath);
|
|
73
|
-
params.backupPath = path_1.default.join(params.projectPath, '..', 'backups', `${repoName}-backup-${timestamp}`);
|
|
74
|
-
}
|
|
75
|
-
// Ensure backup directory exists
|
|
76
|
-
const backupDir = path_1.default.dirname(params.backupPath);
|
|
77
|
-
await promises_1.default.mkdir(backupDir, { recursive: true });
|
|
78
|
-
const format = params.format || 'tar';
|
|
79
|
-
const backupName = params.name || `backup-${Date.now()}`;
|
|
80
|
-
// Create backup using git archive
|
|
81
|
-
const result = await this.gitExecutor.createBackup(params.projectPath, params.backupPath, format);
|
|
82
|
-
if (!result.success) {
|
|
83
|
-
return operation_error_handler_js_1.OperationErrorHandler.handleGitError(result.stderr, 'backup', params.projectPath);
|
|
84
|
-
}
|
|
85
|
-
const extension = format === 'zip' ? 'zip' : 'tar.gz';
|
|
86
|
-
const finalBackupPath = `${params.backupPath}.${extension}`;
|
|
87
|
-
// Get backup file stats
|
|
88
|
-
const stats = await promises_1.default.stat(finalBackupPath);
|
|
89
|
-
// Create backup metadata
|
|
90
|
-
const metadata = {
|
|
91
|
-
name: backupName,
|
|
92
|
-
path: finalBackupPath,
|
|
93
|
-
format,
|
|
94
|
-
size: stats.size,
|
|
95
|
-
created: stats.birthtime.toISOString(),
|
|
96
|
-
repository: path_1.default.basename(params.projectPath),
|
|
97
|
-
compression: params.compression !== false
|
|
98
|
-
};
|
|
99
|
-
// Save metadata file
|
|
100
|
-
const metadataPath = `${params.backupPath}.meta.json`;
|
|
101
|
-
await promises_1.default.writeFile(metadataPath, JSON.stringify(metadata, null, 2));
|
|
102
|
-
return {
|
|
103
|
-
success: true,
|
|
104
|
-
data: {
|
|
105
|
-
message: 'Repository backup created successfully',
|
|
106
|
-
backup: metadata,
|
|
107
|
-
output: result.stdout
|
|
108
|
-
},
|
|
109
|
-
metadata: {
|
|
110
|
-
operation: 'backup',
|
|
111
|
-
timestamp: new Date().toISOString(),
|
|
112
|
-
executionTime: Date.now() - startTime
|
|
113
|
-
}
|
|
114
|
-
};
|
|
115
|
-
}
|
|
116
|
-
catch (error) {
|
|
117
|
-
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
118
|
-
return operation_error_handler_js_1.OperationErrorHandler.createToolError('BACKUP_CREATE_ERROR', `Failed to create backup: ${errorMessage}`, 'backup', { error: errorMessage, backupPath: params.backupPath });
|
|
119
|
-
}
|
|
120
|
-
} /**
|
|
121
|
-
|
|
122
|
-
* Handle backup restoration operation
|
|
123
|
-
*/
|
|
124
|
-
async handleRestore(params, startTime) {
|
|
125
|
-
try {
|
|
126
|
-
if (!params.backupPath) {
|
|
127
|
-
return operation_error_handler_js_1.OperationErrorHandler.createToolError('MISSING_BACKUP_PATH', 'Backup path is required for restore operation', 'restore', {}, ['Provide backupPath parameter with the path to the backup file']);
|
|
128
|
-
}
|
|
129
|
-
// Check if backup file exists
|
|
130
|
-
if (!(0, fs_1.existsSync)(params.backupPath)) {
|
|
131
|
-
return operation_error_handler_js_1.OperationErrorHandler.createToolError('BACKUP_NOT_FOUND', `Backup file not found: ${params.backupPath}`, 'restore', { backupPath: params.backupPath }, ['Ensure the backup file exists and path is correct']);
|
|
132
|
-
}
|
|
133
|
-
const targetPath = params.targetPath || params.projectPath;
|
|
134
|
-
// Check if target directory exists and handle overwrite
|
|
135
|
-
if ((0, fs_1.existsSync)(targetPath) && !params.overwrite) {
|
|
136
|
-
return operation_error_handler_js_1.OperationErrorHandler.createToolError('TARGET_EXISTS', `Target directory exists: ${targetPath}`, 'restore', { targetPath }, ['Use overwrite: true to overwrite existing directory', 'Choose a different target path']);
|
|
137
|
-
}
|
|
138
|
-
// Ensure target directory exists
|
|
139
|
-
await promises_1.default.mkdir(targetPath, { recursive: true });
|
|
140
|
-
// Determine backup format from file extension
|
|
141
|
-
const isZip = params.backupPath.endsWith('.zip');
|
|
142
|
-
const format = isZip ? 'zip' : 'tar';
|
|
143
|
-
// Extract backup
|
|
144
|
-
let result;
|
|
145
|
-
if (format === 'zip') {
|
|
146
|
-
// Use unzip command for zip files
|
|
147
|
-
result = await this.terminal.executeCommand('unzip', ['-o', params.backupPath, '-d', targetPath]);
|
|
148
|
-
}
|
|
149
|
-
else {
|
|
150
|
-
// Use tar command for tar.gz files
|
|
151
|
-
result = await this.terminal.executeCommand('tar', ['-xzf', params.backupPath, '-C', targetPath]);
|
|
152
|
-
}
|
|
153
|
-
if (!result.success) {
|
|
154
|
-
return operation_error_handler_js_1.OperationErrorHandler.createToolError('RESTORE_ERROR', `Failed to extract backup: ${result.stderr}`, 'restore', { backupPath: params.backupPath, targetPath });
|
|
155
|
-
}
|
|
156
|
-
// Load backup metadata if available
|
|
157
|
-
const metadataPath = params.backupPath.replace(/\.(zip|tar\.gz)$/, '.meta.json');
|
|
158
|
-
let metadata = null;
|
|
159
|
-
if ((0, fs_1.existsSync)(metadataPath)) {
|
|
160
|
-
try {
|
|
161
|
-
const metadataContent = await promises_1.default.readFile(metadataPath, 'utf-8');
|
|
162
|
-
metadata = JSON.parse(metadataContent);
|
|
163
|
-
}
|
|
164
|
-
catch (error) {
|
|
165
|
-
// Metadata file exists but couldn't be parsed, continue without it
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
return {
|
|
169
|
-
success: true,
|
|
170
|
-
data: {
|
|
171
|
-
message: 'Backup restored successfully',
|
|
172
|
-
backupPath: params.backupPath,
|
|
173
|
-
targetPath,
|
|
174
|
-
format,
|
|
175
|
-
metadata,
|
|
176
|
-
output: result.stdout
|
|
177
|
-
},
|
|
178
|
-
metadata: {
|
|
179
|
-
operation: 'restore',
|
|
180
|
-
timestamp: new Date().toISOString(),
|
|
181
|
-
executionTime: Date.now() - startTime
|
|
182
|
-
}
|
|
183
|
-
};
|
|
184
|
-
}
|
|
185
|
-
catch (error) {
|
|
186
|
-
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
187
|
-
return operation_error_handler_js_1.OperationErrorHandler.createToolError('RESTORE_ERROR', `Failed to restore backup: ${errorMessage}`, 'restore', { error: errorMessage, backupPath: params.backupPath });
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
/**
|
|
191
|
-
* Handle backup listing operation
|
|
192
|
-
*/
|
|
193
|
-
async handleList(params, startTime) {
|
|
194
|
-
try {
|
|
195
|
-
const backupDir = params.backupPath || path_1.default.join(params.projectPath, '..', 'backups');
|
|
196
|
-
if (!(0, fs_1.existsSync)(backupDir)) {
|
|
197
|
-
return {
|
|
198
|
-
success: true,
|
|
199
|
-
data: {
|
|
200
|
-
message: 'No backup directory found',
|
|
201
|
-
backups: [],
|
|
202
|
-
backupDir
|
|
203
|
-
},
|
|
204
|
-
metadata: {
|
|
205
|
-
operation: 'list',
|
|
206
|
-
timestamp: new Date().toISOString(),
|
|
207
|
-
executionTime: Date.now() - startTime
|
|
208
|
-
}
|
|
209
|
-
};
|
|
210
|
-
}
|
|
211
|
-
const files = await promises_1.default.readdir(backupDir);
|
|
212
|
-
const backups = [];
|
|
213
|
-
for (const file of files) {
|
|
214
|
-
if (file.endsWith('.tar.gz') || file.endsWith('.zip')) {
|
|
215
|
-
const filePath = path_1.default.join(backupDir, file);
|
|
216
|
-
const stats = await promises_1.default.stat(filePath);
|
|
217
|
-
// Try to load metadata
|
|
218
|
-
const metadataPath = filePath.replace(/\.(zip|tar\.gz)$/, '.meta.json');
|
|
219
|
-
let metadata = null;
|
|
220
|
-
if ((0, fs_1.existsSync)(metadataPath)) {
|
|
221
|
-
try {
|
|
222
|
-
const metadataContent = await promises_1.default.readFile(metadataPath, 'utf-8');
|
|
223
|
-
metadata = JSON.parse(metadataContent);
|
|
224
|
-
}
|
|
225
|
-
catch (error) {
|
|
226
|
-
// Continue without metadata if parsing fails
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
backups.push({
|
|
230
|
-
name: file,
|
|
231
|
-
path: filePath,
|
|
232
|
-
size: stats.size,
|
|
233
|
-
created: stats.birthtime.toISOString(),
|
|
234
|
-
modified: stats.mtime.toISOString(),
|
|
235
|
-
format: file.endsWith('.zip') ? 'zip' : 'tar',
|
|
236
|
-
metadata
|
|
237
|
-
});
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
// Sort backups
|
|
241
|
-
const sortBy = params.sortBy || 'date';
|
|
242
|
-
backups.sort((a, b) => {
|
|
243
|
-
switch (sortBy) {
|
|
244
|
-
case 'name':
|
|
245
|
-
return a.name.localeCompare(b.name);
|
|
246
|
-
case 'size':
|
|
247
|
-
return b.size - a.size;
|
|
248
|
-
case 'date':
|
|
249
|
-
default:
|
|
250
|
-
return new Date(b.created).getTime() - new Date(a.created).getTime();
|
|
251
|
-
}
|
|
252
|
-
});
|
|
253
|
-
return {
|
|
254
|
-
success: true,
|
|
255
|
-
data: {
|
|
256
|
-
message: `Found ${backups.length} backup(s)`,
|
|
257
|
-
backups,
|
|
258
|
-
backupDir,
|
|
259
|
-
sortBy
|
|
260
|
-
},
|
|
261
|
-
metadata: {
|
|
262
|
-
operation: 'list',
|
|
263
|
-
timestamp: new Date().toISOString(),
|
|
264
|
-
executionTime: Date.now() - startTime
|
|
265
|
-
}
|
|
266
|
-
};
|
|
267
|
-
}
|
|
268
|
-
catch (error) {
|
|
269
|
-
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
270
|
-
return operation_error_handler_js_1.OperationErrorHandler.createToolError('LIST_ERROR', `Failed to list backups: ${errorMessage}`, 'list', { error: errorMessage, backupPath: params.backupPath });
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
/**
|
|
274
|
-
* Handle backup verification operation
|
|
275
|
-
*/
|
|
276
|
-
async handleVerify(params, startTime) {
|
|
277
|
-
try {
|
|
278
|
-
if (!params.backupPath) {
|
|
279
|
-
return operation_error_handler_js_1.OperationErrorHandler.createToolError('MISSING_BACKUP_PATH', 'Backup path is required for verify operation', 'verify', {}, ['Provide backupPath parameter with the path to the backup file']);
|
|
280
|
-
}
|
|
281
|
-
if (!(0, fs_1.existsSync)(params.backupPath)) {
|
|
282
|
-
return operation_error_handler_js_1.OperationErrorHandler.createToolError('BACKUP_NOT_FOUND', `Backup file not found: ${params.backupPath}`, 'verify', { backupPath: params.backupPath }, ['Ensure the backup file exists and path is correct']);
|
|
283
|
-
}
|
|
284
|
-
const stats = await promises_1.default.stat(params.backupPath);
|
|
285
|
-
const isZip = params.backupPath.endsWith('.zip');
|
|
286
|
-
const format = isZip ? 'zip' : 'tar';
|
|
287
|
-
// Basic file verification
|
|
288
|
-
const verification = {
|
|
289
|
-
exists: true,
|
|
290
|
-
readable: true,
|
|
291
|
-
size: stats.size,
|
|
292
|
-
format,
|
|
293
|
-
created: stats.birthtime.toISOString(),
|
|
294
|
-
modified: stats.mtime.toISOString(),
|
|
295
|
-
integrity: 'unknown'
|
|
296
|
-
};
|
|
297
|
-
// Test archive integrity if requested
|
|
298
|
-
if (params.checkIntegrity) {
|
|
299
|
-
let result;
|
|
300
|
-
if (format === 'zip') {
|
|
301
|
-
// Test zip file integrity
|
|
302
|
-
result = await this.terminal.executeCommand('unzip', ['-t', params.backupPath]);
|
|
303
|
-
}
|
|
304
|
-
else {
|
|
305
|
-
// Test tar.gz file integrity
|
|
306
|
-
result = await this.terminal.executeCommand('tar', ['-tzf', params.backupPath]);
|
|
307
|
-
}
|
|
308
|
-
verification.integrity = result.success ? 'valid' : 'invalid';
|
|
309
|
-
}
|
|
310
|
-
// Load and verify metadata if available
|
|
311
|
-
const metadataPath = params.backupPath.replace(/\.(zip|tar\.gz)$/, '.meta.json');
|
|
312
|
-
let metadata = null;
|
|
313
|
-
let metadataValid = false;
|
|
314
|
-
if ((0, fs_1.existsSync)(metadataPath)) {
|
|
315
|
-
try {
|
|
316
|
-
const metadataContent = await promises_1.default.readFile(metadataPath, 'utf-8');
|
|
317
|
-
metadata = JSON.parse(metadataContent);
|
|
318
|
-
metadataValid = true;
|
|
319
|
-
// Verify metadata consistency
|
|
320
|
-
if (metadata.size !== stats.size) {
|
|
321
|
-
metadataValid = false;
|
|
322
|
-
}
|
|
323
|
-
}
|
|
324
|
-
catch (error) {
|
|
325
|
-
metadataValid = false;
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
const isValid = verification.integrity !== 'invalid' &&
|
|
329
|
-
(metadata ? metadataValid : true);
|
|
330
|
-
return {
|
|
331
|
-
success: true,
|
|
332
|
-
data: {
|
|
333
|
-
message: isValid ? 'Backup verification passed' : 'Backup verification failed',
|
|
334
|
-
valid: isValid,
|
|
335
|
-
verification,
|
|
336
|
-
metadata: metadata ? { ...metadata, valid: metadataValid } : null
|
|
337
|
-
},
|
|
338
|
-
metadata: {
|
|
339
|
-
operation: 'verify',
|
|
340
|
-
timestamp: new Date().toISOString(),
|
|
341
|
-
executionTime: Date.now() - startTime
|
|
342
|
-
}
|
|
343
|
-
};
|
|
344
|
-
}
|
|
345
|
-
catch (error) {
|
|
346
|
-
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
347
|
-
return operation_error_handler_js_1.OperationErrorHandler.createToolError('VERIFY_ERROR', `Failed to verify backup: ${errorMessage}`, 'verify', { error: errorMessage, backupPath: params.backupPath });
|
|
348
|
-
}
|
|
349
|
-
}
|
|
350
|
-
/**
|
|
351
|
-
* Get tool schema for MCP registration
|
|
352
|
-
*/
|
|
353
|
-
static getToolSchema() {
|
|
354
|
-
return {
|
|
355
|
-
name: 'git-backup',
|
|
356
|
-
description: 'Comprehensive backup system for Git repositories. Supports backup creation, restoration, listing, and verification.',
|
|
357
|
-
inputSchema: {
|
|
358
|
-
type: 'object',
|
|
359
|
-
properties: {
|
|
360
|
-
action: {
|
|
361
|
-
type: 'string',
|
|
362
|
-
enum: ['backup', 'restore', 'list', 'verify'],
|
|
363
|
-
description: 'The backup operation to perform'
|
|
364
|
-
},
|
|
365
|
-
projectPath: {
|
|
366
|
-
type: 'string',
|
|
367
|
-
description: 'Path to the Git repository (required)'
|
|
368
|
-
},
|
|
369
|
-
backupPath: {
|
|
370
|
-
type: 'string',
|
|
371
|
-
description: 'Path for backup storage or backup file to restore/verify'
|
|
372
|
-
},
|
|
373
|
-
name: {
|
|
374
|
-
type: 'string',
|
|
375
|
-
description: 'Backup name/identifier (for backup operation)'
|
|
376
|
-
},
|
|
377
|
-
format: {
|
|
378
|
-
type: 'string',
|
|
379
|
-
enum: ['tar', 'zip'],
|
|
380
|
-
description: 'Backup format (default: tar)'
|
|
381
|
-
},
|
|
382
|
-
compression: {
|
|
383
|
-
type: 'boolean',
|
|
384
|
-
description: 'Enable compression (default: true)'
|
|
385
|
-
},
|
|
386
|
-
includeUntracked: {
|
|
387
|
-
type: 'boolean',
|
|
388
|
-
description: 'Include untracked files in backup (default: false)'
|
|
389
|
-
},
|
|
390
|
-
targetPath: {
|
|
391
|
-
type: 'string',
|
|
392
|
-
description: 'Target path for restoration (for restore operation)'
|
|
393
|
-
},
|
|
394
|
-
overwrite: {
|
|
395
|
-
type: 'boolean',
|
|
396
|
-
description: 'Overwrite existing files during restore (default: false)'
|
|
397
|
-
},
|
|
398
|
-
sortBy: {
|
|
399
|
-
type: 'string',
|
|
400
|
-
enum: ['name', 'date', 'size'],
|
|
401
|
-
description: 'Sort criteria for listing backups (default: date)'
|
|
402
|
-
},
|
|
403
|
-
checkIntegrity: {
|
|
404
|
-
type: 'boolean',
|
|
405
|
-
description: 'Check backup integrity during verification (default: false)'
|
|
406
|
-
}
|
|
407
|
-
},
|
|
408
|
-
required: ['action', 'projectPath']
|
|
409
|
-
}
|
|
410
|
-
};
|
|
411
|
-
}
|
|
412
|
-
}
|
|
413
|
-
exports.GitBackupTool = GitBackupTool;
|
|
414
|
-
//# sourceMappingURL=git-backup.js.map
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AQ;wBACd,WAAW,EAAE,0DAA0D;qBACxE;oBACD,IAAI,EAAE;wBACJ,IAAI,EAAE,QAAQ;wBACd,WAAW,EAAE,+CAA+C;qBAC7D;oBACD,MAAM,EAAE;wBACN,IAAI,EAAE,QAAQ;wBACd,IAAI,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC;wBACpB,WAAW,EAAE,8BAA8B;qBAC5C;oBACD,WAAW,EAAE;wBACX,IAAI,EAAE,SAAS;wBACf,WAAW,EAAE,oCAAoC;qBAClD;oBACD,gBAAgB,EAAE;wBAChB,IAAI,EAAE,SAAS;wBACf,WAAW,EAAE,oDAAoD;qBAClE;oBACD,UAAU,EAAE;wBACV,IAAI,EAAE,QAAQ;wBACd,WAAW,EAAE,qDAAqD;qBACnE;oBACD,SAAS,EAAE;wBACT,IAAI,EAAE,SAAS;wBACf,WAAW,EAAE,0DAA0D;qBACxE;oBACD,MAAM,EAAE;wBACN,IAAI,EAAE,QAAQ;wBACd,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;wBAC9B,WAAW,EAAE,mDAAmD;qBACjE;oBACD,cAAc,EAAE;wBACd,IAAI,EAAE,SAAS;wBACf,WAAW,EAAE,6DAA6D;qBAC3E;iBACF;gBACD,QAAQ,EAAE,CAAC,QAAQ,EAAE,aAAa,CAAC;aACpC;SACF,CAAC;IACJ,CAAC;CACF;AArgBD,sCAqgBC"}
|
|
@@ -1,183 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Git Branches Tool
|
|
3
|
-
*
|
|
4
|
-
* Branch management tool providing comprehensive Git branch operations.
|
|
5
|
-
* Supports both local Git operations and remote provider operations.
|
|
6
|
-
*
|
|
7
|
-
* Operations: create, list, get, delete, merge, compare
|
|
8
|
-
*/
|
|
9
|
-
import { ToolParams } from '../utils/parameter-validator.js';
|
|
10
|
-
import { ToolResult } from '../utils/operation-error-handler.js';
|
|
11
|
-
import { ProviderConfig } from '../providers/types.js';
|
|
12
|
-
export interface GitBranchesParams extends ToolParams {
|
|
13
|
-
action: 'create' | 'list' | 'get' | 'delete' | 'merge' | 'compare';
|
|
14
|
-
branchName?: string;
|
|
15
|
-
sourceBranch?: string;
|
|
16
|
-
targetBranch?: string;
|
|
17
|
-
baseBranch?: string;
|
|
18
|
-
compareBranch?: string;
|
|
19
|
-
force?: boolean;
|
|
20
|
-
remote?: string;
|
|
21
|
-
checkout?: boolean;
|
|
22
|
-
repo?: string;
|
|
23
|
-
}
|
|
24
|
-
export declare class GitBranchesTool {
|
|
25
|
-
private gitExecutor;
|
|
26
|
-
private providerHandler?;
|
|
27
|
-
constructor(providerConfig?: ProviderConfig);
|
|
28
|
-
/**
|
|
29
|
-
* Execute git-branches operation
|
|
30
|
-
*/
|
|
31
|
-
execute(params: GitBranchesParams): Promise<ToolResult>;
|
|
32
|
-
/**
|
|
33
|
-
* Execute local Git branch operations
|
|
34
|
-
*/
|
|
35
|
-
private executeLocalOperation;
|
|
36
|
-
/**
|
|
37
|
-
* Execute remote provider operations
|
|
38
|
-
*/
|
|
39
|
-
private executeRemoteOperation;
|
|
40
|
-
/**
|
|
41
|
-
* Handle create branch operation
|
|
42
|
-
*/
|
|
43
|
-
private handleCreateBranch;
|
|
44
|
-
/**
|
|
45
|
-
* Handle list branches operation
|
|
46
|
-
*/
|
|
47
|
-
private handleListBranches;
|
|
48
|
-
/**
|
|
49
|
-
* Handle get branch operation
|
|
50
|
-
*/
|
|
51
|
-
private handleGetBranch;
|
|
52
|
-
/**
|
|
53
|
-
* Handle delete branch operation
|
|
54
|
-
*/
|
|
55
|
-
private handleDeleteBranch;
|
|
56
|
-
/**
|
|
57
|
-
* Handle merge branch operation
|
|
58
|
-
*/
|
|
59
|
-
private handleMergeBranch;
|
|
60
|
-
/**
|
|
61
|
-
* Handle compare branches operation
|
|
62
|
-
*/
|
|
63
|
-
private handleCompareBranches;
|
|
64
|
-
/**
|
|
65
|
-
* Check if operation is a remote operation
|
|
66
|
-
*/
|
|
67
|
-
private isRemoteOperation;
|
|
68
|
-
/**
|
|
69
|
-
* Extract parameters for remote operations
|
|
70
|
-
*/
|
|
71
|
-
private extractRemoteParameters;
|
|
72
|
-
/**
|
|
73
|
-
* Map git-branches actions to provider operations
|
|
74
|
-
*/
|
|
75
|
-
private mapActionToProviderOperation;
|
|
76
|
-
/**
|
|
77
|
-
* Get tool schema for MCP registration
|
|
78
|
-
*/
|
|
79
|
-
static getToolSchema(): {
|
|
80
|
-
name: string;
|
|
81
|
-
description: string;
|
|
82
|
-
inputSchema: {
|
|
83
|
-
type: string;
|
|
84
|
-
properties: {
|
|
85
|
-
action: {
|
|
86
|
-
type: string;
|
|
87
|
-
enum: string[];
|
|
88
|
-
description: string;
|
|
89
|
-
};
|
|
90
|
-
projectPath: {
|
|
91
|
-
type: string;
|
|
92
|
-
description: string;
|
|
93
|
-
};
|
|
94
|
-
branchName: {
|
|
95
|
-
type: string;
|
|
96
|
-
description: string;
|
|
97
|
-
};
|
|
98
|
-
sourceBranch: {
|
|
99
|
-
type: string;
|
|
100
|
-
description: string;
|
|
101
|
-
};
|
|
102
|
-
targetBranch: {
|
|
103
|
-
type: string;
|
|
104
|
-
description: string;
|
|
105
|
-
};
|
|
106
|
-
baseBranch: {
|
|
107
|
-
type: string;
|
|
108
|
-
description: string;
|
|
109
|
-
};
|
|
110
|
-
compareBranch: {
|
|
111
|
-
type: string;
|
|
112
|
-
description: string;
|
|
113
|
-
};
|
|
114
|
-
force: {
|
|
115
|
-
type: string;
|
|
116
|
-
description: string;
|
|
117
|
-
};
|
|
118
|
-
remote: {
|
|
119
|
-
type: string;
|
|
120
|
-
description: string;
|
|
121
|
-
};
|
|
122
|
-
checkout: {
|
|
123
|
-
type: string;
|
|
124
|
-
description: string;
|
|
125
|
-
};
|
|
126
|
-
repo: {
|
|
127
|
-
type: string;
|
|
128
|
-
description: string;
|
|
129
|
-
};
|
|
130
|
-
};
|
|
131
|
-
required: string[];
|
|
132
|
-
additionalProperties: boolean;
|
|
133
|
-
};
|
|
134
|
-
errorCodes: {
|
|
135
|
-
VALIDATION_ERROR: string;
|
|
136
|
-
BRANCH_EXISTS: string;
|
|
137
|
-
BRANCH_NOT_FOUND: string;
|
|
138
|
-
MERGE_CONFLICT: string;
|
|
139
|
-
DIRTY_WORKING_TREE: string;
|
|
140
|
-
NOT_A_GIT_REPOSITORY: string;
|
|
141
|
-
PERMISSION_DENIED: string;
|
|
142
|
-
};
|
|
143
|
-
warnings: {
|
|
144
|
-
delete: string;
|
|
145
|
-
force: string;
|
|
146
|
-
};
|
|
147
|
-
examples: ({
|
|
148
|
-
description: string;
|
|
149
|
-
input: {
|
|
150
|
-
action: string;
|
|
151
|
-
projectPath: string;
|
|
152
|
-
branchName?: undefined;
|
|
153
|
-
sourceBranch?: undefined;
|
|
154
|
-
checkout?: undefined;
|
|
155
|
-
baseBranch?: undefined;
|
|
156
|
-
compareBranch?: undefined;
|
|
157
|
-
};
|
|
158
|
-
} | {
|
|
159
|
-
description: string;
|
|
160
|
-
input: {
|
|
161
|
-
action: string;
|
|
162
|
-
projectPath: string;
|
|
163
|
-
branchName: string;
|
|
164
|
-
sourceBranch: string;
|
|
165
|
-
checkout: boolean;
|
|
166
|
-
baseBranch?: undefined;
|
|
167
|
-
compareBranch?: undefined;
|
|
168
|
-
};
|
|
169
|
-
} | {
|
|
170
|
-
description: string;
|
|
171
|
-
input: {
|
|
172
|
-
action: string;
|
|
173
|
-
projectPath: string;
|
|
174
|
-
baseBranch: string;
|
|
175
|
-
compareBranch: string;
|
|
176
|
-
branchName?: undefined;
|
|
177
|
-
sourceBranch?: undefined;
|
|
178
|
-
checkout?: undefined;
|
|
179
|
-
};
|
|
180
|
-
})[];
|
|
181
|
-
};
|
|
182
|
-
}
|
|
183
|
-
//# sourceMappingURL=git-branches.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"git-branches.d.ts","sourceRoot":"","sources":["../../src/tools/git-branches.ts"],"names":[],"mappings":"AAAA;;;;;;;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