svn-mcp 1.0.0
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/LICENSE +21 -0
- package/README.md +165 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +27 -0
- package/dist/index.js.map +1 -0
- package/dist/tools/index.d.ts +3 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +39 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/svn-blame.d.ts +13 -0
- package/dist/tools/svn-blame.d.ts.map +1 -0
- package/dist/tools/svn-blame.js +68 -0
- package/dist/tools/svn-blame.js.map +1 -0
- package/dist/tools/svn-diff.d.ts +12 -0
- package/dist/tools/svn-diff.d.ts.map +1 -0
- package/dist/tools/svn-diff.js +68 -0
- package/dist/tools/svn-diff.js.map +1 -0
- package/dist/tools/svn-info.d.ts +10 -0
- package/dist/tools/svn-info.d.ts.map +1 -0
- package/dist/tools/svn-info.js +50 -0
- package/dist/tools/svn-info.js.map +1 -0
- package/dist/tools/svn-log.d.ts +14 -0
- package/dist/tools/svn-log.d.ts.map +1 -0
- package/dist/tools/svn-log.js +105 -0
- package/dist/tools/svn-log.js.map +1 -0
- package/dist/tools/svn-status.d.ts +11 -0
- package/dist/tools/svn-status.d.ts.map +1 -0
- package/dist/tools/svn-status.js +80 -0
- package/dist/tools/svn-status.js.map +1 -0
- package/dist/types/index.d.ts +75 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +20 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/svn-executor.d.ts +5 -0
- package/dist/utils/svn-executor.d.ts.map +1 -0
- package/dist/utils/svn-executor.js +99 -0
- package/dist/utils/svn-executor.js.map +1 -0
- package/dist/utils/working-copy.d.ts +17 -0
- package/dist/utils/working-copy.d.ts.map +1 -0
- package/dist/utils/working-copy.js +133 -0
- package/dist/utils/working-copy.js.map +1 -0
- package/dist/utils/xml-parser.d.ts +6 -0
- package/dist/utils/xml-parser.d.ts.map +1 -0
- package/dist/utils/xml-parser.js +183 -0
- package/dist/utils/xml-parser.js.map +1 -0
- package/package.json +50 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Will Brock
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
# svn-mcp
|
|
2
|
+
|
|
3
|
+
An MCP (Model Context Protocol) server that provides SVN repository information to Claude Code and other AI assistants.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **svn_info** - Get repository/working copy information including branch detection
|
|
8
|
+
- **svn_status** - Show modified, added, deleted, and untracked files
|
|
9
|
+
- **svn_log** - View commit history with optional path details
|
|
10
|
+
- **svn_diff** - Show file differences (working copy or between revisions)
|
|
11
|
+
- **svn_blame** - Line-by-line annotation with revision and author
|
|
12
|
+
|
|
13
|
+
### Hybrid Local/Network Approach
|
|
14
|
+
|
|
15
|
+
The server intelligently chooses between local and network operations:
|
|
16
|
+
- **Local operations** (no network): When files exist in a local SVN working copy
|
|
17
|
+
- **Network operations**: When accessing remote repository data or cross-revision comparisons
|
|
18
|
+
|
|
19
|
+
This minimizes network calls for common operations like viewing file history.
|
|
20
|
+
|
|
21
|
+
## Installation
|
|
22
|
+
|
|
23
|
+
### Prerequisites
|
|
24
|
+
|
|
25
|
+
- Node.js 18+
|
|
26
|
+
- SVN command-line client (`svn`) installed and in PATH
|
|
27
|
+
|
|
28
|
+
### Via npx (Recommended)
|
|
29
|
+
|
|
30
|
+
No installation required - use directly with npx:
|
|
31
|
+
|
|
32
|
+
```json
|
|
33
|
+
{
|
|
34
|
+
"mcpServers": {
|
|
35
|
+
"svn": {
|
|
36
|
+
"command": "npx",
|
|
37
|
+
"args": ["-y", "svn-mcp"]
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Global Installation
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
npm install -g svn-mcp
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Configuration
|
|
50
|
+
|
|
51
|
+
Configure via environment variables in your MCP settings:
|
|
52
|
+
|
|
53
|
+
| Variable | Required | Description |
|
|
54
|
+
|----------|----------|-------------|
|
|
55
|
+
| `SVN_USERNAME` | No | SVN authentication username |
|
|
56
|
+
| `SVN_PASSWORD` | No | SVN authentication password |
|
|
57
|
+
| `SVN_REPO_URL` | No | Base repository URL (svn://, https://, svn+ssh://) |
|
|
58
|
+
| `SVN_TRUNK_PATH` | No | Path to trunk within repo (e.g., `trunk` or `branches/12.0/trunk`) |
|
|
59
|
+
| `SVN_LOCAL_WORKING_COPY` | No | Local working copy path for file history without network |
|
|
60
|
+
|
|
61
|
+
### Example Configuration
|
|
62
|
+
|
|
63
|
+
Add to your Claude Code MCP settings (`.mcp.json` or Claude Desktop config):
|
|
64
|
+
|
|
65
|
+
```json
|
|
66
|
+
{
|
|
67
|
+
"mcpServers": {
|
|
68
|
+
"svn": {
|
|
69
|
+
"command": "npx",
|
|
70
|
+
"args": ["-y", "svn-mcp"],
|
|
71
|
+
"env": {
|
|
72
|
+
"SVN_USERNAME": "your-username",
|
|
73
|
+
"SVN_PASSWORD": "your-password",
|
|
74
|
+
"SVN_REPO_URL": "svn://your-server.com/repo",
|
|
75
|
+
"SVN_TRUNK_PATH": "trunk",
|
|
76
|
+
"SVN_LOCAL_WORKING_COPY": "/path/to/local/checkout"
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Tools
|
|
84
|
+
|
|
85
|
+
### svn_info
|
|
86
|
+
|
|
87
|
+
Get repository and working copy information.
|
|
88
|
+
|
|
89
|
+
**Parameters:**
|
|
90
|
+
- `path` (optional): Path or URL to query
|
|
91
|
+
|
|
92
|
+
**Returns:** URL, revision, branch type, last commit details
|
|
93
|
+
|
|
94
|
+
### svn_status
|
|
95
|
+
|
|
96
|
+
Show working copy status.
|
|
97
|
+
|
|
98
|
+
**Parameters:**
|
|
99
|
+
- `path` (optional): Working copy path
|
|
100
|
+
- `show_unversioned` (optional, default: true): Include unversioned files
|
|
101
|
+
|
|
102
|
+
**Returns:** List of modified/added/deleted files grouped by status
|
|
103
|
+
|
|
104
|
+
### svn_log
|
|
105
|
+
|
|
106
|
+
Show commit history.
|
|
107
|
+
|
|
108
|
+
**Parameters:**
|
|
109
|
+
- `path` (optional): File or directory path
|
|
110
|
+
- `limit` (optional, default: 10): Maximum entries
|
|
111
|
+
- `revision` (optional): Revision range (e.g., "1000:HEAD")
|
|
112
|
+
- `verbose` (optional, default: false): Include changed paths
|
|
113
|
+
- `search` (optional): Filter by log message
|
|
114
|
+
|
|
115
|
+
**Returns:** List of commits with revision, author, date, message
|
|
116
|
+
|
|
117
|
+
### svn_diff
|
|
118
|
+
|
|
119
|
+
Show file differences.
|
|
120
|
+
|
|
121
|
+
**Parameters:**
|
|
122
|
+
- `path` (optional): File or directory path
|
|
123
|
+
- `revision` (optional): Revision range
|
|
124
|
+
- `change` (optional): Show changes from specific revision
|
|
125
|
+
|
|
126
|
+
**Returns:** Unified diff output
|
|
127
|
+
|
|
128
|
+
### svn_blame
|
|
129
|
+
|
|
130
|
+
Show line-by-line annotation.
|
|
131
|
+
|
|
132
|
+
**Parameters:**
|
|
133
|
+
- `path` (required): File path to annotate
|
|
134
|
+
- `revision` (optional): Annotate up to this revision
|
|
135
|
+
- `start_line` (optional): Start line number
|
|
136
|
+
- `end_line` (optional): End line number
|
|
137
|
+
|
|
138
|
+
**Returns:** Each line with revision, author, and content
|
|
139
|
+
|
|
140
|
+
## Development
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
# Clone the repository
|
|
144
|
+
git clone https://github.com/willbrock/svn-mcp.git
|
|
145
|
+
cd svn-mcp
|
|
146
|
+
|
|
147
|
+
# Install dependencies
|
|
148
|
+
npm install
|
|
149
|
+
|
|
150
|
+
# Build
|
|
151
|
+
npm run build
|
|
152
|
+
|
|
153
|
+
# Run in development mode
|
|
154
|
+
npm run dev
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
## Testing with MCP Inspector
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
npx @modelcontextprotocol/inspector node dist/index.js
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
## License
|
|
164
|
+
|
|
165
|
+
MIT
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
3
|
+
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
4
|
+
import { registerTools } from './tools/index.js';
|
|
5
|
+
import { isSvnInstalled } from './utils/svn-executor.js';
|
|
6
|
+
const server = new McpServer({
|
|
7
|
+
name: 'svn-mcp',
|
|
8
|
+
version: '1.0.0',
|
|
9
|
+
});
|
|
10
|
+
// Register all SVN tools
|
|
11
|
+
registerTools(server);
|
|
12
|
+
async function main() {
|
|
13
|
+
// Check if SVN is installed
|
|
14
|
+
const svnAvailable = await isSvnInstalled();
|
|
15
|
+
if (!svnAvailable) {
|
|
16
|
+
console.error('Warning: SVN command not found. Please ensure SVN is installed and in your PATH.');
|
|
17
|
+
console.error('Some operations may fail until SVN is available.');
|
|
18
|
+
}
|
|
19
|
+
const transport = new StdioServerTransport();
|
|
20
|
+
await server.connect(transport);
|
|
21
|
+
console.error('SVN MCP Server running on stdio');
|
|
22
|
+
}
|
|
23
|
+
main().catch((error) => {
|
|
24
|
+
console.error('Fatal error:', error);
|
|
25
|
+
process.exit(1);
|
|
26
|
+
});
|
|
27
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAEzD,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC;IAC3B,IAAI,EAAE,SAAS;IACf,OAAO,EAAE,OAAO;CACjB,CAAC,CAAC;AAEH,yBAAyB;AACzB,aAAa,CAAC,MAAM,CAAC,CAAC;AAEtB,KAAK,UAAU,IAAI;IACjB,4BAA4B;IAC5B,MAAM,YAAY,GAAG,MAAM,cAAc,EAAE,CAAC;IAC5C,IAAI,CAAC,YAAY,EAAE,CAAC;QAClB,OAAO,CAAC,KAAK,CAAC,kFAAkF,CAAC,CAAC;QAClG,OAAO,CAAC,KAAK,CAAC,kDAAkD,CAAC,CAAC;IACpE,CAAC;IAED,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,OAAO,CAAC,KAAK,CAAC,iCAAiC,CAAC,CAAC;AACnD,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;IACrC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAQpE,wBAAgB,aAAa,CAAC,MAAM,EAAE,SAAS,QA4D9C"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { handleSvnInfo } from './svn-info.js';
|
|
3
|
+
import { handleSvnStatus } from './svn-status.js';
|
|
4
|
+
import { handleSvnLog } from './svn-log.js';
|
|
5
|
+
import { handleSvnDiff } from './svn-diff.js';
|
|
6
|
+
import { handleSvnBlame } from './svn-blame.js';
|
|
7
|
+
export function registerTools(server) {
|
|
8
|
+
// svn_info - Get repository and working copy information
|
|
9
|
+
server.tool('svn_info', 'Get SVN repository and working copy information including URL, revision, branch type, and last commit details', {
|
|
10
|
+
path: z.string().optional().describe('Path or URL to query (defaults to current working copy or configured repo)'),
|
|
11
|
+
}, async (input) => handleSvnInfo(input));
|
|
12
|
+
// svn_status - Show working copy status
|
|
13
|
+
server.tool('svn_status', 'Show modified, added, deleted, and untracked files in the SVN working copy', {
|
|
14
|
+
path: z.string().optional().describe('Working copy path to check (defaults to current directory)'),
|
|
15
|
+
show_unversioned: z.boolean().optional().default(true).describe('Include unversioned files in output'),
|
|
16
|
+
}, async (input) => handleSvnStatus(input));
|
|
17
|
+
// svn_log - Show commit history
|
|
18
|
+
server.tool('svn_log', 'Show SVN commit history for repository or specific file. Uses local working copy when possible to avoid network calls.', {
|
|
19
|
+
path: z.string().optional().describe('File or directory path to show history for'),
|
|
20
|
+
limit: z.number().optional().default(10).describe('Maximum number of log entries to show'),
|
|
21
|
+
revision: z.string().optional().describe('Revision or revision range (e.g., "1000:HEAD", "BASE:HEAD")'),
|
|
22
|
+
verbose: z.boolean().optional().default(false).describe('Include list of changed paths in each commit'),
|
|
23
|
+
search: z.string().optional().describe('Search pattern to filter log messages'),
|
|
24
|
+
}, async (input) => handleSvnLog(input));
|
|
25
|
+
// svn_diff - Show file differences
|
|
26
|
+
server.tool('svn_diff', 'Show differences between working copy and BASE, or between revisions. Returns unified diff format.', {
|
|
27
|
+
path: z.string().optional().describe('File or directory path to diff'),
|
|
28
|
+
revision: z.string().optional().describe('Revision range (e.g., "1000:1005", "BASE:HEAD")'),
|
|
29
|
+
change: z.number().optional().describe('Show changes made in a specific revision number'),
|
|
30
|
+
}, async (input) => handleSvnDiff(input));
|
|
31
|
+
// svn_blame - Show line-by-line annotation
|
|
32
|
+
server.tool('svn_blame', 'Show line-by-line annotation of a file with revision and author information for each line', {
|
|
33
|
+
path: z.string().describe('File path to annotate (required)'),
|
|
34
|
+
revision: z.string().optional().describe('Annotate up to this revision'),
|
|
35
|
+
start_line: z.number().optional().describe('Start line number for output'),
|
|
36
|
+
end_line: z.number().optional().describe('End line number for output'),
|
|
37
|
+
}, async (input) => handleSvnBlame(input));
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEhD,MAAM,UAAU,aAAa,CAAC,MAAiB;IAC7C,yDAAyD;IACzD,MAAM,CAAC,IAAI,CACT,UAAU,EACV,+GAA+G,EAC/G;QACE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,4EAA4E,CAAC;KACnH,EACD,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,CACtC,CAAC;IAEF,wCAAwC;IACxC,MAAM,CAAC,IAAI,CACT,YAAY,EACZ,4EAA4E,EAC5E;QACE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,4DAA4D,CAAC;QAClG,gBAAgB,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,qCAAqC,CAAC;KACvG,EACD,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,eAAe,CAAC,KAAK,CAAC,CACxC,CAAC;IAEF,gCAAgC;IAChC,MAAM,CAAC,IAAI,CACT,SAAS,EACT,wHAAwH,EACxH;QACE,IAAI,EAAE,CAAC,CAAC,MAAM,EAA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AC,QAAQ,CAAC,8BAA8B,CAAC;QACxE,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,8BAA8B,CAAC;QAC1E,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,4BAA4B,CAAC;KACvE,EACD,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,cAAc,CAAC,KAAK,CAAC,CACvC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface SvnBlameInput {
|
|
2
|
+
path: string;
|
|
3
|
+
revision?: string;
|
|
4
|
+
start_line?: number;
|
|
5
|
+
end_line?: number;
|
|
6
|
+
}
|
|
7
|
+
export declare function handleSvnBlame(input: SvnBlameInput): Promise<{
|
|
8
|
+
content: Array<{
|
|
9
|
+
type: 'text';
|
|
10
|
+
text: string;
|
|
11
|
+
}>;
|
|
12
|
+
}>;
|
|
13
|
+
//# sourceMappingURL=svn-blame.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"svn-blame.d.ts","sourceRoot":"","sources":["../../src/tools/svn-blame.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,wBAAsB,cAAc,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC,CA4EtH"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { executeSvnCommand } from '../utils/svn-executor.js';
|
|
2
|
+
import { resolvePathForOperation } from '../utils/working-copy.js';
|
|
3
|
+
import { parseBlameOutput } from '../utils/xml-parser.js';
|
|
4
|
+
import { SvnError, SVN_ERROR_CODES } from '../types/index.js';
|
|
5
|
+
export async function handleSvnBlame(input) {
|
|
6
|
+
try {
|
|
7
|
+
if (!input.path) {
|
|
8
|
+
throw new SvnError('Path is required for blame operation', SVN_ERROR_CODES.FILE_NOT_FOUND);
|
|
9
|
+
}
|
|
10
|
+
const resolved = await resolvePathForOperation(input.path, 'blame');
|
|
11
|
+
const args = [];
|
|
12
|
+
if (input.revision) {
|
|
13
|
+
args.push('-r', input.revision);
|
|
14
|
+
}
|
|
15
|
+
args.push(resolved.path);
|
|
16
|
+
const output = await executeSvnCommand('blame', args, {
|
|
17
|
+
useCredentials: resolved.useCredentials,
|
|
18
|
+
workingDir: resolved.workingDir,
|
|
19
|
+
});
|
|
20
|
+
if (!output.trim()) {
|
|
21
|
+
return {
|
|
22
|
+
content: [{ type: 'text', text: 'No blame output (file may be empty or binary).' }],
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
const entries = parseBlameOutput(output);
|
|
26
|
+
// Apply line range filter if specified
|
|
27
|
+
let filteredEntries = entries;
|
|
28
|
+
if (input.start_line || input.end_line) {
|
|
29
|
+
const start = input.start_line ?? 1;
|
|
30
|
+
const end = input.end_line ?? entries.length;
|
|
31
|
+
filteredEntries = entries.filter(e => e.lineNumber >= start && e.lineNumber <= end);
|
|
32
|
+
}
|
|
33
|
+
if (filteredEntries.length === 0) {
|
|
34
|
+
return {
|
|
35
|
+
content: [{ type: 'text', text: 'No lines found in specified range.' }],
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
// Format output
|
|
39
|
+
const lines = [];
|
|
40
|
+
lines.push(`Blame for: ${input.path}`);
|
|
41
|
+
if (input.start_line || input.end_line) {
|
|
42
|
+
lines.push(`Lines ${input.start_line ?? 1} to ${input.end_line ?? entries.length}`);
|
|
43
|
+
}
|
|
44
|
+
lines.push('');
|
|
45
|
+
// Calculate column widths
|
|
46
|
+
const maxRev = Math.max(...filteredEntries.map(e => e.revision.toString().length));
|
|
47
|
+
const maxAuthor = Math.max(...filteredEntries.map(e => e.author.length));
|
|
48
|
+
const maxLine = Math.max(...filteredEntries.map(e => e.lineNumber.toString().length));
|
|
49
|
+
for (const entry of filteredEntries) {
|
|
50
|
+
const rev = entry.revision.toString().padStart(maxRev);
|
|
51
|
+
const author = entry.author.padEnd(maxAuthor);
|
|
52
|
+
const lineNum = entry.lineNumber.toString().padStart(maxLine);
|
|
53
|
+
lines.push(`${rev} ${author} ${lineNum}: ${entry.content}`);
|
|
54
|
+
}
|
|
55
|
+
return {
|
|
56
|
+
content: [{ type: 'text', text: lines.join('\n') }],
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
catch (error) {
|
|
60
|
+
if (error instanceof SvnError) {
|
|
61
|
+
return {
|
|
62
|
+
content: [{ type: 'text', text: `Error: ${error.message}\nCode: ${error.code}${error.details ? `\nDetails: ${error.details}` : ''}` }],
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
throw error;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=svn-blame.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"svn-blame.js","sourceRoot":"","sources":["../../src/tools/svn-blame.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAS9D,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,KAAoB;IACvD,IAAI,CAAC;QACH,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;YAChB,MAAM,IAAI,QAAQ,CAChB,sCAAsC,EACtC,eAAe,CA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,GAAG,KAAK,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;YAC9D,KAAK,CAAC,IAAI,CAAC,GAAG,GAAG,IAAI,MAAM,IAAI,OAAO,KAAK,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;QAC9D,CAAC;QAED,OAAO;YACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;SACpD,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,KAAK,YAAY,QAAQ,EAAE,CAAC;YAC9B,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,KAAK,CAAC,OAAO,WAAW,KAAK,CAAC,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,cAAc,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC;aACvI,CAAC;QACJ,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface SvnDiffInput {
|
|
2
|
+
path?: string;
|
|
3
|
+
revision?: string;
|
|
4
|
+
change?: number;
|
|
5
|
+
}
|
|
6
|
+
export declare function handleSvnDiff(input: SvnDiffInput): Promise<{
|
|
7
|
+
content: Array<{
|
|
8
|
+
type: 'text';
|
|
9
|
+
text: string;
|
|
10
|
+
}>;
|
|
11
|
+
}>;
|
|
12
|
+
//# sourceMappingURL=svn-diff.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"svn-diff.d.ts","sourceRoot":"","sources":["../../src/tools/svn-diff.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,YAAY;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAsB,aAAa,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC,CAiEpH"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { executeSvnCommand } from '../utils/svn-executor.js';
|
|
2
|
+
import { resolvePathForOperation, findWorkingCopyRoot } from '../utils/working-copy.js';
|
|
3
|
+
import { SvnError } from '../types/index.js';
|
|
4
|
+
export async function handleSvnDiff(input) {
|
|
5
|
+
try {
|
|
6
|
+
const args = [];
|
|
7
|
+
let useCredentials = false;
|
|
8
|
+
let workingDir;
|
|
9
|
+
let targetPath;
|
|
10
|
+
if (input.path) {
|
|
11
|
+
const resolved = await resolvePathForOperation(input.path, 'diff');
|
|
12
|
+
targetPath = resolved.path;
|
|
13
|
+
useCredentials = resolved.useCredentials;
|
|
14
|
+
workingDir = resolved.workingDir;
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
// Default to current directory
|
|
18
|
+
targetPath = process.cwd();
|
|
19
|
+
const wcRoot = await findWorkingCopyRoot(targetPath);
|
|
20
|
+
if (wcRoot) {
|
|
21
|
+
workingDir = wcRoot;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
// Add revision options
|
|
25
|
+
if (input.change) {
|
|
26
|
+
// Show changes made in a specific revision
|
|
27
|
+
args.push('-c', input.change.toString());
|
|
28
|
+
useCredentials = true; // Cross-revision diff typically needs network
|
|
29
|
+
}
|
|
30
|
+
else if (input.revision) {
|
|
31
|
+
// Revision range (e.g., "1000:1005" or "HEAD")
|
|
32
|
+
args.push('-r', input.revision);
|
|
33
|
+
if (input.revision.includes(':') || input.revision !== 'BASE') {
|
|
34
|
+
useCredentials = true;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
args.push(targetPath);
|
|
38
|
+
const output = await executeSvnCommand('diff', args, { useCredentials, workingDir });
|
|
39
|
+
if (!output.trim()) {
|
|
40
|
+
return {
|
|
41
|
+
content: [{ type: 'text', text: 'No differences found.' }],
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
// Add some context about what we're diffing
|
|
45
|
+
let header = 'Diff output:\n';
|
|
46
|
+
if (input.change) {
|
|
47
|
+
header = `Changes in revision ${input.change}:\n`;
|
|
48
|
+
}
|
|
49
|
+
else if (input.revision) {
|
|
50
|
+
header = `Diff for revision range ${input.revision}:\n`;
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
header = 'Working copy changes (BASE vs working copy):\n';
|
|
54
|
+
}
|
|
55
|
+
return {
|
|
56
|
+
content: [{ type: 'text', text: header + '\n' + output }],
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
catch (error) {
|
|
60
|
+
if (error instanceof SvnError) {
|
|
61
|
+
return {
|
|
62
|
+
content: [{ type: 'text', text: `Error: ${error.message}\nCode: ${error.code}${error.details ? `\nDetails: ${error.details}` : ''}` }],
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
throw error;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=svn-diff.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"svn-diff.js","sourceRoot":"","sources":["../../src/tools/svn-diff.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AACxF,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAS7C,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,KAAmB;IACrD,IAAI,CAAC;QACH,MAAM,IAAI,GAAa,EAAE,CAAC;QAC1B,IAAI,cAAc,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,wBAAsB,aAAa,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC,CAoDpH"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { getRepoInfo, resolvePathForOperation } from '../utils/working-copy.js';
|
|
2
|
+
import { executeSvnCommand } from '../utils/svn-executor.js';
|
|
3
|
+
import { parseInfoXml } from '../utils/xml-parser.js';
|
|
4
|
+
import { SvnError } from '../types/index.js';
|
|
5
|
+
export async function handleSvnInfo(input) {
|
|
6
|
+
try {
|
|
7
|
+
let info;
|
|
8
|
+
if (input.path) {
|
|
9
|
+
const resolved = await resolvePathForOperation(input.path, 'info');
|
|
10
|
+
const output = await executeSvnCommand('info', ['--xml', resolved.path], { useCredentials: resolved.useCredentials, workingDir: resolved.workingDir });
|
|
11
|
+
info = parseInfoXml(output);
|
|
12
|
+
}
|
|
13
|
+
else {
|
|
14
|
+
info = await getRepoInfo();
|
|
15
|
+
}
|
|
16
|
+
const lines = [
|
|
17
|
+
`Path: ${info.path}`,
|
|
18
|
+
`URL: ${info.url}`,
|
|
19
|
+
`Relative URL: ${info.relativeUrl}`,
|
|
20
|
+
`Repository Root: ${info.repositoryRoot}`,
|
|
21
|
+
`Repository UUID: ${info.repositoryUuid}`,
|
|
22
|
+
`Revision: ${info.revision}`,
|
|
23
|
+
`Node Kind: ${info.nodeKind}`,
|
|
24
|
+
`Last Changed Author: ${info.lastChangedAuthor}`,
|
|
25
|
+
`Last Changed Rev: ${info.lastChangedRev}`,
|
|
26
|
+
`Last Changed Date: ${info.lastChangedDate}`,
|
|
27
|
+
];
|
|
28
|
+
if (info.wcRoot) {
|
|
29
|
+
lines.push(`Working Copy Root Path: ${info.wcRoot}`);
|
|
30
|
+
}
|
|
31
|
+
if (info.branchType) {
|
|
32
|
+
lines.push(`Branch Type: ${info.branchType}`);
|
|
33
|
+
}
|
|
34
|
+
if (info.branchName) {
|
|
35
|
+
lines.push(`Branch Name: ${info.branchName}`);
|
|
36
|
+
}
|
|
37
|
+
return {
|
|
38
|
+
content: [{ type: 'text', text: lines.join('\n') }],
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
catch (error) {
|
|
42
|
+
if (error instanceof SvnError) {
|
|
43
|
+
return {
|
|
44
|
+
content: [{ type: 'text', text: `Error: ${error.message}\nCode: ${error.code}${error.details ? `\nDetails: ${error.details}` : ''}` }],
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
throw error;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=svn-info.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"svn-info.js","sourceRoot":"","sources":["../../src/tools/svn-info.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAChF,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAM7C,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,KAAmB;IACrD,IAAI,CAAC;QACH,IAAI,IAAI,CAAC;QAET,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC;YACf,MAAM,QAAQ,GAAG,MAAM,uBAAuB,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;YACnE,MAAM,MAAM,GAAG,MAAM,iBAAiB,CACpC,MAAM,EACN,CAAC,OAAO,EAAE,QAAQ,CAAC,IAAI,CAAC,EACxB,EAAE,cAAc,EAAE,QAAQ,CAAC,cAAc,EAAE,UAAU,EAAE,QAAQ,CAAC,UAAU,EAAE,CAC7E,CAAC;YACF,IAAI,GAAG,YAAY,CAAC,MAAM,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CAAC,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,cAAc,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC;aACvI,CAAC;QACJ,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface SvnLogInput {
|
|
2
|
+
path?: string;
|
|
3
|
+
limit?: number;
|
|
4
|
+
revision?: string;
|
|
5
|
+
verbose?: boolean;
|
|
6
|
+
search?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function handleSvnLog(input: SvnLogInput): Promise<{
|
|
9
|
+
content: Array<{
|
|
10
|
+
type: 'text';
|
|
11
|
+
text: string;
|
|
12
|
+
}>;
|
|
13
|
+
}>;
|
|
14
|
+
//# sourceMappingURL=svn-log.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"svn-log.d.ts","sourceRoot":"","sources":["../../src/tools/svn-log.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,WAAW;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAsB,YAAY,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC,CA8FlH"}
|