@andrebuzeli/git-mcp 2.48.0 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/README.md +356 -329
  2. package/dist/server.d.ts.map +1 -1
  3. package/dist/server.js +82 -83
  4. package/dist/server.js.map +1 -1
  5. package/dist/tools/git-branches.d.ts +125 -359
  6. package/dist/tools/git-branches.d.ts.map +1 -1
  7. package/dist/tools/git-branches.js +179 -530
  8. package/dist/tools/git-branches.js.map +1 -1
  9. package/dist/tools/git-commits.d.ts +2 -2
  10. package/dist/tools/git-config.d.ts +2 -2
  11. package/dist/tools/git-files.d.ts +246 -406
  12. package/dist/tools/git-files.d.ts.map +1 -1
  13. package/dist/tools/git-files.js +556 -499
  14. package/dist/tools/git-files.js.map +1 -1
  15. package/dist/tools/git-issues.d.ts +10 -10
  16. package/dist/tools/git-packages.d.ts +2 -2
  17. package/dist/tools/git-projects.d.ts +142 -57
  18. package/dist/tools/git-projects.d.ts.map +1 -1
  19. package/dist/tools/git-projects.js +281 -283
  20. package/dist/tools/git-projects.js.map +1 -1
  21. package/dist/tools/git-pulls.d.ts +16 -16
  22. package/dist/tools/git-releases.d.ts +131 -401
  23. package/dist/tools/git-releases.d.ts.map +1 -1
  24. package/dist/tools/git-releases.js +374 -469
  25. package/dist/tools/git-releases.js.map +1 -1
  26. package/dist/tools/git-remote.d.ts +4 -4
  27. package/dist/tools/git-repositories.d.ts +8 -8
  28. package/dist/tools/git-reset.d.ts +106 -65
  29. package/dist/tools/git-reset.d.ts.map +1 -1
  30. package/dist/tools/git-reset.js +265 -149
  31. package/dist/tools/git-reset.js.map +1 -1
  32. package/dist/tools/git-stash.d.ts +110 -68
  33. package/dist/tools/git-stash.d.ts.map +1 -1
  34. package/dist/tools/git-stash.js +311 -186
  35. package/dist/tools/git-stash.js.map +1 -1
  36. package/dist/tools/git-sync.d.ts +149 -80
  37. package/dist/tools/git-sync.d.ts.map +1 -1
  38. package/dist/tools/git-sync.js +346 -246
  39. package/dist/tools/git-sync.js.map +1 -1
  40. package/dist/tools/git-tags.d.ts +2 -2
  41. package/dist/tools/git-undo.d.ts +268 -0
  42. package/dist/tools/git-undo.d.ts.map +1 -0
  43. package/dist/tools/git-undo.js +516 -0
  44. package/dist/tools/git-undo.js.map +1 -0
  45. package/dist/tools/git-update-project.d.ts +4 -159
  46. package/dist/tools/git-update-project.d.ts.map +1 -1
  47. package/dist/tools/git-update-project.js +7 -349
  48. package/dist/tools/git-update-project.js.map +1 -1
  49. package/dist/tools/git-versioning.d.ts +286 -0
  50. package/dist/tools/git-versioning.d.ts.map +1 -0
  51. package/dist/tools/git-versioning.js +483 -0
  52. package/dist/tools/git-versioning.js.map +1 -0
  53. package/dist/tools/git-workflow.d.ts +200 -259
  54. package/dist/tools/git-workflow.d.ts.map +1 -1
  55. package/dist/tools/git-workflow.js +424 -498
  56. package/dist/tools/git-workflow.js.map +1 -1
  57. package/package.json +5 -14
  58. package/dist/tools/git-publish.d.ts +0 -327
  59. package/dist/tools/git-publish.d.ts.map +0 -1
  60. package/dist/tools/git-publish.js +0 -632
  61. package/dist/tools/git-publish.js.map +0 -1
