@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
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"git-reset.js","sourceRoot":"","sources":["../../src/tools/git-reset.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;AAEH,8EAAsE;AACtE,4EAAiF;AACjF,oFAAwF;AACxF,oEAA6D;AAqB7D,MAAa,YAAY;IACf,WAAW,CAAqB;IAChC,cAAc,CAAkB;IAExC,YAAY,cAA+B;QACzC,IAAI,CAAC,WAAW,GAAG,IAAI,4CAAkB,EAAE,CAAC;QAC5C,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;IACvC,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,UAAU,CAAC,WAAW,CACvB,CAAC;YACJ,CAAC;YAED,yCAAyC;YACzC,MAAM,mBAAmB,GAAG,IAAI,CAAC,uBAAuB,CAAC,MAAM,CAAC,CAAC;YACjE,IAAI,CA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EAAE,IAAI,EAAE,QAAQ,EAAE;wBACzB,WAAW,EAAE,iDAAiD;qBAC/D;oBACD,KAAK,EAAE;wBACL,IAAI,EAAE,SAAS;wBACf,WAAW,EAAE,kDAAkD;qBAChE;oBACD,KAAK,EAAE;wBACL,IAAI,EAAE,SAAS;wBACf,WAAW,EAAE,wCAAwC;qBACtD;oBACD,WAAW,EAAE;wBACX,IAAI,EAAE,SAAS;wBACf,WAAW,EAAE,mEAAmE;qBACjF;oBACD,kBAAkB,EAAE;wBAClB,IAAI,EAAE,SAAS;wBACf,WAAW,EAAE,4EAA4E;qBAC1F;iBACF;gBACD,QAAQ,EAAE,CAAC,QAAQ,EAAE,aAAa,CAAC;aACpC;SACF,CAAC;IACJ,CAAC;CACF;AA/kBD,oCA+kBC"}
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Git Stash Tool
|
|
3
|
-
*
|
|
4
|
-
* Comprehensive Git stash tool providing stash management operations.
|
|
5
|
-
* Supports stash, pop, apply, list, show, drop, clear operations for temporary changes storage.
|
|
6
|
-
*
|
|
7
|
-
* Operations: stash, pop, apply, list, show, drop, clear
|
|
8
|
-
*/
|
|
9
|
-
import { ToolParams } from '../utils/parameter-validator.js';
|
|
10
|
-
import { ToolResult } from '../utils/operation-error-handler.js';
|
|
11
|
-
export interface GitStashParams extends ToolParams {
|
|
12
|
-
action: 'stash' | 'pop' | 'apply' | 'list' | 'show' | 'drop' | 'clear';
|
|
13
|
-
message?: string;
|
|
14
|
-
stashRef?: string;
|
|
15
|
-
includeUntracked?: boolean;
|
|
16
|
-
keepIndex?: boolean;
|
|
17
|
-
patch?: boolean;
|
|
18
|
-
quiet?: boolean;
|
|
19
|
-
index?: boolean;
|
|
20
|
-
oneline?: boolean;
|
|
21
|
-
}
|
|
22
|
-
export declare class GitStashTool {
|
|
23
|
-
private gitExecutor;
|
|
24
|
-
constructor();
|
|
25
|
-
/**
|
|
26
|
-
* Execute git-stash operation
|
|
27
|
-
*/
|
|
28
|
-
execute(params: GitStashParams): Promise<ToolResult>;
|
|
29
|
-
/**
|
|
30
|
-
* Validate operation-specific parameters
|
|
31
|
-
*/
|
|
32
|
-
private validateOperationParams;
|
|
33
|
-
/**
|
|
34
|
-
* Validate stash reference format
|
|
35
|
-
*/
|
|
36
|
-
private isValidStashRef;
|
|
37
|
-
/**
|
|
38
|
-
* Handle git stash operation (save current changes)
|
|
39
|
-
*/
|
|
40
|
-
private handleStash;
|
|
41
|
-
/**
|
|
42
|
-
* Handle git stash pop operation (apply and remove latest stash)
|
|
43
|
-
*/
|
|
44
|
-
private handlePop;
|
|
45
|
-
/**
|
|
46
|
-
* Handle git stash apply operation (apply stash without removing)
|
|
47
|
-
*/
|
|
48
|
-
private handleApply; /**
|
|
49
|
-
|
|
50
|
-
* Handle git stash list operation (show all stashes)
|
|
51
|
-
*/
|
|
52
|
-
private handleList;
|
|
53
|
-
/**
|
|
54
|
-
* Handle git stash show operation (show stash contents)
|
|
55
|
-
*/
|
|
56
|
-
private handleShow;
|
|
57
|
-
/**
|
|
58
|
-
* Handle git stash drop operation (remove specific stash)
|
|
59
|
-
*/
|
|
60
|
-
private handleDrop;
|
|
61
|
-
/**
|
|
62
|
-
* Handle git stash clear operation (remove all stashes)
|
|
63
|
-
*/
|
|
64
|
-
private handleClear;
|
|
65
|
-
/**
|
|
66
|
-
* Normalize stash reference to proper format
|
|
67
|
-
*/
|
|
68
|
-
private normalizeStashRef;
|
|
69
|
-
/**
|
|
70
|
-
* Get tool schema for MCP registration
|
|
71
|
-
*/
|
|
72
|
-
static getToolSchema(): {
|
|
73
|
-
name: string;
|
|
74
|
-
description: string;
|
|
75
|
-
inputSchema: {
|
|
76
|
-
type: string;
|
|
77
|
-
properties: {
|
|
78
|
-
action: {
|
|
79
|
-
type: string;
|
|
80
|
-
enum: string[];
|
|
81
|
-
description: string;
|
|
82
|
-
};
|
|
83
|
-
projectPath: {
|
|
84
|
-
type: string;
|
|
85
|
-
description: string;
|
|
86
|
-
};
|
|
87
|
-
message: {
|
|
88
|
-
type: string;
|
|
89
|
-
description: string;
|
|
90
|
-
};
|
|
91
|
-
stashRef: {
|
|
92
|
-
type: string;
|
|
93
|
-
description: string;
|
|
94
|
-
};
|
|
95
|
-
includeUntracked: {
|
|
96
|
-
type: string;
|
|
97
|
-
description: string;
|
|
98
|
-
};
|
|
99
|
-
keepIndex: {
|
|
100
|
-
type: string;
|
|
101
|
-
description: string;
|
|
102
|
-
};
|
|
103
|
-
patch: {
|
|
104
|
-
type: string;
|
|
105
|
-
description: string;
|
|
106
|
-
};
|
|
107
|
-
quiet: {
|
|
108
|
-
type: string;
|
|
109
|
-
description: string;
|
|
110
|
-
};
|
|
111
|
-
index: {
|
|
112
|
-
type: string;
|
|
113
|
-
description: string;
|
|
114
|
-
};
|
|
115
|
-
oneline: {
|
|
116
|
-
type: string;
|
|
117
|
-
description: string;
|
|
118
|
-
};
|
|
119
|
-
};
|
|
120
|
-
required: string[];
|
|
121
|
-
};
|
|
122
|
-
};
|
|
123
|
-
}
|
|
124
|
-
//# sourceMappingURL=git-stash.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"git-stash.d.ts","sourceRoot":"","sources":["../../src/tools/git-stash.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAsB,UAAU,EAAE,MAAM,iCAAiC,CAAC;AACjF,OAAO,EAAyB,UAAU,EAAE,MAAM,qCAAqC,CAAC;AAGxF,MAAM,WAAW,cAAe,SAAQ,UAAU;IAChD,MAAM,EAAE,OAAO,GAAG,KAAK,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;IAGvE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAGlB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;IAGhB,KAAK,CAAC,EAAE,OAAO,CAAC;IAGhB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,qBAAa,YAAY;IACvB,OAAO,CAAC,WAAW,CAAqB;;IAMxC;;OAEG;IACG,OAAO,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,UAAU,CAAC;IA8E1D;;OAEG;IACH,OAAO,CAAC,uBAAuB;IA8B/B;;OAEG;IACH,OAAO,CAAC,eAAe;IAKvB;;OAEG;YACW,WAAW;IAoEzB;;OAEG;YACW,SAAS;IAuDvB;;OAEG;YACW,WAAW,EAqDtB;;;OAGA;YACW,UAAU;IA4DxB;;OAEG;YACW,UAAU;IAoDxB;;OAEG;YACW,UAAU;IAiDxB;;OAEG;YACW,WAAW;IAwDzB;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAQzB;;OAEG;IACH,MAAM,CAAC,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqDrB"}
|
package/dist/tools/git-stash.js
DELETED
|
@@ -1,506 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Git Stash Tool
|
|
4
|
-
*
|
|
5
|
-
* Comprehensive Git stash tool providing stash management operations.
|
|
6
|
-
* Supports stash, pop, apply, list, show, drop, clear operations for temporary changes storage.
|
|
7
|
-
*
|
|
8
|
-
* Operations: stash, pop, apply, list, show, drop, clear
|
|
9
|
-
*/
|
|
10
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
-
exports.GitStashTool = 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
|
-
class GitStashTool {
|
|
16
|
-
gitExecutor;
|
|
17
|
-
constructor() {
|
|
18
|
-
this.gitExecutor = new git_command_executor_js_1.GitCommandExecutor();
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Execute git-stash operation
|
|
22
|
-
*/
|
|
23
|
-
async execute(params) {
|
|
24
|
-
const startTime = Date.now();
|
|
25
|
-
try {
|
|
26
|
-
// Validate basic parameters
|
|
27
|
-
const validation = parameter_validator_js_1.ParameterValidator.validateToolParams('git-stash', params);
|
|
28
|
-
if (!validation.isValid) {
|
|
29
|
-
return operation_error_handler_js_1.OperationErrorHandler.createToolError('VALIDATION_ERROR', `Parameter validation failed: ${validation.errors.join(', ')}`, params.action, { validationErrors: validation.errors }, validation.suggestions);
|
|
30
|
-
}
|
|
31
|
-
// Validate operation-specific parameters
|
|
32
|
-
const operationValidation = this.validateOperationParams(params);
|
|
33
|
-
if (!operationValidation.isValid) {
|
|
34
|
-
return operation_error_handler_js_1.OperationErrorHandler.createToolError('VALIDATION_ERROR', `Operation validation failed: ${operationValidation.errors.join(', ')}`, params.action, { validationErrors: operationValidation.errors }, operationValidation.suggestions);
|
|
35
|
-
}
|
|
36
|
-
// Check if it's a Git repository
|
|
37
|
-
const isRepo = await this.gitExecutor.isGitRepository(params.projectPath);
|
|
38
|
-
if (!isRepo) {
|
|
39
|
-
return operation_error_handler_js_1.OperationErrorHandler.createToolError('NOT_A_GIT_REPOSITORY', 'The specified path is not a Git repository', params.action, { projectPath: params.projectPath }, ['Initialize a Git repository first with: git init']);
|
|
40
|
-
}
|
|
41
|
-
// Route to appropriate handler
|
|
42
|
-
switch (params.action) {
|
|
43
|
-
case 'stash':
|
|
44
|
-
return await this.handleStash(params, startTime);
|
|
45
|
-
case 'pop':
|
|
46
|
-
return await this.handlePop(params, startTime);
|
|
47
|
-
case 'apply':
|
|
48
|
-
return await this.handleApply(params, startTime);
|
|
49
|
-
case 'list':
|
|
50
|
-
return await this.handleList(params, startTime);
|
|
51
|
-
case 'show':
|
|
52
|
-
return await this.handleShow(params, startTime);
|
|
53
|
-
case 'drop':
|
|
54
|
-
return await this.handleDrop(params, startTime);
|
|
55
|
-
case 'clear':
|
|
56
|
-
return await this.handleClear(params, startTime);
|
|
57
|
-
default:
|
|
58
|
-
return operation_error_handler_js_1.OperationErrorHandler.createToolError('UNSUPPORTED_OPERATION', `Operation '${params.action}' is not supported`, params.action, {}, ['Use one of: stash, pop, apply, list, show, drop, clear']);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
catch (error) {
|
|
62
|
-
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
63
|
-
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']);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Validate operation-specific parameters
|
|
68
|
-
*/
|
|
69
|
-
validateOperationParams(params) {
|
|
70
|
-
const errors = [];
|
|
71
|
-
const suggestions = [];
|
|
72
|
-
switch (params.action) {
|
|
73
|
-
case 'pop':
|
|
74
|
-
case 'apply':
|
|
75
|
-
case 'show':
|
|
76
|
-
case 'drop':
|
|
77
|
-
// These operations can optionally specify a stash reference
|
|
78
|
-
if (params.stashRef && !this.isValidStashRef(params.stashRef)) {
|
|
79
|
-
errors.push('Invalid stash reference format');
|
|
80
|
-
suggestions.push('Use format like "stash@{0}", "0", or omit for latest stash');
|
|
81
|
-
}
|
|
82
|
-
break;
|
|
83
|
-
case 'stash':
|
|
84
|
-
case 'list':
|
|
85
|
-
case 'clear':
|
|
86
|
-
// These operations don't require specific validation
|
|
87
|
-
break;
|
|
88
|
-
}
|
|
89
|
-
return {
|
|
90
|
-
isValid: errors.length === 0,
|
|
91
|
-
errors,
|
|
92
|
-
suggestions
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* Validate stash reference format
|
|
97
|
-
*/
|
|
98
|
-
isValidStashRef(stashRef) {
|
|
99
|
-
// Valid formats: "stash@{0}", "stash@{1}", "0", "1", etc.
|
|
100
|
-
return /^(stash@\{\d+\}|\d+)$/.test(stashRef);
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* Handle git stash operation (save current changes)
|
|
104
|
-
*/
|
|
105
|
-
async handleStash(params, startTime) {
|
|
106
|
-
try {
|
|
107
|
-
const args = [];
|
|
108
|
-
// Add message if provided
|
|
109
|
-
if (params.message) {
|
|
110
|
-
args.push('push', '-m', params.message);
|
|
111
|
-
}
|
|
112
|
-
else {
|
|
113
|
-
args.push('push');
|
|
114
|
-
}
|
|
115
|
-
// Add options
|
|
116
|
-
if (params.includeUntracked) {
|
|
117
|
-
args.push('--include-untracked');
|
|
118
|
-
}
|
|
119
|
-
if (params.keepIndex) {
|
|
120
|
-
args.push('--keep-index');
|
|
121
|
-
}
|
|
122
|
-
if (params.patch) {
|
|
123
|
-
args.push('--patch');
|
|
124
|
-
}
|
|
125
|
-
if (params.quiet) {
|
|
126
|
-
args.push('--quiet');
|
|
127
|
-
}
|
|
128
|
-
const result = await this.gitExecutor.executeGitCommand('stash', args, params.projectPath);
|
|
129
|
-
if (!result.success) {
|
|
130
|
-
return operation_error_handler_js_1.OperationErrorHandler.handleGitError(result.stderr, 'stash', params.projectPath);
|
|
131
|
-
}
|
|
132
|
-
// Check if anything was actually stashed
|
|
133
|
-
const output = result.stdout.trim();
|
|
134
|
-
const noChanges = output.includes('No local changes to save');
|
|
135
|
-
return {
|
|
136
|
-
success: true,
|
|
137
|
-
data: {
|
|
138
|
-
message: noChanges ? 'No local changes to save' : 'Changes stashed successfully',
|
|
139
|
-
stashed: !noChanges,
|
|
140
|
-
stashMessage: params.message || 'WIP on current branch',
|
|
141
|
-
options: {
|
|
142
|
-
includeUntracked: params.includeUntracked || false,
|
|
143
|
-
keepIndex: params.keepIndex || false,
|
|
144
|
-
patch: params.patch || false
|
|
145
|
-
},
|
|
146
|
-
output
|
|
147
|
-
},
|
|
148
|
-
metadata: {
|
|
149
|
-
operation: 'stash',
|
|
150
|
-
timestamp: new Date().toISOString(),
|
|
151
|
-
executionTime: Date.now() - startTime
|
|
152
|
-
}
|
|
153
|
-
};
|
|
154
|
-
}
|
|
155
|
-
catch (error) {
|
|
156
|
-
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
157
|
-
return operation_error_handler_js_1.OperationErrorHandler.createToolError('STASH_ERROR', `Failed to stash changes: ${errorMessage}`, 'stash', { error: errorMessage, message: params.message });
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
/**
|
|
161
|
-
* Handle git stash pop operation (apply and remove latest stash)
|
|
162
|
-
*/
|
|
163
|
-
async handlePop(params, startTime) {
|
|
164
|
-
try {
|
|
165
|
-
const args = ['pop'];
|
|
166
|
-
// Add stash reference if provided
|
|
167
|
-
if (params.stashRef) {
|
|
168
|
-
const normalizedRef = this.normalizeStashRef(params.stashRef);
|
|
169
|
-
args.push(normalizedRef);
|
|
170
|
-
}
|
|
171
|
-
// Add index option if specified
|
|
172
|
-
if (params.index) {
|
|
173
|
-
args.push('--index');
|
|
174
|
-
}
|
|
175
|
-
// Add quiet option if specified
|
|
176
|
-
if (params.quiet) {
|
|
177
|
-
args.push('--quiet');
|
|
178
|
-
}
|
|
179
|
-
const result = await this.gitExecutor.executeGitCommand('stash', args, params.projectPath);
|
|
180
|
-
if (!result.success) {
|
|
181
|
-
return operation_error_handler_js_1.OperationErrorHandler.handleGitError(result.stderr, 'stash pop', params.projectPath);
|
|
182
|
-
}
|
|
183
|
-
const stashRef = params.stashRef || 'stash@{0}';
|
|
184
|
-
return {
|
|
185
|
-
success: true,
|
|
186
|
-
data: {
|
|
187
|
-
message: `Stash ${stashRef} popped successfully`,
|
|
188
|
-
stashRef,
|
|
189
|
-
applied: true,
|
|
190
|
-
removed: true,
|
|
191
|
-
description: 'Stash applied to working directory and removed from stash list',
|
|
192
|
-
output: result.stdout
|
|
193
|
-
},
|
|
194
|
-
metadata: {
|
|
195
|
-
operation: 'stash pop',
|
|
196
|
-
timestamp: new Date().toISOString(),
|
|
197
|
-
executionTime: Date.now() - startTime
|
|
198
|
-
}
|
|
199
|
-
};
|
|
200
|
-
}
|
|
201
|
-
catch (error) {
|
|
202
|
-
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
203
|
-
return operation_error_handler_js_1.OperationErrorHandler.createToolError('STASH_POP_ERROR', `Failed to pop stash: ${errorMessage}`, 'pop', { error: errorMessage, stashRef: params.stashRef });
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
/**
|
|
207
|
-
* Handle git stash apply operation (apply stash without removing)
|
|
208
|
-
*/
|
|
209
|
-
async handleApply(params, startTime) {
|
|
210
|
-
try {
|
|
211
|
-
const args = ['apply'];
|
|
212
|
-
// Add stash reference if provided
|
|
213
|
-
if (params.stashRef) {
|
|
214
|
-
const normalizedRef = this.normalizeStashRef(params.stashRef);
|
|
215
|
-
args.push(normalizedRef);
|
|
216
|
-
}
|
|
217
|
-
// Add index option if specified
|
|
218
|
-
if (params.index) {
|
|
219
|
-
args.push('--index');
|
|
220
|
-
}
|
|
221
|
-
// Add quiet option if specified
|
|
222
|
-
if (params.quiet) {
|
|
223
|
-
args.push('--quiet');
|
|
224
|
-
}
|
|
225
|
-
const result = await this.gitExecutor.executeGitCommand('stash', args, params.projectPath);
|
|
226
|
-
if (!result.success) {
|
|
227
|
-
return operation_error_handler_js_1.OperationErrorHandler.handleGitError(result.stderr, 'stash apply', params.projectPath);
|
|
228
|
-
}
|
|
229
|
-
const stashRef = params.stashRef || 'stash@{0}';
|
|
230
|
-
return {
|
|
231
|
-
success: true,
|
|
232
|
-
data: {
|
|
233
|
-
message: `Stash ${stashRef} applied successfully`,
|
|
234
|
-
stashRef,
|
|
235
|
-
applied: true,
|
|
236
|
-
removed: false,
|
|
237
|
-
description: 'Stash applied to working directory but kept in stash list',
|
|
238
|
-
output: result.stdout
|
|
239
|
-
},
|
|
240
|
-
metadata: {
|
|
241
|
-
operation: 'stash apply',
|
|
242
|
-
timestamp: new Date().toISOString(),
|
|
243
|
-
executionTime: Date.now() - startTime
|
|
244
|
-
}
|
|
245
|
-
};
|
|
246
|
-
}
|
|
247
|
-
catch (error) {
|
|
248
|
-
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
249
|
-
return operation_error_handler_js_1.OperationErrorHandler.createToolError('STASH_APPLY_ERROR', `Failed to apply stash: ${errorMessage}`, 'apply', { error: errorMessage, stashRef: params.stashRef });
|
|
250
|
-
}
|
|
251
|
-
} /**
|
|
252
|
-
|
|
253
|
-
* Handle git stash list operation (show all stashes)
|
|
254
|
-
*/
|
|
255
|
-
async handleList(params, startTime) {
|
|
256
|
-
try {
|
|
257
|
-
const args = ['list'];
|
|
258
|
-
// Add oneline format if specified
|
|
259
|
-
if (params.oneline) {
|
|
260
|
-
args.push('--oneline');
|
|
261
|
-
}
|
|
262
|
-
const result = await this.gitExecutor.executeGitCommand('stash', args, params.projectPath);
|
|
263
|
-
if (!result.success) {
|
|
264
|
-
return operation_error_handler_js_1.OperationErrorHandler.handleGitError(result.stderr, 'stash list', params.projectPath);
|
|
265
|
-
}
|
|
266
|
-
const output = result.stdout.trim();
|
|
267
|
-
const stashes = output ? output.split('\n').map((line, index) => {
|
|
268
|
-
const match = line.match(/^(stash@\{\d+\}):\s*(.+)$/);
|
|
269
|
-
if (match) {
|
|
270
|
-
return {
|
|
271
|
-
ref: match[1],
|
|
272
|
-
index,
|
|
273
|
-
message: match[2],
|
|
274
|
-
fullLine: line
|
|
275
|
-
};
|
|
276
|
-
}
|
|
277
|
-
return {
|
|
278
|
-
ref: `stash@{${index}}`,
|
|
279
|
-
index,
|
|
280
|
-
message: line,
|
|
281
|
-
fullLine: line
|
|
282
|
-
};
|
|
283
|
-
}) : [];
|
|
284
|
-
return {
|
|
285
|
-
success: true,
|
|
286
|
-
data: {
|
|
287
|
-
message: stashes.length > 0 ? `Found ${stashes.length} stash(es)` : 'No stashes found',
|
|
288
|
-
count: stashes.length,
|
|
289
|
-
stashes,
|
|
290
|
-
isEmpty: stashes.length === 0,
|
|
291
|
-
output
|
|
292
|
-
},
|
|
293
|
-
metadata: {
|
|
294
|
-
operation: 'stash list',
|
|
295
|
-
timestamp: new Date().toISOString(),
|
|
296
|
-
executionTime: Date.now() - startTime
|
|
297
|
-
}
|
|
298
|
-
};
|
|
299
|
-
}
|
|
300
|
-
catch (error) {
|
|
301
|
-
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
302
|
-
return operation_error_handler_js_1.OperationErrorHandler.createToolError('STASH_LIST_ERROR', `Failed to list stashes: ${errorMessage}`, 'list', { error: errorMessage });
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
/**
|
|
306
|
-
* Handle git stash show operation (show stash contents)
|
|
307
|
-
*/
|
|
308
|
-
async handleShow(params, startTime) {
|
|
309
|
-
try {
|
|
310
|
-
const args = ['show'];
|
|
311
|
-
// Add stash reference if provided
|
|
312
|
-
if (params.stashRef) {
|
|
313
|
-
const normalizedRef = this.normalizeStashRef(params.stashRef);
|
|
314
|
-
args.push(normalizedRef);
|
|
315
|
-
}
|
|
316
|
-
// Add patch format for detailed diff
|
|
317
|
-
args.push('--patch');
|
|
318
|
-
const result = await this.gitExecutor.executeGitCommand('stash', args, params.projectPath);
|
|
319
|
-
if (!result.success) {
|
|
320
|
-
return operation_error_handler_js_1.OperationErrorHandler.handleGitError(result.stderr, 'stash show', params.projectPath);
|
|
321
|
-
}
|
|
322
|
-
const stashRef = params.stashRef || 'stash@{0}';
|
|
323
|
-
// Get stash summary (files changed)
|
|
324
|
-
const summaryResult = await this.gitExecutor.executeGitCommand('stash', ['show', '--stat', stashRef], params.projectPath);
|
|
325
|
-
const summary = summaryResult.success ? summaryResult.stdout.trim() : '';
|
|
326
|
-
return {
|
|
327
|
-
success: true,
|
|
328
|
-
data: {
|
|
329
|
-
message: `Showing stash ${stashRef}`,
|
|
330
|
-
stashRef,
|
|
331
|
-
summary,
|
|
332
|
-
diff: result.stdout,
|
|
333
|
-
description: 'Detailed diff of stashed changes',
|
|
334
|
-
output: result.stdout
|
|
335
|
-
},
|
|
336
|
-
metadata: {
|
|
337
|
-
operation: 'stash show',
|
|
338
|
-
timestamp: new Date().toISOString(),
|
|
339
|
-
executionTime: Date.now() - startTime
|
|
340
|
-
}
|
|
341
|
-
};
|
|
342
|
-
}
|
|
343
|
-
catch (error) {
|
|
344
|
-
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
345
|
-
return operation_error_handler_js_1.OperationErrorHandler.createToolError('STASH_SHOW_ERROR', `Failed to show stash: ${errorMessage}`, 'show', { error: errorMessage, stashRef: params.stashRef });
|
|
346
|
-
}
|
|
347
|
-
}
|
|
348
|
-
/**
|
|
349
|
-
* Handle git stash drop operation (remove specific stash)
|
|
350
|
-
*/
|
|
351
|
-
async handleDrop(params, startTime) {
|
|
352
|
-
try {
|
|
353
|
-
const args = ['drop'];
|
|
354
|
-
// Add stash reference if provided
|
|
355
|
-
if (params.stashRef) {
|
|
356
|
-
const normalizedRef = this.normalizeStashRef(params.stashRef);
|
|
357
|
-
args.push(normalizedRef);
|
|
358
|
-
}
|
|
359
|
-
// Add quiet option if specified
|
|
360
|
-
if (params.quiet) {
|
|
361
|
-
args.push('--quiet');
|
|
362
|
-
}
|
|
363
|
-
const result = await this.gitExecutor.executeGitCommand('stash', args, params.projectPath);
|
|
364
|
-
if (!result.success) {
|
|
365
|
-
return operation_error_handler_js_1.OperationErrorHandler.handleGitError(result.stderr, 'stash drop', params.projectPath);
|
|
366
|
-
}
|
|
367
|
-
const stashRef = params.stashRef || 'stash@{0}';
|
|
368
|
-
return {
|
|
369
|
-
success: true,
|
|
370
|
-
data: {
|
|
371
|
-
message: `Stash ${stashRef} dropped successfully`,
|
|
372
|
-
stashRef,
|
|
373
|
-
removed: true,
|
|
374
|
-
description: 'Stash permanently removed from stash list',
|
|
375
|
-
output: result.stdout
|
|
376
|
-
},
|
|
377
|
-
metadata: {
|
|
378
|
-
operation: 'stash drop',
|
|
379
|
-
timestamp: new Date().toISOString(),
|
|
380
|
-
executionTime: Date.now() - startTime
|
|
381
|
-
}
|
|
382
|
-
};
|
|
383
|
-
}
|
|
384
|
-
catch (error) {
|
|
385
|
-
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
386
|
-
return operation_error_handler_js_1.OperationErrorHandler.createToolError('STASH_DROP_ERROR', `Failed to drop stash: ${errorMessage}`, 'drop', { error: errorMessage, stashRef: params.stashRef });
|
|
387
|
-
}
|
|
388
|
-
}
|
|
389
|
-
/**
|
|
390
|
-
* Handle git stash clear operation (remove all stashes)
|
|
391
|
-
*/
|
|
392
|
-
async handleClear(params, startTime) {
|
|
393
|
-
try {
|
|
394
|
-
// Get current stash count before clearing
|
|
395
|
-
const listResult = await this.gitExecutor.executeGitCommand('stash', ['list'], params.projectPath);
|
|
396
|
-
const stashCount = listResult.success ? listResult.stdout.trim().split('\n').filter(line => line.trim()).length : 0;
|
|
397
|
-
if (stashCount === 0) {
|
|
398
|
-
return {
|
|
399
|
-
success: true,
|
|
400
|
-
data: {
|
|
401
|
-
message: 'No stashes to clear',
|
|
402
|
-
cleared: 0,
|
|
403
|
-
description: 'Stash list was already empty'
|
|
404
|
-
},
|
|
405
|
-
metadata: {
|
|
406
|
-
operation: 'stash clear',
|
|
407
|
-
timestamp: new Date().toISOString(),
|
|
408
|
-
executionTime: Date.now() - startTime
|
|
409
|
-
}
|
|
410
|
-
};
|
|
411
|
-
}
|
|
412
|
-
const args = ['clear'];
|
|
413
|
-
const result = await this.gitExecutor.executeGitCommand('stash', args, params.projectPath);
|
|
414
|
-
if (!result.success) {
|
|
415
|
-
return operation_error_handler_js_1.OperationErrorHandler.handleGitError(result.stderr, 'stash clear', params.projectPath);
|
|
416
|
-
}
|
|
417
|
-
return {
|
|
418
|
-
success: true,
|
|
419
|
-
data: {
|
|
420
|
-
message: `All ${stashCount} stash(es) cleared successfully`,
|
|
421
|
-
cleared: stashCount,
|
|
422
|
-
description: 'All stashes permanently removed from stash list',
|
|
423
|
-
warning: 'This operation cannot be undone',
|
|
424
|
-
output: result.stdout
|
|
425
|
-
},
|
|
426
|
-
metadata: {
|
|
427
|
-
operation: 'stash clear',
|
|
428
|
-
timestamp: new Date().toISOString(),
|
|
429
|
-
executionTime: Date.now() - startTime
|
|
430
|
-
}
|
|
431
|
-
};
|
|
432
|
-
}
|
|
433
|
-
catch (error) {
|
|
434
|
-
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
435
|
-
return operation_error_handler_js_1.OperationErrorHandler.createToolError('STASH_CLEAR_ERROR', `Failed to clear stashes: ${errorMessage}`, 'clear', { error: errorMessage });
|
|
436
|
-
}
|
|
437
|
-
}
|
|
438
|
-
/**
|
|
439
|
-
* Normalize stash reference to proper format
|
|
440
|
-
*/
|
|
441
|
-
normalizeStashRef(stashRef) {
|
|
442
|
-
// If it's just a number, convert to stash@{n} format
|
|
443
|
-
if (/^\d+$/.test(stashRef)) {
|
|
444
|
-
return `stash@{${stashRef}}`;
|
|
445
|
-
}
|
|
446
|
-
return stashRef;
|
|
447
|
-
}
|
|
448
|
-
/**
|
|
449
|
-
* Get tool schema for MCP registration
|
|
450
|
-
*/
|
|
451
|
-
static getToolSchema() {
|
|
452
|
-
return {
|
|
453
|
-
name: 'git-stash',
|
|
454
|
-
description: 'Git stash tool for temporary changes management. Supports stash, pop, apply, list, show, drop, clear operations for storing and retrieving work-in-progress changes.',
|
|
455
|
-
inputSchema: {
|
|
456
|
-
type: 'object',
|
|
457
|
-
properties: {
|
|
458
|
-
action: {
|
|
459
|
-
type: 'string',
|
|
460
|
-
enum: ['stash', 'pop', 'apply', 'list', 'show', 'drop', 'clear'],
|
|
461
|
-
description: 'The stash operation to perform'
|
|
462
|
-
},
|
|
463
|
-
projectPath: {
|
|
464
|
-
type: 'string',
|
|
465
|
-
description: 'Absolute path to the project directory'
|
|
466
|
-
},
|
|
467
|
-
message: {
|
|
468
|
-
type: 'string',
|
|
469
|
-
description: 'Stash message (for stash operation)'
|
|
470
|
-
},
|
|
471
|
-
stashRef: {
|
|
472
|
-
type: 'string',
|
|
473
|
-
description: 'Stash reference (e.g., "stash@{0}", "0") for pop, apply, show, drop operations'
|
|
474
|
-
},
|
|
475
|
-
includeUntracked: {
|
|
476
|
-
type: 'boolean',
|
|
477
|
-
description: 'Include untracked files when stashing'
|
|
478
|
-
},
|
|
479
|
-
keepIndex: {
|
|
480
|
-
type: 'boolean',
|
|
481
|
-
description: 'Keep index unchanged when stashing'
|
|
482
|
-
},
|
|
483
|
-
patch: {
|
|
484
|
-
type: 'boolean',
|
|
485
|
-
description: 'Interactive patch mode for selective stashing'
|
|
486
|
-
},
|
|
487
|
-
quiet: {
|
|
488
|
-
type: 'boolean',
|
|
489
|
-
description: 'Suppress output during stash operations'
|
|
490
|
-
},
|
|
491
|
-
index: {
|
|
492
|
-
type: 'boolean',
|
|
493
|
-
description: 'Try to reinstate index changes when applying/popping'
|
|
494
|
-
},
|
|
495
|
-
oneline: {
|
|
496
|
-
type: 'boolean',
|
|
497
|
-
description: 'Show stash list in oneline format'
|
|
498
|
-
}
|
|
499
|
-
},
|
|
500
|
-
required: ['action', 'projectPath']
|
|
501
|
-
}
|
|
502
|
-
};
|
|
503
|
-
}
|
|
504
|
-
}
|
|
505
|
-
exports.GitStashTool = GitStashTool;
|
|
506
|
-
//# sourceMappingURL=git-stash.js.map
|