@andrebuzeli/git-mcp 5.5.1 → 5.8.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.
- package/README.md +94 -6
- package/dist/config.d.ts +5 -131
- package/dist/config.js +28 -430
- package/dist/index.d.ts +1 -21
- package/dist/index.js +118 -140
- 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/resources/toolsGuide.d.ts +12 -0
- package/dist/resources/toolsGuide.js +1491 -0
- package/dist/server.d.ts +7 -40
- package/dist/server.js +59 -696
- 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 +98 -0
- package/dist/tools/gitConfig.d.ts +34 -0
- package/dist/tools/gitConfig.js +73 -0
- package/dist/tools/gitFiles.d.ts +30 -0
- package/dist/tools/gitFiles.js +55 -0
- package/dist/tools/gitHistory.d.ts +17 -0
- package/dist/tools/gitHistory.js +365 -0
- package/dist/tools/gitIssues.d.ts +6 -0
- package/dist/tools/gitIssues.js +279 -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 +6 -0
- package/dist/tools/gitPulls.js +288 -0
- package/dist/tools/gitRelease.d.ts +6 -0
- package/dist/tools/gitRelease.js +321 -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/gitUpdate.d.ts +14 -0
- package/dist/tools/gitUpdate.js +374 -0
- package/dist/tools/gitUpload.d.ts +11 -0
- package/dist/tools/gitUpload.js +342 -0
- package/dist/tools/gitWorkflow.d.ts +6 -0
- package/dist/tools/gitWorkflow.js +303 -0
- package/dist/types.d.ts +17 -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 +8 -3
- 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 -819
- 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 -498
- 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 -527
- 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 -340
- 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 -369
- 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 -461
- 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 -542
- 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
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"git-stash.js","sourceRoot":"","sources":["../../src/tools/git-stash.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;AAEH,8EAAsE;AACtE,4EAAiF;AACjF,oFAAwF;AAuBxF,MAAa,YAAY;IACf,WAAW,CAAqB;IAExC;QACE,IAAI,CAAC,WAAW,GAAG,IAAI,4CAAkB,EAAE,CAAC;IAC9C,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,OAAO,CAAC,MAAsB;QAClC,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QAE7B,IAAI,CAAC;YACH,4BAA4B;YAC5B,MAAM,UAAU,GAAG,2CAAkB,CAAC,kBAAkB,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;YAC9E,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,MAAM,CAAC,MAAM,EACb,EAAE,gBAAgB,EAAE,UAAU,CAAC,MAAM,EAAE,EACvC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;wBACX,IAAI,EAAE,QAAQ;wBACd,WAAW,EAAE,wCAAwC;qBACtD;oBACD,OAAO,EAAE;wBACP,IAAI,EAAE,QAAQ;wBACd,WAAW,EAAE,qCAAqC;qBACnD;oBACD,QAAQ,EAAE;wBACR,IAAI,EAAE,QAAQ;wBACd,WAAW,EAAE,gFAAgF;qBAC9F;oBACD,gBAAgB,EAAE;wBAChB,IAAI,EAAE,SAAS;wBACf,WAAW,EAAE,uCAAuC;qBACrD;oBACD,SAAS,EAAE;wBACT,IAAI,EAAE,SAAS;wBACf,WAAW,EAAE,oCAAoC;qBAClD;oBACD,KAAK,EAAE;wBACL,IAAI,EAAE,SAAS;wBACf,WAAW,EAAE,+CAA+C;qBAC7D;oBACD,KAAK,EAAE;wBACL,IAAI,EAAE,SAAS;wBACf,WAAW,EAAE,yCAAyC;qBACvD;oBACD,KAAK,EAAE;wBACL,IAAI,EAAE,SAAS;wBACf,WAAW,EAAE,sDAAsD;qBACpE;oBACD,OAAO,EAAE;wBACP,IAAI,EAAE,SAAS;wBACf,WAAW,EAAE,mCAAmC;qBACjD;iBACF;gBACD,QAAQ,EAAE,CAAC,QAAQ,EAAE,aAAa,CAAC;aACpC;SACF,CAAC;IACJ,CAAC;CACF;AAnmBD,oCAmmBC"}
|
package/dist/tools/git-sync.d.ts
DELETED
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Git Sync Tool
|
|
3
|
-
*
|
|
4
|
-
* Advanced synchronization tool providing intelligent sync and status operations.
|
|
5
|
-
* Supports both local Git synchronization and remote provider synchronization.
|
|
6
|
-
*
|
|
7
|
-
* Operations: sync, status
|
|
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 GitSyncParams extends ToolParams {
|
|
13
|
-
action: 'sync' | 'status';
|
|
14
|
-
remote?: string;
|
|
15
|
-
branch?: string;
|
|
16
|
-
strategy?: 'merge' | 'rebase' | 'fast-forward';
|
|
17
|
-
force?: boolean;
|
|
18
|
-
dryRun?: boolean;
|
|
19
|
-
detailed?: boolean;
|
|
20
|
-
includeRemote?: boolean;
|
|
21
|
-
checkAhead?: boolean;
|
|
22
|
-
repo?: string;
|
|
23
|
-
}
|
|
24
|
-
export interface SyncStatus {
|
|
25
|
-
localBranch: string;
|
|
26
|
-
remoteBranch: string;
|
|
27
|
-
ahead: number;
|
|
28
|
-
behind: number;
|
|
29
|
-
hasUncommittedChanges: boolean;
|
|
30
|
-
hasUntrackedFiles: boolean;
|
|
31
|
-
lastSync?: string;
|
|
32
|
-
conflicts?: string[];
|
|
33
|
-
remoteStatus?: {
|
|
34
|
-
exists: boolean;
|
|
35
|
-
lastCommit?: string;
|
|
36
|
-
lastCommitDate?: string;
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
export interface SyncResult {
|
|
40
|
-
success: boolean;
|
|
41
|
-
status: SyncStatus;
|
|
42
|
-
operations: string[];
|
|
43
|
-
conflicts?: string[];
|
|
44
|
-
warnings?: string[];
|
|
45
|
-
}
|
|
46
|
-
export declare class GitSyncTool {
|
|
47
|
-
private gitExecutor;
|
|
48
|
-
private providerHandler?;
|
|
49
|
-
constructor(providerConfig?: ProviderConfig);
|
|
50
|
-
/**
|
|
51
|
-
* Execute git-sync operation
|
|
52
|
-
*/
|
|
53
|
-
execute(params: GitSyncParams): Promise<ToolResult>;
|
|
54
|
-
/**
|
|
55
|
-
* Validate operation-specific parameters
|
|
56
|
-
*/
|
|
57
|
-
private validateOperationParams;
|
|
58
|
-
/**
|
|
59
|
-
* Handle sync operation
|
|
60
|
-
*/
|
|
61
|
-
private handleSync;
|
|
62
|
-
/**
|
|
63
|
-
* Handle status operation
|
|
64
|
-
*/
|
|
65
|
-
private handleStatus;
|
|
66
|
-
/**
|
|
67
|
-
* Get current repository status
|
|
68
|
-
*/
|
|
69
|
-
private getCurrentStatus;
|
|
70
|
-
/**
|
|
71
|
-
* Plan sync operations for dry run
|
|
72
|
-
*/
|
|
73
|
-
private planSyncOperations;
|
|
74
|
-
/**
|
|
75
|
-
* Perform actual sync operation
|
|
76
|
-
*/
|
|
77
|
-
private performSync;
|
|
78
|
-
/**
|
|
79
|
-
* Perform remote synchronization using provider
|
|
80
|
-
*/
|
|
81
|
-
private performRemoteSync;
|
|
82
|
-
/**
|
|
83
|
-
* Get remote status information
|
|
84
|
-
*/
|
|
85
|
-
private getRemoteStatus;
|
|
86
|
-
/**
|
|
87
|
-
* Get detailed status information
|
|
88
|
-
*/
|
|
89
|
-
private getDetailedStatus;
|
|
90
|
-
/**
|
|
91
|
-
* Get tool schema for MCP registration
|
|
92
|
-
*/
|
|
93
|
-
static getToolSchema(): {
|
|
94
|
-
name: string;
|
|
95
|
-
description: string;
|
|
96
|
-
inputSchema: {
|
|
97
|
-
type: string;
|
|
98
|
-
properties: {
|
|
99
|
-
action: {
|
|
100
|
-
type: string;
|
|
101
|
-
enum: string[];
|
|
102
|
-
description: string;
|
|
103
|
-
};
|
|
104
|
-
projectPath: {
|
|
105
|
-
type: string;
|
|
106
|
-
description: string;
|
|
107
|
-
};
|
|
108
|
-
remote: {
|
|
109
|
-
type: string;
|
|
110
|
-
description: string;
|
|
111
|
-
};
|
|
112
|
-
branch: {
|
|
113
|
-
type: string;
|
|
114
|
-
description: string;
|
|
115
|
-
};
|
|
116
|
-
strategy: {
|
|
117
|
-
type: string;
|
|
118
|
-
enum: string[];
|
|
119
|
-
description: string;
|
|
120
|
-
};
|
|
121
|
-
force: {
|
|
122
|
-
type: string;
|
|
123
|
-
description: string;
|
|
124
|
-
};
|
|
125
|
-
dryRun: {
|
|
126
|
-
type: string;
|
|
127
|
-
description: string;
|
|
128
|
-
};
|
|
129
|
-
detailed: {
|
|
130
|
-
type: string;
|
|
131
|
-
description: string;
|
|
132
|
-
};
|
|
133
|
-
includeRemote: {
|
|
134
|
-
type: string;
|
|
135
|
-
description: string;
|
|
136
|
-
};
|
|
137
|
-
checkAhead: {
|
|
138
|
-
type: string;
|
|
139
|
-
description: string;
|
|
140
|
-
};
|
|
141
|
-
repo: {
|
|
142
|
-
type: string;
|
|
143
|
-
description: string;
|
|
144
|
-
};
|
|
145
|
-
};
|
|
146
|
-
required: string[];
|
|
147
|
-
};
|
|
148
|
-
};
|
|
149
|
-
/**
|
|
150
|
-
* Get current branch name
|
|
151
|
-
*/
|
|
152
|
-
private getCurrentBranch;
|
|
153
|
-
}
|
|
154
|
-
//# sourceMappingURL=git-sync.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"git-sync.d.ts","sourceRoot":"","sources":["../../src/tools/git-sync.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAsB,UAAU,EAAE,MAAM,iCAAiC,CAAC;AACjF,OAAO,EAAyB,UAAU,EAAE,MAAM,qCAAqC,CAAC;AAExF,OAAO,EAAE,cAAc,EAAqB,MAAM,uBAAuB,CAAC;AAG1E,MAAM,WAAW,aAAc,SAAQ,UAAU;IAC/C,MAAM,EAAE,MAAM,GAAG,QAAQ,CAAC;IAG1B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,cAAc,CAAC;IAC/C,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;IAGjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,UAAU,CAAC,EAAE,OAAO,CAAC;IAGrB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,UAAU;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf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
* Advanced synchronization tool providing intelligent sync and status operations.
|
|
6
|
-
* Supports both local Git synchronization and remote provider synchronization.
|
|
7
|
-
*
|
|
8
|
-
* Operations: sync, status
|
|
9
|
-
*/
|
|
10
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
-
exports.GitSyncTool = 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
|
-
class GitSyncTool {
|
|
17
|
-
gitExecutor;
|
|
18
|
-
providerHandler;
|
|
19
|
-
constructor(providerConfig) {
|
|
20
|
-
this.gitExecutor = new git_command_executor_js_1.GitCommandExecutor();
|
|
21
|
-
if (providerConfig) {
|
|
22
|
-
this.providerHandler = new provider_operation_handler_js_1.ProviderOperationHandler(providerConfig);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Execute git-sync operation
|
|
27
|
-
*/
|
|
28
|
-
async execute(params) {
|
|
29
|
-
const startTime = Date.now();
|
|
30
|
-
try {
|
|
31
|
-
// Validate basic parameters
|
|
32
|
-
const validation = parameter_validator_js_1.ParameterValidator.validateToolParams('git-sync', params);
|
|
33
|
-
if (!validation.isValid) {
|
|
34
|
-
return operation_error_handler_js_1.OperationErrorHandler.createToolError('VALIDATION_ERROR', `Parameter validation failed: ${validation.errors.join(', ')}`, params.action, { validationErrors: validation.errors }, validation.suggestions);
|
|
35
|
-
}
|
|
36
|
-
// Validate operation-specific parameters
|
|
37
|
-
const operationValidation = this.validateOperationParams(params);
|
|
38
|
-
if (!operationValidation.isValid) {
|
|
39
|
-
return operation_error_handler_js_1.OperationErrorHandler.createToolError('VALIDATION_ERROR', `Operation validation failed: ${operationValidation.errors.join(', ')}`, params.action, { validationErrors: operationValidation.errors }, operationValidation.suggestions);
|
|
40
|
-
}
|
|
41
|
-
// Route to appropriate handler
|
|
42
|
-
switch (params.action) {
|
|
43
|
-
case 'sync':
|
|
44
|
-
return await this.handleSync(params, startTime);
|
|
45
|
-
case 'status':
|
|
46
|
-
return await this.handleStatus(params, startTime);
|
|
47
|
-
default:
|
|
48
|
-
return operation_error_handler_js_1.OperationErrorHandler.createToolError('UNSUPPORTED_OPERATION', `Unsupported operation: ${params.action}`, params.action, { supportedOperations: ['sync', 'status'] }, ['Use one of the supported operations: sync, status']);
|
|
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 git-sync operation: ${errorMessage}`, params.action, { error: errorMessage });
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Validate operation-specific parameters
|
|
58
|
-
*/
|
|
59
|
-
validateOperationParams(params) {
|
|
60
|
-
const errors = [];
|
|
61
|
-
const suggestions = [];
|
|
62
|
-
// Validate sync parameters
|
|
63
|
-
if (params.action === 'sync') {
|
|
64
|
-
if (params.strategy && !['merge', 'rebase', 'fast-forward'].includes(params.strategy)) {
|
|
65
|
-
errors.push('Invalid sync strategy. Must be one of: merge, rebase, fast-forward');
|
|
66
|
-
suggestions.push('Use strategy: "merge", "rebase", or "fast-forward"');
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
return {
|
|
70
|
-
isValid: errors.length === 0,
|
|
71
|
-
errors,
|
|
72
|
-
suggestions
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Handle sync operation
|
|
77
|
-
*/
|
|
78
|
-
async handleSync(params, startTime) {
|
|
79
|
-
try {
|
|
80
|
-
const remote = params.remote || 'origin';
|
|
81
|
-
const branch = params.branch || await this.getCurrentBranch(params.projectPath);
|
|
82
|
-
const strategy = params.strategy || 'merge';
|
|
83
|
-
const operations = [];
|
|
84
|
-
// Get current status first
|
|
85
|
-
const statusResult = await this.getCurrentStatus(params);
|
|
86
|
-
if (!statusResult.success) {
|
|
87
|
-
return operation_error_handler_js_1.OperationErrorHandler.createToolError('STATUS_CHECK_FAILED', 'Failed to get current repository status', params.action, { statusError: statusResult });
|
|
88
|
-
}
|
|
89
|
-
const status = statusResult.status;
|
|
90
|
-
// Check for uncommitted changes
|
|
91
|
-
if (status.hasUncommittedChanges && !params.force) {
|
|
92
|
-
return operation_error_handler_js_1.OperationErrorHandler.createToolError('UNCOMMITTED_CHANGES', 'Repository has uncommitted changes. Commit or stash changes before syncing.', params.action, { status }, [
|
|
93
|
-
'Commit changes: git add . && git commit -m "message"',
|
|
94
|
-
'Stash changes: git stash (use git stash pop later to restore)',
|
|
95
|
-
'Use git-stash tool to save changes temporarily',
|
|
96
|
-
'Use force: true to override (not recommended - may cause data loss)'
|
|
97
|
-
]);
|
|
98
|
-
}
|
|
99
|
-
// Dry run - show what would be done
|
|
100
|
-
if (params.dryRun) {
|
|
101
|
-
const plannedOperations = await this.planSyncOperations(params, status);
|
|
102
|
-
return {
|
|
103
|
-
success: true,
|
|
104
|
-
data: {
|
|
105
|
-
dryRun: true,
|
|
106
|
-
plannedOperations,
|
|
107
|
-
currentStatus: status
|
|
108
|
-
},
|
|
109
|
-
metadata: {
|
|
110
|
-
operation: params.action,
|
|
111
|
-
executionTime: Date.now() - startTime,
|
|
112
|
-
timestamp: new Date().toISOString()
|
|
113
|
-
}
|
|
114
|
-
};
|
|
115
|
-
}
|
|
116
|
-
// Fetch latest changes
|
|
117
|
-
const fetchArgs = [remote];
|
|
118
|
-
if (branch) {
|
|
119
|
-
// Only fetch specific branch if it's different from current branch
|
|
120
|
-
const currentBranch = await this.getCurrentBranch(params.projectPath);
|
|
121
|
-
if (currentBranch !== branch) {
|
|
122
|
-
fetchArgs.push(`${branch}:${branch}`);
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
const fetchResult = await this.gitExecutor.executeGitCommand('fetch', fetchArgs, params.projectPath);
|
|
126
|
-
if (!fetchResult.success) {
|
|
127
|
-
return operation_error_handler_js_1.OperationErrorHandler.createToolError('FETCH_FAILED', `Failed to fetch from remote: ${fetchResult.stderr}`, params.action, { fetchResult });
|
|
128
|
-
}
|
|
129
|
-
operations.push(`Fetched from ${remote}`);
|
|
130
|
-
// Get updated status after fetch
|
|
131
|
-
const updatedStatus = await this.getCurrentStatus(params);
|
|
132
|
-
if (!updatedStatus.success) {
|
|
133
|
-
return operation_error_handler_js_1.OperationErrorHandler.createToolError('STATUS_UPDATE_FAILED', 'Failed to get updated status after fetch', params.action);
|
|
134
|
-
}
|
|
135
|
-
const newStatus = updatedStatus.status;
|
|
136
|
-
// Perform sync based on strategy
|
|
137
|
-
const syncResult = await this.performSync(params, newStatus, strategy, operations);
|
|
138
|
-
// Handle remote sync if provider is available
|
|
139
|
-
if (this.providerHandler) {
|
|
140
|
-
const remoteSync = await this.performRemoteSync(params);
|
|
141
|
-
if (remoteSync.success) {
|
|
142
|
-
operations.push('Remote synchronization completed');
|
|
143
|
-
}
|
|
144
|
-
else {
|
|
145
|
-
syncResult.warnings = syncResult.warnings || [];
|
|
146
|
-
syncResult.warnings.push('Remote synchronization failed but local sync succeeded');
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
return {
|
|
150
|
-
success: syncResult.success,
|
|
151
|
-
data: {
|
|
152
|
-
syncResult,
|
|
153
|
-
operations,
|
|
154
|
-
finalStatus: await this.getCurrentStatus(params)
|
|
155
|
-
},
|
|
156
|
-
metadata: {
|
|
157
|
-
operation: params.action,
|
|
158
|
-
executionTime: Date.now() - startTime,
|
|
159
|
-
timestamp: new Date().toISOString()
|
|
160
|
-
}
|
|
161
|
-
};
|
|
162
|
-
}
|
|
163
|
-
catch (error) {
|
|
164
|
-
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
165
|
-
return operation_error_handler_js_1.OperationErrorHandler.createToolError('SYNC_FAILED', `Sync operation failed: ${errorMessage}`, params.action, { error: errorMessage });
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
/**
|
|
169
|
-
* Handle status operation
|
|
170
|
-
*/
|
|
171
|
-
async handleStatus(params, startTime) {
|
|
172
|
-
try {
|
|
173
|
-
const statusResult = await this.getCurrentStatus(params);
|
|
174
|
-
if (!statusResult.success) {
|
|
175
|
-
return operation_error_handler_js_1.OperationErrorHandler.createToolError('STATUS_FAILED', 'Failed to get repository status', params.action, { statusResult });
|
|
176
|
-
}
|
|
177
|
-
let data = {
|
|
178
|
-
status: statusResult.status
|
|
179
|
-
};
|
|
180
|
-
// Include remote status if requested
|
|
181
|
-
if (params.includeRemote && this.providerHandler) {
|
|
182
|
-
const remoteStatus = await this.getRemoteStatus(params);
|
|
183
|
-
data.remoteStatus = remoteStatus;
|
|
184
|
-
}
|
|
185
|
-
// Include detailed information if requested
|
|
186
|
-
if (params.detailed) {
|
|
187
|
-
const detailedInfo = await this.getDetailedStatus(params);
|
|
188
|
-
data.detailed = detailedInfo;
|
|
189
|
-
}
|
|
190
|
-
return {
|
|
191
|
-
success: true,
|
|
192
|
-
data,
|
|
193
|
-
metadata: {
|
|
194
|
-
operation: params.action,
|
|
195
|
-
executionTime: Date.now() - startTime,
|
|
196
|
-
timestamp: new Date().toISOString()
|
|
197
|
-
}
|
|
198
|
-
};
|
|
199
|
-
}
|
|
200
|
-
catch (error) {
|
|
201
|
-
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
202
|
-
return operation_error_handler_js_1.OperationErrorHandler.createToolError('STATUS_FAILED', `Status operation failed: ${errorMessage}`, params.action, { error: errorMessage });
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
/**
|
|
206
|
-
* Get current repository status
|
|
207
|
-
*/
|
|
208
|
-
async getCurrentStatus(params) {
|
|
209
|
-
try {
|
|
210
|
-
const remote = params.remote || 'origin';
|
|
211
|
-
const branch = params.branch || await this.getCurrentBranch(params.projectPath);
|
|
212
|
-
const remoteBranch = `${remote}/${branch}`;
|
|
213
|
-
// Check if we have uncommitted changes
|
|
214
|
-
const statusResult = await this.gitExecutor.executeGitCommand('status', ['--porcelain'], params.projectPath);
|
|
215
|
-
const hasUncommittedChanges = statusResult.success && statusResult.stdout.trim().length > 0;
|
|
216
|
-
// Check for untracked files
|
|
217
|
-
const untrackedResult = await this.gitExecutor.executeGitCommand('ls-files', ['--others', '--exclude-standard'], params.projectPath);
|
|
218
|
-
const hasUntrackedFiles = untrackedResult.success && untrackedResult.stdout.trim().length > 0;
|
|
219
|
-
// Get ahead/behind information
|
|
220
|
-
let ahead = 0;
|
|
221
|
-
let behind = 0;
|
|
222
|
-
if (params.checkAhead !== false) {
|
|
223
|
-
const revListResult = await this.gitExecutor.executeGitCommand('rev-list', ['--left-right', '--count', `${remoteBranch}...HEAD`], params.projectPath);
|
|
224
|
-
if (revListResult.success) {
|
|
225
|
-
const counts = revListResult.stdout.trim().split('\t');
|
|
226
|
-
if (counts.length === 2) {
|
|
227
|
-
behind = parseInt(counts[0]) || 0;
|
|
228
|
-
ahead = parseInt(counts[1]) || 0;
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
const status = {
|
|
233
|
-
localBranch: branch || 'main',
|
|
234
|
-
remoteBranch,
|
|
235
|
-
ahead,
|
|
236
|
-
behind,
|
|
237
|
-
hasUncommittedChanges: !!hasUncommittedChanges,
|
|
238
|
-
hasUntrackedFiles: !!hasUntrackedFiles
|
|
239
|
-
};
|
|
240
|
-
return { success: true, status };
|
|
241
|
-
}
|
|
242
|
-
catch (error) {
|
|
243
|
-
return { success: false, status: {} };
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
/**
|
|
247
|
-
* Plan sync operations for dry run
|
|
248
|
-
*/
|
|
249
|
-
async planSyncOperations(params, status) {
|
|
250
|
-
const operations = [];
|
|
251
|
-
const remote = params.remote || 'origin';
|
|
252
|
-
const strategy = params.strategy || 'merge';
|
|
253
|
-
operations.push(`Fetch from ${remote}`);
|
|
254
|
-
if (status.behind > 0) {
|
|
255
|
-
switch (strategy) {
|
|
256
|
-
case 'merge':
|
|
257
|
-
operations.push(`Merge ${status.behind} commits from ${status.remoteBranch}`);
|
|
258
|
-
break;
|
|
259
|
-
case 'rebase':
|
|
260
|
-
operations.push(`Rebase ${status.behind} commits from ${status.remoteBranch}`);
|
|
261
|
-
break;
|
|
262
|
-
case 'fast-forward':
|
|
263
|
-
operations.push(`Fast-forward ${status.behind} commits from ${status.remoteBranch}`);
|
|
264
|
-
break;
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
if (status.ahead > 0) {
|
|
268
|
-
operations.push(`Push ${status.ahead} local commits to ${status.remoteBranch}`);
|
|
269
|
-
}
|
|
270
|
-
if (status.behind === 0 && status.ahead === 0) {
|
|
271
|
-
operations.push('Repository is already up to date');
|
|
272
|
-
}
|
|
273
|
-
return operations;
|
|
274
|
-
}
|
|
275
|
-
/**
|
|
276
|
-
* Perform actual sync operation
|
|
277
|
-
*/
|
|
278
|
-
async performSync(params, status, strategy, operations) {
|
|
279
|
-
const result = {
|
|
280
|
-
success: true,
|
|
281
|
-
status,
|
|
282
|
-
operations: [...operations]
|
|
283
|
-
};
|
|
284
|
-
try {
|
|
285
|
-
// Handle incoming changes (behind)
|
|
286
|
-
if (status.behind > 0) {
|
|
287
|
-
let syncCommand;
|
|
288
|
-
switch (strategy) {
|
|
289
|
-
case 'merge':
|
|
290
|
-
syncCommand = ['merge', status.remoteBranch];
|
|
291
|
-
break;
|
|
292
|
-
case 'rebase':
|
|
293
|
-
syncCommand = ['rebase', status.remoteBranch];
|
|
294
|
-
break;
|
|
295
|
-
case 'fast-forward':
|
|
296
|
-
syncCommand = ['merge', '--ff-only', status.remoteBranch];
|
|
297
|
-
break;
|
|
298
|
-
default:
|
|
299
|
-
syncCommand = ['merge', status.remoteBranch];
|
|
300
|
-
}
|
|
301
|
-
const syncResult = await this.gitExecutor.executeGitCommand(syncCommand[0], syncCommand.slice(1), params.projectPath);
|
|
302
|
-
if (!syncResult.success) {
|
|
303
|
-
result.success = false;
|
|
304
|
-
result.conflicts = [syncResult.stderr || 'Sync failed'];
|
|
305
|
-
return result;
|
|
306
|
-
}
|
|
307
|
-
result.operations.push(`${strategy} completed: ${status.behind} commits integrated`);
|
|
308
|
-
}
|
|
309
|
-
// Handle outgoing changes (ahead)
|
|
310
|
-
if (status.ahead > 0) {
|
|
311
|
-
const pushResult = await this.gitExecutor.executeGitCommand('push', [], params.projectPath);
|
|
312
|
-
if (!pushResult.success) {
|
|
313
|
-
result.warnings = result.warnings || [];
|
|
314
|
-
result.warnings.push(`Failed to push local commits: ${pushResult.stderr}`);
|
|
315
|
-
}
|
|
316
|
-
else {
|
|
317
|
-
result.operations.push(`Pushed ${status.ahead} commits to remote`);
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
return result;
|
|
321
|
-
}
|
|
322
|
-
catch (error) {
|
|
323
|
-
result.success = false;
|
|
324
|
-
result.conflicts = [error instanceof Error ? error.message : 'Unknown sync error'];
|
|
325
|
-
return result;
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
/**
|
|
329
|
-
* Perform remote synchronization using provider
|
|
330
|
-
*/
|
|
331
|
-
async performRemoteSync(params) {
|
|
332
|
-
if (!this.providerHandler || !params.provider) {
|
|
333
|
-
return { success: false, error: 'Provider not configured' };
|
|
334
|
-
}
|
|
335
|
-
try {
|
|
336
|
-
const operation = {
|
|
337
|
-
provider: 'github', // This will be auto-determined by the provider handler
|
|
338
|
-
operation: 'sync',
|
|
339
|
-
parameters: {
|
|
340
|
-
repo: params.repo,
|
|
341
|
-
branch: params.branch
|
|
342
|
-
},
|
|
343
|
-
requiresAuth: true,
|
|
344
|
-
isRemoteOperation: true
|
|
345
|
-
};
|
|
346
|
-
const result = await this.providerHandler.executeOperation(operation);
|
|
347
|
-
return { success: result.success };
|
|
348
|
-
}
|
|
349
|
-
catch (error) {
|
|
350
|
-
return {
|
|
351
|
-
success: false,
|
|
352
|
-
error: error instanceof Error ? error.message : 'Remote sync failed'
|
|
353
|
-
};
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
|
-
/**
|
|
357
|
-
* Get remote status information
|
|
358
|
-
*/
|
|
359
|
-
async getRemoteStatus(params) {
|
|
360
|
-
if (!this.providerHandler || !params.provider) {
|
|
361
|
-
return { error: 'Provider not configured' };
|
|
362
|
-
}
|
|
363
|
-
try {
|
|
364
|
-
const operation = {
|
|
365
|
-
provider: 'github', // This will be auto-determined by the provider handler
|
|
366
|
-
operation: 'get',
|
|
367
|
-
parameters: {
|
|
368
|
-
repo: params.repo
|
|
369
|
-
},
|
|
370
|
-
requiresAuth: true,
|
|
371
|
-
isRemoteOperation: true
|
|
372
|
-
};
|
|
373
|
-
const result = await this.providerHandler.executeOperation(operation);
|
|
374
|
-
return result.success ? result.results[0]?.data : { error: 'Failed to get remote status' };
|
|
375
|
-
}
|
|
376
|
-
catch (error) {
|
|
377
|
-
return { error: error instanceof Error ? error.message : 'Remote status failed' };
|
|
378
|
-
}
|
|
379
|
-
}
|
|
380
|
-
/**
|
|
381
|
-
* Get detailed status information
|
|
382
|
-
*/
|
|
383
|
-
async getDetailedStatus(params) {
|
|
384
|
-
try {
|
|
385
|
-
// Get commit history
|
|
386
|
-
const logResult = await this.gitExecutor.executeGitCommand('log', ['--oneline', '-10'], params.projectPath);
|
|
387
|
-
// Get branch information
|
|
388
|
-
const branchResult = await this.gitExecutor.executeGitCommand('branch', ['-vv'], params.projectPath);
|
|
389
|
-
// Get remote information
|
|
390
|
-
const remoteResult = await this.gitExecutor.executeGitCommand('remote', ['-v'], params.projectPath);
|
|
391
|
-
return {
|
|
392
|
-
recentCommits: logResult.success ? logResult.stdout.split('\n').filter((line) => line.trim()) : [],
|
|
393
|
-
branches: branchResult.success ? branchResult.stdout.split('\n').filter((line) => line.trim()) : [],
|
|
394
|
-
remotes: remoteResult.success ? remoteResult.stdout.split('\n').filter((line) => line.trim()) : []
|
|
395
|
-
};
|
|
396
|
-
}
|
|
397
|
-
catch (error) {
|
|
398
|
-
return { error: error instanceof Error ? error.message : 'Failed to get detailed status' };
|
|
399
|
-
}
|
|
400
|
-
}
|
|
401
|
-
/**
|
|
402
|
-
* Get tool schema for MCP registration
|
|
403
|
-
*/
|
|
404
|
-
static getToolSchema() {
|
|
405
|
-
return {
|
|
406
|
-
name: 'git-sync',
|
|
407
|
-
description: 'Advanced Git synchronization tool for intelligent sync and status operations. Supports both local Git synchronization and remote provider synchronization.',
|
|
408
|
-
inputSchema: {
|
|
409
|
-
type: 'object',
|
|
410
|
-
properties: {
|
|
411
|
-
action: {
|
|
412
|
-
type: 'string',
|
|
413
|
-
enum: ['sync', 'status'],
|
|
414
|
-
description: 'The Git sync operation to perform'
|
|
415
|
-
},
|
|
416
|
-
projectPath: {
|
|
417
|
-
type: 'string',
|
|
418
|
-
description: 'Absolute path to the project directory'
|
|
419
|
-
},
|
|
420
|
-
remote: {
|
|
421
|
-
type: 'string',
|
|
422
|
-
description: 'Remote to sync with (default: origin)'
|
|
423
|
-
},
|
|
424
|
-
branch: {
|
|
425
|
-
type: 'string',
|
|
426
|
-
description: 'Branch to sync (default: current branch)'
|
|
427
|
-
},
|
|
428
|
-
strategy: {
|
|
429
|
-
type: 'string',
|
|
430
|
-
enum: ['merge', 'rebase', 'fast-forward'],
|
|
431
|
-
description: 'Sync strategy (default: merge)'
|
|
432
|
-
},
|
|
433
|
-
force: {
|
|
434
|
-
type: 'boolean',
|
|
435
|
-
description: 'Force sync (use with caution, may override uncommitted changes)'
|
|
436
|
-
},
|
|
437
|
-
dryRun: {
|
|
438
|
-
type: 'boolean',
|
|
439
|
-
description: 'Show what would be done without executing (for sync operation)'
|
|
440
|
-
},
|
|
441
|
-
detailed: {
|
|
442
|
-
type: 'boolean',
|
|
443
|
-
description: 'Show detailed sync status (for status operation)'
|
|
444
|
-
},
|
|
445
|
-
includeRemote: {
|
|
446
|
-
type: 'boolean',
|
|
447
|
-
description: 'Include remote status information (for status operation)'
|
|
448
|
-
},
|
|
449
|
-
checkAhead: {
|
|
450
|
-
type: 'boolean',
|
|
451
|
-
description: 'Check commits ahead/behind (default: true for status operation)'
|
|
452
|
-
},
|
|
453
|
-
repo: {
|
|
454
|
-
type: 'string',
|
|
455
|
-
description: 'Repository name (auto-detected if not provided, for remote operations)'
|
|
456
|
-
}
|
|
457
|
-
},
|
|
458
|
-
required: ['action', 'projectPath']
|
|
459
|
-
}
|
|
460
|
-
};
|
|
461
|
-
}
|
|
462
|
-
/**
|
|
463
|
-
* Get current branch name
|
|
464
|
-
*/
|
|
465
|
-
async getCurrentBranch(projectPath) {
|
|
466
|
-
try {
|
|
467
|
-
const result = await this.gitExecutor.executeGitCommand('branch', ['--show-current'], projectPath);
|
|
468
|
-
if (result.success && result.stdout.trim()) {
|
|
469
|
-
return result.stdout.trim();
|
|
470
|
-
}
|
|
471
|
-
return null;
|
|
472
|
-
}
|
|
473
|
-
catch (error) {
|
|
474
|
-
return null;
|
|
475
|
-
}
|
|
476
|
-
}
|
|
477
|
-
}
|
|
478
|
-
exports.GitSyncTool = GitSyncTool;
|
|
479
|
-
//# sourceMappingURL=git-sync.js.map
|