@andre.buzeli/git-mcp 16.0.2 → 16.0.3
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/package.json
CHANGED
package/src/tools/git-ignore.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import Ajv from "ajv";
|
|
2
2
|
import { asToolError, asToolResult, errorToResponse } from "../utils/errors.js";
|
|
3
3
|
import { validateProjectPath } from "../utils/repoHelpers.js";
|
|
4
|
+
import { withRetry } from "../utils/retry.js";
|
|
4
5
|
|
|
5
6
|
const ajv = new Ajv({ allErrors: true });
|
|
6
7
|
|
|
@@ -8,12 +9,12 @@ export function createGitIgnoreTool(git) {
|
|
|
8
9
|
const inputSchema = {
|
|
9
10
|
type: "object",
|
|
10
11
|
properties: {
|
|
11
|
-
projectPath: {
|
|
12
|
+
projectPath: {
|
|
12
13
|
type: "string",
|
|
13
14
|
description: "Caminho absoluto do diretório do projeto"
|
|
14
15
|
},
|
|
15
|
-
action: {
|
|
16
|
-
type: "string",
|
|
16
|
+
action: {
|
|
17
|
+
type: "string",
|
|
17
18
|
enum: ["list", "create", "add", "remove"],
|
|
18
19
|
description: `Ação a executar:
|
|
19
20
|
- list: Lista padrões atuais do .gitignore
|
|
@@ -21,8 +22,8 @@ export function createGitIgnoreTool(git) {
|
|
|
21
22
|
- add: Adiciona padrões ao .gitignore existente
|
|
22
23
|
- remove: Remove padrões do .gitignore`
|
|
23
24
|
},
|
|
24
|
-
patterns: {
|
|
25
|
-
type: "array",
|
|
25
|
+
patterns: {
|
|
26
|
+
type: "array",
|
|
26
27
|
items: { type: "string" },
|
|
27
28
|
description: "Padrões para ignorar. Ex: ['node_modules/', '*.log', '.env', 'dist/', '*.tmp']"
|
|
28
29
|
}
|
|
@@ -66,7 +67,7 @@ EXEMPLOS:
|
|
|
66
67
|
}
|
|
67
68
|
if (action === "create") {
|
|
68
69
|
if (patterns.length === 0) {
|
|
69
|
-
return asToolError("MISSING_PARAMETER", "patterns é obrigatório para criar .gitignore", {
|
|
70
|
+
return asToolError("MISSING_PARAMETER", "patterns é obrigatório para criar .gitignore", {
|
|
70
71
|
parameter: "patterns",
|
|
71
72
|
suggestion: "Forneça um array de padrões. Ex: ['node_modules/', '*.log', '.env']"
|
|
72
73
|
});
|
package/src/tools/git-stash.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import Ajv from "ajv";
|
|
2
2
|
import { asToolError, asToolResult, errorToResponse } from "../utils/errors.js";
|
|
3
3
|
import { validateProjectPath } from "../utils/repoHelpers.js";
|
|
4
|
+
import { withRetry } from "../utils/retry.js";
|
|
4
5
|
|
|
5
6
|
const ajv = new Ajv({ allErrors: true });
|
|
6
7
|
|
|
@@ -8,12 +9,12 @@ export function createGitStashTool(git) {
|
|
|
8
9
|
const inputSchema = {
|
|
9
10
|
type: "object",
|
|
10
11
|
properties: {
|
|
11
|
-
projectPath: {
|
|
12
|
+
projectPath: {
|
|
12
13
|
type: "string",
|
|
13
14
|
description: "Caminho absoluto do diretório do projeto"
|
|
14
15
|
},
|
|
15
|
-
action: {
|
|
16
|
-
type: "string",
|
|
16
|
+
action: {
|
|
17
|
+
type: "string",
|
|
17
18
|
enum: ["list", "save", "apply", "pop", "drop", "clear"],
|
|
18
19
|
description: `Ação a executar:
|
|
19
20
|
- list: Lista todos os stashes salvos
|
|
@@ -23,15 +24,15 @@ export function createGitStashTool(git) {
|
|
|
23
24
|
- drop: Remove stash específico da lista
|
|
24
25
|
- clear: Remove TODOS os stashes`
|
|
25
26
|
},
|
|
26
|
-
message: {
|
|
27
|
+
message: {
|
|
27
28
|
type: "string",
|
|
28
29
|
description: "Mensagem descritiva para o stash (action='save'). Ex: 'WIP: implementando feature X'"
|
|
29
30
|
},
|
|
30
|
-
ref: {
|
|
31
|
+
ref: {
|
|
31
32
|
type: "string",
|
|
32
33
|
description: "Referência do stash para apply/pop/drop. Ex: 'stash@{0}' (mais recente), 'stash@{1}' (segundo)"
|
|
33
34
|
},
|
|
34
|
-
includeUntracked: {
|
|
35
|
+
includeUntracked: {
|
|
35
36
|
type: "boolean",
|
|
36
37
|
description: "Incluir arquivos não rastreados no stash (action='save'). Default: false"
|
|
37
38
|
}
|
|
@@ -68,7 +69,7 @@ AÇÕES:
|
|
|
68
69
|
validateProjectPath(projectPath);
|
|
69
70
|
if (action === "list") {
|
|
70
71
|
const items = await withRetry(() => git.listStash(projectPath), 3, "stash-list");
|
|
71
|
-
return asToolResult({
|
|
72
|
+
return asToolResult({
|
|
72
73
|
stashes: items.map((s, i) => ({ index: i, ref: `stash@{${i}}`, message: s.message, timestamp: s.timestamp })),
|
|
73
74
|
count: items.length,
|
|
74
75
|
message: items.length === 0 ? "Nenhum stash salvo" : undefined
|