@@ -2,28 +2,83 @@ import { z } from 'zod';
2
2
  /**
3
3
  * Tool: git-sync
4
4
  *
5
- * DESCRIÇÃO:
6
- * Sincronização entre dois repositórios hospedados em provedores distintos (ex.: Gitea <-> GitHub).
5
+ * SINCRONIZAÇÃO SIMPLIFICADA - Para backup pessoal
6
+ * Funcionalidades básicas de backup e sincronização
7
7
  *
8
- * OBJETIVOS:
9
- * - Configurar espelhamento (quando suportado pelo backend) e registrar estado
10
- * - Executar sincronização pontual (one-shot) de código e/ou metadados
11
- * - Consultar status/diagnóstico da sincronização
12
- *
13
- * LIMITAÇÕES:
14
- * - Histórico Git completo por API REST é limitado; prioriza espelhamento nativo (push mirrors) quando disponível
15
- * - Metadados (issues, labels, releases, PRs) têm mapeamento best-effort com diferenças entre plataformas
16
- *
17
- * DICAS (solo):
18
- * - Use para manter um backup/em espelho entre provedores
19
- * - Prefira one-shot antes de configurar contínuo; verifique status e conflitos
20
- * - Defina estratégia de conflito e escopos explicitamente
8
+ * DESIGNED FOR: Programador individual autônomo
9
+ * PHILOSOPHY: Backup simples e confiável para projetos pessoais
21
10
  */
