@commitsage/mcp-server 1.0.0 → 1.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 +31 -101
- package/dist/server/mcpServer.d.ts.map +1 -1
- package/dist/server/mcpServer.js +2 -74
- package/dist/server/mcpServer.js.map +1 -1
- package/dist/server/tools.d.ts +0 -45
- package/dist/server/tools.d.ts.map +1 -1
- package/dist/server/tools.js +5 -163
- package/dist/server/tools.js.map +1 -1
- package/dist/utils/logger.js +3 -3
- package/dist/utils/logger.js.map +1 -1
- package/package.json +1 -1
- package/dist/adapters/sse.d.ts +0 -26
- package/dist/adapters/sse.d.ts.map +0 -1
- package/dist/adapters/sse.js +0 -45
- package/dist/adapters/sse.js.map +0 -1
- package/dist/auth/jwt.d.ts +0 -70
- package/dist/auth/jwt.d.ts.map +0 -1
- package/dist/auth/jwt.js +0 -171
- package/dist/auth/jwt.js.map +0 -1
- package/dist/auth/oauth.d.ts +0 -71
- package/dist/auth/oauth.d.ts.map +0 -1
- package/dist/auth/oauth.js +0 -213
- package/dist/auth/oauth.js.map +0 -1
package/README.md
CHANGED
|
@@ -23,35 +23,17 @@ CommitSage MCP Server provides AI-powered Git commit message generation through
|
|
|
23
23
|
- Git installed and in PATH
|
|
24
24
|
- API key for your chosen provider (Gemini, OpenAI, or Codestral) - not needed for Ollama
|
|
25
25
|
|
|
26
|
-
### Installation
|
|
26
|
+
### Installation
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
CommitSage MCP Server is available on npm: [@commitsage/mcp-server](https://www.npmjs.com/package/@commitsage/mcp-server)
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
See the [Zed Extension README](./zed-extension/README.md) for details.
|
|
33
|
-
|
|
34
|
-
#### Option 2: Manual Installation
|
|
35
|
-
|
|
36
|
-
1. **Clone or download the project**
|
|
37
|
-
|
|
38
|
-
```bash
|
|
39
|
-
cd C:\Users\IVAN\Documents\home\CommitSage\mcp-server
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
2. **Install dependencies**
|
|
30
|
+
No installation required when using `npx` (recommended), or install globally:
|
|
43
31
|
|
|
44
32
|
```bash
|
|
45
|
-
npm install
|
|
33
|
+
npm install -g @commitsage/mcp-server
|
|
46
34
|
```
|
|
47
35
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
```bash
|
|
51
|
-
npm run build
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
4. **Configure in your MCP client** (see Configuration section below)
|
|
36
|
+
Then configure in your MCP client (see Configuration section below).
|
|
55
37
|
|
|
56
38
|
## Configuration for IDE Clients
|
|
57
39
|
|
|
@@ -66,8 +48,8 @@ Add to your Claude Code configuration file:
|
|
|
66
48
|
{
|
|
67
49
|
"mcpServers": {
|
|
68
50
|
"commitsage": {
|
|
69
|
-
"command": "
|
|
70
|
-
"args": ["
|
|
51
|
+
"command": "npx",
|
|
52
|
+
"args": ["-y", "@commitsage/mcp-server"],
|
|
71
53
|
"env": {
|
|
72
54
|
"GEMINI_API_KEY": "your-api-key-here",
|
|
73
55
|
"DEFAULT_PROVIDER": "gemini",
|
|
@@ -86,8 +68,8 @@ Add to your Claude Code configuration file:
|
|
|
86
68
|
{
|
|
87
69
|
"mcpServers": {
|
|
88
70
|
"commitsage": {
|
|
89
|
-
"command": "
|
|
90
|
-
"args": ["
|
|
71
|
+
"command": "npx",
|
|
72
|
+
"args": ["-y", "@commitsage/mcp-server"],
|
|
91
73
|
"env": {
|
|
92
74
|
"GEMINI_API_KEY": "your-api-key-here"
|
|
93
75
|
}
|
|
@@ -105,8 +87,8 @@ Add to Cursor settings (Settings > MCP):
|
|
|
105
87
|
"mcp": {
|
|
106
88
|
"servers": {
|
|
107
89
|
"commitsage": {
|
|
108
|
-
"command": "
|
|
109
|
-
"args": ["
|
|
90
|
+
"command": "npx",
|
|
91
|
+
"args": ["-y", "@commitsage/mcp-server"],
|
|
110
92
|
"env": {
|
|
111
93
|
"GEMINI_API_KEY": "your-api-key-here",
|
|
112
94
|
"DEFAULT_PROVIDER": "gemini",
|
|
@@ -128,8 +110,8 @@ If you prefer manual configuration, add to `.zed/settings.json`:
|
|
|
128
110
|
{
|
|
129
111
|
"context_servers": {
|
|
130
112
|
"commitsage": {
|
|
131
|
-
"command": "
|
|
132
|
-
"args": ["
|
|
113
|
+
"command": "npx",
|
|
114
|
+
"args": ["-y", "@commitsage/mcp-server"],
|
|
133
115
|
"env": {
|
|
134
116
|
"GEMINI_API_KEY": "your-api-key-here",
|
|
135
117
|
"DEFAULT_PROVIDER": "gemini"
|
|
@@ -143,24 +125,15 @@ If you prefer manual configuration, add to `.zed/settings.json`:
|
|
|
143
125
|
|
|
144
126
|
### 1. `generate_commit_message`
|
|
145
127
|
|
|
146
|
-
Generate an AI-powered commit message for a Git repository.
|
|
128
|
+
Generate an AI-powered commit message for a Git repository. Analyzes all changes (staged and unstaged) using configuration from MCP server environment variables.
|
|
147
129
|
|
|
148
130
|
**Parameters:**
|
|
149
131
|
- `repoPath` (required): Path to the git repository
|
|
150
|
-
- `provider` (optional): AI provider (`gemini`, `openai`, `codestral`, `ollama`)
|
|
151
|
-
- `format` (optional): Commit format (`conventional`, `angular`, `karma`, `semantic`, `emoji`, `emojiKarma`, `google`, `atom`)
|
|
152
|
-
- `language` (optional): Language (`english`, `russian`, `chinese`, `japanese`, `spanish`)
|
|
153
|
-
- `onlyStaged` (optional): Only analyze staged changes (default: `false`)
|
|
154
|
-
- `customInstructions` (optional): Custom instructions for generation
|
|
155
132
|
|
|
156
133
|
**Example:**
|
|
157
134
|
```json
|
|
158
135
|
{
|
|
159
|
-
"repoPath": "/path/to/your/repo"
|
|
160
|
-
"provider": "gemini",
|
|
161
|
-
"format": "conventional",
|
|
162
|
-
"language": "english",
|
|
163
|
-
"onlyStaged": true
|
|
136
|
+
"repoPath": "/path/to/your/repo"
|
|
164
137
|
}
|
|
165
138
|
```
|
|
166
139
|
|
|
@@ -174,61 +147,9 @@ Generate an AI-powered commit message for a Git repository.
|
|
|
174
147
|
}
|
|
175
148
|
```
|
|
176
149
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
Analyze git changes in a repository.
|
|
180
|
-
|
|
181
|
-
**Parameters:**
|
|
182
|
-
- `repoPath` (required): Path to the git repository
|
|
183
|
-
- `onlyStaged` (optional): Only analyze staged changes
|
|
184
|
-
|
|
185
|
-
**Example:**
|
|
186
|
-
```json
|
|
187
|
-
{
|
|
188
|
-
"repoPath": "/path/to/your/repo",
|
|
189
|
-
"onlyStaged": false
|
|
190
|
-
}
|
|
191
|
-
```
|
|
192
|
-
|
|
193
|
-
**Response:**
|
|
194
|
-
```json
|
|
195
|
-
{
|
|
196
|
-
"success": true,
|
|
197
|
-
"analysis": {
|
|
198
|
-
"hasStagedChanges": true,
|
|
199
|
-
"hasUnstagedChanges": false,
|
|
200
|
-
"hasUntrackedFiles": false,
|
|
201
|
-
"changedFilesCount": 3,
|
|
202
|
-
"changedFiles": ["src/auth.ts", "src/config.ts", "README.md"],
|
|
203
|
-
"diffLength": 1234,
|
|
204
|
-
"diffPreview": "diff --git a/src/auth.ts..."
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
```
|
|
208
|
-
|
|
209
|
-
### 3. `list_commit_formats`
|
|
150
|
+
**Note:** All configuration (provider, format, language, etc.) is set through environment variables in the MCP server configuration.
|
|
210
151
|
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
**Parameters:** None
|
|
214
|
-
|
|
215
|
-
**Response:**
|
|
216
|
-
```json
|
|
217
|
-
{
|
|
218
|
-
"success": true,
|
|
219
|
-
"formats": [
|
|
220
|
-
{
|
|
221
|
-
"name": "conventional",
|
|
222
|
-
"description": "Conventional Commits format: type(scope): description",
|
|
223
|
-
"example": "feat(auth): add OAuth2 authentication"
|
|
224
|
-
},
|
|
225
|
-
...
|
|
226
|
-
],
|
|
227
|
-
"currentFormat": "conventional"
|
|
228
|
-
}
|
|
229
|
-
```
|
|
230
|
-
|
|
231
|
-
### 4. `validate_api_key`
|
|
152
|
+
### 2. `validate_api_key`
|
|
232
153
|
|
|
233
154
|
Validate that an API key is configured for a provider.
|
|
234
155
|
|
|
@@ -247,7 +168,7 @@ Validate that an API key is configured for a provider.
|
|
|
247
168
|
### In Claude Code
|
|
248
169
|
|
|
249
170
|
```
|
|
250
|
-
Generate a commit message for my
|
|
171
|
+
Generate a commit message for my changes in C:/projects/myapp
|
|
251
172
|
```
|
|
252
173
|
|
|
253
174
|
Claude Code will call the `generate_commit_message` tool and provide you with a properly formatted commit message.
|
|
@@ -255,18 +176,18 @@ Claude Code will call the `generate_commit_message` tool and provide you with a
|
|
|
255
176
|
### In Cursor
|
|
256
177
|
|
|
257
178
|
```
|
|
258
|
-
|
|
179
|
+
Generate commit message for the current repository
|
|
259
180
|
```
|
|
260
181
|
|
|
261
|
-
Cursor will
|
|
182
|
+
Cursor will analyze all changes and generate an appropriate commit message.
|
|
262
183
|
|
|
263
184
|
### In Zed
|
|
264
185
|
|
|
265
186
|
```
|
|
266
|
-
|
|
187
|
+
Create a commit message for my project
|
|
267
188
|
```
|
|
268
189
|
|
|
269
|
-
Zed will call the `
|
|
190
|
+
Zed will call the `generate_commit_message` tool and show you the result.
|
|
270
191
|
|
|
271
192
|
## Environment Variables Reference
|
|
272
193
|
|
|
@@ -306,6 +227,14 @@ Zed will call the `list_commit_formats` tool and show you all options.
|
|
|
306
227
|
|
|
307
228
|
## Development
|
|
308
229
|
|
|
230
|
+
For local development, clone the repository:
|
|
231
|
+
|
|
232
|
+
```bash
|
|
233
|
+
git clone https://github.com/VizzleTF/CommitSage.git
|
|
234
|
+
cd CommitSage/mcp-server
|
|
235
|
+
npm install
|
|
236
|
+
```
|
|
237
|
+
|
|
309
238
|
### Run in development mode
|
|
310
239
|
|
|
311
240
|
```bash
|
|
@@ -415,6 +344,7 @@ MIT
|
|
|
415
344
|
## Support
|
|
416
345
|
|
|
417
346
|
For issues, questions, or contributions, please visit:
|
|
347
|
+
- npm package: [@commitsage/mcp-server](https://www.npmjs.com/package/@commitsage/mcp-server)
|
|
418
348
|
- Main project: [CommitSage GitHub](https://github.com/VizzleTF/CommitSage)
|
|
419
349
|
- Issues: [GitHub Issues](https://github.com/VizzleTF/CommitSage/issues)
|
|
420
350
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcpServer.d.ts","sourceRoot":"","sources":["../../src/server/mcpServer.ts"],"names":[],"mappings":"AAAA;;GAEG;
|
|
1
|
+
{"version":3,"file":"mcpServer.d.ts","sourceRoot":"","sources":["../../src/server/mcpServer.ts"],"names":[],"mappings":"AAAA;;GAEG;AAkBH,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,MAAM,CAAS;;IAmBvB,OAAO,CAAC,iBAAiB;IAyFzB,OAAO,CAAC,kBAAkB;IAkBpB,KAAK;CAoBZ"}
|
package/dist/server/mcpServer.js
CHANGED
|
@@ -7,7 +7,7 @@ import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextpro
|
|
|
7
7
|
import { Logger } from "../utils/logger.js";
|
|
8
8
|
import { ConfigService } from "../utils/config.js";
|
|
9
9
|
import { GitService } from "../services/gitService.js";
|
|
10
|
-
import { GenerateCommitMessageSchema,
|
|
10
|
+
import { GenerateCommitMessageSchema, ValidateApiKeySchema, handleGenerateCommitMessage, handleValidateApiKey, } from "./tools.js";
|
|
11
11
|
export class CommitSageMCPServer {
|
|
12
12
|
server;
|
|
13
13
|
constructor() {
|
|
@@ -29,7 +29,7 @@ export class CommitSageMCPServer {
|
|
|
29
29
|
tools: [
|
|
30
30
|
{
|
|
31
31
|
name: "generate_commit_message",
|
|
32
|
-
description: "Generate an AI-powered commit message for a Git repository
|
|
32
|
+
description: "Generate an AI-powered commit message for a Git repository. Analyzes all changes (staged and unstaged) using configuration from MCP server environment variables.",
|
|
33
33
|
inputSchema: {
|
|
34
34
|
type: "object",
|
|
35
35
|
properties: {
|
|
@@ -37,74 +37,10 @@ export class CommitSageMCPServer {
|
|
|
37
37
|
type: "string",
|
|
38
38
|
description: "Path to the git repository",
|
|
39
39
|
},
|
|
40
|
-
provider: {
|
|
41
|
-
type: "string",
|
|
42
|
-
enum: ["gemini", "openai", "codestral", "ollama"],
|
|
43
|
-
description: "AI provider to use (defaults to configured provider)",
|
|
44
|
-
},
|
|
45
|
-
format: {
|
|
46
|
-
type: "string",
|
|
47
|
-
enum: [
|
|
48
|
-
"conventional",
|
|
49
|
-
"angular",
|
|
50
|
-
"karma",
|
|
51
|
-
"semantic",
|
|
52
|
-
"emoji",
|
|
53
|
-
"emojiKarma",
|
|
54
|
-
"google",
|
|
55
|
-
"atom",
|
|
56
|
-
],
|
|
57
|
-
description: "Commit message format",
|
|
58
|
-
},
|
|
59
|
-
language: {
|
|
60
|
-
type: "string",
|
|
61
|
-
enum: [
|
|
62
|
-
"english",
|
|
63
|
-
"russian",
|
|
64
|
-
"chinese",
|
|
65
|
-
"japanese",
|
|
66
|
-
"spanish",
|
|
67
|
-
],
|
|
68
|
-
description: "Language for commit message",
|
|
69
|
-
},
|
|
70
|
-
onlyStaged: {
|
|
71
|
-
type: "boolean",
|
|
72
|
-
description: "Only analyze staged changes (default: false)",
|
|
73
|
-
},
|
|
74
|
-
customInstructions: {
|
|
75
|
-
type: "string",
|
|
76
|
-
description: "Custom instructions for commit message generation",
|
|
77
|
-
},
|
|
78
40
|
},
|
|
79
41
|
required: ["repoPath"],
|
|
80
42
|
},
|
|
81
43
|
},
|
|
82
|
-
{
|
|
83
|
-
name: "analyze_changes",
|
|
84
|
-
description: "Analyze git changes in a repository. Returns information about staged/unstaged changes, changed files, and a preview of the diff.",
|
|
85
|
-
inputSchema: {
|
|
86
|
-
type: "object",
|
|
87
|
-
properties: {
|
|
88
|
-
repoPath: {
|
|
89
|
-
type: "string",
|
|
90
|
-
description: "Path to the git repository",
|
|
91
|
-
},
|
|
92
|
-
onlyStaged: {
|
|
93
|
-
type: "boolean",
|
|
94
|
-
description: "Only analyze staged changes (default: false)",
|
|
95
|
-
},
|
|
96
|
-
},
|
|
97
|
-
required: ["repoPath"],
|
|
98
|
-
},
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
name: "list_commit_formats",
|
|
102
|
-
description: "List all available commit message formats with descriptions and examples.",
|
|
103
|
-
inputSchema: {
|
|
104
|
-
type: "object",
|
|
105
|
-
properties: {},
|
|
106
|
-
},
|
|
107
|
-
},
|
|
108
44
|
{
|
|
109
45
|
name: "validate_api_key",
|
|
110
46
|
description: "Validate that an API key is configured for a specific provider.",
|
|
@@ -136,14 +72,6 @@ export class CommitSageMCPServer {
|
|
|
136
72
|
const parsed = GenerateCommitMessageSchema.parse(args);
|
|
137
73
|
return await handleGenerateCommitMessage(parsed);
|
|
138
74
|
}
|
|
139
|
-
case "analyze_changes": {
|
|
140
|
-
const parsed = AnalyzeChangesSchema.parse(args);
|
|
141
|
-
return await handleAnalyzeChanges(parsed);
|
|
142
|
-
}
|
|
143
|
-
case "list_commit_formats": {
|
|
144
|
-
const parsed = ListCommitFormatsSchema.parse(args);
|
|
145
|
-
return await handleListCommitFormats(parsed);
|
|
146
|
-
}
|
|
147
75
|
case "validate_api_key": {
|
|
148
76
|
const parsed = ValidateApiKeySchema.parse(args);
|
|
149
77
|
return await handleValidateApiKey(parsed);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcpServer.js","sourceRoot":"","sources":["../../src/server/mcpServer.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACL,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OA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AG,CAAC,uCAAuC,CAAC,CAAC;YACpD,aAAa,CAAC,UAAU,EAAE,CAAC;YAC3B,MAAM,UAAU,CAAC,WAAW,EAAE,CAAC;YAE/B,8BAA8B;YAC9B,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;YAC7C,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;YAErC,MAAM,CAAC,GAAG,CAAC,4CAA4C,CAAC,CAAC;YACzD,MAAM,CAAC,GAAG,CAAC,qBAAqB,aAAa,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;YAC/D,MAAM,CAAC,GAAG,CAAC,mBAAmB,aAAa,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC;YACjE,MAAM,CAAC,GAAG,CAAC,qBAAqB,aAAa,CAAC,iBAAiB,EAAE,EAAE,CAAC,CAAC;QACvE,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,CAAC,KAAK,CAAC,6BAA6B,EAAE,KAAK,CAAC,CAAC;YACnD,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;CACF"}
|
package/dist/server/tools.d.ts
CHANGED
|
@@ -4,37 +4,11 @@
|
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
export declare const GenerateCommitMessageSchema: z.ZodObject<{
|
|
6
6
|
repoPath: z.ZodString;
|
|
7
|
-
provider: z.ZodOptional<z.ZodEnum<["gemini", "openai", "codestral", "ollama"]>>;
|
|
8
|
-
format: z.ZodOptional<z.ZodEnum<["conventional", "angular", "karma", "semantic", "emoji", "emojiKarma", "google", "atom"]>>;
|
|
9
|
-
language: z.ZodOptional<z.ZodEnum<["english", "russian", "chinese", "japanese", "spanish"]>>;
|
|
10
|
-
onlyStaged: z.ZodOptional<z.ZodBoolean>;
|
|
11
|
-
customInstructions: z.ZodOptional<z.ZodString>;
|
|
12
7
|
}, "strip", z.ZodTypeAny, {
|
|
13
8
|
repoPath: string;
|
|
14
|
-
provider?: "gemini" | "openai" | "codestral" | "ollama" | undefined;
|
|
15
|
-
format?: "conventional" | "angular" | "karma" | "semantic" | "emoji" | "emojiKarma" | "google" | "atom" | undefined;
|
|
16
|
-
language?: "english" | "russian" | "chinese" | "japanese" | "spanish" | undefined;
|
|
17
|
-
onlyStaged?: boolean | undefined;
|
|
18
|
-
customInstructions?: string | undefined;
|
|
19
9
|
}, {
|
|
20
10
|
repoPath: string;
|
|
21
|
-
provider?: "gemini" | "openai" | "codestral" | "ollama" | undefined;
|
|
22
|
-
format?: "conventional" | "angular" | "karma" | "semantic" | "emoji" | "emojiKarma" | "google" | "atom" | undefined;
|
|
23
|
-
language?: "english" | "russian" | "chinese" | "japanese" | "spanish" | undefined;
|
|
24
|
-
onlyStaged?: boolean | undefined;
|
|
25
|
-
customInstructions?: string | undefined;
|
|
26
11
|
}>;
|
|
27
|
-
export declare const AnalyzeChangesSchema: z.ZodObject<{
|
|
28
|
-
repoPath: z.ZodString;
|
|
29
|
-
onlyStaged: z.ZodOptional<z.ZodBoolean>;
|
|
30
|
-
}, "strip", z.ZodTypeAny, {
|
|
31
|
-
repoPath: string;
|
|
32
|
-
onlyStaged?: boolean | undefined;
|
|
33
|
-
}, {
|
|
34
|
-
repoPath: string;
|
|
35
|
-
onlyStaged?: boolean | undefined;
|
|
36
|
-
}>;
|
|
37
|
-
export declare const ListCommitFormatsSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
38
12
|
export declare const ValidateApiKeySchema: z.ZodObject<{
|
|
39
13
|
provider: z.ZodEnum<["gemini", "openai", "codestral", "ollama"]>;
|
|
40
14
|
apiKey: z.ZodOptional<z.ZodString>;
|
|
@@ -58,25 +32,6 @@ export declare function handleGenerateCommitMessage(args: z.infer<typeof Generat
|
|
|
58
32
|
}[];
|
|
59
33
|
isError: boolean;
|
|
60
34
|
}>;
|
|
61
|
-
export declare function handleAnalyzeChanges(args: z.infer<typeof AnalyzeChangesSchema>): Promise<{
|
|
62
|
-
content: {
|
|
63
|
-
type: string;
|
|
64
|
-
text: string;
|
|
65
|
-
}[];
|
|
66
|
-
isError?: undefined;
|
|
67
|
-
} | {
|
|
68
|
-
content: {
|
|
69
|
-
type: string;
|
|
70
|
-
text: string;
|
|
71
|
-
}[];
|
|
72
|
-
isError: boolean;
|
|
73
|
-
}>;
|
|
74
|
-
export declare function handleListCommitFormats(_args: z.infer<typeof ListCommitFormatsSchema>): Promise<{
|
|
75
|
-
content: {
|
|
76
|
-
type: string;
|
|
77
|
-
text: string;
|
|
78
|
-
}[];
|
|
79
|
-
}>;
|
|
80
35
|
export declare function handleValidateApiKey(args: z.infer<typeof ValidateApiKeySchema>): Promise<{
|
|
81
36
|
content: {
|
|
82
37
|
type: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../src/server/tools.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,eAAO,MAAM,2BAA2B
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../src/server/tools.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,eAAO,MAAM,2BAA2B;;;;;;EAEtC,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;EAK/B,CAAC;AAGH,wBAAsB,2BAA2B,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC;;;;;;;;;;;;GA6ClG;AAED,wBAAsB,oBAAoB,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC;;;;;;;;;;;;GA+DpF"}
|
package/dist/server/tools.js
CHANGED
|
@@ -3,50 +3,12 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
import { AIService } from '../services/aiService.js';
|
|
6
|
-
import { GitService } from '../services/gitService.js';
|
|
7
6
|
import { Logger } from '../utils/logger.js';
|
|
8
7
|
import { ConfigService } from '../utils/config.js';
|
|
9
8
|
// Tool schemas
|
|
10
9
|
export const GenerateCommitMessageSchema = z.object({
|
|
11
10
|
repoPath: z.string().describe('Path to the git repository'),
|
|
12
|
-
provider: z
|
|
13
|
-
.enum(['gemini', 'openai', 'codestral', 'ollama'])
|
|
14
|
-
.optional()
|
|
15
|
-
.describe('AI provider to use (defaults to configured provider)'),
|
|
16
|
-
format: z
|
|
17
|
-
.enum([
|
|
18
|
-
'conventional',
|
|
19
|
-
'angular',
|
|
20
|
-
'karma',
|
|
21
|
-
'semantic',
|
|
22
|
-
'emoji',
|
|
23
|
-
'emojiKarma',
|
|
24
|
-
'google',
|
|
25
|
-
'atom',
|
|
26
|
-
])
|
|
27
|
-
.optional()
|
|
28
|
-
.describe('Commit message format'),
|
|
29
|
-
language: z
|
|
30
|
-
.enum(['english', 'russian', 'chinese', 'japanese', 'spanish'])
|
|
31
|
-
.optional()
|
|
32
|
-
.describe('Language for commit message'),
|
|
33
|
-
onlyStaged: z
|
|
34
|
-
.boolean()
|
|
35
|
-
.optional()
|
|
36
|
-
.describe('Only analyze staged changes (default: false)'),
|
|
37
|
-
customInstructions: z
|
|
38
|
-
.string()
|
|
39
|
-
.optional()
|
|
40
|
-
.describe('Custom instructions for commit message generation'),
|
|
41
11
|
});
|
|
42
|
-
export const AnalyzeChangesSchema = z.object({
|
|
43
|
-
repoPath: z.string().describe('Path to the git repository'),
|
|
44
|
-
onlyStaged: z
|
|
45
|
-
.boolean()
|
|
46
|
-
.optional()
|
|
47
|
-
.describe('Only analyze staged changes (default: false)'),
|
|
48
|
-
});
|
|
49
|
-
export const ListCommitFormatsSchema = z.object({});
|
|
50
12
|
export const ValidateApiKeySchema = z.object({
|
|
51
13
|
provider: z
|
|
52
14
|
.enum(['gemini', 'openai', 'codestral', 'ollama'])
|
|
@@ -57,87 +19,23 @@ export const ValidateApiKeySchema = z.object({
|
|
|
57
19
|
export async function handleGenerateCommitMessage(args) {
|
|
58
20
|
try {
|
|
59
21
|
Logger.log(`Generating commit message for: ${args.repoPath}`);
|
|
60
|
-
|
|
61
|
-
const originalEnv = { ...process.env };
|
|
62
|
-
if (args.format) {
|
|
63
|
-
process.env.DEFAULT_COMMIT_FORMAT = args.format;
|
|
64
|
-
}
|
|
65
|
-
if (args.language) {
|
|
66
|
-
process.env.DEFAULT_COMMIT_LANGUAGE = args.language;
|
|
67
|
-
}
|
|
68
|
-
if (args.customInstructions) {
|
|
69
|
-
process.env.USE_CUSTOM_INSTRUCTIONS = 'true';
|
|
70
|
-
process.env.CUSTOM_INSTRUCTIONS = args.customInstructions;
|
|
71
|
-
}
|
|
72
|
-
try {
|
|
73
|
-
const result = await AIService.generateCommitMessageForRepo(args.repoPath, args.onlyStaged || false, args.provider);
|
|
74
|
-
return {
|
|
75
|
-
content: [
|
|
76
|
-
{
|
|
77
|
-
type: 'text',
|
|
78
|
-
text: JSON.stringify({
|
|
79
|
-
success: true,
|
|
80
|
-
message: result.message,
|
|
81
|
-
model: result.model,
|
|
82
|
-
provider: args.provider || ConfigService.getProvider(),
|
|
83
|
-
}, null, 2),
|
|
84
|
-
},
|
|
85
|
-
],
|
|
86
|
-
};
|
|
87
|
-
}
|
|
88
|
-
finally {
|
|
89
|
-
// Restore original env
|
|
90
|
-
process.env = originalEnv;
|
|
91
|
-
ConfigService.initialize();
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
catch (error) {
|
|
95
|
-
Logger.error('Error generating commit message:', error);
|
|
96
|
-
return {
|
|
97
|
-
content: [
|
|
98
|
-
{
|
|
99
|
-
type: 'text',
|
|
100
|
-
text: JSON.stringify({
|
|
101
|
-
success: false,
|
|
102
|
-
error: error instanceof Error ? error.message : String(error),
|
|
103
|
-
}, null, 2),
|
|
104
|
-
},
|
|
105
|
-
],
|
|
106
|
-
isError: true,
|
|
107
|
-
};
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
export async function handleAnalyzeChanges(args) {
|
|
111
|
-
try {
|
|
112
|
-
Logger.log(`Analyzing changes for: ${args.repoPath}`);
|
|
113
|
-
await GitService.validateRepository(args.repoPath);
|
|
114
|
-
const hasStagedChanges = await GitService.hasChanges(args.repoPath, 'staged');
|
|
115
|
-
const hasUnstagedChanges = await GitService.hasChanges(args.repoPath, 'unstaged');
|
|
116
|
-
const hasUntrackedFiles = await GitService.hasChanges(args.repoPath, 'untracked');
|
|
117
|
-
const diff = await GitService.getDiff(args.repoPath, args.onlyStaged || false);
|
|
118
|
-
const changedFiles = await GitService.getChangedFiles(args.repoPath, args.onlyStaged || false);
|
|
22
|
+
const result = await AIService.generateCommitMessageForRepo(args.repoPath, false);
|
|
119
23
|
return {
|
|
120
24
|
content: [
|
|
121
25
|
{
|
|
122
26
|
type: 'text',
|
|
123
27
|
text: JSON.stringify({
|
|
124
28
|
success: true,
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
hasUntrackedFiles,
|
|
129
|
-
changedFilesCount: changedFiles.length,
|
|
130
|
-
changedFiles,
|
|
131
|
-
diffLength: diff.length,
|
|
132
|
-
diffPreview: diff.substring(0, 500),
|
|
133
|
-
},
|
|
29
|
+
message: result.message,
|
|
30
|
+
model: result.model,
|
|
31
|
+
provider: ConfigService.getProvider(),
|
|
134
32
|
}, null, 2),
|
|
135
33
|
},
|
|
136
34
|
],
|
|
137
35
|
};
|
|
138
36
|
}
|
|
139
37
|
catch (error) {
|
|
140
|
-
Logger.error('Error
|
|
38
|
+
Logger.error('Error generating commit message:', error);
|
|
141
39
|
return {
|
|
142
40
|
content: [
|
|
143
41
|
{
|
|
@@ -152,62 +50,6 @@ export async function handleAnalyzeChanges(args) {
|
|
|
152
50
|
};
|
|
153
51
|
}
|
|
154
52
|
}
|
|
155
|
-
export async function handleListCommitFormats(_args) {
|
|
156
|
-
const formats = [
|
|
157
|
-
{
|
|
158
|
-
name: 'conventional',
|
|
159
|
-
description: 'Conventional Commits format: type(scope): description',
|
|
160
|
-
example: 'feat(auth): add OAuth2 authentication',
|
|
161
|
-
},
|
|
162
|
-
{
|
|
163
|
-
name: 'angular',
|
|
164
|
-
description: 'Angular commit format with type, scope, and summary',
|
|
165
|
-
example: 'build(deps): update dependency versions',
|
|
166
|
-
},
|
|
167
|
-
{
|
|
168
|
-
name: 'karma',
|
|
169
|
-
description: 'Karma format: type(scope): message',
|
|
170
|
-
example: 'fix(parser): handle edge case in tokenizer',
|
|
171
|
-
},
|
|
172
|
-
{
|
|
173
|
-
name: 'semantic',
|
|
174
|
-
description: 'Semantic format: type: message',
|
|
175
|
-
example: 'refactor: simplify user authentication flow',
|
|
176
|
-
},
|
|
177
|
-
{
|
|
178
|
-
name: 'emoji',
|
|
179
|
-
description: 'Emoji-based commit messages',
|
|
180
|
-
example: ':sparkles: Add dark mode support',
|
|
181
|
-
},
|
|
182
|
-
{
|
|
183
|
-
name: 'emojiKarma',
|
|
184
|
-
description: 'Combination of emoji and Karma format',
|
|
185
|
-
example: ':bug: fix(ui): correct button alignment',
|
|
186
|
-
},
|
|
187
|
-
{
|
|
188
|
-
name: 'google',
|
|
189
|
-
description: 'Google commit format with capitalized type',
|
|
190
|
-
example: 'Feature: Add user profile page',
|
|
191
|
-
},
|
|
192
|
-
{
|
|
193
|
-
name: 'atom',
|
|
194
|
-
description: 'Atom editor commit format',
|
|
195
|
-
example: 'feat(editor): add syntax highlighting',
|
|
196
|
-
},
|
|
197
|
-
];
|
|
198
|
-
return {
|
|
199
|
-
content: [
|
|
200
|
-
{
|
|
201
|
-
type: 'text',
|
|
202
|
-
text: JSON.stringify({
|
|
203
|
-
success: true,
|
|
204
|
-
formats,
|
|
205
|
-
currentFormat: ConfigService.getCommitFormat(),
|
|
206
|
-
}, null, 2),
|
|
207
|
-
},
|
|
208
|
-
],
|
|
209
|
-
};
|
|
210
|
-
}
|
|
211
53
|
export async function handleValidateApiKey(args) {
|
|
212
54
|
try {
|
|
213
55
|
const provider = args.provider;
|
package/dist/server/tools.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../../src/server/tools.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../../src/server/tools.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAErD,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,eAAe;AACf,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC,MAAM,CAAC;IAClD,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,4BAA4B,CAAC;CAC5D,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,QAAQ,EAAE,CAAC;SACR,IAAI,CAAC,CAAC,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,CAAC,CAAC;SACjD,QAAQ,CAAC,sBAAsB,CAAC;IACnC,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,0DAA0D,CAAC;CACnG,CAAC,CAAC;AAEH,gBAAgB;AAChB,MAAM,CAAC,KAAK,UAAU,2BAA2B,CAAC,IAAiD;IACjG,IAAI,CAAC;QACH,MAAM,CAAC,GAAG,CAAC,kCAAkC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;QAE9D,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,4BAA4B,CACzD,IAA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