@zhanglc77/bitbucket-mcp-server 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/CHANGELOG.md +280 -0
- package/LICENSE +21 -0
- package/README.md +1090 -0
- package/build/handlers/branch-handlers.d.ts +55 -0
- package/build/handlers/branch-handlers.d.ts.map +1 -0
- package/build/handlers/branch-handlers.js +522 -0
- package/build/handlers/branch-handlers.js.map +1 -0
- package/build/handlers/file-handlers.d.ts +33 -0
- package/build/handlers/file-handlers.d.ts.map +1 -0
- package/build/handlers/file-handlers.js +308 -0
- package/build/handlers/file-handlers.js.map +1 -0
- package/build/handlers/pull-request-handlers.d.ts +101 -0
- package/build/handlers/pull-request-handlers.d.ts.map +1 -0
- package/build/handlers/pull-request-handlers.js +955 -0
- package/build/handlers/pull-request-handlers.js.map +1 -0
- package/build/handlers/review-handlers.d.ts +67 -0
- package/build/handlers/review-handlers.d.ts.map +1 -0
- package/build/handlers/review-handlers.js +252 -0
- package/build/handlers/review-handlers.js.map +1 -0
- package/build/handlers/search-handlers.d.ts +20 -0
- package/build/handlers/search-handlers.d.ts.map +1 -0
- package/build/handlers/search-handlers.js +151 -0
- package/build/handlers/search-handlers.js.map +1 -0
- package/build/index.d.ts +3 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +120 -0
- package/build/index.js.map +1 -0
- package/build/tools/definitions.d.ts +1191 -0
- package/build/tools/definitions.d.ts.map +1 -0
- package/build/tools/definitions.js +655 -0
- package/build/tools/definitions.js.map +1 -0
- package/build/types/bitbucket.d.ts +483 -0
- package/build/types/bitbucket.d.ts.map +1 -0
- package/build/types/bitbucket.js +2 -0
- package/build/types/bitbucket.js.map +1 -0
- package/build/types/guards.d.ts +140 -0
- package/build/types/guards.d.ts.map +1 -0
- package/build/types/guards.js +140 -0
- package/build/types/guards.js.map +1 -0
- package/build/utils/api-client.d.ts +22 -0
- package/build/utils/api-client.d.ts.map +1 -0
- package/build/utils/api-client.js +111 -0
- package/build/utils/api-client.js.map +1 -0
- package/build/utils/diff-parser.d.ts +42 -0
- package/build/utils/diff-parser.d.ts.map +1 -0
- package/build/utils/diff-parser.js +165 -0
- package/build/utils/diff-parser.js.map +1 -0
- package/build/utils/formatters.d.ts +8 -0
- package/build/utils/formatters.d.ts.map +1 -0
- package/build/utils/formatters.js +207 -0
- package/build/utils/formatters.js.map +1 -0
- package/build/utils/suggestion-formatter.d.ts +6 -0
- package/build/utils/suggestion-formatter.d.ts.map +1 -0
- package/build/utils/suggestion-formatter.js +17 -0
- package/build/utils/suggestion-formatter.js.map +1 -0
- package/package.json +55 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"definitions.d.ts","sourceRoot":"","sources":["../../src/tools/definitions.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA6oB3B,CAAC"}
|
|
@@ -0,0 +1,655 @@
|
|
|
1
|
+
export const toolDefinitions = [
|
|
2
|
+
{
|
|
3
|
+
name: 'get_pull_request',
|
|
4
|
+
description: 'Get details of a Bitbucket pull request including merge commit information',
|
|
5
|
+
inputSchema: {
|
|
6
|
+
type: 'object',
|
|
7
|
+
properties: {
|
|
8
|
+
workspace: {
|
|
9
|
+
type: 'string',
|
|
10
|
+
description: 'Bitbucket workspace/project key (e.g., "PROJ")',
|
|
11
|
+
},
|
|
12
|
+
repository: {
|
|
13
|
+
type: 'string',
|
|
14
|
+
description: 'Repository slug (e.g., "my-repo")',
|
|
15
|
+
},
|
|
16
|
+
pull_request_id: {
|
|
17
|
+
type: 'number',
|
|
18
|
+
description: 'Pull request ID',
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
required: ['workspace', 'repository', 'pull_request_id'],
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
name: 'list_pull_requests',
|
|
26
|
+
description: 'List pull requests for a repository with optional filters',
|
|
27
|
+
inputSchema: {
|
|
28
|
+
type: 'object',
|
|
29
|
+
properties: {
|
|
30
|
+
workspace: {
|
|
31
|
+
type: 'string',
|
|
32
|
+
description: 'Bitbucket workspace/project key (e.g., "PROJ")',
|
|
33
|
+
},
|
|
34
|
+
repository: {
|
|
35
|
+
type: 'string',
|
|
36
|
+
description: 'Repository slug (e.g., "my-repo")',
|
|
37
|
+
},
|
|
38
|
+
state: {
|
|
39
|
+
type: 'string',
|
|
40
|
+
description: 'Filter by PR state: OPEN, MERGED, DECLINED, ALL (default: OPEN)',
|
|
41
|
+
enum: ['OPEN', 'MERGED', 'DECLINED', 'ALL'],
|
|
42
|
+
},
|
|
43
|
+
author: {
|
|
44
|
+
type: 'string',
|
|
45
|
+
description: 'Filter by author username',
|
|
46
|
+
},
|
|
47
|
+
limit: {
|
|
48
|
+
type: 'number',
|
|
49
|
+
description: 'Maximum number of PRs to return (default: 25)',
|
|
50
|
+
},
|
|
51
|
+
start: {
|
|
52
|
+
type: 'number',
|
|
53
|
+
description: 'Start index for pagination (default: 0)',
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
required: ['workspace', 'repository'],
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
name: 'create_pull_request',
|
|
61
|
+
description: 'Create a new pull request',
|
|
62
|
+
inputSchema: {
|
|
63
|
+
type: 'object',
|
|
64
|
+
properties: {
|
|
65
|
+
workspace: {
|
|
66
|
+
type: 'string',
|
|
67
|
+
description: 'Bitbucket workspace/project key (e.g., "PROJ")',
|
|
68
|
+
},
|
|
69
|
+
repository: {
|
|
70
|
+
type: 'string',
|
|
71
|
+
description: 'Repository slug (e.g., "my-repo")',
|
|
72
|
+
},
|
|
73
|
+
title: {
|
|
74
|
+
type: 'string',
|
|
75
|
+
description: 'Title of the pull request',
|
|
76
|
+
},
|
|
77
|
+
source_branch: {
|
|
78
|
+
type: 'string',
|
|
79
|
+
description: 'Source branch name',
|
|
80
|
+
},
|
|
81
|
+
destination_branch: {
|
|
82
|
+
type: 'string',
|
|
83
|
+
description: 'Destination branch name (e.g., "main", "master")',
|
|
84
|
+
},
|
|
85
|
+
description: {
|
|
86
|
+
type: 'string',
|
|
87
|
+
description: 'Description of the pull request (optional)',
|
|
88
|
+
},
|
|
89
|
+
reviewers: {
|
|
90
|
+
type: 'array',
|
|
91
|
+
items: { type: 'string' },
|
|
92
|
+
description: 'Array of reviewer usernames/emails (optional)',
|
|
93
|
+
},
|
|
94
|
+
close_source_branch: {
|
|
95
|
+
type: 'boolean',
|
|
96
|
+
description: 'Whether to close source branch after merge (optional, default: false)',
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
required: ['workspace', 'repository', 'title', 'source_branch', 'destination_branch'],
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
name: 'update_pull_request',
|
|
104
|
+
description: 'Update an existing pull request. When updating without specifying reviewers, existing reviewers and their approval status will be preserved.',
|
|
105
|
+
inputSchema: {
|
|
106
|
+
type: 'object',
|
|
107
|
+
properties: {
|
|
108
|
+
workspace: {
|
|
109
|
+
type: 'string',
|
|
110
|
+
description: 'Bitbucket workspace/project key (e.g., "PROJ")',
|
|
111
|
+
},
|
|
112
|
+
repository: {
|
|
113
|
+
type: 'string',
|
|
114
|
+
description: 'Repository slug (e.g., "my-repo")',
|
|
115
|
+
},
|
|
116
|
+
pull_request_id: {
|
|
117
|
+
type: 'number',
|
|
118
|
+
description: 'Pull request ID',
|
|
119
|
+
},
|
|
120
|
+
title: {
|
|
121
|
+
type: 'string',
|
|
122
|
+
description: 'New title (optional)',
|
|
123
|
+
},
|
|
124
|
+
description: {
|
|
125
|
+
type: 'string',
|
|
126
|
+
description: 'New description (optional)',
|
|
127
|
+
},
|
|
128
|
+
destination_branch: {
|
|
129
|
+
type: 'string',
|
|
130
|
+
description: 'New destination branch (optional)',
|
|
131
|
+
},
|
|
132
|
+
reviewers: {
|
|
133
|
+
type: 'array',
|
|
134
|
+
items: { type: 'string' },
|
|
135
|
+
description: 'New list of reviewer usernames/emails. If provided, replaces the reviewer list (preserving approval status for existing reviewers). If omitted, existing reviewers are preserved. (optional)',
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
required: ['workspace', 'repository', 'pull_request_id'],
|
|
139
|
+
},
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
name: 'add_comment',
|
|
143
|
+
description: 'Add a comment to a pull request. Supports: 1) General PR comments, 2) Replies to existing comments, 3) Inline comments on specific code lines (using line_number OR code_snippet), 4) Code suggestions for single or multi-line replacements. For inline comments, you can either provide exact line_number or use code_snippet to auto-detect the line.',
|
|
144
|
+
inputSchema: {
|
|
145
|
+
type: 'object',
|
|
146
|
+
properties: {
|
|
147
|
+
workspace: {
|
|
148
|
+
type: 'string',
|
|
149
|
+
description: 'Bitbucket workspace/project key (e.g., "PROJ")',
|
|
150
|
+
},
|
|
151
|
+
repository: {
|
|
152
|
+
type: 'string',
|
|
153
|
+
description: 'Repository slug (e.g., "my-repo")',
|
|
154
|
+
},
|
|
155
|
+
pull_request_id: {
|
|
156
|
+
type: 'number',
|
|
157
|
+
description: 'Pull request ID',
|
|
158
|
+
},
|
|
159
|
+
comment_text: {
|
|
160
|
+
type: 'string',
|
|
161
|
+
description: 'The main comment text. For suggestions, this is the explanation before the code suggestion.',
|
|
162
|
+
},
|
|
163
|
+
parent_comment_id: {
|
|
164
|
+
type: 'number',
|
|
165
|
+
description: 'ID of comment to reply to. Use this to create threaded conversations (optional)',
|
|
166
|
+
},
|
|
167
|
+
file_path: {
|
|
168
|
+
type: 'string',
|
|
169
|
+
description: 'File path for inline comment. Required for inline comments. Example: "src/components/Button.js" (optional)',
|
|
170
|
+
},
|
|
171
|
+
line_number: {
|
|
172
|
+
type: 'number',
|
|
173
|
+
description: 'Exact line number in the file. Use this OR code_snippet, not both. Required with file_path unless using code_snippet (optional)',
|
|
174
|
+
},
|
|
175
|
+
line_type: {
|
|
176
|
+
type: 'string',
|
|
177
|
+
description: 'Type of line: ADDED (green/new lines), REMOVED (red/deleted lines), or CONTEXT (unchanged lines). Default: CONTEXT',
|
|
178
|
+
enum: ['ADDED', 'REMOVED', 'CONTEXT'],
|
|
179
|
+
},
|
|
180
|
+
suggestion: {
|
|
181
|
+
type: 'string',
|
|
182
|
+
description: 'Replacement code for a suggestion. Creates a suggestion block that can be applied in Bitbucket UI. Requires file_path and line_number. For multi-line, include newlines in the string (optional)',
|
|
183
|
+
},
|
|
184
|
+
suggestion_end_line: {
|
|
185
|
+
type: 'number',
|
|
186
|
+
description: 'For multi-line suggestions: the last line number to replace. If not provided, only replaces the single line at line_number (optional)',
|
|
187
|
+
},
|
|
188
|
+
code_snippet: {
|
|
189
|
+
type: 'string',
|
|
190
|
+
description: 'Exact code text from the diff to find and comment on. Use this instead of line_number for auto-detection. Must match exactly including whitespace (optional)',
|
|
191
|
+
},
|
|
192
|
+
search_context: {
|
|
193
|
+
type: 'object',
|
|
194
|
+
properties: {
|
|
195
|
+
before: {
|
|
196
|
+
type: 'array',
|
|
197
|
+
items: { type: 'string' },
|
|
198
|
+
description: 'Array of code lines that appear BEFORE the target line. Helps disambiguate when code_snippet appears multiple times',
|
|
199
|
+
},
|
|
200
|
+
after: {
|
|
201
|
+
type: 'array',
|
|
202
|
+
items: { type: 'string' },
|
|
203
|
+
description: 'Array of code lines that appear AFTER the target line. Helps disambiguate when code_snippet appears multiple times',
|
|
204
|
+
},
|
|
205
|
+
},
|
|
206
|
+
description: 'Additional context lines to help locate the exact position when using code_snippet. Useful when the same code appears multiple times (optional)',
|
|
207
|
+
},
|
|
208
|
+
match_strategy: {
|
|
209
|
+
type: 'string',
|
|
210
|
+
enum: ['strict', 'best'],
|
|
211
|
+
description: 'How to handle multiple matches when using code_snippet. "strict": fail with detailed error showing all matches. "best": automatically pick the highest confidence match. Default: "strict"',
|
|
212
|
+
},
|
|
213
|
+
},
|
|
214
|
+
required: ['workspace', 'repository', 'pull_request_id', 'comment_text'],
|
|
215
|
+
},
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
name: 'merge_pull_request',
|
|
219
|
+
description: 'Merge a pull request',
|
|
220
|
+
inputSchema: {
|
|
221
|
+
type: 'object',
|
|
222
|
+
properties: {
|
|
223
|
+
workspace: {
|
|
224
|
+
type: 'string',
|
|
225
|
+
description: 'Bitbucket workspace/project key (e.g., "PROJ")',
|
|
226
|
+
},
|
|
227
|
+
repository: {
|
|
228
|
+
type: 'string',
|
|
229
|
+
description: 'Repository slug (e.g., "my-repo")',
|
|
230
|
+
},
|
|
231
|
+
pull_request_id: {
|
|
232
|
+
type: 'number',
|
|
233
|
+
description: 'Pull request ID',
|
|
234
|
+
},
|
|
235
|
+
merge_strategy: {
|
|
236
|
+
type: 'string',
|
|
237
|
+
description: 'Merge strategy: merge-commit, squash, fast-forward (optional)',
|
|
238
|
+
enum: ['merge-commit', 'squash', 'fast-forward'],
|
|
239
|
+
},
|
|
240
|
+
close_source_branch: {
|
|
241
|
+
type: 'boolean',
|
|
242
|
+
description: 'Whether to close source branch after merge (optional)',
|
|
243
|
+
},
|
|
244
|
+
commit_message: {
|
|
245
|
+
type: 'string',
|
|
246
|
+
description: 'Custom merge commit message (optional)',
|
|
247
|
+
},
|
|
248
|
+
},
|
|
249
|
+
required: ['workspace', 'repository', 'pull_request_id'],
|
|
250
|
+
},
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
name: 'list_branches',
|
|
254
|
+
description: 'List branches in a repository',
|
|
255
|
+
inputSchema: {
|
|
256
|
+
type: 'object',
|
|
257
|
+
properties: {
|
|
258
|
+
workspace: {
|
|
259
|
+
type: 'string',
|
|
260
|
+
description: 'Bitbucket workspace/project key (e.g., "PROJ")',
|
|
261
|
+
},
|
|
262
|
+
repository: {
|
|
263
|
+
type: 'string',
|
|
264
|
+
description: 'Repository slug (e.g., "my-repo")',
|
|
265
|
+
},
|
|
266
|
+
filter: {
|
|
267
|
+
type: 'string',
|
|
268
|
+
description: 'Filter branches by name pattern (optional)',
|
|
269
|
+
},
|
|
270
|
+
limit: {
|
|
271
|
+
type: 'number',
|
|
272
|
+
description: 'Maximum number of branches to return (default: 25)',
|
|
273
|
+
},
|
|
274
|
+
start: {
|
|
275
|
+
type: 'number',
|
|
276
|
+
description: 'Start index for pagination (default: 0)',
|
|
277
|
+
},
|
|
278
|
+
},
|
|
279
|
+
required: ['workspace', 'repository'],
|
|
280
|
+
},
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
name: 'delete_branch',
|
|
284
|
+
description: 'Delete a branch',
|
|
285
|
+
inputSchema: {
|
|
286
|
+
type: 'object',
|
|
287
|
+
properties: {
|
|
288
|
+
workspace: {
|
|
289
|
+
type: 'string',
|
|
290
|
+
description: 'Bitbucket workspace/project key (e.g., "PROJ")',
|
|
291
|
+
},
|
|
292
|
+
repository: {
|
|
293
|
+
type: 'string',
|
|
294
|
+
description: 'Repository slug (e.g., "my-repo")',
|
|
295
|
+
},
|
|
296
|
+
branch_name: {
|
|
297
|
+
type: 'string',
|
|
298
|
+
description: 'Branch name to delete',
|
|
299
|
+
},
|
|
300
|
+
force: {
|
|
301
|
+
type: 'boolean',
|
|
302
|
+
description: 'Force delete even if branch is not merged (optional, default: false)',
|
|
303
|
+
},
|
|
304
|
+
},
|
|
305
|
+
required: ['workspace', 'repository', 'branch_name'],
|
|
306
|
+
},
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
name: 'get_pull_request_diff',
|
|
310
|
+
description: 'Get the diff/changes for a pull request with optional filtering',
|
|
311
|
+
inputSchema: {
|
|
312
|
+
type: 'object',
|
|
313
|
+
properties: {
|
|
314
|
+
workspace: {
|
|
315
|
+
type: 'string',
|
|
316
|
+
description: 'Bitbucket workspace/project key (e.g., "PROJ")',
|
|
317
|
+
},
|
|
318
|
+
repository: {
|
|
319
|
+
type: 'string',
|
|
320
|
+
description: 'Repository slug (e.g., "my-repo")',
|
|
321
|
+
},
|
|
322
|
+
pull_request_id: {
|
|
323
|
+
type: 'number',
|
|
324
|
+
description: 'Pull request ID',
|
|
325
|
+
},
|
|
326
|
+
context_lines: {
|
|
327
|
+
type: 'number',
|
|
328
|
+
description: 'Number of context lines around changes (optional, default: 3)',
|
|
329
|
+
},
|
|
330
|
+
include_patterns: {
|
|
331
|
+
type: 'array',
|
|
332
|
+
items: { type: 'string' },
|
|
333
|
+
description: 'Array of glob patterns to include (e.g., ["*.res", "src/**/*.js"]) (optional)',
|
|
334
|
+
},
|
|
335
|
+
exclude_patterns: {
|
|
336
|
+
type: 'array',
|
|
337
|
+
items: { type: 'string' },
|
|
338
|
+
description: 'Array of glob patterns to exclude (e.g., ["*.lock", "*.svg"]) (optional)',
|
|
339
|
+
},
|
|
340
|
+
file_path: {
|
|
341
|
+
type: 'string',
|
|
342
|
+
description: 'Specific file path to get diff for (e.g., "src/index.ts") (optional)',
|
|
343
|
+
},
|
|
344
|
+
},
|
|
345
|
+
required: ['workspace', 'repository', 'pull_request_id'],
|
|
346
|
+
},
|
|
347
|
+
},
|
|
348
|
+
{
|
|
349
|
+
name: 'approve_pull_request',
|
|
350
|
+
description: 'Approve a pull request',
|
|
351
|
+
inputSchema: {
|
|
352
|
+
type: 'object',
|
|
353
|
+
properties: {
|
|
354
|
+
workspace: {
|
|
355
|
+
type: 'string',
|
|
356
|
+
description: 'Bitbucket workspace/project key (e.g., "PROJ")',
|
|
357
|
+
},
|
|
358
|
+
repository: {
|
|
359
|
+
type: 'string',
|
|
360
|
+
description: 'Repository slug (e.g., "my-repo")',
|
|
361
|
+
},
|
|
362
|
+
pull_request_id: {
|
|
363
|
+
type: 'number',
|
|
364
|
+
description: 'Pull request ID',
|
|
365
|
+
},
|
|
366
|
+
},
|
|
367
|
+
required: ['workspace', 'repository', 'pull_request_id'],
|
|
368
|
+
},
|
|
369
|
+
},
|
|
370
|
+
{
|
|
371
|
+
name: 'unapprove_pull_request',
|
|
372
|
+
description: 'Remove approval from a pull request',
|
|
373
|
+
inputSchema: {
|
|
374
|
+
type: 'object',
|
|
375
|
+
properties: {
|
|
376
|
+
workspace: {
|
|
377
|
+
type: 'string',
|
|
378
|
+
description: 'Bitbucket workspace/project key (e.g., "PROJ")',
|
|
379
|
+
},
|
|
380
|
+
repository: {
|
|
381
|
+
type: 'string',
|
|
382
|
+
description: 'Repository slug (e.g., "my-repo")',
|
|
383
|
+
},
|
|
384
|
+
pull_request_id: {
|
|
385
|
+
type: 'number',
|
|
386
|
+
description: 'Pull request ID',
|
|
387
|
+
},
|
|
388
|
+
},
|
|
389
|
+
required: ['workspace', 'repository', 'pull_request_id'],
|
|
390
|
+
},
|
|
391
|
+
},
|
|
392
|
+
{
|
|
393
|
+
name: 'request_changes',
|
|
394
|
+
description: 'Request changes on a pull request',
|
|
395
|
+
inputSchema: {
|
|
396
|
+
type: 'object',
|
|
397
|
+
properties: {
|
|
398
|
+
workspace: {
|
|
399
|
+
type: 'string',
|
|
400
|
+
description: 'Bitbucket workspace/project key (e.g., "PROJ")',
|
|
401
|
+
},
|
|
402
|
+
repository: {
|
|
403
|
+
type: 'string',
|
|
404
|
+
description: 'Repository slug (e.g., "my-repo")',
|
|
405
|
+
},
|
|
406
|
+
pull_request_id: {
|
|
407
|
+
type: 'number',
|
|
408
|
+
description: 'Pull request ID',
|
|
409
|
+
},
|
|
410
|
+
comment: {
|
|
411
|
+
type: 'string',
|
|
412
|
+
description: 'Comment explaining requested changes (optional)',
|
|
413
|
+
},
|
|
414
|
+
},
|
|
415
|
+
required: ['workspace', 'repository', 'pull_request_id'],
|
|
416
|
+
},
|
|
417
|
+
},
|
|
418
|
+
{
|
|
419
|
+
name: 'remove_requested_changes',
|
|
420
|
+
description: 'Remove change request from a pull request',
|
|
421
|
+
inputSchema: {
|
|
422
|
+
type: 'object',
|
|
423
|
+
properties: {
|
|
424
|
+
workspace: {
|
|
425
|
+
type: 'string',
|
|
426
|
+
description: 'Bitbucket workspace/project key (e.g., "PROJ")',
|
|
427
|
+
},
|
|
428
|
+
repository: {
|
|
429
|
+
type: 'string',
|
|
430
|
+
description: 'Repository slug (e.g., "my-repo")',
|
|
431
|
+
},
|
|
432
|
+
pull_request_id: {
|
|
433
|
+
type: 'number',
|
|
434
|
+
description: 'Pull request ID',
|
|
435
|
+
},
|
|
436
|
+
},
|
|
437
|
+
required: ['workspace', 'repository', 'pull_request_id'],
|
|
438
|
+
},
|
|
439
|
+
},
|
|
440
|
+
{
|
|
441
|
+
name: 'get_branch',
|
|
442
|
+
description: 'Get detailed information about a branch including associated pull requests',
|
|
443
|
+
inputSchema: {
|
|
444
|
+
type: 'object',
|
|
445
|
+
properties: {
|
|
446
|
+
workspace: {
|
|
447
|
+
type: 'string',
|
|
448
|
+
description: 'Bitbucket workspace/project key (e.g., "PROJ")',
|
|
449
|
+
},
|
|
450
|
+
repository: {
|
|
451
|
+
type: 'string',
|
|
452
|
+
description: 'Repository slug (e.g., "my-repo")',
|
|
453
|
+
},
|
|
454
|
+
branch_name: {
|
|
455
|
+
type: 'string',
|
|
456
|
+
description: 'Branch name to get details for',
|
|
457
|
+
},
|
|
458
|
+
include_merged_prs: {
|
|
459
|
+
type: 'boolean',
|
|
460
|
+
description: 'Include merged PRs from this branch (default: false)',
|
|
461
|
+
},
|
|
462
|
+
},
|
|
463
|
+
required: ['workspace', 'repository', 'branch_name'],
|
|
464
|
+
},
|
|
465
|
+
},
|
|
466
|
+
{
|
|
467
|
+
name: 'list_directory_content',
|
|
468
|
+
description: 'List files and directories in a repository path',
|
|
469
|
+
inputSchema: {
|
|
470
|
+
type: 'object',
|
|
471
|
+
properties: {
|
|
472
|
+
workspace: {
|
|
473
|
+
type: 'string',
|
|
474
|
+
description: 'Bitbucket workspace/project key (e.g., "PROJ")',
|
|
475
|
+
},
|
|
476
|
+
repository: {
|
|
477
|
+
type: 'string',
|
|
478
|
+
description: 'Repository slug (e.g., "my-repo")',
|
|
479
|
+
},
|
|
480
|
+
path: {
|
|
481
|
+
type: 'string',
|
|
482
|
+
description: 'Directory path (optional, defaults to root, e.g., "src/components")',
|
|
483
|
+
},
|
|
484
|
+
branch: {
|
|
485
|
+
type: 'string',
|
|
486
|
+
description: 'Branch name (optional, defaults to default branch)',
|
|
487
|
+
},
|
|
488
|
+
},
|
|
489
|
+
required: ['workspace', 'repository'],
|
|
490
|
+
},
|
|
491
|
+
},
|
|
492
|
+
{
|
|
493
|
+
name: 'get_file_content',
|
|
494
|
+
description: 'Get file content from a repository with smart truncation for large files',
|
|
495
|
+
inputSchema: {
|
|
496
|
+
type: 'object',
|
|
497
|
+
properties: {
|
|
498
|
+
workspace: {
|
|
499
|
+
type: 'string',
|
|
500
|
+
description: 'Bitbucket workspace/project key (e.g., "PROJ")',
|
|
501
|
+
},
|
|
502
|
+
repository: {
|
|
503
|
+
type: 'string',
|
|
504
|
+
description: 'Repository slug (e.g., "my-repo")',
|
|
505
|
+
},
|
|
506
|
+
file_path: {
|
|
507
|
+
type: 'string',
|
|
508
|
+
description: 'Path to the file (e.g., "src/index.ts")',
|
|
509
|
+
},
|
|
510
|
+
branch: {
|
|
511
|
+
type: 'string',
|
|
512
|
+
description: 'Branch name (optional, defaults to default branch)',
|
|
513
|
+
},
|
|
514
|
+
start_line: {
|
|
515
|
+
type: 'number',
|
|
516
|
+
description: 'Starting line number (1-based). Use negative for lines from end (optional)',
|
|
517
|
+
},
|
|
518
|
+
line_count: {
|
|
519
|
+
type: 'number',
|
|
520
|
+
description: 'Number of lines to return (optional, default varies by file size)',
|
|
521
|
+
},
|
|
522
|
+
full_content: {
|
|
523
|
+
type: 'boolean',
|
|
524
|
+
description: 'Force return full content regardless of size (optional, default: false)',
|
|
525
|
+
},
|
|
526
|
+
},
|
|
527
|
+
required: ['workspace', 'repository', 'file_path'],
|
|
528
|
+
},
|
|
529
|
+
},
|
|
530
|
+
{
|
|
531
|
+
name: 'list_branch_commits',
|
|
532
|
+
description: 'List commits in a branch with detailed information and filtering options',
|
|
533
|
+
inputSchema: {
|
|
534
|
+
type: 'object',
|
|
535
|
+
properties: {
|
|
536
|
+
workspace: {
|
|
537
|
+
type: 'string',
|
|
538
|
+
description: 'Bitbucket workspace/project key (e.g., "PROJ")',
|
|
539
|
+
},
|
|
540
|
+
repository: {
|
|
541
|
+
type: 'string',
|
|
542
|
+
description: 'Repository slug (e.g., "my-repo")',
|
|
543
|
+
},
|
|
544
|
+
branch_name: {
|
|
545
|
+
type: 'string',
|
|
546
|
+
description: 'Branch name to get commits from',
|
|
547
|
+
},
|
|
548
|
+
limit: {
|
|
549
|
+
type: 'number',
|
|
550
|
+
description: 'Maximum number of commits to return (default: 25)',
|
|
551
|
+
},
|
|
552
|
+
start: {
|
|
553
|
+
type: 'number',
|
|
554
|
+
description: 'Start index for pagination (default: 0)',
|
|
555
|
+
},
|
|
556
|
+
since: {
|
|
557
|
+
type: 'string',
|
|
558
|
+
description: 'ISO date string - only show commits after this date (optional)',
|
|
559
|
+
},
|
|
560
|
+
until: {
|
|
561
|
+
type: 'string',
|
|
562
|
+
description: 'ISO date string - only show commits before this date (optional)',
|
|
563
|
+
},
|
|
564
|
+
author: {
|
|
565
|
+
type: 'string',
|
|
566
|
+
description: 'Filter by author email/username (optional)',
|
|
567
|
+
},
|
|
568
|
+
include_merge_commits: {
|
|
569
|
+
type: 'boolean',
|
|
570
|
+
description: 'Include merge commits in results (default: true)',
|
|
571
|
+
},
|
|
572
|
+
search: {
|
|
573
|
+
type: 'string',
|
|
574
|
+
description: 'Search for text in commit messages (optional)',
|
|
575
|
+
},
|
|
576
|
+
},
|
|
577
|
+
required: ['workspace', 'repository', 'branch_name'],
|
|
578
|
+
},
|
|
579
|
+
},
|
|
580
|
+
{
|
|
581
|
+
name: 'list_pr_commits',
|
|
582
|
+
description: 'List all commits that are part of a pull request',
|
|
583
|
+
inputSchema: {
|
|
584
|
+
type: 'object',
|
|
585
|
+
properties: {
|
|
586
|
+
workspace: {
|
|
587
|
+
type: 'string',
|
|
588
|
+
description: 'Bitbucket workspace/project key (e.g., "PROJ")',
|
|
589
|
+
},
|
|
590
|
+
repository: {
|
|
591
|
+
type: 'string',
|
|
592
|
+
description: 'Repository slug (e.g., "my-repo")',
|
|
593
|
+
},
|
|
594
|
+
pull_request_id: {
|
|
595
|
+
type: 'number',
|
|
596
|
+
description: 'Pull request ID',
|
|
597
|
+
},
|
|
598
|
+
limit: {
|
|
599
|
+
type: 'number',
|
|
600
|
+
description: 'Maximum number of commits to return (default: 25)',
|
|
601
|
+
},
|
|
602
|
+
start: {
|
|
603
|
+
type: 'number',
|
|
604
|
+
description: 'Start index for pagination (default: 0)',
|
|
605
|
+
},
|
|
606
|
+
},
|
|
607
|
+
required: ['workspace', 'repository', 'pull_request_id'],
|
|
608
|
+
},
|
|
609
|
+
},
|
|
610
|
+
{
|
|
611
|
+
name: 'search_code',
|
|
612
|
+
description: 'Search for code across Bitbucket repositories with enhanced context-aware search patterns (currently only supported for Bitbucket Server)',
|
|
613
|
+
inputSchema: {
|
|
614
|
+
type: 'object',
|
|
615
|
+
properties: {
|
|
616
|
+
workspace: {
|
|
617
|
+
type: 'string',
|
|
618
|
+
description: 'Bitbucket workspace/project key (e.g., "PROJ")',
|
|
619
|
+
},
|
|
620
|
+
repository: {
|
|
621
|
+
type: 'string',
|
|
622
|
+
description: 'Repository slug to search in (optional, searches all repos if not specified)',
|
|
623
|
+
},
|
|
624
|
+
search_query: {
|
|
625
|
+
type: 'string',
|
|
626
|
+
description: 'The search term or phrase to look for in code (e.g., "variable")',
|
|
627
|
+
},
|
|
628
|
+
search_context: {
|
|
629
|
+
type: 'string',
|
|
630
|
+
enum: ['assignment', 'declaration', 'usage', 'exact', 'any'],
|
|
631
|
+
description: 'Context to search for: assignment (term=value), declaration (defining term), usage (calling/accessing term), exact (quoted match), or any (all patterns)',
|
|
632
|
+
},
|
|
633
|
+
file_pattern: {
|
|
634
|
+
type: 'string',
|
|
635
|
+
description: 'File path pattern to filter results (e.g., "*.java", "src/**/*.ts") (optional)',
|
|
636
|
+
},
|
|
637
|
+
include_patterns: {
|
|
638
|
+
type: 'array',
|
|
639
|
+
items: { type: 'string' },
|
|
640
|
+
description: 'Additional custom search patterns to include (e.g., ["variable =", ".variable"]) (optional)',
|
|
641
|
+
},
|
|
642
|
+
limit: {
|
|
643
|
+
type: 'number',
|
|
644
|
+
description: 'Maximum number of results to return (default: 25)',
|
|
645
|
+
},
|
|
646
|
+
start: {
|
|
647
|
+
type: 'number',
|
|
648
|
+
description: 'Start index for pagination (default: 0)',
|
|
649
|
+
},
|
|
650
|
+
},
|
|
651
|
+
required: ['workspace', 'search_query'],
|
|
652
|
+
},
|
|
653
|
+
},
|
|
654
|
+
];
|
|
655
|
+
//# sourceMappingURL=definitions.js.map
|