@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.
- package/README.md +356 -329
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +82 -83
- package/dist/server.js.map +1 -1
- package/dist/tools/git-branches.d.ts +125 -359
- package/dist/tools/git-branches.d.ts.map +1 -1
- package/dist/tools/git-branches.js +179 -530
- package/dist/tools/git-branches.js.map +1 -1
- package/dist/tools/git-commits.d.ts +2 -2
- package/dist/tools/git-config.d.ts +2 -2
- package/dist/tools/git-files.d.ts +246 -406
- package/dist/tools/git-files.d.ts.map +1 -1
- package/dist/tools/git-files.js +556 -499
- package/dist/tools/git-files.js.map +1 -1
- package/dist/tools/git-issues.d.ts +10 -10
- package/dist/tools/git-packages.d.ts +2 -2
- package/dist/tools/git-projects.d.ts +142 -57
- package/dist/tools/git-projects.d.ts.map +1 -1
- package/dist/tools/git-projects.js +281 -283
- package/dist/tools/git-projects.js.map +1 -1
- package/dist/tools/git-pulls.d.ts +16 -16
- package/dist/tools/git-releases.d.ts +131 -401
- package/dist/tools/git-releases.d.ts.map +1 -1
- package/dist/tools/git-releases.js +374 -469
- package/dist/tools/git-releases.js.map +1 -1
- package/dist/tools/git-remote.d.ts +4 -4
- package/dist/tools/git-repositories.d.ts +8 -8
- package/dist/tools/git-reset.d.ts +106 -65
- package/dist/tools/git-reset.d.ts.map +1 -1
- package/dist/tools/git-reset.js +265 -149
- package/dist/tools/git-reset.js.map +1 -1
- package/dist/tools/git-stash.d.ts +110 -68
- package/dist/tools/git-stash.d.ts.map +1 -1
- package/dist/tools/git-stash.js +311 -186
- package/dist/tools/git-stash.js.map +1 -1
- package/dist/tools/git-sync.d.ts +149 -80
- package/dist/tools/git-sync.d.ts.map +1 -1
- package/dist/tools/git-sync.js +346 -246
- package/dist/tools/git-sync.js.map +1 -1
- package/dist/tools/git-tags.d.ts +2 -2
- package/dist/tools/git-undo.d.ts +268 -0
- package/dist/tools/git-undo.d.ts.map +1 -0
- package/dist/tools/git-undo.js +516 -0
- package/dist/tools/git-undo.js.map +1 -0
- package/dist/tools/git-update-project.d.ts +4 -159
- package/dist/tools/git-update-project.d.ts.map +1 -1
- package/dist/tools/git-update-project.js +7 -349
- package/dist/tools/git-update-project.js.map +1 -1
- package/dist/tools/git-versioning.d.ts +286 -0
- package/dist/tools/git-versioning.d.ts.map +1 -0
- package/dist/tools/git-versioning.js +483 -0
- package/dist/tools/git-versioning.js.map +1 -0
- package/dist/tools/git-workflow.d.ts +200 -259
- package/dist/tools/git-workflow.d.ts.map +1 -1
- package/dist/tools/git-workflow.js +424 -498
- package/dist/tools/git-workflow.js.map +1 -1
- package/package.json +5 -14
- package/dist/tools/git-publish.d.ts +0 -327
- package/dist/tools/git-publish.d.ts.map +0 -1
- package/dist/tools/git-publish.js +0 -632
- package/dist/tools/git-publish.js.map +0 -1
|
@@ -16,8 +16,8 @@ declare const GitUpdateProjectInputSchema: z.ZodDiscriminatedUnion<"action", [z.
|
|
|
16
16
|
action: "init";
|
|
17
17
|
projectPath: string;
|
|
18
18
|
branch?: string | undefined;
|
|
19
|
-
createRepo?: boolean | undefined;
|
|
20
19
|
forcePush?: boolean | undefined;
|
|
20
|
+
createRepo?: boolean | undefined;
|
|
21
21
|
granular?: boolean | undefined;
|
|
22
22
|
}, {
|
|
23
23
|
provider: "gitea" | "github";
|
|
@@ -26,8 +26,8 @@ declare const GitUpdateProjectInputSchema: z.ZodDiscriminatedUnion<"action", [z.
|
|
|
26
26
|
action: "init";
|
|
27
27
|
projectPath: string;
|
|
28
28
|
branch?: string | undefined;
|
|
29
|
-
createRepo?: boolean | undefined;
|
|
30
29
|
forcePush?: boolean | undefined;
|
|
30
|
+
createRepo?: boolean | undefined;
|
|
31
31
|
granular?: boolean | undefined;
|
|
32
32
|
}>, z.ZodObject<{
|
|
33
33
|
action: z.ZodLiteral<"update">;
|
|
@@ -93,14 +93,14 @@ declare const GitUpdateProjectInputSchema: z.ZodDiscriminatedUnion<"action", [z.
|
|
|
93
93
|
action: "log";
|
|
94
94
|
projectPath: string;
|
|
95
95
|
branch?: string | undefined;
|
|
96
|
-
maxCount?: number | undefined;
|
|
97
96
|
oneline?: boolean | undefined;
|
|
97
|
+
maxCount?: number | undefined;
|
|
98
98
|
}, {
|
|
99
99
|
action: "log";
|
|
100
100
|
projectPath: string;
|
|
101
101
|
branch?: string | undefined;
|
|
102
|
-
maxCount?: number | undefined;
|
|
103
102
|
oneline?: boolean | undefined;
|
|
103
|
+
maxCount?: number | undefined;
|
|
104
104
|
}>, z.ZodObject<{
|
|
105
105
|
action: z.ZodLiteral<"reset">;
|
|
106
106
|
projectPath: z.ZodString;
|
|
@@ -167,93 +167,6 @@ declare const GitUpdateProjectInputSchema: z.ZodDiscriminatedUnion<"action", [z.
|
|
|
167
167
|
projectPath: string;
|
|
168
168
|
branch?: string | undefined;
|
|
169
169
|
forcePush?: boolean | undefined;
|
|
170
|
-
}>, z.ZodObject<{
|
|
171
|
-
action: z.ZodLiteral<"daily-workflow">;
|
|
172
|
-
projectPath: z.ZodString;
|
|
173
|
-
autoMessage: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
174
|
-
autoPush: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
175
|
-
createBackup: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
176
|
-
granularCommits: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
177
|
-
}, "strip", z.ZodTypeAny, {
|
|
178
|
-
action: "daily-workflow";
|
|
179
|
-
projectPath: string;
|
|
180
|
-
autoMessage: boolean;
|
|
181
|
-
autoPush: boolean;
|
|
182
|
-
createBackup: boolean;
|
|
183
|
-
granularCommits: boolean;
|
|
184
|
-
}, {
|
|
185
|
-
action: "daily-workflow";
|
|
186
|
-
projectPath: string;
|
|
187
|
-
autoMessage?: boolean | undefined;
|
|
188
|
-
autoPush?: boolean | undefined;
|
|
189
|
-
createBackup?: boolean | undefined;
|
|
190
|
-
granularCommits?: boolean | undefined;
|
|
191
|
-
}>, z.ZodObject<{
|
|
192
|
-
action: z.ZodLiteral<"smart-commit">;
|
|
193
|
-
projectPath: z.ZodString;
|
|
194
|
-
detectChanges: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
195
|
-
autoCategorize: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
196
|
-
suggestedMessage: z.ZodOptional<z.ZodString>;
|
|
197
|
-
validateSyntax: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
198
|
-
autoPush: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
199
|
-
}, "strip", z.ZodTypeAny, {
|
|
200
|
-
action: "smart-commit";
|
|
201
|
-
projectPath: string;
|
|
202
|
-
autoPush: boolean;
|
|
203
|
-
detectChanges: boolean;
|
|
204
|
-
autoCategorize: boolean;
|
|
205
|
-
validateSyntax: boolean;
|
|
206
|
-
suggestedMessage?: string | undefined;
|
|
207
|
-
}, {
|
|
208
|
-
action: "smart-commit";
|
|
209
|
-
projectPath: string;
|
|
210
|
-
autoPush?: boolean | undefined;
|
|
211
|
-
detectChanges?: boolean | undefined;
|
|
212
|
-
autoCategorize?: boolean | undefined;
|
|
213
|
-
suggestedMessage?: string | undefined;
|
|
214
|
-
validateSyntax?: boolean | undefined;
|
|
215
|
-
}>, z.ZodObject<{
|
|
216
|
-
action: z.ZodLiteral<"full-sync">;
|
|
217
|
-
repo: z.ZodString;
|
|
218
|
-
projectPath: z.ZodString;
|
|
219
|
-
provider: z.ZodEnum<["gitea", "github"]>;
|
|
220
|
-
pullFirst: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
221
|
-
resolveConflicts: z.ZodDefault<z.ZodOptional<z.ZodEnum<["auto", "manual", "skip"]>>>;
|
|
222
|
-
forcePush: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
223
|
-
createBackup: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
224
|
-
}, "strip", z.ZodTypeAny, {
|
|
225
|
-
provider: "gitea" | "github";
|
|
226
|
-
repo: string;
|
|
227
|
-
action: "full-sync";
|
|
228
|
-
projectPath: string;
|
|
229
|
-
forcePush: boolean;
|
|
230
|
-
createBackup: boolean;
|
|
231
|
-
pullFirst: boolean;
|
|
232
|
-
resolveConflicts: "auto" | "manual" | "skip";
|
|
233
|
-
}, {
|
|
234
|
-
provider: "gitea" | "github";
|
|
235
|
-
repo: string;
|
|
236
|
-
action: "full-sync";
|
|
237
|
-
projectPath: string;
|
|
238
|
-
forcePush?: boolean | undefined;
|
|
239
|
-
createBackup?: boolean | undefined;
|
|
240
|
-
pullFirst?: boolean | undefined;
|
|
241
|
-
resolveConflicts?: "auto" | "manual" | "skip" | undefined;
|
|
242
|
-
}>, z.ZodObject<{
|
|
243
|
-
action: z.ZodLiteral<"auto-backup">;
|
|
244
|
-
projectPath: z.ZodString;
|
|
245
|
-
message: z.ZodOptional<z.ZodString>;
|
|
246
|
-
includeUntracked: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
247
|
-
}, "strip", z.ZodTypeAny, {
|
|
248
|
-
action: "auto-backup";
|
|
249
|
-
projectPath: string;
|
|
250
|
-
includeUntracked: boolean;
|
|
251
|
-
message?: string | undefined;
|
|
252
|
-
}, {
|
|
253
|
-
action: "auto-backup";
|
|
254
|
-
projectPath: string;
|
|
255
|
-
message?: string | undefined;
|
|
256
|
-
includeUntracked?: boolean | undefined;
|
|
257
170
|
}>]>;
|
|
258
171
|
export type GitUpdateProjectInput = z.infer<typeof GitUpdateProjectInputSchema>;
|
|
259
172
|
declare const GitUpdateProjectResultSchema: z.ZodObject<{
|
|
@@ -365,61 +278,6 @@ export declare const gitUpdateProjectTool: {
|
|
|
365
278
|
description: string;
|
|
366
279
|
default: string;
|
|
367
280
|
};
|
|
368
|
-
autoMessage: {
|
|
369
|
-
type: string;
|
|
370
|
-
description: string;
|
|
371
|
-
default: boolean;
|
|
372
|
-
};
|
|
373
|
-
autoPush: {
|
|
374
|
-
type: string;
|
|
375
|
-
description: string;
|
|
376
|
-
default: boolean;
|
|
377
|
-
};
|
|
378
|
-
createBackup: {
|
|
379
|
-
type: string;
|
|
380
|
-
description: string;
|
|
381
|
-
default: boolean;
|
|
382
|
-
};
|
|
383
|
-
granularCommits: {
|
|
384
|
-
type: string;
|
|
385
|
-
description: string;
|
|
386
|
-
default: boolean;
|
|
387
|
-
};
|
|
388
|
-
detectChanges: {
|
|
389
|
-
type: string;
|
|
390
|
-
description: string;
|
|
391
|
-
default: boolean;
|
|
392
|
-
};
|
|
393
|
-
autoCategorize: {
|
|
394
|
-
type: string;
|
|
395
|
-
description: string;
|
|
396
|
-
default: boolean;
|
|
397
|
-
};
|
|
398
|
-
suggestedMessage: {
|
|
399
|
-
type: string;
|
|
400
|
-
description: string;
|
|
401
|
-
};
|
|
402
|
-
validateSyntax: {
|
|
403
|
-
type: string;
|
|
404
|
-
description: string;
|
|
405
|
-
default: boolean;
|
|
406
|
-
};
|
|
407
|
-
pullFirst: {
|
|
408
|
-
type: string;
|
|
409
|
-
description: string;
|
|
410
|
-
default: boolean;
|
|
411
|
-
};
|
|
412
|
-
resolveConflicts: {
|
|
413
|
-
type: string;
|
|
414
|
-
enum: string[];
|
|
415
|
-
description: string;
|
|
416
|
-
default: string;
|
|
417
|
-
};
|
|
418
|
-
includeUntracked: {
|
|
419
|
-
type: string;
|
|
420
|
-
description: string;
|
|
421
|
-
default: boolean;
|
|
422
|
-
};
|
|
423
281
|
};
|
|
424
282
|
required: string[];
|
|
425
283
|
};
|
|
@@ -452,19 +310,6 @@ export declare const gitUpdateProjectTool: {
|
|
|
452
310
|
action: "sync";
|
|
453
311
|
}): Promise<GitUpdateProjectResult>;
|
|
454
312
|
groupFilesByType(projectPath: string): Promise<Record<string, string[]>>;
|
|
455
|
-
handleDailyWorkflow(params: GitUpdateProjectInput & {
|
|
456
|
-
action: "daily-workflow";
|
|
457
|
-
}): Promise<GitUpdateProjectResult>;
|
|
458
|
-
handleSmartCommit(params: GitUpdateProjectInput & {
|
|
459
|
-
action: "smart-commit";
|
|
460
|
-
}): Promise<GitUpdateProjectResult>;
|
|
461
|
-
handleFullSync(params: GitUpdateProjectInput & {
|
|
462
|
-
action: "full-sync";
|
|
463
|
-
}): Promise<GitUpdateProjectResult>;
|
|
464
|
-
handleAutoBackup(params: GitUpdateProjectInput & {
|
|
465
|
-
action: "auto-backup";
|
|
466
|
-
}): Promise<GitUpdateProjectResult>;
|
|
467
|
-
generateSmartCommitMessage(fileGroups: Record<string, string[]>): string;
|
|
468
313
|
};
|
|
469
314
|
export {};
|
|
470
315
|
//# sourceMappingURL=git-update-project.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"git-update-project.d.ts","sourceRoot":"","sources":["../../src/tools/git-update-project.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,QAAA,MAAM,2BAA2B
|
|
1
|
+
{"version":3,"file":"git-update-project.d.ts","sourceRoot":"","sources":["../../src/tools/git-update-project.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,QAAA,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAmF/B,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEhF,QAAA,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;EAMhC,CAAC;AAEH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAElF,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAmCV,qBAAqB,GAAG,OAAO,CAAC,sBAAsB,CAAC;yBAqCjD,qBAAqB,GAAG;QAAE,MAAM,EAAE,QAAQ,CAAA;KAAE,GAAG,OAAO,CAAC,sBAAsB,CAAC;uBAyLhF,qBAAqB,GAAG;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,sBAAsB,CAAC;yBAuJ1E,qBAAqB,GAAG;QAAE,MAAM,EAAE,QAAQ,CAAA;KAAE,GAAG,OAAO,CAAC,sBAAsB,CAAC;uBAmDhF,qBAAqB,GAAG;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,sBAAsB,CAAC;sBAiD7E,qBAAqB,GAAG;QAAE,MAAM,EAAE,KAAK,CAAA;KAAE,GAAG,OAAO,CAAC,sBAAsB,CAAC;wBAkDzE,qBAAqB,GAAG;QAAE,MAAM,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO,CAAC,sBAAsB,CAAC;wBA2C7E,qBAAqB,GAAG;QAAE,MAAM,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO,CAAC,sBAAsB,CAAC;uBA+D9E,qBAAqB,GAAG;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,sBAAsB,CAAC;uBAwC5E,qBAAqB,GAAG;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,sBAAsB,CAAC;kCAkGjE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;CAwC/E,CAAC"}
|
|
@@ -79,43 +79,6 @@ const GitUpdateProjectInputSchema = zod_1.z.discriminatedUnion('action', [
|
|
|
79
79
|
message: zod_1.z.string().min(1, 'Commit message is required'),
|
|
80
80
|
branch: zod_1.z.string().optional(),
|
|
81
81
|
forcePush: zod_1.z.boolean().optional()
|
|
82
|
-
}),
|
|
83
|
-
// NEW: Action: daily-workflow - workflow diário completo automatizado
|
|
84
|
-
zod_1.z.object({
|
|
85
|
-
action: zod_1.z.literal('daily-workflow'),
|
|
86
|
-
projectPath: zod_1.z.string(),
|
|
87
|
-
autoMessage: zod_1.z.boolean().optional().default(true),
|
|
88
|
-
autoPush: zod_1.z.boolean().optional().default(true),
|
|
89
|
-
createBackup: zod_1.z.boolean().optional().default(true),
|
|
90
|
-
granularCommits: zod_1.z.boolean().optional().default(false)
|
|
91
|
-
}),
|
|
92
|
-
// NEW: Action: smart-commit - commit inteligente com auto-detecção
|
|
93
|
-
zod_1.z.object({
|
|
94
|
-
action: zod_1.z.literal('smart-commit'),
|
|
95
|
-
projectPath: zod_1.z.string(),
|
|
96
|
-
detectChanges: zod_1.z.boolean().optional().default(true),
|
|
97
|
-
autoCategorize: zod_1.z.boolean().optional().default(true),
|
|
98
|
-
suggestedMessage: zod_1.z.string().optional(),
|
|
99
|
-
validateSyntax: zod_1.z.boolean().optional().default(true),
|
|
100
|
-
autoPush: zod_1.z.boolean().optional().default(true)
|
|
101
|
-
}),
|
|
102
|
-
// NEW: Action: full-sync - sincronização completa com resolução automática
|
|
103
|
-
zod_1.z.object({
|
|
104
|
-
action: zod_1.z.literal('full-sync'),
|
|
105
|
-
repo: zod_1.z.string(),
|
|
106
|
-
projectPath: zod_1.z.string(),
|
|
107
|
-
provider: zod_1.z.enum(['gitea', 'github']),
|
|
108
|
-
pullFirst: zod_1.z.boolean().optional().default(true),
|
|
109
|
-
resolveConflicts: zod_1.z.enum(['auto', 'manual', 'skip']).optional().default('auto'),
|
|
110
|
-
forcePush: zod_1.z.boolean().optional().default(false),
|
|
111
|
-
createBackup: zod_1.z.boolean().optional().default(true)
|
|
112
|
-
}),
|
|
113
|
-
// NEW: Action: auto-backup - backup automático do estado atual
|
|
114
|
-
zod_1.z.object({
|
|
115
|
-
action: zod_1.z.literal('auto-backup'),
|
|
116
|
-
projectPath: zod_1.z.string(),
|
|
117
|
-
message: zod_1.z.string().optional(),
|
|
118
|
-
includeUntracked: zod_1.z.boolean().optional().default(true)
|
|
119
82
|
})
|
|
120
83
|
]);
|
|
121
84
|
const GitUpdateProjectResultSchema = zod_1.z.object({
|
|
@@ -127,20 +90,20 @@ const GitUpdateProjectResultSchema = zod_1.z.object({
|
|
|
127
90
|
});
|
|
128
91
|
exports.gitUpdateProjectTool = {
|
|
129
92
|
name: 'git-update-project',
|
|
130
|
-
description: 'tool:
|
|
93
|
+
description: 'tool: Gerenciamento COMPLETO de projetos Git (local + remoto)\\n──────────────\\n9 ACTIONS DISPONÍVEIS:\\n• init: UPLOAD INICIAL completo (substitui upload-project)\\n• update: Commit incremental automático\\n• status: Verificar status do repositório\\n• diff: Mostrar diferenças entre versões\\n• log: Histórico de commits\\n• reset: Desfazer mudanças\\n• stash: Gerenciar mudanças temporárias\\n• pull: Atualizar do repositório remoto\\n• sync: Sincronização completa (pull+commit+push)\\n───────────────\\nCOMMITS REAIS + RASTREABILIDADE TOTAL\\nFunciona com GitHub, Gitea e qualquer repositório Git',
|
|
131
94
|
inputSchema: {
|
|
132
95
|
type: 'object',
|
|
133
96
|
properties: {
|
|
134
97
|
action: {
|
|
135
98
|
type: 'string',
|
|
136
|
-
enum: ['init', 'update', 'status', 'diff', 'log', 'reset', 'stash', 'pull', 'sync'
|
|
137
|
-
description: 'Action to perform
|
|
99
|
+
enum: ['init', 'update', 'status', 'diff', 'log', 'reset', 'stash', 'pull', 'sync'],
|
|
100
|
+
description: 'Action to perform'
|
|
138
101
|
},
|
|
139
102
|
// Parâmetros comuns
|
|
140
|
-
repo: { type: 'string', description: 'Repository name (required for init/update/sync
|
|
103
|
+
repo: { type: 'string', description: 'Repository name (required for init/update/sync)' },
|
|
141
104
|
projectPath: { type: 'string', description: 'Local project path (OBRIGATÓRIO para TODAS as operações)' },
|
|
142
|
-
provider: { type: 'string', enum: ['gitea', 'github'], description: 'Provider (required for init/update/sync
|
|
143
|
-
// Parâmetros específicos
|
|
105
|
+
provider: { type: 'string', enum: ['gitea', 'github'], description: 'Provider (required for init/update/sync)' },
|
|
106
|
+
// Parâmetros específicos
|
|
144
107
|
message: { type: 'string', description: 'Commit message (required for init/update/sync)' },
|
|
145
108
|
branch: { type: 'string', description: 'Branch name', default: 'main' },
|
|
146
109
|
forcePush: { type: 'boolean', description: 'Force push', default: false },
|
|
@@ -153,19 +116,7 @@ exports.gitUpdateProjectTool = {
|
|
|
153
116
|
maxCount: { type: 'number', description: 'Max commits for log', default: 10 },
|
|
154
117
|
oneline: { type: 'boolean', description: 'One line format for log', default: true },
|
|
155
118
|
mode: { type: 'string', enum: ['soft', 'mixed', 'hard'], description: 'Reset mode', default: 'mixed' },
|
|
156
|
-
operation: { type: 'string', enum: ['save', 'pop', 'apply', 'list', 'drop', 'clear'], description: 'Stash operation', default: 'save' }
|
|
157
|
-
// Parâmetros específicos - New AI-First Actions
|
|
158
|
-
autoMessage: { type: 'boolean', description: 'Auto-generate commit message based on changes', default: true },
|
|
159
|
-
autoPush: { type: 'boolean', description: 'Auto-push after commit', default: true },
|
|
160
|
-
createBackup: { type: 'boolean', description: 'Create backup before operations', default: true },
|
|
161
|
-
granularCommits: { type: 'boolean', description: 'Create separate commits by file type', default: false },
|
|
162
|
-
detectChanges: { type: 'boolean', description: 'Detect and categorize changes automatically', default: true },
|
|
163
|
-
autoCategorize: { type: 'boolean', description: 'Auto-categorize commits (feat/fix/docs)', default: true },
|
|
164
|
-
suggestedMessage: { type: 'string', description: 'Suggested commit message (optional)' },
|
|
165
|
-
validateSyntax: { type: 'boolean', description: 'Validate syntax before committing', default: true },
|
|
166
|
-
pullFirst: { type: 'boolean', description: 'Pull latest changes before sync', default: true },
|
|
167
|
-
resolveConflicts: { type: 'string', enum: ['auto', 'manual', 'skip'], description: 'Conflict resolution strategy', default: 'auto' },
|
|
168
|
-
includeUntracked: { type: 'boolean', description: 'Include untracked files in backup', default: true }
|
|
119
|
+
operation: { type: 'string', enum: ['save', 'pop', 'apply', 'list', 'drop', 'clear'], description: 'Stash operation', default: 'save' }
|
|
169
120
|
},
|
|
170
121
|
required: ['action', 'projectPath']
|
|
171
122
|
},
|
|
@@ -192,14 +143,6 @@ exports.gitUpdateProjectTool = {
|
|
|
192
143
|
return await this.handlePull(validatedInput);
|
|
193
144
|
case 'sync':
|
|
194
145
|
return await this.handleSync(validatedInput);
|
|
195
|
-
case 'daily-workflow':
|
|
196
|
-
return await this.handleDailyWorkflow(validatedInput);
|
|
197
|
-
case 'smart-commit':
|
|
198
|
-
return await this.handleSmartCommit(validatedInput);
|
|
199
|
-
case 'full-sync':
|
|
200
|
-
return await this.handleFullSync(validatedInput);
|
|
201
|
-
case 'auto-backup':
|
|
202
|
-
return await this.handleAutoBackup(validatedInput);
|
|
203
146
|
default:
|
|
204
147
|
throw new Error(`Action '${validatedInput.action}' não suportada`);
|
|
205
148
|
}
|
|
@@ -925,291 +868,6 @@ exports.gitUpdateProjectTool = {
|
|
|
925
868
|
}
|
|
926
869
|
}
|
|
927
870
|
return fileGroups;
|
|
928
|
-
},
|
|
929
|
-
// NEW: Handle daily-workflow - Workflow diário completo automatizado
|
|
930
|
-
async handleDailyWorkflow(params) {
|
|
931
|
-
try {
|
|
932
|
-
const { projectPath, autoMessage = true, autoPush = true, createBackup = true, granularCommits = false } = params;
|
|
933
|
-
const gitOps = new git_operations_js_1.GitOperations(projectPath);
|
|
934
|
-
// 1. Verificar se é repositório Git
|
|
935
|
-
const isGitRepo = await gitOps.isGitRepository();
|
|
936
|
-
if (!isGitRepo) {
|
|
937
|
-
throw new Error(`Diretório '${projectPath}' não é um repositório Git válido`);
|
|
938
|
-
}
|
|
939
|
-
// 2. Backup se solicitado
|
|
940
|
-
let backupResult = null;
|
|
941
|
-
if (createBackup) {
|
|
942
|
-
backupResult = await this.handleAutoBackup({ action: 'auto-backup', projectPath, includeUntracked: true });
|
|
943
|
-
}
|
|
944
|
-
// 3. Verificar status
|
|
945
|
-
const statusResult = await gitOps.status({ porcelain: true });
|
|
946
|
-
const hasChanges = statusResult.success && statusResult.output.trim().length > 0;
|
|
947
|
-
if (!hasChanges) {
|
|
948
|
-
return {
|
|
949
|
-
success: true,
|
|
950
|
-
action: 'daily-workflow',
|
|
951
|
-
message: 'Nenhuma mudança detectada - workflow diário concluído',
|
|
952
|
-
data: {
|
|
953
|
-
backup: backupResult?.success,
|
|
954
|
-
changesDetected: false,
|
|
955
|
-
implementation: 'AI_WORKFLOW_v2.39.0'
|
|
956
|
-
}
|
|
957
|
-
};
|
|
958
|
-
}
|
|
959
|
-
// 4. Add files
|
|
960
|
-
const addResult = await gitOps.addFiles(['.']);
|
|
961
|
-
if (!addResult.success) {
|
|
962
|
-
throw new Error(`Falha ao adicionar arquivos: ${addResult.error}`);
|
|
963
|
-
}
|
|
964
|
-
// 5. Commit inteligente
|
|
965
|
-
let commitMessage = 'Daily update';
|
|
966
|
-
if (autoMessage) {
|
|
967
|
-
const fileGroups = await this.groupFilesByType(projectPath);
|
|
968
|
-
const totalFiles = Object.values(fileGroups).flat().length;
|
|
969
|
-
if (granularCommits && totalFiles > 1) {
|
|
970
|
-
// Commits granulares por tipo
|
|
971
|
-
const results = [];
|
|
972
|
-
for (const [type, files] of Object.entries(fileGroups)) {
|
|
973
|
-
if (files.length === 0)
|
|
974
|
-
continue;
|
|
975
|
-
const typeCommit = await gitOps.commit(`${type}: ${files.length} files updated`);
|
|
976
|
-
results.push({ type, files: files.length, success: typeCommit.success });
|
|
977
|
-
}
|
|
978
|
-
if (autoPush) {
|
|
979
|
-
const pushResult = await gitOps.push('origin', 'main');
|
|
980
|
-
return {
|
|
981
|
-
success: results.every(r => r.success) && pushResult.success,
|
|
982
|
-
action: 'daily-workflow',
|
|
983
|
-
message: `Daily workflow concluído com ${results.length} commits granulares`,
|
|
984
|
-
data: {
|
|
985
|
-
granularCommits: results,
|
|
986
|
-
push: pushResult.success,
|
|
987
|
-
backup: backupResult?.success,
|
|
988
|
-
implementation: 'AI_WORKFLOW_v2.39.0'
|
|
989
|
-
}
|
|
990
|
-
};
|
|
991
|
-
}
|
|
992
|
-
return {
|
|
993
|
-
success: results.every(r => r.success),
|
|
994
|
-
action: 'daily-workflow',
|
|
995
|
-
message: `Daily workflow concluído com ${results.length} commits granulares`,
|
|
996
|
-
data: {
|
|
997
|
-
granularCommits: results,
|
|
998
|
-
backup: backupResult?.success,
|
|
999
|
-
implementation: 'AI_WORKFLOW_v2.39.0'
|
|
1000
|
-
}
|
|
1001
|
-
};
|
|
1002
|
-
}
|
|
1003
|
-
else {
|
|
1004
|
-
// Single commit
|
|
1005
|
-
commitMessage = this.generateSmartCommitMessage(fileGroups);
|
|
1006
|
-
}
|
|
1007
|
-
}
|
|
1008
|
-
const commitResult = await gitOps.commit(commitMessage);
|
|
1009
|
-
// 6. Push se solicitado
|
|
1010
|
-
let pushResult = null;
|
|
1011
|
-
if (autoPush === true && commitResult.success) {
|
|
1012
|
-
pushResult = await gitOps.push('origin', 'main');
|
|
1013
|
-
}
|
|
1014
|
-
return {
|
|
1015
|
-
success: commitResult.success && (autoPush !== true || (pushResult?.success === true)),
|
|
1016
|
-
action: 'daily-workflow',
|
|
1017
|
-
message: `Daily workflow ${commitResult.success ? 'concluído' : 'com problemas'}`,
|
|
1018
|
-
data: {
|
|
1019
|
-
backup: backupResult?.success,
|
|
1020
|
-
commit: commitResult.success,
|
|
1021
|
-
push: pushResult?.success,
|
|
1022
|
-
message: commitMessage,
|
|
1023
|
-
implementation: 'AI_WORKFLOW_v2.39.0'
|
|
1024
|
-
}
|
|
1025
|
-
};
|
|
1026
|
-
}
|
|
1027
|
-
catch (error) {
|
|
1028
|
-
return {
|
|
1029
|
-
success: false,
|
|
1030
|
-
action: 'daily-workflow',
|
|
1031
|
-
message: 'Erro no workflow diário',
|
|
1032
|
-
error: error instanceof Error ? error.message : String(error)
|
|
1033
|
-
};
|
|
1034
|
-
}
|
|
1035
|
-
},
|
|
1036
|
-
// NEW: Handle smart-commit - Commit inteligente com auto-detecção
|
|
1037
|
-
async handleSmartCommit(params) {
|
|
1038
|
-
try {
|
|
1039
|
-
const { projectPath, detectChanges = true, autoCategorize = true, suggestedMessage, validateSyntax = true, autoPush = true } = params;
|
|
1040
|
-
const gitOps = new git_operations_js_1.GitOperations(projectPath);
|
|
1041
|
-
// 1. Verificar repositório
|
|
1042
|
-
const isGitRepo = await gitOps.isGitRepository();
|
|
1043
|
-
if (!isGitRepo) {
|
|
1044
|
-
throw new Error(`Diretório '${projectPath}' não é um repositório Git válido`);
|
|
1045
|
-
}
|
|
1046
|
-
// 2. Verificar mudanças
|
|
1047
|
-
const statusResult = await gitOps.status({ porcelain: true });
|
|
1048
|
-
if (!statusResult.success || !statusResult.output.trim()) {
|
|
1049
|
-
return {
|
|
1050
|
-
success: true,
|
|
1051
|
-
action: 'smart-commit',
|
|
1052
|
-
message: 'Nenhuma mudança detectada para commit',
|
|
1053
|
-
data: {
|
|
1054
|
-
changesDetected: false,
|
|
1055
|
-
implementation: 'SMART_COMMIT_v2.39.0'
|
|
1056
|
-
}
|
|
1057
|
-
};
|
|
1058
|
-
}
|
|
1059
|
-
// 3. Add files
|
|
1060
|
-
const addResult = await gitOps.addFiles(['.']);
|
|
1061
|
-
if (!addResult.success) {
|
|
1062
|
-
throw new Error(`Falha ao adicionar arquivos: ${addResult.error}`);
|
|
1063
|
-
}
|
|
1064
|
-
// 4. Gerar mensagem inteligente
|
|
1065
|
-
let commitMessage = suggestedMessage || 'Smart commit';
|
|
1066
|
-
if (detectChanges && autoCategorize) {
|
|
1067
|
-
const fileGroups = await this.groupFilesByType(projectPath);
|
|
1068
|
-
commitMessage = this.generateSmartCommitMessage(fileGroups);
|
|
1069
|
-
}
|
|
1070
|
-
// 5. Commit
|
|
1071
|
-
const commitResult = await gitOps.commit(commitMessage);
|
|
1072
|
-
// 6. Push se solicitado
|
|
1073
|
-
let pushResult = null;
|
|
1074
|
-
if (autoPush === true && commitResult.success) {
|
|
1075
|
-
pushResult = await gitOps.push('origin', 'main');
|
|
1076
|
-
}
|
|
1077
|
-
return {
|
|
1078
|
-
success: commitResult.success && (autoPush !== true || (pushResult?.success === true)),
|
|
1079
|
-
action: 'smart-commit',
|
|
1080
|
-
message: `Smart commit ${commitResult.success ? 'concluído' : 'com problemas'}`,
|
|
1081
|
-
data: {
|
|
1082
|
-
message: commitMessage,
|
|
1083
|
-
commit: commitResult.success,
|
|
1084
|
-
push: pushResult?.success,
|
|
1085
|
-
implementation: 'SMART_COMMIT_v2.39.0'
|
|
1086
|
-
}
|
|
1087
|
-
};
|
|
1088
|
-
}
|
|
1089
|
-
catch (error) {
|
|
1090
|
-
return {
|
|
1091
|
-
success: false,
|
|
1092
|
-
action: 'smart-commit',
|
|
1093
|
-
message: 'Erro no smart commit',
|
|
1094
|
-
error: error instanceof Error ? error.message : String(error)
|
|
1095
|
-
};
|
|
1096
|
-
}
|
|
1097
|
-
},
|
|
1098
|
-
// NEW: Handle full-sync - Sincronização completa com resolução automática
|
|
1099
|
-
async handleFullSync(params) {
|
|
1100
|
-
try {
|
|
1101
|
-
const { repo, projectPath, provider: providerName, pullFirst = true, resolveConflicts = 'auto', forcePush = false, createBackup = true } = params;
|
|
1102
|
-
const gitOps = new git_operations_js_1.GitOperations(projectPath);
|
|
1103
|
-
// 1. Backup se solicitado
|
|
1104
|
-
let backupResult = null;
|
|
1105
|
-
if (createBackup) {
|
|
1106
|
-
backupResult = await this.handleAutoBackup({ action: 'auto-backup', projectPath, includeUntracked: true });
|
|
1107
|
-
}
|
|
1108
|
-
// 2. Pull primeiro se solicitado
|
|
1109
|
-
let pullResult = null;
|
|
1110
|
-
if (pullFirst) {
|
|
1111
|
-
pullResult = await gitOps.pull('origin', 'main');
|
|
1112
|
-
}
|
|
1113
|
-
// 3. Verificar status após pull
|
|
1114
|
-
const statusResult = await gitOps.status({ porcelain: true });
|
|
1115
|
-
const hasChanges = statusResult.success && statusResult.output.trim().length > 0;
|
|
1116
|
-
// 4. Add e commit se houver mudanças
|
|
1117
|
-
let commitResult = null;
|
|
1118
|
-
let pushResult = null;
|
|
1119
|
-
if (hasChanges) {
|
|
1120
|
-
const addResult = await gitOps.addFiles(['.']);
|
|
1121
|
-
if (addResult.success) {
|
|
1122
|
-
const fileGroups = await this.groupFilesByType(projectPath);
|
|
1123
|
-
const message = this.generateSmartCommitMessage(fileGroups);
|
|
1124
|
-
commitResult = await gitOps.commit(message);
|
|
1125
|
-
if (commitResult.success) {
|
|
1126
|
-
pushResult = await gitOps.push('origin', 'main', forcePush ? { force: true } : {});
|
|
1127
|
-
}
|
|
1128
|
-
}
|
|
1129
|
-
}
|
|
1130
|
-
return {
|
|
1131
|
-
success: (pullFirst !== true || (pullResult?.success === true)) && (!hasChanges || (commitResult?.success === true && pushResult?.success === true)),
|
|
1132
|
-
action: 'full-sync',
|
|
1133
|
-
message: `Full sync ${pullResult?.success && (!hasChanges || (commitResult?.success && pushResult?.success)) ? 'concluído' : 'com problemas'}`,
|
|
1134
|
-
data: {
|
|
1135
|
-
repo,
|
|
1136
|
-
provider: providerName,
|
|
1137
|
-
backup: backupResult?.success,
|
|
1138
|
-
pull: pullResult?.success,
|
|
1139
|
-
commit: commitResult?.success,
|
|
1140
|
-
push: pushResult?.success,
|
|
1141
|
-
hasChanges,
|
|
1142
|
-
implementation: 'FULL_SYNC_v2.39.0'
|
|
1143
|
-
}
|
|
1144
|
-
};
|
|
1145
|
-
}
|
|
1146
|
-
catch (error) {
|
|
1147
|
-
return {
|
|
1148
|
-
success: false,
|
|
1149
|
-
action: 'full-sync',
|
|
1150
|
-
message: 'Erro no full sync',
|
|
1151
|
-
error: error instanceof Error ? error.message : String(error)
|
|
1152
|
-
};
|
|
1153
|
-
}
|
|
1154
|
-
},
|
|
1155
|
-
// NEW: Handle auto-backup - Backup automático do estado atual
|
|
1156
|
-
async handleAutoBackup(params) {
|
|
1157
|
-
try {
|
|
1158
|
-
const { projectPath, message = 'Auto backup', includeUntracked = true } = params;
|
|
1159
|
-
const gitOps = new git_operations_js_1.GitOperations(projectPath);
|
|
1160
|
-
// Verificar se é repositório Git
|
|
1161
|
-
const isGitRepo = await gitOps.isGitRepository();
|
|
1162
|
-
if (!isGitRepo) {
|
|
1163
|
-
throw new Error(`Diretório '${projectPath}' não é um repositório Git válido`);
|
|
1164
|
-
}
|
|
1165
|
-
// Criar stash com timestamp
|
|
1166
|
-
const timestamp = new Date().toISOString().replace(/[:.]/g, '-');
|
|
1167
|
-
const stashMessage = `${message} - ${timestamp}`;
|
|
1168
|
-
const stashResult = await gitOps.stash('push', {
|
|
1169
|
-
message: stashMessage,
|
|
1170
|
-
includeUntracked
|
|
1171
|
-
});
|
|
1172
|
-
return {
|
|
1173
|
-
success: stashResult.success,
|
|
1174
|
-
action: 'auto-backup',
|
|
1175
|
-
message: `Backup ${stashResult.success ? 'criado' : 'com problemas'}`,
|
|
1176
|
-
data: {
|
|
1177
|
-
stashMessage,
|
|
1178
|
-
includeUntracked,
|
|
1179
|
-
timestamp,
|
|
1180
|
-
implementation: 'AUTO_BACKUP_v2.39.0'
|
|
1181
|
-
}
|
|
1182
|
-
};
|
|
1183
|
-
}
|
|
1184
|
-
catch (error) {
|
|
1185
|
-
return {
|
|
1186
|
-
success: false,
|
|
1187
|
-
action: 'auto-backup',
|
|
1188
|
-
message: 'Erro no auto backup',
|
|
1189
|
-
error: error instanceof Error ? error.message : String(error)
|
|
1190
|
-
};
|
|
1191
|
-
}
|
|
1192
|
-
},
|
|
1193
|
-
// Helper: Generate smart commit message based on file groups
|
|
1194
|
-
generateSmartCommitMessage(fileGroups) {
|
|
1195
|
-
const totalFiles = Object.values(fileGroups).flat().length;
|
|
1196
|
-
const groups = Object.entries(fileGroups).filter(([, files]) => files.length > 0);
|
|
1197
|
-
if (groups.length === 1) {
|
|
1198
|
-
const [type, files] = groups[0];
|
|
1199
|
-
return `${type}: ${files.length} files updated`;
|
|
1200
|
-
}
|
|
1201
|
-
let message = '';
|
|
1202
|
-
if (fileGroups.source.length > 0)
|
|
1203
|
-
message += `feat: ${fileGroups.source.length} source files`;
|
|
1204
|
-
if (fileGroups.documentation.length > 0)
|
|
1205
|
-
message += `${message ? ', ' : ''}${fileGroups.documentation.length} docs`;
|
|
1206
|
-
if (fileGroups.config.length > 0)
|
|
1207
|
-
message += `${message ? ', ' : ''}${fileGroups.config.length} config`;
|
|
1208
|
-
if (fileGroups.assets.length > 0)
|
|
1209
|
-
message += `${message ? ', ' : ''}${fileGroups.assets.length} assets`;
|
|
1210
|
-
if (fileGroups.other.length > 0)
|
|
1211
|
-
message += `${message ? ', ' : ''}${fileGroups.other.length} other`;
|
|
1212
|
-
return message || `update: ${totalFiles} files`;
|
|
1213
871
|
}
|
|
1214
872
|
};
|
|
1215
873
|
//# sourceMappingURL=git-update-project.js.map
|