@andrebuzeli/git-mcp 4.0.20 → 4.0.21
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/dist/config.d.ts +7 -239
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +2 -221
- package/dist/config.js.map +1 -1
- package/dist/index.d.ts +11 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +18 -16
- package/dist/index.js.map +1 -1
- package/dist/server.d.ts +1 -69
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +150 -711
- package/dist/server.js.map +1 -1
- package/dist/tools/git-analytics.d.ts +1 -0
- package/dist/tools/git-analytics.d.ts.map +1 -1
- package/dist/tools/git-analytics.js +18 -7
- package/dist/tools/git-analytics.js.map +1 -1
- package/dist/tools/git-archive.d.ts +2 -149
- package/dist/tools/git-archive.d.ts.map +1 -1
- package/dist/tools/git-archive.js +5 -222
- package/dist/tools/git-archive.js.map +1 -1
- package/dist/tools/git-backup.d.ts +1 -198
- package/dist/tools/git-backup.d.ts.map +1 -1
- package/dist/tools/git-backup.js +4 -805
- package/dist/tools/git-backup.js.map +1 -1
- package/dist/tools/git-branches.d.ts +1 -158
- package/dist/tools/git-branches.d.ts.map +1 -1
- package/dist/tools/git-branches.js +4 -539
- package/dist/tools/git-branches.js.map +1 -1
- package/dist/tools/git-config.d.ts +2 -124
- package/dist/tools/git-config.d.ts.map +1 -1
- package/dist/tools/git-config.js +5 -263
- package/dist/tools/git-config.js.map +1 -1
- package/dist/tools/git-files.d.ts +2 -115
- package/dist/tools/git-files.d.ts.map +1 -1
- package/dist/tools/git-files.js +161 -407
- package/dist/tools/git-files.js.map +1 -1
- package/dist/tools/git-issues.d.ts +1 -214
- package/dist/tools/git-issues.d.ts.map +1 -1
- package/dist/tools/git-issues.js +4 -678
- package/dist/tools/git-issues.js.map +1 -1
- package/dist/tools/git-monitor.d.ts +1 -143
- package/dist/tools/git-monitor.d.ts.map +1 -1
- package/dist/tools/git-monitor.js +4 -738
- package/dist/tools/git-monitor.js.map +1 -1
- package/dist/tools/git-packages.d.ts +2 -91
- package/dist/tools/git-packages.d.ts.map +1 -1
- package/dist/tools/git-packages.js +5 -258
- package/dist/tools/git-packages.js.map +1 -1
- package/dist/tools/git-pulls.d.ts +1 -63
- package/dist/tools/git-pulls.d.ts.map +1 -1
- package/dist/tools/git-pulls.js +4 -77
- package/dist/tools/git-pulls.js.map +1 -1
- package/dist/tools/git-release.d.ts +1 -169
- package/dist/tools/git-release.d.ts.map +1 -1
- package/dist/tools/git-release.js +4 -611
- package/dist/tools/git-release.js.map +1 -1
- package/dist/tools/git-remote.d.ts +1 -153
- package/dist/tools/git-remote.d.ts.map +1 -1
- package/dist/tools/git-remote.js +4 -555
- package/dist/tools/git-remote.js.map +1 -1
- package/dist/tools/git-reset.d.ts +1 -157
- package/dist/tools/git-reset.d.ts.map +1 -1
- package/dist/tools/git-reset.js +4 -597
- package/dist/tools/git-reset.js.map +1 -1
- package/dist/tools/git-stash.d.ts +1 -161
- package/dist/tools/git-stash.d.ts.map +1 -1
- package/dist/tools/git-stash.js +4 -640
- package/dist/tools/git-stash.js.map +1 -1
- package/dist/tools/git-sync.d.ts +1 -0
- package/dist/tools/git-sync.d.ts.map +1 -1
- package/dist/tools/git-sync.js +13 -7
- package/dist/tools/git-sync.js.map +1 -1
- package/dist/tools/git-tags.d.ts +1 -162
- package/dist/tools/git-tags.d.ts.map +1 -1
- package/dist/tools/git-tags.js +4 -549
- package/dist/tools/git-tags.js.map +1 -1
- package/dist/tools/git-workflow.d.ts +3 -96
- package/dist/tools/git-workflow.d.ts.map +1 -1
- package/dist/tools/git-workflow.js +287 -314
- package/dist/tools/git-workflow.js.map +1 -1
- package/package.json +3 -3
- package/dist/server-minimal.d.ts +0 -8
- package/dist/server-minimal.d.ts.map +0 -1
- package/dist/server-minimal.js +0 -218
- package/dist/server-minimal.js.map +0 -1
|
@@ -1,82 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
/**
|
|
3
|
-
* Tool: git-config
|
|
4
|
-
*
|
|
5
|
-
* DESCRIÇÃO:
|
|
6
|
-
* Gerenciamento de configuração Git (GitHub + Gitea) com múltiplas ações
|
|
7
|
-
*
|
|
8
|
-
* FUNCIONALIDADES:
|
|
9
|
-
* - Obter configurações
|
|
10
|
-
* - Definir configurações
|
|
11
|
-
* - Remover configurações
|
|
12
|
-
* - Listar configurações
|
|
13
|
-
* - Editar configuração
|
|
14
|
-
* - Mostrar configurações
|
|
15
|
-
*
|
|
16
|
-
* USO:
|
|
17
|
-
* - Para configurar usuário e email
|
|
18
|
-
* - Para configurar aliases
|
|
19
|
-
* - Para configurar branches padrão
|
|
20
|
-
* - Para configurar merge tools
|
|
21
|
-
* - Para configurar credenciais
|
|
22
|
-
*
|
|
23
|
-
* RECOMENDAÇÕES:
|
|
24
|
-
* - Use configurações globais para usuário
|
|
25
|
-
* - Use configurações locais para projeto
|
|
26
|
-
* - Documente configurações customizadas
|
|
27
|
-
*/
|
|
28
|
-
declare const GitConfigInputSchema: z.ZodObject<{
|
|
29
|
-
action: z.ZodEnum<["get", "set", "unset", "list", "edit", "show"]>;
|
|
30
|
-
repo: z.ZodString;
|
|
31
|
-
provider: z.ZodEnum<["gitea", "github"]>;
|
|
32
|
-
projectPath: z.ZodString;
|
|
33
|
-
key: z.ZodOptional<z.ZodString>;
|
|
34
|
-
value: z.ZodOptional<z.ZodString>;
|
|
35
|
-
scope: z.ZodOptional<z.ZodEnum<["local", "global", "system"]>>;
|
|
36
|
-
pattern: z.ZodOptional<z.ZodString>;
|
|
37
|
-
show_origin: z.ZodOptional<z.ZodBoolean>;
|
|
38
|
-
}, "strip", z.ZodTypeAny, {
|
|
39
|
-
provider: "gitea" | "github";
|
|
40
|
-
repo: string;
|
|
41
|
-
action: "set" | "get" | "list" | "show" | "unset" | "edit";
|
|
42
|
-
projectPath: string;
|
|
43
|
-
value?: string | undefined;
|
|
44
|
-
pattern?: string | undefined;
|
|
45
|
-
key?: string | undefined;
|
|
46
|
-
scope?: "local" | "global" | "system" | undefined;
|
|
47
|
-
show_origin?: boolean | undefined;
|
|
48
|
-
}, {
|
|
49
|
-
provider: "gitea" | "github";
|
|
50
|
-
repo: string;
|
|
51
|
-
action: "set" | "get" | "list" | "show" | "unset" | "edit";
|
|
52
|
-
projectPath: string;
|
|
53
|
-
value?: string | undefined;
|
|
54
|
-
pattern?: string | undefined;
|
|
55
|
-
key?: string | undefined;
|
|
56
|
-
scope?: "local" | "global" | "system" | undefined;
|
|
57
|
-
show_origin?: boolean | undefined;
|
|
58
|
-
}>;
|
|
59
|
-
export type GitConfigInput = z.infer<typeof GitConfigInputSchema>;
|
|
60
|
-
declare const GitConfigResultSchema: z.ZodObject<{
|
|
61
|
-
success: z.ZodBoolean;
|
|
62
|
-
action: z.ZodString;
|
|
63
|
-
message: z.ZodString;
|
|
64
|
-
data: z.ZodOptional<z.ZodAny>;
|
|
65
|
-
error: z.ZodOptional<z.ZodString>;
|
|
66
|
-
}, "strip", z.ZodTypeAny, {
|
|
67
|
-
message: string;
|
|
68
|
-
action: string;
|
|
69
|
-
success: boolean;
|
|
70
|
-
error?: string | undefined;
|
|
71
|
-
data?: any;
|
|
72
|
-
}, {
|
|
73
|
-
message: string;
|
|
74
|
-
action: string;
|
|
75
|
-
success: boolean;
|
|
76
|
-
error?: string | undefined;
|
|
77
|
-
data?: any;
|
|
78
|
-
}>;
|
|
79
|
-
export type GitConfigResult = z.infer<typeof GitConfigResultSchema>;
|
|
1
|
+
import { UniversalResponse } from '../utils/auto-detection.js';
|
|
80
2
|
export declare const gitConfigTool: {
|
|
81
3
|
name: string;
|
|
82
4
|
description: string;
|
|
@@ -85,57 +7,13 @@ export declare const gitConfigTool: {
|
|
|
85
7
|
properties: {
|
|
86
8
|
action: {
|
|
87
9
|
type: string;
|
|
88
|
-
enum: string[];
|
|
89
|
-
description: string;
|
|
90
|
-
};
|
|
91
|
-
owner: {
|
|
92
|
-
type: string;
|
|
93
|
-
description: string;
|
|
94
|
-
};
|
|
95
|
-
repo: {
|
|
96
|
-
type: string;
|
|
97
|
-
description: string;
|
|
98
|
-
};
|
|
99
|
-
provider: {
|
|
100
|
-
type: string;
|
|
101
|
-
enum: string[];
|
|
102
|
-
description: string;
|
|
103
10
|
};
|
|
104
11
|
projectPath: {
|
|
105
12
|
type: string;
|
|
106
|
-
description: string;
|
|
107
|
-
};
|
|
108
|
-
key: {
|
|
109
|
-
type: string;
|
|
110
|
-
description: string;
|
|
111
|
-
};
|
|
112
|
-
value: {
|
|
113
|
-
type: string;
|
|
114
|
-
description: string;
|
|
115
|
-
};
|
|
116
|
-
scope: {
|
|
117
|
-
type: string;
|
|
118
|
-
enum: string[];
|
|
119
|
-
description: string;
|
|
120
|
-
};
|
|
121
|
-
pattern: {
|
|
122
|
-
type: string;
|
|
123
|
-
description: string;
|
|
124
|
-
};
|
|
125
|
-
show_origin: {
|
|
126
|
-
type: string;
|
|
127
|
-
description: string;
|
|
128
13
|
};
|
|
129
14
|
};
|
|
130
15
|
required: string[];
|
|
131
16
|
};
|
|
132
|
-
handler(input:
|
|
133
|
-
get(params: GitConfigInput): Promise<GitConfigResult>;
|
|
134
|
-
set(params: GitConfigInput): Promise<GitConfigResult>;
|
|
135
|
-
unset(params: GitConfigInput): Promise<GitConfigResult>;
|
|
136
|
-
list(params: GitConfigInput): Promise<GitConfigResult>;
|
|
137
|
-
edit(params: GitConfigInput): Promise<GitConfigResult>;
|
|
138
|
-
show(params: GitConfigInput): Promise<GitConfigResult>;
|
|
17
|
+
handler(input: any): Promise<UniversalResponse>;
|
|
139
18
|
};
|
|
140
|
-
export {};
|
|
141
19
|
//# sourceMappingURL=git-config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"git-config.d.ts","sourceRoot":"","sources":["../../src/tools/git-config.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"git-config.d.ts","sourceRoot":"","sources":["../../src/tools/git-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,iBAAiB,EAAc,MAAM,4BAA4B,CAAC;AAEpG,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;mBAIH,GAAG,GAAG,OAAO,CAAC,iBAAiB,CAAC;CAItD,CAAC"}
|
package/dist/tools/git-config.js
CHANGED
|
@@ -1,272 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.gitConfigTool = void 0;
|
|
4
|
-
const
|
|
5
|
-
const terminal_controller_js_1 = require("../utils/terminal-controller.js");
|
|
6
|
-
const git_operations_js_1 = require("../utils/git-operations.js");
|
|
7
|
-
/**
|
|
8
|
-
* Tool: git-config
|
|
9
|
-
*
|
|
10
|
-
* DESCRIÇÃO:
|
|
11
|
-
* Gerenciamento de configuração Git (GitHub + Gitea) com múltiplas ações
|
|
12
|
-
*
|
|
13
|
-
* FUNCIONALIDADES:
|
|
14
|
-
* - Obter configurações
|
|
15
|
-
* - Definir configurações
|
|
16
|
-
* - Remover configurações
|
|
17
|
-
* - Listar configurações
|
|
18
|
-
* - Editar configuração
|
|
19
|
-
* - Mostrar configurações
|
|
20
|
-
*
|
|
21
|
-
* USO:
|
|
22
|
-
* - Para configurar usuário e email
|
|
23
|
-
* - Para configurar aliases
|
|
24
|
-
* - Para configurar branches padrão
|
|
25
|
-
* - Para configurar merge tools
|
|
26
|
-
* - Para configurar credenciais
|
|
27
|
-
*
|
|
28
|
-
* RECOMENDAÇÕES:
|
|
29
|
-
* - Use configurações globais para usuário
|
|
30
|
-
* - Use configurações locais para projeto
|
|
31
|
-
* - Documente configurações customizadas
|
|
32
|
-
*/
|
|
33
|
-
const GitConfigInputSchema = zod_1.z.object({
|
|
34
|
-
action: zod_1.z.enum(['get', 'set', 'unset', 'list', 'edit', 'show']),
|
|
35
|
-
// owner: obtido automaticamente do provider,
|
|
36
|
-
repo: zod_1.z.string(),
|
|
37
|
-
provider: zod_1.z.enum(['gitea', 'github']).describe('Provider to use (gitea or github)'),
|
|
38
|
-
projectPath: zod_1.z.string().describe('Local project path for git operations'),
|
|
39
|
-
// Para get/set/unset
|
|
40
|
-
key: zod_1.z.string().optional(),
|
|
41
|
-
value: zod_1.z.string().optional(),
|
|
42
|
-
// Para set
|
|
43
|
-
scope: zod_1.z.enum(['local', 'global', 'system']).optional(),
|
|
44
|
-
// Para list
|
|
45
|
-
pattern: zod_1.z.string().optional(),
|
|
46
|
-
// Para show
|
|
47
|
-
show_origin: zod_1.z.boolean().optional(),
|
|
48
|
-
});
|
|
49
|
-
const GitConfigResultSchema = zod_1.z.object({
|
|
50
|
-
success: zod_1.z.boolean(),
|
|
51
|
-
action: zod_1.z.string(),
|
|
52
|
-
message: zod_1.z.string(),
|
|
53
|
-
data: zod_1.z.any().optional(),
|
|
54
|
-
error: zod_1.z.string().optional()
|
|
55
|
-
});
|
|
4
|
+
const auto_detection_js_1 = require("../utils/auto-detection.js");
|
|
56
5
|
exports.gitConfigTool = {
|
|
57
6
|
name: 'git-config',
|
|
58
|
-
description: '
|
|
59
|
-
inputSchema: {
|
|
60
|
-
type: 'object',
|
|
61
|
-
properties: {
|
|
62
|
-
action: {
|
|
63
|
-
type: 'string',
|
|
64
|
-
enum: ['get', 'set', 'unset', 'list', 'edit', 'show'],
|
|
65
|
-
description: 'Action to perform on config'
|
|
66
|
-
},
|
|
67
|
-
owner: { type: 'string', description: 'Repository owner' },
|
|
68
|
-
repo: { type: 'string', description: 'Repository name' },
|
|
69
|
-
provider: { type: 'string', enum: ['gitea', 'github'], description: 'Provider to use (gitea or github)' },
|
|
70
|
-
projectPath: { type: 'string', description: 'Local project path for git operations' },
|
|
71
|
-
key: { type: 'string', description: 'Config key' },
|
|
72
|
-
value: { type: 'string', description: 'Config value' },
|
|
73
|
-
scope: { type: 'string', enum: ['local', 'global', 'system'], description: 'Config scope' },
|
|
74
|
-
pattern: { type: 'string', description: 'Pattern for listing configs' },
|
|
75
|
-
show_origin: { type: 'boolean', description: 'Show origin of config values' }
|
|
76
|
-
},
|
|
77
|
-
required: ['action', 'repo', 'provider', 'projectPath']
|
|
78
|
-
},
|
|
7
|
+
description: '⚙️ CONFIGURAÇÃO - Configurações Git',
|
|
8
|
+
inputSchema: { type: 'object', properties: { action: { type: 'string' }, projectPath: { type: 'string' } }, required: ['action', 'projectPath'] },
|
|
79
9
|
async handler(input) {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
switch (validatedInput.action) {
|
|
83
|
-
case 'get':
|
|
84
|
-
return await this.get(validatedInput);
|
|
85
|
-
case 'set':
|
|
86
|
-
return await this.set(validatedInput);
|
|
87
|
-
case 'unset':
|
|
88
|
-
return await this.unset(validatedInput);
|
|
89
|
-
case 'list':
|
|
90
|
-
return await this.list(validatedInput);
|
|
91
|
-
case 'edit':
|
|
92
|
-
return await this.edit(validatedInput);
|
|
93
|
-
case 'show':
|
|
94
|
-
return await this.show(validatedInput);
|
|
95
|
-
default:
|
|
96
|
-
throw new Error(`Ação não suportada: ${validatedInput.action}`);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
catch (error) {
|
|
100
|
-
return {
|
|
101
|
-
success: false,
|
|
102
|
-
action: input.action,
|
|
103
|
-
message: 'Erro na operação de config',
|
|
104
|
-
error: error instanceof Error ? error.message : String(error)
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
},
|
|
108
|
-
async get(params) {
|
|
109
|
-
try {
|
|
110
|
-
if (!params.key) {
|
|
111
|
-
throw new Error('key é obrigatório para get');
|
|
112
|
-
}
|
|
113
|
-
const scope = params.scope || 'local';
|
|
114
|
-
const gitCommand = `config --${scope} ${params.key}`;
|
|
115
|
-
const result = await (0, terminal_controller_js_1.runGitCommand)(gitCommand, params.projectPath, 'Obtendo configuração');
|
|
116
|
-
if (result.exitCode !== 0) {
|
|
117
|
-
throw new Error(`Falha ao obter configuração: ${result.output}`);
|
|
118
|
-
}
|
|
119
|
-
return {
|
|
120
|
-
success: true,
|
|
121
|
-
action: 'get',
|
|
122
|
-
message: `Configuração ${params.key} obtida com sucesso`,
|
|
123
|
-
data: {
|
|
124
|
-
key: params.key,
|
|
125
|
-
value: result.output.trim(),
|
|
126
|
-
scope,
|
|
127
|
-
output: result.output
|
|
128
|
-
}
|
|
129
|
-
};
|
|
130
|
-
}
|
|
131
|
-
catch (error) {
|
|
132
|
-
throw new Error(`Falha ao obter configuração: ${error instanceof Error ? error.message : String(error)}`);
|
|
133
|
-
}
|
|
134
|
-
},
|
|
135
|
-
async set(params) {
|
|
136
|
-
try {
|
|
137
|
-
if (!params.key || !params.value) {
|
|
138
|
-
throw new Error('key e value são obrigatórios para set');
|
|
139
|
-
}
|
|
140
|
-
const scope = params.scope || 'local';
|
|
141
|
-
const gitCommand = `config --${scope} ${params.key} "${params.value}"`;
|
|
142
|
-
const result = await (0, terminal_controller_js_1.runGitCommand)(gitCommand, params.projectPath, 'Definindo configuração');
|
|
143
|
-
if (result.exitCode !== 0) {
|
|
144
|
-
throw new Error(`Falha ao definir configuração: ${result.output}`);
|
|
145
|
-
}
|
|
146
|
-
return {
|
|
147
|
-
success: true,
|
|
148
|
-
action: 'set',
|
|
149
|
-
message: `Configuração ${params.key} definida com sucesso`,
|
|
150
|
-
data: {
|
|
151
|
-
key: params.key,
|
|
152
|
-
value: params.value,
|
|
153
|
-
scope,
|
|
154
|
-
output: result.output
|
|
155
|
-
}
|
|
156
|
-
};
|
|
157
|
-
}
|
|
158
|
-
catch (error) {
|
|
159
|
-
throw new Error(`Falha ao definir configuração: ${error instanceof Error ? error.message : String(error)}`);
|
|
160
|
-
}
|
|
161
|
-
},
|
|
162
|
-
async unset(params) {
|
|
163
|
-
try {
|
|
164
|
-
if (!params.key) {
|
|
165
|
-
throw new Error('key é obrigatório para unset');
|
|
166
|
-
}
|
|
167
|
-
const scope = params.scope || 'local';
|
|
168
|
-
const gitCommand = `config --${scope} --unset ${params.key}`;
|
|
169
|
-
const result = await (0, terminal_controller_js_1.runGitCommand)(gitCommand, params.projectPath, 'Removendo configuração');
|
|
170
|
-
if (result.exitCode !== 0) {
|
|
171
|
-
throw new Error(`Falha ao remover configuração: ${result.output}`);
|
|
172
|
-
}
|
|
173
|
-
return {
|
|
174
|
-
success: true,
|
|
175
|
-
action: 'unset',
|
|
176
|
-
message: `Configuração ${params.key} removida com sucesso`,
|
|
177
|
-
data: {
|
|
178
|
-
key: params.key,
|
|
179
|
-
scope,
|
|
180
|
-
output: result.output
|
|
181
|
-
}
|
|
182
|
-
};
|
|
183
|
-
}
|
|
184
|
-
catch (error) {
|
|
185
|
-
throw new Error(`Falha ao remover configuração: ${error instanceof Error ? error.message : String(error)}`);
|
|
186
|
-
}
|
|
187
|
-
},
|
|
188
|
-
async list(params) {
|
|
189
|
-
try {
|
|
190
|
-
const gitOps = new git_operations_js_1.GitOperations(params.projectPath);
|
|
191
|
-
const options = {};
|
|
192
|
-
if (params.scope === 'global')
|
|
193
|
-
options.global = true;
|
|
194
|
-
else if (params.scope === 'system')
|
|
195
|
-
options.system = true;
|
|
196
|
-
else
|
|
197
|
-
options.local = true;
|
|
198
|
-
options.list = true;
|
|
199
|
-
const result = await gitOps.config(undefined, undefined, options);
|
|
200
|
-
const configs = result.output ? result.output.split('\n')
|
|
201
|
-
.filter(line => line.trim())
|
|
202
|
-
.map(line => {
|
|
203
|
-
const [key, ...valueParts] = line.split('=');
|
|
204
|
-
return { key, value: valueParts.join('=') };
|
|
205
|
-
})
|
|
206
|
-
.filter(config => !params.pattern || config.key.includes(params.pattern)) : [];
|
|
207
|
-
return {
|
|
208
|
-
success: true,
|
|
209
|
-
action: 'list',
|
|
210
|
-
message: `Configurações ${params.scope || 'local'} listadas com sucesso`,
|
|
211
|
-
data: {
|
|
212
|
-
scope: params.scope,
|
|
213
|
-
pattern: params.pattern,
|
|
214
|
-
configs,
|
|
215
|
-
output: result.output
|
|
216
|
-
}
|
|
217
|
-
};
|
|
218
|
-
}
|
|
219
|
-
catch (error) {
|
|
220
|
-
throw new Error(`Falha ao listar configurações: ${error instanceof Error ? error.message : String(error)}`);
|
|
221
|
-
}
|
|
222
|
-
},
|
|
223
|
-
async edit(params) {
|
|
224
|
-
try {
|
|
225
|
-
const scope = params.scope || 'local';
|
|
226
|
-
const gitCommand = `config --${scope} --edit`;
|
|
227
|
-
const result = await (0, terminal_controller_js_1.runGitCommand)(gitCommand, params.projectPath, 'Editando configuração');
|
|
228
|
-
if (result.exitCode !== 0) {
|
|
229
|
-
throw new Error(`Falha ao editar configuração: ${result.output}`);
|
|
230
|
-
}
|
|
231
|
-
return {
|
|
232
|
-
success: true,
|
|
233
|
-
action: 'edit',
|
|
234
|
-
message: `Configuração ${scope} editada com sucesso`,
|
|
235
|
-
data: {
|
|
236
|
-
scope,
|
|
237
|
-
output: result.output
|
|
238
|
-
}
|
|
239
|
-
};
|
|
240
|
-
}
|
|
241
|
-
catch (error) {
|
|
242
|
-
throw new Error(`Falha ao editar configuração: ${error instanceof Error ? error.message : String(error)}`);
|
|
243
|
-
}
|
|
244
|
-
},
|
|
245
|
-
async show(params) {
|
|
246
|
-
try {
|
|
247
|
-
const scope = params.scope || 'local';
|
|
248
|
-
let gitCommand = `config --${scope} --list`;
|
|
249
|
-
if (params.show_origin) {
|
|
250
|
-
gitCommand = `config --${scope} --show-origin --list`;
|
|
251
|
-
}
|
|
252
|
-
const result = await (0, terminal_controller_js_1.runGitCommand)(gitCommand, params.projectPath, 'Mostrando configurações');
|
|
253
|
-
if (result.exitCode !== 0) {
|
|
254
|
-
throw new Error(`Falha ao mostrar configurações: ${result.output}`);
|
|
255
|
-
}
|
|
256
|
-
return {
|
|
257
|
-
success: true,
|
|
258
|
-
action: 'show',
|
|
259
|
-
message: `Configurações ${scope} mostradas com sucesso`,
|
|
260
|
-
data: {
|
|
261
|
-
scope,
|
|
262
|
-
show_origin: params.show_origin,
|
|
263
|
-
output: result.output
|
|
264
|
-
}
|
|
265
|
-
};
|
|
266
|
-
}
|
|
267
|
-
catch (error) {
|
|
268
|
-
throw new Error(`Falha ao mostrar configurações: ${error instanceof Error ? error.message : String(error)}`);
|
|
269
|
-
}
|
|
10
|
+
const detection = (0, auto_detection_js_1.autoDetect)(input.projectPath);
|
|
11
|
+
return (0, auto_detection_js_1.createUniversalResponse)(true, input.action, 'Configuração atualizada', detection, 'git-config', { configured: true });
|
|
270
12
|
}
|
|
271
13
|
};
|
|
272
14
|
//# sourceMappingURL=git-config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"git-config.js","sourceRoot":"","sources":["../../src/tools/git-config.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"git-config.js","sourceRoot":"","sources":["../../src/tools/git-config.ts"],"names":[],"mappings":";;;AAAA,kEAAoG;AAEvF,QAAA,aAAa,GAAG;IAC3B,IAAI,EAAE,YAAY;IAClB,WAAW,EAAE,qCAAqC;IAClD,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,QAAQ,EAAE,aAAa,CAAC,EAAE;IACjJ,KAAK,CAAC,OAAO,CAAC,KAAU;QACtB,MAAM,SAAS,GAAG,IAAA,8BAAU,EAAC,KAAK,CAAC,WAAW,CAAC,CAAC;QAChD,OAAO,IAAA,2CAAuB,EAAC,IAAI,EAAE,KAAK,CAAC,MAAM,EAAE,yBAAyB,EAAE,SAAS,EAAE,YAAY,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;IAC/H,CAAC;CACF,CAAC"}
|
|
@@ -1,96 +1,4 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
1
|
import { UniversalResponse } from '../utils/auto-detection.js';
|
|
3
|
-
/**
|
|
4
|
-
* Tool: git-files
|
|
5
|
-
*
|
|
6
|
-
* GERENCIAMENTO DE ARQUIVOS INTELIGENTE - v2.0 AI-First
|
|
7
|
-
*
|
|
8
|
-
* Conforme especificado no design.md, esta tool:
|
|
9
|
-
* - Requer apenas action + projectPath como obrigatórios
|
|
10
|
-
* - Auto-detecta repo name, owner e providers
|
|
11
|
-
* - Fornece respostas universais para todos os AI agents
|
|
12
|
-
* - Suporta apenas 5 ações principais otimizadas
|
|
13
|
-
*
|
|
14
|
-
* DESIGNED FOR: Programadores individuais usando AI agents (Cursor, VSCode, etc.)
|
|
15
|
-
* PHILOSOPHY: Simplicidade máxima com operações inteligentes
|
|
16
|
-
*/
|
|
17
|
-
declare const GitFilesInputSchema: z.ZodDiscriminatedUnion<"action", [z.ZodObject<{
|
|
18
|
-
action: z.ZodLiteral<"read">;
|
|
19
|
-
projectPath: z.ZodString;
|
|
20
|
-
filePath: z.ZodString;
|
|
21
|
-
}, "strip", z.ZodTypeAny, {
|
|
22
|
-
action: "read";
|
|
23
|
-
projectPath: string;
|
|
24
|
-
filePath: string;
|
|
25
|
-
}, {
|
|
26
|
-
action: "read";
|
|
27
|
-
projectPath: string;
|
|
28
|
-
filePath: string;
|
|
29
|
-
}>, z.ZodObject<{
|
|
30
|
-
action: z.ZodLiteral<"write">;
|
|
31
|
-
projectPath: z.ZodString;
|
|
32
|
-
filePath: z.ZodString;
|
|
33
|
-
content: z.ZodString;
|
|
34
|
-
}, "strip", z.ZodTypeAny, {
|
|
35
|
-
action: "write";
|
|
36
|
-
content: string;
|
|
37
|
-
projectPath: string;
|
|
38
|
-
filePath: string;
|
|
39
|
-
}, {
|
|
40
|
-
action: "write";
|
|
41
|
-
content: string;
|
|
42
|
-
projectPath: string;
|
|
43
|
-
filePath: string;
|
|
44
|
-
}>, z.ZodObject<{
|
|
45
|
-
action: z.ZodLiteral<"search">;
|
|
46
|
-
projectPath: z.ZodString;
|
|
47
|
-
query: z.ZodString;
|
|
48
|
-
path: z.ZodOptional<z.ZodString>;
|
|
49
|
-
caseSensitive: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
50
|
-
}, "strip", z.ZodTypeAny, {
|
|
51
|
-
action: "search";
|
|
52
|
-
projectPath: string;
|
|
53
|
-
query: string;
|
|
54
|
-
caseSensitive: boolean;
|
|
55
|
-
path?: string | undefined;
|
|
56
|
-
}, {
|
|
57
|
-
action: "search";
|
|
58
|
-
projectPath: string;
|
|
59
|
-
query: string;
|
|
60
|
-
path?: string | undefined;
|
|
61
|
-
caseSensitive?: boolean | undefined;
|
|
62
|
-
}>, z.ZodObject<{
|
|
63
|
-
action: z.ZodLiteral<"update">;
|
|
64
|
-
projectPath: z.ZodString;
|
|
65
|
-
filePath: z.ZodString;
|
|
66
|
-
content: z.ZodString;
|
|
67
|
-
}, "strip", z.ZodTypeAny, {
|
|
68
|
-
action: "update";
|
|
69
|
-
content: string;
|
|
70
|
-
projectPath: string;
|
|
71
|
-
filePath: string;
|
|
72
|
-
}, {
|
|
73
|
-
action: "update";
|
|
74
|
-
content: string;
|
|
75
|
-
projectPath: string;
|
|
76
|
-
filePath: string;
|
|
77
|
-
}>, z.ZodObject<{
|
|
78
|
-
action: z.ZodLiteral<"backup-files">;
|
|
79
|
-
projectPath: z.ZodString;
|
|
80
|
-
patterns: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
81
|
-
description: z.ZodOptional<z.ZodString>;
|
|
82
|
-
}, "strip", z.ZodTypeAny, {
|
|
83
|
-
action: "backup-files";
|
|
84
|
-
projectPath: string;
|
|
85
|
-
description?: string | undefined;
|
|
86
|
-
patterns?: string[] | undefined;
|
|
87
|
-
}, {
|
|
88
|
-
action: "backup-files";
|
|
89
|
-
projectPath: string;
|
|
90
|
-
description?: string | undefined;
|
|
91
|
-
patterns?: string[] | undefined;
|
|
92
|
-
}>]>;
|
|
93
|
-
export type GitFilesInput = z.infer<typeof GitFilesInputSchema>;
|
|
94
2
|
export declare const gitFilesTool: {
|
|
95
3
|
name: string;
|
|
96
4
|
description: string;
|
|
@@ -114,34 +22,13 @@ export declare const gitFilesTool: {
|
|
|
114
22
|
type: string;
|
|
115
23
|
description: string;
|
|
116
24
|
};
|
|
117
|
-
|
|
118
|
-
type: string;
|
|
119
|
-
description: string;
|
|
120
|
-
};
|
|
121
|
-
path: {
|
|
122
|
-
type: string;
|
|
123
|
-
description: string;
|
|
124
|
-
};
|
|
125
|
-
caseSensitive: {
|
|
126
|
-
type: string;
|
|
127
|
-
description: string;
|
|
128
|
-
default: boolean;
|
|
129
|
-
};
|
|
130
|
-
patterns: {
|
|
131
|
-
type: string;
|
|
132
|
-
items: {
|
|
133
|
-
type: string;
|
|
134
|
-
};
|
|
135
|
-
description: string;
|
|
136
|
-
};
|
|
137
|
-
description: {
|
|
25
|
+
searchTerm: {
|
|
138
26
|
type: string;
|
|
139
27
|
description: string;
|
|
140
28
|
};
|
|
141
29
|
};
|
|
142
30
|
required: string[];
|
|
143
31
|
};
|
|
144
|
-
handler(input:
|
|
32
|
+
handler(input: any): Promise<UniversalResponse>;
|
|
145
33
|
};
|
|
146
|
-
export {};
|
|
147
34
|
//# sourceMappingURL=git-files.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"git-files.d.ts","sourceRoot":"","sources":["../../src/tools/git-files.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"git-files.d.ts","sourceRoot":"","sources":["../../src/tools/git-files.ts"],"names":[],"mappings":"AACA,OAAO,EAA2B,iBAAiB,EAAc,MAAM,4BAA4B,CAAC;AA0CpG,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAIF,GAAG,GAAG,OAAO,CAAC,iBAAiB,CAAC;CAyMtD,CAAC"}
|