22
- declare const GitSyncInputSchema: z.ZodObject<{
23
- action: z.ZodEnum<["configure", "status", "one-shot"]>;
11
+ declare const GitSyncInputSchema: z.ZodDiscriminatedUnion<"action", [z.ZodObject<{
12
+ action: z.ZodLiteral<"backup">;
13
+ repo: z.ZodString;
14
+ projectPath: z.ZodString;
15
+ provider: z.ZodEnum<["gitea", "github"]>;
16
+ message: z.ZodOptional<z.ZodString>;
17
+ force: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
18
+ }, "strip", z.ZodTypeAny, {
19
+ provider: "gitea" | "github";
20
+ repo: string;
21
+ action: "backup";
22
+ force: boolean;
23
+ projectPath: string;
24
+ message?: string | undefined;
25
+ }, {
26
+ provider: "gitea" | "github";
27
+ repo: string;
28
+ action: "backup";
29
+ projectPath: string;
30
+ message?: string | undefined;
31
+ force?: boolean | undefined;
32
+ }>, z.ZodObject<{
33
+ action: z.ZodLiteral<"restore">;
34
+ repo: z.ZodString;
35
+ projectPath: z.ZodString;
36
+ provider: z.ZodEnum<["gitea", "github"]>;
37
+ version: z.ZodOptional<z.ZodString>;
38
+ }, "strip", z.ZodTypeAny, {
39
+ provider: "gitea" | "github";
40
+ repo: string;
41
+ action: "restore";
42
+ projectPath: string;
43
+ version?: string | undefined;
44
+ }, {
45
+ provider: "gitea" | "github";
46
+ repo: string;
47
+ action: "restore";
48
+ projectPath: string;
49
+ version?: string | undefined;
50
+ }>, z.ZodObject<{
51
+ action: z.ZodLiteral<"status">;
52
+ repo: z.ZodString;
53
+ provider: z.ZodEnum<["gitea", "github"]>;
54
+ }, "strip", z.ZodTypeAny, {
55
+ provider: "gitea" | "github";
56
+ repo: string;
57
+ action: "status";
58
+ }, {
59
+ provider: "gitea" | "github";
60
+ repo: string;
61
+ action: "status";
62
+ }>, z.ZodObject<{
63
+ action: z.ZodLiteral<"quick-sync">;
64
+ projectPath: z.ZodString;
65
+ message: z.ZodOptional<z.ZodString>;
66
+ createBackup: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
67
+ }, "strip", z.ZodTypeAny, {
68
+ action: "quick-sync";
69
+ projectPath: string;
70
+ createBackup: boolean;
71
+ message?: string | undefined;
72
+ }, {
73
+ action: "quick-sync";
74
+ projectPath: string;
75
+ message?: string | undefined;
76
+ createBackup?: boolean | undefined;
77
+ }>, z.ZodObject<{
78
+ action: z.ZodLiteral<"mirror">;
24
79
  source: z.ZodObject<{
25
- provider: z.ZodEnum<["gitea", "github"]>;
26
80
  repo: z.ZodString;
81
+ provider: z.ZodEnum<["gitea", "github"]>;
27
82
  }, "strip", z.ZodTypeAny, {
28
83
  provider: "gitea" | "github";
29
84
  repo: string;
@@ -32,8 +87,8 @@ declare const GitSyncInputSchema: z.ZodObject<{
32
87
  repo: string;
33
88
  }>;
34
89
  target: z.ZodObject<{
35
- provider: z.ZodEnum<["gitea", "github"]>;
36
90
  repo: z.ZodString;
91
+ provider: z.ZodEnum<["gitea", "github"]>;
37
92
  }, "strip", z.ZodTypeAny, {
38
93
  provider: "gitea" | "github";
39
94
  repo: string;
@@ -41,39 +96,30 @@ declare const GitSyncInputSchema: z.ZodObject<{
41
96
  provider: "gitea" | "github";
42
97
  repo: string;
43
98
  }>;
44
- direction: z.ZodOptional<z.ZodEnum<["one-way", "two-way"]>>;
45
- include: z.ZodOptional<z.ZodArray<z.ZodEnum<["git", "issues", "labels", "milestones", "releases", "pulls"]>, "many">>;
46
- strategy: z.ZodOptional<z.ZodEnum<["source-wins", "timestamp", "skip-conflicts"]>>;
47
- dry_run: z.ZodOptional<z.ZodBoolean>;
99
+ bidirectional: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
48
100
  }, "strip", z.ZodTypeAny, {
49
- action: "status" | "configure" | "one-shot";
50
- target: {
101
+ action: "mirror";
102
+ source: {
51
103
  provider: "gitea" | "github";
52
104
  repo: string;
53
105
  };
54
- source: {
106
+ target: {
55
107
  provider: "gitea" | "github";
56
108
  repo: string;
57
109
  };
58
- strategy?: "timestamp" | "source-wins" | "skip-conflicts" | undefined;
59
- direction?: "one-way" | "two-way" | undefined;
60
- include?: ("issues" | "labels" | "git" | "milestones" | "releases" | "pulls")[] | undefined;
61
- dry_run?: boolean | undefined;
110
+ bidirectional: boolean;
62
111
  }, {
63
- action: "status" | "configure" | "one-shot";
64
- target: {
112
+ action: "mirror";
113
+ source: {
65
114
  provider: "gitea" | "github";
66
115
  repo: string;
67
116
  };
68
- source: {
117
+ target: {
69
118
  provider: "gitea" | "github";
70
119
  repo: string;
71
120
  };
72
- strategy?: "timestamp" | "source-wins" | "skip-conflicts" | undefined;
73
- direction?: "one-way" | "two-way" | undefined;
74
- include?: ("issues" | "labels" | "git" | "milestones" | "releases" | "pulls")[] | undefined;
75
- dry_run?: boolean | undefined;
76
- }>;
121
+ bidirectional?: boolean | undefined;
122
+ }>]>;
77
123
  export type GitSyncInput = z.infer<typeof GitSyncInputSchema>;
78
124
  declare const GitSyncResultSchema: z.ZodObject<{
79
125
  success: z.ZodBoolean;
@@ -81,18 +127,27 @@ declare const GitSyncResultSchema: z.ZodObject<{
81
127
  message: z.ZodString;
82
128
  data: z.ZodOptional<z.ZodAny>;
83
129
  error: z.ZodOptional<z.ZodString>;
130
+ recoverable: z.ZodOptional<z.ZodBoolean>;
131
+ suggestion: z.ZodOptional<z.ZodString>;
132
+ warning: z.ZodOptional<z.ZodString>;
84
133
  }, "strip", z.ZodTypeAny, {
85
134
  message: string;
86
135
  action: string;
87
136
  success: boolean;
88
137
  error?: string | undefined;
89
138
  data?: any;
139
+ recoverable?: boolean | undefined;
140
+ suggestion?: string | undefined;
141
+ warning?: string | undefined;
90
142
  }, {
91
143
  message: string;
92
144
  action: string;
93
145
  success: boolean;
94
146
  error?: string | undefined;
95
147
  data?: any;
148
+ recoverable?: boolean | undefined;
149
+ suggestion?: string | undefined;
150
+ warning?: string | undefined;
96
151
  }>;
97
152
  export type GitSyncResult = z.infer<typeof GitSyncResultSchema>;
98
153
  export declare const gitSyncTool: {
@@ -106,74 +161,88 @@ export declare const gitSyncTool: {
106
161
  enum: string[];
107
162
  description: string;
108
163
  };
109
- source: {
164
+ repo: {
165
+ type: string;
166
+ description: string;
167
+ };
168
+ projectPath: {
110
169
  type: string;
111
170
  description: string;
171
+ };
172
+ provider: {
173
+ type: string;
174
+ enum: string[];
175
+ description: string;
176
+ };
177
+ message: {
178
+ type: string;
179
+ description: string;
180
+ };
181
+ force: {
182
+ type: string;
183
+ description: string;
184
+ default: boolean;
185
+ };
186
+ version: {
187
+ type: string;
188
+ description: string;
189
+ };
190
+ createBackup: {
191
+ type: string;
192
+ description: string;
193
+ default: boolean;
194
+ };
195
+ source: {
196
+ type: string;
112
197
  properties: {
113
- provider: {
114
- type: string;
115
- };
116
- owner: {
198
+ repo: {
117
199
  type: string;
118
200
  };
119
- repo: {
201
+ provider: {
120
202
  type: string;
203
+ enum: string[];
121
204
  };
122
205
  };
206
+ description: string;
123
207
  };
124
208
  target: {
125
209
  type: string;
126
- description: string;
127
210
  properties: {
128
- provider: {
129
- type: string;
130
- };
131
- owner: {
211
+ repo: {
132
212
  type: string;
133
213
  };
134
- repo: {
214
+ provider: {
135
215
  type: string;
216
+ enum: string[];
136
217
  };
137
218
  };
138
- };
139
- direction: {
140
- type: string;
141
- enum: string[];
142
- description: string;
143
- };
144
- include: {
145
- type: string;
146
- items: {
147
- type: string;
148
- enum: string[];
149
- };
150
- description: string;
151
- };
152
- strategy: {
153
- type: string;
154
- enum: string[];
155
219
  description: string;
156
220
  };
157
- dry_run: {
221
+ bidirectional: {
158
222
  type: string;
159
223
  description: string;
224
+ default: boolean;
160
225
  };
161
226
  };
162
227
  required: string[];
163
228
  };
164
229
  handler(input: GitSyncInput): Promise<GitSyncResult>;
165
- /**
166
- * Configura sincronização entre dois repositórios
167
- */
168
- configureSync(params: GitSyncInput): Promise<GitSyncResult>;
169
- /**
170
- * Obtém status da sincronização
171
- */
172
- getSyncStatus(params: GitSyncInput): Promise<GitSyncResult>;
173
- /**
174
- * Executa sincronização pontual
175
- */
176
- executeSync(params: GitSyncInput): Promise<GitSyncResult>;
230
+ handleBackup(params: GitSyncInput & {
231
+ action: "backup";
232
+ }): Promise<GitSyncResult>;
233
+ handleRestore(params: GitSyncInput & {
234
+ action: "restore";
235
+ }): Promise<GitSyncResult>;
236
+ handleStatus(params: GitSyncInput & {
237
+ action: "status";
238
+ }): Promise<GitSyncResult>;
239
+ handleQuickSync(params: GitSyncInput & {
240
+ action: "quick-sync";
241
+ }): Promise<GitSyncResult>;
242
+ handleMirror(params: GitSyncInput & {
243
+ action: "mirror";
244
+ }): Promise<GitSyncResult>;
245
+ hasUncommittedChanges(projectPath: string): Promise<boolean>;
177
246
  };
178
247
  export {};
179
248
  //# sourceMappingURL=git-sync.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"git-sync.d.ts","sourceRoot":"","sources":["../../src/tools/git-sync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,QAAA,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EActB,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D,QAAA,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;EAMvB,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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